diff --git a/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/ShowDialogCommandFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/ShowDialogCommandFingerprint.kt index fed10e5e95..b83d05c766 100644 --- a/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/ShowDialogCommandFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/ads/general/fingerprints/ShowDialogCommandFingerprint.kt @@ -1,17 +1,28 @@ package app.revanced.patches.music.ads.general.fingerprints +import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.SlidingDialogAnimation -import app.revanced.util.fingerprint.LiteralValueFingerprint +import app.revanced.util.containsWideLiteralInstructionIndex import com.android.tools.smali.dexlib2.Opcode -internal object ShowDialogCommandFingerprint : LiteralValueFingerprint( +internal object ShowDialogCommandFingerprint : MethodFingerprint( returnType = "V", - parameters = listOf("[B", "L"), opcodes = listOf( Opcode.IF_EQ, Opcode.IGET_OBJECT, Opcode.INVOKE_VIRTUAL, Opcode.IGET, // get dialog code ), - literalSupplier = { SlidingDialogAnimation } + // 6.26 and earlier has a different first parameter. + // Since this fingerprint is somewhat weak, work around by checking for both method parameter signatures. + customFingerprint = custom@{ methodDef, _ -> + if (!methodDef.containsWideLiteralInstructionIndex(SlidingDialogAnimation)) { + return@custom false + } + // 6.26 and earlier parameters are: "L", "L" + // 6.27+ parameters are "[B", "L" + val parameterTypes = methodDef.parameterTypes + + parameterTypes.size == 2 && parameterTypes[1].startsWith("L") + }, ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/music/utils/compatibility/Constants.kt b/src/main/kotlin/app/revanced/patches/music/utils/compatibility/Constants.kt index 6b8abb737b..b809ed1693 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/compatibility/Constants.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/compatibility/Constants.kt @@ -7,6 +7,7 @@ object Constants { Patch.CompatiblePackage( "com.google.android.apps.youtube.music", setOf( + "6.20.51", // This is the latest version that supports Android 5.0 "6.29.58", // This is the latest version that supports the 'Restore old player layout' setting. "6.33.52", // This is the latest version with the legacy code of YouTube Music. "6.42.55", // This is the latest version that supports Android 7.0