From cd5e911f4ed9ad95b02c13c30cd9466d250e8904 Mon Sep 17 00:00:00 2001 From: bogadana <30848157+bogadana@users.noreply.github.com> Date: Tue, 5 Jul 2022 22:23:00 +0200 Subject: [PATCH] fix: make `minimized-playback-manager-fingerprint` unique (#120) --- .../MinimizedPlaybackSettingsFingerprint.kt | 11 ++++------- .../minimizedplayback/patch/MinimizedPlaybackPatch.kt | 2 -- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/minimizedplayback/fingerprints/MinimizedPlaybackSettingsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/minimizedplayback/fingerprints/MinimizedPlaybackSettingsFingerprint.kt index ebb2e304..c15fb55b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/minimizedplayback/fingerprints/MinimizedPlaybackSettingsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/minimizedplayback/fingerprints/MinimizedPlaybackSettingsFingerprint.kt @@ -29,12 +29,9 @@ object MinimizedPlaybackSettingsFingerprint : MethodFingerprint( Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT, Opcode.IF_EQZ, + Opcode.IF_NEZ, + Opcode.GOTO, + Opcode.IGET_OBJECT, + Opcode.CHECK_CAST ), - customFingerprint = { - it.implementation!!.instructions.any { - (it as? WideLiteralInstruction)?.wideLiteral == resourceId - } - } ) - -val resourceId = ResourceIdMappingProviderResourcePatch.resourceMappings.first { it.type == "string" && it.name == "pref_background_category" }.id diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/minimizedplayback/patch/MinimizedPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/minimizedplayback/patch/MinimizedPlaybackPatch.kt index 8d28616a..f61a4b41 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/minimizedplayback/patch/MinimizedPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/minimizedplayback/patch/MinimizedPlaybackPatch.kt @@ -8,7 +8,6 @@ import app.revanced.patcher.data.impl.toMethodWalker import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.Dependencies import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod @@ -21,7 +20,6 @@ import org.jf.dexlib2.iface.reference.MethodReference @Patch -@Dependencies(dependencies = [ResourceIdMappingProviderResourcePatch::class]) @Name("minimized-playback") @Description("Enable minimized and background playback.") @MinimizedPlaybackCompatibility