fix(youtube): improve patching speed (#2514)
This commit is contained in:
committed by
GitHub
parent
23537557b5
commit
38dda9346b
+3
-14
@@ -1,23 +1,12 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patches.youtube.interaction.seekbar.patch.EnableSeekbarTappingResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
|
||||
|
||||
object AccessibilityPlayerProgressTimeFingerprint : MethodFingerprint(
|
||||
object AccessibilityPlayerProgressTimeFingerprint : LiteralValueFingerprint(
|
||||
returnType = "L",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.implementation?.instructions?.any { instruction ->
|
||||
if (instruction.opcode != Opcode.CONST) return@any false
|
||||
|
||||
val wideLiteral = (instruction as WideLiteralInstruction).wideLiteral
|
||||
|
||||
EnableSeekbarTappingResourcePatch.accessibilityPlayerProgressTime == wideLiteral
|
||||
} ?: false
|
||||
}
|
||||
literal = EnableSeekbarTappingResourcePatch.accessibilityPlayerProgressTime
|
||||
)
|
||||
+5
-2
@@ -1,10 +1,13 @@
|
||||
package app.revanced.patches.youtube.interaction.swipecontrols.fingerprints
|
||||
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
|
||||
object SwipeControlsHostActivityFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
|
||||
parameters = listOf(),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.definingClass == "Lapp/revanced/integrations/swipecontrols/SwipeControlsHostActivity;" && methodDef.name == "<init>"
|
||||
methodDef.definingClass == "Lapp/revanced/integrations/swipecontrols/SwipeControlsHostActivity;"
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user