From 01c0f1bd1ac6edb8aea758f88ffffcdea74a29b7 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 20 Sep 2025 20:09:52 +0400 Subject: [PATCH] feat(YouTube Music): Support version `8.10.52` (#5941) --- .../music/patches/HideUpgradeButtonPatch.java | 14 --- .../extension/music/settings/Settings.java | 1 - .../patches/music/ad/video/HideVideoAds.kt | 3 +- .../EnableExclusiveAudioPlayback.kt | 3 +- .../permanentrepeat/PermanentRepeatPatch.kt | 3 +- .../permanentshuffle/PermanentShufflePatch.kt | 3 +- .../music/layout/castbutton/HideCastButton.kt | 3 +- .../layout/compactheader/HideCategoryBar.kt | 5 +- .../navigationbar/NavigationBarPatch.kt | 3 +- .../layout/premium/HideGetPremiumPatch.kt | 3 +- .../layout/upgradebutton/Fingerprints.kt | 18 ---- .../upgradebutton/HideUpgradeButtonPatch.kt | 100 +----------------- .../BypassCertificateChecksPatch.kt | 3 +- .../BackgroundPlaybackPatch.kt | 3 +- .../misc/spoof/SpoofVideoStreamsPatch.kt | 3 +- 15 files changed, 26 insertions(+), 142 deletions(-) delete mode 100644 extensions/music/src/main/java/app/revanced/extension/music/patches/HideUpgradeButtonPatch.java delete mode 100644 patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/Fingerprints.kt diff --git a/extensions/music/src/main/java/app/revanced/extension/music/patches/HideUpgradeButtonPatch.java b/extensions/music/src/main/java/app/revanced/extension/music/patches/HideUpgradeButtonPatch.java deleted file mode 100644 index 8d3e022b1..000000000 --- a/extensions/music/src/main/java/app/revanced/extension/music/patches/HideUpgradeButtonPatch.java +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.extension.music.patches; - -import app.revanced.extension.music.settings.Settings; - -@SuppressWarnings("unused") -public class HideUpgradeButtonPatch { - - /** - * Injection point - */ - public static boolean hideUpgradeButton() { - return Settings.HIDE_UPGRADE_BUTTON.get(); - } -} diff --git a/extensions/music/src/main/java/app/revanced/extension/music/settings/Settings.java b/extensions/music/src/main/java/app/revanced/extension/music/settings/Settings.java index 431ec7de0..832118829 100644 --- a/extensions/music/src/main/java/app/revanced/extension/music/settings/Settings.java +++ b/extensions/music/src/main/java/app/revanced/extension/music/settings/Settings.java @@ -15,7 +15,6 @@ public class Settings extends BaseSettings { // Ads public static final BooleanSetting HIDE_VIDEO_ADS = new BooleanSetting("revanced_music_hide_video_ads", TRUE, true); public static final BooleanSetting HIDE_GET_PREMIUM_LABEL = new BooleanSetting("revanced_music_hide_get_premium_label", TRUE, true); - public static final BooleanSetting HIDE_UPGRADE_BUTTON = new BooleanSetting("revanced_music_hide_upgrade_button", TRUE, true); // General public static final BooleanSetting HIDE_CAST_BUTTON = new BooleanSetting("revanced_music_hide_cast_button", TRUE, false); diff --git a/patches/src/main/kotlin/app/revanced/patches/music/ad/video/HideVideoAds.kt b/patches/src/main/kotlin/app/revanced/patches/music/ad/video/HideVideoAds.kt index fd417bb5d..cd5150c16 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/ad/video/HideVideoAds.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/ad/video/HideVideoAds.kt @@ -24,7 +24,8 @@ val hideVideoAdsPatch = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/EnableExclusiveAudioPlayback.kt b/patches/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/EnableExclusiveAudioPlayback.kt index 4d598e402..f0b1974c3 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/EnableExclusiveAudioPlayback.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/EnableExclusiveAudioPlayback.kt @@ -17,7 +17,8 @@ val enableExclusiveAudioPlaybackPatch = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt index 559bacc39..addf737f8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentrepeat/PermanentRepeatPatch.kt @@ -27,7 +27,8 @@ val permanentRepeatPatch = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentshuffle/PermanentShufflePatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentshuffle/PermanentShufflePatch.kt index 39ffa319a..359ede662 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentshuffle/PermanentShufflePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/interaction/permanentshuffle/PermanentShufflePatch.kt @@ -11,7 +11,8 @@ val permanentShufflePatch = bytecodePatch( ) { compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/castbutton/HideCastButton.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/castbutton/HideCastButton.kt index 4e18e6305..2c1fbdea8 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/castbutton/HideCastButton.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/castbutton/HideCastButton.kt @@ -33,7 +33,8 @@ val hideCastButton = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/compactheader/HideCategoryBar.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/compactheader/HideCategoryBar.kt index 883be02a6..7668c9dc7 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/compactheader/HideCategoryBar.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/compactheader/HideCategoryBar.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.layout.compactheader -import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.bytecodePatch @@ -10,7 +9,6 @@ import app.revanced.patches.music.misc.extension.sharedExtensionPatch import app.revanced.patches.music.misc.settings.PreferenceScreen import app.revanced.patches.music.misc.settings.settingsPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.util.addInstructionsAtControlFlowLabel import app.revanced.util.findFreeRegister import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -29,7 +27,8 @@ val hideCategoryBar = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/NavigationBarPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/NavigationBarPatch.kt index d3af09f24..e9598f576 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/NavigationBarPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/navigationbar/NavigationBarPatch.kt @@ -40,7 +40,8 @@ val navigationBarPatch = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/premium/HideGetPremiumPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/premium/HideGetPremiumPatch.kt index beea72673..13a50c54f 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/premium/HideGetPremiumPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/premium/HideGetPremiumPatch.kt @@ -28,7 +28,8 @@ val hideGetPremiumPatch = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/Fingerprints.kt deleted file mode 100644 index f3c96dc44..000000000 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/Fingerprints.kt +++ /dev/null @@ -1,18 +0,0 @@ -package app.revanced.patches.music.layout.upgradebutton - -import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.AccessFlags -import app.revanced.patcher.fingerprint - -internal val pivotBarConstructorFingerprint = fingerprint { - accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR) - returns("V") - parameters("L", "Z") - opcodes( - Opcode.CHECK_CAST, - Opcode.INVOKE_INTERFACE, - Opcode.GOTO, - Opcode.IPUT_OBJECT, - Opcode.RETURN_VOID - ) -} \ No newline at end of file diff --git a/patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/HideUpgradeButtonPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/HideUpgradeButtonPatch.kt index f06eda341..0b0f24497 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/HideUpgradeButtonPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/layout/upgradebutton/HideUpgradeButtonPatch.kt @@ -1,104 +1,12 @@ package app.revanced.patches.music.layout.upgradebutton -import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -import app.revanced.patcher.extensions.InstructionExtensions.addInstructions -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction -import app.revanced.patcher.extensions.newLabel import app.revanced.patcher.patch.bytecodePatch -import app.revanced.patcher.util.smali.toInstructions -import app.revanced.patches.all.misc.resources.addResources -import app.revanced.patches.all.misc.resources.addResourcesPatch -import app.revanced.patches.music.misc.extension.sharedExtensionPatch -import app.revanced.patches.music.misc.settings.PreferenceScreen -import app.revanced.patches.music.misc.settings.settingsPatch -import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.util.getReference -import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction22t -import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction -import com.android.tools.smali.dexlib2.iface.reference.FieldReference +import app.revanced.patches.music.layout.navigationbar.navigationBarPatch -private const val EXTENSION_CLASS_DESCRIPTOR = "Lapp/revanced/extension/music/patches/HideUpgradeButtonPatch;" - -@Deprecated("This patch will be removed in the future.") +@Deprecated("Patch is obsolete and was replaced by navigation bar patch", ReplaceWith("navigationBarPatch")) @Suppress("unused") -val hideUpgradeButton = bytecodePatch( - description = "Hides the upgrade tab from the pivot bar.", -) { - dependsOn( - sharedExtensionPatch, - settingsPatch, - addResourcesPatch, - ) - - compatibleWith( - "com.google.android.apps.youtube.music"( - "7.29.52" - ) - ) - - execute { - addResources("music", "layout.upgradebutton.hideUpgradeButtonPatch") - - // TODO: Add an extension patch to allow this to be enabled/disabled in app. - if (false) { - PreferenceScreen.ADS.addPreferences( - SwitchPreference("revanced_music_hide_upgrade_button") - ) - } - - pivotBarConstructorFingerprint.method.apply { - val pivotBarElementFieldReference = - getInstruction(pivotBarConstructorFingerprint.patternMatch!!.endIndex - 1) - .getReference() - - val register = getInstruction(0).registerC - - // First compile all the needed instructions. - val instructionList = """ - invoke-interface { v0 }, Ljava/util/List;->size()I - move-result v1 - const/4 v2, 0x4 - invoke-interface {v0, v2}, Ljava/util/List;->remove(I)Ljava/lang/Object; - iput-object v0, v$register, $pivotBarElementFieldReference - """.toInstructions().toMutableList() - - val endIndex = pivotBarConstructorFingerprint.patternMatch!!.endIndex - - // Replace the instruction to retain the label at given index. - replaceInstruction( - endIndex - 1, - instructionList[0], // invoke-interface. - ) - // Do not forget to remove this instruction since we added it already. - instructionList.removeFirst() - - val exitInstruction = instructionList.last() // iput-object - addInstruction( - endIndex, - exitInstruction, - ) - // Do not forget to remove this instruction since we added it already. - instructionList.removeLast() - - // Add the necessary if statement to remove the upgrade tab button in case it exists. - instructionList.add( - 2, // if-le. - BuilderInstruction22t( - Opcode.IF_LE, - 1, - 2, - newLabel(endIndex), - ), - ) - - addInstructions( - endIndex, - instructionList, - ) - } - } +val hideUpgradeButton = bytecodePatch{ + dependsOn(navigationBarPatch) } @Deprecated("Patch was renamed", ReplaceWith("hideUpgradeButton")) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/misc/androidauto/BypassCertificateChecksPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/misc/androidauto/BypassCertificateChecksPatch.kt index 70e707fbb..245569d9e 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/misc/androidauto/BypassCertificateChecksPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/misc/androidauto/BypassCertificateChecksPatch.kt @@ -17,7 +17,8 @@ val bypassCertificateChecksPatch = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 3d81296a7..bf35b24d5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -17,7 +17,8 @@ val backgroundPlaybackPatch = bytecodePatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) diff --git a/patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofVideoStreamsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofVideoStreamsPatch.kt index 0452bc3cf..b01f74cca 100644 --- a/patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofVideoStreamsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/music/misc/spoof/SpoofVideoStreamsPatch.kt @@ -33,7 +33,8 @@ val spoofVideoStreamsPatch = spoofVideoStreamsPatch( compatibleWith( "com.google.android.apps.youtube.music"( - "7.29.52" + "7.29.52", + "8.10.52" ) ) },