Skip to content

Commit dbc9c5f

Browse files
fix(YouTube - Slide to seek): Show tap and hold 2x speed overlay when active (#5398)
1 parent 06cb777 commit dbc9c5f

File tree

4 files changed

+19
-28
lines changed

4 files changed

+19
-28
lines changed

patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,9 @@ val enableSlideToSeekPatch = bytecodePatch(
7373

7474
// Disable the double speed seek gesture.
7575
if (is_19_17_or_greater) {
76-
arrayOf(
77-
disableFastForwardGestureFingerprint,
78-
disableFastForwardNoticeFingerprint,
79-
).forEach { fingerprint ->
80-
fingerprint.method.apply {
81-
val targetIndex = fingerprint.patternMatch!!.endIndex
76+
disableFastForwardGestureFingerprint.let {
77+
it.method.apply {
78+
val targetIndex = it.patternMatch!!.endIndex
8279
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA
8380

8481
addInstructions(

patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/Fingerprints.kt

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ package app.revanced.patches.youtube.interaction.seekbar
33
import app.revanced.patcher.fingerprint
44
import app.revanced.util.containsLiteralInstruction
55
import app.revanced.util.getReference
6-
import app.revanced.util.indexOfFirstInstruction
76
import app.revanced.util.indexOfFirstInstructionReversed
87
import app.revanced.util.literal
98
import com.android.tools.smali.dexlib2.AccessFlags
109
import com.android.tools.smali.dexlib2.Opcode
1110
import com.android.tools.smali.dexlib2.iface.Method
1211
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
13-
import com.android.tools.smali.dexlib2.iface.reference.StringReference
1412

1513
internal val swipingUpGestureParentFingerprint = fingerprint {
1614
returns("Z")
@@ -59,25 +57,6 @@ internal val disableFastForwardGestureFingerprint = fingerprint {
5957
}
6058
}
6159

62-
internal val disableFastForwardNoticeFingerprint = fingerprint {
63-
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
64-
returns("V")
65-
parameters()
66-
opcodes(
67-
Opcode.CHECK_CAST,
68-
Opcode.IGET_OBJECT,
69-
Opcode.INVOKE_VIRTUAL,
70-
Opcode.MOVE_RESULT,
71-
)
72-
custom { method, _ ->
73-
method.name == "run" && method.indexOfFirstInstruction {
74-
// In later targets the code is found in different methods with different strings.
75-
val string = getReference<StringReference>()?.string
76-
string == "Failed to easy seek haptics vibrate." || string == "search_landing_cache_key"
77-
} >= 0
78-
}
79-
}
80-
8160
internal val onTouchEventHandlerFingerprint = fingerprint {
8261
accessFlags(AccessFlags.PUBLIC, AccessFlags.PUBLIC)
8362
returns("Z")

patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import app.revanced.patches.all.misc.resources.addResourcesPatch
99
import app.revanced.patches.shared.misc.settings.preference.InputType
1010
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
1111
import app.revanced.patches.shared.misc.settings.preference.TextPreference
12-
import app.revanced.patches.youtube.interaction.seekbar.disableFastForwardNoticeFingerprint
1312
import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch
1413
import app.revanced.patches.youtube.misc.litho.filter.addLithoFilter
1514
import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch

patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/Fingerprints.kt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package app.revanced.patches.youtube.video.speed.custom
22

33
import app.revanced.patcher.fingerprint
4+
import app.revanced.util.getReference
5+
import app.revanced.util.indexOfFirstInstruction
46
import com.android.tools.smali.dexlib2.AccessFlags
57
import com.android.tools.smali.dexlib2.Opcode
8+
import com.android.tools.smali.dexlib2.iface.reference.StringReference
69

710
internal val speedLimiterFingerprint = fingerprint {
811
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
@@ -19,3 +22,16 @@ internal val speedLimiterFingerprint = fingerprint {
1922
Opcode.INVOKE_STATIC,
2023
)
2124
}
25+
26+
internal val disableFastForwardNoticeFingerprint = fingerprint {
27+
accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL)
28+
returns("V")
29+
parameters()
30+
custom { method, _ ->
31+
method.name == "run" && method.indexOfFirstInstruction {
32+
// In later targets the code is found in different methods with different strings.
33+
val string = getReference<StringReference>()?.string
34+
string == "Failed to easy seek haptics vibrate." || string == "search_landing_cache_key"
35+
} >= 0
36+
}
37+
}

0 commit comments

Comments
 (0)