Skip to content

Commit 6d89cb0

Browse files
kitadai31anddea
authored andcommitted
feat(YouTube Music): Add support version 6.20.51
1 parent f7f89d7 commit 6d89cb0

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
11
package app.revanced.patches.music.ads.general.fingerprints
22

3+
import app.revanced.patcher.fingerprint.MethodFingerprint
34
import app.revanced.patches.music.utils.resourceid.SharedResourceIdPatch.SlidingDialogAnimation
4-
import app.revanced.util.fingerprint.LiteralValueFingerprint
5+
import app.revanced.util.containsWideLiteralInstructionIndex
56
import 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
)

src/main/kotlin/app/revanced/patches/music/utils/compatibility/Constants.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)