From e33605b46d675b74c936a68f051cc69ff8d374d7 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 08:07:37 -0400 Subject: [PATCH 01/11] feat(YouTube): Add `Change Shorts repeat` patch --- api/revanced-patches.api | 6 + .../shortsrepeat/ChangeShortsRepeatPatch.kt | 120 ++++++++++++++++++ .../ReelEnumConstructorFingerprint.kt | 16 +++ .../ReelPlaybackRepeatFingerprint.kt | 9 ++ .../resources/addresources/values/arrays.xml | 15 +++ .../resources/addresources/values/strings.xml | 8 ++ 6 files changed, 174 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelPlaybackRepeatFingerprint.kt diff --git a/api/revanced-patches.api b/api/revanced-patches.api index ed2f78f371..809f77a16f 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -1832,6 +1832,12 @@ public final class app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbar public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } +public final class app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch : app/revanced/patcher/patch/BytecodePatch { + public static final field INSTANCE Lapp/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch; + public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V + public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V +} + public final class app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch : app/revanced/patcher/patch/BytecodePatch { public static final field INSTANCE Lapp/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch; public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt new file mode 100644 index 0000000000..90a4ac6df4 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt @@ -0,0 +1,120 @@ +package app.revanced.patches.youtube.layout.shortsrepeat + +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.annotation.CompatiblePackage +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.all.misc.resources.AddResourcesPatch +import app.revanced.patches.all.misc.resources.AddResourcesPatch.invoke +import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch +import app.revanced.patches.shared.misc.settings.preference.ListPreference +import app.revanced.patches.youtube.layout.shortsrepeat.fingerprints.ReelEnumConstructorFingerprint +import app.revanced.patches.youtube.layout.shortsrepeat.fingerprints.ReelPlaybackRepeatFingerprint +import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch +import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.patches.youtube.shared.fingerprints.MainActivityOnCreateFingerprint +import app.revanced.util.findOpcodeIndicesReversed +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstructionOrThrow +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 = "Change Shorts repeat", + description = "Adds options to play Shorts once, repeat, or autoplay the next Short.", + dependencies = [ + IntegrationsPatch::class, + SettingsPatch::class, + ResourceMappingPatch::class, + ], + compatiblePackages = [ + CompatiblePackage( + "com.google.android.youtube", + [ + "18.49.37", + "19.16.39", + "19.25.37", + "19.34.42", + ], + ), + ], +) +@Suppress("unused") +object ChangeShortsRepeatPatch : BytecodePatch( + setOf( + MainActivityOnCreateFingerprint, + ReelEnumConstructorFingerprint, + ReelPlaybackRepeatFingerprint + ) +) { + private const val INTEGRATIONS_CLASS_DESCRIPTOR = + "Lapp/revanced/integrations/youtube/patches/ChangeShortsRepeatPatch;" + + override fun execute(context: BytecodeContext) { + AddResourcesPatch(this::class) + + SettingsPatch.PreferenceScreen.SHORTS.addPreferences( + ListPreference( + key = "revanced_shorts_repeat_behavior", + summaryKey = null, + ), + ListPreference( + key = "revanced_shorts_background_repeat_behavior", + titleKey = "revanced_shorts_background_repeat_behavior_title", + summaryKey = null, + entriesKey = "revanced_shorts_repeat_behavior_entries", + entryValuesKey = "revanced_shorts_repeat_behavior_entry_values" + ) + ) + + // Main activity is used to check if app is in pip mode. + MainActivityOnCreateFingerprint.resultOrThrow().mutableMethod.addInstructions( + 0, + "invoke-static/range { p0 .. p0 }, $INTEGRATIONS_CLASS_DESCRIPTOR->" + + "setMainActivity(Landroid/app/Activity;)V", + ) + + val reelEnumClass: String + + ReelEnumConstructorFingerprint.resultOrThrow().let { + reelEnumClass = it.classDef.type + + it.mutableMethod.apply { + val insertIndex = indexOfFirstInstructionOrThrow(Opcode.RETURN_VOID) + + addInstructions( + insertIndex, + """ + # Pass the first enum value to integrations. + # Any enum value of this type will work. + sget-object v0, $reelEnumClass->a:$reelEnumClass + invoke-static { v0 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setYTShortsRepeatEnum(Ljava/lang/Enum;)V + """ + ) + } + } + + ReelPlaybackRepeatFingerprint.resultOrThrow().mutableMethod.apply { + // The behavior enums are looked up from an ordinal value to an enum type. + findOpcodeIndicesReversed { + val reference = getReference() + reference?.definingClass == reelEnumClass + && reference.parameterTypes.firstOrNull() == "I" + }.forEach { index -> + val register = getInstruction(index + 1).registerA + + addInstructions( + index + 2, + """ + invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->changeShortsRepeatState(Ljava/lang/Enum;)Ljava/lang/Enum; + move-result-object v$register + """ + ) + } + } + } +} diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt new file mode 100644 index 0000000000..45a36920db --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt @@ -0,0 +1,16 @@ +package app.revanced.patches.youtube.layout.shortsrepeat.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags +import kotlin.collections.listOf + +internal object ReelEnumConstructorFingerprint : MethodFingerprint( + accessFlags = AccessFlags.STATIC or AccessFlags.CONSTRUCTOR, + returnType = "V", + strings = listOf( + "REEL_LOOP_BEHAVIOR_SINGLE_PLAY", + "REEL_LOOP_BEHAVIOR_REPEAT", + "REEL_LOOP_BEHAVIOR_END_SCREEN" + ) +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelPlaybackRepeatFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelPlaybackRepeatFingerprint.kt new file mode 100644 index 0000000000..15b4bdb04b --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelPlaybackRepeatFingerprint.kt @@ -0,0 +1,9 @@ +package app.revanced.patches.youtube.layout.shortsrepeat.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint + +internal object ReelPlaybackRepeatFingerprint : MethodFingerprint( + parameters = listOf("L"), + returnType = "V", + strings = listOf("YoutubePlayerState is in throwing an Error.") +) diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index 829f9533e5..9f60db37ea 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -98,6 +98,21 @@ BROWSE + + + @string/revanced_shorts_repeat_behavior_entry_1 + @string/revanced_shorts_repeat_behavior_entry_2 + @string/revanced_shorts_repeat_behavior_entry_3 + @string/revanced_shorts_repeat_behavior_entry_4 + + + + UNKNOWN + REPEAT + SINGLE_PLAY + END_SCREEN + + @string/revanced_alt_thumbnail_options_entry_1 diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 712d8d2fdf..596b997570 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -997,6 +997,14 @@ This is because Crowdin requires temporarily flattening this file and removing t Shorts player will not resume on app startup Shorts player will resume on app startup + + Shorts repeat behavior + Default + Repeat + Autoplay + Pause + Shorts repeat background behavior + Enable tablet layout Tablet layout is enabled From 0d27f4830955aa3c5bccecdb1bf0d0523bd93a67 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 09:18:44 -0400 Subject: [PATCH 02/11] fix: Restrict changing Shorts PiP behavior to 19.35+ --- .../shortsrepeat/ChangeShortsRepeatPatch.kt | 21 ++++++++++++------- .../misc/playservice/VersionCheckPatch.kt | 2 ++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt index 90a4ac6df4..2ba9c660fe 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt @@ -13,6 +13,7 @@ import app.revanced.patches.shared.misc.settings.preference.ListPreference import app.revanced.patches.youtube.layout.shortsrepeat.fingerprints.ReelEnumConstructorFingerprint import app.revanced.patches.youtube.layout.shortsrepeat.fingerprints.ReelPlaybackRepeatFingerprint import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch +import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.patches.youtube.shared.fingerprints.MainActivityOnCreateFingerprint import app.revanced.util.findOpcodeIndicesReversed @@ -30,6 +31,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference IntegrationsPatch::class, SettingsPatch::class, ResourceMappingPatch::class, + VersionCheckPatch::class, ], compatiblePackages = [ CompatiblePackage( @@ -61,16 +63,21 @@ object ChangeShortsRepeatPatch : BytecodePatch( ListPreference( key = "revanced_shorts_repeat_behavior", summaryKey = null, - ), - ListPreference( - key = "revanced_shorts_background_repeat_behavior", - titleKey = "revanced_shorts_background_repeat_behavior_title", - summaryKey = null, - entriesKey = "revanced_shorts_repeat_behavior_entries", - entryValuesKey = "revanced_shorts_repeat_behavior_entry_values" ) ) + if (VersionCheckPatch.is_19_35_or_greater) { + SettingsPatch.PreferenceScreen.SHORTS.addPreferences( + ListPreference( + key = "revanced_shorts_background_repeat_behavior", + titleKey = "revanced_shorts_background_repeat_behavior_title", + summaryKey = null, + entriesKey = "revanced_shorts_repeat_behavior_entries", + entryValuesKey = "revanced_shorts_repeat_behavior_entry_values" + ) + ) + } + // Main activity is used to check if app is in pip mode. MainActivityOnCreateFingerprint.resultOrThrow().mutableMethod.addInstructions( 0, diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt index 5ef04463c6..251c8d4582 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt @@ -20,6 +20,7 @@ internal object VersionCheckPatch : ResourcePatch() { var is_19_29_or_greater by Delegates.notNull() var is_19_32_or_greater by Delegates.notNull() var is_19_33_or_greater by Delegates.notNull() + var is_19_35_or_greater by Delegates.notNull() var is_19_36_or_greater by Delegates.notNull() var is_19_41_or_greater by Delegates.notNull() @@ -46,6 +47,7 @@ internal object VersionCheckPatch : ResourcePatch() { is_19_29_or_greater = 243005000 <= playStoreServicesVersion is_19_32_or_greater = 243199000 <= playStoreServicesVersion is_19_33_or_greater = 243405000 <= playStoreServicesVersion + is_19_35_or_greater = 243605000 <= playStoreServicesVersion is_19_36_or_greater = 243705000 <= playStoreServicesVersion is_19_41_or_greater = 244305000 <= playStoreServicesVersion } From 0147a59dd4703f4f34bad0d0017abb60c295014e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 09:39:35 -0400 Subject: [PATCH 03/11] fix: 19.34 works with background PiP autoplay --- .../youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt | 2 +- .../patches/youtube/misc/playservice/VersionCheckPatch.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt index 2ba9c660fe..a36f3c6aac 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt @@ -66,7 +66,7 @@ object ChangeShortsRepeatPatch : BytecodePatch( ) ) - if (VersionCheckPatch.is_19_35_or_greater) { + if (VersionCheckPatch.is_19_34_or_greater) { SettingsPatch.PreferenceScreen.SHORTS.addPreferences( ListPreference( key = "revanced_shorts_background_repeat_behavior", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt index 251c8d4582..4a704ca541 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt @@ -20,7 +20,7 @@ internal object VersionCheckPatch : ResourcePatch() { var is_19_29_or_greater by Delegates.notNull() var is_19_32_or_greater by Delegates.notNull() var is_19_33_or_greater by Delegates.notNull() - var is_19_35_or_greater by Delegates.notNull() + var is_19_34_or_greater by Delegates.notNull() var is_19_36_or_greater by Delegates.notNull() var is_19_41_or_greater by Delegates.notNull() @@ -47,7 +47,7 @@ internal object VersionCheckPatch : ResourcePatch() { is_19_29_or_greater = 243005000 <= playStoreServicesVersion is_19_32_or_greater = 243199000 <= playStoreServicesVersion is_19_33_or_greater = 243405000 <= playStoreServicesVersion - is_19_35_or_greater = 243605000 <= playStoreServicesVersion + is_19_34_or_greater = 243499000 <= playStoreServicesVersion is_19_36_or_greater = 243705000 <= playStoreServicesVersion is_19_41_or_greater = 244305000 <= playStoreServicesVersion } From 499965956c4fe688833dd84a2886c40a8e7cc897 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 09:45:39 -0400 Subject: [PATCH 04/11] fix: More robust check --- .../youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt index a36f3c6aac..bb33ac3742 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt @@ -111,6 +111,7 @@ object ChangeShortsRepeatPatch : BytecodePatch( val reference = getReference() reference?.definingClass == reelEnumClass && reference.parameterTypes.firstOrNull() == "I" + && reference.returnType == reelEnumClass }.forEach { index -> val register = getInstruction(index + 1).registerA From c91550cb01a47a35cc9a9149e5eef58fb37002e0 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:46:22 -0400 Subject: [PATCH 05/11] fix: Remove 'default' setting option --- .../youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt | 2 +- .../fingerprints/ReelEnumConstructorFingerprint.kt | 1 + src/main/resources/addresources/values/arrays.xml | 2 -- src/main/resources/addresources/values/strings.xml | 7 +++---- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt index bb33ac3742..f33aa14083 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt @@ -118,7 +118,7 @@ object ChangeShortsRepeatPatch : BytecodePatch( addInstructions( index + 2, """ - invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->changeShortsRepeatState(Ljava/lang/Enum;)Ljava/lang/Enum; + invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->changeShortsRepeatBehavior(Ljava/lang/Enum;)Ljava/lang/Enum; move-result-object v$register """ ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt index 45a36920db..4ce8ea5a00 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt @@ -9,6 +9,7 @@ internal object ReelEnumConstructorFingerprint : MethodFingerprint( accessFlags = AccessFlags.STATIC or AccessFlags.CONSTRUCTOR, returnType = "V", strings = listOf( + "REEL_LOOP_BEHAVIOR_UNKNOWN", "REEL_LOOP_BEHAVIOR_SINGLE_PLAY", "REEL_LOOP_BEHAVIOR_REPEAT", "REEL_LOOP_BEHAVIOR_END_SCREEN" diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index 9f60db37ea..82d20cbab3 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -103,11 +103,9 @@ @string/revanced_shorts_repeat_behavior_entry_1 @string/revanced_shorts_repeat_behavior_entry_2 @string/revanced_shorts_repeat_behavior_entry_3 - @string/revanced_shorts_repeat_behavior_entry_4 - UNKNOWN REPEAT SINGLE_PLAY END_SCREEN diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 596b997570..2fb54bf84e 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -999,10 +999,9 @@ This is because Crowdin requires temporarily flattening this file and removing t Shorts repeat behavior - Default - Repeat - Autoplay - Pause + Repeat + Autoplay + Pause Shorts repeat background behavior From 4da4cb5b4271a4e516f9639a942197e1a3b1803c Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 12:55:39 -0400 Subject: [PATCH 06/11] fix: Remove buggy 'pause' setting option --- src/main/resources/addresources/values/arrays.xml | 2 -- src/main/resources/addresources/values/strings.xml | 1 - 2 files changed, 3 deletions(-) diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index 82d20cbab3..180d4c4540 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -102,13 +102,11 @@ @string/revanced_shorts_repeat_behavior_entry_1 @string/revanced_shorts_repeat_behavior_entry_2 - @string/revanced_shorts_repeat_behavior_entry_3 REPEAT SINGLE_PLAY - END_SCREEN diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 2fb54bf84e..cc05563e23 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1001,7 +1001,6 @@ This is because Crowdin requires temporarily flattening this file and removing t Shorts repeat behavior Repeat Autoplay - Pause Shorts repeat background behavior From 8a4b3709b6a1d9ec803978d15b059fecf01c505d Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 14:27:05 -0400 Subject: [PATCH 07/11] refactor: Rename and simplify to `Shorts autoplay` --- api/revanced-patches.api | 4 +-- .../ShortsAutoplayPatch.kt} | 29 +++++++------------ .../ReelEnumConstructorFingerprint.kt | 2 +- .../ReelPlaybackRepeatFingerprint.kt | 2 +- .../resources/addresources/values/arrays.xml | 11 ------- .../resources/addresources/values/strings.xml | 12 ++++---- 6 files changed, 21 insertions(+), 39 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/layout/{shortsrepeat/ChangeShortsRepeatPatch.kt => shortsautoplay/ShortsAutoplayPatch.kt} (79%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{shortsrepeat => shortsautoplay}/fingerprints/ReelEnumConstructorFingerprint.kt (88%) rename src/main/kotlin/app/revanced/patches/youtube/layout/{shortsrepeat => shortsautoplay}/fingerprints/ReelPlaybackRepeatFingerprint.kt (77%) diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 809f77a16f..152dc8346f 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -1832,8 +1832,8 @@ public final class app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbar public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } -public final class app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch : app/revanced/patcher/patch/BytecodePatch { - public static final field INSTANCE Lapp/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch; +public final class app/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch : app/revanced/patcher/patch/BytecodePatch { + public static final field INSTANCE Lapp/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch; public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch.kt similarity index 79% rename from src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch.kt index f33aa14083..25577c8a82 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/ChangeShortsRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.shortsrepeat +package app.revanced.patches.youtube.layout.shortsautoplay import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -9,9 +9,9 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.all.misc.resources.AddResourcesPatch.invoke import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.patches.shared.misc.settings.preference.ListPreference -import app.revanced.patches.youtube.layout.shortsrepeat.fingerprints.ReelEnumConstructorFingerprint -import app.revanced.patches.youtube.layout.shortsrepeat.fingerprints.ReelPlaybackRepeatFingerprint +import app.revanced.patches.shared.misc.settings.preference.SwitchPreference +import app.revanced.patches.youtube.layout.shortsautoplay.fingerprints.ReelEnumConstructorFingerprint +import app.revanced.patches.youtube.layout.shortsautoplay.fingerprints.ReelPlaybackRepeatFingerprint import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch @@ -25,8 +25,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Patch( - name = "Change Shorts repeat", - description = "Adds options to play Shorts once, repeat, or autoplay the next Short.", + name = "Shorts autoplay", + description = "Adds options to automatically play the next Short.", dependencies = [ IntegrationsPatch::class, SettingsPatch::class, @@ -46,7 +46,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference ], ) @Suppress("unused") -object ChangeShortsRepeatPatch : BytecodePatch( +object ShortsAutoplayPatch : BytecodePatch( setOf( MainActivityOnCreateFingerprint, ReelEnumConstructorFingerprint, @@ -54,27 +54,18 @@ object ChangeShortsRepeatPatch : BytecodePatch( ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/youtube/patches/ChangeShortsRepeatPatch;" + "Lapp/revanced/integrations/youtube/patches/ShortsAutoplayPatch;" override fun execute(context: BytecodeContext) { AddResourcesPatch(this::class) SettingsPatch.PreferenceScreen.SHORTS.addPreferences( - ListPreference( - key = "revanced_shorts_repeat_behavior", - summaryKey = null, - ) + SwitchPreference("revanced_shorts_autoplay") ) if (VersionCheckPatch.is_19_34_or_greater) { SettingsPatch.PreferenceScreen.SHORTS.addPreferences( - ListPreference( - key = "revanced_shorts_background_repeat_behavior", - titleKey = "revanced_shorts_background_repeat_behavior_title", - summaryKey = null, - entriesKey = "revanced_shorts_repeat_behavior_entries", - entryValuesKey = "revanced_shorts_repeat_behavior_entry_values" - ) + SwitchPreference("revanced_shorts_autoplay_background") ) } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelEnumConstructorFingerprint.kt similarity index 88% rename from src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelEnumConstructorFingerprint.kt index 4ce8ea5a00..5ff69dfc73 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelEnumConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelEnumConstructorFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.shortsrepeat.fingerprints +package app.revanced.patches.youtube.layout.shortsautoplay.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelPlaybackRepeatFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelPlaybackRepeatFingerprint.kt similarity index 77% rename from src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelPlaybackRepeatFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelPlaybackRepeatFingerprint.kt index 15b4bdb04b..793516be97 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsrepeat/fingerprints/ReelPlaybackRepeatFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelPlaybackRepeatFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.shortsrepeat.fingerprints +package app.revanced.patches.youtube.layout.shortsautoplay.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index 180d4c4540..829f9533e5 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -98,17 +98,6 @@ BROWSE - - - @string/revanced_shorts_repeat_behavior_entry_1 - @string/revanced_shorts_repeat_behavior_entry_2 - - - - REPEAT - SINGLE_PLAY - - @string/revanced_alt_thumbnail_options_entry_1 diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index cc05563e23..07006c1dba 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -997,11 +997,13 @@ This is because Crowdin requires temporarily flattening this file and removing t Shorts player will not resume on app startup Shorts player will resume on app startup - - Shorts repeat behavior - Repeat - Autoplay - Shorts repeat background behavior + + Shorts autoplay + Shorts will repeat + Shorts will autoplay + Shorts background autoplay + Background Shorts will repeat + Background Shorts will autoplay Enable tablet layout From 4bf4a0052a2699a59ec7b5628da876bf10ecefbd Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 14:40:20 -0400 Subject: [PATCH 08/11] fix: Move Shorts player hide settings to sub menu --- .../HideShortsComponentsResourcePatch.kt | 72 ++++++++++--------- .../youtube/misc/settings/SettingsPatch.kt | 1 - .../resources/addresources/values/strings.xml | 12 ++-- 3 files changed, 47 insertions(+), 38 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsResourcePatch.kt index 7c1f10ccc4..34463afdbc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsResourcePatch.kt @@ -5,6 +5,8 @@ import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch +import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen +import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting import app.revanced.patches.shared.misc.settings.preference.SwitchPreference import app.revanced.patches.youtube.layout.hide.shorts.HideShortsComponentsPatch.hideShortsAppShortcut import app.revanced.patches.youtube.layout.hide.shorts.HideShortsComponentsPatch.hideShortsWidget @@ -34,40 +36,46 @@ object HideShortsComponentsResourcePatch : ResourcePatch() { SwitchPreference("revanced_hide_shorts_subscriptions"), SwitchPreference("revanced_hide_shorts_search"), - // Shorts player components. - // Ideally each group should be ordered similar to how they appear in the UI - // since this Setting menu currently uses the ordering used here. + PreferenceScreen( + key = "revanced_shorts_player_screen", + sorting = Sorting.UNSORTED, + preferences = setOf( + // Shorts player components. + // Ideally each group should be ordered similar to how they appear in the UI + // since this Setting menu currently uses the ordering used here. - // Vertical row of buttons on right side of the screen. - SwitchPreference("revanced_hide_shorts_like_fountain"), - SwitchPreference("revanced_hide_shorts_like_button"), - SwitchPreference("revanced_hide_shorts_dislike_button"), - SwitchPreference("revanced_hide_shorts_comments_button"), - SwitchPreference("revanced_hide_shorts_share_button"), - SwitchPreference("revanced_hide_shorts_remix_button"), - SwitchPreference("revanced_hide_shorts_sound_button"), + // Vertical row of buttons on right side of the screen. + SwitchPreference("revanced_hide_shorts_like_fountain"), + SwitchPreference("revanced_hide_shorts_like_button"), + SwitchPreference("revanced_hide_shorts_dislike_button"), + SwitchPreference("revanced_hide_shorts_comments_button"), + SwitchPreference("revanced_hide_shorts_share_button"), + SwitchPreference("revanced_hide_shorts_remix_button"), + SwitchPreference("revanced_hide_shorts_sound_button"), - // Everything else. - SwitchPreference("revanced_hide_shorts_join_button"), - SwitchPreference("revanced_hide_shorts_subscribe_button"), - SwitchPreference("revanced_hide_shorts_paused_overlay_buttons"), - SwitchPreference("revanced_hide_shorts_save_sound_button"), - SwitchPreference("revanced_hide_shorts_use_template_button"), - SwitchPreference("revanced_hide_shorts_upcoming_button"), - SwitchPreference("revanced_hide_shorts_green_screen_button"), - SwitchPreference("revanced_hide_shorts_hashtag_button"), - SwitchPreference("revanced_hide_shorts_shop_button"), - SwitchPreference("revanced_hide_shorts_tagged_products"), - SwitchPreference("revanced_hide_shorts_stickers"), - SwitchPreference("revanced_hide_shorts_search_suggestions"), - SwitchPreference("revanced_hide_shorts_super_thanks_button"), - SwitchPreference("revanced_hide_shorts_location_label"), - SwitchPreference("revanced_hide_shorts_channel_bar"), - SwitchPreference("revanced_hide_shorts_info_panel"), - SwitchPreference("revanced_hide_shorts_full_video_link_label"), - SwitchPreference("revanced_hide_shorts_video_title"), - SwitchPreference("revanced_hide_shorts_sound_metadata_label"), - SwitchPreference("revanced_hide_shorts_navigation_bar"), + // Everything else. + SwitchPreference("revanced_hide_shorts_join_button"), + SwitchPreference("revanced_hide_shorts_subscribe_button"), + SwitchPreference("revanced_hide_shorts_paused_overlay_buttons"), + SwitchPreference("revanced_hide_shorts_save_sound_button"), + SwitchPreference("revanced_hide_shorts_use_template_button"), + SwitchPreference("revanced_hide_shorts_upcoming_button"), + SwitchPreference("revanced_hide_shorts_green_screen_button"), + SwitchPreference("revanced_hide_shorts_hashtag_button"), + SwitchPreference("revanced_hide_shorts_shop_button"), + SwitchPreference("revanced_hide_shorts_tagged_products"), + SwitchPreference("revanced_hide_shorts_stickers"), + SwitchPreference("revanced_hide_shorts_search_suggestions"), + SwitchPreference("revanced_hide_shorts_super_thanks_button"), + SwitchPreference("revanced_hide_shorts_location_label"), + SwitchPreference("revanced_hide_shorts_channel_bar"), + SwitchPreference("revanced_hide_shorts_info_panel"), + SwitchPreference("revanced_hide_shorts_full_video_link_label"), + SwitchPreference("revanced_hide_shorts_video_title"), + SwitchPreference("revanced_hide_shorts_sound_metadata_label"), + SwitchPreference("revanced_hide_shorts_navigation_bar"), + ) + ) ) if (hideShortsAppShortcut == true) { diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt index ade624eaf9..2cc3142ff9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsPatch.kt @@ -151,7 +151,6 @@ object SettingsPatch : val SHORTS = Screen( key = "revanced_settings_screen_06_shorts", summaryKey = null, - sorting = Sorting.UNSORTED, ) // Don't sort, because title sorting scatters the custom color preferences. val SEEKBAR = Screen( diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 07006c1dba..9b727ca270 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -602,6 +602,8 @@ This is because Crowdin requires temporarily flattening this file and removing t Thumbnail seekbar is shown + Shorts player + Hide or show components in the Shorts player Hide Shorts in home feed Shorts in home feed are hidden @@ -999,11 +1001,11 @@ This is because Crowdin requires temporarily flattening this file and removing t Shorts autoplay - Shorts will repeat - Shorts will autoplay - Shorts background autoplay - Background Shorts will repeat - Background Shorts will autoplay + Shorts will autoplay + Shorts will repeat + Shorts autoplay background + Shorts background play will autoplay + Shorts background play will repeat Enable tablet layout From e53c456f7834545c019c06d1869ec2cc02986579 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 20 Oct 2024 14:46:49 -0400 Subject: [PATCH 09/11] Comments --- .../hide/shorts/HideShortsComponentsResourcePatch.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsResourcePatch.kt index 34463afdbc..c548cf2f18 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsResourcePatch.kt @@ -42,7 +42,6 @@ object HideShortsComponentsResourcePatch : ResourcePatch() { preferences = setOf( // Shorts player components. // Ideally each group should be ordered similar to how they appear in the UI - // since this Setting menu currently uses the ordering used here. // Vertical row of buttons on right side of the screen. SwitchPreference("revanced_hide_shorts_like_fountain"), @@ -53,10 +52,12 @@ object HideShortsComponentsResourcePatch : ResourcePatch() { SwitchPreference("revanced_hide_shorts_remix_button"), SwitchPreference("revanced_hide_shorts_sound_button"), - // Everything else. + // Upper and middle area of the player. SwitchPreference("revanced_hide_shorts_join_button"), SwitchPreference("revanced_hide_shorts_subscribe_button"), SwitchPreference("revanced_hide_shorts_paused_overlay_buttons"), + + // Suggested actions. SwitchPreference("revanced_hide_shorts_save_sound_button"), SwitchPreference("revanced_hide_shorts_use_template_button"), SwitchPreference("revanced_hide_shorts_upcoming_button"), @@ -64,9 +65,11 @@ object HideShortsComponentsResourcePatch : ResourcePatch() { SwitchPreference("revanced_hide_shorts_hashtag_button"), SwitchPreference("revanced_hide_shorts_shop_button"), SwitchPreference("revanced_hide_shorts_tagged_products"), - SwitchPreference("revanced_hide_shorts_stickers"), SwitchPreference("revanced_hide_shorts_search_suggestions"), SwitchPreference("revanced_hide_shorts_super_thanks_button"), + SwitchPreference("revanced_hide_shorts_stickers"), + + // Bottom of the screen. SwitchPreference("revanced_hide_shorts_location_label"), SwitchPreference("revanced_hide_shorts_channel_bar"), SwitchPreference("revanced_hide_shorts_info_panel"), From b4e6169b82c5a02166b2955492ca7db430784c8d Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 02:31:39 -0400 Subject: [PATCH 10/11] Adjust settings text --- src/main/resources/addresources/values/strings.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 9b727ca270..d08ae90ea1 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1000,10 +1000,10 @@ This is because Crowdin requires temporarily flattening this file and removing t Shorts player will resume on app startup - Shorts autoplay + Autoplay Shorts Shorts will autoplay Shorts will repeat - Shorts autoplay background + Autoplay Shorts background play Shorts background play will autoplay Shorts background play will repeat From 1dacc5ecab7bd8450c72b253a98e6d1e1c90eeac Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 21 Oct 2024 02:51:28 -0400 Subject: [PATCH 11/11] refactor --- .../youtube/layout/shortsautoplay/ShortsAutoplayPatch.kt | 2 +- .../fingerprints/ReelEnumConstructorFingerprint.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch.kt index 25577c8a82..c8be358972 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/ShortsAutoplayPatch.kt @@ -82,7 +82,7 @@ object ShortsAutoplayPatch : BytecodePatch( reelEnumClass = it.classDef.type it.mutableMethod.apply { - val insertIndex = indexOfFirstInstructionOrThrow(Opcode.RETURN_VOID) + val insertIndex = it.scanResult.patternScanResult!!.startIndex addInstructions( insertIndex, diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelEnumConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelEnumConstructorFingerprint.kt index 5ff69dfc73..b9bc8bfed2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelEnumConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/shortsautoplay/fingerprints/ReelEnumConstructorFingerprint.kt @@ -3,11 +3,12 @@ package app.revanced.patches.youtube.layout.shortsautoplay.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 import kotlin.collections.listOf internal object ReelEnumConstructorFingerprint : MethodFingerprint( accessFlags = AccessFlags.STATIC or AccessFlags.CONSTRUCTOR, - returnType = "V", + opcodes = listOf(Opcode.RETURN_VOID), strings = listOf( "REEL_LOOP_BEHAVIOR_UNKNOWN", "REEL_LOOP_BEHAVIOR_SINGLE_PLAY",