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.
fix(youtube): improve patching speed (ReVanced#2514)
- Loading branch information
1 parent
e9fb849
commit 77bb761
Showing
71 changed files
with
367 additions
and
381 deletions.
There are no files selected for viewing
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
7 changes: 3 additions & 4 deletions
7
...n/app/revanced/patches/music/misc/androidauto/fingerprints/CheckCertificateFingerprint.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,10 +1,9 @@ | ||
package app.revanced.patches.music.misc.androidauto.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.music.misc.androidauto.patch.BypassCertificateChecksPatch | ||
|
||
|
||
object CheckCertificateFingerprint : MethodFingerprint( | ||
"Z", | ||
strings = listOf("No match") // Unique in combination with boolean return type | ||
returnType = "Z", | ||
parameters = listOf("Ljava/lang/String;"), | ||
strings = listOf("X509", "Failed to get public key.", "Failed to get certificate.") | ||
) |
7 changes: 5 additions & 2 deletions
7
src/main/kotlin/app/revanced/patches/shared/fingerprints/WatchWhileActivityFingerprint.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,10 +1,13 @@ | ||
package app.revanced.patches.shared.fingerprints | ||
|
||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import org.jf.dexlib2.AccessFlags | ||
|
||
object WatchWhileActivityFingerprint : MethodFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, | ||
parameters = listOf(), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.definingClass.endsWith("WatchWhileActivity;") && methodDef.name == "<init>" | ||
methodDef.definingClass.endsWith("WatchWhileActivity;") | ||
} | ||
) |
5 changes: 4 additions & 1 deletion
5
...ced/patches/shared/misc/fix/verticalscroll/fingerprints/CanScrollVerticallyFingerprint.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
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
5 changes: 5 additions & 0 deletions
5
...revanced/patches/youtube/ad/getpremium/bytecode/fingerprints/GetPremiumViewFingerprint.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
17 changes: 3 additions & 14 deletions
17
...es/youtube/interaction/seekbar/fingerprints/AccessibilityPlayerProgressTimeFingerprint.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,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 | ||
) |
7 changes: 5 additions & 2 deletions
7
...es/youtube/interaction/swipecontrols/fingerprints/SwipeControlsHostActivityFingerprint.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,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;" | ||
} | ||
) |
3 changes: 0 additions & 3 deletions
3
...evanced/patches/youtube/layout/autocaptions/fingerprints/StartVideoInformerFingerprint.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
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
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
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
18 changes: 8 additions & 10 deletions
18
...ed/patches/youtube/layout/buttons/navigation/fingerprints/InitializeButtonsFingerprint.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,15 +1,13 @@ | ||
package app.revanced.patches.youtube.layout.buttons.navigation.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patches.youtube.layout.buttons.navigation.patch.ResolvePivotBarFingerprintsPatch | ||
import org.jf.dexlib2.Opcode | ||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction | ||
import app.revanced.util.patch.LiteralValueFingerprint | ||
import org.jf.dexlib2.AccessFlags | ||
|
||
object InitializeButtonsFingerprint : MethodFingerprint( | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.implementation?.instructions?.any { | ||
it.opcode == Opcode.CONST && (it as WideLiteralInstruction).wideLiteral == | ||
ResolvePivotBarFingerprintsPatch.imageOnlyTabResourceId | ||
} == true | ||
} | ||
object InitializeButtonsFingerprint : LiteralValueFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
returnType = "V", | ||
parameters = listOf(), | ||
literal = ResolvePivotBarFingerprintsPatch.imageOnlyTabResourceId | ||
) |
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
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
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
15 changes: 6 additions & 9 deletions
15
...s/youtube/layout/hide/crowdfundingbox/bytecode/fingerprints/CrowdfundingBoxFingerprint.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,20 +1,17 @@ | ||
package app.revanced.patches.youtube.layout.hide.crowdfundingbox.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patches.youtube.layout.hide.crowdfundingbox.resource.patch.CrowdfundingBoxResourcePatch | ||
import app.revanced.util.patch.LiteralValueFingerprint | ||
import org.jf.dexlib2.AccessFlags | ||
import org.jf.dexlib2.Opcode | ||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction | ||
|
||
object CrowdfundingBoxFingerprint : MethodFingerprint( | ||
object CrowdfundingBoxFingerprint : LiteralValueFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, | ||
opcodes = listOf( | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT_OBJECT, | ||
Opcode.IPUT_OBJECT, | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.implementation?.instructions?.any { instruction -> | ||
instruction.opcode.ordinal == Opcode.CONST.ordinal && | ||
(instruction as? WideLiteralInstruction)?.wideLiteral == CrowdfundingBoxResourcePatch.crowdfundingBoxId | ||
} == true | ||
} | ||
literal = CrowdfundingBoxResourcePatch.crowdfundingBoxId | ||
) |
13 changes: 4 additions & 9 deletions
13
...tches/youtube/layout/hide/endscreencards/bytecode/fingerprints/LayoutCircleFingerprint.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,22 +1,17 @@ | ||
package app.revanced.patches.youtube.layout.hide.endscreencards.bytecode.fingerprints | ||
|
||
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint | ||
import app.revanced.patches.youtube.layout.hide.endscreencards.resource.patch.HideEndscreenCardsResourcePatch | ||
import app.revanced.util.patch.LiteralValueFingerprint | ||
import org.jf.dexlib2.Opcode | ||
import org.jf.dexlib2.iface.instruction.WideLiteralInstruction | ||
|
||
object LayoutCircleFingerprint : MethodFingerprint( | ||
object LayoutCircleFingerprint : LiteralValueFingerprint( | ||
returnType = "Landroid/view/View;", | ||
opcodes = listOf( | ||
Opcode.CONST, | ||
Opcode.CONST_4, | ||
Opcode.INVOKE_VIRTUAL, | ||
Opcode.MOVE_RESULT_OBJECT, | ||
Opcode.CHECK_CAST, | ||
), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.implementation?.instructions?.any { instruction -> | ||
instruction.opcode.ordinal == Opcode.CONST.ordinal && | ||
(instruction as? WideLiteralInstruction)?.wideLiteral == HideEndscreenCardsResourcePatch.layoutCircle | ||
} == true | ||
} | ||
literal = HideEndscreenCardsResourcePatch.layoutCircle | ||
) |
Oops, something went wrong.