generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(youtube/sponsorblock): replace missing strings
This partially reverts commit 0d14c46 Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
- Loading branch information
Showing
2 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
...youtube/layout/sponsorblock/bytecode/fingerprints/RectangleFieldInvalidatorFingerprint.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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package app.revanced.patches.youtube.layout.sponsorblock.bytecode.fingerprints | ||
|
||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import org.jf.dexlib2.iface.instruction.ReferenceInstruction | ||
import org.jf.dexlib2.iface.reference.MethodReference | ||
|
||
object RectangleFieldInvalidatorFingerprint : MethodFingerprint( | ||
"V", | ||
customFingerprint = custom@{ methodDef -> | ||
val instructions = methodDef.implementation?.instructions!! | ||
val instructionCount = instructions.count() | ||
|
||
// the method has definitely more than 5 instructions | ||
if (instructionCount < 5) return@custom false | ||
|
||
val referenceInstruction = instructions.elementAt(instructionCount - 2) // the second to last instruction | ||
val reference = ((referenceInstruction as? ReferenceInstruction)?.reference as? MethodReference) | ||
|
||
reference?.parameterTypes?.size == 1 && reference.name == "invalidate" // the reference is the invalidate(..) method | ||
} | ||
) |
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