Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
541a1a0e0a | ||
|
|
ce2f7042da | ||
|
|
ca3438b640 | ||
|
|
5121c3d45b | ||
|
|
666b241a53 | ||
|
|
b961bdf9d3 | ||
|
|
8aa1d58b76 | ||
|
|
570723bb59 | ||
|
|
7027929e30 |
28
CHANGELOG.md
@@ -1,3 +1,31 @@
|
||||
## [2.92.2](https://github.com/revanced/revanced-patches/compare/v2.92.1...v2.92.2) (2022-10-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/theme:** theme missing gray color ([#873](https://github.com/revanced/revanced-patches/issues/873)) ([5267d56](https://github.com/revanced/revanced-patches/commit/5267d56a05b4053d556171ffd2d2870f3f932e8e))
|
||||
|
||||
## [2.92.1](https://github.com/revanced/revanced-patches/compare/v2.92.0...v2.92.1) (2022-10-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/custom-branding:** use proper scaled icons ([24b5bcd](https://github.com/revanced/revanced-patches/commit/24b5bcdd703474c940fd436a37f0ae924d8b8c74))
|
||||
|
||||
# [2.92.0](https://github.com/revanced/revanced-patches/compare/v2.91.0...v2.92.0) (2022-10-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/hide-mix-playlists:** hide in video suggestions ([#854](https://github.com/revanced/revanced-patches/issues/854)) ([acde5f0](https://github.com/revanced/revanced-patches/commit/acde5f066053ca3d58ca09fc2a6a1381ba27d84b))
|
||||
|
||||
# [2.91.0](https://github.com/revanced/revanced-patches/compare/v2.90.0...v2.91.0) (2022-10-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* remove partially complete patch ([d212e19](https://github.com/revanced/revanced-patches/commit/d212e19c3276c2ba6550f03dfd9bba47b7773524))
|
||||
|
||||
# [2.90.0](https://github.com/revanced/revanced-patches/compare/v2.89.0...v2.90.0) (2022-10-25)
|
||||
|
||||
|
||||
|
||||
10
README.md
@@ -4,14 +4,6 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
|
||||
> Looking for the JSON variant of this? [Click here](patches.json).
|
||||
|
||||
### 📦 `com.metanav`
|
||||
<details>
|
||||
|
||||
| 💊 Patch | 📜 Description | 🏹 Target Version |
|
||||
|:--------:|:--------------:|:-----------------:|
|
||||
| `fix-scaling` | Scales the content properly. | 0.1.0 |
|
||||
</details>
|
||||
|
||||
### 📦 `com.ss.android.ugc.trill`
|
||||
<details>
|
||||
|
||||
@@ -95,7 +87,7 @@ The official Patch bundle provided by ReVanced and the community.
|
||||
| `hide-email-address` | Hides the email address in the account switcher. | 17.36.37 |
|
||||
| `tablet-mini-player` | Enables the tablet mini player layout. | 17.36.37 |
|
||||
| `hide-watermark` | Hides creator's watermarks on videos. | 17.36.37 |
|
||||
| `hide-my-mix` | Removes mix playlists from the feed. | 17.40.41 |
|
||||
| `hide-my-mix` | Hides mix playlists. | 17.40.41 |
|
||||
| `custom-branding` | Changes the YouTube launcher icon and name to your choice (defaults to ReVanced). | all |
|
||||
| `premium-heading` | Shows premium branding on the home screen. | all |
|
||||
| `old-quality-layout` | Enables the original quality flyout menu. | 17.36.37 |
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
kotlin.code.style = official
|
||||
version = 2.90.0
|
||||
version = 2.92.2
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package app.revanced.patches.metanav.scaling.annotations
|
||||
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility([Package("com.metanav", arrayOf("0.1.0"))])
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class FixScalingCompatibility
|
||||
@@ -1,32 +0,0 @@
|
||||
package app.revanced.patches.metanav.scaling.patch
|
||||
|
||||
import app.revanced.patcher.annotation.Description
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.metanav.scaling.annotations.FixScalingCompatibility
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Patch
|
||||
@Name("fix-scaling")
|
||||
@Description("Scales the content properly.")
|
||||
@FixScalingCompatibility
|
||||
@Version("0.0.1")
|
||||
class FixScalingPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
context.xmlEditor["assets/startScreenCanvas.html"].use { editor ->
|
||||
val svgNode = editor
|
||||
.file
|
||||
.getElementsByTagName("svg")
|
||||
.item(0) as Element
|
||||
|
||||
svgNode.setAttribute("height", "750")
|
||||
}
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,9 @@ import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility
|
||||
import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch
|
||||
import app.revanced.util.resources.ResourceUtils
|
||||
import app.revanced.util.resources.ResourceUtils.copyResources
|
||||
import java.io.File
|
||||
import java.io.FileInputStream
|
||||
import java.io.InputStream
|
||||
import java.nio.file.Files
|
||||
|
||||
@Patch
|
||||
@@ -22,36 +22,43 @@ import java.nio.file.Files
|
||||
@Version("0.0.1")
|
||||
class CustomBrandingPatch : ResourcePatch {
|
||||
override fun execute(context: ResourceContext): PatchResult {
|
||||
val resDirectory = context["res"]
|
||||
if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.")
|
||||
fun copyResources(resourceGroups: List<ResourceUtils.ResourceGroup>) {
|
||||
iconPath?.let { iconPathString ->
|
||||
val iconPath = File(iconPathString)
|
||||
val resourceDirectory = context["res"]
|
||||
|
||||
// Icon branding
|
||||
val iconNames = arrayOf(
|
||||
resourceGroups.forEach { group ->
|
||||
val fromDirectory = iconPath.resolve(group.resourceDirectoryName)
|
||||
val toDirectory = resourceDirectory.resolve(group.resourceDirectoryName)
|
||||
|
||||
group.resources.forEach { iconFileName ->
|
||||
Files.write(
|
||||
toDirectory.resolve(iconFileName).toPath(),
|
||||
fromDirectory.resolve(iconFileName).readBytes()
|
||||
)
|
||||
}
|
||||
}
|
||||
} ?: resourceGroups.forEach { context.copyResources("branding", it) }
|
||||
}
|
||||
|
||||
val iconResourceFileNames = arrayOf(
|
||||
"adaptiveproduct_youtube_background_color_108",
|
||||
"adaptiveproduct_youtube_foreground_color_108",
|
||||
"ic_launcher",
|
||||
"ic_launcher_round"
|
||||
).map { "$it.png" }.toTypedArray()
|
||||
|
||||
fun createGroup(directory: String) = ResourceUtils.ResourceGroup(
|
||||
directory, *iconResourceFileNames
|
||||
)
|
||||
|
||||
mapOf(
|
||||
"xxxhdpi" to 192,
|
||||
"xxhdpi" to 144,
|
||||
"xhdpi" to 96,
|
||||
"hdpi" to 72,
|
||||
"mdpi" to 48
|
||||
).forEach { (iconDirectory, size) ->
|
||||
iconNames.forEach { iconName ->
|
||||
val iconFile = getIconStream("branding/$size/$iconName.png")
|
||||
?: return PatchResultError("The icon $iconName can not be found.")
|
||||
// change the app icon
|
||||
arrayOf("xxxhdpi", "xxhdpi", "xhdpi", "hdpi", "mdpi")
|
||||
.map { "mipmap-$it" }
|
||||
.map(::createGroup)
|
||||
.let(::copyResources)
|
||||
|
||||
Files.write(
|
||||
resDirectory.resolve("mipmap-$iconDirectory").resolve("$iconName.png").toPath(),
|
||||
iconFile.readBytes()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Name branding
|
||||
// change the name of the app
|
||||
val manifest = context["AndroidManifest.xml"]
|
||||
manifest.writeText(
|
||||
manifest.readText()
|
||||
@@ -64,15 +71,6 @@ class CustomBrandingPatch : ResourcePatch {
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun getIconStream(iconPath: String): InputStream? {
|
||||
if (appIconPath == null) {
|
||||
return this.javaClass.classLoader.getResourceAsStream(iconPath)
|
||||
}
|
||||
val file = File(appIconPath!!).resolve(iconPath)
|
||||
if (!file.exists()) return null
|
||||
return FileInputStream(file)
|
||||
}
|
||||
|
||||
companion object : OptionsContainer() {
|
||||
private var appName: String? by option(
|
||||
PatchOption.StringOption(
|
||||
@@ -84,12 +82,12 @@ class CustomBrandingPatch : ResourcePatch {
|
||||
)
|
||||
)
|
||||
|
||||
private var appIconPath: String? by option(
|
||||
private var iconPath: String? by option(
|
||||
PatchOption.StringOption(
|
||||
key = "appIconPath",
|
||||
key = "iconPath",
|
||||
default = null,
|
||||
title = "Application Icon Path",
|
||||
description = "A path to the icon of the application."
|
||||
title = "App Icon Path",
|
||||
description = "A path containing mipmap resource folders with icons."
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ import app.revanced.patches.youtube.layout.hidemixplaylists.annotations.MixPlayl
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("mix-playlists-fingerprint")
|
||||
@Name("create-mix-playlist-fingerprint")
|
||||
@MixPlaylistsPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
object MixPlaylistsPatchFingerprint : MethodFingerprint(
|
||||
object CreateMixPlaylistFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
@@ -26,6 +26,5 @@ object MixPlaylistsPatchFingerprint : MethodFingerprint(
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
@@ -0,0 +1,30 @@
|
||||
package app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints
|
||||
|
||||
import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.annotations.MixPlaylistsPatchCompatibility
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("second-create-mix-playlist-fingerprint")
|
||||
@MixPlaylistsPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
object SecondCreateMixPlaylistFingerprint : MethodFingerprint(
|
||||
"V", AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, listOf("L", "L", "L", "L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.NEW_INSTANCE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.RETURN_VOID
|
||||
)
|
||||
)
|
||||
@@ -5,13 +5,16 @@ import app.revanced.patcher.annotation.Name
|
||||
import app.revanced.patcher.annotation.Version
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.addInstruction
|
||||
import app.revanced.patcher.extensions.instruction
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.patch.PatchResult
|
||||
import app.revanced.patcher.patch.PatchResultSuccess
|
||||
import app.revanced.patcher.patch.annotations.DependsOn
|
||||
import app.revanced.patcher.patch.annotations.Patch
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.annotations.MixPlaylistsPatchCompatibility
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints.MixPlaylistsPatchFingerprint
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints.CreateMixPlaylistFingerprint
|
||||
import app.revanced.patches.youtube.layout.hidemixplaylists.fingerprints.SecondCreateMixPlaylistFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.bytecode.patch.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.framework.components.impl.StringResource
|
||||
@@ -21,12 +24,12 @@ import org.jf.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@Patch
|
||||
@DependsOn([IntegrationsPatch::class])
|
||||
@Name("hide-my-mix")
|
||||
@Description("Removes mix playlists from the feed.")
|
||||
@Description("Hides mix playlists.")
|
||||
@MixPlaylistsPatchCompatibility
|
||||
@Version("0.0.1")
|
||||
class MixPlaylistsPatch : BytecodePatch(
|
||||
listOf(
|
||||
MixPlaylistsPatchFingerprint
|
||||
CreateMixPlaylistFingerprint, SecondCreateMixPlaylistFingerprint
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext): PatchResult {
|
||||
@@ -40,16 +43,22 @@ class MixPlaylistsPatch : BytecodePatch(
|
||||
)
|
||||
)
|
||||
|
||||
val result = MixPlaylistsPatchFingerprint.result!!
|
||||
val method = result.mutableMethod
|
||||
val index = result.scanResult.patternScanResult!!.endIndex - 6
|
||||
val register = (method.implementation!!.instructions[index] as OneRegisterInstruction).registerA
|
||||
|
||||
method.addInstruction(
|
||||
index + 2,
|
||||
"invoke-static {v$register}, Lapp/revanced/integrations/patches/HideMixPlaylistsPatch;->hideMixPlaylists(Landroid/view/View;)V"
|
||||
)
|
||||
arrayOf(CreateMixPlaylistFingerprint, SecondCreateMixPlaylistFingerprint).forEach(::addHook)
|
||||
|
||||
return PatchResultSuccess()
|
||||
}
|
||||
|
||||
private fun addHook(fingerprint: MethodFingerprint) {
|
||||
with (fingerprint.result!!) {
|
||||
val insertIndex = scanResult.patternScanResult!!.endIndex - 3
|
||||
|
||||
val register = (mutableMethod.instruction(insertIndex - 2) as OneRegisterInstruction).registerA
|
||||
|
||||
mutableMethod.addInstruction(
|
||||
insertIndex,
|
||||
"invoke-static {v$register}, Lapp/revanced/integrations/patches/HideMixPlaylistsPatch;->hideMixPlaylists(Landroid/view/View;)V"
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,13 +31,13 @@ class ThemePatch : ResourcePatch {
|
||||
val node = resourcesNode.childNodes.item(i) as? Element ?: continue
|
||||
|
||||
node.textContent = when (node.getAttribute("name")) {
|
||||
"yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3", "yt_black4",
|
||||
"yt_status_bar_background_dark", "material_grey_100", "material_grey_50", "material_grey_600",
|
||||
"material_grey_800", "material_grey_850", "material_grey_900", "material_grey_white_1000",
|
||||
"sud_glif_v3_dialog_background_color_dark" -> darkThemeBackgroundColor
|
||||
"yt_black0", "yt_black1", "yt_black1_opacity95", "yt_black1_opacity98", "yt_black2", "yt_black3",
|
||||
"yt_black4", "yt_status_bar_background_dark", "material_grey_100", "material_grey_50",
|
||||
"material_grey_600", "material_grey_800", "material_grey_850", "material_grey_900",
|
||||
"material_grey_white_1000", "sud_glif_v3_dialog_background_color_dark" -> darkThemeBackgroundColor
|
||||
|
||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3",
|
||||
"yt_white4", "sud_glif_v3_dialog_background_color_light" -> lightThemeBackgroundColor
|
||||
"yt_white1", "yt_white1_opacity95", "yt_white1_opacity98", "yt_white2", "yt_white3", "yt_white4",
|
||||
"sud_glif_v3_dialog_background_color_light" -> lightThemeBackgroundColor
|
||||
|
||||
else -> continue
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 5.0 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 8.1 KiB |
|
Before Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.6 KiB |
|
Before Width: | Height: | Size: 276 B After Width: | Height: | Size: 276 B |
|
After Width: | Height: | Size: 1.5 KiB |
BIN
src/main/resources/branding/mipmap-hdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
src/main/resources/branding/mipmap-hdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 191 B |
|
After Width: | Height: | Size: 1.1 KiB |
BIN
src/main/resources/branding/mipmap-mdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
src/main/resources/branding/mipmap-mdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 343 B |
|
After Width: | Height: | Size: 2.1 KiB |
BIN
src/main/resources/branding/mipmap-xhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
src/main/resources/branding/mipmap-xhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 483 B After Width: | Height: | Size: 483 B |
|
After Width: | Height: | Size: 2.8 KiB |
BIN
src/main/resources/branding/mipmap-xxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
BIN
src/main/resources/branding/mipmap-xxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 163 B After Width: | Height: | Size: 163 B |
|
After Width: | Height: | Size: 3.4 KiB |
BIN
src/main/resources/branding/mipmap-xxxhdpi/ic_launcher.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
src/main/resources/branding/mipmap-xxxhdpi/ic_launcher_round.png
Normal file
|
After Width: | Height: | Size: 11 KiB |