fix(youtube): improve patching speed (#2514)
This commit is contained in:
committed by
GitHub
parent
23537557b5
commit
38dda9346b
+5
@@ -1,9 +1,14 @@
|
||||
package app.revanced.patches.youtube.video.information.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
object OnPlaybackSpeedItemClickFingerprint : MethodFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
returnType = "V",
|
||||
parameters = listOf("L", "L", "I", "J"),
|
||||
customFingerprint = { methodDef, _ -> methodDef.name == "onItemClick" },
|
||||
opcodes = listOf(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
|
||||
+8
-12
@@ -1,11 +1,15 @@
|
||||
package app.revanced.patches.youtube.video.oldqualitylayout.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import app.revanced.patches.youtube.video.oldqualitylayout.patch.OldQualityLayoutResourcePatch
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction
|
||||
|
||||
object QualityMenuViewInflateFingerprint : MethodFingerprint(
|
||||
object QualityMenuViewInflateFingerprint : LiteralValueFingerprint(
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
parameters = listOf("L", "L", "L"),
|
||||
returnType = "L",
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_SUPER,
|
||||
Opcode.CONST,
|
||||
@@ -22,13 +26,5 @@ object QualityMenuViewInflateFingerprint : MethodFingerprint(
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST
|
||||
),
|
||||
customFingerprint = { methodDef, _ ->
|
||||
methodDef.implementation?.instructions?.any {
|
||||
if (it.opcode != Opcode.CONST) return@any false
|
||||
|
||||
val literal = (it as WideLiteralInstruction).wideLiteral
|
||||
|
||||
literal == OldQualityLayoutResourcePatch.videoQualityBottomSheetListFragmentTitle
|
||||
} ?: false
|
||||
}
|
||||
literal = OldQualityLayoutResourcePatch.videoQualityBottomSheetListFragmentTitle
|
||||
)
|
||||
+4
-5
@@ -1,19 +1,18 @@
|
||||
package app.revanced.patches.youtube.video.speed.custom.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@FuzzyPatternScanMethod(2)
|
||||
object SpeedArrayGeneratorFingerprint : MethodFingerprint(
|
||||
"[L",
|
||||
AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
returnType = "[L",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
|
||||
parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"),
|
||||
opcodes = listOf(
|
||||
Opcode.IF_NEZ,
|
||||
Opcode.SGET_OBJECT,
|
||||
Opcode.GOTO,
|
||||
Opcode.GOTO_16,
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
|
||||
-2
@@ -1,12 +1,10 @@
|
||||
package app.revanced.patches.youtube.video.videoid.fingerprint
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
|
||||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
|
||||
import org.jf.dexlib2.AccessFlags
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@FuzzyPatternScanMethod(2)
|
||||
object VideoIdFingerprint : MethodFingerprint(
|
||||
returnType = "V",
|
||||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
|
||||
|
||||
Reference in New Issue
Block a user