forked from inotia00/revanced-patches
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(YouTube Music): add support version
6.20.51
(inotia00#81)
* feat(YouTube Music): add support version `6.20.51` * feat: apply code review suggestions --------- Co-authored-by: inotia00 <[email protected]>
- Loading branch information
Showing
2 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
19 changes: 15 additions & 4 deletions
19
...otlin/app/revanced/patches/music/ads/general/fingerprints/ShowDialogCommandFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters