diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt index 1a19d5b91..8c5dce555 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt @@ -73,12 +73,9 @@ val enableSlideToSeekPatch = bytecodePatch( // Disable the double speed seek gesture. if (is_19_17_or_greater) { - arrayOf( - disableFastForwardGestureFingerprint, - disableFastForwardNoticeFingerprint, - ).forEach { fingerprint -> - fingerprint.method.apply { - val targetIndex = fingerprint.patternMatch!!.endIndex + disableFastForwardGestureFingerprint.let { + it.method.apply { + val targetIndex = it.patternMatch!!.endIndex val targetRegister = getInstruction(targetIndex).registerA addInstructions( diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/Fingerprints.kt index 37ad6f750..0b7bf052a 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/Fingerprints.kt @@ -3,14 +3,12 @@ package app.revanced.patches.youtube.interaction.seekbar import app.revanced.patcher.fingerprint import app.revanced.util.containsLiteralInstruction import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstruction import app.revanced.util.indexOfFirstInstructionReversed import app.revanced.util.literal import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.Method import com.android.tools.smali.dexlib2.iface.reference.MethodReference -import com.android.tools.smali.dexlib2.iface.reference.StringReference internal val swipingUpGestureParentFingerprint = fingerprint { returns("Z") @@ -59,25 +57,6 @@ internal val disableFastForwardGestureFingerprint = fingerprint { } } -internal val disableFastForwardNoticeFingerprint = fingerprint { - accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL) - returns("V") - parameters() - opcodes( - Opcode.CHECK_CAST, - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - ) - custom { method, _ -> - method.name == "run" && method.indexOfFirstInstruction { - // In later targets the code is found in different methods with different strings. - val string = getReference()?.string - string == "Failed to easy seek haptics vibrate." || string == "search_landing_cache_key" - } >= 0 - } -} - internal val onTouchEventHandlerFingerprint = fingerprint { accessFlags(AccessFlags.PUBLIC, AccessFlags.PUBLIC) returns("Z") diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt index 027be3a1b..e6732fb09 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt @@ -9,7 +9,6 @@ import app.revanced.patches.all.misc.resources.addResourcesPatch import app.revanced.patches.shared.misc.settings.preference.InputType import app.revanced.patches.shared.misc.settings.preference.SwitchPreference import app.revanced.patches.shared.misc.settings.preference.TextPreference -import app.revanced.patches.youtube.interaction.seekbar.disableFastForwardNoticeFingerprint import app.revanced.patches.youtube.misc.extension.sharedExtensionPatch import app.revanced.patches.youtube.misc.litho.filter.addLithoFilter import app.revanced.patches.youtube.misc.litho.filter.lithoFilterPatch diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/Fingerprints.kt index 120bb1df3..9d8ba8315 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/Fingerprints.kt @@ -1,8 +1,11 @@ package app.revanced.patches.youtube.video.speed.custom import app.revanced.patcher.fingerprint +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstruction import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.reference.StringReference internal val speedLimiterFingerprint = fingerprint { accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL) @@ -19,3 +22,16 @@ internal val speedLimiterFingerprint = fingerprint { Opcode.INVOKE_STATIC, ) } + +internal val disableFastForwardNoticeFingerprint = fingerprint { + accessFlags(AccessFlags.PUBLIC, AccessFlags.FINAL) + returns("V") + parameters() + custom { method, _ -> + method.name == "run" && method.indexOfFirstInstruction { + // In later targets the code is found in different methods with different strings. + val string = getReference()?.string + string == "Failed to easy seek haptics vibrate." || string == "search_landing_cache_key" + } >= 0 + } +}