mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-29 13:20:19 +02:00
fix(YouTube): Patch fails on YouTube 19.16.39 or earlier
This commit is contained in:
parent
acd84b8991
commit
288244acf2
@ -22,7 +22,7 @@ import app.revanced.patches.youtube.utils.mainactivity.mainActivityResolvePatch
|
||||
import app.revanced.patches.youtube.utils.navigation.navigationBarHookPatch
|
||||
import app.revanced.patches.youtube.utils.patch.PatchList.HIDE_FEED_COMPONENTS
|
||||
import app.revanced.patches.youtube.utils.playertype.playerTypeHookPatch
|
||||
import app.revanced.patches.youtube.utils.playservice.is_18_34_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_19_46_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.is_20_02_or_greater
|
||||
import app.revanced.patches.youtube.utils.playservice.versionCheckPatch
|
||||
import app.revanced.patches.youtube.utils.resourceid.bar
|
||||
@ -302,11 +302,8 @@ val feedComponentsPatch = bytecodePatch(
|
||||
reference.returnType.startsWith("L")
|
||||
}
|
||||
|
||||
val objectOpcode = if (is_18_34_or_greater)
|
||||
Opcode.IGET_OBJECT
|
||||
else
|
||||
Opcode.MOVE_OBJECT
|
||||
val objectIndex = indexOfFirstInstructionReversedOrThrow(insertIndex, objectOpcode)
|
||||
if (is_19_46_or_greater) {
|
||||
val objectIndex = indexOfFirstInstructionReversedOrThrow(insertIndex, Opcode.IGET_OBJECT)
|
||||
val objectRegister = getInstruction<TwoRegisterInstruction>(objectIndex).registerA
|
||||
|
||||
addInstructionsWithLabels(
|
||||
@ -317,6 +314,23 @@ val feedComponentsPatch = bytecodePatch(
|
||||
""" + emptyComponentLabel,
|
||||
ExternalLabel("ignore", getInstruction(insertIndex))
|
||||
)
|
||||
} else {
|
||||
val objectIndex = indexOfFirstInstructionOrThrow(Opcode.MOVE_OBJECT)
|
||||
val objectRegister = getInstruction<TwoRegisterInstruction>(objectIndex).registerA
|
||||
val jumpIndex = it.patternMatch!!.startIndex
|
||||
|
||||
addInstructionsWithLabels(
|
||||
insertIndex, """
|
||||
invoke-static {v$objectRegister, v$freeRegister}, $FEED_COMPONENTS_FILTER_CLASS_DESCRIPTOR->filterMixPlaylists(Ljava/lang/Object;[B)Z
|
||||
move-result v$freeRegister
|
||||
if-nez v$freeRegister, :filter
|
||||
""", ExternalLabel("filter", getInstruction(jumpIndex))
|
||||
)
|
||||
addInstruction(
|
||||
0,
|
||||
"move-object/from16 v$freeRegister, p3"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,8 +33,10 @@ val playerResponseMethodHookPatch = bytecodePatch(
|
||||
description = "playerResponseMethodHookPatch"
|
||||
) {
|
||||
execute {
|
||||
playerParameterBuilderFingerprint.methodOrThrow().apply {
|
||||
playerResponseMethod = this
|
||||
playerResponseMethod = playerParameterBuilderFingerprint.second.methodOrNull
|
||||
?: playerParameterBuilderLegacyFingerprint.methodOrThrow()
|
||||
|
||||
playerResponseMethod.apply {
|
||||
parameterIsShortAndOpeningOrPlaying = parameterTypes.indexOfFirst { it == "Z" } + 1
|
||||
// On some app targets the method has too many registers pushing the parameters past v15.
|
||||
// If needed, move the parameters to 4-bit registers so they can be passed to extension.
|
||||
|
@ -426,7 +426,7 @@
|
||||
<SwitchPreference android:title="@string/revanced_enable_compact_controls_overlay_title" android:key="revanced_enable_compact_controls_overlay" android:summaryOn="@string/revanced_enable_compact_controls_overlay_summary_on" android:summaryOff="@string/revanced_enable_compact_controls_overlay_summary_off" />SETTINGS: FULLSCREEN_COMPONENTS -->
|
||||
|
||||
<!-- SETTINGS: KEEP_LANDSCAPE_MODE
|
||||
<SwitchPreference android:title="@string/revanced_keep_landscape_mode_title" android:key="revanced_keep_landscape_mode" android:summaryOn="@string/revanced_keep_landscape_mode_summary_on android:summaryOff="@string/revanced_keep_landscape_mode_summary_off" />
|
||||
<SwitchPreference android:title="@string/revanced_keep_landscape_mode_title" android:key="revanced_keep_landscape_mode" android:summaryOn="@string/revanced_keep_landscape_mode_summary_on" android:summaryOff="@string/revanced_keep_landscape_mode_summary_off" />
|
||||
<app.revanced.extension.shared.settings.preference.ResettableEditTextPreference android:title="@string/revanced_keep_landscape_mode_timeout_title" android:key="revanced_keep_landscape_mode_timeout" android:summary="@string/revanced_keep_landscape_mode_timeout_summary" android:inputType="number" android:dependency="revanced_keep_landscape_mode" />SETTINGS: KEEP_LANDSCAPE_MODE -->
|
||||
|
||||
<!-- SETTINGS: FULLSCREEN_COMPONENTS
|
||||
|
Loading…
x
Reference in New Issue
Block a user