File tree Expand file tree Collapse file tree
src/main/kotlin/app/revanced/patches/music Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package app.revanced.patches.music.ads.general.fingerprints
22
3+ import app.revanced.patcher.fingerprint.MethodFingerprint
34import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.SlidingDialogAnimation
4- import app.revanced.util.fingerprint.LiteralValueFingerprint
5+ import app.revanced.util.containsWideLiteralInstructionIndex
56import com.android.tools.smali.dexlib2.Opcode
67
7- internal object ShowDialogCommandFingerprint : LiteralValueFingerprint (
8+ internal object ShowDialogCommandFingerprint : MethodFingerprint (
89 returnType = " V" ,
9- parameters = listOf("[B ", "L "),
1010 opcodes = listOf(
1111 Opcode .IF_EQ ,
1212 Opcode .IGET_OBJECT ,
1313 Opcode .INVOKE_VIRTUAL ,
1414 Opcode .IGET , // get dialog code
1515 ),
16- literalSupplier = { SlidingDialogAnimation }
16+ // 6.26 and earlier has a different first parameter.
17+ // Since this fingerprint is somewhat weak, work around by checking for both method parameter signatures.
18+ customFingerprint = custom@{ methodDef, _ ->
19+ if (!methodDef.containsWideLiteralInstructionIndex(SlidingDialogAnimation )) {
20+ return @custom false
21+ }
22+ // 6.26 and earlier parameters are: "L", "L"
23+ // 6.27+ parameters are "[B", "L"
24+ val parameterTypes = methodDef.parameterTypes
25+
26+ parameterTypes.size == 2 && parameterTypes[1 ].startsWith("L ")
27+ },
1728)
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ object Constants {
77 Patch .CompatiblePackage (
88 " com.google.android.apps.youtube.music" ,
99 setOf (
10+ " 6.20.51" , // This is the latest version that supports Android 5.0
1011 " 6.29.58" , // This is the latest version that supports the 'Restore old player layout' setting.
1112 " 6.33.52" , // This is the latest version with the legacy code of YouTube Music.
1213 " 6.42.55" , // This is the latest version that supports Android 7.0
You can’t perform that action at this time.
0 commit comments