Skip to content

Commit

Permalink
chore: Fix merge fix for 19.34 target
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios authored and oSumAtrIX committed Nov 6, 2024
1 parent fec90fd commit 053ebe3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ val enableSlideToSeekPatch = bytecodePatch(

compatibleWith(
"com.google.android.youtube"(
"18.38.44",
"18.49.37",
"19.16.39",
"19.25.37",
Expand Down Expand Up @@ -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
"""
)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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")
Expand Down Expand Up @@ -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<StringReference>()?.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")
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -14,7 +14,5 @@ internal val createPlayerOverviewFingerprint = fingerprint {
Opcode.MOVE_RESULT_OBJECT,
Opcode.CHECK_CAST,
)
custom { method, _ ->
method.containsLiteralInstruction(scrimOverlayId)
}
literal { scrimOverlayId }
}

0 comments on commit 053ebe3

Please sign in to comment.