mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2025-05-11 13:15:39 +02:00
unofficial 20.19
This commit is contained in:
parent
32f89974df
commit
7c9eb849e7
4 changed files with 11 additions and 17 deletions
|
@ -8,6 +8,7 @@ import app.revanced.patcher.newInstance
|
|||
import app.revanced.patcher.opcode
|
||||
import app.revanced.patches.youtube.misc.playservice.is_19_34_or_greater
|
||||
import app.revanced.patches.youtube.misc.playservice.is_19_47_or_greater
|
||||
import app.revanced.patches.youtube.misc.playservice.is_20_19_or_greater
|
||||
import app.revanced.util.getReference
|
||||
import app.revanced.util.indexOfFirstInstruction
|
||||
import app.revanced.util.literal
|
||||
|
@ -79,11 +80,12 @@ internal val disableFastForwardNoticeFingerprint by fingerprint {
|
|||
)
|
||||
custom { method, _ ->
|
||||
// Code is found in different methods with different strings.
|
||||
val findSearchLandingKey = is_19_34_or_greater && !is_19_47_or_greater
|
||||
val findSearchLandingKey = (is_19_34_or_greater && !is_19_47_or_greater) || is_20_19_or_greater
|
||||
|
||||
method.name == "run" && method.indexOfFirstInstruction {
|
||||
val string = getReference<StringReference>()?.string
|
||||
string == "Failed to easy seek haptics vibrate." || (findSearchLandingKey && string == "search_landing_cache_key")
|
||||
string == "Failed to easy seek haptics vibrate."
|
||||
|| (findSearchLandingKey && string == "search_landing_cache_key")
|
||||
} >= 0
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ internal val playerSeekbarHandle1ColorFingerprint by fingerprint {
|
|||
|
||||
internal val playerSeekbarHandle2ColorFingerprint by fingerprint {
|
||||
accessFlags(AccessFlags.PUBLIC, AccessFlags.CONSTRUCTOR)
|
||||
parameters("Landroid/content/Context;")
|
||||
instructions(
|
||||
resourceLiteral("color", "inline_time_bar_live_seekable_range"),
|
||||
resourceLiteral("attr", "ytStaticBrandRed"),
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package app.revanced.patches.youtube.layout.sponsorblock
|
||||
|
||||
import app.revanced.patcher.checkCast
|
||||
import app.revanced.patcher.fingerprint
|
||||
import app.revanced.patcher.methodCall
|
||||
import app.revanced.patcher.opcode
|
||||
|
@ -28,17 +29,9 @@ internal val controlsOverlayFingerprint by fingerprint {
|
|||
returns("V")
|
||||
accessFlags(AccessFlags.PRIVATE, AccessFlags.FINAL)
|
||||
parameters()
|
||||
opcodes(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST, // R.id.inset_overlay_view_layout
|
||||
Opcode.IPUT_OBJECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.CONST,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
Opcode.NEW_INSTANCE,
|
||||
instructions(
|
||||
resourceLiteral("id", "inset_overlay_view_layout"),
|
||||
checkCast("Landroid/widget/FrameLayout;", maxAfter = 20)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -206,11 +206,11 @@ val sponsorBlockPatch = bytecodePatch(
|
|||
|
||||
// Initialize the SponsorBlock view.
|
||||
controlsOverlayFingerprint.match(layoutConstructorFingerprint.originalClassDef).let {
|
||||
val startIndex = it.instructionMatches.first().index
|
||||
val checkCastIndex = it.instructionMatches.last().index
|
||||
it.method.apply {
|
||||
val frameLayoutRegister = getInstruction<OneRegisterInstruction>(startIndex + 2).registerA
|
||||
val frameLayoutRegister = getInstruction<OneRegisterInstruction>(checkCastIndex).registerA
|
||||
addInstruction(
|
||||
startIndex + 3,
|
||||
checkCastIndex + 1,
|
||||
"invoke-static {v$frameLayoutRegister}, $EXTENSION_SPONSORBLOCK_VIEW_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/ViewGroup;)V",
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue