feat(YouTube Music): add support version 6.20.51 (#81)

* feat(YouTube Music): add support version `6.20.51`

* feat: apply code review suggestions

---------

Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com>
This commit is contained in:
kitadai31
2024-09-14 17:10:00 +09:00
committed by GitHub
parent 20b7721e6a
commit 225adc7ba2
2 changed files with 16 additions and 4 deletions

View File

@ -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")
},
)

View File

@ -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