Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(YouTube): Support versions 19.25 and 19.37 #3629

Open
wants to merge 86 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
70bdc0d
fix(YouTube - Spoof Client): Fix playback by replace streaming data
zainarbani Aug 24, 2024
ceced62
Merge branch 'dev' into fix/yt-spoof-stream
zainarbani Aug 24, 2024
d2c0a1c
Add iOS client as streaming data source
zainarbani Aug 25, 2024
f5a283f
refactor: Present stream replacement in the settings as an option sim…
LisoUseInAIKyrios Aug 26, 2024
5860bcb
fix: Remove client type spoofing and use only stream replacement
LisoUseInAIKyrios Aug 26, 2024
23b0d7b
Fix: Remove obsolete code that no longer works
LisoUseInAIKyrios Aug 26, 2024
f7dcb59
refactor: Comments, rename repurposed code
LisoUseInAIKyrios Aug 27, 2024
26733c8
fix: Can use non experimental parent class type
LisoUseInAIKyrios Aug 28, 2024
4ccfdf4
Don't block /get_watch
zainarbani Aug 31, 2024
fe2634e
Merge remote-tracking branch 'refs/remotes/upstream/dev' into fix/yt-…
LisoUseInAIKyrios Sep 2, 2024
20a7ade
fix: Constrain to working versions
LisoUseInAIKyrios Sep 2, 2024
6513909
Revert "Don't block /get_watch"
LisoUseInAIKyrios Sep 3, 2024
08eea0b
Merge remote-tracking branch 'refs/remotes/upstream/dev' into fix/yt-…
LisoUseInAIKyrios Sep 7, 2024
aad5e50
feat(YouTube): Support version `~19.31`
zainarbani Sep 7, 2024
3073fd3
fix: temporarily ignore broken client-spoof until stream replacement …
LisoUseInAIKyrios Sep 8, 2024
f7b066f
fix compiler warnings
LisoUseInAIKyrios Sep 8, 2024
40ede12
fix: Use version 19.30.39 instead, just to avoid Miniplayer issue wit…
LisoUseInAIKyrios Sep 8, 2024
b5932c2
fix: Only show Miniplayer preferences that are available, remove targ…
LisoUseInAIKyrios Sep 8, 2024
5405a04
fix(Miniplayer): Do not patch features on target versions that cannot…
LisoUseInAIKyrios Sep 8, 2024
618dcb2
fix(Background play): Fix Premium user unusual edge case failure
LisoUseInAIKyrios Sep 8, 2024
bbf92f6
fix(Miniplayer): Add Modern 1 drag and drop, double tap action
LisoUseInAIKyrios Sep 8, 2024
9265150
feat(Miniplayer): Customize `19.28` miniplayer size
LisoUseInAIKyrios Sep 8, 2024
91f30ad
fix: Adjust text
LisoUseInAIKyrios Sep 8, 2024
cbdef46
fix: Comments, fix 19.16 patching
LisoUseInAIKyrios Sep 8, 2024
97bc87d
refactor: Add YouTube version check patch
LisoUseInAIKyrios Sep 8, 2024
636769c
fix: Use same version as old seekbar thumbnails
LisoUseInAIKyrios Sep 9, 2024
5d631c6
fix patching older versions
LisoUseInAIKyrios Sep 9, 2024
9a69c60
fix Sponsorblock overlay buttons
LisoUseInAIKyrios Sep 9, 2024
dd5a4d3
refactor: Cleanup of SponsorBlock patch. No functional changes.
LisoUseInAIKyrios Sep 9, 2024
de54e2d
Merge branch 'refs/heads/fix/yt-spoof-stream' into feat/yt-bump
LisoUseInAIKyrios Sep 9, 2024
bf3ae08
fix: Simplify and fix patching 19.02 - 19.07
LisoUseInAIKyrios Sep 10, 2024
87903bc
refactor: Remove opcode patterns from `filterState()` hook
LisoUseInAIKyrios Sep 10, 2024
85d1c43
refactor: More robust selection of indexes
LisoUseInAIKyrios Sep 10, 2024
c9c2476
fix: Use two method patching only with 19.18+
LisoUseInAIKyrios Sep 10, 2024
f994c04
fix: Fix control flow label to prevent double filtering
LisoUseInAIKyrios Sep 10, 2024
e4dee60
Cleanup
LisoUseInAIKyrios Sep 10, 2024
f680cfe
refactor: Remove opcode pattern for identifier string
LisoUseInAIKyrios Sep 11, 2024
3d63c33
cleanup
LisoUseInAIKyrios Sep 11, 2024
1a04330
fix: Show a log message if the user turns off version checks
LisoUseInAIKyrios Sep 11, 2024
5f08338
feat: Support for `19.36.37`. Miniplayer settings need to be figured…
LisoUseInAIKyrios Sep 11, 2024
44270af
feat: Unlock sleep timer menu
zainarbani Sep 13, 2024
e0ff21b
Revert "feat: Unlock sleep timer menu"
zainarbani Sep 13, 2024
be4e9d0
fix `Bypass URL redirects`
LisoUseInAIKyrios Sep 14, 2024
8d9d8cd
fix miniplayer: Only recommend versions that have no bugs, and have s…
LisoUseInAIKyrios Sep 14, 2024
9eb21b5
Revert "Merge branch 'refs/heads/fix/yt-spoof-stream' into feat/yt-bump"
LisoUseInAIKyrios Sep 14, 2024
e1a4253
add 19.31 - 19.36
LisoUseInAIKyrios Sep 14, 2024
ee0a9db
fix(Miniplayer): The latest release doesn't seem so beta anymore.
LisoUseInAIKyrios Sep 14, 2024
6f552dc
fix broken litho filtering?
LisoUseInAIKyrios Sep 14, 2024
0d67416
Revert "fix broken litho filtering?"
LisoUseInAIKyrios Sep 15, 2024
85bf50c
fix Url bypass with 19.34
LisoUseInAIKyrios Sep 15, 2024
9dac823
fix: For now, remove 19.35 and 19.36
LisoUseInAIKyrios Sep 15, 2024
3c8fa63
fix(Change start page): For now, set 19.31 as max supported version
LisoUseInAIKyrios Sep 15, 2024
b81b543
comments
LisoUseInAIKyrios Sep 15, 2024
21ce939
fix: Constrain new versions to `19.25`, `19.32`, `19.33`, `19.34`
LisoUseInAIKyrios Sep 15, 2024
0b82a85
fix Disable resuming Shorts on startup
LisoUseInAIKyrios Sep 15, 2024
6f3d079
fix: Constrain versions even more. Only 19.25 and 19.34 are newly rec…
LisoUseInAIKyrios Sep 15, 2024
7407940
cleanup
LisoUseInAIKyrios Sep 15, 2024
889e744
fix: Restore `Slide to seek` patch
zainarbani Sep 16, 2024
b978994
fix(Change start page): Add limited support for 19.25+
LisoUseInAIKyrios Sep 16, 2024
1f09756
Merge remote-tracking branch 'refs/remotes/upstream/dev' into feat/yt…
LisoUseInAIKyrios Sep 17, 2024
4a59a86
unofficial support for 19.37.33
LisoUseInAIKyrios Sep 17, 2024
f035dcc
Adjust patch description
LisoUseInAIKyrios Sep 17, 2024
4f00a0d
Merge remote-tracking branch 'refs/remotes/upstream/dev' into feat/yt…
LisoUseInAIKyrios Sep 17, 2024
12f40b3
fix(Change start page): Fix url start pages
LisoUseInAIKyrios Sep 18, 2024
6155024
fix(Hide Shorts components): Simplify fingerprints, use weak referenc…
LisoUseInAIKyrios Sep 18, 2024
f05f8cb
fix(Hide Shorts components): Fix nav bar hiding at wrong times
LisoUseInAIKyrios Sep 19, 2024
0210949
fix(Hide Shorts components): Do not cut off Shorts seekbar if navbar …
LisoUseInAIKyrios Sep 19, 2024
c32c2b6
revert fix(Hide Shorts components). Cannot set a height otherwise if…
LisoUseInAIKyrios Sep 19, 2024
4b1cbf1
fix(Hide Shorts components): If hiding the the nav bar, then use padd…
LisoUseInAIKyrios Sep 19, 2024
b1edc0c
fix(Hide Shorts components): Also hide empty space if sound button is…
LisoUseInAIKyrios Sep 19, 2024
1160e59
Merge remote-tracking branch 'refs/remotes/upstream/dev' into feat/yt…
LisoUseInAIKyrios Sep 19, 2024
cd49a13
fix VideoIdPatch with older targets
LisoUseInAIKyrios Sep 20, 2024
5a0d2b3
fix: Add version declaration
LisoUseInAIKyrios Sep 20, 2024
ca9e9f9
fix(Hide Shorts components): Hide sound button in older versions
LisoUseInAIKyrios Sep 20, 2024
0e42bf4
fix: Use reverse order to handle if the same literal is in a method t…
LisoUseInAIKyrios Sep 20, 2024
5ebf61c
revert fix: Use reverse order to handle if the same literal is in a m…
LisoUseInAIKyrios Sep 20, 2024
4371a72
Work in progress, all code from 19.16 seems to be applied, but at lea…
LisoUseInAIKyrios Sep 20, 2024
1a8c562
Revert "Work in progress, all code from 19.16 seems to be applied, bu…
LisoUseInAIKyrios Sep 20, 2024
8ba8642
fix: Do not use Cairo settings as too much stuff is broken.
LisoUseInAIKyrios Sep 21, 2024
0f07583
refactor: Simplify
LisoUseInAIKyrios Sep 21, 2024
c17c28e
fix(Enable slide to seek): Adjust summary text
LisoUseInAIKyrios Sep 21, 2024
dd43aaa
Comments
LisoUseInAIKyrios Sep 21, 2024
ccc67d5
fix: Add version check to cairo patch
LisoUseInAIKyrios Sep 21, 2024
08fa0e0
fix: Resolve `slide to seek` remaining issue
zainarbani Sep 22, 2024
62e7da2
fix: Remove Unnecessary import
zainarbani Sep 22, 2024
ce00b2b
fix: use `19.37.39` instead of `19.34`
LisoUseInAIKyrios Sep 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions api/revanced-patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -2166,12 +2166,26 @@ public final class app/revanced/util/BytecodeUtilsKt {
public static final fun containsWideLiteralInstructionValue (Lcom/android/tools/smali/dexlib2/iface/Method;J)Z
public static final fun findMutableMethodOf (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableClass;Lcom/android/tools/smali/dexlib2/iface/Method;)Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;
public static final fun findOpcodeIndicesReversed (Lcom/android/tools/smali/dexlib2/iface/Method;Lcom/android/tools/smali/dexlib2/Opcode;)Ljava/util/List;
public static final fun findOpcodeIndicesReversed (Lcom/android/tools/smali/dexlib2/iface/Method;Lkotlin/jvm/functions/Function1;)Ljava/util/List;
public static final fun forEachLiteralValueInstruction (Lapp/revanced/patcher/data/BytecodeContext;JLkotlin/jvm/functions/Function2;)V
public static final fun getException (Lapp/revanced/patcher/fingerprint/MethodFingerprint;)Lapp/revanced/patcher/patch/PatchException;
public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;ILcom/android/tools/smali/dexlib2/Opcode;)I
public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;)I
public static final fun indexOfFirstInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Lkotlin/jvm/functions/Function1;)I
public static synthetic fun indexOfFirstInstruction$default (Lcom/android/tools/smali/dexlib2/iface/Method;ILcom/android/tools/smali/dexlib2/Opcode;ILjava/lang/Object;)I
public static synthetic fun indexOfFirstInstruction$default (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)I
public static final fun indexOfFirstInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;ILcom/android/tools/smali/dexlib2/Opcode;)I
public static final fun indexOfFirstInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;)I
public static synthetic fun indexOfFirstInstructionOrThrow$default (Lcom/android/tools/smali/dexlib2/iface/Method;ILcom/android/tools/smali/dexlib2/Opcode;ILjava/lang/Object;)I
public static synthetic fun indexOfFirstInstructionOrThrow$default (Lcom/android/tools/smali/dexlib2/iface/Method;ILkotlin/jvm/functions/Function1;ILjava/lang/Object;)I
public static final fun indexOfFirstInstructionReversed (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lcom/android/tools/smali/dexlib2/Opcode;)I
public static final fun indexOfFirstInstructionReversed (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)I
public static synthetic fun indexOfFirstInstructionReversed$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lcom/android/tools/smali/dexlib2/Opcode;ILjava/lang/Object;)I
public static synthetic fun indexOfFirstInstructionReversed$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)I
public static final fun indexOfFirstInstructionReversedOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lcom/android/tools/smali/dexlib2/Opcode;)I
public static final fun indexOfFirstInstructionReversedOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)I
public static synthetic fun indexOfFirstInstructionReversedOrThrow$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lcom/android/tools/smali/dexlib2/Opcode;ILjava/lang/Object;)I
public static synthetic fun indexOfFirstInstructionReversedOrThrow$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)I
public static final fun indexOfFirstWideLiteralInstructionValue (Lcom/android/tools/smali/dexlib2/iface/Method;J)I
public static final fun indexOfFirstWideLiteralInstructionValueOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;J)I
public static final fun indexOfIdResource (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/String;)I
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
],
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
CompatiblePackage(
"com.google.android.youtube",
[
"18.37.36",
"18.38.44",
"18.43.45",
"18.44.41",
"18.45.43",
"18.48.39",
"18.49.37",
"19.01.34",
Expand All @@ -37,6 +42,8 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
],
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ import app.revanced.util.resultOrThrow
CompatiblePackage(
"com.google.android.youtube",
[
"18.37.36",
"18.38.44",
"18.43.45",
"18.44.41",
"18.45.43",
"18.48.39",
"18.49.37",
"19.01.34",
Expand All @@ -43,6 +48,8 @@ import app.revanced.util.resultOrThrow
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
],
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
]
)
]
Expand All @@ -66,7 +68,7 @@ object DisablePreciseSeekingGesturePatch : BytecodePatch(
)

IsSwipingUpFingerprint.result?.let {
val addMovementIndex = it.scanResult.patternScanResult!!.startIndex - 1
val addMovementIndex = it.scanResult.patternScanResult!!.endIndex

it.mutableMethod.apply {
val addMovementInstruction = getInstruction<FiveRegisterInstruction>(addMovementIndex)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
]
)
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,27 @@ import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchException
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patches.all.misc.resources.AddResourcesPatch
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.DoubleSpeedSeekNoticeFingerprint
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.DisableFastForwardLegacyFingerprint
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.DisableFastForwardGestureFingerprint
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.DisableFastForwardNoticeFingerprint
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SlideToSeekFingerprint
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
import app.revanced.patches.youtube.misc.settings.SettingsPatch
import app.revanced.util.exception
import app.revanced.util.getReference
import app.revanced.util.resultOrThrow
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
import com.android.tools.smali.dexlib2.iface.reference.MethodReference

@Patch(
name = "Enable slide to seek",
description = "Adds an option to enable slide to seek instead of playing at 2x speed when pressing and holding in the video player. Including this patch may cause issues with tapping or double tapping the video player overlay.",
description = "Adds an option to enable slide to seek instead of playing at 2x speed when pressing and holding in the video player. Including this patch may cause issues with the video player overlay, such as missing buttons and ignored taps and double taps.",
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
compatiblePackages = [
CompatiblePackage(
Expand All @@ -44,6 +51,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
]
)
],
Expand All @@ -53,10 +62,13 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
object EnableSlideToSeekPatch : BytecodePatch(
setOf(
SlideToSeekFingerprint,
DoubleSpeedSeekNoticeFingerprint
DisableFastForwardLegacyFingerprint,
DisableFastForwardGestureFingerprint,
DisableFastForwardNoticeFingerprint
)
) {
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/SlideToSeekPatch;"
private const val INTEGRATIONS_METHOD_DESCRIPTOR =
"Lapp/revanced/integrations/youtube/patches/SlideToSeekPatch;->isSlideToSeekDisabled(Z)Z"

override fun execute(context: BytecodeContext) {
AddResourcesPatch(this::class)
Expand All @@ -65,27 +77,74 @@ object EnableSlideToSeekPatch : BytecodePatch(
SwitchPreference("revanced_slide_to_seek")
)

arrayOf(
// Restore the behaviour to slide to seek.
SlideToSeekFingerprint,
// Disable the double speed seek notice.
DoubleSpeedSeekNoticeFingerprint
).map {
it.result ?: throw it.exception
}.forEach {
val insertIndex = it.scanResult.patternScanResult!!.endIndex + 1
var modifiedMethods = false

it.mutableMethod.apply {
val isEnabledRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
// Restore the behaviour to slide to seek.
SlideToSeekFingerprint.resultOrThrow().let {
val checkIndex = it.scanResult.patternScanResult!!.startIndex
val checkReference = it.mutableMethod
.getInstruction(checkIndex).getReference<MethodReference>()!!

addInstructions(
insertIndex,
"""
invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSlideToSeekDisabled()Z
move-result v$isEnabledRegister
"""
)
// A/B check method was only called on this class.
it.mutableClass.methods.forEach { method ->
method.implementation!!.instructions.forEachIndexed { index, instruction ->
if (instruction.opcode == Opcode.INVOKE_VIRTUAL &&
instruction.getReference<MethodReference>() == checkReference
) {
method.apply {
val targetRegister = getInstruction<OneRegisterInstruction>(index + 1).registerA

addInstructions(
index + 2,
"""
invoke-static { v$targetRegister }, $INTEGRATIONS_METHOD_DESCRIPTOR
move-result v$targetRegister
"""
)
}

modifiedMethods = true
}
}
}
}

if (!modifiedMethods) throw PatchException("Could not find methods to modify")

// Disable the double speed seek gesture.
if (!YouTubeVersionCheck.is_19_17_or_greater) {
DisableFastForwardLegacyFingerprint.resultOrThrow().let {
it.mutableMethod.apply {
val insertIndex = it.scanResult.patternScanResult!!.endIndex + 1
val targetRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA

addInstructions(
insertIndex,
"""
invoke-static { v$targetRegister }, $INTEGRATIONS_METHOD_DESCRIPTOR
move-result v$targetRegister
"""
)
}
}
} else {
arrayOf(
DisableFastForwardGestureFingerprint,
DisableFastForwardNoticeFingerprint
).forEach { it.resultOrThrow().let {
it.mutableMethod.apply {
val targetIndex = it.scanResult.patternScanResult!!.endIndex
val targetRegister = getInstruction<OneRegisterInstruction>(targetIndex).registerA

addInstructions(
targetIndex + 1,
"""
invoke-static { v$targetRegister }, $INTEGRATIONS_METHOD_DESCRIPTOR
move-result v$targetRegister
"""
)
}
}}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package app.revanced.patches.youtube.interaction.seekbar.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

internal object DisableFastForwardGestureFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "Z",
parameters = emptyList(),
opcodes = listOf(
Opcode.IF_EQZ,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT
),
customFingerprint = { methodDef, classDef ->
methodDef.implementation!!.instructions.count() > 30 &&
classDef.type.endsWith("/NextGenWatchLayout;")
}
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package app.revanced.patches.youtube.interaction.seekbar.fingerprints
import app.revanced.util.patch.LiteralValueFingerprint
import com.android.tools.smali.dexlib2.Opcode

internal object DoubleSpeedSeekNoticeFingerprint : LiteralValueFingerprint(
internal object DisableFastForwardLegacyFingerprint : LiteralValueFingerprint(
returnType = "Z",
parameters = emptyList(),
opcodes = listOf(Opcode.MOVE_RESULT),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package app.revanced.patches.youtube.interaction.seekbar.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.MethodFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

internal object DisableFastForwardNoticeFingerprint : MethodFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
returnType = "V",
parameters = emptyList(),
opcodes = listOf(
Opcode.CHECK_CAST,
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT
),
strings = listOf("Failed to easy seek haptics vibrate")
)
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ internal object IsSwipingUpFingerprint : MethodFingerprint(
returnType = "Z",
parameters = listOf("Landroid/view/MotionEvent;", "J"),
opcodes = listOf(
Opcode.SGET_OBJECT,
Opcode.IGET_OBJECT
Opcode.CONST_4,
Opcode.IGET_OBJECT,
Opcode.IF_EQZ,
Opcode.INVOKE_VIRTUAL
)
)
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
package app.revanced.patches.youtube.interaction.seekbar.fingerprints

import app.revanced.patcher.extensions.or
import app.revanced.util.patch.LiteralValueFingerprint
import com.android.tools.smali.dexlib2.AccessFlags
import com.android.tools.smali.dexlib2.Opcode

internal object SlideToSeekFingerprint : LiteralValueFingerprint(
returnType = "Z",
parameters = emptyList(),
opcodes = listOf(Opcode.MOVE_RESULT),
literalSupplier = { 45411329 }
accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL,
returnType = "V",
parameters = listOf("Landroid/view/View;", "F"),
opcodes = listOf(
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT,
Opcode.IF_EQZ,
Opcode.GOTO_16
),
literalSupplier = { 67108864 }
)
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
],
),
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ import app.revanced.util.exception
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
]
)
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
"19.14.43",
"19.15.36",
"19.16.39",
"19.25.37",
"19.37.39",
]
)
]
Expand Down
Loading
Loading