From 1fbaeef5cf21ce8b914c8c4cf49a33f1e23abbd9 Mon Sep 17 00:00:00 2001 From: Aaron Veil <70171475+anddea@users.noreply.github.com> Date: Fri, 22 Mar 2024 14:07:27 +0300 Subject: [PATCH] feat(YT Music): Bump new versions --- api/revanced-patches.api | 4 ++-- .../OldStyleMiniPlayerPatch.kt | 6 ++++-- .../music/utils/intenthook/IntentHookPatch.kt | 10 +++++----- ...rint.kt => GoogleApiActivityFingerprint.kt} | 4 ++-- .../music/utils/settings/ResourceUtils.kt | 2 +- .../sponsorblock/xml/sponsorblock_prefs.xml | 18 +++++++++--------- 6 files changed, 23 insertions(+), 21 deletions(-) rename src/main/kotlin/app/revanced/patches/music/utils/intenthook/fingerprints/{FullStackTraceActivityFingerprint.kt => GoogleApiActivityFingerprint.kt} (60%) diff --git a/api/revanced-patches.api b/api/revanced-patches.api index bd21fbd0e..48a8b53e2 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -642,8 +642,8 @@ public final class app/revanced/patches/music/utils/intenthook/IntentHookPatch : public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } -public final class app/revanced/patches/music/utils/intenthook/fingerprints/FullStackTraceActivityFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint { - public static final field INSTANCE Lapp/revanced/patches/music/utils/intenthook/fingerprints/FullStackTraceActivityFingerprint; +public final class app/revanced/patches/music/utils/intenthook/fingerprints/GoogleApiActivityFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint { + public static final field INSTANCE Lapp/revanced/patches/music/utils/intenthook/fingerprints/GoogleApiActivityFingerprint; } public final class app/revanced/patches/music/utils/litho/LithoFilterPatch : app/revanced/patcher/patch/BytecodePatch, java/io/Closeable { diff --git a/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/OldStyleMiniPlayerPatch.kt b/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/OldStyleMiniPlayerPatch.kt index 437080233..86b99915d 100644 --- a/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/OldStyleMiniPlayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/player/oldstyleminiplayer/OldStyleMiniPlayerPatch.kt @@ -4,6 +4,7 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.music.player.oldstyleminiplayer.fingerprints.MiniPlayerParentFingerprint @@ -23,7 +24,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction SettingsPatch::class, SharedResourceIdPatch::class ], - compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")] + compatiblePackages = [CompatiblePackage("com.google.android.apps.youtube.music")], + use = false ) @Suppress("unused") object OldStyleMiniPlayerPatch : BytecodePatch( @@ -53,7 +55,7 @@ object OldStyleMiniPlayerPatch : BytecodePatch( """ ) } - } ?: throw NextButtonVisibilityFingerprint.exception + } ?: throw PatchException("This version is not supported. Please use YT Music 6.42 or earlier.") } ?: throw MiniPlayerParentFingerprint.exception SwipeToCloseFingerprint.result?.let { diff --git a/src/main/kotlin/app/revanced/patches/music/utils/intenthook/IntentHookPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/intenthook/IntentHookPatch.kt index 8d6f75476..215484aab 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/intenthook/IntentHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/intenthook/IntentHookPatch.kt @@ -7,17 +7,17 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.music.utils.integrations.Constants.INTEGRATIONS_PATH -import app.revanced.patches.music.utils.intenthook.fingerprints.FullStackTraceActivityFingerprint +import app.revanced.patches.music.utils.intenthook.fingerprints.GoogleApiActivityFingerprint import app.revanced.patches.music.utils.settings.SettingsPatch import app.revanced.util.exception @Patch(dependencies = [SettingsPatch::class]) object IntentHookPatch : BytecodePatch( - setOf(FullStackTraceActivityFingerprint) + setOf(GoogleApiActivityFingerprint) ) { override fun execute(context: BytecodeContext) { - FullStackTraceActivityFingerprint.result?.let { + GoogleApiActivityFingerprint.result?.let { it.mutableMethod.apply { addInstructionsWithLabels( 1, """ @@ -28,7 +28,7 @@ object IntentHookPatch : BytecodePatch( """, ExternalLabel("show", getInstruction(1)) ) } - } ?: throw FullStackTraceActivityFingerprint.exception + } ?: throw GoogleApiActivityFingerprint.exception } -} \ No newline at end of file +} diff --git a/src/main/kotlin/app/revanced/patches/music/utils/intenthook/fingerprints/FullStackTraceActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/utils/intenthook/fingerprints/GoogleApiActivityFingerprint.kt similarity index 60% rename from src/main/kotlin/app/revanced/patches/music/utils/intenthook/fingerprints/FullStackTraceActivityFingerprint.kt rename to src/main/kotlin/app/revanced/patches/music/utils/intenthook/fingerprints/GoogleApiActivityFingerprint.kt index a5f809c25..693f28bf9 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/intenthook/fingerprints/FullStackTraceActivityFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/intenthook/fingerprints/GoogleApiActivityFingerprint.kt @@ -2,10 +2,10 @@ package app.revanced.patches.music.utils.intenthook.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint -object FullStackTraceActivityFingerprint : MethodFingerprint( +object GoogleApiActivityFingerprint : MethodFingerprint( returnType = "V", parameters = listOf("Landroid/os/Bundle;"), customFingerprint = { methodDef, _ -> - methodDef.definingClass.endsWith("/FullStackTraceActivity;") && methodDef.name == "onCreate" + methodDef.definingClass.endsWith("/GoogleApiActivity;") && methodDef.name == "onCreate" } ) diff --git a/src/main/kotlin/app/revanced/patches/music/utils/settings/ResourceUtils.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/ResourceUtils.kt index 38961ac92..55999a406 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/settings/ResourceUtils.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/ResourceUtils.kt @@ -23,7 +23,7 @@ object ResourceUtils { "com.google.android.apps.youtube.music.ui.preference.SwitchCompatPreference" const val YOUTUBE_MUSIC_PREFERENCE_TARGET_CLASS = - "com.google.android.libraries.strictmode.penalties.notification.FullStackTraceActivity" + "com.google.android.gms.common.api.GoogleApiActivity" var targetPackage = "com.google.android.apps.youtube.music" diff --git a/src/main/resources/music/sponsorblock/xml/sponsorblock_prefs.xml b/src/main/resources/music/sponsorblock/xml/sponsorblock_prefs.xml index 30ab62437..dfdceb521 100644 --- a/src/main/resources/music/sponsorblock/xml/sponsorblock_prefs.xml +++ b/src/main/resources/music/sponsorblock/xml/sponsorblock_prefs.xml @@ -5,32 +5,32 @@ - + - + - + - + - + - + - + - + - +