Skip to content

Commit

Permalink
feat(YouTube Music): add support version 6.20.51 (inotia00#81)
Browse files Browse the repository at this point in the history
* feat(YouTube Music): add support version `6.20.51`

* feat: apply code review suggestions

---------

Co-authored-by: inotia00 <[email protected]>
  • Loading branch information
kitadai31 and inotia00 authored Sep 14, 2024
1 parent 20b7721 commit 225adc7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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")
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 225adc7

Please sign in to comment.