diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/SlideToSeekPatch.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/SlideToSeekPatch.java index d17a1f8660..5ed4a81850 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/SlideToSeekPatch.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/SlideToSeekPatch.java @@ -4,10 +4,10 @@ @SuppressWarnings("unused") public final class SlideToSeekPatch { - private static final Boolean SLIDE_TO_SEEK_DISABLED = !Settings.SLIDE_TO_SEEK.get(); + private static final boolean SLIDE_TO_SEEK_DISABLED = !Settings.SLIDE_TO_SEEK.get(); public static boolean isSlideToSeekDisabled(boolean isDisabled) { - if (!isDisabled) return isDisabled; + if (!isDisabled) return false; return SLIDE_TO_SEEK_DISABLED; } diff --git a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/components/ShortsFilter.java b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/components/ShortsFilter.java index 5e994a0036..e774733969 100644 --- a/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/components/ShortsFilter.java +++ b/extensions/shared/src/main/java/app/revanced/extension/youtube/patches/components/ShortsFilter.java @@ -21,7 +21,7 @@ @SuppressWarnings("unused") public final class ShortsFilter extends Filter { - public static final Boolean HIDE_SHORTS_NAVIGATION_BAR = Settings.HIDE_SHORTS_NAVIGATION_BAR.get(); + private static final boolean HIDE_SHORTS_NAVIGATION_BAR = Settings.HIDE_SHORTS_NAVIGATION_BAR.get(); private final static String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml"; /** 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 d8afdde5fe..8ca2ff0020 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 @@ -38,7 +38,6 @@ val enableSlideToSeekPatch = bytecodePatch( compatibleWith( "com.google.android.youtube"( - "18.38.44", "18.49.37", "19.16.39", "19.25.37", @@ -116,9 +115,9 @@ val enableSlideToSeekPatch = bytecodePatch( addInstructions( insertIndex, """ - invoke-static { v$targetRegister }, $EXTENSION_METHOD_DESCRIPTOR - move-result v$targetRegister - """ + invoke-static { v$targetRegister }, $EXTENSION_METHOD_DESCRIPTOR + move-result v$targetRegister + """ ) } } 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 132c6f6f46..968ba89db3 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 @@ -1,10 +1,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.literal 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 swipingUpGestureParentFingerprint = fingerprint { returns("Z") @@ -63,13 +65,16 @@ internal val disableFastForwardNoticeFingerprint = fingerprint { Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT, ) - strings("search_landing_cache_key", "batterymanager") custom { method, _ -> - method.name == "run" + 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(fuzzyPatternScanThreshold = 3) { +internal val onTouchEventHandlerFingerprint = fingerprint { accessFlags(AccessFlags.PUBLIC, AccessFlags.PUBLIC) returns("Z") parameters("L") @@ -103,9 +108,7 @@ internal val seekbarTappingFingerprint = fingerprint { Opcode.RETURN, Opcode.INVOKE_VIRTUAL, ) - custom { method, _ -> - method.containsLiteralInstruction(Integer.MAX_VALUE.toLong()) - } + literal { Integer.MAX_VALUE.toLong() } } internal val slideToSeekFingerprint = fingerprint { diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/Fingerprints.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/Fingerprints.kt index 4e921b76ef..7269868402 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/Fingerprints.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/layout/player/overlay/Fingerprints.kt @@ -1,7 +1,7 @@ package app.revanced.patches.youtube.layout.player.overlay import app.revanced.patcher.fingerprint -import app.revanced.util.containsLiteralInstruction +import app.revanced.util.literal import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -14,7 +14,5 @@ internal val createPlayerOverviewFingerprint = fingerprint { Opcode.MOVE_RESULT_OBJECT, Opcode.CHECK_CAST, ) - custom { method, _ -> - method.containsLiteralInstruction(scrimOverlayId) - } + literal { scrimOverlayId } }