From 70bdc0d0e583dad7535b29ba12a7fbf20cf7d738 Mon Sep 17 00:00:00 2001 From: zainarbani Date: Sat, 24 Aug 2024 11:38:23 +0700 Subject: [PATCH 001/143] fix(YouTube - Spoof Client): Fix playback by replace streaming data --- .../misc/fix/playback/SpoofClientPatch.kt | 64 ++++++++++++++++++- .../CreateStreamingDataFingerprint.kt | 25 ++++++++ .../resources/addresources/values/strings.xml | 3 + 3 files changed, 90 insertions(+), 2 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreateStreamingDataFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 1c097fa49e..25bf1cff1c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -3,6 +3,7 @@ package app.revanced.patches.youtube.misc.fix.playback import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions +import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction @@ -13,6 +14,7 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable +import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen import app.revanced.patches.shared.misc.settings.preference.SwitchPreference @@ -29,6 +31,7 @@ import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference +import com.android.tools.smali.dexlib2.iface.reference.MethodReference import com.android.tools.smali.dexlib2.iface.reference.TypeReference import com.android.tools.smali.dexlib2.immutable.ImmutableMethod import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter @@ -93,6 +96,9 @@ object SpoofClientPatch : BytecodePatch( // Player speed menu item. CreatePlaybackSpeedMenuItemFingerprint, + // Player streaming data. + CreateStreamingDataFingerprint, + // Video qualities missing. BuildRequestFingerprint, @@ -108,6 +114,8 @@ object SpoofClientPatch : BytecodePatch( "Lorg/chromium/net/ExperimentalUrlRequest;" private const val REQUEST_BUILDER_CLASS_DESCRIPTOR = "Lorg/chromium/net/ExperimentalUrlRequest\$Builder;" + private const val STREAMING_DATA_CLASS_DESCRIPTOR = + "Lcom/google/protos/youtube/api/innertube/StreamingDataOuterClass\$StreamingData;" override fun execute(context: BytecodeContext) { AddResourcesPatch(this::class) @@ -119,6 +127,7 @@ object SpoofClientPatch : BytecodePatch( preferences = setOf( SwitchPreference("revanced_spoof_client"), SwitchPreference("revanced_spoof_client_use_ios"), + SwitchPreference("revanced_spoof_stream"), ), ), ) @@ -377,11 +386,62 @@ object SpoofClientPatch : BytecodePatch( // Replace "requestBuilder.build(): Request" with "overrideUserAgent(requestBuilder, url): Request". replaceInstruction( buildRequestIndex, - "invoke-static { v$requestBuilderRegister, v$urlRegister }, " + + "invoke-static { v$requestBuilderRegister, v$urlRegister, v${urlRegister + 1} }, " + "$INTEGRATIONS_CLASS_DESCRIPTOR->" + - "overrideUserAgent(${REQUEST_BUILDER_CLASS_DESCRIPTOR}Ljava/lang/String;)" + + "overrideUserAgent(${REQUEST_BUILDER_CLASS_DESCRIPTOR}Ljava/lang/String;Ljava/util/Map;)" + REQUEST_CLASS_DESCRIPTOR ) + + // Copy request headers for streaming data fetch. + addInstruction(newRequestBuilderIndex + 2, "move-object v${urlRegister + 1}, p1") + } + } + + // endregion + + // region Fix playback by replace the streaming data. + + CreateStreamingDataFingerprint.resultOrThrow().let { result -> + result.mutableMethod.apply { + val videoDetailsIndex = result.scanResult.patternScanResult!!.endIndex + val videoDetailsClass = getInstruction(videoDetailsIndex).getReference()!!.type + val playerProtoClass = parameterTypes.first() + val protobufClass = getInstructions().find { instruction -> + instruction.opcode == Opcode.INVOKE_STATIC && + instruction.getReference()!!.name.endsWith("smcheckIsLite") + }!!.getReference()!!.definingClass + + addInstructionsWithLabels( + videoDetailsIndex + 1, + """ + # Registers is free at this index. + + invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSpoofStreamEnabled()Z + move-result v1 + if-eqz v1, :disabled + + # Get video id. + iget-object v1, v0, $videoDetailsClass->c:Ljava/lang/String; + if-eqz v1, :disabled + + # Get streaming data. + invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStreamingData(Ljava/lang/String;)Ljava/nio/ByteBuffer; + move-result-object v1 + if-eqz v1, :disabled + + # Parse streaming data. + sget-object v0, $playerProtoClass->a:$playerProtoClass + invoke-static { v0, v1 }, $protobufClass->parseFrom(${protobufClass}Ljava/nio/ByteBuffer;)$protobufClass + move-result-object v1 + check-cast v1, $playerProtoClass + + # Set streaming data. + iget-object v0, v1, $playerProtoClass->h:$STREAMING_DATA_CLASS_DESCRIPTOR + if-eqz v0, :disabled + iput-object v0, p0, $definingClass->a:$STREAMING_DATA_CLASS_DESCRIPTOR + """, + ExternalLabel("disabled", getInstruction(videoDetailsIndex + 1)) + ) } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreateStreamingDataFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreateStreamingDataFingerprint.kt new file mode 100644 index 0000000000..104a280b46 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreateStreamingDataFingerprint.kt @@ -0,0 +1,25 @@ +package app.revanced.patches.youtube.misc.fix.playback.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 CreateStreamingDataFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, + returnType = "V", + parameters = listOf("L"), + opcodes = listOf( + Opcode.MOVE_RESULT_OBJECT, + Opcode.IPUT_OBJECT, + Opcode.IGET_OBJECT, + Opcode.IF_NEZ, + Opcode.SGET_OBJECT, + Opcode.IPUT_OBJECT + ), + customFingerprint = { methodDef, classDef -> + methodDef.name == "" && classDef.fields.any { field -> + field.name == "a" && field.type.contains("StreamingDataOuterClass") + } + }, +) \ No newline at end of file diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 863f956c08..ffd973b613 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1141,6 +1141,9 @@ This is because Crowdin requires temporarily flattening this file and removing t Spoof client to iOS Client is currently spoofed to iOS\n\nSide effects include:\n• HDR video may not be available\n• Watch history does not work with a brand account Client is currently spoofed to Android VR\n\nSide effects include:\n• No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume\n• Low quality Shorts seekbar thumbnails\n• Download action button is hidden\n• End screen cards are hidden + Spoof stream + Streaming data is spoofed + Streaming data is not spoofed\n\nVideo playback may not work Spoof client thumbnails not available (API timed out) Spoof client thumbnails temporarily not available: %s From d2c0a1cba84ad2062534c3d0c6749b9d168e310e Mon Sep 17 00:00:00 2001 From: zainarbani Date: Sun, 25 Aug 2024 18:10:33 +0700 Subject: [PATCH 002/143] Add iOS client as streaming data source --- .../misc/fix/playback/SpoofClientPatch.kt | 27 +++++++++++++++++++ .../BuildMediaDataSourceFingerprint.kt | 22 +++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildMediaDataSourceFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 06ac555d3b..157cc66cca 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -100,6 +100,7 @@ object SpoofClientPatch : BytecodePatch( // Player streaming data. CreateStreamingDataFingerprint, + BuildMediaDataSourceFingerprint, // Video qualities missing. BuildRequestFingerprint, @@ -455,5 +456,31 @@ object SpoofClientPatch : BytecodePatch( } // endregion + + // region Remove /videoplayback request body to fix playback. + // This is needed when using iOS client as streaming data source. + + BuildMediaDataSourceFingerprint.resultOrThrow().let { + it.mutableMethod.apply { + val targetIndex = getInstructions().lastIndex + + addInstructions( + targetIndex, + """ + # Field a: Stream uri. + # Field c: Http method. + # Field d: Post data. + iget-object v1, v0, $definingClass->a:Landroid/net/Uri; + iget v2, v0, $definingClass->c:I + iget-object v3, v0, $definingClass->d:[B + invoke-static { v1, v2, v3 }, $INTEGRATIONS_CLASS_DESCRIPTOR->removeVideoPlaybackPostBody(Landroid/net/Uri;I[B)[B + move-result-object v1 + iput-object v1, v0, $definingClass->d:[B + """, + ) + } + } + + // endregion } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildMediaDataSourceFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildMediaDataSourceFingerprint.kt new file mode 100644 index 0000000000..ad00203cc0 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildMediaDataSourceFingerprint.kt @@ -0,0 +1,22 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +internal object BuildMediaDataSourceFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, + returnType = "V", + parameters = listOf( + "Landroid/net/Uri;", + "J", + "I", + "[B", + "Ljava/util/Map;", + "J", + "J", + "Ljava/lang/String;", + "I", + "Ljava/lang/Object;" + ) +) From f5a283f69ebe03daf48d65b7276f925c067cc82c Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 26 Aug 2024 01:24:48 -0400 Subject: [PATCH 003/143] refactor: Present stream replacement in the settings as an option similar to `iOS` and `Android VR` --- .../misc/fix/playback/SpoofClientPatch.kt | 11 +++++------ .../resources/addresources/values/arrays.xml | 10 ++++++---- .../resources/addresources/values/strings.xml | 16 ++++++++-------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 157cc66cca..16f5644394 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -129,15 +129,14 @@ object SpoofClientPatch : BytecodePatch( sorting = PreferenceScreen.Sorting.UNSORTED, preferences = setOf( SwitchPreference("revanced_spoof_client"), - ListPreference("revanced_spoof_client_type", + ListPreference("revanced_spoof_client_strategy", summaryKey = null, - entriesKey = "revanced_spoof_client_type_entries", - entryValuesKey = "revanced_spoof_client_type_entry_values" + entriesKey = "revanced_spoof_client_strategy_entries", + entryValuesKey = "revanced_spoof_client_strategy_entry_values" ), - SwitchPreference("revanced_spoof_client_ios_force_avc"), + SwitchPreference("revanced_spoof_client_force_avc"), NonInteractivePreference("revanced_spoof_client_about_android_ios"), NonInteractivePreference("revanced_spoof_client_about_android_vr"), - SwitchPreference("revanced_spoof_stream"), ) ) ) @@ -270,7 +269,7 @@ object SpoofClientPatch : BytecodePatch( ).toMutable().apply { addInstructions( """ - invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isClientSpoofingEnabled()Z + invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isClientTypeSpoofingEnabled()Z move-result v0 if-eqz v0, :disabled diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index f1700555f4..99ff08e308 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -98,15 +98,17 @@ - + + @string/revanced_spoof_client_strategy_replace_streams iOS Android VR - + - IOS - ANDROID_VR + REPLACE_STREAMS + CLIENT_IOS + CLIENT_ANDROID_VR diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index b06734b1b3..76444cb8f7 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1138,19 +1138,19 @@ This is because Crowdin requires temporarily flattening this file and removing t Client is spoofed Client is not spoofed\n\nVideo playback may not work Turning off this setting may cause video playback issues. - Spoof client type - Force iOS AVC (H.264) - iOS video codec is AVC - iOS video codec is AVC, VP9, or AV1 - Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1. + Spoof type + Replace streams + Force AVC (H.264) + Video codec is AVC + Video codec is AVC, VP9, or AV1 + Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1. iOS spoofing side effects • HDR is supported only with AV1 codec\n• Watch history does not work with a brand account Android VR spoofing side effects • No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume\n• Low quality Shorts seekbar thumbnails\n• Download action button is hidden\n• End screen cards are hidden - Spoof stream - Streaming data is spoofed - Streaming data is not spoofed\n\nVideo playback may not work + Spoof client thumbnails not available (API timed out) + Spoof client thumbnails temporarily not available: %s From 5860bcb3deb852d7f4e4882c2f1e1728e9105ba8 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:28:08 -0400 Subject: [PATCH 004/143] fix: Remove client type spoofing and use only stream replacement --- .../misc/fix/playback/SpoofClientPatch.kt | 267 +----------------- .../CreatePlaybackSpeedMenuItemFingerprint.kt | 34 --- .../CreatePlayerRequestBodyFingerprint.kt | 15 - ...tePlayerRequestBodyWithModelFingerprint.kt | 31 -- ...equestBodyWithVersionReleaseFingerprint.kt | 31 -- ...PlayerGestureConfigSyntheticFingerprint.kt | 49 ---- ...ModelBackgroundAudioPlaybackFingerprint.kt | 25 -- .../SetPlayerRequestClientTypeFingerprint.kt | 13 - .../youtube/misc/gms/GmsCoreSupportPatch.kt | 11 +- .../resources/addresources/values/arrays.xml | 14 - .../resources/addresources/values/strings.xml | 10 - 11 files changed, 17 insertions(+), 483 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlaybackSpeedMenuItemFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithModelFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerGestureConfigSyntheticFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelBackgroundAudioPlaybackFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SetPlayerRequestClientTypeFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 16f5644394..9253ba0d40 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -7,36 +7,26 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWith import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction -import app.revanced.patcher.extensions.or 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.patcher.util.proxy.mutableTypes.MutableMethod -import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.all.misc.resources.AddResourcesPatch -import app.revanced.patches.shared.misc.settings.preference.ListPreference -import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.misc.backgroundplayback.BackgroundPlaybackPatch -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.* -import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildInitPlaybackRequestFingerprint +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildMediaDataSourceFingerprint +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildPlayerRequestURIFingerprint +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildRequestFingerprint +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreateStreamingDataFingerprint import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.resultOrThrow -import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference import com.android.tools.smali.dexlib2.iface.reference.MethodReference -import com.android.tools.smali.dexlib2.iface.reference.TypeReference -import com.android.tools.smali.dexlib2.immutable.ImmutableMethod -import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter @Patch( name = "Spoof client", @@ -45,21 +35,16 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter SettingsPatch::class, AddResourcesPatch::class, UserAgentClientSpoofPatch::class, - // Required since iOS livestream fix partially enables background playback. - BackgroundPlaybackPatch::class, - PlayerTypeHookPatch::class, ], compatiblePackages = [ CompatiblePackage( "com.google.android.youtube", [ - // This patch works with these versions, - // but the dependent background playback patch does not. - // "18.37.36", - // "18.38.44", - // "18.43.45", - // "18.44.41", - // "18.45.43", + "18.37.36", + "18.38.44", + "18.43.45", + "18.44.41", + "18.45.43", "18.48.39", "18.49.37", "19.01.34", @@ -84,35 +69,15 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter ) object SpoofClientPatch : BytecodePatch( setOf( - // Client type spoof. BuildInitPlaybackRequestFingerprint, BuildPlayerRequestURIFingerprint, - SetPlayerRequestClientTypeFingerprint, - CreatePlayerRequestBodyFingerprint, - CreatePlayerRequestBodyWithModelFingerprint, - CreatePlayerRequestBodyWithVersionReleaseFingerprint, - - // Player gesture config. - PlayerGestureConfigSyntheticFingerprint, - - // Player speed menu item. - CreatePlaybackSpeedMenuItemFingerprint, - - // Player streaming data. CreateStreamingDataFingerprint, BuildMediaDataSourceFingerprint, - - // Video qualities missing. - BuildRequestFingerprint, - - // Livestream audio only background playback. - PlayerResponseModelBackgroundAudioPlaybackFingerprint, + BuildRequestFingerprint ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/spoof/SpoofClientPatch;" - private const val CLIENT_INFO_CLASS_DESCRIPTOR = - "Lcom/google/protos/youtube/api/innertube/InnertubeContext\$ClientInfo;" private const val REQUEST_CLASS_DESCRIPTOR = "Lorg/chromium/net/ExperimentalUrlRequest;" private const val REQUEST_BUILDER_CLASS_DESCRIPTOR = @@ -129,14 +94,7 @@ object SpoofClientPatch : BytecodePatch( sorting = PreferenceScreen.Sorting.UNSORTED, preferences = setOf( SwitchPreference("revanced_spoof_client"), - ListPreference("revanced_spoof_client_strategy", - summaryKey = null, - entriesKey = "revanced_spoof_client_strategy_entries", - entryValuesKey = "revanced_spoof_client_strategy_entry_values" - ), SwitchPreference("revanced_spoof_client_force_avc"), - NonInteractivePreference("revanced_spoof_client_about_android_ios"), - NonInteractivePreference("revanced_spoof_client_about_android_vr"), ) ) ) @@ -181,207 +139,6 @@ object SpoofClientPatch : BytecodePatch( // endregion - // region Get field references to be used below. - - val (clientInfoField, clientInfoClientTypeField, clientInfoClientVersionField) = - SetPlayerRequestClientTypeFingerprint.resultOrThrow().let { result -> - // Field in the player request object that holds the client info object. - val clientInfoField = result.mutableMethod - .getInstructions().find { instruction -> - // requestMessage.clientInfo = clientInfoBuilder.build(); - instruction.opcode == Opcode.IPUT_OBJECT && - instruction.getReference()?.type == CLIENT_INFO_CLASS_DESCRIPTOR - }?.getReference() ?: throw PatchException("Could not find clientInfoField") - - // Client info object's client type field. - val clientInfoClientTypeField = result.mutableMethod - .getInstruction(result.scanResult.patternScanResult!!.endIndex) - .getReference() ?: throw PatchException("Could not find clientInfoClientTypeField") - - // Client info object's client version field. - val clientInfoClientVersionField = result.mutableMethod - .getInstruction(result.scanResult.stringsScanResult!!.matches.first().index + 1) - .getReference() - ?: throw PatchException("Could not find clientInfoClientVersionField") - - Triple(clientInfoField, clientInfoClientTypeField, clientInfoClientVersionField) - } - - val clientInfoClientModelField = CreatePlayerRequestBodyWithModelFingerprint.resultOrThrow().let { - val getClientModelIndex = - CreatePlayerRequestBodyWithModelFingerprint.indexOfBuildModelInstruction(it.method) - - // The next IPUT_OBJECT instruction after getting the client model is setting the client model field. - val index = it.mutableMethod.indexOfFirstInstructionOrThrow(getClientModelIndex) { - opcode == Opcode.IPUT_OBJECT - } - - it.mutableMethod.getInstruction(index).getReference() - ?: throw PatchException("Could not find clientInfoClientModelField") - } - - val clientInfoOsVersionField = CreatePlayerRequestBodyWithVersionReleaseFingerprint.resultOrThrow().let { - val getOsVersionIndex = - CreatePlayerRequestBodyWithVersionReleaseFingerprint.indexOfBuildVersionReleaseInstruction(it.method) - - // The next IPUT_OBJECT instruction after getting the client os version is setting the client os version field. - val index = it.mutableMethod.indexOfFirstInstructionOrThrow(getOsVersionIndex) { - opcode == Opcode.IPUT_OBJECT - } - - it.mutableMethod.getInstruction(index).getReference() - ?: throw PatchException("Could not find clientInfoOsVersionField") - } - - // endregion - - // region Spoof client type for /player requests. - - CreatePlayerRequestBodyFingerprint.resultOrThrow().let { result -> - val setClientInfoMethodName = "patch_setClientInfo" - val checkCastIndex = result.scanResult.patternScanResult!!.startIndex - var clientInfoContainerClassName: String - - result.mutableMethod.apply { - val checkCastInstruction = getInstruction(checkCastIndex) - val requestMessageInstanceRegister = checkCastInstruction.registerA - clientInfoContainerClassName = checkCastInstruction.getReference()!!.type - - addInstruction( - checkCastIndex + 1, - "invoke-static { v$requestMessageInstanceRegister }," + - " ${result.classDef.type}->$setClientInfoMethodName($clientInfoContainerClassName)V", - ) - } - - // Change client info to use the spoofed values. - // Do this in a helper method, to remove the need of picking out multiple free registers from the hooked code. - result.mutableClass.methods.add( - ImmutableMethod( - result.mutableClass.type, - setClientInfoMethodName, - listOf(ImmutableMethodParameter(clientInfoContainerClassName, null, "clientInfoContainer")), - "V", - AccessFlags.PRIVATE or AccessFlags.STATIC, - null, - null, - MutableMethodImplementation(3), - ).toMutable().apply { - addInstructions( - """ - invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isClientTypeSpoofingEnabled()Z - move-result v0 - if-eqz v0, :disabled - - iget-object v0, p0, $clientInfoField - - # Set client type to the spoofed value. - iget v1, v0, $clientInfoClientTypeField - invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getClientTypeId(I)I - move-result v1 - iput v1, v0, $clientInfoClientTypeField - - # Set client model to the spoofed value. - iget-object v1, v0, $clientInfoClientModelField - invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getClientModel(Ljava/lang/String;)Ljava/lang/String; - move-result-object v1 - iput-object v1, v0, $clientInfoClientModelField - - # Set client version to the spoofed value. - iget-object v1, v0, $clientInfoClientVersionField - invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getClientVersion(Ljava/lang/String;)Ljava/lang/String; - move-result-object v1 - iput-object v1, v0, $clientInfoClientVersionField - - # Set client os version to the spoofed value. - iget-object v1, v0, $clientInfoOsVersionField - invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getOsVersion(Ljava/lang/String;)Ljava/lang/String; - move-result-object v1 - iput-object v1, v0, $clientInfoOsVersionField - - :disabled - return-void - """, - ) - }, - ) - } - - // endregion - - // region Fix player gesture if spoofing to iOS. - - PlayerGestureConfigSyntheticFingerprint.resultOrThrow().let { - val endIndex = it.scanResult.patternScanResult!!.endIndex - val downAndOutLandscapeAllowedIndex = endIndex - 3 - val downAndOutPortraitAllowedIndex = endIndex - 9 - - arrayOf( - downAndOutLandscapeAllowedIndex, - downAndOutPortraitAllowedIndex, - ).forEach { index -> - val gestureAllowedMethod = context.toMethodWalker(it.mutableMethod) - .nextMethod(index, true) - .getMethod() as MutableMethod - - gestureAllowedMethod.apply { - val isAllowedIndex = getInstructions().lastIndex - val isAllowed = getInstruction(isAllowedIndex).registerA - - addInstructions( - isAllowedIndex, - """ - invoke-static { v$isAllowed }, $INTEGRATIONS_CLASS_DESCRIPTOR->enablePlayerGesture(Z)Z - move-result v$isAllowed - """, - ) - } - } - } - - // endregion - - // region Fix livestream audio only background play if spoofing to iOS. - // This force enables audio background playback. - - PlayerResponseModelBackgroundAudioPlaybackFingerprint.resultOrThrow().mutableMethod.addInstructions( - 0, - """ - invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideBackgroundAudioPlayback()Z - move-result v0 - if-eqz v0, :do_not_override - return v0 - :do_not_override - nop - """ - ) - - // endregion - - // Fix playback speed menu item if spoofing to iOS. - - CreatePlaybackSpeedMenuItemFingerprint.resultOrThrow().let { - val scanResult = it.scanResult.patternScanResult!! - if (scanResult.startIndex != 0) throw PatchException("Unexpected start index: ${scanResult.startIndex}") - - it.mutableMethod.apply { - // Find the conditional check if the playback speed menu item is not created. - val shouldCreateMenuIndex = - indexOfFirstInstructionOrThrow(scanResult.endIndex) { opcode == Opcode.IF_EQZ } - val shouldCreateMenuRegister = getInstruction(shouldCreateMenuIndex).registerA - - addInstructions( - shouldCreateMenuIndex, - """ - invoke-static { v$shouldCreateMenuRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->forceCreatePlaybackSpeedMenu(Z)Z - move-result v$shouldCreateMenuRegister - """, - ) - } - } - - // endregion - // region Fix video qualities missing, if spoofing to iOS by overriding the user agent. BuildRequestFingerprint.resultOrThrow().let { result -> @@ -425,7 +182,7 @@ object SpoofClientPatch : BytecodePatch( """ # Registers is free at this index. - invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSpoofStreamEnabled()Z + invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSpoofingEnabled()Z move-result v1 if-eqz v1, :disabled diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlaybackSpeedMenuItemFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlaybackSpeedMenuItemFingerprint.kt deleted file mode 100644 index 035771ce2d..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlaybackSpeedMenuItemFingerprint.kt +++ /dev/null @@ -1,34 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.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 CreatePlaybackSpeedMenuItemFingerprint : MethodFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - returnType = "V", - opcodes = listOf( - Opcode.IGET_OBJECT, // First instruction of the method - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.CONST_4, - Opcode.IF_EQZ, - Opcode.INVOKE_INTERFACE, - null // MOVE_RESULT or MOVE_RESULT_OBJECT, Return value controls the creation of the playback speed menu item. - ), - // 19.01 and earlier is missing the second parameter. - // Since this fingerprint is somewhat weak, work around by checking for both method parameter signatures. - customFingerprint = custom@{ methodDef, _ -> - // 19.01 and earlier parameters are: "[L" - // 19.02+ parameters are "[L", "F" - val parameterTypes = methodDef.parameterTypes - val firstParameter = parameterTypes.firstOrNull() - - if (firstParameter == null || !firstParameter.startsWith("[L")) { - return@custom false - } - - parameterTypes.size == 1 || (parameterTypes.size == 2 && parameterTypes[1] == "F") - } -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyFingerprint.kt deleted file mode 100644 index 5abe29e676..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyFingerprint.kt +++ /dev/null @@ -1,15 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.Opcode - -internal object CreatePlayerRequestBodyFingerprint : MethodFingerprint( - returnType = "V", - parameters = listOf("L"), - opcodes = listOf( - Opcode.CHECK_CAST, - Opcode.IGET, - Opcode.AND_INT_LIT16, - ), - strings = listOf("ms"), -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithModelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithModelFingerprint.kt deleted file mode 100644 index eb91330051..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithModelFingerprint.kt +++ /dev/null @@ -1,31 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyWithModelFingerprint.indexOfBuildModelInstruction -import app.revanced.util.containsWideLiteralInstructionValue -import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstruction -import com.android.tools.smali.dexlib2.AccessFlags -import com.android.tools.smali.dexlib2.iface.Method -import com.android.tools.smali.dexlib2.iface.reference.FieldReference - -internal object CreatePlayerRequestBodyWithModelFingerprint : MethodFingerprint( - returnType = "L", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf(), - customFingerprint = { methodDef, _ -> - methodDef.containsWideLiteralInstructionValue(1073741824) && - indexOfBuildModelInstruction(methodDef) >= 0 - }, -) { - fun indexOfBuildModelInstruction(methodDef: Method) = - methodDef.indexOfFirstInstruction { - val reference = getReference() - reference?.definingClass == "Landroid/os/Build;" && - reference.name == "MODEL" && - reference.type == "Ljava/lang/String;" - } -} - - diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt deleted file mode 100644 index 1fba488bef..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt +++ /dev/null @@ -1,31 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyWithVersionReleaseFingerprint.indexOfBuildVersionReleaseInstruction -import app.revanced.util.containsWideLiteralInstructionValue -import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstruction -import com.android.tools.smali.dexlib2.AccessFlags -import com.android.tools.smali.dexlib2.iface.Method -import com.android.tools.smali.dexlib2.iface.reference.FieldReference - -internal object CreatePlayerRequestBodyWithVersionReleaseFingerprint : MethodFingerprint( - returnType = "L", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf(), - customFingerprint = { methodDef, _ -> - methodDef.containsWideLiteralInstructionValue(1073741824) && - indexOfBuildVersionReleaseInstruction(methodDef) >= 0 - }, -) { - fun indexOfBuildVersionReleaseInstruction(methodDef: Method) = - methodDef.indexOfFirstInstruction { - val reference = getReference() - reference?.definingClass == "Landroid/os/Build\$VERSION;" && - reference.name == "RELEASE" && - reference.type == "Ljava/lang/String;" - } -} - - diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerGestureConfigSyntheticFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerGestureConfigSyntheticFingerprint.kt deleted file mode 100644 index d691d7cfca..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerGestureConfigSyntheticFingerprint.kt +++ /dev/null @@ -1,49 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstruction -import com.android.tools.smali.dexlib2.AccessFlags -import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.iface.Method -import com.android.tools.smali.dexlib2.iface.reference.MethodReference - -internal object PlayerGestureConfigSyntheticFingerprint : MethodFingerprint( - returnType = "V", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf("Ljava/lang/Object;"), - opcodes = listOf( - Opcode.SGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.IF_EQZ, - Opcode.IF_EQZ, - Opcode.IGET_OBJECT, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT_OBJECT, - Opcode.INVOKE_VIRTUAL, // playerGestureConfig.downAndOutLandscapeAllowed. - Opcode.MOVE_RESULT, - Opcode.CHECK_CAST, - Opcode.IPUT_BOOLEAN, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT_OBJECT, - Opcode.INVOKE_VIRTUAL, // playerGestureConfig.downAndOutPortraitAllowed. - Opcode.MOVE_RESULT, - Opcode.IPUT_BOOLEAN, - Opcode.RETURN_VOID, - ), - customFingerprint = { methodDef, classDef -> - fun indexOfDownAndOutAllowedInstruction(methodDef: Method) = - methodDef.indexOfFirstInstruction { - val reference = getReference() - reference?.definingClass == "Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;" && - reference.parameterTypes.isEmpty() && - reference.returnType == "Z" - } - - // This method is always called "a" because this kind of class always has a single method. - methodDef.name == "a" && classDef.methods.count() == 2 && - indexOfDownAndOutAllowedInstruction(methodDef) >= 0 - }, -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelBackgroundAudioPlaybackFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelBackgroundAudioPlaybackFingerprint.kt deleted file mode 100644 index afe153219a..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelBackgroundAudioPlaybackFingerprint.kt +++ /dev/null @@ -1,25 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.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 PlayerResponseModelBackgroundAudioPlaybackFingerprint : MethodFingerprint( - returnType = "Z", - accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, - parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"), - opcodes = listOf( - Opcode.CONST_4, - Opcode.IF_EQZ, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.IF_NEZ, - Opcode.GOTO, - Opcode.RETURN, - null, // Opcode.CONST_4 or Opcode.MOVE - Opcode.RETURN, - ) -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SetPlayerRequestClientTypeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SetPlayerRequestClientTypeFingerprint.kt deleted file mode 100644 index 78c240ef4c..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SetPlayerRequestClientTypeFingerprint.kt +++ /dev/null @@ -1,13 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.util.patch.LiteralValueFingerprint -import com.android.tools.smali.dexlib2.Opcode - -internal object SetPlayerRequestClientTypeFingerprint : LiteralValueFingerprint( - opcodes = listOf( - Opcode.IGET, - Opcode.IPUT, // Sets ClientInfo.clientId. - ), - strings = listOf("10.29"), - literalSupplier = { 134217728 } -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 67a47c71d5..e74a3d11eb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -32,12 +32,11 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( CompatiblePackage( "com.google.android.youtube", setOf( - // Patch supports these versions but ClientSpoof does not. - // "18.37.36", - // "18.38.44", - // "18.43.45", - // "18.44.41", - // "18.45.43", + "18.37.36", + "18.38.44", + "18.43.45", + "18.44.41", + "18.45.43", "18.48.39", "18.49.37", "19.01.34", diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index 99ff08e308..f8f2b42183 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -97,20 +97,6 @@ END - - - @string/revanced_spoof_client_strategy_replace_streams - - iOS - Android VR - - - - REPLACE_STREAMS - CLIENT_IOS - CLIENT_ANDROID_VR - - @string/revanced_video_quality_default_entry_1 diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 76444cb8f7..e783d62141 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1138,20 +1138,10 @@ This is because Crowdin requires temporarily flattening this file and removing t Client is spoofed Client is not spoofed\n\nVideo playback may not work Turning off this setting may cause video playback issues. - Spoof type - Replace streams Force AVC (H.264) Video codec is AVC Video codec is AVC, VP9, or AV1 Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1. - iOS spoofing side effects - • HDR is supported only with AV1 codec\n• Watch history does not work with a brand account - Android VR spoofing side effects - • No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume\n• Low quality Shorts seekbar thumbnails\n• Download action button is hidden\n• End screen cards are hidden - - Spoof client thumbnails not available (API timed out) - - Spoof client thumbnails temporarily not available: %s From 23b0d7b5b830e9db4b87f7f4d1a9560f11a1536a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 26 Aug 2024 16:43:51 -0400 Subject: [PATCH 005/143] Fix: Remove obsolete code that no longer works --- .../misc/fix/playback/SpoofSignaturePatch.kt | 235 +----------------- .../playback/SpoofSignatureResourcePatch.kt | 12 +- .../fingerprints/ParamsMapPutFingerprint.kt | 25 -- ...ayerResponseModelImplGeneralFingerprint.kt | 24 -- ...rResponseModelImplLiveStreamFingerprint.kt | 24 -- ...nseModelImplRecommendedLevelFingerprint.kt | 24 -- ...rePatchScrubbedPreviewLayoutFingerprint.kt | 28 --- .../StatsQueryParameterFingerprint.kt | 8 - ...dererDecoderRecommendedLevelFingerprint.kt | 24 -- ...toryboardRendererDecoderSpecFingerprint.kt | 24 -- .../StoryboardRendererSpecFingerprint.kt | 13 - .../StoryboardThumbnailFingerprint.kt | 24 -- .../StoryboardThumbnailParentFingerprint.kt | 18 -- .../resources/addresources/values/strings.xml | 17 -- 14 files changed, 5 insertions(+), 495 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/ParamsMapPutFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplRecommendedLevelFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StatsQueryParameterFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderRecommendedLevelFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderSpecFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererSpecFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailParentFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt index c82597b3a4..bc9ebdbdfc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt @@ -1,239 +1,12 @@ package app.revanced.patches.youtube.misc.fix.playback import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstructions -import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patcher.util.smali.ExternalLabel -import app.revanced.patches.all.misc.resources.AddResourcesPatch -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.misc.fix.playback.fingerprints.* -import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch -import app.revanced.patches.youtube.misc.settings.SettingsPatch -import app.revanced.patches.youtube.video.information.VideoInformationPatch -import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch -import app.revanced.util.exception -import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction -import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction -import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction -@Patch( - description = "Spoofs the signature to prevent playback issues.", - dependencies = [ - SettingsPatch::class, - PlayerTypeHookPatch::class, - PlayerResponseMethodHookPatch::class, - VideoInformationPatch::class, - SpoofSignatureResourcePatch::class, - AddResourcesPatch::class, - ], -) -@Deprecated("This patch will be removed in the future.") +@Deprecated("This patch is obsolete.", replaceWith = ReplaceWith("SpoofClientPatch")) object SpoofSignaturePatch : BytecodePatch( - setOf( - PlayerResponseModelImplGeneralFingerprint, - PlayerResponseModelImplLiveStreamFingerprint, - PlayerResponseModelImplRecommendedLevelFingerprint, - StoryboardRendererSpecFingerprint, - StoryboardRendererDecoderSpecFingerprint, - StoryboardRendererDecoderRecommendedLevelFingerprint, - StoryboardThumbnailParentFingerprint, - SpoofSignaturePatchScrubbedPreviewLayoutFingerprint, - StatsQueryParameterFingerprint, - ParamsMapPutFingerprint, - ), + dependencies = setOf(SpoofClientPatch::class), ) { - private const val INTEGRATIONS_CLASS_DESCRIPTOR = - "Lapp/revanced/integrations/youtube/patches/spoof/SpoofSignaturePatch;" - - override fun execute(context: BytecodeContext) { - AddResourcesPatch(this::class) - - SettingsPatch.PreferenceScreen.MISC.addPreferences( - PreferenceScreen( - key = "revanced_spoof_signature_verification_screen", - sorting = Sorting.UNSORTED, - preferences = setOf( - SwitchPreference("revanced_spoof_signature_verification_enabled"), - SwitchPreference("revanced_spoof_signature_in_feed_enabled"), - SwitchPreference("revanced_spoof_storyboard"), - ), - ), - ) - - // Hook the player parameters. - PlayerResponseMethodHookPatch += PlayerResponseMethodHookPatch.Hook.ProtoBufferParameter( - "$INTEGRATIONS_CLASS_DESCRIPTOR->spoofParameter(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;", - ) - - // Force the seekbar time and chapters to always show up. - // This is used if the storyboard spec fetch fails, for viewing paid videos, - // or if storyboard spoofing is turned off. - StoryboardThumbnailParentFingerprint.result?.classDef?.let { classDef -> - StoryboardThumbnailFingerprint.also { - it.resolve( - context, - classDef, - ) - }.result?.let { - val endIndex = it.scanResult.patternScanResult!!.endIndex - // Replace existing instruction to preserve control flow label. - // The replaced return instruction always returns false - // (it is the 'no thumbnails found' control path), - // so there is no need to pass the existing return value to integrations. - it.mutableMethod.replaceInstruction( - endIndex, - """ - invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSeekbarThumbnailOverrideValue()Z - """, - ) - // Since this is end of the method must replace one line then add the rest. - it.mutableMethod.addInstructions( - endIndex + 1, - """ - move-result v0 - return v0 - """, - ) - } ?: throw StoryboardThumbnailFingerprint.exception - } - - // If storyboard spoofing is turned off, then hide the empty seekbar thumbnail view. - SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.result?.apply { - val endIndex = scanResult.patternScanResult!!.endIndex - mutableMethod.apply { - val imageViewFieldName = getInstruction(endIndex).reference - addInstructions( - implementation!!.instructions.lastIndex, - """ - iget-object v0, p0, $imageViewFieldName # copy imageview field to a register - invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->seekbarImageViewCreated(Landroid/widget/ImageView;)V - """, - ) - } - } ?: throw SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.exception - - /** - * Hook StoryBoard renderer url - */ - arrayOf( - PlayerResponseModelImplGeneralFingerprint, - PlayerResponseModelImplLiveStreamFingerprint, - ).forEach { fingerprint -> - fingerprint.result?.let { - it.mutableMethod.apply { - val getStoryBoardIndex = it.scanResult.patternScanResult!!.endIndex - val getStoryBoardRegister = - getInstruction(getStoryBoardIndex).registerA - - addInstructions( - getStoryBoardIndex, - """ - invoke-static { v$getStoryBoardRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String; - move-result-object v$getStoryBoardRegister - """, - ) - } - } ?: throw fingerprint.exception - } - - // Hook recommended seekbar thumbnails quality level. - StoryboardRendererDecoderRecommendedLevelFingerprint.result?.let { - val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex - val originalValueRegister = it.mutableMethod - .getInstruction(moveOriginalRecommendedValueIndex).registerA - - it.mutableMethod.addInstructions( - moveOriginalRecommendedValueIndex + 1, - """ - invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I - move-result v$originalValueRegister - """, - ) - } ?: throw StoryboardRendererDecoderRecommendedLevelFingerprint.exception - - // Hook the recommended precise seeking thumbnails quality level. - PlayerResponseModelImplRecommendedLevelFingerprint.result?.let { - it.mutableMethod.apply { - val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex - val originalValueRegister = - getInstruction(moveOriginalRecommendedValueIndex).registerA - - addInstructions( - moveOriginalRecommendedValueIndex, - """ - invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I - move-result v$originalValueRegister - """, - ) - } - } ?: throw PlayerResponseModelImplRecommendedLevelFingerprint.exception - - StoryboardRendererSpecFingerprint.result?.let { - it.mutableMethod.apply { - val storyBoardUrlParams = 0 - - addInstructionsWithLabels( - 0, - """ - if-nez p$storyBoardUrlParams, :ignore - invoke-static { p$storyBoardUrlParams }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String; - move-result-object p$storyBoardUrlParams - """, - ExternalLabel("ignore", getInstruction(0)), - ) - } - } ?: throw StoryboardRendererSpecFingerprint.exception - - // Hook the seekbar thumbnail decoder and use a NULL spec for live streams. - StoryboardRendererDecoderSpecFingerprint.result?.let { - val storyBoardUrlIndex = it.scanResult.patternScanResult!!.startIndex + 1 - val storyboardUrlRegister = - it.mutableMethod.getInstruction(storyBoardUrlIndex).registerA - - it.mutableMethod.addInstructions( - storyBoardUrlIndex + 1, - """ - invoke-static { v$storyboardUrlRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardDecoderRendererSpec(Ljava/lang/String;)Ljava/lang/String; - move-result-object v$storyboardUrlRegister - """, - ) - } ?: throw StoryboardRendererDecoderSpecFingerprint.exception - - // Fix stats not being tracked. - // Due to signature spoofing "adformat" is present in query parameters made for /stats requests, - // even though, for regular videos, it should not be. - // This breaks stats tracking. - // Replace the ad parameter with the video parameter in the query parameters. - StatsQueryParameterFingerprint.result?.let { - val putMethod = ParamsMapPutFingerprint.result?.method?.toString() - ?: throw ParamsMapPutFingerprint.exception - - it.mutableMethod.apply { - val adParamIndex = it.scanResult.stringsScanResult!!.matches.first().index - val videoParamIndex = adParamIndex + 3 - - // Replace the ad parameter with the video parameter. - replaceInstruction(adParamIndex, getInstruction(videoParamIndex)) - - // Call paramsMap.put instead of paramsMap.putIfNotExist - // because the key is already present in the map. - val putAdParamIndex = adParamIndex + 1 - val putIfKeyNotExistsInstruction = getInstruction(putAdParamIndex) - replaceInstruction( - putAdParamIndex, - "invoke-virtual { " + - "v${putIfKeyNotExistsInstruction.registerC}, " + - "v${putIfKeyNotExistsInstruction.registerD}, " + - "v${putIfKeyNotExistsInstruction.registerE} }, " + - putMethod, - ) - } - } ?: throw StatsQueryParameterFingerprint.exception - } + override fun execute(context: BytecodeContext) {} } + diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignatureResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignatureResourcePatch.kt index c29c94381b..ae164ebf1b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignatureResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignatureResourcePatch.kt @@ -2,18 +2,8 @@ package app.revanced.patches.youtube.misc.fix.playback import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -@Patch(dependencies = [ResourceMappingPatch::class]) @Deprecated("This patch will be removed in the future.") object SpoofSignatureResourcePatch : ResourcePatch() { - internal var scrubbedPreviewThumbnailResourceId: Long = -1 - - override fun execute(context: ResourceContext) { - scrubbedPreviewThumbnailResourceId = ResourceMappingPatch[ - "id", - "thumbnail", - ] - } + override fun execute(context: ResourceContext) {} } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/ParamsMapPutFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/ParamsMapPutFingerprint.kt deleted file mode 100644 index bb93acc882..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/ParamsMapPutFingerprint.kt +++ /dev/null @@ -1,25 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.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 - -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object ParamsMapPutFingerprint : MethodFingerprint( - returnType = "V", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf( - "Ljava/lang/String;", - "Ljava/lang/String;", - ), - opcodes = listOf( - Opcode.CONST_4, - Opcode.CONST_4, - Opcode.CONST_4, - Opcode.MOVE_OBJECT, - Opcode.MOVE_OBJECT, - Opcode.MOVE_OBJECT, - Opcode.INVOKE_DIRECT_RANGE, - ), -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt deleted file mode 100644 index 9328dd45c1..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.containsWideLiteralInstructionValue -import com.android.tools.smali.dexlib2.AccessFlags -import com.android.tools.smali.dexlib2.Opcode - -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object PlayerResponseModelImplGeneralFingerprint : MethodFingerprint( - returnType = "Ljava/lang/String;", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = emptyList(), - opcodes = listOf( - Opcode.RETURN_OBJECT, - Opcode.CONST_4, - Opcode.RETURN_OBJECT, - ), - customFingerprint = handler@{ methodDef, _ -> - if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false - - methodDef.containsWideLiteralInstructionValue(55735497) - }, -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt deleted file mode 100644 index 480bdb11fc..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.containsWideLiteralInstructionValue -import com.android.tools.smali.dexlib2.AccessFlags -import com.android.tools.smali.dexlib2.Opcode - -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object PlayerResponseModelImplLiveStreamFingerprint : MethodFingerprint( - returnType = "Ljava/lang/String;", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = emptyList(), - opcodes = listOf( - Opcode.RETURN_OBJECT, - Opcode.CONST_4, - Opcode.RETURN_OBJECT, - ), - customFingerprint = handler@{ methodDef, _ -> - if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false - - methodDef.containsWideLiteralInstructionValue(70276274) - }, -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplRecommendedLevelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplRecommendedLevelFingerprint.kt deleted file mode 100644 index 11de5b7fe0..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplRecommendedLevelFingerprint.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.containsWideLiteralInstructionValue -import com.android.tools.smali.dexlib2.AccessFlags -import com.android.tools.smali.dexlib2.Opcode - -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object PlayerResponseModelImplRecommendedLevelFingerprint : MethodFingerprint( - returnType = "I", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = emptyList(), - opcodes = listOf( - Opcode.SGET_OBJECT, - Opcode.IGET, - Opcode.RETURN, - ), - customFingerprint = handler@{ methodDef, _ -> - if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false - - methodDef.containsWideLiteralInstructionValue(55735497) - }, -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.kt deleted file mode 100644 index c15d94db92..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.kt +++ /dev/null @@ -1,28 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.misc.fix.playback.SpoofSignatureResourcePatch -import app.revanced.util.patch.LiteralValueFingerprint -import com.android.tools.smali.dexlib2.AccessFlags -import com.android.tools.smali.dexlib2.Opcode - -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object SpoofSignaturePatchScrubbedPreviewLayoutFingerprint : LiteralValueFingerprint( - accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, - returnType = "V", - parameters = listOf("Landroid/content/Context;", "Landroid/util/AttributeSet;", "I", "I"), - opcodes = listOf( - Opcode.INVOKE_STATIC, - Opcode.MOVE_RESULT_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.INVOKE_VIRTUAL, - Opcode.CONST, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - Opcode.CHECK_CAST, - Opcode.IPUT_OBJECT, // preview imageview - ), - // This resource is used in ~ 40 different locations, but this method has a distinct list of parameters to match to. - literalSupplier = { SpoofSignatureResourcePatch.scrubbedPreviewThumbnailResourceId }, -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StatsQueryParameterFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StatsQueryParameterFingerprint.kt deleted file mode 100644 index 24c8121367..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StatsQueryParameterFingerprint.kt +++ /dev/null @@ -1,8 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint - -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object StatsQueryParameterFingerprint : MethodFingerprint( - strings = listOf("adunit"), -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderRecommendedLevelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderRecommendedLevelFingerprint.kt deleted file mode 100644 index 482ca51a14..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderRecommendedLevelFingerprint.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.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 - -/** - * Resolves to the same method as [StoryboardRendererDecoderSpecFingerprint]. - */ -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object StoryboardRendererDecoderRecommendedLevelFingerprint : MethodFingerprint( - returnType = "V", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"), - opcodes = listOf( - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT_OBJECT, - Opcode.IPUT_OBJECT, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT, - ), - strings = listOf("#-1#"), -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderSpecFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderSpecFingerprint.kt deleted file mode 100644 index a2a31800f5..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderSpecFingerprint.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.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 - -/** - * Resolves to the same method as [StoryboardRendererDecoderRecommendedLevelFingerprint]. - */ -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object StoryboardRendererDecoderSpecFingerprint : MethodFingerprint( - returnType = "V", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"), - opcodes = listOf( - Opcode.INVOKE_INTERFACE, // First instruction of the method. - Opcode.MOVE_RESULT_OBJECT, - Opcode.CONST_4, - Opcode.CONST_4, - Opcode.IF_NEZ, - ), - strings = listOf("#-1#"), -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererSpecFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererSpecFingerprint.kt deleted file mode 100644 index cc00d0ccdc..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererSpecFingerprint.kt +++ /dev/null @@ -1,13 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.AccessFlags - -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object StoryboardRendererSpecFingerprint : MethodFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, - returnType = "L", - parameters = listOf("Ljava/lang/String;", "J"), - strings = listOf("\\|"), -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailFingerprint.kt deleted file mode 100644 index 88e368db5f..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailFingerprint.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.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 - -/** - * Resolves using the class found in [StoryboardThumbnailParentFingerprint]. - */ -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object StoryboardThumbnailFingerprint : MethodFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - returnType = "Z", - parameters = listOf(), - opcodes = listOf( - Opcode.MOVE_RESULT, - Opcode.IF_GTZ, - Opcode.GOTO, - Opcode.CONST_4, - Opcode.RETURN, - Opcode.RETURN, // Last instruction of method. - ), -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailParentFingerprint.kt deleted file mode 100644 index f8e449405f..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailParentFingerprint.kt +++ /dev/null @@ -1,18 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.AccessFlags - -/** - * Here lies code that creates the seekbar thumbnails. - * - * An additional change here might force the thumbnails to be created, - * or possibly a change somewhere else (maybe involving YouTube 18.23.35 class `hte`) - */ -@Deprecated("Fingerprint is obsolete and will be deleted soon") -internal object StoryboardThumbnailParentFingerprint : MethodFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - returnType = "Landroid/graphics/Bitmap;", - strings = listOf("Storyboard regionDecoder.decodeRegion exception - "), -) diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index e783d62141..715b452733 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1143,23 +1143,6 @@ This is because Crowdin requires temporarily flattening this file and removing t Video codec is AVC, VP9, or AV1 Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1. - - - Spoof app signature - Spoof the app signature to prevent playback issues - Spoof app signature - App signature spoofed\n\nSide effects include:\n• Enhanced bitrate is not available\n• Videos cannot be downloaded\n• No seekbar thumbnails for paid videos - App signature not spoofed\n\nVideo playback may not work - Turning off this setting will cause video playback issues. - Spoof app signature in feed - App signature spoofed\n\nSide effects include:\n• Feed videos are missing subtitles\n• Automatically played feed videos will show up in your watch history - App signature not spoofed for feed videos\n\nFeed videos will play for less than 1 minute before encountering playback issues - Spoof storyboard - Storyboard spoofed - Storyboard not spoofed\n\nSide effects include:\n• No ambient mode\n• Seekbar thumbnails are hidden - Spoof storyboard temporarily not available (API timed out) - Spoof storyboard temporarily not available: %s - Enable auto HDR brightness From f7dcb59b28179794a00b232d48991ed34f865536 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 27 Aug 2024 01:13:07 -0400 Subject: [PATCH 006/143] refactor: Comments, rename repurposed code --- .../patches/youtube/misc/fix/playback/SpoofClientPatch.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 9253ba0d40..4ec50a60b8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -139,7 +139,7 @@ object SpoofClientPatch : BytecodePatch( // endregion - // region Fix video qualities missing, if spoofing to iOS by overriding the user agent. + // region Fetch replacement streams. BuildRequestFingerprint.resultOrThrow().let { result -> result.mutableMethod.apply { @@ -149,12 +149,12 @@ object SpoofClientPatch : BytecodePatch( val newRequestBuilderIndex = result.scanResult.patternScanResult!!.endIndex val urlRegister = getInstruction(newRequestBuilderIndex).registerD - // Replace "requestBuilder.build(): Request" with "overrideUserAgent(requestBuilder, url): Request". + // Replace "requestBuilder.build()" with integrations call. replaceInstruction( buildRequestIndex, "invoke-static { v$requestBuilderRegister, v$urlRegister, v${urlRegister + 1} }, " + "$INTEGRATIONS_CLASS_DESCRIPTOR->" + - "overrideUserAgent(${REQUEST_BUILDER_CLASS_DESCRIPTOR}Ljava/lang/String;Ljava/util/Map;)" + + "buildRequest(${REQUEST_BUILDER_CLASS_DESCRIPTOR}Ljava/lang/String;Ljava/util/Map;)" + REQUEST_CLASS_DESCRIPTOR ) @@ -165,7 +165,7 @@ object SpoofClientPatch : BytecodePatch( // endregion - // region Fix playback by replace the streaming data. + // region Replace the streaming data. CreateStreamingDataFingerprint.resultOrThrow().let { result -> result.mutableMethod.apply { From 26733c85f57a73c14d2155090092207859e8295c Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 28 Aug 2024 16:37:13 -0400 Subject: [PATCH 007/143] fix: Can use non experimental parent class type --- .../patches/youtube/misc/fix/playback/SpoofClientPatch.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 4ec50a60b8..42e5e3e3e2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -79,9 +79,9 @@ object SpoofClientPatch : BytecodePatch( private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/spoof/SpoofClientPatch;" private const val REQUEST_CLASS_DESCRIPTOR = - "Lorg/chromium/net/ExperimentalUrlRequest;" + "Lorg/chromium/net/UrlRequest;" private const val REQUEST_BUILDER_CLASS_DESCRIPTOR = - "Lorg/chromium/net/ExperimentalUrlRequest\$Builder;" + "Lorg/chromium/net/UrlRequest\$Builder;" private const val STREAMING_DATA_CLASS_DESCRIPTOR = "Lcom/google/protos/youtube/api/innertube/StreamingDataOuterClass\$StreamingData;" From 4ccfdf4fa43d3c56a51ca03f103e528230451175 Mon Sep 17 00:00:00 2001 From: zainarbani Date: Sat, 31 Aug 2024 21:51:39 +0700 Subject: [PATCH 008/143] Don't block /get_watch --- .../misc/fix/playback/SpoofClientPatch.kt | 62 +++++-------------- ...nt.kt => BuildBrowseRequestFingerprint.kt} | 2 +- .../BuildPlayerRequestURIFingerprint.kt | 21 ------- 3 files changed, 17 insertions(+), 68 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/{BuildRequestFingerprint.kt => BuildBrowseRequestFingerprint.kt} (87%) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildPlayerRequestURIFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 42e5e3e3e2..701ffc2099 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -6,7 +6,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions -import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch @@ -14,12 +13,12 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen import app.revanced.patches.shared.misc.settings.preference.SwitchPreference +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildBrowseRequestFingerprint import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildInitPlaybackRequestFingerprint import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildMediaDataSourceFingerprint -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildPlayerRequestURIFingerprint -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildRequestFingerprint import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreateStreamingDataFingerprint import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.patches.youtube.video.videoid.VideoIdPatch import app.revanced.util.getReference import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode @@ -35,6 +34,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference SettingsPatch::class, AddResourcesPatch::class, UserAgentClientSpoofPatch::class, + VideoIdPatch::class, ], compatiblePackages = [ CompatiblePackage( @@ -70,18 +70,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference object SpoofClientPatch : BytecodePatch( setOf( BuildInitPlaybackRequestFingerprint, - BuildPlayerRequestURIFingerprint, + BuildBrowseRequestFingerprint, CreateStreamingDataFingerprint, - BuildMediaDataSourceFingerprint, - BuildRequestFingerprint + BuildMediaDataSourceFingerprint ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/spoof/SpoofClientPatch;" - private const val REQUEST_CLASS_DESCRIPTOR = - "Lorg/chromium/net/UrlRequest;" - private const val REQUEST_BUILDER_CLASS_DESCRIPTOR = - "Lorg/chromium/net/UrlRequest\$Builder;" private const val STREAMING_DATA_CLASS_DESCRIPTOR = "Lcom/google/protos/youtube/api/innertube/StreamingDataOuterClass\$StreamingData;" @@ -99,6 +94,9 @@ object SpoofClientPatch : BytecodePatch( ) ) + // Prefetch streaming data. + VideoIdPatch.hookPlayerResponseVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->fetchStreamingData(Ljava/lang/String;Z)V") + // region Block /initplayback requests to fall back to /get_watch requests. BuildInitPlaybackRequestFingerprint.resultOrThrow().let { @@ -119,47 +117,19 @@ object SpoofClientPatch : BytecodePatch( // endregion - // region Block /get_watch requests to fall back to /player requests. - - BuildPlayerRequestURIFingerprint.resultOrThrow().let { - val invokeToStringIndex = it.scanResult.patternScanResult!!.startIndex + // region Copy request headers for streaming data fetch. + BuildBrowseRequestFingerprint.resultOrThrow().let { it.mutableMethod.apply { - val uriRegister = getInstruction(invokeToStringIndex).registerC - - addInstructions( - invokeToStringIndex, - """ - invoke-static { v$uriRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->blockGetWatchRequest(Landroid/net/Uri;)Landroid/net/Uri; - move-result-object v$uriRegister - """, - ) - } - } - - // endregion - - // region Fetch replacement streams. - - BuildRequestFingerprint.resultOrThrow().let { result -> - result.mutableMethod.apply { - val buildRequestIndex = getInstructions().lastIndex - 2 - val requestBuilderRegister = getInstruction(buildRequestIndex).registerC - - val newRequestBuilderIndex = result.scanResult.patternScanResult!!.endIndex + val newRequestBuilderIndex = it.scanResult.patternScanResult!!.endIndex val urlRegister = getInstruction(newRequestBuilderIndex).registerD - // Replace "requestBuilder.build()" with integrations call. - replaceInstruction( - buildRequestIndex, - "invoke-static { v$requestBuilderRegister, v$urlRegister, v${urlRegister + 1} }, " + - "$INTEGRATIONS_CLASS_DESCRIPTOR->" + - "buildRequest(${REQUEST_BUILDER_CLASS_DESCRIPTOR}Ljava/lang/String;Ljava/util/Map;)" + - REQUEST_CLASS_DESCRIPTOR + addInstruction( + newRequestBuilderIndex, + """ + invoke-static { v$urlRegister, p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setFetchHeaders(Ljava/lang/String;Ljava/util/Map;)V + """ ) - - // Copy request headers for streaming data fetch. - addInstruction(newRequestBuilderIndex + 2, "move-object v${urlRegister + 1}, p1") } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildRequestFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildBrowseRequestFingerprint.kt similarity index 87% rename from src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildRequestFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildBrowseRequestFingerprint.kt index 49c4a76ee1..9f3e235b56 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildRequestFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildBrowseRequestFingerprint.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -internal object BuildRequestFingerprint : MethodFingerprint( +internal object BuildBrowseRequestFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, returnType = "Lorg/chromium/net/UrlRequest;", opcodes = listOf( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildPlayerRequestURIFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildPlayerRequestURIFingerprint.kt deleted file mode 100644 index 1cdab0f354..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildPlayerRequestURIFingerprint.kt +++ /dev/null @@ -1,21 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.Opcode - -internal object BuildPlayerRequestURIFingerprint : MethodFingerprint( - returnType = "Ljava/lang/String;", - opcodes = listOf( - Opcode.INVOKE_VIRTUAL, // Register holds player request URI. - Opcode.MOVE_RESULT_OBJECT, - Opcode.IPUT_OBJECT, - Opcode.IGET_OBJECT, - Opcode.MONITOR_EXIT, - Opcode.RETURN_OBJECT, - ), - strings = listOf( - "youtubei/v1", - "key", - "asig", - ), -) From 20a7adecc9593a3614ff0dbe9e9fae057e9d6779 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 2 Sep 2024 01:33:28 -0400 Subject: [PATCH 009/143] fix: Constrain to working versions --- .../youtube/misc/fix/playback/SpoofClientPatch.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 701ffc2099..5a583b5a92 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -40,11 +40,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference CompatiblePackage( "com.google.android.youtube", [ - "18.37.36", - "18.38.44", - "18.43.45", - "18.44.41", - "18.45.43", + // This patch supports these version, but VideoIdPatch does not. + // "18.37.36", + // "18.38.44", + // "18.43.45", + // "18.44.41", + // "18.45.43", "18.48.39", "18.49.37", "19.01.34", From 65139090172dc734d2e93b41cbcf40f96cac2ebb Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 3 Sep 2024 00:25:55 -0400 Subject: [PATCH 010/143] Revert "Don't block /get_watch" --- .../misc/fix/playback/SpoofClientPatch.kt | 73 +++++++++++++------ .../BuildPlayerRequestURIFingerprint.kt | 21 ++++++ ...gerprint.kt => BuildRequestFingerprint.kt} | 2 +- 3 files changed, 73 insertions(+), 23 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildPlayerRequestURIFingerprint.kt rename src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/{BuildBrowseRequestFingerprint.kt => BuildRequestFingerprint.kt} (87%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 5a583b5a92..42e5e3e3e2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -6,6 +6,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions +import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch @@ -13,12 +14,12 @@ import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildBrowseRequestFingerprint import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildInitPlaybackRequestFingerprint import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildMediaDataSourceFingerprint +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildPlayerRequestURIFingerprint +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildRequestFingerprint import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreateStreamingDataFingerprint import app.revanced.patches.youtube.misc.settings.SettingsPatch -import app.revanced.patches.youtube.video.videoid.VideoIdPatch import app.revanced.util.getReference import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode @@ -34,18 +35,16 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference SettingsPatch::class, AddResourcesPatch::class, UserAgentClientSpoofPatch::class, - VideoIdPatch::class, ], compatiblePackages = [ CompatiblePackage( "com.google.android.youtube", [ - // This patch supports these version, but VideoIdPatch does not. - // "18.37.36", - // "18.38.44", - // "18.43.45", - // "18.44.41", - // "18.45.43", + "18.37.36", + "18.38.44", + "18.43.45", + "18.44.41", + "18.45.43", "18.48.39", "18.49.37", "19.01.34", @@ -71,13 +70,18 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference object SpoofClientPatch : BytecodePatch( setOf( BuildInitPlaybackRequestFingerprint, - BuildBrowseRequestFingerprint, + BuildPlayerRequestURIFingerprint, CreateStreamingDataFingerprint, - BuildMediaDataSourceFingerprint + BuildMediaDataSourceFingerprint, + BuildRequestFingerprint ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/spoof/SpoofClientPatch;" + private const val REQUEST_CLASS_DESCRIPTOR = + "Lorg/chromium/net/UrlRequest;" + private const val REQUEST_BUILDER_CLASS_DESCRIPTOR = + "Lorg/chromium/net/UrlRequest\$Builder;" private const val STREAMING_DATA_CLASS_DESCRIPTOR = "Lcom/google/protos/youtube/api/innertube/StreamingDataOuterClass\$StreamingData;" @@ -95,9 +99,6 @@ object SpoofClientPatch : BytecodePatch( ) ) - // Prefetch streaming data. - VideoIdPatch.hookPlayerResponseVideoId("$INTEGRATIONS_CLASS_DESCRIPTOR->fetchStreamingData(Ljava/lang/String;Z)V") - // region Block /initplayback requests to fall back to /get_watch requests. BuildInitPlaybackRequestFingerprint.resultOrThrow().let { @@ -118,19 +119,47 @@ object SpoofClientPatch : BytecodePatch( // endregion - // region Copy request headers for streaming data fetch. + // region Block /get_watch requests to fall back to /player requests. + + BuildPlayerRequestURIFingerprint.resultOrThrow().let { + val invokeToStringIndex = it.scanResult.patternScanResult!!.startIndex - BuildBrowseRequestFingerprint.resultOrThrow().let { it.mutableMethod.apply { - val newRequestBuilderIndex = it.scanResult.patternScanResult!!.endIndex - val urlRegister = getInstruction(newRequestBuilderIndex).registerD + val uriRegister = getInstruction(invokeToStringIndex).registerC - addInstruction( - newRequestBuilderIndex, - """ - invoke-static { v$urlRegister, p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setFetchHeaders(Ljava/lang/String;Ljava/util/Map;)V + addInstructions( + invokeToStringIndex, """ + invoke-static { v$uriRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->blockGetWatchRequest(Landroid/net/Uri;)Landroid/net/Uri; + move-result-object v$uriRegister + """, + ) + } + } + + // endregion + + // region Fetch replacement streams. + + BuildRequestFingerprint.resultOrThrow().let { result -> + result.mutableMethod.apply { + val buildRequestIndex = getInstructions().lastIndex - 2 + val requestBuilderRegister = getInstruction(buildRequestIndex).registerC + + val newRequestBuilderIndex = result.scanResult.patternScanResult!!.endIndex + val urlRegister = getInstruction(newRequestBuilderIndex).registerD + + // Replace "requestBuilder.build()" with integrations call. + replaceInstruction( + buildRequestIndex, + "invoke-static { v$requestBuilderRegister, v$urlRegister, v${urlRegister + 1} }, " + + "$INTEGRATIONS_CLASS_DESCRIPTOR->" + + "buildRequest(${REQUEST_BUILDER_CLASS_DESCRIPTOR}Ljava/lang/String;Ljava/util/Map;)" + + REQUEST_CLASS_DESCRIPTOR ) + + // Copy request headers for streaming data fetch. + addInstruction(newRequestBuilderIndex + 2, "move-object v${urlRegister + 1}, p1") } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildPlayerRequestURIFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildPlayerRequestURIFingerprint.kt new file mode 100644 index 0000000000..1cdab0f354 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildPlayerRequestURIFingerprint.kt @@ -0,0 +1,21 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.Opcode + +internal object BuildPlayerRequestURIFingerprint : MethodFingerprint( + returnType = "Ljava/lang/String;", + opcodes = listOf( + Opcode.INVOKE_VIRTUAL, // Register holds player request URI. + Opcode.MOVE_RESULT_OBJECT, + Opcode.IPUT_OBJECT, + Opcode.IGET_OBJECT, + Opcode.MONITOR_EXIT, + Opcode.RETURN_OBJECT, + ), + strings = listOf( + "youtubei/v1", + "key", + "asig", + ), +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildBrowseRequestFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildRequestFingerprint.kt similarity index 87% rename from src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildBrowseRequestFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildRequestFingerprint.kt index 9f3e235b56..49c4a76ee1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildBrowseRequestFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildRequestFingerprint.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -internal object BuildBrowseRequestFingerprint : MethodFingerprint( +internal object BuildRequestFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, returnType = "Lorg/chromium/net/UrlRequest;", opcodes = listOf( From aad5e50d8ce117a34314f9e5393963ba37d5bd1c Mon Sep 17 00:00:00 2001 From: zainarbani Date: Sun, 8 Sep 2024 05:27:56 +0700 Subject: [PATCH 011/143] feat(YouTube): Support version `~19.31` --- .../youtube/ad/general/HideAdsPatch.kt | 1 + .../ad/getpremium/HideGetPremiumPatch.kt | 1 + .../patches/youtube/ad/video/VideoAdsPatch.kt | 1 + .../copyvideourl/CopyVideoUrlBytecodePatch.kt | 1 + .../RemoveViewerDiscretionDialogPatch.kt | 1 + .../interaction/downloads/DownloadsPatch.kt | 1 + .../DisablePreciseSeekingGesturePatch.kt | 3 +- .../seekbar/EnableSeekbarTappingPatch.kt | 1 + .../seekbar/EnableSlideToSeekPatch.kt | 1 + .../fingerprints/IsSwipingUpFingerprint.kt | 6 +- .../SwipeControlsBytecodePatch.kt | 1 + .../layout/autocaptions/AutoCaptionsPatch.kt | 1 + .../layout/buttons/action/HideButtonsPatch.kt | 1 + .../autoplay/HideAutoplayButtonPatch.kt | 1 + .../captions/HideCaptionsButtonPatch.kt | 1 + .../navigation/NavigationButtonsPatch.kt | 1 + .../player/hide/HidePlayerButtonsPatch.kt | 1 + .../layout/hide/albumcards/AlbumCardsPatch.kt | 1 + .../layout/hide/comments/CommentsPatch.kt | 1 + .../crowdfundingbox/CrowdfundingBoxPatch.kt | 1 + .../endscreencards/HideEndscreenCardsPatch.kt | 1 + .../hide/filterbar/HideFilterBarPatch.kt | 1 + .../HideFloatingMicrophoneButtonPatch.kt | 1 + .../DisableFullscreenAmbientModePatch.kt | 1 + .../hide/general/HideLayoutComponentsPatch.kt | 1 + .../hide/infocards/HideInfoCardsPatch.kt | 1 + .../HidePlayerFlyoutMenuPatch.kt | 1 + .../DisableRollingNumberAnimationPatch.kt | 1 + .../layout/hide/seekbar/HideSeekbarPatch.kt | 1 + .../hide/shorts/HideShortsComponentsPatch.kt | 11 +- .../BottomNavigationBarNewFingerprint.kt | 24 ++++ .../DisableSuggestedVideoEndScreenPatch.kt | 1 + .../layout/hide/time/HideTimestampPatch.kt | 1 + .../layout/miniplayer/MiniplayerPatch.kt | 34 ++--- .../miniplayer/MiniplayerResourcePatch.kt | 26 ++-- .../MiniplayerOverrideFingerprint.kt | 1 - .../panels/popup/PlayerPopupPanelsPatch.kt | 1 + .../PlayerControlsBackgroundPatch.kt | 1 + .../ReturnYouTubeDislikePatch.kt | 21 ++- .../RollingNumberSetterFingerprint.kt | 2 +- .../RollingNumberTextViewFingerprint.kt | 5 +- .../fingerprints/ShortsTextViewFingerprint.kt | 14 +- .../layout/searchbar/WideSearchbarPatch.kt | 1 + .../SetWordmarkHeaderFingerprint.kt | 2 +- .../RestoreOldSeekbarThumbnailsPatch.kt | 2 +- .../sponsorblock/SponsorBlockBytecodePatch.kt | 1 + .../spoofappversion/SpoofAppVersionPatch.kt | 1 + .../DisableResumingShortsOnStartupPatch.kt | 1 + .../layout/tablet/EnableTabletLayoutPatch.kt | 3 +- .../layout/theme/ThemeBytecodePatch.kt | 1 + .../thumbnails/AlternativeThumbnailsPatch.kt | 1 + .../BypassImageRegionRestrictions.kt | 1 + .../misc/autorepeat/AutoRepeatPatch.kt | 1 + .../BackgroundPlaybackPatch.kt | 1 + ...oundPlaybackPolicyControllerFingerprint.kt | 8 +- .../spoof/SpoofDeviceDimensionsPatch.kt | 1 + ...ckWatchHistoryDomainNameResolutionPatch.kt | 1 + .../misc/fix/playback/SpoofClientPatch.kt | 1 + .../youtube/misc/gms/GmsCoreSupportPatch.kt | 1 + .../misc/imageurlhook/CronetImageUrlHook.kt | 5 +- .../misc/links/BypassURLRedirectsPatch.kt | 1 + .../misc/links/OpenLinksExternallyPatch.kt | 1 + .../misc/litho/filter/LithoFilterPatch.kt | 130 +++++++++--------- .../ComponentContextParserFingerprint.kt | 5 + .../EmptyComponentBuilderFingerprint.kt | 11 -- .../ReadComponentIdentifierFingerprint.kt | 3 +- .../InitializeButtonsFingerprint.kt | 1 - .../BottomControlsInflateFingerprint.kt | 3 - .../RemoveTrackingQueryParameterPatch.kt | 1 + .../hook/RecyclerViewTreeHookPatch.kt | 2 +- .../RecyclerViewTreeObserverFingerprint.kt | 5 +- ...umberTextViewAnimationUpdateFingerprint.kt | 5 +- .../PlayerResponseMethodHookPatch.kt | 5 +- .../PlayerParameterBuilderFingerprint.kt | 19 +-- .../quality/RememberVideoQualityPatch.kt | 1 + .../youtube/video/speed/PlaybackSpeedPatch.kt | 1 + .../speed/custom/CustomPlaybackSpeedPatch.kt | 5 +- .../RestoreOldVideoQualityMenuPatch.kt | 1 + 78 files changed, 246 insertions(+), 165 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarNewFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/EmptyComponentBuilderFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index fd6ffde4b9..0c658d0570 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -50,6 +50,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt index a36063d3d3..8d96a0caf7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt @@ -44,6 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt index b2df5d82b1..ea1ede7d51 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt @@ -49,6 +49,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt index 5d740aa59c..143cc01b31 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt @@ -37,6 +37,7 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt index 83b391cb8f..69ba063d6e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt @@ -46,6 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt index b22a146166..780e07ec9a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt @@ -43,6 +43,7 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt index 4923a6c4ee..8deda89767 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt @@ -46,6 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] @@ -66,7 +67,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(addMovementIndex) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt index eaae9af877..a3e2bd516e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt @@ -48,6 +48,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt index e6ed839e4b..df6e3259ea 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt @@ -44,6 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/IsSwipingUpFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/IsSwipingUpFingerprint.kt index 3029925adc..9ebb3fd922 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/IsSwipingUpFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/IsSwipingUpFingerprint.kt @@ -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 ) ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt index 819ea52cad..8124917de2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt @@ -50,6 +50,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt index fabd8cc3ae..60fd2c9a06 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt @@ -48,6 +48,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt index 1da88f35cb..0f226b5e98 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt @@ -47,6 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt index 6446f32a43..833e2dad27 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt @@ -58,6 +58,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt index e346945db4..30fb44a3cf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt @@ -48,6 +48,7 @@ import com.android.tools.smali.dexlib2.Opcode "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt index 10e8d36045..1b77d96a83 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt @@ -61,6 +61,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt index 2199b05d8e..b8b8f84524 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt @@ -52,6 +52,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt index 782999c106..d7e6a0cc96 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt @@ -46,6 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index 51280ac183..539c3a0087 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -46,6 +46,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt index 938d91eb70..43e18bfcd2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -46,6 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt index 396e9a8c35..a2e3919d83 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt @@ -49,6 +49,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt index 37915f48d0..fa96c01c4e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt @@ -46,6 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt index 697b081fc7..83b9193766 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt @@ -42,6 +42,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt index 0d7ccb956c..64fbad8e41 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt @@ -42,6 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index bff904da08..7eda35b07a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -64,6 +64,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index 92b2d5a4f8..bd43a412ba 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -53,6 +53,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt index 6bf5c58eb7..9f68d9e625 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt @@ -47,6 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt index 0e7b98850f..07bef44aa9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt @@ -44,6 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt index 6f369184a4..3fe8155422 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt @@ -49,6 +49,7 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 5b81773834..27df8f25c6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -60,6 +60,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], @@ -70,6 +71,7 @@ object HideShortsComponentsPatch : BytecodePatch( CreateShortsButtonsFingerprint, ReelConstructorFingerprint, BottomNavigationBarFingerprint, + BottomNavigationBarNewFingerprint, RenderBottomNavigationBarParentFingerprint, SetPivotBarVisibilityParentFingerprint, ), @@ -145,7 +147,12 @@ object HideShortsComponentsPatch : BytecodePatch( } ?: throw RenderBottomNavigationBarParentFingerprint.exception // Required to prevent a black bar from appearing at the bottom of the screen. - BottomNavigationBarFingerprint.result?.let { + // BottomNavigationBar class deprecated on 19.29+. + val bottomNavigationBarResult = + BottomNavigationBarFingerprint.result ?: BottomNavigationBarNewFingerprint.result + ?: throw BottomNavigationBarFingerprint.exception + + bottomNavigationBarResult?.let { it.mutableMethod.apply { val moveResultIndex = it.scanResult.patternScanResult!!.startIndex + 2 val viewRegister = getInstruction(moveResultIndex).registerA @@ -157,7 +164,7 @@ object HideShortsComponentsPatch : BytecodePatch( "hideNavigationBar(Landroid/view/View;)Landroid/view/View;", ) } - } ?: throw BottomNavigationBarFingerprint.exception + } // endregion } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarNewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarNewFingerprint.kt new file mode 100644 index 0000000000..f756c1adf6 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarNewFingerprint.kt @@ -0,0 +1,24 @@ +package app.revanced.patches.youtube.layout.hide.shorts.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 BottomNavigationBarNewFingerprint : MethodFingerprint( + returnType = "V", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"), + opcodes = listOf( + Opcode.CONST, // R.id.app_engagement_panel_wrapper + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.IF_EQZ, + Opcode.IGET_OBJECT, + Opcode.IGET_OBJECT, + Opcode.IGET_OBJECT, + ), + strings = listOf( + "r_pfvc" + ), +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt index aee5ad2884..08be450199 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt @@ -41,6 +41,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt index 1fee6435e9..7096a1f211 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt @@ -42,6 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 4d7c52a48f..85150a5d96 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -100,7 +100,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter // It's simpler to not bother with supporting this single old version. // 19.15 has a different code for handling sub title texts, // and also probably not worth making changes just to support this single old version. - "19.16.39" // Earliest supported version with modern miniplayers. + "19.16.39", // Earliest supported version with modern miniplayers. + "19.31.36" ] ) ] @@ -123,7 +124,7 @@ object MiniplayerPatch : BytecodePatch( // Modern mini player is only present and functional in 19.15+. // Resource is not present in older versions. Using it to determine, if patching an old version. - val isPatchingOldVersion = ytOutlinePictureInPictureWhite24 < 0 + val isPatchingOldVersion = modernMiniplayerClose < 0 SettingsPatch.PreferenceScreen.PLAYER.addPreferences( PreferenceScreen( @@ -217,21 +218,22 @@ object MiniplayerPatch : BytecodePatch( // region Fix 19.16 using mixed up drawables for tablet modern. // YT fixed this mistake in 19.17. // Fix this, by swapping the drawable resource values with each other. + if (ytOutlinePictureInPictureWhite24 >= 0) { + MiniplayerModernExpandCloseDrawablesFingerprint.apply { + resolve( + context, + MiniplayerModernViewParentFingerprint.resultOrThrow().classDef + ) + }.resultOrThrow().mutableMethod.apply { + listOf( + ytOutlinePictureInPictureWhite24 to ytOutlineXWhite24, + ytOutlineXWhite24 to ytOutlinePictureInPictureWhite24, + ).forEach { (originalResource, replacementResource) -> + val imageResourceIndex = indexOfFirstWideLiteralInstructionValueOrThrow(originalResource) + val register = getInstruction(imageResourceIndex).registerA - MiniplayerModernExpandCloseDrawablesFingerprint.apply { - resolve( - context, - MiniplayerModernViewParentFingerprint.resultOrThrow().classDef - ) - }.resultOrThrow().mutableMethod.apply { - listOf( - ytOutlinePictureInPictureWhite24 to ytOutlineXWhite24, - ytOutlineXWhite24 to ytOutlinePictureInPictureWhite24, - ).forEach { (originalResource, replacementResource) -> - val imageResourceIndex = indexOfFirstWideLiteralInstructionValueOrThrow(originalResource) - val register = getInstruction(imageResourceIndex).registerA - - replaceInstruction(imageResourceIndex, "const v$register, $replacementResource") + replaceInstruction(imageResourceIndex, "const v$register, $replacementResource") + } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt index 3870f06544..07aa95487b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt @@ -5,6 +5,8 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch +import app.revanced.util.getNode +import org.w3c.dom.Element @Patch(dependencies = [ResourceMappingPatch::class]) internal object MiniplayerResourcePatch : ResourcePatch() { @@ -21,19 +23,22 @@ internal object MiniplayerResourcePatch : ResourcePatch() { var playerOverlays = -1L override fun execute(context: ResourceContext) { + val appVersionName = context.document["AndroidManifest.xml"].use { document -> + val manifestElement = document.getNode("manifest") as Element + manifestElement.getAttribute("android:versionName") + } + floatyBarButtonTopMargin = ResourceMappingPatch[ "dimen", "floaty_bar_button_top_margin" ] - try { + // Only required for 19.16. + if (appVersionName.contains("19.16")) { ytOutlinePictureInPictureWhite24 = ResourceMappingPatch[ "drawable", "yt_outline_picture_in_picture_white_24" ] - } catch (exception: PatchException) { - // Ignore, and assume the app is 19.14 or earlier. - return } ytOutlineXWhite24 = ResourceMappingPatch[ @@ -46,10 +51,15 @@ internal object MiniplayerResourcePatch : ResourcePatch() { "scrim_overlay" ] - modernMiniplayerClose = ResourceMappingPatch[ - "id", - "modern_miniplayer_close" - ] + try { + modernMiniplayerClose = ResourceMappingPatch[ + "id", + "modern_miniplayer_close" + ] + } catch (exception: PatchException) { + // Ignore, and assume the app is 19.14 or earlier. + return + } modernMiniplayerExpand = ResourceMappingPatch[ "id", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerOverrideFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerOverrideFingerprint.kt index 9d9bf5e153..3a1fbfb43b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerOverrideFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerOverrideFingerprint.kt @@ -7,6 +7,5 @@ import com.android.tools.smali.dexlib2.AccessFlags internal object MiniplayerOverrideFingerprint : MethodFingerprint( returnType = "L", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf("L"), strings = listOf("appName") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt index c93d718f5b..4d20c79d84 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt @@ -43,6 +43,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt index eec03ff01f..9b0ee2e5ae 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt @@ -38,6 +38,7 @@ import org.w3c.dom.Element "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index 8e4556a008..766c11714f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -5,6 +5,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction +import app.revanced.patcher.extensions.InstructionExtensions.getInstructions import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException @@ -72,6 +73,7 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] @@ -184,20 +186,27 @@ object ReturnYouTubeDislikePatch : BytecodePatch( ShortsTextViewFingerprint.result?.let { it.mutableMethod.apply { - val patternResult = it.scanResult.patternScanResult!! + val insertIndex = it.scanResult.patternScanResult!!.endIndex // If the field is true, the TextView is for a dislike button. - val isDisLikesBooleanReference = getInstruction(patternResult.endIndex).reference + val isDisLikesBooleanInstruction = getInstructions().first { instruction -> + instruction.opcode == Opcode.IGET_BOOLEAN + } as ReferenceInstruction - val textViewFieldReference = // Like/Dislike button TextView field - getInstruction(patternResult.endIndex - 1).reference + val isDisLikesBooleanReference = isDisLikesBooleanInstruction.reference + + // Like/Dislike button TextView field. + val textViewFieldInstruction = getInstructions().first { instruction -> + instruction.opcode == Opcode.IGET_OBJECT + } as ReferenceInstruction + + val textViewFieldReference = textViewFieldInstruction.reference // Check if the hooked TextView object is that of the dislike button. // If RYD is disabled, or the TextView object is not that of the dislike button, the execution flow is not interrupted. // Otherwise, the TextView object is modified, and the execution flow is interrupted to prevent it from being changed afterward. - val insertIndex = patternResult.startIndex + 6 addInstructionsWithLabels( - insertIndex, + insertIndex + 1, """ # Check, if the TextView is for a dislike button iget-boolean v0, p0, $isDisLikesBooleanReference diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberSetterFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberSetterFingerprint.kt index e79cf27292..e497007544 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberSetterFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberSetterFingerprint.kt @@ -8,5 +8,5 @@ internal object RollingNumberSetterFingerprint : MethodFingerprint( Opcode.INVOKE_DIRECT, Opcode.IGET_OBJECT ), - strings = listOf("RollingNumberType required properties missing! Need updateCount, fontName, color and fontSize.") + strings = listOf("RollingNumberType required properties missing! Need") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberTextViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberTextViewFingerprint.kt index 54fe00865f..2aab0d2071 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberTextViewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberTextViewFingerprint.kt @@ -18,6 +18,9 @@ internal object RollingNumberTextViewFingerprint : MethodFingerprint( Opcode.RETURN_VOID ), customFingerprint = { _, classDef -> - classDef.superclass == "Landroid/support/v7/widget/AppCompatTextView;" + val appCompatTextView = "Landroid/support/v7/widget/AppCompatTextView;" + val youTubeAppCompatTextView = "Lcom/google/android/libraries/youtube/rendering/ui/spec/typography/YouTubeAppCompatTextView;" + + classDef.superclass in listOf(appCompatTextView, youTubeAppCompatTextView) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/ShortsTextViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/ShortsTextViewFingerprint.kt index a326a6ced8..75ec556068 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/ShortsTextViewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/ShortsTextViewFingerprint.kt @@ -15,18 +15,6 @@ internal object ShortsTextViewFingerprint : MethodFingerprint( null, Opcode.INVOKE_VIRTUAL, Opcode.MOVE_RESULT_OBJECT, - Opcode.CHECK_CAST, - Opcode.SGET_OBJECT, // insertion point, must be after constructor call to parent class - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.CONST_4, - Opcode.IF_EQZ, - Opcode.CONST_4, - Opcode.IF_EQ, - Opcode.CONST_4, - Opcode.IF_EQ, - Opcode.RETURN_VOID, - Opcode.IGET_OBJECT, // TextView field - Opcode.IGET_BOOLEAN, // boolean field + Opcode.CHECK_CAST ) ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index c8a75eb11c..8db63d9194 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -47,6 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/fingerprints/SetWordmarkHeaderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/fingerprints/SetWordmarkHeaderFingerprint.kt index bc5f29ff8e..0d4fa777e0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/fingerprints/SetWordmarkHeaderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/fingerprints/SetWordmarkHeaderFingerprint.kt @@ -18,6 +18,6 @@ internal object SetWordmarkHeaderFingerprint : MethodFingerprint( Opcode.IF_EQZ, Opcode.IGET_OBJECT, Opcode.CONST, - Opcode.INVOKE_STATIC, + null // invoke-static or invoke-virtual ) ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt index 3aecd97f07..4a05714107 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt @@ -42,7 +42,7 @@ import app.revanced.util.exception "19.13.37", "19.14.43", "19.15.36", - "19.16.39", + "19.16.39" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index e41d0e4214..037eaa653d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -57,6 +57,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt index a4aa0f38de..26d315fa9e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt @@ -46,6 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index 3030214399..8dbe6386a9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -51,6 +51,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt index 8b41fc5dfc..0004af2d2f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt @@ -49,7 +49,8 @@ import app.revanced.util.resultOrThrow "19.13.37", "19.14.43", "19.15.36", - "19.16.39" + "19.16.39", + "19.31.36" ) ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt index 23d7a62fdd..1cd39cc36e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt @@ -58,6 +58,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt index 095d567c72..af651b5e65 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt @@ -52,6 +52,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt index d1d9dd39e1..5d8ebd10df 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt @@ -48,6 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt index 1db64983dc..8166b86e56 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt @@ -47,6 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 97fc73d662..51124c4f65 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -50,6 +50,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/fingerprints/KidsBackgroundPlaybackPolicyControllerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/fingerprints/KidsBackgroundPlaybackPolicyControllerFingerprint.kt index 7f33326c5f..11040d5e18 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/fingerprints/KidsBackgroundPlaybackPolicyControllerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/fingerprints/KidsBackgroundPlaybackPolicyControllerFingerprint.kt @@ -17,13 +17,7 @@ internal object KidsBackgroundPlaybackPolicyControllerFingerprint : LiteralValue Opcode.IGET, Opcode.CONST_4, Opcode.IF_NE, - Opcode.IGET_OBJECT, - Opcode.SGET_OBJECT, - Opcode.IF_EQ, - Opcode.GOTO, - Opcode.IGET_OBJECT, - Opcode.INVOKE_VIRTUAL, - Opcode.RETURN_VOID + Opcode.IGET_OBJECT ), literalSupplier = { 5 }, ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt index 70e1978e76..15d907cec9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt @@ -42,6 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt index 7d24b10862..7f5f7c7740 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt @@ -42,6 +42,7 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index f9ad8dd766..6f5b876943 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -75,6 +75,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 67a47c71d5..7a4d2cf575 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -56,6 +56,7 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ), ), ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/imageurlhook/CronetImageUrlHook.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/imageurlhook/CronetImageUrlHook.kt index d85b5f6a1b..84e1c061c2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/imageurlhook/CronetImageUrlHook.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/imageurlhook/CronetImageUrlHook.kt @@ -97,9 +97,8 @@ object CronetImageUrlHook : BytecodePatch( // The URL is required for the failure callback hook, but the URL field is obfuscated. // Add a helper get method that returns the URL field. RequestFingerprint.resultOrThrow().apply { - // The url is the only string field that is set inside the constructor. - val urlFieldInstruction = mutableMethod.getInstructions().single { - if (it.opcode != Opcode.IPUT_OBJECT) return@single false + val urlFieldInstruction = mutableMethod.getInstructions().first { + if (it.opcode != Opcode.IPUT_OBJECT) return@first false val reference = (it as ReferenceInstruction).reference as FieldReference reference.type == "Ljava/lang/String;" diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index 451f7742e7..d0cce22766 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -44,6 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt index 97367d6c1b..7dd8c2ee8f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt @@ -48,6 +48,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 4b9620a2a4..8602d9b152 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -16,12 +16,14 @@ import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.fingerprints.* 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.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.Instruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference +import com.android.tools.smali.dexlib2.iface.reference.StringReference import java.io.Closeable @Patch( @@ -30,14 +32,13 @@ import java.io.Closeable ) @Suppress("unused") object LithoFilterPatch : BytecodePatch( - setOf(ComponentContextParserFingerprint, LithoFilterFingerprint, ProtobufBufferReferenceFingerprint) + setOf( + ComponentContextParserFingerprint, + LithoFilterFingerprint, + ProtobufBufferReferenceFingerprint, + ReadComponentIdentifierFingerprint + ) ), Closeable { - private val MethodFingerprint.patternScanResult - get() = result!!.scanResult.patternScanResult!! - - private val MethodFingerprint.patternScanEndIndex - get() = patternScanResult.endIndex - private val Instruction.descriptor get() = (this as ReferenceInstruction).reference.toString() @@ -81,75 +82,45 @@ object LithoFilterPatch : BytecodePatch( * } */ override fun execute(context: BytecodeContext) { - ComponentContextParserFingerprint.result?.also { - arrayOf( - EmptyComponentBuilderFingerprint, - ReadComponentIdentifierFingerprint - ).forEach { fingerprint -> - if (fingerprint.resolve(context, it.mutableMethod, it.mutableClass)) return@forEach - throw fingerprint.exception - } - }?.let { bytesToComponentContextMethod -> + // region Hook the method that parses bytes into a ComponentContext. - // region Pass the buffer into Integrations. - - ProtobufBufferReferenceFingerprint.result - ?.mutableMethod?.addInstruction(0, - " invoke-static { p2 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setProtoBuffer(Ljava/nio/ByteBuffer;)V") - ?: throw ProtobufBufferReferenceFingerprint.exception + ComponentContextParserFingerprint.resultOrThrow()?.let { + it.mutableMethod.apply { + // region Get references that this patch needs. - // endregion + val builderMethodIndex = it.scanResult.patternScanResult!!.endIndex + val emptyComponentFieldIndex = builderMethodIndex + 2 - // region Hook the method that parses bytes into a ComponentContext. + val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor + val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor - val builderMethodIndex = EmptyComponentBuilderFingerprint.patternScanEndIndex - val emptyComponentFieldIndex = builderMethodIndex + 2 + // endregion - bytesToComponentContextMethod.mutableMethod.apply { - val insertHookIndex = indexOfFirstInstructionOrThrow { - opcode == Opcode.IPUT_OBJECT && - getReference()?.type == "Ljava/lang/StringBuilder;" - } + 1 + // region Get insert hook index and free registers that this patch uses. - // region Get free registers that this patch uses. - // Registers are overwritten right after they are used in this patch, therefore free to clobber. + // Insert hook index + val stringIndex = indexOfFirstInstructionOrThrow { + opcode == Opcode.CONST_STRING && + getReference()?.string == "Element missing type extension" + } - val freeRegistersInstruction = getInstruction(insertHookIndex - 2) + val insertHookIndex = stringIndex - 2 // Later used to store the protobuf buffer object. - val free1 = getInstruction(insertHookIndex).registerA + val free1 = getInstruction(stringIndex + 1).registerA // Later used to store the identifier of the component. - // This register currently holds a reference to the StringBuilder object - // that is required before clobbering. - val free2 = freeRegistersInstruction.registerC - - @Suppress("UnnecessaryVariable") - val stringBuilderRegister = free2 + val free2 = getInstruction(stringIndex).registerA // endregion - // region Get references that this patch needs. - - val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor - val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor - - val identifierRegister = - getInstruction(ReadComponentIdentifierFingerprint.patternScanEndIndex).registerA - - // endregion - - // region Patch the method. - // Insert the instructions that are responsible - // to return an EmptyComponent instead of the original component if the filter method returns true. + // to return an EmptyComponent instead of the original component if the filterState method returns true. addInstructionsWithLabels( insertHookIndex, """ - # Invoke the filter method. - - invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z + invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->filterState()Z move-result v$free1 - + if-eqz v$free1, :unfiltered move-object/from16 v$free2, p1 @@ -158,14 +129,49 @@ object LithoFilterPatch : BytecodePatch( iget-object v$free2, v$free2, $emptyComponentFieldDescriptor return-object v$free2 """, - // Used to jump over the instruction which block the component from being created. + // Used to jump over the instruction which block the component from being created.. ExternalLabel("unfiltered", getInstruction(insertHookIndex)) ) - // endregion } + } + + // endregion + + // region Pass the buffer into Integrations. + + ProtobufBufferReferenceFingerprint.resultOrThrow()?.mutableMethod?.apply { + addInstruction( + 0, " invoke-static { p2 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setProtoBuffer(Ljava/nio/ByteBuffer;)V" + ) + } + + // endregion + + // region Read component then store the result. + + ReadComponentIdentifierFingerprint.resultOrThrow()?.let { + it.mutableMethod.apply { + val identifierIndex = it.scanResult.patternScanResult!!.endIndex + val identifierRegister = getInstruction(identifierIndex).registerA + + val insertHookIndex = indexOfFirstInstructionOrThrow { + opcode == Opcode.IPUT_OBJECT && + getReference()?.type == "Ljava/lang/StringBuilder;" + } + 1 + + val stringBuilderRegister = getInstruction(insertHookIndex - 2).registerC + + addInstruction( + insertHookIndex, + """ + # Invoke the filter method. + invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)V + """, + ) + } + } - // endregion - } ?: throw ComponentContextParserFingerprint.exception + // endregion LithoFilterFingerprint.result?.mutableMethod?.apply { removeInstructions(2, 4) // Remove dummy filter. diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt index 419e0f91c8..0ca80fbd22 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt @@ -1,7 +1,12 @@ package app.revanced.patches.youtube.misc.litho.filter.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.Opcode internal object ComponentContextParserFingerprint : MethodFingerprint( + opcodes = listOf( + Opcode.INVOKE_INTERFACE, + Opcode.INVOKE_STATIC_RANGE + ), strings = listOf("Component was not found %s because it was removed due to duplicate converter bindings.") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/EmptyComponentBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/EmptyComponentBuilderFingerprint.kt deleted file mode 100644 index ec6a1f0c6f..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/EmptyComponentBuilderFingerprint.kt +++ /dev/null @@ -1,11 +0,0 @@ -package app.revanced.patches.youtube.misc.litho.filter.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.Opcode - -internal object EmptyComponentBuilderFingerprint : MethodFingerprint( - opcodes = listOf( - Opcode.INVOKE_INTERFACE, - Opcode.INVOKE_STATIC_RANGE - ), -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt index 0a6adfda3d..51bd558175 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt @@ -8,5 +8,6 @@ internal object ReadComponentIdentifierFingerprint : MethodFingerprint( Opcode.IF_NEZ, null, Opcode.MOVE_RESULT_OBJECT // Register stores the component identifier string - ) + ), + strings = listOf("Number of bits must be positive") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/fingerprints/InitializeButtonsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/fingerprints/InitializeButtonsFingerprint.kt index f91d1b36f3..eeeb060ffb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/fingerprints/InitializeButtonsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/fingerprints/InitializeButtonsFingerprint.kt @@ -11,6 +11,5 @@ import com.android.tools.smali.dexlib2.AccessFlags internal object InitializeButtonsFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, returnType = "V", - parameters = listOf(), literalSupplier = { NavigationBarHookResourcePatch.imageOnlyTabResourceId } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt index 9480c6a1e4..8a2bca5565 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/fingerprints/BottomControlsInflateFingerprint.kt @@ -1,13 +1,10 @@ package app.revanced.patches.youtube.misc.playercontrols.fingerprints -import app.revanced.patcher.extensions.or import app.revanced.patches.youtube.misc.playercontrols.BottomControlsResourcePatch import app.revanced.util.patch.LiteralValueFingerprint -import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode internal object BottomControlsInflateFingerprint : LiteralValueFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.SYNTHETIC, returnType = "L", parameters = listOf(), opcodes = listOf( diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt index 37ccb352f6..06d9e5d84e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt @@ -49,6 +49,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt index 9e5e4f8b87..a5852d06e9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt @@ -26,7 +26,7 @@ internal object RecyclerViewTreeHookPatch : BytecodePatch( addHook = { classDescriptor -> addInstruction( - insertIndex, + insertIndex + 1, "invoke-static/range { p$recyclerViewParameter .. p$recyclerViewParameter }, $classDescriptor->onFlyoutMenuCreate(Landroid/support/v7/widget/RecyclerView;)V" ) } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/fingerprints/RecyclerViewTreeObserverFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/fingerprints/RecyclerViewTreeObserverFingerprint.kt index f40fd09c9c..b94c578129 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/fingerprints/RecyclerViewTreeObserverFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/fingerprints/RecyclerViewTreeObserverFingerprint.kt @@ -9,12 +9,11 @@ internal object RecyclerViewTreeObserverFingerprint : MethodFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, opcodes = listOf( + Opcode.CHECK_CAST, Opcode.NEW_INSTANCE, Opcode.INVOKE_DIRECT, Opcode.INVOKE_VIRTUAL, - Opcode.NEW_INSTANCE, - Opcode.INVOKE_DIRECT, - Opcode.IPUT_OBJECT + Opcode.NEW_INSTANCE ), strings = listOf("LithoRVSLCBinder") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt index 14b224eea9..bafa735c3d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt @@ -25,6 +25,9 @@ internal object RollingNumberTextViewAnimationUpdateFingerprint : MethodFingerpr Opcode.INVOKE_VIRTUAL, // set textview padding using bitmap width ), customFingerprint = { _, classDef -> - classDef.superclass == "Landroid/support/v7/widget/AppCompatTextView;" + val appCompatTextView = "Landroid/support/v7/widget/AppCompatTextView;" + val youTubeAppCompatTextView = "Lcom/google/android/libraries/youtube/rendering/ui/spec/typography/YouTubeAppCompatTextView;" + + classDef.superclass in listOf(appCompatTextView, youTubeAppCompatTextView) } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt index 03711953ab..6b5b42eb9f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt @@ -22,7 +22,7 @@ object PlayerResponseMethodHookPatch : // Parameter numbers of the patched method. private const val PARAMETER_VIDEO_ID = 1 private const val PARAMETER_PROTO_BUFFER = 3 - private const val PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 11 + private var PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 11 // Registers used to pass the parameters to integrations. private var playerResponseMethodCopyRegisters = false @@ -42,6 +42,9 @@ object PlayerResponseMethodHookPatch : playerResponseMethodCopyRegisters = playerResponseMethod.implementation!!.registerCount - playerResponseMethod.parameterTypes.size + PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING > 15 + PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = + if (playerResponseMethod.parameterTypes[10] == "Z") 11 else 12 + if (playerResponseMethodCopyRegisters) { REGISTER_VIDEO_ID = "v0" REGISTER_PROTO_BUFFER = "v1" diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt index 2694940fd6..d987f27060 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt @@ -7,19 +7,8 @@ import com.android.tools.smali.dexlib2.AccessFlags internal object PlayerParameterBuilderFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, returnType = "L", - parameters = listOf( - "Ljava/lang/String;", // VideoId. - "[B", - "Ljava/lang/String;", // Player parameters proto buffer. - "Ljava/lang/String;", - "I", - "I", - "Ljava/util/Set;", - "Ljava/lang/String;", - "Ljava/lang/String;", - "L", - "Z", // Appears to indicate if the video id is being opened or is currently playing. - "Z", - "Z" - ) + strings = listOf("psps"), + customFingerprint = { methodDef, _ -> + methodDef.parameters.isNotEmpty() + } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt index dc89623c7a..75b90a9116 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt @@ -53,6 +53,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt index 7cdb7d064b..ef29cac44d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt @@ -39,6 +39,7 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt index 061207c085..826d9eeaa5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt @@ -108,11 +108,12 @@ object CustomPlaybackSpeedPatch : BytecodePatch( val limiterMethodImpl = limiterMethod.implementation!! val lowerLimitConst = 0.25f.toRawBits() - val upperLimitConst = 2.0f.toRawBits() + val upperLimitConst2x = 2.0f.toRawBits() + val upperLimitConst4x = 4.0f.toRawBits() val (limiterMinConstIndex, limiterMinConst) = limiterMethodImpl.instructions.withIndex() .first { (it.value as? NarrowLiteralInstruction)?.narrowLiteral == lowerLimitConst } val (limiterMaxConstIndex, limiterMaxConst) = limiterMethodImpl.instructions.withIndex() - .first { (it.value as? NarrowLiteralInstruction)?.narrowLiteral == upperLimitConst } + .first { (it.value as? NarrowLiteralInstruction)?.narrowLiteral in listOf(upperLimitConst2x, upperLimitConst4x) } val limiterMinConstDestination = (limiterMinConst as OneRegisterInstruction).registerA val limiterMaxConstDestination = (limiterMaxConst as OneRegisterInstruction).registerA diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt index 5e60a69966..0a35b3bb1a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt @@ -53,6 +53,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", + "19.31.36" ], ), ], From 3073fd363feafcdc5bea2ab75ac3cef03bf74649 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 7 Sep 2024 20:50:30 -0400 Subject: [PATCH 012/143] fix: temporarily ignore broken client-spoof until stream replacement is merged --- .../patches/youtube/misc/fix/playback/SpoofClientPatch.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 6f5b876943..c8a479fb89 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -113,6 +113,11 @@ object SpoofClientPatch : BytecodePatch( "Lorg/chromium/net/ExperimentalUrlRequest\$Builder;" override fun execute(context: BytecodeContext) { + // FIXME: this patch is not updated to support 19.31 and does not work + // and this will soon be replaced with stream replacing. + println("FIXME: skipping 'Spoof client'") + if (true) return; + AddResourcesPatch(this::class) SettingsPatch.PreferenceScreen.MISC.addPreferences( From f7b066f31750d68ea19452e6645f65ad9cd57331 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 7 Sep 2024 22:56:35 -0400 Subject: [PATCH 013/143] fix compiler warnings --- .../youtube/misc/litho/filter/LithoFilterPatch.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 8602d9b152..253236e439 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -84,7 +84,7 @@ object LithoFilterPatch : BytecodePatch( override fun execute(context: BytecodeContext) { // region Hook the method that parses bytes into a ComponentContext. - ComponentContextParserFingerprint.resultOrThrow()?.let { + ComponentContextParserFingerprint.resultOrThrow().let { it.mutableMethod.apply { // region Get references that this patch needs. @@ -139,7 +139,7 @@ object LithoFilterPatch : BytecodePatch( // region Pass the buffer into Integrations. - ProtobufBufferReferenceFingerprint.resultOrThrow()?.mutableMethod?.apply { + ProtobufBufferReferenceFingerprint.resultOrThrow().mutableMethod.apply { addInstruction( 0, " invoke-static { p2 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setProtoBuffer(Ljava/nio/ByteBuffer;)V" ) @@ -149,7 +149,7 @@ object LithoFilterPatch : BytecodePatch( // region Read component then store the result. - ReadComponentIdentifierFingerprint.resultOrThrow()?.let { + ReadComponentIdentifierFingerprint.resultOrThrow().let { it.mutableMethod.apply { val identifierIndex = it.scanResult.patternScanResult!!.endIndex val identifierRegister = getInstruction(identifierIndex).registerA @@ -173,7 +173,7 @@ object LithoFilterPatch : BytecodePatch( // endregion - LithoFilterFingerprint.result?.mutableMethod?.apply { + LithoFilterFingerprint.resultOrThrow().mutableMethod.apply { removeInstructions(2, 4) // Remove dummy filter. addFilter = { classDescriptor -> @@ -187,7 +187,7 @@ object LithoFilterPatch : BytecodePatch( """ ) } - } ?: throw LithoFilterFingerprint.exception + } } override fun close() = LithoFilterFingerprint.result!! From 40ede125f2f1caf820d3648c1c8e2831f4e64eee Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 7 Sep 2024 23:19:06 -0400 Subject: [PATCH 014/143] fix: Use version 19.30.39 instead, just to avoid Miniplayer issue with 19.31 --- .../youtube/ad/general/HideAdsPatch.kt | 14 ++++++++++- .../ad/getpremium/HideGetPremiumPatch.kt | 14 ++++++++++- .../patches/youtube/ad/video/VideoAdsPatch.kt | 14 ++++++++++- .../copyvideourl/CopyVideoUrlBytecodePatch.kt | 14 ++++++++++- .../RemoveViewerDiscretionDialogPatch.kt | 14 ++++++++++- .../interaction/downloads/DownloadsPatch.kt | 14 ++++++++++- .../DisablePreciseSeekingGesturePatch.kt | 14 ++++++++++- .../seekbar/EnableSeekbarTappingPatch.kt | 14 ++++++++++- .../seekbar/EnableSlideToSeekPatch.kt | 14 ++++++++++- .../SwipeControlsBytecodePatch.kt | 14 ++++++++++- .../layout/autocaptions/AutoCaptionsPatch.kt | 14 ++++++++++- .../layout/buttons/action/HideButtonsPatch.kt | 14 ++++++++++- .../autoplay/HideAutoplayButtonPatch.kt | 14 ++++++++++- .../captions/HideCaptionsButtonPatch.kt | 14 ++++++++++- .../navigation/NavigationButtonsPatch.kt | 14 ++++++++++- .../player/hide/HidePlayerButtonsPatch.kt | 14 ++++++++++- .../layout/hide/albumcards/AlbumCardsPatch.kt | 14 ++++++++++- .../layout/hide/comments/CommentsPatch.kt | 14 ++++++++++- .../crowdfundingbox/CrowdfundingBoxPatch.kt | 14 ++++++++++- .../endscreencards/HideEndscreenCardsPatch.kt | 14 ++++++++++- .../hide/filterbar/HideFilterBarPatch.kt | 14 ++++++++++- .../HideFloatingMicrophoneButtonPatch.kt | 14 ++++++++++- .../DisableFullscreenAmbientModePatch.kt | 14 ++++++++++- .../hide/general/HideLayoutComponentsPatch.kt | 14 ++++++++++- .../hide/infocards/HideInfoCardsPatch.kt | 14 ++++++++++- .../HidePlayerFlyoutMenuPatch.kt | 14 ++++++++++- .../DisableRollingNumberAnimationPatch.kt | 14 ++++++++++- .../layout/hide/seekbar/HideSeekbarPatch.kt | 14 ++++++++++- .../hide/shorts/HideShortsComponentsPatch.kt | 16 +++++++++++-- .../DisableSuggestedVideoEndScreenPatch.kt | 14 ++++++++++- .../layout/hide/time/HideTimestampPatch.kt | 14 ++++++++++- .../layout/miniplayer/MiniplayerPatch.kt | 23 ++++++++++++++----- .../panels/popup/PlayerPopupPanelsPatch.kt | 14 ++++++++++- .../PlayerControlsBackgroundPatch.kt | 14 ++++++++++- .../ReturnYouTubeDislikePatch.kt | 14 ++++++++++- .../layout/searchbar/WideSearchbarPatch.kt | 14 ++++++++++- .../sponsorblock/SponsorBlockBytecodePatch.kt | 14 ++++++++++- .../spoofappversion/SpoofAppVersionPatch.kt | 14 ++++++++++- .../DisableResumingShortsOnStartupPatch.kt | 14 ++++++++++- .../layout/tablet/EnableTabletLayoutPatch.kt | 14 ++++++++++- .../layout/theme/ThemeBytecodePatch.kt | 14 ++++++++++- .../thumbnails/AlternativeThumbnailsPatch.kt | 14 ++++++++++- .../BypassImageRegionRestrictions.kt | 14 ++++++++++- .../misc/autorepeat/AutoRepeatPatch.kt | 14 ++++++++++- .../BackgroundPlaybackPatch.kt | 14 ++++++++++- .../spoof/SpoofDeviceDimensionsPatch.kt | 14 ++++++++++- ...ckWatchHistoryDomainNameResolutionPatch.kt | 14 ++++++++++- .../misc/fix/playback/SpoofClientPatch.kt | 16 +++++++++++-- .../youtube/misc/gms/GmsCoreSupportPatch.kt | 14 ++++++++++- .../misc/links/BypassURLRedirectsPatch.kt | 14 ++++++++++- .../misc/links/OpenLinksExternallyPatch.kt | 14 ++++++++++- .../RemoveTrackingQueryParameterPatch.kt | 14 ++++++++++- .../quality/RememberVideoQualityPatch.kt | 14 ++++++++++- .../youtube/video/speed/PlaybackSpeedPatch.kt | 14 ++++++++++- .../RestoreOldVideoQualityMenuPatch.kt | 14 ++++++++++- 55 files changed, 721 insertions(+), 62 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index 0c658d0570..fef0d4c04b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -50,7 +50,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt index 8d96a0caf7..74af615aab 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt @@ -44,7 +44,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt index ea1ede7d51..06005885cc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt @@ -49,7 +49,19 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt index 143cc01b31..0e2a112d24 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt @@ -37,7 +37,19 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt index 69ba063d6e..fce77b9d68 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt @@ -46,7 +46,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt index 780e07ec9a..d2092848fe 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt @@ -43,7 +43,19 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt index 8deda89767..913ace45a7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt @@ -46,7 +46,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt index a3e2bd516e..14686fefaf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt @@ -48,7 +48,19 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt index df6e3259ea..2fed864f0a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt @@ -44,7 +44,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt index 8124917de2..6dc65b5f30 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt @@ -50,7 +50,19 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt index 60fd2c9a06..f53a0ceafa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt @@ -48,7 +48,19 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt index 0f226b5e98..17aa55bb33 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt @@ -47,7 +47,19 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt index 833e2dad27..0460b11a08 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt @@ -58,7 +58,19 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt index 30fb44a3cf..513fb0746a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt @@ -48,7 +48,19 @@ import com.android.tools.smali.dexlib2.Opcode "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt index 1b77d96a83..f06d840c9a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt @@ -61,7 +61,19 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt index b8b8f84524..5cb48bc669 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt @@ -52,7 +52,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt index d7e6a0cc96..acd80c5aed 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt @@ -46,7 +46,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index 539c3a0087..5273318d28 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -46,7 +46,19 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt index 43e18bfcd2..c053c4cb47 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -46,7 +46,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt index a2e3919d83..6eec616db3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt @@ -49,7 +49,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt index fa96c01c4e..0c48ecb464 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt @@ -46,7 +46,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt index 83b9193766..0ca3072575 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt @@ -42,7 +42,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt index 64fbad8e41..0cce5b39da 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt @@ -42,7 +42,19 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 7eda35b07a..60971b3a09 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -64,7 +64,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index bd43a412ba..1527cf871c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -53,7 +53,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt index 9f68d9e625..f9d1952640 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt @@ -47,7 +47,19 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt index 07bef44aa9..a510420500 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt @@ -44,7 +44,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt index 3fe8155422..f81d09669a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt @@ -49,7 +49,19 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 27df8f25c6..7119a4bbe8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -60,7 +60,19 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], @@ -152,7 +164,7 @@ object HideShortsComponentsPatch : BytecodePatch( BottomNavigationBarFingerprint.result ?: BottomNavigationBarNewFingerprint.result ?: throw BottomNavigationBarFingerprint.exception - bottomNavigationBarResult?.let { + bottomNavigationBarResult.let { it.mutableMethod.apply { val moveResultIndex = it.scanResult.patternScanResult!!.startIndex + 2 val viewRegister = getInstruction(moveResultIndex).registerA diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt index 08be450199..3e5732a27f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt @@ -41,7 +41,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt index 7096a1f211..45950a209c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt @@ -42,7 +42,19 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 85150a5d96..3f98382a05 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -96,12 +96,23 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.11.43", "19.12.41", "19.13.37", - // 19.14 is left out, as it has incomplete miniplayer code and missing some UI resources. - // It's simpler to not bother with supporting this single old version. - // 19.15 has a different code for handling sub title texts, - // and also probably not worth making changes just to support this single old version. - "19.16.39", // Earliest supported version with modern miniplayers. - "19.31.36" + // 19.14.43 // Incomplete code for modern miniplayers. + // 19.15.36 // Different code for handling sub title texts and not worth supporting. + "19.16.39", + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", // Last version Modern 1 hide expand/close buttons. + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", // Last version with Modern 1 smaller miniplayer and skip forward/back buttons. + // 19.25.37 // Issues with resuming miniplayer on cold start for Premium users. + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", + // 19.31.36 // Issues with resuming miniplayer on cold start for Premium users. ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt index 4d20c79d84..acc81858d5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt @@ -43,7 +43,19 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt index 9b0ee2e5ae..3c67e45142 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt @@ -38,7 +38,19 @@ import org.w3c.dom.Element "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index 766c11714f..98d77303e3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -73,7 +73,19 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index 8db63d9194..a3b8dd91f4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -47,7 +47,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index 037eaa653d..e5c815b72b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -57,7 +57,19 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt index 26d315fa9e..b732b5dffb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt @@ -46,7 +46,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index 8dbe6386a9..c5b8988e47 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -51,7 +51,19 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt index 0004af2d2f..d58d2aa06f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt @@ -50,7 +50,19 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ) ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt index 1cd39cc36e..6a4c441afb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt @@ -58,7 +58,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt index af651b5e65..52ec339c56 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt @@ -52,7 +52,19 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt index 5d8ebd10df..bde87d2d49 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt @@ -48,7 +48,19 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt index 8166b86e56..99fe7c33bd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt @@ -47,7 +47,19 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 51124c4f65..570bde4ed0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -50,7 +50,19 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt index 15d907cec9..26fa5f6c8b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt @@ -42,7 +42,19 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt index 7f5f7c7740..8a29eea27c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt @@ -42,7 +42,19 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index c8a479fb89..a37a996c72 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -75,7 +75,19 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], @@ -116,7 +128,7 @@ object SpoofClientPatch : BytecodePatch( // FIXME: this patch is not updated to support 19.31 and does not work // and this will soon be replaced with stream replacing. println("FIXME: skipping 'Spoof client'") - if (true) return; + if (true) return AddResourcesPatch(this::class) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 7a4d2cf575..2154cfc915 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -56,7 +56,19 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ), ), ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index d0cce22766..df5e8b0870 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -44,7 +44,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt index 7dd8c2ee8f..f8c5328309 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt @@ -48,7 +48,19 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt index 06d9e5d84e..beb9e136d3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt @@ -49,7 +49,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt index 75b90a9116..00a86133b0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt @@ -53,7 +53,19 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt index ef29cac44d..21d1f0a949 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt @@ -39,7 +39,19 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt index 0a35b3bb1a..6f4c54f7f5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt @@ -53,7 +53,19 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.31.36" + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", ], ), ], From b5932c2d82a30fdb532e10004b1da4797d4d9eaa Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 01:01:10 -0400 Subject: [PATCH 015/143] fix: Only show Miniplayer preferences that are available, remove target versions with known issues --- .../layout/miniplayer/MiniplayerPatch.kt | 77 ++++++++++--------- .../miniplayer/MiniplayerResourcePatch.kt | 35 +++++++-- .../kotlin/app/revanced/util/ResourceUtils.kt | 36 +++++++++ .../resources/addresources/values/arrays.xml | 4 +- 4 files changed, 105 insertions(+), 47 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 3f98382a05..e8bd523c7b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -12,6 +12,7 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patches.all.misc.resources.AddResourcesPatch +import app.revanced.patches.shared.misc.settings.preference.BasePreference import app.revanced.patches.shared.misc.settings.preference.InputType import app.revanced.patches.shared.misc.settings.preference.ListPreference import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen @@ -101,16 +102,16 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.16.39", "19.17.41", "19.18.41", - "19.19.39", - "19.20.35", // Last version Modern 1 hide expand/close buttons. - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", // Last version with Modern 1 smaller miniplayer and skip forward/back buttons. + "19.19.39", // Last (bug free) version with Modern 1 skip forward/back buttons and swipe to close. + // 19.20.35 // Issues with resuming miniplayer on cold start for Premium users. + // 19.21.40 // Issues with resuming miniplayer on cold start for Premium users. + // 19.22.43 // Issues with resuming miniplayer on cold start for Premium users. + // 19.23.40 // Issues with resuming miniplayer on cold start for Premium users. + // 19.24.45 // Last version with skip forward/back buttons, but has issues for Premium users. // 19.25.37 // Issues with resuming miniplayer on cold start for Premium users. - "19.26.42", - "19.28.42", - "19.29.42", + // 19.26.42 // Issues with resuming miniplayer on cold start for Premium users. + // 19.28.42 // Issues with resuming miniplayer on cold start for Premium users. + "19.29.42", // Miniplayer can show layout glitches on cold start, but is still functional. "19.30.39", // 19.31.36 // Issues with resuming miniplayer on cold start for Premium users. ] @@ -133,38 +134,40 @@ object MiniplayerPatch : BytecodePatch( override fun execute(context: BytecodeContext) { AddResourcesPatch(this::class) - // Modern mini player is only present and functional in 19.15+. - // Resource is not present in older versions. Using it to determine, if patching an old version. - val isPatchingOldVersion = modernMiniplayerClose < 0 + val preferences = mutableSetOf() + + if (MiniplayerResourcePatch.is_19_15_36_or_less) { + preferences += ListPreference( + "revanced_miniplayer_type", + summaryKey = null, + entriesKey = "revanced_miniplayer_type_legacy_entries", + entryValuesKey = "revanced_miniplayer_type_legacy_entry_values" + ) + } else { + preferences += ListPreference( + "revanced_miniplayer_type", + summaryKey = null, + entriesKey = "revanced_miniplayer_type_19_16_entries", + entryValuesKey = "revanced_miniplayer_type_19_16_entry_values" + ) + + if (MiniplayerResourcePatch.is_19_19_39_or_less) { + preferences += SwitchPreference("revanced_miniplayer_hide_expand_close") + + if (MiniplayerResourcePatch.is_19_24_45_or_less) { + preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward") + } + } + + preferences += SwitchPreference("revanced_miniplayer_hide_subtext") + preferences += TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER) + } SettingsPatch.PreferenceScreen.PLAYER.addPreferences( PreferenceScreen( key = "revanced_miniplayer_screen", sorting = Sorting.UNSORTED, - preferences = - if (isPatchingOldVersion) { - setOf( - ListPreference( - "revanced_miniplayer_type", - summaryKey = null, - entriesKey = "revanced_miniplayer_type_legacy_entries", - entryValuesKey = "revanced_miniplayer_type_legacy_entry_values" - ) - ) - } else { - setOf( - ListPreference( - "revanced_miniplayer_type", - summaryKey = null, - entriesKey = "revanced_miniplayer_type_19_15_entries", - entryValuesKey = "revanced_miniplayer_type_19_15_entry_values" - ), - SwitchPreference("revanced_miniplayer_hide_expand_close"), - SwitchPreference("revanced_miniplayer_hide_subtext"), - SwitchPreference("revanced_miniplayer_hide_rewind_forward"), - TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER) - ) - } + preferences = preferences ) ) @@ -200,7 +203,7 @@ object MiniplayerPatch : BytecodePatch( it.mutableMethod.insertLegacyTabletMiniplayerOverride(it.scanResult.patternScanResult!!.endIndex) } - if (isPatchingOldVersion) { + if (MiniplayerResourcePatch.is_19_15_36_or_less) { // Return here, as patch below is only intended for new versions of the app. return } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt index 07aa95487b..1f76bfcb54 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt @@ -5,8 +5,7 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.util.getNode -import org.w3c.dom.Element +import app.revanced.util.ResourceUtils @Patch(dependencies = [ResourceMappingPatch::class]) internal object MiniplayerResourcePatch : ResourcePatch() { @@ -22,19 +21,39 @@ internal object MiniplayerResourcePatch : ResourcePatch() { var modernMiniplayerForwardButton = -1L var playerOverlays = -1L + // These version checks assume no new bug fix versions will be released (such as 19.16.40). + /** + * Supports only legacy miniplayer. + */ + var is_19_15_36_or_less = false + /** + * First supported version with modern miniplayers + */ + var is_19_16_35_or_less = false + /** + * Last version with Modern 1swipe to expand/close functionality. + */ + var is_19_19_39_or_less = false + /** + * Last version with Modern 1 skip forward/back buttons. + */ + var is_19_24_45_or_less = false + override fun execute(context: ResourceContext) { - val appVersionName = context.document["AndroidManifest.xml"].use { document -> - val manifestElement = document.getNode("manifest") as Element - manifestElement.getAttribute("android:versionName") - } + val playVersion = ResourceUtils.getPlayServicesVersion(context) + + is_19_15_36_or_less = playVersion <= 241602000 + is_19_16_35_or_less = playVersion <= 241702000 + is_19_19_39_or_less = playVersion <= 241999000 + is_19_24_45_or_less = playVersion <= 242505000 floatyBarButtonTopMargin = ResourceMappingPatch[ "dimen", "floaty_bar_button_top_margin" ] - // Only required for 19.16. - if (appVersionName.contains("19.16")) { + // Only required for 19.16 + if (!is_19_15_36_or_less && is_19_16_35_or_less) { ytOutlinePictureInPictureWhite24 = ResourceMappingPatch[ "drawable", "yt_outline_picture_in_picture_white_24" diff --git a/src/main/kotlin/app/revanced/util/ResourceUtils.kt b/src/main/kotlin/app/revanced/util/ResourceUtils.kt index 56076078d3..1b502ef5ba 100644 --- a/src/main/kotlin/app/revanced/util/ResourceUtils.kt +++ b/src/main/kotlin/app/revanced/util/ResourceUtils.kt @@ -1,14 +1,50 @@ package app.revanced.util import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchException import app.revanced.patcher.util.DomFileEditor import app.revanced.util.resource.BaseResource +import org.w3c.dom.Element import org.w3c.dom.Node import org.w3c.dom.NodeList import java.io.InputStream import java.nio.file.Files import java.nio.file.StandardCopyOption +internal object ResourceUtils { + private var playStoreServicesVersion : Int? = null + + /** + * Used to check what version an app is. + * Returns the Google Play services version, + * since the decoded app manifest does not have the app version. + */ + fun getPlayServicesVersion(context: ResourceContext) : Int { + if (playStoreServicesVersion != null) { + return playStoreServicesVersion!! + } + + // The app version is missing from the decompiled manifest, + // so instead use the Google Play services version and compare against specific releases. + context.document["res/values/integers.xml"].use { document -> + val nodeList = document.documentElement.childNodes + for (i in 0 until nodeList.length) { + val node = nodeList.item(i) + if (node.nodeType == Node.ELEMENT_NODE) { + val element = node as Element + if (element.getAttribute("name") == "google_play_services_version") { + val version = element.textContent.toInt() + playStoreServicesVersion = version + return version + } + } + } + } + + throw PatchException("integers.xml does not contain a Google Play services version") + } +} + private val classLoader = object {}.javaClass.classLoader /** diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index f1700555f4..44bdcd5892 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -17,7 +17,7 @@ - + @string/revanced_miniplayer_type_entry_1 @string/revanced_miniplayer_type_entry_2 @string/revanced_miniplayer_type_entry_3 @@ -25,7 +25,7 @@ @string/revanced_miniplayer_type_entry_5 @string/revanced_miniplayer_type_entry_6 - + ORIGINAL PHONE From 5405a04fc7aa12c7a285851984982b6752c754cd Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 02:10:16 -0400 Subject: [PATCH 016/143] fix(Miniplayer): Do not patch features on target versions that cannot be disabled --- .../layout/miniplayer/MiniplayerPatch.kt | 40 +++++++++++++++---- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index e8bd523c7b..924908913c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -6,6 +6,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction +import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch @@ -61,6 +62,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference import com.android.tools.smali.dexlib2.iface.reference.TypeReference import com.android.tools.smali.dexlib2.immutable.ImmutableMethod import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter +import java.util.ArrayList // YT uses "Miniplayer" without a space between 'mini' and 'player: https://support.google.com/youtube/answer/9162927. @Patch( @@ -256,13 +258,37 @@ object MiniplayerPatch : BytecodePatch( // region Add hooks to hide tablet modern miniplayer buttons. - listOf( - Triple(MiniplayerModernExpandButtonFingerprint, modernMiniplayerExpand,"hideMiniplayerExpandClose"), - Triple(MiniplayerModernCloseButtonFingerprint, modernMiniplayerClose, "hideMiniplayerExpandClose"), - Triple(MiniplayerModernRewindButtonFingerprint, modernMiniplayerRewindButton, "hideMiniplayerRewindForward"), - Triple(MiniplayerModernForwardButtonFingerprint, modernMiniplayerForwardButton, "hideMiniplayerRewindForward"), + val modernHideFeatures = mutableListOf>( Triple(MiniplayerModernOverlayViewFingerprint, scrimOverlay, "adjustMiniplayerOpacity") - ).forEach { (fingerprint, literalValue, methodName) -> + ) + + if (MiniplayerResourcePatch.is_19_19_39_or_less) { + modernHideFeatures += Triple( + MiniplayerModernExpandButtonFingerprint, + modernMiniplayerExpand, + "hideMiniplayerExpandClose" + ) + modernHideFeatures += Triple( + MiniplayerModernCloseButtonFingerprint, + modernMiniplayerClose, + "hideMiniplayerExpandClose" + ) + + if (MiniplayerResourcePatch.is_19_24_45_or_less) { + modernHideFeatures += Triple( + MiniplayerModernRewindButtonFingerprint, + modernMiniplayerRewindButton, + "hideMiniplayerRewindForward" + ) + modernHideFeatures += Triple( + MiniplayerModernForwardButtonFingerprint, + modernMiniplayerForwardButton, + "hideMiniplayerRewindForward" + ) + } + } + + modernHideFeatures.forEach { (fingerprint, literalValue, methodName) -> fingerprint.resolve( context, MiniplayerModernViewParentFingerprint.resultOrThrow().classDef @@ -364,7 +390,7 @@ object MiniplayerPatch : BytecodePatch( removeInstruction(iPutIndex) } - private fun LiteralValueFingerprint.hookInflatedView( + private fun MethodFingerprint.hookInflatedView( literalValue: Long, hookedClassType: String, integrationsMethodName: String, From 618dcb2aa66ea36595f4cce9f34feacf9fc9f72c Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 02:49:13 -0400 Subject: [PATCH 017/143] fix(Background play): Fix Premium user unusual edge case failure --- api/revanced-patches.api | 1 + .../BackgroundPlaybackPatch.kt | 31 ++++++++++++++----- .../kotlin/app/revanced/util/BytecodeUtils.kt | 13 ++++++-- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 769746f26e..86aee8e285 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -2154,6 +2154,7 @@ 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 getException (Lapp/revanced/patcher/fingerprint/MethodFingerprint;)Lapp/revanced/patcher/patch/PatchException; 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 diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 570bde4ed0..b4f076aeb6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -3,6 +3,8 @@ package app.revanced.patches.youtube.misc.backgroundplayback import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions +import app.revanced.patcher.extensions.InstructionExtensions.getInstruction +import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch @@ -14,7 +16,10 @@ import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.patches.youtube.video.information.VideoInformationPatch +import app.revanced.util.findOpcodeIndicesReversed 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.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference @@ -79,14 +84,24 @@ object BackgroundPlaybackPatch : BytecodePatch( "Lapp/revanced/integrations/youtube/patches/BackgroundPlaybackPatch;" override fun execute(context: BytecodeContext) { - BackgroundPlaybackManagerFingerprint.resultOrThrow().mutableMethod.addInstructions( - 0, - """ - invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->playbackIsNotShort()Z - move-result v0 - return v0 - """ - ) + BackgroundPlaybackManagerFingerprint.resultOrThrow().mutableMethod.apply { + findOpcodeIndicesReversed(Opcode.RETURN).forEach{ index -> + val register = getInstruction(index).registerA + + // Replace to preserve control flow label. + replaceInstruction( + index, + "invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->allowBackgroundPlayback(Z)Z" + ) + + addInstructions(index + 1, + """ + move-result v$register + return v$register + """ + ) + } + } // Enable background playback option in YouTube settings BackgroundPlaybackSettingsFingerprint.resultOrThrow().mutableMethod.apply { diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index 0f81d8d4e2..704d45f42d 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -198,18 +198,25 @@ fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, predicate: Instru /** * @return The list of indices of the opcode in reverse order. */ -fun Method.findOpcodeIndicesReversed(opcode: Opcode): List { +fun Method.findOpcodeIndicesReversed(opcode: Opcode): List = + findOpcodeIndicesReversed { it.opcode == opcode } + +/** + * @return The list of indices of the opcode in reverse order. + */ +fun Method.findOpcodeIndicesReversed(filter: (Instruction) -> Boolean): List { val indexes = implementation!!.instructions .withIndex() - .filter { (_, instruction) -> instruction.opcode == opcode } + .filter { (_, instruction) -> filter.invoke(instruction) } .map { (index, _) -> index } .reversed() - if (indexes.isEmpty()) throw PatchException("No ${opcode.name} instructions found in: $this") + if (indexes.isEmpty()) throw PatchException("No matching instructions found in: $this") return indexes } + /** * Return the resolved method early. */ From bbf92f689be73755be21509f396b3067de58e313 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 05:54:25 -0400 Subject: [PATCH 018/143] fix(Miniplayer): Add Modern 1 drag and drop, double tap action --- .../layout/miniplayer/MiniplayerPatch.kt | 140 +++++++++++------- .../miniplayer/MiniplayerResourcePatch.kt | 41 +++-- .../MiniplayerModernConstructorFingerprint.kt | 9 +- .../MiniplayerModernEnabledFingerprint.kt | 14 ++ .../kotlin/app/revanced/util/BytecodeUtils.kt | 4 +- .../resources/addresources/values/strings.xml | 6 + 6 files changed, 134 insertions(+), 80 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernEnabledFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 924908913c..0a51fc59b4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -31,6 +31,7 @@ import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerDim import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernAddViewListenerFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernCloseButtonFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernConstructorFingerprint +import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernEnabledFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernExpandButtonFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernExpandCloseDrawablesFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernForwardButtonFingerprint @@ -48,8 +49,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.util.findOpcodeIndicesReversed import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfFirstWideLiteralInstructionValue import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow -import app.revanced.util.patch.LiteralValueFingerprint import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -62,13 +63,12 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference import com.android.tools.smali.dexlib2.iface.reference.TypeReference import com.android.tools.smali.dexlib2.immutable.ImmutableMethod import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter -import java.util.ArrayList -// YT uses "Miniplayer" without a space between 'mini' and 'player: https://support.google.com/youtube/answer/9162927. +// YT uses "Miniplayer" without a space between 'mini' and 'player': https://support.google.com/youtube/answer/9162927. @Patch( name = "Miniplayer", - description = "Adds options to change the in app minimized player, " + - "and if patching target 19.16+ adds options to use modern miniplayers.", + description = "Adds options to change the in app minimized player. " + + "If patching target 19.16+ modern miniplayers can be selected, with 19.25.37 offering the most features.", dependencies = [ IntegrationsPatch::class, SettingsPatch::class, @@ -104,18 +104,18 @@ import java.util.ArrayList "19.16.39", "19.17.41", "19.18.41", - "19.19.39", // Last (bug free) version with Modern 1 skip forward/back buttons and swipe to close. - // 19.20.35 // Issues with resuming miniplayer on cold start for Premium users. - // 19.21.40 // Issues with resuming miniplayer on cold start for Premium users. - // 19.22.43 // Issues with resuming miniplayer on cold start for Premium users. - // 19.23.40 // Issues with resuming miniplayer on cold start for Premium users. - // 19.24.45 // Last version with skip forward/back buttons, but has issues for Premium users. - // 19.25.37 // Issues with resuming miniplayer on cold start for Premium users. - // 19.26.42 // Issues with resuming miniplayer on cold start for Premium users. - // 19.28.42 // Issues with resuming miniplayer on cold start for Premium users. - "19.29.42", // Miniplayer can show layout glitches on cold start, but is still functional. - "19.30.39", - // 19.31.36 // Issues with resuming miniplayer on cold start for Premium users. + "19.19.39", // Last bug free version with smaller Modern 1 miniplayer. + // 19.20.35 // Cannot swipe to expand. Premium cold start cannot resume playback. + // 19.21.40 // Same issues as last. + // 19.22.43 // Same issues as last. + // 19.23.40 // First with Modern 1 drag and drop, same issues as last. + // 19.24.45 // First with larger Modern 1, same issues as last. + "19.25.37", // First with double tap, last with skip forward/back buttons. Screen flickers when swiping to expand Modern 1. + // 19.26.42 // Modern 1 Pause/play button are always hidden. Unusable. + "19.28.42", // Screen flickers when swiping to maximize Modern 1, otherwise no issues. + "19.29.42", // Same issues as last. + "19.30.39", // Same issues as last. + // 19.31.36 // All Modern 1 buttons are missing. Unusable. ] ) ] @@ -126,6 +126,7 @@ object MiniplayerPatch : BytecodePatch( MiniplayerDimensionsCalculatorParentFingerprint, MiniplayerResponseModelSizeCheckFingerprint, MiniplayerOverrideFingerprint, + MiniplayerModernEnabledFingerprint, MiniplayerModernConstructorFingerprint, MiniplayerModernViewParentFingerprint, YouTubePlayerOverlaysLayoutFingerprint @@ -137,8 +138,7 @@ object MiniplayerPatch : BytecodePatch( AddResourcesPatch(this::class) val preferences = mutableSetOf() - - if (MiniplayerResourcePatch.is_19_15_36_or_less) { + if (!MiniplayerResourcePatch.is_19_16_or_greater) { preferences += ListPreference( "revanced_miniplayer_type", summaryKey = null, @@ -152,15 +152,14 @@ object MiniplayerPatch : BytecodePatch( entriesKey = "revanced_miniplayer_type_19_16_entries", entryValuesKey = "revanced_miniplayer_type_19_16_entry_values" ) - - if (MiniplayerResourcePatch.is_19_19_39_or_less) { - preferences += SwitchPreference("revanced_miniplayer_hide_expand_close") - - if (MiniplayerResourcePatch.is_19_24_45_or_less) { - preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward") - } + if (MiniplayerResourcePatch.is_19_25_or_greater) { + preferences += SwitchPreference("revanced_miniplayer_enable_double_tap_action") + preferences += SwitchPreference("revanced_miniplayer_enable_drag_and_drop") + } + preferences += SwitchPreference("revanced_miniplayer_hide_expand_close") + if (!MiniplayerResourcePatch.is_19_26_or_greater) { + preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward") } - preferences += SwitchPreference("revanced_miniplayer_hide_subtext") preferences += TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER) } @@ -205,7 +204,7 @@ object MiniplayerPatch : BytecodePatch( it.mutableMethod.insertLegacyTabletMiniplayerOverride(it.scanResult.patternScanResult!!.endIndex) } - if (MiniplayerResourcePatch.is_19_15_36_or_less) { + if (!MiniplayerResourcePatch.is_19_16_or_greater) { // Return here, as patch below is only intended for new versions of the app. return } @@ -229,6 +228,41 @@ object MiniplayerPatch : BytecodePatch( } } + if (MiniplayerResourcePatch.is_19_25_or_greater) { + arrayOf( + Triple( + MiniplayerModernEnabledFingerprint, + MiniplayerModernEnabledFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, + "getModernMiniplayerOverride" + ), + Triple( + MiniplayerModernConstructorFingerprint, + MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, + "getModernMiniplayerOverride" + ), + Triple( + MiniplayerModernConstructorFingerprint, + MiniplayerModernConstructorFingerprint.DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL, + "enableMiniplayerDoubleTapAction" + ), + Triple( + MiniplayerModernConstructorFingerprint, + MiniplayerModernConstructorFingerprint.DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL, + "enableMiniplayerDragAndDrop" + ) + + ).forEach { (fingerprint, literal, intergrationsMethod) -> + fingerprint.resultOrThrow().mutableMethod.apply { + val literalIndex = indexOfFirstWideLiteralInstructionValue(literal) + val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) { + opcode == Opcode.MOVE_RESULT + } + + insertBooleanOverride(targetIndex + 1, intergrationsMethod) + } + } + } + // endregion // region Fix 19.16 using mixed up drawables for tablet modern. @@ -255,40 +289,35 @@ object MiniplayerPatch : BytecodePatch( // endregion + // region Add hooks to hide modern miniplayer buttons. - // region Add hooks to hide tablet modern miniplayer buttons. - - val modernHideFeatures = mutableListOf>( - Triple(MiniplayerModernOverlayViewFingerprint, scrimOverlay, "adjustMiniplayerOpacity") - ) - - if (MiniplayerResourcePatch.is_19_19_39_or_less) { - modernHideFeatures += Triple( + listOf( + Triple( MiniplayerModernExpandButtonFingerprint, modernMiniplayerExpand, "hideMiniplayerExpandClose" - ) - modernHideFeatures += Triple( + ), + Triple( MiniplayerModernCloseButtonFingerprint, modernMiniplayerClose, "hideMiniplayerExpandClose" + ), + Triple( + MiniplayerModernRewindButtonFingerprint, + modernMiniplayerRewindButton, + "hideMiniplayerRewindForward" + ), + Triple( + MiniplayerModernForwardButtonFingerprint, + modernMiniplayerForwardButton, + "hideMiniplayerRewindForward" + ), + Triple( + MiniplayerModernOverlayViewFingerprint, + scrimOverlay, + "adjustMiniplayerOpacity" ) - - if (MiniplayerResourcePatch.is_19_24_45_or_less) { - modernHideFeatures += Triple( - MiniplayerModernRewindButtonFingerprint, - modernMiniplayerRewindButton, - "hideMiniplayerRewindForward" - ) - modernHideFeatures += Triple( - MiniplayerModernForwardButtonFingerprint, - modernMiniplayerForwardButton, - "hideMiniplayerRewindForward" - ) - } - } - - modernHideFeatures.forEach { (fingerprint, literalValue, methodName) -> + ).forEach { (fingerprint, literalValue, methodName) -> fingerprint.resolve( context, MiniplayerModernViewParentFingerprint.resultOrThrow().classDef @@ -317,6 +346,9 @@ object MiniplayerPatch : BytecodePatch( // Modern 2 uses the same overlay controls as the regular video player, // and the overlay views are added at runtime. // Add a hook to the overlay class, and pass the added views to integrations. + // + // NOTE: Modern 2 uses the same video UI as the regular player except resized to smaller. + // This patch code could be used to hide other player overlays that do not use Litho. YouTubePlayerOverlaysLayoutFingerprint.resultOrThrow().mutableClass.methods.add( ImmutableMethod( YOUTUBE_PLAYER_OVERLAYS_LAYOUT_CLASS_NAME, diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt index 1f76bfcb54..190b5538b1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt @@ -21,31 +21,28 @@ internal object MiniplayerResourcePatch : ResourcePatch() { var modernMiniplayerForwardButton = -1L var playerOverlays = -1L - // These version checks assume no new bug fix versions will be released (such as 19.16.40). - /** - * Supports only legacy miniplayer. - */ - var is_19_15_36_or_less = false - /** - * First supported version with modern miniplayers - */ - var is_19_16_35_or_less = false - /** - * Last version with Modern 1swipe to expand/close functionality. - */ - var is_19_19_39_or_less = false - /** - * Last version with Modern 1 skip forward/back buttons. - */ - var is_19_24_45_or_less = false + // TODO: Extract these version checks into a shared resource patch. + + var is_19_15_or_greater = false + var is_19_16_or_greater = false + var is_19_17_or_greater = false + var is_19_19_or_greater = false + var is_19_23_or_greater = false + var is_19_24_or_greater = false + var is_19_25_or_greater = false + var is_19_26_or_greater = false override fun execute(context: ResourceContext) { val playVersion = ResourceUtils.getPlayServicesVersion(context) - is_19_15_36_or_less = playVersion <= 241602000 - is_19_16_35_or_less = playVersion <= 241702000 - is_19_19_39_or_less = playVersion <= 241999000 - is_19_24_45_or_less = playVersion <= 242505000 + is_19_15_or_greater = 241602000 <= playVersion + is_19_16_or_greater = 241702000 <= playVersion + is_19_17_or_greater = 241802000 <= playVersion + is_19_19_or_greater = 241999000 <= playVersion + is_19_24_or_greater = 242505000 <= playVersion + is_19_23_or_greater = 242402000 <= playVersion + is_19_25_or_greater = 242599000 <= playVersion + is_19_26_or_greater = 242705000 <= playVersion floatyBarButtonTopMargin = ResourceMappingPatch[ "dimen", @@ -53,7 +50,7 @@ internal object MiniplayerResourcePatch : ResourcePatch() { ] // Only required for 19.16 - if (!is_19_15_36_or_less && is_19_16_35_or_less) { + if (is_19_16_or_greater && !is_19_17_or_greater) { ytOutlinePictureInPictureWhite24 = ResourceMappingPatch[ "drawable", "yt_outline_picture_in_picture_white_24" diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt index 0afb5e5264..d09bef7b7c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt @@ -1,11 +1,16 @@ package app.revanced.patches.youtube.layout.miniplayer.fingerprints import app.revanced.patcher.extensions.or +import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags internal object MiniplayerModernConstructorFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, parameters = listOf("L"), - literalSupplier = { 45623000L } // Magic number found in the constructor. -) \ No newline at end of file + literalSupplier = { MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL } +) { + const val MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL = 45622882L + const val DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL = 45628823L + const val DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL = 45628752L +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernEnabledFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernEnabledFingerprint.kt new file mode 100644 index 0000000000..d249642c3e --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernEnabledFingerprint.kt @@ -0,0 +1,14 @@ +package app.revanced.patches.youtube.layout.miniplayer.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernEnabledFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL +import app.revanced.util.patch.LiteralValueFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +internal object MiniplayerModernEnabledFingerprint : LiteralValueFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, + parameters = listOf("L"), + literalSupplier = { MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL } +) { + const val MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL = 45630429L +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index 704d45f42d..80f58239cd 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -199,12 +199,12 @@ fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, predicate: Instru * @return The list of indices of the opcode in reverse order. */ fun Method.findOpcodeIndicesReversed(opcode: Opcode): List = - findOpcodeIndicesReversed { it.opcode == opcode } + findOpcodeIndicesReversed { this.opcode == opcode } /** * @return The list of indices of the opcode in reverse order. */ -fun Method.findOpcodeIndicesReversed(filter: (Instruction) -> Boolean): List { +fun Method.findOpcodeIndicesReversed(filter: Instruction.() -> Boolean): List { val indexes = implementation!!.instructions .withIndex() .filter { (_, instruction) -> filter.invoke(instruction) } diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 5f41165c1a..1f0e6b8726 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -986,6 +986,12 @@ This is because Crowdin requires temporarily flattening this file and removing t Modern 1 Modern 2 Modern 3 + Enable double-tap action + Double-tap action is enabled\n• Double tap to increase miniplayer size\n• Double tap again to restore original size + Double-tap action is disabled + Enable drag and drop + Drag and drop is enabled + Drag and drop is disabled Hide expand and close buttons Buttons are hidden\n(swipe miniplayer to expand or close) Expand and close buttons are shown From 92651504d7300e76615f9158f4a4dc5a93ad3c6d Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 10:11:36 -0400 Subject: [PATCH 019/143] feat(Miniplayer): Customize `19.28` miniplayer size --- .../layout/miniplayer/MiniplayerPatch.kt | 87 ++++++++++++------- .../MiniplayerModernConstructorFingerprint.kt | 1 + .../resources/addresources/values/strings.xml | 3 + 3 files changed, 60 insertions(+), 31 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 0a51fc59b4..2bf0555141 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -49,7 +49,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.util.findOpcodeIndicesReversed import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.indexOfFirstWideLiteralInstructionValue import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.AccessFlags @@ -68,7 +67,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter @Patch( name = "Miniplayer", description = "Adds options to change the in app minimized player. " + - "If patching target 19.16+ modern miniplayers can be selected, with 19.25.37 offering the most features.", + "Patching target 19.16+ adds modern miniplayers, and 19.28+ offers the most customization", dependencies = [ IntegrationsPatch::class, SettingsPatch::class, @@ -112,7 +111,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter // 19.24.45 // First with larger Modern 1, same issues as last. "19.25.37", // First with double tap, last with skip forward/back buttons. Screen flickers when swiping to expand Modern 1. // 19.26.42 // Modern 1 Pause/play button are always hidden. Unusable. - "19.28.42", // Screen flickers when swiping to maximize Modern 1, otherwise no issues. + "19.28.42", // First with custom miniplayer size, screen flickers when swiping to maximize Modern 1. "19.29.42", // Same issues as last. "19.30.39", // Same issues as last. // 19.31.36 // All Modern 1 buttons are missing. Unusable. @@ -161,6 +160,9 @@ object MiniplayerPatch : BytecodePatch( preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward") } preferences += SwitchPreference("revanced_miniplayer_hide_subtext") + if (MiniplayerResourcePatch.is_19_26_or_greater) { + preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER) + } preferences += TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER) } @@ -228,38 +230,47 @@ object MiniplayerPatch : BytecodePatch( } } + if (MiniplayerResourcePatch.is_19_23_or_greater) { + MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( + MiniplayerModernConstructorFingerprint.DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL, + "enableMiniplayerDragAndDrop" + ) + } + if (MiniplayerResourcePatch.is_19_25_or_greater) { - arrayOf( - Triple( - MiniplayerModernEnabledFingerprint, - MiniplayerModernEnabledFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, - "getModernMiniplayerOverride" - ), - Triple( - MiniplayerModernConstructorFingerprint, - MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, - "getModernMiniplayerOverride" - ), - Triple( - MiniplayerModernConstructorFingerprint, - MiniplayerModernConstructorFingerprint.DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL, - "enableMiniplayerDoubleTapAction" - ), - Triple( - MiniplayerModernConstructorFingerprint, - MiniplayerModernConstructorFingerprint.DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL, - "enableMiniplayerDragAndDrop" - ) + MiniplayerModernEnabledFingerprint.insertLiteralValueBooleanOverride( + MiniplayerModernEnabledFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, + "getModernMiniplayerOverride" + ) - ).forEach { (fingerprint, literal, intergrationsMethod) -> - fingerprint.resultOrThrow().mutableMethod.apply { - val literalIndex = indexOfFirstWideLiteralInstructionValue(literal) - val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) { - opcode == Opcode.MOVE_RESULT - } + MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( + MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, + "getModernMiniplayerOverride" + ) + + MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( + MiniplayerModernConstructorFingerprint.DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL, + "enableMiniplayerDoubleTapAction" + ) + } - insertBooleanOverride(targetIndex + 1, intergrationsMethod) + if (MiniplayerResourcePatch.is_19_26_or_greater) { + MiniplayerModernConstructorFingerprint.resultOrThrow().mutableMethod.apply { + val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow( + MiniplayerModernConstructorFingerprint.MINIPLAYER_SIZE_FEATURE_KEY_LITERAL + ) + val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) { + opcode == Opcode.LONG_TO_INT } + val register = getInstruction(targetIndex).registerA + + addInstructions( + targetIndex + 1, + """ + invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->setMiniplayerSize(I)I + move-result v$register + """ + ) } } @@ -393,6 +404,20 @@ object MiniplayerPatch : BytecodePatch( insertBooleanOverride(index, "getModernMiniplayerOverride") } + private fun MethodFingerprint.insertLiteralValueBooleanOverride( + literal: Long, + integrationsMethod: String + ) { + resultOrThrow().mutableMethod.apply { + val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(literal) + val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) { + opcode == Opcode.MOVE_RESULT + } + + insertBooleanOverride(targetIndex + 1, integrationsMethod) + } + } + private fun MutableMethod.insertBooleanOverride(index: Int, methodName: String) { val register = getInstruction(index).registerA addInstructions( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt index d09bef7b7c..d8b95d7da6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt @@ -13,4 +13,5 @@ internal object MiniplayerModernConstructorFingerprint : LiteralValueFingerprint const val MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL = 45622882L const val DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL = 45628823L const val DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL = 45628752L + const val MINIPLAYER_SIZE_FEATURE_KEY_LITERAL = 45640023L } \ No newline at end of file diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 1f0e6b8726..f587bcd953 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -986,6 +986,9 @@ This is because Crowdin requires temporarily flattening this file and removing t Modern 1 Modern 2 Modern 3 + Miniplayer size + On screen size, in pixels + Pixel size must be between %1$s and %2$s Enable double-tap action Double-tap action is enabled\n• Double tap to increase miniplayer size\n• Double tap again to restore original size Double-tap action is disabled From 91f30adc52d92ad5063d232c1896cb11ac92e99f Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 10:17:21 -0400 Subject: [PATCH 020/143] fix: Adjust text --- src/main/resources/addresources/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index f587bcd953..350880eaa8 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -990,7 +990,7 @@ This is because Crowdin requires temporarily flattening this file and removing t On screen size, in pixels Pixel size must be between %1$s and %2$s Enable double-tap action - Double-tap action is enabled\n• Double tap to increase miniplayer size\n• Double tap again to restore original size + Double-tap action is enabled\n\n• Double tap to increase miniplayer size\n• Double tap again to restore original size Double-tap action is disabled Enable drag and drop Drag and drop is enabled From cbdef4699276632e28fed33e543399e1b1a039fb Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 18:41:43 -0400 Subject: [PATCH 021/143] fix: Comments, fix 19.16 patching --- .../youtube/layout/miniplayer/MiniplayerPatch.kt | 16 ++++++++-------- .../MiniplayerModernConstructorFingerprint.kt | 3 +-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 2bf0555141..0087a11515 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -100,20 +100,20 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.13.37", // 19.14.43 // Incomplete code for modern miniplayers. // 19.15.36 // Different code for handling sub title texts and not worth supporting. - "19.16.39", + "19.16.39", // First with modern miniplayers. "19.17.41", "19.18.41", "19.19.39", // Last bug free version with smaller Modern 1 miniplayer. - // 19.20.35 // Cannot swipe to expand. Premium cold start cannot resume playback. - // 19.21.40 // Same issues as last. - // 19.22.43 // Same issues as last. - // 19.23.40 // First with Modern 1 drag and drop, same issues as last. - // 19.24.45 // First with larger Modern 1, same issues as last. + // 19.20.35 // Cannot swipe to expand. + // 19.21.40 // Cannot swipe to expand. + // 19.22.43 // Cannot swipe to expand. + // 19.23.40 // First with Modern 1 drag and drop, Cannot swipe to expand. + // 19.24.45 // First with larger Modern 1, Cannot swipe to expand. "19.25.37", // First with double tap, last with skip forward/back buttons. Screen flickers when swiping to expand Modern 1. // 19.26.42 // Modern 1 Pause/play button are always hidden. Unusable. "19.28.42", // First with custom miniplayer size, screen flickers when swiping to maximize Modern 1. - "19.29.42", // Same issues as last. - "19.30.39", // Same issues as last. + "19.29.42", // Screen flickers when swiping to maximize Modern 1. + "19.30.39", // Screen flickers when swiping to maximize Modern 1. // 19.31.36 // All Modern 1 buttons are missing. Unusable. ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt index d8b95d7da6..cba9059c2e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt @@ -1,14 +1,13 @@ package app.revanced.patches.youtube.layout.miniplayer.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags internal object MiniplayerModernConstructorFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, parameters = listOf("L"), - literalSupplier = { MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL } + literalSupplier = { 45623000L } // Magic number found in the constructor. ) { const val MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL = 45622882L const val DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL = 45628823L From 97bc87da0a8c67178382a8dc962436503a8dc10c Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 18:58:47 -0400 Subject: [PATCH 022/143] refactor: Add YouTube version check patch --- .../layout/miniplayer/MiniplayerPatch.kt | 17 ++--- .../miniplayer/MiniplayerResourcePatch.kt | 28 +------- .../misc/playservice/YouTubeVersionCheck.kt | 67 +++++++++++++++++++ .../kotlin/app/revanced/util/ResourceUtils.kt | 36 ---------- 4 files changed, 79 insertions(+), 69 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 0087a11515..9f9c21beab 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -13,6 +13,7 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patches.all.misc.resources.AddResourcesPatch +import app.revanced.patches.shared.misc.playservice.YouTubeVersionCheck import app.revanced.patches.shared.misc.settings.preference.BasePreference import app.revanced.patches.shared.misc.settings.preference.InputType import app.revanced.patches.shared.misc.settings.preference.ListPreference @@ -137,7 +138,7 @@ object MiniplayerPatch : BytecodePatch( AddResourcesPatch(this::class) val preferences = mutableSetOf() - if (!MiniplayerResourcePatch.is_19_16_or_greater) { + if (!YouTubeVersionCheck.is_19_16_or_greater) { preferences += ListPreference( "revanced_miniplayer_type", summaryKey = null, @@ -151,16 +152,16 @@ object MiniplayerPatch : BytecodePatch( entriesKey = "revanced_miniplayer_type_19_16_entries", entryValuesKey = "revanced_miniplayer_type_19_16_entry_values" ) - if (MiniplayerResourcePatch.is_19_25_or_greater) { + if (YouTubeVersionCheck.is_19_25_or_greater) { preferences += SwitchPreference("revanced_miniplayer_enable_double_tap_action") preferences += SwitchPreference("revanced_miniplayer_enable_drag_and_drop") } preferences += SwitchPreference("revanced_miniplayer_hide_expand_close") - if (!MiniplayerResourcePatch.is_19_26_or_greater) { + if (!YouTubeVersionCheck.is_19_26_or_greater) { preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward") } preferences += SwitchPreference("revanced_miniplayer_hide_subtext") - if (MiniplayerResourcePatch.is_19_26_or_greater) { + if (YouTubeVersionCheck.is_19_26_or_greater) { preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER) } preferences += TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER) @@ -206,7 +207,7 @@ object MiniplayerPatch : BytecodePatch( it.mutableMethod.insertLegacyTabletMiniplayerOverride(it.scanResult.patternScanResult!!.endIndex) } - if (!MiniplayerResourcePatch.is_19_16_or_greater) { + if (!YouTubeVersionCheck.is_19_16_or_greater) { // Return here, as patch below is only intended for new versions of the app. return } @@ -230,14 +231,14 @@ object MiniplayerPatch : BytecodePatch( } } - if (MiniplayerResourcePatch.is_19_23_or_greater) { + if (YouTubeVersionCheck.is_19_23_or_greater) { MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( MiniplayerModernConstructorFingerprint.DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL, "enableMiniplayerDragAndDrop" ) } - if (MiniplayerResourcePatch.is_19_25_or_greater) { + if (YouTubeVersionCheck.is_19_25_or_greater) { MiniplayerModernEnabledFingerprint.insertLiteralValueBooleanOverride( MiniplayerModernEnabledFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, "getModernMiniplayerOverride" @@ -254,7 +255,7 @@ object MiniplayerPatch : BytecodePatch( ) } - if (MiniplayerResourcePatch.is_19_26_or_greater) { + if (YouTubeVersionCheck.is_19_26_or_greater) { MiniplayerModernConstructorFingerprint.resultOrThrow().mutableMethod.apply { val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow( MiniplayerModernConstructorFingerprint.MINIPLAYER_SIZE_FEATURE_KEY_LITERAL diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt index 190b5538b1..da67ef9ec2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt @@ -5,9 +5,9 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.util.ResourceUtils +import app.revanced.patches.shared.misc.playservice.YouTubeVersionCheck -@Patch(dependencies = [ResourceMappingPatch::class]) +@Patch(dependencies = [ResourceMappingPatch::class, YouTubeVersionCheck::class]) internal object MiniplayerResourcePatch : ResourcePatch() { var floatyBarButtonTopMargin = -1L @@ -21,36 +21,14 @@ internal object MiniplayerResourcePatch : ResourcePatch() { var modernMiniplayerForwardButton = -1L var playerOverlays = -1L - // TODO: Extract these version checks into a shared resource patch. - - var is_19_15_or_greater = false - var is_19_16_or_greater = false - var is_19_17_or_greater = false - var is_19_19_or_greater = false - var is_19_23_or_greater = false - var is_19_24_or_greater = false - var is_19_25_or_greater = false - var is_19_26_or_greater = false - override fun execute(context: ResourceContext) { - val playVersion = ResourceUtils.getPlayServicesVersion(context) - - is_19_15_or_greater = 241602000 <= playVersion - is_19_16_or_greater = 241702000 <= playVersion - is_19_17_or_greater = 241802000 <= playVersion - is_19_19_or_greater = 241999000 <= playVersion - is_19_24_or_greater = 242505000 <= playVersion - is_19_23_or_greater = 242402000 <= playVersion - is_19_25_or_greater = 242599000 <= playVersion - is_19_26_or_greater = 242705000 <= playVersion - floatyBarButtonTopMargin = ResourceMappingPatch[ "dimen", "floaty_bar_button_top_margin" ] // Only required for 19.16 - if (is_19_16_or_greater && !is_19_17_or_greater) { + if (YouTubeVersionCheck.is_19_16_or_greater && !YouTubeVersionCheck.is_19_17_or_greater) { ytOutlinePictureInPictureWhite24 = ResourceMappingPatch[ "drawable", "yt_outline_picture_in_picture_white_24" diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt new file mode 100644 index 0000000000..8f296992cf --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt @@ -0,0 +1,67 @@ +package app.revanced.patches.shared.misc.playservice + +import app.revanced.patcher.data.ResourceContext +import app.revanced.patcher.patch.PatchException +import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch +import org.w3c.dom.Element +import org.w3c.dom.Node +import kotlin.properties.Delegates + +/** + * Uses the Play Store service version to find the major/minor version of the target app. + * All bug fix releases always seem to use the same play store version. + */ +@Patch(dependencies = [ResourceMappingPatch::class]) +internal object YouTubeVersionCheck : ResourcePatch() { + + private var playStoreServicesVersion by Delegates.notNull() + + var is_19_15_or_greater by Delegates.notNull() + var is_19_16_or_greater by Delegates.notNull() + var is_19_17_or_greater by Delegates.notNull() + var is_19_19_or_greater by Delegates.notNull() + var is_19_23_or_greater by Delegates.notNull() + var is_19_24_or_greater by Delegates.notNull() + var is_19_25_or_greater by Delegates.notNull() + var is_19_26_or_greater by Delegates.notNull() + + override fun execute(context: ResourceContext) { + findPlayServicesVersion(context) + + is_19_15_or_greater = 241602000 <= playStoreServicesVersion + is_19_16_or_greater = 241702000 <= playStoreServicesVersion + is_19_17_or_greater = 241802000 <= playStoreServicesVersion + is_19_19_or_greater = 241999000 <= playStoreServicesVersion + is_19_24_or_greater = 242505000 <= playStoreServicesVersion + is_19_23_or_greater = 242402000 <= playStoreServicesVersion + is_19_25_or_greater = 242599000 <= playStoreServicesVersion + is_19_26_or_greater = 242705000 <= playStoreServicesVersion + } + + /** + * Used to check what version an app is. + * Returns the Google Play services version, + * since the decoded app manifest does not have the app version. + */ + private fun findPlayServicesVersion(context: ResourceContext) { + // The app version is missing from the decompiled manifest, + // so instead use the Google Play services version and compare against specific releases. + context.document["res/values/integers.xml"].use { document -> + val nodeList = document.documentElement.childNodes + for (i in 0 until nodeList.length) { + val node = nodeList.item(i) + if (node.nodeType == Node.ELEMENT_NODE) { + val element = node as Element + if (element.getAttribute("name") == "google_play_services_version") { + playStoreServicesVersion = element.textContent.toInt() + return + } + } + } + } + + throw PatchException("integers.xml does not contain a Google Play services version") + } +} diff --git a/src/main/kotlin/app/revanced/util/ResourceUtils.kt b/src/main/kotlin/app/revanced/util/ResourceUtils.kt index 1b502ef5ba..56076078d3 100644 --- a/src/main/kotlin/app/revanced/util/ResourceUtils.kt +++ b/src/main/kotlin/app/revanced/util/ResourceUtils.kt @@ -1,50 +1,14 @@ package app.revanced.util import app.revanced.patcher.data.ResourceContext -import app.revanced.patcher.patch.PatchException import app.revanced.patcher.util.DomFileEditor import app.revanced.util.resource.BaseResource -import org.w3c.dom.Element import org.w3c.dom.Node import org.w3c.dom.NodeList import java.io.InputStream import java.nio.file.Files import java.nio.file.StandardCopyOption -internal object ResourceUtils { - private var playStoreServicesVersion : Int? = null - - /** - * Used to check what version an app is. - * Returns the Google Play services version, - * since the decoded app manifest does not have the app version. - */ - fun getPlayServicesVersion(context: ResourceContext) : Int { - if (playStoreServicesVersion != null) { - return playStoreServicesVersion!! - } - - // The app version is missing from the decompiled manifest, - // so instead use the Google Play services version and compare against specific releases. - context.document["res/values/integers.xml"].use { document -> - val nodeList = document.documentElement.childNodes - for (i in 0 until nodeList.length) { - val node = nodeList.item(i) - if (node.nodeType == Node.ELEMENT_NODE) { - val element = node as Element - if (element.getAttribute("name") == "google_play_services_version") { - val version = element.textContent.toInt() - playStoreServicesVersion = version - return version - } - } - } - } - - throw PatchException("integers.xml does not contain a Google Play services version") - } -} - private val classLoader = object {}.javaClass.classLoader /** From 636769c507a0c09dac1e9b01c040ff825e973c49 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 20:20:02 -0400 Subject: [PATCH 023/143] fix: Use same version as old seekbar thumbnails --- .../interaction/seekbar/EnableSlideToSeekPatch.kt | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt index 2fed864f0a..0a8b86bbe6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt @@ -44,19 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", - "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", + // 19.17.41 is the last version with the target code. ] ) ], From 5d631c66429d2c754debc8c9b279e85d6bc3589a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 21:01:43 -0400 Subject: [PATCH 024/143] fix patching older versions --- .../PlayerResponseMethodHookPatch.kt | 24 ++++++++++------ .../PlayerParameterBuilderFingerprint.kt | 24 +++++++++++++--- ...PlayerParameterBuilderLegacyFingerprint.kt | 28 +++++++++++++++++++ 3 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderLegacyFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt index 6b5b42eb9f..df365a4bd4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.video.playerresponse -import app.revanced.util.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -9,20 +8,27 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.video.playerresponse.fingerprint.PlayerParameterBuilderFingerprint +import app.revanced.patches.youtube.video.playerresponse.fingerprint.PlayerParameterBuilderLegacyFingerprint +import app.revanced.util.resultOrThrow import java.io.Closeable @Patch( dependencies = [IntegrationsPatch::class], ) object PlayerResponseMethodHookPatch : - BytecodePatch(setOf(PlayerParameterBuilderFingerprint)), + BytecodePatch( + setOf( + PlayerParameterBuilderFingerprint, + PlayerParameterBuilderLegacyFingerprint + ) + ), Closeable, MutableSet by mutableSetOf() { // Parameter numbers of the patched method. private const val PARAMETER_VIDEO_ID = 1 private const val PARAMETER_PROTO_BUFFER = 3 - private var PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 11 + private var PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = -1 // Registers used to pass the parameters to integrations. private var playerResponseMethodCopyRegisters = false @@ -34,17 +40,19 @@ object PlayerResponseMethodHookPatch : private var numberOfInstructionsAdded = 0 override fun execute(context: BytecodeContext) { - playerResponseMethod = PlayerParameterBuilderFingerprint.result?.mutableMethod - ?: throw PlayerParameterBuilderFingerprint.exception + if (PlayerParameterBuilderLegacyFingerprint.result != null) { + playerResponseMethod = PlayerParameterBuilderLegacyFingerprint.resultOrThrow().mutableMethod + PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 11 + } else { + playerResponseMethod = PlayerParameterBuilderFingerprint.resultOrThrow().mutableMethod + PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 12 + } // 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 integrations. playerResponseMethodCopyRegisters = playerResponseMethod.implementation!!.registerCount - playerResponseMethod.parameterTypes.size + PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING > 15 - PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = - if (playerResponseMethod.parameterTypes[10] == "Z") 11 else 12 - if (playerResponseMethodCopyRegisters) { REGISTER_VIDEO_ID = "v0" REGISTER_PROTO_BUFFER = "v1" diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt index d987f27060..4152d39aad 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderFingerprint.kt @@ -4,11 +4,27 @@ import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.AccessFlags +/** + * For targets 19.25 and later. + */ internal object PlayerParameterBuilderFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, returnType = "L", - strings = listOf("psps"), - customFingerprint = { methodDef, _ -> - methodDef.parameters.isNotEmpty() - } + parameters = listOf( + "Ljava/lang/String;", // VideoId. + "[B", + "Ljava/lang/String;", // Player parameters proto buffer. + "Ljava/lang/String;", + "I", + "I", + "L", // 19.25+ parameter + "Ljava/util/Set;", + "Ljava/lang/String;", + "Ljava/lang/String;", + "L", + "Z", // Appears to indicate if the video id is being opened or is currently playing. + "Z", + "Z" + ), + strings = listOf("psps") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderLegacyFingerprint.kt new file mode 100644 index 0000000000..f41a57e344 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/fingerprint/PlayerParameterBuilderLegacyFingerprint.kt @@ -0,0 +1,28 @@ +package app.revanced.patches.youtube.video.playerresponse.fingerprint + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +/** + * For targets 19.24 and earlier. + */ +internal object PlayerParameterBuilderLegacyFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + returnType = "L", + parameters = listOf( + "Ljava/lang/String;", // VideoId. + "[B", + "Ljava/lang/String;", // Player parameters proto buffer. + "Ljava/lang/String;", + "I", + "I", + "Ljava/util/Set;", + "Ljava/lang/String;", + "Ljava/lang/String;", + "L", + "Z", // Appears to indicate if the video id is being opened or is currently playing. + "Z", + "Z" + ) +) \ No newline at end of file From 9a69c60eebaceef9ba673d6061e786bd4efa97ab Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 8 Sep 2024 23:10:26 -0400 Subject: [PATCH 025/143] fix Sponsorblock overlay buttons --- .../sponsorblock/SponsorBlockBytecodePatch.kt | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index e5c815b72b..2b2a0f22dc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -25,6 +25,9 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint import app.revanced.patches.youtube.video.information.VideoInformationPatch import app.revanced.patches.youtube.video.videoid.VideoIdPatch import app.revanced.util.exception +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.* import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c @@ -187,43 +190,41 @@ object SponsorBlockBytecodePatch : BytecodePatch( */ val controlsMethodResult = PlayerControlsBytecodePatch.showPlayerControlsFingerprintResult - val controlsLayoutStubResourceId = - ResourceMappingPatch["id", "controls_layout_stub"] - val zoomOverlayResourceId = - ResourceMappingPatch["id", "video_zoom_overlay_stub"] + val controlsLayoutStubResourceId = ResourceMappingPatch["id", "controls_layout_stub"] + val zoomOverlayResourceId = ResourceMappingPatch["id", "video_zoom_overlay_stub"] - methods@ for (method in controlsMethodResult.mutableClass.methods) { + for (method in controlsMethodResult.mutableClass.methods) { val instructions = method.implementation?.instructions!! - instructions@ for ((index, instruction) in instructions.withIndex()) { + for ((constIndex, instruction) in instructions.withIndex()) { // search for method which inflates the controls layout view - if (instruction.opcode != Opcode.CONST) continue@instructions + if (instruction.opcode != Opcode.CONST) continue when ((instruction as NarrowLiteralInstruction).wideLiteral) { controlsLayoutStubResourceId -> { - // replace the view with the YouTubeControlsOverlay - val moveResultInstructionIndex = index + 5 - val inflatedViewRegister = - (instructions[moveResultInstructionIndex] as OneRegisterInstruction).registerA - // initialize with the player overlay object + val insertIndex = method.indexOfFirstInstructionOrThrow(constIndex) { + getReference()?.name == "inflate" + } + 1 + val inflatedViewRegister = method.getInstruction(insertIndex).registerA + method.addInstructions( - moveResultInstructionIndex + 1, // insert right after moving the view to the register and use that register + insertIndex + 1, """ - invoke-static {v$inflatedViewRegister}, $INTEGRATIONS_CREATE_SEGMENT_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/View;)V - invoke-static {v$inflatedViewRegister}, $INTEGRATIONS_VOTING_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/View;)V + invoke-static { v$inflatedViewRegister }, $INTEGRATIONS_CREATE_SEGMENT_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/View;)V + invoke-static { v$inflatedViewRegister }, $INTEGRATIONS_VOTING_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/View;)V """, ) } zoomOverlayResourceId -> { val invertVisibilityMethod = - context.toMethodWalker(method).nextMethod(index - 6, true).getMethod() as MutableMethod + context.toMethodWalker(method).nextMethod(constIndex - 6, true).getMethod() as MutableMethod // change visibility of the buttons invertVisibilityMethod.addInstructions( 0, """ invoke-static {p1}, $INTEGRATIONS_CREATE_SEGMENT_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->changeVisibilityNegatedImmediate(Z)V invoke-static {p1}, $INTEGRATIONS_VOTING_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->changeVisibilityNegatedImmediate(Z)V - """.trimIndent(), + """ ) } } From dd5a4d358e7af170140f9281ede9b7a1be8e1419 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 9 Sep 2024 00:21:46 -0400 Subject: [PATCH 026/143] refactor: Cleanup of SponsorBlock patch. No functional changes. --- api/revanced-patches.api | 4 + .../sponsorblock/SponsorBlockBytecodePatch.kt | 274 ++++++++---------- .../kotlin/app/revanced/util/BytecodeUtils.kt | 41 ++- 3 files changed, 171 insertions(+), 148 deletions(-) diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 86aee8e285..cec18bb595 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -2165,6 +2165,10 @@ public final class app/revanced/util/BytecodeUtilsKt { 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 public static final fun indexOfIdResourceOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/String;)I + public static final fun indexOfLastInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)I + public static synthetic fun indexOfLastInstruction$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)I + public static final fun indexOfLastInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)I + public static synthetic fun indexOfLastInstructionOrThrow$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)I public static final fun injectHideViewCall (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;IILjava/lang/String;Ljava/lang/String;)V public static final fun resultOrThrow (Lapp/revanced/patcher/fingerprint/MethodFingerprint;)Lapp/revanced/patcher/fingerprint/MethodFingerprintResult; public static final fun returnEarly (Lapp/revanced/patcher/fingerprint/MethodFingerprint;Z)V diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index 2b2a0f22dc..4b56b4e513 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -24,13 +24,18 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarFingerprint import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint import app.revanced.patches.youtube.video.information.VideoInformationPatch import app.revanced.patches.youtube.video.videoid.VideoIdPatch -import app.revanced.util.exception +import app.revanced.util.alsoResolve +import app.revanced.util.findOpcodeIndicesReversed import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfLastInstructionOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.iface.instruction.* -import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c +import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction +import com.android.tools.smali.dexlib2.iface.instruction.Instruction +import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction +import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference import com.android.tools.smali.dexlib2.iface.reference.MethodReference import com.android.tools.smali.dexlib2.iface.reference.StringReference @@ -106,12 +111,6 @@ object SponsorBlockBytecodePatch : BytecodePatch( "Lapp/revanced/integrations/youtube/sponsorblock/ui/SponsorBlockViewController;" override fun execute(context: BytecodeContext) { - LayoutConstructorFingerprint.result?.let { - if (!ControlsOverlayFingerprint.resolve(context, it.classDef)) { - throw ControlsOverlayFingerprint.exception - } - } ?: throw LayoutConstructorFingerprint.exception - /* * Hook the video time methods */ @@ -122,138 +121,122 @@ object SponsorBlockBytecodePatch : BytecodePatch( ) } - /* - * Set current video id. - */ - VideoIdPatch.hookBackgroundPlayVideoId("$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V") - - /* - * Seekbar drawing - */ - val seekbarSignatureResult = SeekbarFingerprint.result!!.let { - SeekbarOnDrawFingerprint.apply { resolve(context, it.mutableClass) } - }.result!! - val seekbarMethod = seekbarSignatureResult.mutableMethod - val seekbarMethodInstructions = seekbarMethod.implementation!!.instructions - - /* - * Get left and right of seekbar rectangle - */ - val moveRectangleToRegisterIndex = seekbarMethodInstructions.indexOfFirst { - it.opcode == Opcode.MOVE_OBJECT_FROM16 - } - - seekbarMethod.addInstruction( - moveRectangleToRegisterIndex + 1, - "invoke-static/range {p0 .. p0}, " + - "$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->setSponsorBarRect(Ljava/lang/Object;)V", - ) - - for ((index, instruction) in seekbarMethodInstructions.withIndex()) { - if (instruction.opcode != Opcode.INVOKE_STATIC) continue + VideoIdPatch.hookBackgroundPlayVideoId( + "$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->setCurrentVideoId(Ljava/lang/String;)V") - val invokeInstruction = instruction as Instruction35c - if ((invokeInstruction.reference as MethodReference).name != "round") continue - val insertIndex = index + 2 - - // set the thickness of the segment - seekbarMethod.addInstruction( - insertIndex, - "invoke-static {v${invokeInstruction.registerC}}, " + - "$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->setSponsorBarThickness(I)V", + // Seekbar drawing + SeekbarOnDrawFingerprint.alsoResolve(context, SeekbarFingerprint).mutableMethod.apply { + // Get left and right of seekbar rectangle. + val moveRectangleToRegisterIndex = indexOfFirstInstructionOrThrow { + opcode == Opcode.MOVE_OBJECT_FROM16 + } + addInstruction( + moveRectangleToRegisterIndex + 1, + "invoke-static/range { p0 .. p0 }, " + + "$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->setSponsorBarRect(Ljava/lang/Object;)V", ) - break - } - /* - * Draw segment - */ - // Find the drawCircle call and draw the segment before it - for (i in seekbarMethodInstructions.size - 1 downTo 0) { - val invokeInstruction = seekbarMethodInstructions[i] as? ReferenceInstruction ?: continue - if ((invokeInstruction.reference as MethodReference).name != "drawCircle") continue - - val (canvasInstance, centerY) = (invokeInstruction as FiveRegisterInstruction).let { - it.registerC to it.registerE + // Set the thickness of the segment. + val thicknessIndex = indexOfFirstInstructionOrThrow { + opcode == Opcode.INVOKE_STATIC && getReference()?.name == "round" } - seekbarMethod.addInstruction( - i, - "invoke-static {v$canvasInstance, v$centerY}, $INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->drawSponsorTimeBars(Landroid/graphics/Canvas;F)V", + val thicknessRegister = getInstruction(thicknessIndex).registerC + addInstruction( + thicknessIndex + 2, + "invoke-static { v$thicknessRegister }, " + + "$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->setSponsorBarThickness(I)V", ) - break + // Find the drawCircle call and draw the segment before it. + val drawCircleIndex = indexOfLastInstructionOrThrow { + getReference()?.name == "drawCircle" + } + val drawCircleInstruction = getInstruction(drawCircleIndex) + val canvasInstanceRegister = drawCircleInstruction.registerC + val centerYRegister = drawCircleInstruction.registerE + + addInstruction( + drawCircleIndex, + "invoke-static { v$canvasInstanceRegister, v$centerYRegister }, " + + "$INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->" + + "drawSponsorTimeBars(Landroid/graphics/Canvas;F)V", + ) } - /* - * Voting & Shield button - */ - val controlsMethodResult = PlayerControlsBytecodePatch.showPlayerControlsFingerprintResult - val controlsLayoutStubResourceId = ResourceMappingPatch["id", "controls_layout_stub"] - val zoomOverlayResourceId = ResourceMappingPatch["id", "video_zoom_overlay_stub"] + // Voting & Shield button. + PlayerControlsBytecodePatch.showPlayerControlsFingerprintResult.let { controlsMethodResult -> + val controlsLayoutStubResourceId = ResourceMappingPatch["id", "controls_layout_stub"] + val zoomOverlayResourceId = ResourceMappingPatch["id", "video_zoom_overlay_stub"] - for (method in controlsMethodResult.mutableClass.methods) { - val instructions = method.implementation?.instructions!! - for ((constIndex, instruction) in instructions.withIndex()) { - // search for method which inflates the controls layout view - if (instruction.opcode != Opcode.CONST) continue + for (method in controlsMethodResult.mutableClass.methods) { + val instructions = method.implementation?.instructions!! + for ((constIndex, instruction) in instructions.withIndex()) { + // search for method which inflates the controls layout view + if (instruction.opcode != Opcode.CONST) continue - when ((instruction as NarrowLiteralInstruction).wideLiteral) { - controlsLayoutStubResourceId -> { - val insertIndex = method.indexOfFirstInstructionOrThrow(constIndex) { - getReference()?.name == "inflate" - } + 1 - val inflatedViewRegister = method.getInstruction(insertIndex).registerA + when ((instruction as NarrowLiteralInstruction).wideLiteral) { + controlsLayoutStubResourceId -> { + val insertIndex = method.indexOfFirstInstructionOrThrow(constIndex) { + getReference()?.name == "inflate" + } + 1 + val inflatedViewRegister = + method.getInstruction(insertIndex).registerA - method.addInstructions( - insertIndex + 1, - """ - invoke-static { v$inflatedViewRegister }, $INTEGRATIONS_CREATE_SEGMENT_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/View;)V - invoke-static { v$inflatedViewRegister }, $INTEGRATIONS_VOTING_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/View;)V - """, - ) - } + method.addInstructions( + insertIndex + 1, + """ + invoke-static { v$inflatedViewRegister }, $INTEGRATIONS_CREATE_SEGMENT_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/View;)V + invoke-static { v$inflatedViewRegister }, $INTEGRATIONS_VOTING_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/View;)V + """, + ) + } - zoomOverlayResourceId -> { - val invertVisibilityMethod = - context.toMethodWalker(method).nextMethod(constIndex - 6, true).getMethod() as MutableMethod - // change visibility of the buttons - invertVisibilityMethod.addInstructions( - 0, - """ + zoomOverlayResourceId -> { + val invertVisibilityMethod = + context.toMethodWalker(method).nextMethod(constIndex - 6, true) + .getMethod() as MutableMethod + // change visibility of the buttons + invertVisibilityMethod.addInstructions( + 0, + """ invoke-static {p1}, $INTEGRATIONS_CREATE_SEGMENT_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->changeVisibilityNegatedImmediate(Z)V invoke-static {p1}, $INTEGRATIONS_VOTING_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->changeVisibilityNegatedImmediate(Z)V """ - ) + ) + } } } } } - // change visibility of the buttons + + // Change visibility of the buttons. PlayerControlsBytecodePatch.injectVisibilityCheckCall("$INTEGRATIONS_CREATE_SEGMENT_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->changeVisibility(Z)V") PlayerControlsBytecodePatch.injectVisibilityCheckCall("$INTEGRATIONS_VOTING_BUTTON_CONTROLLER_CLASS_DESCRIPTOR->changeVisibility(Z)V") - // append the new time to the player layout - val appendTimeFingerprintResult = AppendTimeFingerprint.result!! - val appendTimePatternScanStartIndex = appendTimeFingerprintResult.scanResult.patternScanResult!!.startIndex - val targetRegister = - (appendTimeFingerprintResult.method.implementation!!.instructions.elementAt(appendTimePatternScanStartIndex + 1) as OneRegisterInstruction).registerA + // Append the new time to the player layout. + AppendTimeFingerprint.resultOrThrow().let { + val appendTimePatternScanStartIndex = it.scanResult.patternScanResult!!.startIndex + it.mutableMethod.apply { + val register = getInstruction(appendTimePatternScanStartIndex + 1).registerA - appendTimeFingerprintResult.mutableMethod.addInstructions( - appendTimePatternScanStartIndex + 2, - """ - invoke-static {v$targetRegister}, $INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->appendTimeWithoutSegments(Ljava/lang/String;)Ljava/lang/String; - move-result-object v$targetRegister - """, - ) + addInstructions( + appendTimePatternScanStartIndex + 2, + """ + invoke-static { v$register }, $INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR->appendTimeWithoutSegments(Ljava/lang/String;)Ljava/lang/String; + move-result-object v$register + """ + ) + } + } - // initialize the player controller + // Initialize the player controller. VideoInformationPatch.onCreateHook(INTEGRATIONS_SEGMENT_PLAYBACK_CONTROLLER_CLASS_DESCRIPTOR, "initialize") - // initialize the sponsorblock view - ControlsOverlayFingerprint.result?.let { + // Initialize the SponsorBlock view. + ControlsOverlayFingerprint.alsoResolve(context, LayoutConstructorFingerprint).let { val startIndex = it.scanResult.patternScanResult!!.startIndex it.mutableMethod.apply { val frameLayoutRegister = (getInstruction(startIndex + 2) as OneRegisterInstruction).registerA @@ -262,53 +245,50 @@ object SponsorBlockBytecodePatch : BytecodePatch( "invoke-static {v$frameLayoutRegister}, $INTEGRATIONS_SPONSORBLOCK_VIEW_CONTROLLER_CLASS_DESCRIPTOR->initialize(Landroid/view/ViewGroup;)V", ) } - } ?: throw ControlsOverlayFingerprint.exception + } - // get rectangle field name - RectangleFieldInvalidatorFingerprint.resolve(context, seekbarSignatureResult.classDef) - val rectangleFieldInvalidatorInstructions = - RectangleFieldInvalidatorFingerprint.result!!.method.implementation!!.instructions - val rectangleFieldName = - ((rectangleFieldInvalidatorInstructions.elementAt(rectangleFieldInvalidatorInstructions.count() - 3) as ReferenceInstruction).reference as FieldReference).name - // replace the "replaceMeWith*" strings - context - .proxy(context.classes.first { it.type.endsWith("SegmentPlaybackController;") }) - .mutableClass - .methods - .find { it.name == "setSponsorBarRect" } - ?.let { method -> - fun MutableMethod.replaceStringInstruction(index: Int, instruction: Instruction, with: String) { - val register = (instruction as OneRegisterInstruction).registerA - this.replaceInstruction( - index, - "const-string v$register, \"$with\"", - ) - } - for ((index, it) in method.implementation!!.instructions.withIndex()) { - if (it.opcode.ordinal != Opcode.CONST_STRING.ordinal) continue + // Set seekbar draw rectangle. + RectangleFieldInvalidatorFingerprint.alsoResolve(context, SeekbarOnDrawFingerprint).mutableMethod.apply { + val fieldIndex = implementation!!.instructions.count() - 3 + val fieldReference = getInstruction(fieldIndex).reference as FieldReference - when (((it as ReferenceInstruction).reference as StringReference).string) { - "replaceMeWithsetSponsorBarRect" -> method.replaceStringInstruction( + // replace the "replaceMeWith*" strings + context + .proxy(context.classes.first { it.type.endsWith("SegmentPlaybackController;") }) + .mutableClass + .methods + .find { it.name == "setSponsorBarRect" } + ?.let { method -> + fun MutableMethod.replaceStringInstruction(index: Int, instruction: Instruction, with: String) { + val register = (instruction as OneRegisterInstruction).registerA + this.replaceInstruction( index, - it, - rectangleFieldName, + "const-string v$register, \"$with\"", ) } - } - } ?: throw PatchException("Could not find the method which contains the replaceMeWith* strings") + for ((index, it) in method.implementation!!.instructions.withIndex()) { + if (it.opcode.ordinal != Opcode.CONST_STRING.ordinal) continue + + when (((it as ReferenceInstruction).reference as StringReference).string) { + "replaceMeWithsetSponsorBarRect" -> method.replaceStringInstruction( + index, + it, + fieldReference.name, + ) + } + } + } ?: throw PatchException("Could not find the method which contains the replaceMeWith* strings") + } // The vote and create segment buttons automatically change their visibility when appropriate, // but if buttons are showing when the end of the video is reached then they will not automatically hide. // Add a hook to forcefully hide when the end of the video is reached. - AutoRepeatParentFingerprint.result ?: throw AutoRepeatParentFingerprint.exception - AutoRepeatFingerprint.also { - it.resolve(context, AutoRepeatParentFingerprint.result!!.classDef) - }.result?.mutableMethod?.addInstruction( + AutoRepeatFingerprint.alsoResolve(context, AutoRepeatParentFingerprint).mutableMethod.addInstruction( 0, "invoke-static {}, $INTEGRATIONS_SPONSORBLOCK_VIEW_CONTROLLER_CLASS_DESCRIPTOR->endOfVideoReached()V", - ) ?: throw AutoRepeatFingerprint.exception + ) - // TODO: isSBChannelWhitelisting implementation + // TODO: isSBChannelWhitelisting implementation? } } diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index 80f58239cd..40f2a06a6a 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -171,7 +171,11 @@ fun Method.indexOfFirstInstruction(predicate: Instruction.() -> Boolean) = index * @see indexOfFirstInstructionOrThrow */ fun Method.indexOfFirstInstruction(startIndex: Int = 0, predicate: Instruction.() -> Boolean): Int { - val index = this.implementation!!.instructions.drop(startIndex).indexOfFirst(predicate) + var instructions = this.implementation!!.instructions + if (startIndex != 0) { + instructions = instructions.drop(startIndex) + } + val index = instructions.indexOfFirst(predicate) return if (index >= 0) { startIndex + index @@ -192,6 +196,41 @@ fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, predicate: Instru if (index < 0) { throw PatchException("Could not find instruction index") } + + return index +} + +/** + * Get the index of the last [Instruction] that matches the predicate, + * starting from and [endIndex] and searching down. + * + * @param endIndex Optional last index to start searching _down_ from. + * @return -1 if the instruction is not found. + * @see indexOfLastInstructionOrThrow + */ +fun Method.indexOfLastInstruction(endIndex: Int? = null, predicate: Instruction.() -> Boolean): Int { + var instructions = this.implementation!!.instructions + if (endIndex != null) { + instructions = instructions.take(endIndex + 1) + } + + return instructions.indexOfLast(predicate) +} + +/** + * Get the index of the last [Instruction] that matches the predicate, + * starting from and [endIndex] and searching down. + * + * @return the last index that matches the predicate, or throws an exception if not found. + * @throws PatchException + * @see indexOfLastInstruction + */ +fun Method.indexOfLastInstructionOrThrow(endIndex: Int? = null, predicate: Instruction.() -> Boolean): Int { + val index = indexOfLastInstruction(endIndex, predicate) + if (index < 0) { + throw PatchException("Could not find instruction index") + } + return index } From bf3ae08bbc357e8528298747689d3dfab21fb4fe Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Sep 2024 06:12:09 -0400 Subject: [PATCH 027/143] fix: Simplify and fix patching 19.02 - 19.07 --- api/revanced-patches.api | 8 +++ .../misc/litho/filter/LithoFilterPatch.kt | 58 +++++++------------ .../ComponentContextParserFingerprint.kt | 5 +- .../kotlin/app/revanced/util/BytecodeUtils.kt | 50 ++++++++++++++++ 4 files changed, 83 insertions(+), 38 deletions(-) diff --git a/api/revanced-patches.api b/api/revanced-patches.api index cec18bb595..f67a253b57 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -2156,18 +2156,26 @@ public final class app/revanced/util/BytecodeUtilsKt { 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 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 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 public static final fun indexOfIdResourceOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/String;)I + public static final fun indexOfLastInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lcom/android/tools/smali/dexlib2/Opcode;)I public static final fun indexOfLastInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)I + public static synthetic fun indexOfLastInstruction$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 indexOfLastInstruction$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)I + public static final fun indexOfLastInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lcom/android/tools/smali/dexlib2/Opcode;)I public static final fun indexOfLastInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)I + public static synthetic fun indexOfLastInstructionOrThrow$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 indexOfLastInstructionOrThrow$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)I public static final fun injectHideViewCall (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;IILjava/lang/String;Ljava/lang/String;)V public static final fun resultOrThrow (Lapp/revanced/patcher/fingerprint/MethodFingerprint;)Lapp/revanced/patcher/fingerprint/MethodFingerprintResult; diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 253236e439..e9634185b2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.misc.litho.filter -import app.revanced.util.exception import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions @@ -8,12 +7,14 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWith import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch -import app.revanced.patches.youtube.misc.litho.filter.fingerprints.* +import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ComponentContextParserFingerprint +import app.revanced.patches.youtube.misc.litho.filter.fingerprints.LithoFilterFingerprint +import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBufferReferenceFingerprint +import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.resultOrThrow @@ -23,7 +24,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.Instruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference -import com.android.tools.smali.dexlib2.iface.reference.StringReference import java.io.Closeable @Patch( @@ -86,7 +86,7 @@ object LithoFilterPatch : BytecodePatch( ComponentContextParserFingerprint.resultOrThrow().let { it.mutableMethod.apply { - // region Get references that this patch needs. + // Get references that this patch needs. val builderMethodIndex = it.scanResult.patternScanResult!!.endIndex val emptyComponentFieldIndex = builderMethodIndex + 2 @@ -94,24 +94,10 @@ object LithoFilterPatch : BytecodePatch( val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor - // endregion - - // region Get insert hook index and free registers that this patch uses. - - // Insert hook index - val stringIndex = indexOfFirstInstructionOrThrow { - opcode == Opcode.CONST_STRING && - getReference()?.string == "Element missing type extension" - } - - val insertHookIndex = stringIndex - 2 - - // Later used to store the protobuf buffer object. - val free1 = getInstruction(stringIndex + 1).registerA - // Later used to store the identifier of the component. - val free2 = getInstruction(stringIndex).registerA - - // endregion + // Get insert hook index and free register + val stringIndex = it.scanResult.stringsScanResult!!.matches.first().index + val insertHookIndex = stringIndex - 2 // This is fragile and could be improved. + val register = getInstruction(stringIndex).registerA // Insert the instructions that are responsible // to return an EmptyComponent instead of the original component if the filterState method returns true. @@ -119,15 +105,14 @@ object LithoFilterPatch : BytecodePatch( insertHookIndex, """ invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->filterState()Z - move-result v$free1 - - if-eqz v$free1, :unfiltered - - move-object/from16 v$free2, p1 - invoke-static {v$free2}, $builderMethodDescriptor - move-result-object v$free2 - iget-object v$free2, v$free2, $emptyComponentFieldDescriptor - return-object v$free2 + move-result v$register + if-eqz v$register, :unfiltered + + move-object/from16 v$register, p1 + invoke-static { v$register }, $builderMethodDescriptor + move-result-object v$register + iget-object v$register, v$register, $emptyComponentFieldDescriptor + return-object v$register """, // Used to jump over the instruction which block the component from being created.. ExternalLabel("unfiltered", getInstruction(insertHookIndex)) @@ -139,11 +124,10 @@ object LithoFilterPatch : BytecodePatch( // region Pass the buffer into Integrations. - ProtobufBufferReferenceFingerprint.resultOrThrow().mutableMethod.apply { - addInstruction( - 0, " invoke-static { p2 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setProtoBuffer(Ljava/nio/ByteBuffer;)V" - ) - } + ProtobufBufferReferenceFingerprint.resultOrThrow().mutableMethod.addInstruction( + 0, + " invoke-static { p2 }, $INTEGRATIONS_CLASS_DESCRIPTOR->setProtoBuffer(Ljava/nio/ByteBuffer;)V" + ) // endregion diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt index 0ca80fbd22..a7c186d45f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt @@ -8,5 +8,8 @@ internal object ComponentContextParserFingerprint : MethodFingerprint( Opcode.INVOKE_INTERFACE, Opcode.INVOKE_STATIC_RANGE ), - strings = listOf("Component was not found %s because it was removed due to duplicate converter bindings.") + strings = listOf( + "Element missing type extension", + "Component was not found %s because it was removed due to duplicate converter bindings." + ) ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index 40f2a06a6a..9d53b50b7e 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -163,6 +163,18 @@ inline fun Instruction.getReference() = (this as? Refere // @Deprecated("Use the overloaded method with an optional start index.", ReplaceWith("indexOfFirstInstruction(predicate)")) fun Method.indexOfFirstInstruction(predicate: Instruction.() -> Boolean) = indexOfFirstInstruction(0, predicate) +/** + * Get the index of the first [Instruction] that matches the predicate, starting from [startIndex]. + * + * @param startIndex Optional starting index to start searching from. + * @return -1 if the instruction is not found. + * @see indexOfFirstInstructionOrThrow + */ +fun Method.indexOfFirstInstruction(startIndex: Int = 0, targetOpcode: Opcode): Int = + indexOfFirstInstruction(startIndex) { + opcode == targetOpcode + } + /** * Get the index of the first [Instruction] that matches the predicate, starting from [startIndex]. * @@ -184,6 +196,18 @@ fun Method.indexOfFirstInstruction(startIndex: Int = 0, predicate: Instruction.( } } +/** + * Get the index of the first [Instruction] that matches the predicate, starting from [startIndex]. + * + * @return the index of the instruction + * @throws PatchException + * @see indexOfFirstInstruction + */ +fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, targetOpcode: Opcode): Int = + indexOfFirstInstructionOrThrow(startIndex) { + opcode == targetOpcode + } + /** * Get the index of the first [Instruction] that matches the predicate, starting from [startIndex]. * @@ -200,6 +224,19 @@ fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, predicate: Instru return index } +/** + * Get the index of the last [Instruction] that matches the predicate, + * starting from and [endIndex] and searching down. + * + * @param endIndex Optional last index to start searching _down_ from. + * @return -1 if the instruction is not found. + * @see indexOfLastInstructionOrThrow + */ +fun Method.indexOfLastInstruction(endIndex: Int? = null, targetOpcode: Opcode): Int = + indexOfLastInstruction(endIndex) { + opcode == targetOpcode + } + /** * Get the index of the last [Instruction] that matches the predicate, * starting from and [endIndex] and searching down. @@ -217,6 +254,19 @@ fun Method.indexOfLastInstruction(endIndex: Int? = null, predicate: Instruction. return instructions.indexOfLast(predicate) } +/** + * Get the index of the last [Instruction] that matches the predicate, + * starting from and [endIndex] and searching down. + * + * @return the last index that matches the predicate, or throws an exception if not found. + * @throws PatchException + * @see indexOfLastInstruction + */ +fun Method.indexOfLastInstructionOrThrow(endIndex: Int? = null, targetOpcode: Opcode): Int = + indexOfLastInstructionOrThrow(endIndex) { + opcode == targetOpcode + } + /** * Get the index of the last [Instruction] that matches the predicate, * starting from and [endIndex] and searching down. From 87903bc9bfbfbcbbd23a33e38c92628593f8fe4e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Sep 2024 07:22:27 -0400 Subject: [PATCH 028/143] refactor: Remove opcode patterns from `filterState()` hook --- .../misc/litho/filter/LithoFilterPatch.kt | 50 ++++++++++++------- .../ComponentContextParserFingerprint.kt | 5 -- .../fingerprints/EmptyComponentFingerprint.kt | 14 ++++++ 3 files changed, 47 insertions(+), 22 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/EmptyComponentFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index e9634185b2..507306643a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -8,22 +8,26 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ComponentContextParserFingerprint +import app.revanced.patches.youtube.misc.litho.filter.fingerprints.EmptyComponentFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.LithoFilterFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBufferReferenceFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.resultOrThrow +import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.Instruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference +import com.android.tools.smali.dexlib2.iface.reference.MethodReference import java.io.Closeable @Patch( @@ -36,7 +40,8 @@ object LithoFilterPatch : BytecodePatch( ComponentContextParserFingerprint, LithoFilterFingerprint, ProtobufBufferReferenceFingerprint, - ReadComponentIdentifierFingerprint + ReadComponentIdentifierFingerprint, + EmptyComponentFingerprint ) ), Closeable { private val Instruction.descriptor @@ -86,21 +91,32 @@ object LithoFilterPatch : BytecodePatch( ComponentContextParserFingerprint.resultOrThrow().let { it.mutableMethod.apply { - // Get references that this patch needs. - - val builderMethodIndex = it.scanResult.patternScanResult!!.endIndex - val emptyComponentFieldIndex = builderMethodIndex + 2 - - val builderMethodDescriptor = getInstruction(builderMethodIndex).descriptor - val emptyComponentFieldDescriptor = getInstruction(emptyComponentFieldIndex).descriptor - - // Get insert hook index and free register - val stringIndex = it.scanResult.stringsScanResult!!.matches.first().index - val insertHookIndex = stringIndex - 2 // This is fragile and could be improved. - val register = getInstruction(stringIndex).registerA - - // Insert the instructions that are responsible - // to return an EmptyComponent instead of the original component if the filterState method returns true. + // Get references this patch needs. + val builderMethodDescriptor = EmptyComponentFingerprint.resultOrThrow().classDef + .methods.first{ method -> AccessFlags.STATIC.isSet(method.accessFlags) } + val emptyComponentClass = context.findClass(builderMethodDescriptor.returnType)!!.immutableClass + val emptyComponentField = emptyComponentClass.fields.single() + + val readComponentMethod = ReadComponentIdentifierFingerprint.resultOrThrow().method + val readComponentIndex = indexOfFirstInstructionOrThrow { + val reference = getReference() ?: return@indexOfFirstInstructionOrThrow false + + reference.definingClass == readComponentMethod.definingClass + && reference.name == readComponentMethod.name + } + + // Find a free temporary register + val register = getInstruction( + indexOfFirstInstructionOrThrow(readComponentIndex, Opcode.CONST_STRING) + ).registerA + // Verify the temp register will not clobber the method result register + if (getInstruction(readComponentIndex + 1).registerA == register) { + throw PatchException("Could not find a free register") + } + + // Insert after 'move-result-object' + val insertHookIndex = readComponentIndex + 2 + // Return an EmptyComponent instead of the original component if the filterState method returns true. addInstructionsWithLabels( insertHookIndex, """ @@ -111,7 +127,7 @@ object LithoFilterPatch : BytecodePatch( move-object/from16 v$register, p1 invoke-static { v$register }, $builderMethodDescriptor move-result-object v$register - iget-object v$register, v$register, $emptyComponentFieldDescriptor + iget-object v$register, v$register, $emptyComponentField return-object v$register """, // Used to jump over the instruction which block the component from being created.. diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt index a7c186d45f..63e144cb06 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt @@ -1,13 +1,8 @@ package app.revanced.patches.youtube.misc.litho.filter.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.Opcode internal object ComponentContextParserFingerprint : MethodFingerprint( - opcodes = listOf( - Opcode.INVOKE_INTERFACE, - Opcode.INVOKE_STATIC_RANGE - ), strings = listOf( "Element missing type extension", "Component was not found %s because it was removed due to duplicate converter bindings." diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/EmptyComponentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/EmptyComponentFingerprint.kt new file mode 100644 index 0000000000..f5dc38971a --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/EmptyComponentFingerprint.kt @@ -0,0 +1,14 @@ +package app.revanced.patches.youtube.misc.litho.filter.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +internal object EmptyComponentFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PRIVATE or AccessFlags.CONSTRUCTOR, + parameters = listOf(), + strings = listOf("EmptyComponent"), + customFingerprint = { _, classDef -> + classDef.methods.filter { AccessFlags.STATIC.isSet(it.accessFlags) }.size == 1 + } +) \ No newline at end of file From 85d1c43c83a441b934a6bf854bee8e49384c7d6b Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Sep 2024 07:40:13 -0400 Subject: [PATCH 029/143] refactor: More robust selection of indexes --- .../youtube/misc/litho/filter/LithoFilterPatch.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 507306643a..4ae0b701c5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -19,6 +19,7 @@ import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBuffe import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfLastInstructionOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -154,15 +155,18 @@ object LithoFilterPatch : BytecodePatch( val identifierIndex = it.scanResult.patternScanResult!!.endIndex val identifierRegister = getInstruction(identifierIndex).registerA - val insertHookIndex = indexOfFirstInstructionOrThrow { + val putBuilderIndex = indexOfFirstInstructionOrThrow { opcode == Opcode.IPUT_OBJECT && getReference()?.type == "Ljava/lang/StringBuilder;" - } + 1 - - val stringBuilderRegister = getInstruction(insertHookIndex - 2).registerC + } + val stringBuilderRegister = getInstruction( + indexOfLastInstructionOrThrow(putBuilderIndex) { + getReference()?.name == "append" + } + ).registerC addInstruction( - insertHookIndex, + putBuilderIndex + 1, """ # Invoke the filter method. invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)V From c9c24767e2ee7c7625820924439e31cd93c6af93 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Sep 2024 18:02:34 -0400 Subject: [PATCH 030/143] fix: Use two method patching only with 19.18+ --- .../misc/litho/filter/LithoFilterPatch.kt | 167 ++++++++++-------- .../ComponentContextParserFingerprint.kt | 9 +- .../ReadComponentIdentifierFingerprint.kt | 4 + .../misc/playservice/YouTubeVersionCheck.kt | 2 + 4 files changed, 106 insertions(+), 76 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 4ae0b701c5..8431659f76 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -11,6 +11,7 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel +import app.revanced.patches.shared.misc.playservice.YouTubeVersionCheck import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ComponentContextParserFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.EmptyComponentFingerprint @@ -19,21 +20,22 @@ import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBuffe import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.indexOfLastInstructionOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction +import com.android.tools.smali.dexlib2.iface.Field +import com.android.tools.smali.dexlib2.iface.Method import com.android.tools.smali.dexlib2.iface.instruction.Instruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction +import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference import com.android.tools.smali.dexlib2.iface.reference.MethodReference import java.io.Closeable @Patch( description = "Hooks the method which parses the bytes into a ComponentContext to filter components.", - dependencies = [IntegrationsPatch::class] + dependencies = [IntegrationsPatch::class, YouTubeVersionCheck::class] ) @Suppress("unused") object LithoFilterPatch : BytecodePatch( @@ -88,57 +90,25 @@ object LithoFilterPatch : BytecodePatch( * } */ override fun execute(context: BytecodeContext) { - // region Hook the method that parses bytes into a ComponentContext. - - ComponentContextParserFingerprint.resultOrThrow().let { - it.mutableMethod.apply { - // Get references this patch needs. - val builderMethodDescriptor = EmptyComponentFingerprint.resultOrThrow().classDef - .methods.first{ method -> AccessFlags.STATIC.isSet(method.accessFlags) } - val emptyComponentClass = context.findClass(builderMethodDescriptor.returnType)!!.immutableClass - val emptyComponentField = emptyComponentClass.fields.single() - - val readComponentMethod = ReadComponentIdentifierFingerprint.resultOrThrow().method - val readComponentIndex = indexOfFirstInstructionOrThrow { - val reference = getReference() ?: return@indexOfFirstInstructionOrThrow false - - reference.definingClass == readComponentMethod.definingClass - && reference.name == readComponentMethod.name - } - // Find a free temporary register - val register = getInstruction( - indexOfFirstInstructionOrThrow(readComponentIndex, Opcode.CONST_STRING) - ).registerA - // Verify the temp register will not clobber the method result register - if (getInstruction(readComponentIndex + 1).registerA == register) { - throw PatchException("Could not find a free register") - } + // Remove dummy filter from Integrations static field + // and add the filters included during patching. + LithoFilterFingerprint.resultOrThrow().mutableMethod.apply { + removeInstructions(2, 4) // Remove dummy filter. - // Insert after 'move-result-object' - val insertHookIndex = readComponentIndex + 2 - // Return an EmptyComponent instead of the original component if the filterState method returns true. - addInstructionsWithLabels( - insertHookIndex, + addFilter = { classDescriptor -> + addInstructions( + 2, + """ + new-instance v1, $classDescriptor + invoke-direct {v1}, $classDescriptor->()V + const/16 v2, ${filterCount++} + aput-object v1, v0, v2 """ - invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->filterState()Z - move-result v$register - if-eqz v$register, :unfiltered - - move-object/from16 v$register, p1 - invoke-static { v$register }, $builderMethodDescriptor - move-result-object v$register - iget-object v$register, v$register, $emptyComponentField - return-object v$register - """, - // Used to jump over the instruction which block the component from being created.. - ExternalLabel("unfiltered", getInstruction(insertHookIndex)) ) } } - // endregion - // region Pass the buffer into Integrations. ProtobufBufferReferenceFingerprint.resultOrThrow().mutableMethod.addInstruction( @@ -148,6 +118,58 @@ object LithoFilterPatch : BytecodePatch( // endregion + // region Hook the method that parses bytes into a ComponentContext. + + var readComponentMethod : Method + var builderMethodDescriptor : Method + val emptyComponentField : Field + + ComponentContextParserFingerprint.resultOrThrow().let { + it.mutableMethod.apply { + readComponentMethod = ReadComponentIdentifierFingerprint.resultOrThrow().method + builderMethodDescriptor = EmptyComponentFingerprint.resultOrThrow().classDef + .methods.first { method -> AccessFlags.STATIC.isSet(method.accessFlags) } + emptyComponentField = context.findClass(builderMethodDescriptor.returnType)!! + .immutableClass.fields.single() + + // 19.18 and later require patching 2 methods instead of one. + // Otherwise the patched code is the same. + if (YouTubeVersionCheck.is_19_18_or_greater) { + val readComponentMethodCallIndex = indexOfFirstInstructionOrThrow { + val reference = getReference() + ?: return@indexOfFirstInstructionOrThrow false + reference.definingClass == readComponentMethod.definingClass + && reference.name == readComponentMethod.name + } + + // Result of read component, and also a free register. + val register = getInstruction( + readComponentMethodCallIndex + 1).registerA + + // Insert after 'move-result-object' + val insertHookIndex = readComponentMethodCallIndex + 2 + + // Return an EmptyComponent instead of the original component if the filterState method returns true. + addInstructionsWithLabels( + insertHookIndex, + """ + if-nez v$register, :unfiltered + + # Component was filtered in ReadComponentIdentifierFingerprint hook + move-object/from16 v$register, p1 + invoke-static { v$register }, $builderMethodDescriptor + move-result-object v$register + iget-object v$register, v$register, $emptyComponentField + return-object v$register + """, + ExternalLabel("unfiltered", getInstruction(insertHookIndex)) + ) + } + } + } + + // endregion + // region Read component then store the result. ReadComponentIdentifierFingerprint.resultOrThrow().let { @@ -159,39 +181,40 @@ object LithoFilterPatch : BytecodePatch( opcode == Opcode.IPUT_OBJECT && getReference()?.type == "Ljava/lang/StringBuilder;" } - val stringBuilderRegister = getInstruction( - indexOfLastInstructionOrThrow(putBuilderIndex) { - getReference()?.name == "append" - } - ).registerC - addInstruction( - putBuilderIndex + 1, + // Register has the StringBuilder and is also free. + val register = getInstruction(putBuilderIndex).registerA + val insertHookIndex = putBuilderIndex + 1 + + addInstructionsWithLabels( + insertHookIndex, + if (YouTubeVersionCheck.is_19_18_or_greater) """ + invoke-static { v$identifierRegister, v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z + move-result v$register + if-eqz v$register, :unfiltered + + # Return null, and the ComponentContextParserFingerprint hook + # handles returning an empty component. + const/4 v$register, 0x0 + return-object v$register """ - # Invoke the filter method. - invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)V + else """ + invoke-static { v$identifierRegister, v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z + move-result v$register + if-eqz v$register, :unfiltered + + move-object/from16 v$register, p1 + invoke-static { v$register }, $builderMethodDescriptor + move-result-object v$register + iget-object v$register, v$register, $emptyComponentField + return-object v$register """, + ExternalLabel("unfiltered", getInstruction(insertHookIndex)) ) } } // endregion - - LithoFilterFingerprint.resultOrThrow().mutableMethod.apply { - removeInstructions(2, 4) // Remove dummy filter. - - addFilter = { classDescriptor -> - addInstructions( - 2, - """ - new-instance v1, $classDescriptor - invoke-direct {v1}, $classDescriptor->()V - const/16 v2, ${filterCount++} - aput-object v1, v0, v2 - """ - ) - } - } } override fun close() = LithoFilterFingerprint.result!! diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt index 63e144cb06..1249e674c8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ComponentContextParserFingerprint.kt @@ -2,9 +2,10 @@ package app.revanced.patches.youtube.misc.litho.filter.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint +/** + * In 19.17 and earlier, this resolves to the same method as [ReadComponentIdentifierFingerprint]. + * In 19.18+ this resolves to a different method. + */ internal object ComponentContextParserFingerprint : MethodFingerprint( - strings = listOf( - "Element missing type extension", - "Component was not found %s because it was removed due to duplicate converter bindings." - ) + strings = listOf("Component was not found %s because it was removed due to duplicate converter bindings.") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt index 51bd558175..ee74a3b1d5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt @@ -3,6 +3,10 @@ package app.revanced.patches.youtube.misc.litho.filter.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.Opcode +/** + * In 19.17 and earlier, this resolves to the same method as [ComponentContextParserFingerprint]. + * In 19.18+ this resolves to a different method. + */ internal object ReadComponentIdentifierFingerprint : MethodFingerprint( opcodes = listOf( Opcode.IF_NEZ, diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt index 8f296992cf..360f0ddff0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt @@ -21,6 +21,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { var is_19_15_or_greater by Delegates.notNull() var is_19_16_or_greater by Delegates.notNull() var is_19_17_or_greater by Delegates.notNull() + var is_19_18_or_greater by Delegates.notNull() var is_19_19_or_greater by Delegates.notNull() var is_19_23_or_greater by Delegates.notNull() var is_19_24_or_greater by Delegates.notNull() @@ -33,6 +34,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { is_19_15_or_greater = 241602000 <= playStoreServicesVersion is_19_16_or_greater = 241702000 <= playStoreServicesVersion is_19_17_or_greater = 241802000 <= playStoreServicesVersion + is_19_18_or_greater = 241902000 <= playStoreServicesVersion is_19_19_or_greater = 241999000 <= playStoreServicesVersion is_19_24_or_greater = 242505000 <= playStoreServicesVersion is_19_23_or_greater = 242402000 <= playStoreServicesVersion From f994c0499eb8a4d4bebaea578920d5baf321a0ea Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Sep 2024 18:47:12 -0400 Subject: [PATCH 031/143] fix: Fix control flow label to prevent double filtering --- .../misc/litho/filter/LithoFilterPatch.kt | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 8431659f76..b6f55a6870 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -20,6 +20,7 @@ import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBuffe import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfLastInstructionOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -79,14 +80,33 @@ object LithoFilterPatch : BytecodePatch( * } * } * + * When patching 19.17 and earlier: + * * class ComponentContextParser { + * public ComponentContext ReadComponentIdentifierFingerprint(...) { + * ... + * if (IntegrationsClass.filter(identifier, pathBuilder)); // Inserted by this patch. + * return emptyComponent; + * ... + * } + * } * + * When patching 19.18 and later: + * + * class ComponentContextParser { * public ComponentContext parseBytesToComponentContext(...) { * ... - * if (IntegrationsClass.filter(identifier, pathBuilder)); // Inserted by this patch. + * if (ReadComponentIdentifierFingerprint() == null); // Inserted by this patch. * return emptyComponent; * ... * } + * + * public ComponentIdentifierObj readComponentIdentifier(...) { + * ... + * if (IntegrationsClass.filter(identifier, pathBuilder)); // Inserted by this patch. + * return null; + * ... + * } * } */ override fun execute(context: BytecodeContext) { @@ -177,19 +197,28 @@ object LithoFilterPatch : BytecodePatch( val identifierIndex = it.scanResult.patternScanResult!!.endIndex val identifierRegister = getInstruction(identifierIndex).registerA - val putBuilderIndex = indexOfFirstInstructionOrThrow { + val insertHookIndex = indexOfFirstInstructionOrThrow { opcode == Opcode.IPUT_OBJECT && getReference()?.type == "Ljava/lang/StringBuilder;" } - // Register has the StringBuilder and is also free. - val register = getInstruction(putBuilderIndex).registerA - val insertHookIndex = putBuilderIndex + 1 + val stringBuilderRegister = getInstruction(insertHookIndex).registerA + + // Find a free temporary register. + val register = getInstruction( + // Immediately before is a StringBuilder append constant character. + indexOfLastInstructionOrThrow(insertHookIndex, Opcode.CONST_16) + ).registerA + + // Verify the temp register will not clobber the method result register. + if (stringBuilderRegister == register) { + throw PatchException("Free register will clobber StringBuilder register") + } addInstructionsWithLabels( insertHookIndex, if (YouTubeVersionCheck.is_19_18_or_greater) """ - invoke-static { v$identifierRegister, v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z + invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z move-result v$register if-eqz v$register, :unfiltered @@ -199,7 +228,7 @@ object LithoFilterPatch : BytecodePatch( return-object v$register """ else """ - invoke-static { v$identifierRegister, v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z + invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z move-result v$register if-eqz v$register, :unfiltered From e4dee60769402a529a70345cee25d4d1dc4a4d2a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Sep 2024 19:03:00 -0400 Subject: [PATCH 032/143] Cleanup --- .../misc/litho/filter/LithoFilterPatch.kt | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index b6f55a6870..1d8d3f6af6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -215,12 +215,16 @@ object LithoFilterPatch : BytecodePatch( throw PatchException("Free register will clobber StringBuilder register") } + val commonInstructions = """ + invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z + move-result v$register + if-eqz v$register, :unfiltered + """ + addInstructionsWithLabels( insertHookIndex, if (YouTubeVersionCheck.is_19_18_or_greater) """ - invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z - move-result v$register - if-eqz v$register, :unfiltered + $commonInstructions # Return null, and the ComponentContextParserFingerprint hook # handles returning an empty component. @@ -228,10 +232,10 @@ object LithoFilterPatch : BytecodePatch( return-object v$register """ else """ - invoke-static { v$identifierRegister, v$stringBuilderRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->filter(Ljava/lang/String;Ljava/lang/StringBuilder;)Z - move-result v$register - if-eqz v$register, :unfiltered + $commonInstructions + # Exact same code as ComponentContextParserFingerprint hook, + # but with the free register of this method. move-object/from16 v$register, p1 invoke-static { v$register }, $builderMethodDescriptor move-result-object v$register From f680cfee13b089f0676feafd082250a422e95627 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 10 Sep 2024 21:58:18 -0400 Subject: [PATCH 033/143] refactor: Remove opcode pattern for identifier string --- .../misc/litho/filter/LithoFilterPatch.kt | 23 ++++++++++++------- .../ReadComponentIdentifierFingerprint.kt | 6 ----- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 1d8d3f6af6..4cfc111efe 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -146,25 +146,28 @@ object LithoFilterPatch : BytecodePatch( ComponentContextParserFingerprint.resultOrThrow().let { it.mutableMethod.apply { - readComponentMethod = ReadComponentIdentifierFingerprint.resultOrThrow().method + // Get the only static method in the class. builderMethodDescriptor = EmptyComponentFingerprint.resultOrThrow().classDef .methods.first { method -> AccessFlags.STATIC.isSet(method.accessFlags) } + // Only one field. emptyComponentField = context.findClass(builderMethodDescriptor.returnType)!! .immutableClass.fields.single() + readComponentMethod = ReadComponentIdentifierFingerprint.resultOrThrow().method // 19.18 and later require patching 2 methods instead of one. // Otherwise the patched code is the same. if (YouTubeVersionCheck.is_19_18_or_greater) { + // Get the method name of the ReadComponentIdentifierFingerprint call. val readComponentMethodCallIndex = indexOfFirstInstructionOrThrow { val reference = getReference() - ?: return@indexOfFirstInstructionOrThrow false - reference.definingClass == readComponentMethod.definingClass + reference?.definingClass == readComponentMethod.definingClass && reference.name == readComponentMethod.name } // Result of read component, and also a free register. val register = getInstruction( - readComponentMethodCallIndex + 1).registerA + readComponentMethodCallIndex + 1 + ).registerA // Insert after 'move-result-object' val insertHookIndex = readComponentMethodCallIndex + 2 @@ -194,16 +197,20 @@ object LithoFilterPatch : BytecodePatch( ReadComponentIdentifierFingerprint.resultOrThrow().let { it.mutableMethod.apply { - val identifierIndex = it.scanResult.patternScanResult!!.endIndex - val identifierRegister = getInstruction(identifierIndex).registerA - val insertHookIndex = indexOfFirstInstructionOrThrow { opcode == Opcode.IPUT_OBJECT && getReference()?.type == "Ljava/lang/StringBuilder;" } - val stringBuilderRegister = getInstruction(insertHookIndex).registerA + // Identifier is saved to a field just before the string builder. + val identifierRegister = getInstruction( + indexOfLastInstructionOrThrow(insertHookIndex) { + opcode == Opcode.IPUT_OBJECT + && getReference()?.type == "Ljava/lang/String;" + } + ).registerA + // Find a free temporary register. val register = getInstruction( // Immediately before is a StringBuilder append constant character. diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt index ee74a3b1d5..7a86b86ca5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ReadComponentIdentifierFingerprint.kt @@ -1,17 +1,11 @@ package app.revanced.patches.youtube.misc.litho.filter.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.Opcode /** * In 19.17 and earlier, this resolves to the same method as [ComponentContextParserFingerprint]. * In 19.18+ this resolves to a different method. */ internal object ReadComponentIdentifierFingerprint : MethodFingerprint( - opcodes = listOf( - Opcode.IF_NEZ, - null, - Opcode.MOVE_RESULT_OBJECT // Register stores the component identifier string - ), strings = listOf("Number of bits must be positive") ) \ No newline at end of file From 3d63c33740b9cebfee11d4f69c13d6ed9197183a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:49:30 -0400 Subject: [PATCH 034/143] cleanup --- .../youtube/layout/miniplayer/MiniplayerPatch.kt | 2 +- .../layout/miniplayer/MiniplayerResourcePatch.kt | 2 +- .../youtube/misc/litho/filter/LithoFilterPatch.kt | 2 +- .../youtube/misc/playservice/YouTubeVersionCheck.kt | 11 +++++------ .../playerresponse/PlayerResponseMethodHookPatch.kt | 11 ++++++----- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 9f9c21beab..ec1fd5bfbb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -13,7 +13,6 @@ import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patches.all.misc.resources.AddResourcesPatch -import app.revanced.patches.shared.misc.playservice.YouTubeVersionCheck import app.revanced.patches.shared.misc.settings.preference.BasePreference import app.revanced.patches.shared.misc.settings.preference.InputType import app.revanced.patches.shared.misc.settings.preference.ListPreference @@ -46,6 +45,7 @@ import app.revanced.patches.youtube.layout.miniplayer.fingerprints.YouTubePlayer import app.revanced.patches.youtube.layout.miniplayer.fingerprints.YouTubePlayerOverlaysLayoutFingerprint.YOUTUBE_PLAYER_OVERLAYS_LAYOUT_CLASS_NAME import app.revanced.patches.youtube.layout.tablet.fingerprints.GetFormFactorFingerprint 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.findOpcodeIndicesReversed import app.revanced.util.getReference diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt index da67ef9ec2..0741d10283 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.ResourcePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch -import app.revanced.patches.shared.misc.playservice.YouTubeVersionCheck +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck @Patch(dependencies = [ResourceMappingPatch::class, YouTubeVersionCheck::class]) internal object MiniplayerResourcePatch : ResourcePatch() { diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 4cfc111efe..9c7dc325fe 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -11,13 +11,13 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.smali.ExternalLabel -import app.revanced.patches.shared.misc.playservice.YouTubeVersionCheck import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ComponentContextParserFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.EmptyComponentFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.LithoFilterFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBufferReferenceFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.indexOfLastInstructionOrThrow diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt index 360f0ddff0..446f1cbc7b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.shared.misc.playservice +package app.revanced.patches.youtube.misc.playservice import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.PatchException @@ -29,15 +29,15 @@ internal object YouTubeVersionCheck : ResourcePatch() { var is_19_26_or_greater by Delegates.notNull() override fun execute(context: ResourceContext) { - findPlayServicesVersion(context) + playStoreServicesVersion = findPlayServicesVersion(context) is_19_15_or_greater = 241602000 <= playStoreServicesVersion is_19_16_or_greater = 241702000 <= playStoreServicesVersion is_19_17_or_greater = 241802000 <= playStoreServicesVersion is_19_18_or_greater = 241902000 <= playStoreServicesVersion is_19_19_or_greater = 241999000 <= playStoreServicesVersion - is_19_24_or_greater = 242505000 <= playStoreServicesVersion is_19_23_or_greater = 242402000 <= playStoreServicesVersion + is_19_24_or_greater = 242505000 <= playStoreServicesVersion is_19_25_or_greater = 242599000 <= playStoreServicesVersion is_19_26_or_greater = 242705000 <= playStoreServicesVersion } @@ -47,7 +47,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { * Returns the Google Play services version, * since the decoded app manifest does not have the app version. */ - private fun findPlayServicesVersion(context: ResourceContext) { + private fun findPlayServicesVersion(context: ResourceContext): Int { // The app version is missing from the decompiled manifest, // so instead use the Google Play services version and compare against specific releases. context.document["res/values/integers.xml"].use { document -> @@ -57,8 +57,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { if (node.nodeType == Node.ELEMENT_NODE) { val element = node as Element if (element.getAttribute("name") == "google_play_services_version") { - playStoreServicesVersion = element.textContent.toInt() - return + return element.textContent.toInt() } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt index df365a4bd4..717a27f807 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt @@ -7,13 +7,14 @@ import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.patches.youtube.video.playerresponse.fingerprint.PlayerParameterBuilderFingerprint import app.revanced.patches.youtube.video.playerresponse.fingerprint.PlayerParameterBuilderLegacyFingerprint import app.revanced.util.resultOrThrow import java.io.Closeable @Patch( - dependencies = [IntegrationsPatch::class], + dependencies = [IntegrationsPatch::class, YouTubeVersionCheck::class], ) object PlayerResponseMethodHookPatch : BytecodePatch( @@ -40,12 +41,12 @@ object PlayerResponseMethodHookPatch : private var numberOfInstructionsAdded = 0 override fun execute(context: BytecodeContext) { - if (PlayerParameterBuilderLegacyFingerprint.result != null) { - playerResponseMethod = PlayerParameterBuilderLegacyFingerprint.resultOrThrow().mutableMethod - PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 11 - } else { + if (YouTubeVersionCheck.is_19_23_or_greater) { playerResponseMethod = PlayerParameterBuilderFingerprint.resultOrThrow().mutableMethod PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 12 + } else { + playerResponseMethod = PlayerParameterBuilderLegacyFingerprint.resultOrThrow().mutableMethod + PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 11 } // On some app targets the method has too many registers pushing the parameters past v15. From 1a04330f6972cd4cbf85e9d5b7de574086db62e7 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 11 Sep 2024 16:40:09 -0400 Subject: [PATCH 035/143] fix: Show a log message if the user turns off version checks --- .../layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt index 4a05714107..7c7afd9f46 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt @@ -4,19 +4,21 @@ import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions 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.layout.seekbar.fingerprints.FullscreenSeekbarThumbnailsFingerprint 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 @Patch( name = "Restore old seekbar thumbnails", description = "Adds an option to restore the old seekbar thumbnails that appear above the seekbar while seeking instead of fullscreen thumbnails.", - dependencies = [IntegrationsPatch::class, AddResourcesPatch::class], + dependencies = [IntegrationsPatch::class, AddResourcesPatch::class, YouTubeVersionCheck::class], compatiblePackages = [ CompatiblePackage( "com.google.android.youtube", [ @@ -55,6 +57,11 @@ object RestoreOldSeekbarThumbnailsPatch : BytecodePatch( "Lapp/revanced/integrations/youtube/patches/RestoreOldSeekbarThumbnailsPatch;" override fun execute(context: BytecodeContext) { + if (YouTubeVersionCheck.is_19_17_or_greater) { + // Give a more informative error, if the user has turned off version checks. + throw PatchException("'Restore old seekbar thumbnails' cannot be patched to any version after 19.16.39") + } + AddResourcesPatch(this::class) SettingsPatch.PreferenceScreen.SEEKBAR.addPreferences( From 5f08338223bba9254b1803d92aa5d5ea71c0c9bd Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 11 Sep 2024 18:46:33 -0400 Subject: [PATCH 036/143] feat: Support for `19.36.37`. Miniplayer settings need to be figured out, as using some overrides without overs gives a half broken miniplayer. --- api/revanced-patches.api | 16 +-- .../hide/general/HideLayoutComponentsPatch.kt | 8 +- .../hide/infocards/HideInfoCardsPatch.kt | 5 +- .../layout/miniplayer/MiniplayerPatch.kt | 132 ++++++++++++------ .../MiniplayerModernConstructorFingerprint.kt | 7 +- .../ReturnYouTubeDislikePatch.kt | 101 ++++++++++---- .../TextComponentDataFingerprint.kt | 4 +- .../sponsorblock/SponsorBlockBytecodePatch.kt | 5 +- .../layout/startpage/ChangeStartPagePatch.kt | 20 +-- .../fingerprints/StartActivityFingerprint.kt | 10 ++ .../misc/links/BypassURLRedirectsPatch.kt | 65 ++++++--- .../fingerprints/ABUriParserFingerprint.kt | 26 +--- .../ABUriParserLegacyFingerprint.kt | 36 +++++ .../fingerprints/HTTPUriParserFingerprint.kt | 7 +- .../HTTPUriParserLegacyFingerprint.kt | 17 +++ .../misc/litho/filter/LithoFilterPatch.kt | 6 +- .../misc/playservice/YouTubeVersionCheck.kt | 6 + .../fingerprints/HomeActivityFingerprint.kt | 9 -- .../VideoIdFingerprintBackgroundPlay.kt | 4 +- .../kotlin/app/revanced/util/BytecodeUtils.kt | 55 ++++---- .../resources/addresources/values/strings.xml | 17 ++- 21 files changed, 357 insertions(+), 199 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserLegacyFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/HomeActivityFingerprint.kt diff --git a/api/revanced-patches.api b/api/revanced-patches.api index f67a253b57..4d9bad6173 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -2165,18 +2165,18 @@ public final class app/revanced/util/BytecodeUtilsKt { 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 public static final fun indexOfIdResourceOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/String;)I - public static final fun indexOfLastInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lcom/android/tools/smali/dexlib2/Opcode;)I - public static final fun indexOfLastInstruction (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)I - public static synthetic fun indexOfLastInstruction$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 indexOfLastInstruction$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)I - public static final fun indexOfLastInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lcom/android/tools/smali/dexlib2/Opcode;)I - public static final fun indexOfLastInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;)I - public static synthetic fun indexOfLastInstructionOrThrow$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 indexOfLastInstructionOrThrow$default (Lcom/android/tools/smali/dexlib2/iface/Method;Ljava/lang/Integer;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)I public static final fun injectHideViewCall (Lapp/revanced/patcher/util/proxy/mutableTypes/MutableMethod;IILjava/lang/String;Ljava/lang/String;)V public static final fun resultOrThrow (Lapp/revanced/patcher/fingerprint/MethodFingerprint;)Lapp/revanced/patcher/fingerprint/MethodFingerprintResult; public static final fun returnEarly (Lapp/revanced/patcher/fingerprint/MethodFingerprint;Z)V diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 60971b3a09..26b8dbee9d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -21,6 +21,7 @@ import app.revanced.patches.youtube.layout.hide.general.fingerprints.ShowWaterma import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.util.alsoResolve import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -204,9 +205,10 @@ object HideLayoutComponentsPatch : BytecodePatch( // region Watermark (legacy code for old versions of YouTube) - ShowWatermarkFingerprint.also { - it.resolve(context, PlayerOverlayFingerprint.resultOrThrow().classDef) - }.resultOrThrow().mutableMethod.apply { + ShowWatermarkFingerprint.alsoResolve( + context, + PlayerOverlayFingerprint + ).mutableMethod.apply { val index = implementation!!.instructions.size - 5 removeInstruction(index) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index 1527cf871c..e8d6a5fc64 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -13,6 +13,7 @@ import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.Infocards import app.revanced.patches.youtube.layout.hide.infocards.fingerprints.InfocardsMethodCallFingerprint import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch +import app.revanced.util.alsoResolve import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction @@ -81,9 +82,7 @@ object HideInfoCardsPatch : BytecodePatch( "Lapp/revanced/integrations/youtube/patches/components/HideInfoCardsFilterPatch;" override fun execute(context: BytecodeContext) { - InfocardsIncognitoFingerprint.also { - it.resolve(context, InfocardsIncognitoParentFingerprint.result!!.classDef) - }.result!!.mutableMethod.apply { + InfocardsIncognitoFingerprint.alsoResolve(context, InfocardsIncognitoParentFingerprint).mutableMethod.apply { val invokeInstructionIndex = implementation!!.instructions.indexOfFirst { it.opcode.ordinal == Opcode.INVOKE_VIRTUAL.ordinal && ((it as ReferenceInstruction).reference.toString() == "Landroid/view/View;->setVisibility(I)V") diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index ec1fd5bfbb..e9f985e61d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -1,3 +1,5 @@ +@file:Suppress("SpellCheckingInspection") + package app.revanced.patches.youtube.layout.miniplayer import app.revanced.patcher.data.BytecodeContext @@ -16,6 +18,7 @@ import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.BasePreference import app.revanced.patches.shared.misc.settings.preference.InputType import app.revanced.patches.shared.misc.settings.preference.ListPreference +import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference 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 @@ -47,6 +50,7 @@ import app.revanced.patches.youtube.layout.tablet.fingerprints.GetFormFactorFing 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.alsoResolve import app.revanced.util.findOpcodeIndicesReversed import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow @@ -116,6 +120,10 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.29.42", // Screen flickers when swiping to maximize Modern 1. "19.30.39", // Screen flickers when swiping to maximize Modern 1. // 19.31.36 // All Modern 1 buttons are missing. Unusable. + // 19.32.36 // ? + // 19.33.35 // Modern 1 cannot tap miniplayer to open. Unusable. + // 19.34.42 // ? + // 19.35.36 // ? ] ) ] @@ -153,20 +161,31 @@ object MiniplayerPatch : BytecodePatch( entryValuesKey = "revanced_miniplayer_type_19_16_entry_values" ) if (YouTubeVersionCheck.is_19_25_or_greater) { - preferences += SwitchPreference("revanced_miniplayer_enable_double_tap_action") - preferences += SwitchPreference("revanced_miniplayer_enable_drag_and_drop") + preferences += SwitchPreference("revanced_miniplayer_double_tap_action") + preferences += SwitchPreference("revanced_miniplayer_drag_and_drop") } + preferences += SwitchPreference("revanced_miniplayer_hide_expand_close") + if (!YouTubeVersionCheck.is_19_26_or_greater) { preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward") } + preferences += SwitchPreference("revanced_miniplayer_hide_subtext") + + if (YouTubeVersionCheck.is_19_36_or_greater) { + preferences += SwitchPreference("revanced_miniplayer_drop_shadow") + } + if (YouTubeVersionCheck.is_19_26_or_greater) { preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER) } + preferences += TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER) } + preferences += NonInteractivePreference("revanced_miniplayer_about") + SettingsPatch.PreferenceScreen.PLAYER.addPreferences( PreferenceScreen( key = "revanced_miniplayer_screen", @@ -177,11 +196,10 @@ object MiniplayerPatch : BytecodePatch( // region Enable tablet miniplayer. - MiniplayerOverrideNoContextFingerprint.resolve( + MiniplayerOverrideNoContextFingerprint.alsoResolve( context, - MiniplayerDimensionsCalculatorParentFingerprint.resultOrThrow().classDef - ) - MiniplayerOverrideNoContextFingerprint.resultOrThrow().mutableMethod.apply { + MiniplayerDimensionsCalculatorParentFingerprint + ).mutableMethod.apply { findReturnIndicesReversed().forEach { index -> insertLegacyTabletMiniplayerOverride(index) } } @@ -245,8 +263,8 @@ object MiniplayerPatch : BytecodePatch( ) MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( - MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, - "getModernMiniplayerOverride" + MiniplayerModernConstructorFingerprint.MODERN_FEATURE_FLAGS_ENABLED_KEY_LITERAL, + "getModernFeatureFlagsActiveOverride" ) MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( @@ -258,7 +276,7 @@ object MiniplayerPatch : BytecodePatch( if (YouTubeVersionCheck.is_19_26_or_greater) { MiniplayerModernConstructorFingerprint.resultOrThrow().mutableMethod.apply { val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow( - MiniplayerModernConstructorFingerprint.MINIPLAYER_SIZE_FEATURE_KEY_LITERAL + MiniplayerModernConstructorFingerprint.INITIAL_SIZE_FEATURE_KEY_LITERAL ) val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) { opcode == Opcode.LONG_TO_INT @@ -268,25 +286,44 @@ object MiniplayerPatch : BytecodePatch( addInstructions( targetIndex + 1, """ - invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->setMiniplayerSize(I)I + invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->setMiniplayerDefaultSize(I)I move-result v$register """ ) } } + if (YouTubeVersionCheck.is_19_32_or_greater) { + // Feature is not exposed in the settings, and currently only for debugging. + + MiniplayerModernConstructorFingerprint.insertLiteralValueFloatOverride( + MiniplayerModernConstructorFingerprint.ANIMATION_INTERPOLATION_FEATURE_KEY, + "setMovementBoundFactor" + ) + } + + if (YouTubeVersionCheck.is_19_36_or_greater) { + MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( + MiniplayerModernConstructorFingerprint.DROP_SHADOW_FEATURE_KEY, + "setDropShadow" + ) + + MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( + MiniplayerModernConstructorFingerprint.VIEW_OUTLINE_PROVIDER_FEATURE_KEY, + "setUseBackgroundViewOutlineProvider" + ) + } + // endregion // region Fix 19.16 using mixed up drawables for tablet modern. // YT fixed this mistake in 19.17. // Fix this, by swapping the drawable resource values with each other. if (ytOutlinePictureInPictureWhite24 >= 0) { - MiniplayerModernExpandCloseDrawablesFingerprint.apply { - resolve( - context, - MiniplayerModernViewParentFingerprint.resultOrThrow().classDef - ) - }.resultOrThrow().mutableMethod.apply { + MiniplayerModernExpandCloseDrawablesFingerprint.alsoResolve( + context, + MiniplayerModernViewParentFingerprint + ).mutableMethod.apply { listOf( ytOutlinePictureInPictureWhite24 to ytOutlineXWhite24, ytOutlineXWhite24 to ytOutlinePictureInPictureWhite24, @@ -330,24 +367,20 @@ object MiniplayerPatch : BytecodePatch( "adjustMiniplayerOpacity" ) ).forEach { (fingerprint, literalValue, methodName) -> - fingerprint.resolve( + fingerprint.alsoResolve( context, - MiniplayerModernViewParentFingerprint.resultOrThrow().classDef - ) - - fingerprint.hookInflatedView( + MiniplayerModernViewParentFingerprint + ).mutableMethod.hookInflatedView( literalValue, "Landroid/widget/ImageView;", "$INTEGRATIONS_CLASS_DESCRIPTOR->$methodName(Landroid/widget/ImageView;)V" ) } - MiniplayerModernAddViewListenerFingerprint.apply { - resolve( - context, - MiniplayerModernViewParentFingerprint.resultOrThrow().classDef - ) - }.resultOrThrow().mutableMethod.addInstruction( + MiniplayerModernAddViewListenerFingerprint.alsoResolve( + context, + MiniplayerModernViewParentFingerprint + ).mutableMethod.addInstruction( 0, "invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->" + "hideMiniplayerSubTexts(Landroid/view/View;)V" @@ -419,6 +452,27 @@ object MiniplayerPatch : BytecodePatch( } } + private fun MethodFingerprint.insertLiteralValueFloatOverride( + literal: Long, + integrationsMethod: String + ) { + resultOrThrow().mutableMethod.apply { + val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(literal) + val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) { + opcode == Opcode.DOUBLE_TO_FLOAT + } + val register = getInstruction(targetIndex).registerA + + addInstructions( + targetIndex + 1, + """ + invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->$integrationsMethod(F)F + move-result v$register + """ + ) + } + } + private fun MutableMethod.insertBooleanOverride(index: Int, methodName: String) { val register = getInstruction(index).registerA addInstructions( @@ -448,23 +502,21 @@ object MiniplayerPatch : BytecodePatch( removeInstruction(iPutIndex) } - private fun MethodFingerprint.hookInflatedView( + private fun MutableMethod.hookInflatedView( literalValue: Long, hookedClassType: String, integrationsMethodName: String, ) { - resultOrThrow().mutableMethod.apply { - val imageViewIndex = indexOfFirstInstructionOrThrow( - indexOfFirstWideLiteralInstructionValueOrThrow(literalValue) - ) { - opcode == Opcode.CHECK_CAST && getReference()?.type == hookedClassType - } - - val register = getInstruction(imageViewIndex).registerA - addInstruction( - imageViewIndex + 1, - "invoke-static { v$register }, $integrationsMethodName" - ) + val imageViewIndex = indexOfFirstInstructionOrThrow( + indexOfFirstWideLiteralInstructionValueOrThrow(literalValue) + ) { + opcode == Opcode.CHECK_CAST && getReference()?.type == hookedClassType } + + val register = getInstruction(imageViewIndex).registerA + addInstruction( + imageViewIndex + 1, + "invoke-static { v$register }, $integrationsMethodName" + ) } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt index cba9059c2e..4914a7fae9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt @@ -9,8 +9,11 @@ internal object MiniplayerModernConstructorFingerprint : LiteralValueFingerprint parameters = listOf("L"), literalSupplier = { 45623000L } // Magic number found in the constructor. ) { - const val MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL = 45622882L + const val MODERN_FEATURE_FLAGS_ENABLED_KEY_LITERAL = 45622882L const val DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL = 45628823L const val DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL = 45628752L - const val MINIPLAYER_SIZE_FEATURE_KEY_LITERAL = 45640023L + const val INITIAL_SIZE_FEATURE_KEY_LITERAL = 45640023L + const val ANIMATION_INTERPOLATION_FEATURE_KEY = 45647018L + const val DROP_SHADOW_FEATURE_KEY = 45652223L + const val VIEW_OUTLINE_PROVIDER_FEATURE_KEY = 45652224L } \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index 98d77303e3..d2cbcf8eb4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -6,6 +6,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions +import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.PatchException @@ -28,8 +29,10 @@ import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.Tex import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.patches.youtube.shared.fingerprints.RollingNumberTextViewAnimationUpdateFingerprint import app.revanced.patches.youtube.video.videoid.VideoIdPatch +import app.revanced.util.alsoResolve import app.revanced.util.exception import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow @@ -38,9 +41,11 @@ import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction +import com.android.tools.smali.dexlib2.iface.instruction.RegisterRangeInstruction import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference import com.android.tools.smali.dexlib2.iface.reference.MethodReference +import com.android.tools.smali.dexlib2.iface.reference.Reference import com.android.tools.smali.dexlib2.iface.reference.TypeReference @Patch( @@ -52,6 +57,7 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference VideoIdPatch::class, ReturnYouTubeDislikeResourcePatch::class, PlayerTypeHookPatch::class, + YouTubeVersionCheck::class ], compatiblePackages = [ CompatiblePackage( @@ -150,7 +156,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch( // And it works in all situations except it fails to update the Span when the user dislikes, // since the underlying (likes only) text did not change. // This hook handles all situations, as it's where the created Spans are stored and later reused. - TextComponentConstructorFingerprint.result?.let { textConstructorResult -> + TextComponentConstructorFingerprint.resultOrThrow().let { textConstructorResult -> // Find the field name of the conversion context. val conversionContextClassType = ConversionContextFingerprint.resultOrThrow().classDef.type val conversionContextField = textConstructorResult.classDef.fields.find { @@ -161,36 +167,76 @@ object ReturnYouTubeDislikePatch : BytecodePatch( TextComponentLookupFingerprint.resultOrThrow().mutableMethod.apply { // Find the instruction for creating the text data object. val textDataClassType = TextComponentDataFingerprint.resultOrThrow().classDef.type - val insertIndex = indexOfFirstInstructionOrThrow { - opcode == Opcode.NEW_INSTANCE && - getReference()?.type == textDataClassType + + val originalSmali : String + val insertIndex : Int + val tempRegister : Int + val charSequenceRegister : Int + + if (YouTubeVersionCheck.is_19_33_or_greater) { + insertIndex = indexOfFirstInstructionOrThrow { + opcode == Opcode.INVOKE_STATIC_RANGE && + getReference()?.returnType == textDataClassType + } + + // Convert the original instruction to smali. + // Would be handy if BuilderInstruction.toString() gave the smali, but it doesn't. + // Maybe there's an easier way. + val originalInstruction = getInstruction(insertIndex) + val originalStartRegister = originalInstruction.startRegister + val originalEndRegister = originalStartRegister + originalInstruction.registerCount - 1 + val originalReference = originalInstruction.getReference() + originalSmali = "invoke-static/range { v$originalStartRegister .. v$originalEndRegister }, $originalReference" + + tempRegister = getInstruction(insertIndex + 1).registerA + + // Find the instruction that sets the span to an instance field. + // The instruction is only a few lines after the creation of the instance. + charSequenceRegister = getInstruction( + indexOfFirstInstructionOrThrow(insertIndex) { + opcode == Opcode.INVOKE_VIRTUAL && + getReference()?.parameterTypes?.firstOrNull() == "Ljava/lang/CharSequence;" + } + ).registerD + } else { + insertIndex = indexOfFirstInstructionOrThrow { + opcode == Opcode.NEW_INSTANCE && + getReference()?.type == textDataClassType + } + + val originalInstruction = getInstruction(insertIndex) + val originalRegister = originalInstruction.registerA + val originalReference = originalInstruction.getReference() + originalSmali = "new-instance v$originalRegister, $originalReference" + + tempRegister = getInstruction(insertIndex).registerA + + charSequenceRegister = getInstruction( + indexOfFirstInstructionOrThrow(insertIndex) { + opcode == Opcode.IPUT_OBJECT && + getReference()?.type == "Ljava/lang/CharSequence;" + } + ).registerA } - val tempRegister = getInstruction(insertIndex).registerA - - // Find the instruction that sets the span to an instance field. - // The instruction is only a few lines after the creation of the instance. - // The method has multiple iput-object instructions using a CharSequence, - // so verify the found instruction is in the expected location. - val putFieldInstruction = implementation!!.instructions - .subList(insertIndex, insertIndex + 20) - .find { - it.opcode == Opcode.IPUT_OBJECT && - it.getReference()?.type == "Ljava/lang/CharSequence;" - } ?: throw PatchException("Could not find put object instruction") - val charSequenceRegister = (putFieldInstruction as TwoRegisterInstruction).registerA + // Add original instruction to preserve control flow. + // Would be helpful if instructions could be added at a control label. addInstructions( - insertIndex, + insertIndex + 1, + """ + # Copy conversion context + move-object/from16 v$tempRegister, p0 + iget-object v$tempRegister, v$tempRegister, $conversionContextField + invoke-static { v$tempRegister, v$charSequenceRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/lang/CharSequence;)Ljava/lang/CharSequence; + move-result-object v$charSequenceRegister + + $originalSmali """ - # Copy conversion context - move-object/from16 v$tempRegister, p0 - iget-object v$tempRegister, v$tempRegister, $conversionContextField - invoke-static {v$tempRegister, v$charSequenceRegister}, $INTEGRATIONS_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/lang/CharSequence;)Ljava/lang/CharSequence; - move-result-object v$charSequenceRegister - """ ) + + removeInstruction(insertIndex) } - } ?: throw TextComponentConstructorFingerprint.exception + } // endregion @@ -327,8 +373,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch( // Additional text measurement method. Used if YouTube decides not to animate the likes count // and sometimes used for initial video load. - RollingNumberMeasureStaticLabelFingerprint.resolve(context, RollingNumberMeasureStaticLabelParentFingerprint.resultOrThrow().classDef) - RollingNumberMeasureStaticLabelFingerprint.result?.also { + RollingNumberMeasureStaticLabelFingerprint.alsoResolve(context, RollingNumberMeasureStaticLabelParentFingerprint).let { val measureTextIndex = it.scanResult.patternScanResult!!.startIndex + 1 it.mutableMethod.apply { val freeRegister = getInstruction(0).registerA @@ -341,7 +386,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch( """ ) } - } ?: throw RollingNumberMeasureStaticLabelFingerprint.exception + } // The rolling number Span is missing styling since it's initially set as a String. // Modify the UI text view and use the styled like/dislike Span. diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/TextComponentDataFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/TextComponentDataFingerprint.kt index 2d70664030..6126fda655 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/TextComponentDataFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/TextComponentDataFingerprint.kt @@ -9,8 +9,6 @@ internal object TextComponentDataFingerprint : MethodFingerprint( parameters = listOf("L", "L"), strings = listOf("text"), customFingerprint = { _, classDef -> - val fields = classDef.fields - fields.find { it.type == "Ljava/util/BitSet;" } != null && - fields.find { it.type == "[Ljava/lang/String;" } != null + classDef.fields.find { it.type == "Ljava/util/BitSet;" } != null } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index 4b56b4e513..ba13370b4e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -25,10 +25,9 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint import app.revanced.patches.youtube.video.information.VideoInformationPatch import app.revanced.patches.youtube.video.videoid.VideoIdPatch import app.revanced.util.alsoResolve -import app.revanced.util.findOpcodeIndicesReversed import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.indexOfLastInstructionOrThrow +import app.revanced.util.indexOfFirstInstructionReversedOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @@ -149,7 +148,7 @@ object SponsorBlockBytecodePatch : BytecodePatch( ) // Find the drawCircle call and draw the segment before it. - val drawCircleIndex = indexOfLastInstructionOrThrow { + val drawCircleIndex = indexOfFirstInstructionReversedOrThrow { getReference()?.name == "drawCircle" } val drawCircleInstruction = getInstruction(drawCircleIndex) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt index e4f42397e4..16481ea80e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt @@ -10,22 +10,17 @@ import app.revanced.patches.shared.misc.settings.preference.ListPreference import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityFingerprint import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch -import app.revanced.patches.youtube.shared.fingerprints.HomeActivityFingerprint -import app.revanced.util.exception +import app.revanced.util.resultOrThrow @Patch( name = "Change start page", description = "Adds an option to set which page the app opens in instead of the homepage.", dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class], - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube" - ) - ] + compatiblePackages = [CompatiblePackage("com.google.android.youtube")] ) @Suppress("unused") object ChangeStartPagePatch : BytecodePatch( - setOf(HomeActivityFingerprint) + setOf(StartActivityFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/ChangeStartPagePatch;" @@ -40,14 +35,9 @@ object ChangeStartPagePatch : BytecodePatch( ) ) - StartActivityFingerprint.resolve( - context, - HomeActivityFingerprint.result?.classDef ?: throw HomeActivityFingerprint.exception - ) - - StartActivityFingerprint.result?.mutableMethod?.addInstruction( + StartActivityFingerprint.resultOrThrow().mutableMethod.addInstruction( 0, "invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeIntent(Landroid/content/Intent;)V" - ) ?: throw StartActivityFingerprint.exception + ) } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt index 7461872181..a039df2764 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt @@ -1,7 +1,17 @@ package app.revanced.patches.youtube.layout.startpage.fingerprints +import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags object StartActivityFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + returnType = "V", parameters = listOf("Landroid/content/Intent;"), + + customFingerprint = { method, classDef -> + method.name == "startActivity" && + (classDef.type.endsWith("/Shell_HomeActivity;") || + classDef.type.endsWith("/Shell_UrlActivity;")) + } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index df5e8b0870..2e487700b3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -10,15 +10,26 @@ import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.links.fingerprints.ABUriParserFingerprint +import app.revanced.patches.youtube.misc.links.fingerprints.ABUriParserLegacyFingerprint import app.revanced.patches.youtube.misc.links.fingerprints.HTTPUriParserFingerprint +import app.revanced.patches.youtube.misc.links.fingerprints.HTTPUriParserLegacyFingerprint +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction +import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Patch( name = "Bypass URL redirects", description = "Adds an option to bypass URL redirects and open the original URL directly.", - dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class], + dependencies = [ + IntegrationsPatch::class, + SettingsPatch::class, + AddResourcesPatch::class, + YouTubeVersionCheck::class + ], compatiblePackages = [ CompatiblePackage( "com.google.android.youtube", @@ -63,7 +74,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction ) @Suppress("unused") object BypassURLRedirectsPatch : BytecodePatch( - setOf(ABUriParserFingerprint, HTTPUriParserFingerprint), + setOf( + ABUriParserFingerprint, + ABUriParserLegacyFingerprint, + HTTPUriParserFingerprint, + HTTPUriParserLegacyFingerprint, + ), ) { override fun execute(context: BytecodeContext) { AddResourcesPatch(this::class) @@ -72,23 +88,36 @@ object BypassURLRedirectsPatch : BytecodePatch( SwitchPreference("revanced_bypass_url_redirects"), ) - mapOf( - ABUriParserFingerprint to 7, // Offset to Uri.parse. - HTTPUriParserFingerprint to 0, // Offset to Uri.parse. - ).map { (fingerprint, offset) -> - fingerprint.resultOrThrow() to offset - }.forEach { (result, offset) -> - result.mutableMethod.apply { - val insertIndex = result.scanResult.patternScanResult!!.startIndex + offset - val uriStringRegister = getInstruction(insertIndex).registerC - - replaceInstruction( - insertIndex, - "invoke-static {v$uriStringRegister}," + - "Lapp/revanced/integrations/youtube/patches/BypassURLRedirectsPatch;" + - "->" + - "parseRedirectUri(Ljava/lang/String;)Landroid/net/Uri;", + val fingerprints = + if (YouTubeVersionCheck.is_19_25_or_greater) + arrayOf( + ABUriParserFingerprint, + HTTPUriParserFingerprint ) + else arrayOf( + ABUriParserLegacyFingerprint, + HTTPUriParserLegacyFingerprint + ) + + fingerprints.forEach { fingerprint -> + fingerprint.resultOrThrow().let { + it.mutableMethod.apply { + val insertIndex = indexOfFirstInstructionOrThrow { + val reference = getReference() + reference?.returnType == "Landroid/net/Uri;" && + reference.name == "parse" + } + + val uriStringRegister = getInstruction(insertIndex).registerC + + replaceInstruction( + insertIndex, + "invoke-static {v$uriStringRegister}," + + "Lapp/revanced/integrations/youtube/patches/BypassURLRedirectsPatch;" + + "->" + + "parseRedirectUri(Ljava/lang/String;)Landroid/net/Uri;", + ) + } } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt index c2b3aa1d66..7cb2cb1e46 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt @@ -3,31 +3,13 @@ package app.revanced.patches.youtube.misc.links.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 +/** + * Target 19.25+ + */ internal object ABUriParserFingerprint : MethodFingerprint( returnType = "Ljava/lang/Object", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Ljava/lang/Object"), - opcodes = listOf( - Opcode.RETURN_OBJECT, - Opcode.CHECK_CAST, - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - Opcode.CHECK_CAST, - Opcode.RETURN_OBJECT, - Opcode.CHECK_CAST, - Opcode.INVOKE_STATIC, - Opcode.MOVE_RESULT_OBJECT, - Opcode.RETURN_OBJECT, - Opcode.CHECK_CAST, - ), - customFingerprint = custom@{ methodDef, classDef -> - // This method is always called "a" because this kind of class always has a single (non synthetic) method. - - if (methodDef.name != "a") return@custom false - - val count = classDef.methods.count() - count == 2 || count == 3 - }, + strings = listOf("` that does not contain a PlaylistVideoEntityId message as it's identifier."), ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt new file mode 100644 index 0000000000..4bdcd8ca1a --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt @@ -0,0 +1,36 @@ +package app.revanced.patches.youtube.misc.links.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 + +/** + * Target 19.25+ + */ +internal object ABUriParserLegacyFingerprint : MethodFingerprint( + returnType = "Ljava/lang/Object", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf("Ljava/lang/Object"), + opcodes = listOf( + Opcode.RETURN_OBJECT, + Opcode.CHECK_CAST, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.CHECK_CAST, + Opcode.RETURN_OBJECT, + Opcode.CHECK_CAST, + Opcode.INVOKE_STATIC, + Opcode.MOVE_RESULT_OBJECT, + Opcode.RETURN_OBJECT, + Opcode.CHECK_CAST, + ), + customFingerprint = custom@{ methodDef, classDef -> + // This method is always called "a" because this kind of class always has a single (non synthetic) method. + + if (methodDef.name != "a") return@custom false + + val count = classDef.methods.count() + count == 2 || count == 3 + } +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserFingerprint.kt index 66fcccaac4..d791408240 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserFingerprint.kt @@ -3,15 +3,10 @@ package app.revanced.patches.youtube.misc.links.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 HTTPUriParserFingerprint : MethodFingerprint( returnType = "Landroid/net/Uri", accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, parameters = listOf("Ljava/lang/String"), - opcodes = listOf( - Opcode.INVOKE_STATIC, - Opcode.MOVE_RESULT_OBJECT - ), - strings = listOf("://") + strings = listOf("https", "https:", "://") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserLegacyFingerprint.kt new file mode 100644 index 0000000000..e6bfc4cf8e --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserLegacyFingerprint.kt @@ -0,0 +1,17 @@ +package app.revanced.patches.youtube.misc.links.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 HTTPUriParserLegacyFingerprint : MethodFingerprint( + returnType = "Landroid/net/Uri", + accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, + parameters = listOf("Ljava/lang/String"), + opcodes = listOf( + Opcode.INVOKE_STATIC, + Opcode.MOVE_RESULT_OBJECT + ), + strings = listOf("://") +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index 9c7dc325fe..cc1d439b49 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -20,7 +20,7 @@ import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponent import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.indexOfLastInstructionOrThrow +import app.revanced.util.indexOfFirstInstructionReversedOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -205,7 +205,7 @@ object LithoFilterPatch : BytecodePatch( // Identifier is saved to a field just before the string builder. val identifierRegister = getInstruction( - indexOfLastInstructionOrThrow(insertHookIndex) { + indexOfFirstInstructionReversedOrThrow(insertHookIndex) { opcode == Opcode.IPUT_OBJECT && getReference()?.type == "Ljava/lang/String;" } @@ -214,7 +214,7 @@ object LithoFilterPatch : BytecodePatch( // Find a free temporary register. val register = getInstruction( // Immediately before is a StringBuilder append constant character. - indexOfLastInstructionOrThrow(insertHookIndex, Opcode.CONST_16) + indexOfFirstInstructionReversedOrThrow(insertHookIndex, Opcode.CONST_16) ).registerA // Verify the temp register will not clobber the method result register. diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt index 446f1cbc7b..2167523958 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt @@ -27,6 +27,9 @@ internal object YouTubeVersionCheck : ResourcePatch() { var is_19_24_or_greater by Delegates.notNull() var is_19_25_or_greater by Delegates.notNull() var is_19_26_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_36_or_greater by Delegates.notNull() override fun execute(context: ResourceContext) { playStoreServicesVersion = findPlayServicesVersion(context) @@ -40,6 +43,9 @@ internal object YouTubeVersionCheck : ResourcePatch() { is_19_24_or_greater = 242505000 <= playStoreServicesVersion is_19_25_or_greater = 242599000 <= playStoreServicesVersion is_19_26_or_greater = 242705000 <= playStoreServicesVersion + is_19_32_or_greater = 243199000 <= playStoreServicesVersion + is_19_33_or_greater = 243405000 <= playStoreServicesVersion + is_19_36_or_greater = 243705000 <= playStoreServicesVersion } /** diff --git a/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/HomeActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/HomeActivityFingerprint.kt deleted file mode 100644 index f54b9ee7c8..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/HomeActivityFingerprint.kt +++ /dev/null @@ -1,9 +0,0 @@ -package app.revanced.patches.youtube.shared.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint - -internal object HomeActivityFingerprint : MethodFingerprint( - customFingerprint = { methodDef, classDef -> - methodDef.name == "onCreate" && classDef.type.endsWith("Shell_HomeActivity;") - }, -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprintBackgroundPlay.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprintBackgroundPlay.kt index 5bc5d4fd3b..5379272c6f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprintBackgroundPlay.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprintBackgroundPlay.kt @@ -1,13 +1,11 @@ package app.revanced.patches.youtube.video.videoid.fingerprint -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 VideoIdFingerprintBackgroundPlay : MethodFingerprint( returnType = "V", - accessFlags = AccessFlags.DECLARED_SYNCHRONIZED or AccessFlags.FINAL or AccessFlags.PUBLIC, + // accessFlags are "public final synchronized", or "(package protected) final synchronized" parameters = listOf("L"), opcodes = listOf( Opcode.INVOKE_VIRTUAL, diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index 9d53b50b7e..1390da513e 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -225,58 +225,59 @@ fun Method.indexOfFirstInstructionOrThrow(startIndex: Int = 0, predicate: Instru } /** - * Get the index of the last [Instruction] that matches the predicate, - * starting from and [endIndex] and searching down. + * Get the index of matching instruction, + * starting from and [startIndex] and searching down. * - * @param endIndex Optional last index to start searching _down_ from. + * @param startIndex Optional starting index to search down from. Searching includes the start index. * @return -1 if the instruction is not found. - * @see indexOfLastInstructionOrThrow + * @see indexOfFirstInstructionReversedOrThrow */ -fun Method.indexOfLastInstruction(endIndex: Int? = null, targetOpcode: Opcode): Int = - indexOfLastInstruction(endIndex) { +fun Method.indexOfFirstInstructionReversed(startIndex: Int? = null, targetOpcode: Opcode): Int = + indexOfFirstInstructionReversed(startIndex) { opcode == targetOpcode } /** - * Get the index of the last [Instruction] that matches the predicate, - * starting from and [endIndex] and searching down. + * Get the index of matching instruction, + * starting from and [startIndex] and searching down. * - * @param endIndex Optional last index to start searching _down_ from. + * @param startIndex Optional starting index to search down from. Searching includes the start index. * @return -1 if the instruction is not found. - * @see indexOfLastInstructionOrThrow + * @see indexOfFirstInstructionReversedOrThrow */ -fun Method.indexOfLastInstruction(endIndex: Int? = null, predicate: Instruction.() -> Boolean): Int { +fun Method.indexOfFirstInstructionReversed(startIndex: Int? = null, predicate: Instruction.() -> Boolean): Int { var instructions = this.implementation!!.instructions - if (endIndex != null) { - instructions = instructions.take(endIndex + 1) + if (startIndex != null) { + instructions = instructions.take(startIndex + 1) } return instructions.indexOfLast(predicate) } /** - * Get the index of the last [Instruction] that matches the predicate, - * starting from and [endIndex] and searching down. + * Get the index of matching instruction, + * starting from and [startIndex] and searching down. * - * @return the last index that matches the predicate, or throws an exception if not found. - * @throws PatchException - * @see indexOfLastInstruction + * @param startIndex Optional starting index to search down from. Searching includes the start index. + * @return -1 if the instruction is not found. + * @see indexOfFirstInstructionReversed */ -fun Method.indexOfLastInstructionOrThrow(endIndex: Int? = null, targetOpcode: Opcode): Int = - indexOfLastInstructionOrThrow(endIndex) { +fun Method.indexOfFirstInstructionReversedOrThrow(startIndex: Int? = null, targetOpcode: Opcode): Int = + indexOfFirstInstructionReversedOrThrow(startIndex) { opcode == targetOpcode } /** - * Get the index of the last [Instruction] that matches the predicate, - * starting from and [endIndex] and searching down. + * Get the index of matching instruction, + * starting from and [startIndex] and searching down. * - * @return the last index that matches the predicate, or throws an exception if not found. - * @throws PatchException - * @see indexOfLastInstruction + * @param startIndex Optional starting index to search down from. Searching includes the start index. + * @return -1 if the instruction is not found. + * @see indexOfFirstInstructionReversed */ -fun Method.indexOfLastInstructionOrThrow(endIndex: Int? = null, predicate: Instruction.() -> Boolean): Int { - val index = indexOfLastInstruction(endIndex, predicate) +fun Method.indexOfFirstInstructionReversedOrThrow(startIndex: Int? = null, predicate: Instruction.() -> Boolean): Int { + val index = indexOfFirstInstructionReversed(startIndex, predicate) + if (index < 0) { throw PatchException("Could not find instruction index") } diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 10363d3fcc..dfab755a2d 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -989,12 +989,15 @@ This is because Crowdin requires temporarily flattening this file and removing t Miniplayer size On screen size, in pixels Pixel size must be between %1$s and %2$s - Enable double-tap action - Double-tap action is enabled\n\n• Double tap to increase miniplayer size\n• Double tap again to restore original size - Double-tap action is disabled - Enable drag and drop - Drag and drop is enabled - Drag and drop is disabled + Enable double-tap and pinch to resize + Double-tap action and pinch to resize is enabled\n\n• Double tap to increase miniplayer size\n• Double tap again to restore original size + Double-tap action and pinch to resize is disabled + Enable drag and drop + Drag and drop is enabled\n\nMiniplayer can be dragged to any corner of the screen + Drag and drop is disabled + Show drop shadow + Drop shadow is shown + Drag and drop is not shown Hide expand and close buttons Buttons are hidden\n(swipe miniplayer to expand or close) Expand and close buttons are shown @@ -1007,6 +1010,8 @@ This is because Crowdin requires temporarily flattening this file and removing t Overlay opacity Opacity value between 0-100, where 0 is transparent Miniplayer overlay opacity must be between 0-100 + About modern miniplayers + Modern miniplayers are under active development, and if selected you may experience bugs or incomplete features Enable gradient loading screen From 44270af390c9a6c9ec4e1c90c845de501287cdf4 Mon Sep 17 00:00:00 2001 From: zainarbani Date: Fri, 13 Sep 2024 15:51:13 +0700 Subject: [PATCH 037/143] feat: Unlock sleep timer menu --- api/revanced-patches.api | 6 +++ .../player/flyout/SleepTimerMenuPatch.kt | 49 +++++++++++++++++++ ...leepTimerExperimentalFeatureFingerprint.kt | 12 +++++ .../SleepTimerFeatureFingerprint.kt | 7 +++ 4 files changed, 74 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerExperimentalFeatureFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerFeatureFingerprint.kt diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 4d9bad6173..5238448294 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -1634,6 +1634,12 @@ public final class app/revanced/patches/youtube/layout/buttons/navigation/Naviga public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } +public final class app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch : app/revanced/patcher/patch/BytecodePatch { + public static final field INSTANCE Lapp/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch; + 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/buttons/player/hide/HidePlayerButtonsPatch : app/revanced/patcher/patch/BytecodePatch { public static final field INSTANCE Lapp/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch; public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch.kt new file mode 100644 index 0000000000..b537544589 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch.kt @@ -0,0 +1,49 @@ +package app.revanced.patches.youtube.layout.buttons.player.flyout + +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +import app.revanced.patcher.extensions.InstructionExtensions.addInstructions +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.annotation.CompatiblePackage +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.layout.buttons.player.flyout.fingerprints.SleepTimerFeatureFingerprint +import app.revanced.patches.youtube.layout.buttons.player.flyout.fingerprints.SleepTimerExperimentalFeatureFingerprint +import app.revanced.util.resultOrThrow + +@Patch( + name = "Remove sleep timer menu restrictions", + description = "Show sleep timer options in player flyout menu.", + compatiblePackages = [ + CompatiblePackage( + "com.google.android.youtube", + [ + "19.30.39", // Only enable this patch on 19.30+ for now. + ] + ) + ] +) +@Suppress("unused") +object SleepTimerMenuPatch : BytecodePatch( + setOf(SleepTimerFeatureFingerprint, SleepTimerExperimentalFeatureFingerprint) +) { + override fun execute(context: BytecodeContext) { + SleepTimerFeatureFingerprint.resultOrThrow().mutableMethod.addInstructions( + 0, + """ + const/4 v0, 0x1 + return v0 + """ + ) + + // This experimental check might be removed in the future. + SleepTimerExperimentalFeatureFingerprint.resultOrThrow().let { + it.mutableMethod.apply { + val targetIndex = it.scanResult.patternScanResult!!.startIndex + + addInstruction( + targetIndex, "const/4 p1, 0x1" + ) + } + } + } +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerExperimentalFeatureFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerExperimentalFeatureFingerprint.kt new file mode 100644 index 0000000000..0fdf9e8668 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerExperimentalFeatureFingerprint.kt @@ -0,0 +1,12 @@ +package app.revanced.patches.youtube.layout.buttons.player.flyout.fingerprints + +import app.revanced.util.patch.LiteralValueFingerprint +import com.android.tools.smali.dexlib2.Opcode + +internal object SleepTimerExperimentalFeatureFingerprint : LiteralValueFingerprint( + opcodes = listOf( + Opcode.IPUT_BOOLEAN, + Opcode.RETURN_VOID + ), + literalSupplier = { 45640654 } +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerFeatureFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerFeatureFingerprint.kt new file mode 100644 index 0000000000..7f7a2b6c90 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerFeatureFingerprint.kt @@ -0,0 +1,7 @@ +package app.revanced.patches.youtube.layout.buttons.player.flyout.fingerprints + +import app.revanced.util.patch.LiteralValueFingerprint + +internal object SleepTimerFeatureFingerprint : LiteralValueFingerprint( + literalSupplier = { 45630421 } +) From e0ff21be4b86ce391260e8cb3e11e2238dd07164 Mon Sep 17 00:00:00 2001 From: zainarbani Date: Fri, 13 Sep 2024 16:28:22 +0700 Subject: [PATCH 038/143] Revert "feat: Unlock sleep timer menu" This reverts commit 44270af390c9a6c9ec4e1c90c845de501287cdf4. --- api/revanced-patches.api | 6 --- .../player/flyout/SleepTimerMenuPatch.kt | 49 ------------------- ...leepTimerExperimentalFeatureFingerprint.kt | 12 ----- .../SleepTimerFeatureFingerprint.kt | 7 --- 4 files changed, 74 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerExperimentalFeatureFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerFeatureFingerprint.kt diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 5238448294..4d9bad6173 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -1634,12 +1634,6 @@ public final class app/revanced/patches/youtube/layout/buttons/navigation/Naviga public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V } -public final class app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch : app/revanced/patcher/patch/BytecodePatch { - public static final field INSTANCE Lapp/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch; - 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/buttons/player/hide/HidePlayerButtonsPatch : app/revanced/patcher/patch/BytecodePatch { public static final field INSTANCE Lapp/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch; public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch.kt deleted file mode 100644 index b537544589..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/SleepTimerMenuPatch.kt +++ /dev/null @@ -1,49 +0,0 @@ -package app.revanced.patches.youtube.layout.buttons.player.flyout - -import app.revanced.patcher.data.BytecodeContext -import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -import app.revanced.patcher.extensions.InstructionExtensions.addInstructions -import app.revanced.patcher.patch.BytecodePatch -import app.revanced.patcher.patch.annotation.CompatiblePackage -import app.revanced.patcher.patch.annotation.Patch -import app.revanced.patches.youtube.layout.buttons.player.flyout.fingerprints.SleepTimerFeatureFingerprint -import app.revanced.patches.youtube.layout.buttons.player.flyout.fingerprints.SleepTimerExperimentalFeatureFingerprint -import app.revanced.util.resultOrThrow - -@Patch( - name = "Remove sleep timer menu restrictions", - description = "Show sleep timer options in player flyout menu.", - compatiblePackages = [ - CompatiblePackage( - "com.google.android.youtube", - [ - "19.30.39", // Only enable this patch on 19.30+ for now. - ] - ) - ] -) -@Suppress("unused") -object SleepTimerMenuPatch : BytecodePatch( - setOf(SleepTimerFeatureFingerprint, SleepTimerExperimentalFeatureFingerprint) -) { - override fun execute(context: BytecodeContext) { - SleepTimerFeatureFingerprint.resultOrThrow().mutableMethod.addInstructions( - 0, - """ - const/4 v0, 0x1 - return v0 - """ - ) - - // This experimental check might be removed in the future. - SleepTimerExperimentalFeatureFingerprint.resultOrThrow().let { - it.mutableMethod.apply { - val targetIndex = it.scanResult.patternScanResult!!.startIndex - - addInstruction( - targetIndex, "const/4 p1, 0x1" - ) - } - } - } -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerExperimentalFeatureFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerExperimentalFeatureFingerprint.kt deleted file mode 100644 index 0fdf9e8668..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerExperimentalFeatureFingerprint.kt +++ /dev/null @@ -1,12 +0,0 @@ -package app.revanced.patches.youtube.layout.buttons.player.flyout.fingerprints - -import app.revanced.util.patch.LiteralValueFingerprint -import com.android.tools.smali.dexlib2.Opcode - -internal object SleepTimerExperimentalFeatureFingerprint : LiteralValueFingerprint( - opcodes = listOf( - Opcode.IPUT_BOOLEAN, - Opcode.RETURN_VOID - ), - literalSupplier = { 45640654 } -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerFeatureFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerFeatureFingerprint.kt deleted file mode 100644 index 7f7a2b6c90..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/flyout/fingerprints/SleepTimerFeatureFingerprint.kt +++ /dev/null @@ -1,7 +0,0 @@ -package app.revanced.patches.youtube.layout.buttons.player.flyout.fingerprints - -import app.revanced.util.patch.LiteralValueFingerprint - -internal object SleepTimerFeatureFingerprint : LiteralValueFingerprint( - literalSupplier = { 45630421 } -) From be4e9d09fb0cd874cc0d4032b992afba54f4c914 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 13 Sep 2024 22:55:08 -0700 Subject: [PATCH 039/143] fix `Bypass URL redirects` --- .../patches/youtube/misc/links/BypassURLRedirectsPatch.kt | 2 +- .../youtube/misc/links/fingerprints/ABUriParserFingerprint.kt | 2 +- .../misc/links/fingerprints/ABUriParserLegacyFingerprint.kt | 2 +- .../patches/youtube/misc/playservice/YouTubeVersionCheck.kt | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index 2e487700b3..2cc002c35c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -89,7 +89,7 @@ object BypassURLRedirectsPatch : BytecodePatch( ) val fingerprints = - if (YouTubeVersionCheck.is_19_25_or_greater) + if (YouTubeVersionCheck.is_19_35_or_greater) arrayOf( ABUriParserFingerprint, HTTPUriParserFingerprint diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt index 7cb2cb1e46..2bcb18ed9c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt @@ -5,7 +5,7 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.AccessFlags /** - * Target 19.25+ + * Target 19.35+ */ internal object ABUriParserFingerprint : MethodFingerprint( returnType = "Ljava/lang/Object", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt index 4bdcd8ca1a..992386df77 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt @@ -6,7 +6,7 @@ import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode /** - * Target 19.25+ + * Target 19.35+ */ internal object ABUriParserLegacyFingerprint : MethodFingerprint( returnType = "Ljava/lang/Object", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt index 2167523958..0eec373c5f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt @@ -29,6 +29,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { var is_19_26_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() override fun execute(context: ResourceContext) { @@ -45,6 +46,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { is_19_26_or_greater = 242705000 <= 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 } From 8d9d8cd523677a171942e8a945266071a8231dcd Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 13 Sep 2024 22:55:20 -0700 Subject: [PATCH 040/143] fix miniplayer: Only recommend versions that have no bugs, and have specific reasons to use over other versions. --- .../layout/miniplayer/MiniplayerPatch.kt | 50 +++++++++++-------- .../MiniplayerModernConstructorFingerprint.kt | 2 + .../MiniplayerModernEnabledFingerprint.kt | 14 ------ .../misc/playservice/YouTubeVersionCheck.kt | 2 + .../resources/addresources/values/strings.xml | 6 +-- 5 files changed, 34 insertions(+), 40 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernEnabledFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index e9f985e61d..26ca2d0e1e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -34,7 +34,6 @@ import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerDim import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernAddViewListenerFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernCloseButtonFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernConstructorFingerprint -import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernEnabledFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernExpandButtonFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernExpandCloseDrawablesFingerprint import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernForwardButtonFingerprint @@ -72,7 +71,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter @Patch( name = "Miniplayer", description = "Adds options to change the in app minimized player. " + - "Patching target 19.16+ adds modern miniplayers, and 19.28+ offers the most customization", + "Patching target 19.16+ adds modern miniplayers. " + + "19.25 has drag and drop, and is the last version that can swipe to expand the miniplayer.", dependencies = [ IntegrationsPatch::class, SettingsPatch::class, @@ -106,24 +106,25 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter // 19.14.43 // Incomplete code for modern miniplayers. // 19.15.36 // Different code for handling sub title texts and not worth supporting. "19.16.39", // First with modern miniplayers. - "19.17.41", - "19.18.41", - "19.19.39", // Last bug free version with smaller Modern 1 miniplayer. + // 19.17.41 // Works without issues, but no reason to recommend over 19.19. + // 19.18.41 // Works without issues, but no reason to recommend over 19.19. + // 19.19.39 // Last bug free version with smaller Modern 1 miniplayer, but no reason to recommend over 19.16. // 19.20.35 // Cannot swipe to expand. // 19.21.40 // Cannot swipe to expand. // 19.22.43 // Cannot swipe to expand. // 19.23.40 // First with Modern 1 drag and drop, Cannot swipe to expand. // 19.24.45 // First with larger Modern 1, Cannot swipe to expand. - "19.25.37", // First with double tap, last with skip forward/back buttons. Screen flickers when swiping to expand Modern 1. + "19.25.37", // First with double tap, last with skip forward/back buttons, last with swipe to expand/close, and last before double tap to expand seems to be required. // 19.26.42 // Modern 1 Pause/play button are always hidden. Unusable. - "19.28.42", // First with custom miniplayer size, screen flickers when swiping to maximize Modern 1. - "19.29.42", // Screen flickers when swiping to maximize Modern 1. - "19.30.39", // Screen flickers when swiping to maximize Modern 1. + // 19.28.42 // First with custom miniplayer size, screen flickers when swiping to maximize Modern 1. Swipe to close miniplayer is broken. + // 19.29.42 // All modern players are broken and ignore tapping the miniplayer video. + // 19.30.39 // Modern 3 is less broken when double tap expand is enabled, but cannot swipe to expand when double tap is off. // 19.31.36 // All Modern 1 buttons are missing. Unusable. - // 19.32.36 // ? - // 19.33.35 // Modern 1 cannot tap miniplayer to open. Unusable. - // 19.34.42 // ? - // 19.35.36 // ? + // 19.32.36 // Works without issues, but no reason to recommend over 19.36. + // 19.33.35 // Works without issues, but no reason to recommend over 19.36. + // 19.34.42 // Works without issues, but no reason to recommend over 19.36. + // 19.35.36 // Works without issues, but no reason to recommend over 19.36. + "19.36.37", // Works without issues. ] ) ] @@ -134,7 +135,6 @@ object MiniplayerPatch : BytecodePatch( MiniplayerDimensionsCalculatorParentFingerprint, MiniplayerResponseModelSizeCheckFingerprint, MiniplayerOverrideFingerprint, - MiniplayerModernEnabledFingerprint, MiniplayerModernConstructorFingerprint, MiniplayerModernViewParentFingerprint, YouTubePlayerOverlaysLayoutFingerprint @@ -161,11 +161,21 @@ object MiniplayerPatch : BytecodePatch( entryValuesKey = "revanced_miniplayer_type_19_16_entry_values" ) if (YouTubeVersionCheck.is_19_25_or_greater) { - preferences += SwitchPreference("revanced_miniplayer_double_tap_action") + if (!YouTubeVersionCheck.is_19_29_or_greater) { + preferences += SwitchPreference("revanced_miniplayer_double_tap_action") + } preferences += SwitchPreference("revanced_miniplayer_drag_and_drop") } - preferences += SwitchPreference("revanced_miniplayer_hide_expand_close") + preferences += SwitchPreference( + key = "revanced_miniplayer_hide_expand_close", + summaryOnKey = + if (YouTubeVersionCheck.is_19_26_or_greater) { + "revanced_miniplayer_hide_expand_close_19_26_summary_on" + } else { + "revanced_miniplayer_hide_expand_close_summary_on" + } + ) if (!YouTubeVersionCheck.is_19_26_or_greater) { preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward") @@ -173,10 +183,6 @@ object MiniplayerPatch : BytecodePatch( preferences += SwitchPreference("revanced_miniplayer_hide_subtext") - if (YouTubeVersionCheck.is_19_36_or_greater) { - preferences += SwitchPreference("revanced_miniplayer_drop_shadow") - } - if (YouTubeVersionCheck.is_19_26_or_greater) { preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER) } @@ -257,8 +263,8 @@ object MiniplayerPatch : BytecodePatch( } if (YouTubeVersionCheck.is_19_25_or_greater) { - MiniplayerModernEnabledFingerprint.insertLiteralValueBooleanOverride( - MiniplayerModernEnabledFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL, + MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride( + MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_OLD_TARGETS_FEATURE_KEY_LITERAL, "getModernMiniplayerOverride" ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt index 4914a7fae9..e7d976b433 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt @@ -10,6 +10,8 @@ internal object MiniplayerModernConstructorFingerprint : LiteralValueFingerprint literalSupplier = { 45623000L } // Magic number found in the constructor. ) { const val MODERN_FEATURE_FLAGS_ENABLED_KEY_LITERAL = 45622882L + // In later targets this feature flag does nothing and is dead code. + const val MODERN_MINIPLAYER_ENABLED_OLD_TARGETS_FEATURE_KEY_LITERAL = 45630429L const val DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL = 45628823L const val DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL = 45628752L const val INITIAL_SIZE_FEATURE_KEY_LITERAL = 45640023L diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernEnabledFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernEnabledFingerprint.kt deleted file mode 100644 index d249642c3e..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernEnabledFingerprint.kt +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.patches.youtube.layout.miniplayer.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernEnabledFingerprint.MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL -import app.revanced.util.patch.LiteralValueFingerprint -import com.android.tools.smali.dexlib2.AccessFlags - -internal object MiniplayerModernEnabledFingerprint : LiteralValueFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, - parameters = listOf("L"), - literalSupplier = { MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL } -) { - const val MODERN_MINIPLAYER_ENABLED_FEATURE_KEY_LITERAL = 45630429L -} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt index 0eec373c5f..5e417e8e16 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt @@ -27,6 +27,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { var is_19_24_or_greater by Delegates.notNull() var is_19_25_or_greater by Delegates.notNull() var is_19_26_or_greater by Delegates.notNull() + 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() @@ -44,6 +45,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { is_19_24_or_greater = 242505000 <= playStoreServicesVersion is_19_25_or_greater = 242599000 <= playStoreServicesVersion is_19_26_or_greater = 242705000 <= playStoreServicesVersion + 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 diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index dfab755a2d..0b9f4171bd 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -995,11 +995,9 @@ This is because Crowdin requires temporarily flattening this file and removing t Enable drag and drop Drag and drop is enabled\n\nMiniplayer can be dragged to any corner of the screen Drag and drop is disabled - Show drop shadow - Drop shadow is shown - Drag and drop is not shown Hide expand and close buttons - Buttons are hidden\n(swipe miniplayer to expand or close) + Buttons are hidden\n\nSwipe to expand or close + Buttons are hidden\n\nTap to expand, swipe to close Expand and close buttons are shown Hide subtexts Subtexts are hidden From 9eb21b5066eb772a116d2dfda758d6b4f685cec3 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 13 Sep 2024 23:11:51 -0700 Subject: [PATCH 041/143] Revert "Merge branch 'refs/heads/fix/yt-spoof-stream' into feat/yt-bump" This reverts commit de54e2d325c9ece6b222e9a2e87e8efa1e8be459, reversing changes made to dd5a4d358e7af170140f9281ede9b7a1be8e1419. --- .../misc/fix/playback/SpoofClientPatch.kt | 343 +++++++++++++----- .../misc/fix/playback/SpoofSignaturePatch.kt | 235 +++++++++++- .../playback/SpoofSignatureResourcePatch.kt | 12 +- .../BuildMediaDataSourceFingerprint.kt | 22 -- .../CreatePlaybackSpeedMenuItemFingerprint.kt | 34 ++ .../CreatePlayerRequestBodyFingerprint.kt | 15 + ...tePlayerRequestBodyWithModelFingerprint.kt | 31 ++ ...equestBodyWithVersionReleaseFingerprint.kt | 31 ++ .../CreateStreamingDataFingerprint.kt | 25 -- .../fingerprints/ParamsMapPutFingerprint.kt | 25 ++ ...PlayerGestureConfigSyntheticFingerprint.kt | 49 +++ ...ModelBackgroundAudioPlaybackFingerprint.kt | 25 ++ ...ayerResponseModelImplGeneralFingerprint.kt | 24 ++ ...rResponseModelImplLiveStreamFingerprint.kt | 24 ++ ...nseModelImplRecommendedLevelFingerprint.kt | 24 ++ .../SetPlayerRequestClientTypeFingerprint.kt | 13 + ...rePatchScrubbedPreviewLayoutFingerprint.kt | 28 ++ .../StatsQueryParameterFingerprint.kt | 8 + ...dererDecoderRecommendedLevelFingerprint.kt | 24 ++ ...toryboardRendererDecoderSpecFingerprint.kt | 24 ++ .../StoryboardRendererSpecFingerprint.kt | 13 + .../StoryboardThumbnailFingerprint.kt | 24 ++ .../StoryboardThumbnailParentFingerprint.kt | 18 + .../youtube/misc/gms/GmsCoreSupportPatch.kt | 11 +- .../resources/addresources/values/arrays.xml | 12 + .../resources/addresources/values/strings.xml | 32 +- 26 files changed, 972 insertions(+), 154 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildMediaDataSourceFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlaybackSpeedMenuItemFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithModelFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreateStreamingDataFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/ParamsMapPutFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerGestureConfigSyntheticFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelBackgroundAudioPlaybackFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplRecommendedLevelFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SetPlayerRequestClientTypeFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StatsQueryParameterFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderRecommendedLevelFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderSpecFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererSpecFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailParentFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 3e24c685c4..a37a996c72 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -3,30 +3,37 @@ package app.revanced.patches.youtube.misc.fix.playback import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.addInstructions -import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction +import app.revanced.patcher.extensions.or 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.patcher.util.smali.ExternalLabel +import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod +import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable import app.revanced.patches.all.misc.resources.AddResourcesPatch +import app.revanced.patches.shared.misc.settings.preference.ListPreference +import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen import app.revanced.patches.shared.misc.settings.preference.SwitchPreference -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildInitPlaybackRequestFingerprint -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildMediaDataSourceFingerprint -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildPlayerRequestURIFingerprint -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.BuildRequestFingerprint -import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreateStreamingDataFingerprint +import app.revanced.patches.youtube.misc.backgroundplayback.BackgroundPlaybackPatch +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.* +import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.resultOrThrow +import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.FieldReference -import com.android.tools.smali.dexlib2.iface.reference.MethodReference +import com.android.tools.smali.dexlib2.iface.reference.TypeReference +import com.android.tools.smali.dexlib2.immutable.ImmutableMethod +import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter @Patch( name = "Spoof client", @@ -35,16 +42,21 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference SettingsPatch::class, AddResourcesPatch::class, UserAgentClientSpoofPatch::class, + // Required since iOS livestream fix partially enables background playback. + BackgroundPlaybackPatch::class, + PlayerTypeHookPatch::class, ], compatiblePackages = [ CompatiblePackage( "com.google.android.youtube", [ - "18.37.36", - "18.38.44", - "18.43.45", - "18.44.41", - "18.45.43", + // This patch works with these versions, + // but the dependent background playback patch does not. + // "18.37.36", + // "18.38.44", + // "18.43.45", + // "18.44.41", + // "18.45.43", "18.48.39", "18.49.37", "19.01.34", @@ -82,21 +94,35 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference ) object SpoofClientPatch : BytecodePatch( setOf( + // Client type spoof. BuildInitPlaybackRequestFingerprint, BuildPlayerRequestURIFingerprint, - CreateStreamingDataFingerprint, - BuildMediaDataSourceFingerprint, - BuildRequestFingerprint + SetPlayerRequestClientTypeFingerprint, + CreatePlayerRequestBodyFingerprint, + CreatePlayerRequestBodyWithModelFingerprint, + CreatePlayerRequestBodyWithVersionReleaseFingerprint, + + // Player gesture config. + PlayerGestureConfigSyntheticFingerprint, + + // Player speed menu item. + CreatePlaybackSpeedMenuItemFingerprint, + + // Video qualities missing. + BuildRequestFingerprint, + + // Livestream audio only background playback. + PlayerResponseModelBackgroundAudioPlaybackFingerprint, ) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/spoof/SpoofClientPatch;" + private const val CLIENT_INFO_CLASS_DESCRIPTOR = + "Lcom/google/protos/youtube/api/innertube/InnertubeContext\$ClientInfo;" private const val REQUEST_CLASS_DESCRIPTOR = - "Lorg/chromium/net/UrlRequest;" + "Lorg/chromium/net/ExperimentalUrlRequest;" private const val REQUEST_BUILDER_CLASS_DESCRIPTOR = - "Lorg/chromium/net/UrlRequest\$Builder;" - private const val STREAMING_DATA_CLASS_DESCRIPTOR = - "Lcom/google/protos/youtube/api/innertube/StreamingDataOuterClass\$StreamingData;" + "Lorg/chromium/net/ExperimentalUrlRequest\$Builder;" override fun execute(context: BytecodeContext) { // FIXME: this patch is not updated to support 19.31 and does not work @@ -112,7 +138,14 @@ object SpoofClientPatch : BytecodePatch( sorting = PreferenceScreen.Sorting.UNSORTED, preferences = setOf( SwitchPreference("revanced_spoof_client"), - SwitchPreference("revanced_spoof_client_force_avc"), + ListPreference("revanced_spoof_client_type", + summaryKey = null, + entriesKey = "revanced_spoof_client_type_entries", + entryValuesKey = "revanced_spoof_client_type_entry_values" + ), + SwitchPreference("revanced_spoof_client_ios_force_avc"), + NonInteractivePreference("revanced_spoof_client_about_android_ios"), + NonInteractivePreference("revanced_spoof_client_about_android_vr") ) ) ) @@ -157,104 +190,228 @@ object SpoofClientPatch : BytecodePatch( // endregion - // region Fetch replacement streams. + // region Get field references to be used below. + + val (clientInfoField, clientInfoClientTypeField, clientInfoClientVersionField) = + SetPlayerRequestClientTypeFingerprint.resultOrThrow().let { result -> + // Field in the player request object that holds the client info object. + val clientInfoField = result.mutableMethod + .getInstructions().find { instruction -> + // requestMessage.clientInfo = clientInfoBuilder.build(); + instruction.opcode == Opcode.IPUT_OBJECT && + instruction.getReference()?.type == CLIENT_INFO_CLASS_DESCRIPTOR + }?.getReference() ?: throw PatchException("Could not find clientInfoField") + + // Client info object's client type field. + val clientInfoClientTypeField = result.mutableMethod + .getInstruction(result.scanResult.patternScanResult!!.endIndex) + .getReference() ?: throw PatchException("Could not find clientInfoClientTypeField") + + // Client info object's client version field. + val clientInfoClientVersionField = result.mutableMethod + .getInstruction(result.scanResult.stringsScanResult!!.matches.first().index + 1) + .getReference() + ?: throw PatchException("Could not find clientInfoClientVersionField") + + Triple(clientInfoField, clientInfoClientTypeField, clientInfoClientVersionField) + } - BuildRequestFingerprint.resultOrThrow().let { result -> - result.mutableMethod.apply { - val buildRequestIndex = getInstructions().lastIndex - 2 - val requestBuilderRegister = getInstruction(buildRequestIndex).registerC + val clientInfoClientModelField = CreatePlayerRequestBodyWithModelFingerprint.resultOrThrow().let { + val getClientModelIndex = + CreatePlayerRequestBodyWithModelFingerprint.indexOfBuildModelInstruction(it.method) - val newRequestBuilderIndex = result.scanResult.patternScanResult!!.endIndex - val urlRegister = getInstruction(newRequestBuilderIndex).registerD + // The next IPUT_OBJECT instruction after getting the client model is setting the client model field. + val index = it.mutableMethod.indexOfFirstInstructionOrThrow(getClientModelIndex) { + opcode == Opcode.IPUT_OBJECT + } - // Replace "requestBuilder.build()" with integrations call. - replaceInstruction( - buildRequestIndex, - "invoke-static { v$requestBuilderRegister, v$urlRegister, v${urlRegister + 1} }, " + - "$INTEGRATIONS_CLASS_DESCRIPTOR->" + - "buildRequest(${REQUEST_BUILDER_CLASS_DESCRIPTOR}Ljava/lang/String;Ljava/util/Map;)" + - REQUEST_CLASS_DESCRIPTOR - ) - - // Copy request headers for streaming data fetch. - addInstruction(newRequestBuilderIndex + 2, "move-object v${urlRegister + 1}, p1") + it.mutableMethod.getInstruction(index).getReference() + ?: throw PatchException("Could not find clientInfoClientModelField") + } + + val clientInfoOsVersionField = CreatePlayerRequestBodyWithVersionReleaseFingerprint.resultOrThrow().let { + val getOsVersionIndex = + CreatePlayerRequestBodyWithVersionReleaseFingerprint.indexOfBuildVersionReleaseInstruction(it.method) + + // The next IPUT_OBJECT instruction after getting the client os version is setting the client os version field. + val index = it.mutableMethod.indexOfFirstInstructionOrThrow(getOsVersionIndex) { + opcode == Opcode.IPUT_OBJECT } + + it.mutableMethod.getInstruction(index).getReference() + ?: throw PatchException("Could not find clientInfoOsVersionField") } // endregion - // region Replace the streaming data. + // region Spoof client type for /player requests. + + CreatePlayerRequestBodyFingerprint.resultOrThrow().let { result -> + val setClientInfoMethodName = "patch_setClientInfo" + val checkCastIndex = result.scanResult.patternScanResult!!.startIndex + var clientInfoContainerClassName: String - CreateStreamingDataFingerprint.resultOrThrow().let { result -> result.mutableMethod.apply { - val videoDetailsIndex = result.scanResult.patternScanResult!!.endIndex - val videoDetailsClass = getInstruction(videoDetailsIndex).getReference()!!.type - val playerProtoClass = parameterTypes.first() - val protobufClass = getInstructions().find { instruction -> - instruction.opcode == Opcode.INVOKE_STATIC && - instruction.getReference()!!.name.endsWith("smcheckIsLite") - }!!.getReference()!!.definingClass - - addInstructionsWithLabels( - videoDetailsIndex + 1, - """ - # Registers is free at this index. - - invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSpoofingEnabled()Z - move-result v1 - if-eqz v1, :disabled - - # Get video id. - iget-object v1, v0, $videoDetailsClass->c:Ljava/lang/String; - if-eqz v1, :disabled - - # Get streaming data. - invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStreamingData(Ljava/lang/String;)Ljava/nio/ByteBuffer; - move-result-object v1 - if-eqz v1, :disabled - - # Parse streaming data. - sget-object v0, $playerProtoClass->a:$playerProtoClass - invoke-static { v0, v1 }, $protobufClass->parseFrom(${protobufClass}Ljava/nio/ByteBuffer;)$protobufClass - move-result-object v1 - check-cast v1, $playerProtoClass - - # Set streaming data. - iget-object v0, v1, $playerProtoClass->h:$STREAMING_DATA_CLASS_DESCRIPTOR - if-eqz v0, :disabled - iput-object v0, p0, $definingClass->a:$STREAMING_DATA_CLASS_DESCRIPTOR - """, - ExternalLabel("disabled", getInstruction(videoDetailsIndex + 1)) + val checkCastInstruction = getInstruction(checkCastIndex) + val requestMessageInstanceRegister = checkCastInstruction.registerA + clientInfoContainerClassName = checkCastInstruction.getReference()!!.type + + addInstruction( + checkCastIndex + 1, + "invoke-static { v$requestMessageInstanceRegister }," + + " ${result.classDef.type}->$setClientInfoMethodName($clientInfoContainerClassName)V", ) } + + // Change client info to use the spoofed values. + // Do this in a helper method, to remove the need of picking out multiple free registers from the hooked code. + result.mutableClass.methods.add( + ImmutableMethod( + result.mutableClass.type, + setClientInfoMethodName, + listOf(ImmutableMethodParameter(clientInfoContainerClassName, null, "clientInfoContainer")), + "V", + AccessFlags.PRIVATE or AccessFlags.STATIC, + null, + null, + MutableMethodImplementation(3), + ).toMutable().apply { + addInstructions( + """ + invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isClientSpoofingEnabled()Z + move-result v0 + if-eqz v0, :disabled + + iget-object v0, p0, $clientInfoField + + # Set client type to the spoofed value. + iget v1, v0, $clientInfoClientTypeField + invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getClientTypeId(I)I + move-result v1 + iput v1, v0, $clientInfoClientTypeField + + # Set client model to the spoofed value. + iget-object v1, v0, $clientInfoClientModelField + invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getClientModel(Ljava/lang/String;)Ljava/lang/String; + move-result-object v1 + iput-object v1, v0, $clientInfoClientModelField + + # Set client version to the spoofed value. + iget-object v1, v0, $clientInfoClientVersionField + invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getClientVersion(Ljava/lang/String;)Ljava/lang/String; + move-result-object v1 + iput-object v1, v0, $clientInfoClientVersionField + + # Set client os version to the spoofed value. + iget-object v1, v0, $clientInfoOsVersionField + invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->getOsVersion(Ljava/lang/String;)Ljava/lang/String; + move-result-object v1 + iput-object v1, v0, $clientInfoOsVersionField + + :disabled + return-void + """, + ) + }, + ) } // endregion - // region Remove /videoplayback request body to fix playback. - // This is needed when using iOS client as streaming data source. + // region Fix player gesture if spoofing to iOS. + + PlayerGestureConfigSyntheticFingerprint.resultOrThrow().let { + val endIndex = it.scanResult.patternScanResult!!.endIndex + val downAndOutLandscapeAllowedIndex = endIndex - 3 + val downAndOutPortraitAllowedIndex = endIndex - 9 + + arrayOf( + downAndOutLandscapeAllowedIndex, + downAndOutPortraitAllowedIndex, + ).forEach { index -> + val gestureAllowedMethod = context.toMethodWalker(it.mutableMethod) + .nextMethod(index, true) + .getMethod() as MutableMethod + + gestureAllowedMethod.apply { + val isAllowedIndex = getInstructions().lastIndex + val isAllowed = getInstruction(isAllowedIndex).registerA + + addInstructions( + isAllowedIndex, + """ + invoke-static { v$isAllowed }, $INTEGRATIONS_CLASS_DESCRIPTOR->enablePlayerGesture(Z)Z + move-result v$isAllowed + """, + ) + } + } + } + + // endregion + + // region Fix livestream audio only background play if spoofing to iOS. + // This force enables audio background playback. + + PlayerResponseModelBackgroundAudioPlaybackFingerprint.resultOrThrow().mutableMethod.addInstructions( + 0, + """ + invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideBackgroundAudioPlayback()Z + move-result v0 + if-eqz v0, :do_not_override + return v0 + :do_not_override + nop + """ + ) + + // endregion + + // Fix playback speed menu item if spoofing to iOS. + + CreatePlaybackSpeedMenuItemFingerprint.resultOrThrow().let { + val scanResult = it.scanResult.patternScanResult!! + if (scanResult.startIndex != 0) throw PatchException("Unexpected start index: ${scanResult.startIndex}") - BuildMediaDataSourceFingerprint.resultOrThrow().let { it.mutableMethod.apply { - val targetIndex = getInstructions().lastIndex + // Find the conditional check if the playback speed menu item is not created. + val shouldCreateMenuIndex = + indexOfFirstInstructionOrThrow(scanResult.endIndex) { opcode == Opcode.IF_EQZ } + val shouldCreateMenuRegister = getInstruction(shouldCreateMenuIndex).registerA addInstructions( - targetIndex, + shouldCreateMenuIndex, """ - # Field a: Stream uri. - # Field c: Http method. - # Field d: Post data. - iget-object v1, v0, $definingClass->a:Landroid/net/Uri; - iget v2, v0, $definingClass->c:I - iget-object v3, v0, $definingClass->d:[B - invoke-static { v1, v2, v3 }, $INTEGRATIONS_CLASS_DESCRIPTOR->removeVideoPlaybackPostBody(Landroid/net/Uri;I[B)[B - move-result-object v1 - iput-object v1, v0, $definingClass->d:[B + invoke-static { v$shouldCreateMenuRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->forceCreatePlaybackSpeedMenu(Z)Z + move-result v$shouldCreateMenuRegister """, ) } } // endregion + + // region Fix video qualities missing, if spoofing to iOS by overriding the user agent. + + BuildRequestFingerprint.resultOrThrow().let { result -> + result.mutableMethod.apply { + val buildRequestIndex = getInstructions().lastIndex - 2 + val requestBuilderRegister = getInstruction(buildRequestIndex).registerC + + val newRequestBuilderIndex = result.scanResult.patternScanResult!!.endIndex + val urlRegister = getInstruction(newRequestBuilderIndex).registerD + + // Replace "requestBuilder.build(): Request" with "overrideUserAgent(requestBuilder, url): Request". + replaceInstruction( + buildRequestIndex, + "invoke-static { v$requestBuilderRegister, v$urlRegister }, " + + "$INTEGRATIONS_CLASS_DESCRIPTOR->" + + "overrideUserAgent(${REQUEST_BUILDER_CLASS_DESCRIPTOR}Ljava/lang/String;)" + + REQUEST_CLASS_DESCRIPTOR + ) + } + } + + // endregion } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt index bc9ebdbdfc..c82597b3a4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignaturePatch.kt @@ -1,12 +1,239 @@ package app.revanced.patches.youtube.misc.fix.playback import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.InstructionExtensions.addInstructions +import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels +import app.revanced.patcher.extensions.InstructionExtensions.getInstruction +import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patcher.util.smali.ExternalLabel +import app.revanced.patches.all.misc.resources.AddResourcesPatch +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.misc.fix.playback.fingerprints.* +import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch +import app.revanced.patches.youtube.misc.settings.SettingsPatch +import app.revanced.patches.youtube.video.information.VideoInformationPatch +import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch +import app.revanced.util.exception +import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction +import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction -@Deprecated("This patch is obsolete.", replaceWith = ReplaceWith("SpoofClientPatch")) +@Patch( + description = "Spoofs the signature to prevent playback issues.", + dependencies = [ + SettingsPatch::class, + PlayerTypeHookPatch::class, + PlayerResponseMethodHookPatch::class, + VideoInformationPatch::class, + SpoofSignatureResourcePatch::class, + AddResourcesPatch::class, + ], +) +@Deprecated("This patch will be removed in the future.") object SpoofSignaturePatch : BytecodePatch( - dependencies = setOf(SpoofClientPatch::class), + setOf( + PlayerResponseModelImplGeneralFingerprint, + PlayerResponseModelImplLiveStreamFingerprint, + PlayerResponseModelImplRecommendedLevelFingerprint, + StoryboardRendererSpecFingerprint, + StoryboardRendererDecoderSpecFingerprint, + StoryboardRendererDecoderRecommendedLevelFingerprint, + StoryboardThumbnailParentFingerprint, + SpoofSignaturePatchScrubbedPreviewLayoutFingerprint, + StatsQueryParameterFingerprint, + ParamsMapPutFingerprint, + ), ) { - override fun execute(context: BytecodeContext) {} -} + private const val INTEGRATIONS_CLASS_DESCRIPTOR = + "Lapp/revanced/integrations/youtube/patches/spoof/SpoofSignaturePatch;" + + override fun execute(context: BytecodeContext) { + AddResourcesPatch(this::class) + + SettingsPatch.PreferenceScreen.MISC.addPreferences( + PreferenceScreen( + key = "revanced_spoof_signature_verification_screen", + sorting = Sorting.UNSORTED, + preferences = setOf( + SwitchPreference("revanced_spoof_signature_verification_enabled"), + SwitchPreference("revanced_spoof_signature_in_feed_enabled"), + SwitchPreference("revanced_spoof_storyboard"), + ), + ), + ) + + // Hook the player parameters. + PlayerResponseMethodHookPatch += PlayerResponseMethodHookPatch.Hook.ProtoBufferParameter( + "$INTEGRATIONS_CLASS_DESCRIPTOR->spoofParameter(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/String;", + ) + + // Force the seekbar time and chapters to always show up. + // This is used if the storyboard spec fetch fails, for viewing paid videos, + // or if storyboard spoofing is turned off. + StoryboardThumbnailParentFingerprint.result?.classDef?.let { classDef -> + StoryboardThumbnailFingerprint.also { + it.resolve( + context, + classDef, + ) + }.result?.let { + val endIndex = it.scanResult.patternScanResult!!.endIndex + // Replace existing instruction to preserve control flow label. + // The replaced return instruction always returns false + // (it is the 'no thumbnails found' control path), + // so there is no need to pass the existing return value to integrations. + it.mutableMethod.replaceInstruction( + endIndex, + """ + invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->getSeekbarThumbnailOverrideValue()Z + """, + ) + // Since this is end of the method must replace one line then add the rest. + it.mutableMethod.addInstructions( + endIndex + 1, + """ + move-result v0 + return v0 + """, + ) + } ?: throw StoryboardThumbnailFingerprint.exception + } + + // If storyboard spoofing is turned off, then hide the empty seekbar thumbnail view. + SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.result?.apply { + val endIndex = scanResult.patternScanResult!!.endIndex + mutableMethod.apply { + val imageViewFieldName = getInstruction(endIndex).reference + addInstructions( + implementation!!.instructions.lastIndex, + """ + iget-object v0, p0, $imageViewFieldName # copy imageview field to a register + invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->seekbarImageViewCreated(Landroid/widget/ImageView;)V + """, + ) + } + } ?: throw SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.exception + + /** + * Hook StoryBoard renderer url + */ + arrayOf( + PlayerResponseModelImplGeneralFingerprint, + PlayerResponseModelImplLiveStreamFingerprint, + ).forEach { fingerprint -> + fingerprint.result?.let { + it.mutableMethod.apply { + val getStoryBoardIndex = it.scanResult.patternScanResult!!.endIndex + val getStoryBoardRegister = + getInstruction(getStoryBoardIndex).registerA + + addInstructions( + getStoryBoardIndex, + """ + invoke-static { v$getStoryBoardRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String; + move-result-object v$getStoryBoardRegister + """, + ) + } + } ?: throw fingerprint.exception + } + + // Hook recommended seekbar thumbnails quality level. + StoryboardRendererDecoderRecommendedLevelFingerprint.result?.let { + val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex + val originalValueRegister = it.mutableMethod + .getInstruction(moveOriginalRecommendedValueIndex).registerA + + it.mutableMethod.addInstructions( + moveOriginalRecommendedValueIndex + 1, + """ + invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I + move-result v$originalValueRegister + """, + ) + } ?: throw StoryboardRendererDecoderRecommendedLevelFingerprint.exception + // Hook the recommended precise seeking thumbnails quality level. + PlayerResponseModelImplRecommendedLevelFingerprint.result?.let { + it.mutableMethod.apply { + val moveOriginalRecommendedValueIndex = it.scanResult.patternScanResult!!.endIndex + val originalValueRegister = + getInstruction(moveOriginalRecommendedValueIndex).registerA + + addInstructions( + moveOriginalRecommendedValueIndex, + """ + invoke-static { v$originalValueRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getRecommendedLevel(I)I + move-result v$originalValueRegister + """, + ) + } + } ?: throw PlayerResponseModelImplRecommendedLevelFingerprint.exception + + StoryboardRendererSpecFingerprint.result?.let { + it.mutableMethod.apply { + val storyBoardUrlParams = 0 + + addInstructionsWithLabels( + 0, + """ + if-nez p$storyBoardUrlParams, :ignore + invoke-static { p$storyBoardUrlParams }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardRendererSpec(Ljava/lang/String;)Ljava/lang/String; + move-result-object p$storyBoardUrlParams + """, + ExternalLabel("ignore", getInstruction(0)), + ) + } + } ?: throw StoryboardRendererSpecFingerprint.exception + + // Hook the seekbar thumbnail decoder and use a NULL spec for live streams. + StoryboardRendererDecoderSpecFingerprint.result?.let { + val storyBoardUrlIndex = it.scanResult.patternScanResult!!.startIndex + 1 + val storyboardUrlRegister = + it.mutableMethod.getInstruction(storyBoardUrlIndex).registerA + + it.mutableMethod.addInstructions( + storyBoardUrlIndex + 1, + """ + invoke-static { v$storyboardUrlRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getStoryboardDecoderRendererSpec(Ljava/lang/String;)Ljava/lang/String; + move-result-object v$storyboardUrlRegister + """, + ) + } ?: throw StoryboardRendererDecoderSpecFingerprint.exception + + // Fix stats not being tracked. + // Due to signature spoofing "adformat" is present in query parameters made for /stats requests, + // even though, for regular videos, it should not be. + // This breaks stats tracking. + // Replace the ad parameter with the video parameter in the query parameters. + StatsQueryParameterFingerprint.result?.let { + val putMethod = ParamsMapPutFingerprint.result?.method?.toString() + ?: throw ParamsMapPutFingerprint.exception + + it.mutableMethod.apply { + val adParamIndex = it.scanResult.stringsScanResult!!.matches.first().index + val videoParamIndex = adParamIndex + 3 + + // Replace the ad parameter with the video parameter. + replaceInstruction(adParamIndex, getInstruction(videoParamIndex)) + + // Call paramsMap.put instead of paramsMap.putIfNotExist + // because the key is already present in the map. + val putAdParamIndex = adParamIndex + 1 + val putIfKeyNotExistsInstruction = getInstruction(putAdParamIndex) + replaceInstruction( + putAdParamIndex, + "invoke-virtual { " + + "v${putIfKeyNotExistsInstruction.registerC}, " + + "v${putIfKeyNotExistsInstruction.registerD}, " + + "v${putIfKeyNotExistsInstruction.registerE} }, " + + putMethod, + ) + } + } ?: throw StatsQueryParameterFingerprint.exception + } +} diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignatureResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignatureResourcePatch.kt index ae164ebf1b..c29c94381b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignatureResourcePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofSignatureResourcePatch.kt @@ -2,8 +2,18 @@ package app.revanced.patches.youtube.misc.fix.playback import app.revanced.patcher.data.ResourceContext import app.revanced.patcher.patch.ResourcePatch +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch +@Patch(dependencies = [ResourceMappingPatch::class]) @Deprecated("This patch will be removed in the future.") object SpoofSignatureResourcePatch : ResourcePatch() { - override fun execute(context: ResourceContext) {} + internal var scrubbedPreviewThumbnailResourceId: Long = -1 + + override fun execute(context: ResourceContext) { + scrubbedPreviewThumbnailResourceId = ResourceMappingPatch[ + "id", + "thumbnail", + ] + } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildMediaDataSourceFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildMediaDataSourceFingerprint.kt deleted file mode 100644 index ad00203cc0..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildMediaDataSourceFingerprint.kt +++ /dev/null @@ -1,22 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.AccessFlags - -internal object BuildMediaDataSourceFingerprint : MethodFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, - returnType = "V", - parameters = listOf( - "Landroid/net/Uri;", - "J", - "I", - "[B", - "Ljava/util/Map;", - "J", - "J", - "Ljava/lang/String;", - "I", - "Ljava/lang/Object;" - ) -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlaybackSpeedMenuItemFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlaybackSpeedMenuItemFingerprint.kt new file mode 100644 index 0000000000..035771ce2d --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlaybackSpeedMenuItemFingerprint.kt @@ -0,0 +1,34 @@ +package app.revanced.patches.youtube.misc.fix.playback.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 CreatePlaybackSpeedMenuItemFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + returnType = "V", + opcodes = listOf( + Opcode.IGET_OBJECT, // First instruction of the method + Opcode.IGET_OBJECT, + Opcode.IGET_OBJECT, + Opcode.CONST_4, + Opcode.IF_EQZ, + Opcode.INVOKE_INTERFACE, + null // MOVE_RESULT or MOVE_RESULT_OBJECT, Return value controls the creation of the playback speed menu item. + ), + // 19.01 and earlier is missing the second parameter. + // Since this fingerprint is somewhat weak, work around by checking for both method parameter signatures. + customFingerprint = custom@{ methodDef, _ -> + // 19.01 and earlier parameters are: "[L" + // 19.02+ parameters are "[L", "F" + val parameterTypes = methodDef.parameterTypes + val firstParameter = parameterTypes.firstOrNull() + + if (firstParameter == null || !firstParameter.startsWith("[L")) { + return@custom false + } + + parameterTypes.size == 1 || (parameterTypes.size == 2 && parameterTypes[1] == "F") + } +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyFingerprint.kt new file mode 100644 index 0000000000..5abe29e676 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyFingerprint.kt @@ -0,0 +1,15 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.Opcode + +internal object CreatePlayerRequestBodyFingerprint : MethodFingerprint( + returnType = "V", + parameters = listOf("L"), + opcodes = listOf( + Opcode.CHECK_CAST, + Opcode.IGET, + Opcode.AND_INT_LIT16, + ), + strings = listOf("ms"), +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithModelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithModelFingerprint.kt new file mode 100644 index 0000000000..eb91330051 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithModelFingerprint.kt @@ -0,0 +1,31 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyWithModelFingerprint.indexOfBuildModelInstruction +import app.revanced.util.containsWideLiteralInstructionValue +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstruction +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.reference.FieldReference + +internal object CreatePlayerRequestBodyWithModelFingerprint : MethodFingerprint( + returnType = "L", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf(), + customFingerprint = { methodDef, _ -> + methodDef.containsWideLiteralInstructionValue(1073741824) && + indexOfBuildModelInstruction(methodDef) >= 0 + }, +) { + fun indexOfBuildModelInstruction(methodDef: Method) = + methodDef.indexOfFirstInstruction { + val reference = getReference() + reference?.definingClass == "Landroid/os/Build;" && + reference.name == "MODEL" && + reference.type == "Ljava/lang/String;" + } +} + + diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt new file mode 100644 index 0000000000..1fba488bef --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt @@ -0,0 +1,31 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyWithVersionReleaseFingerprint.indexOfBuildVersionReleaseInstruction +import app.revanced.util.containsWideLiteralInstructionValue +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstruction +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.reference.FieldReference + +internal object CreatePlayerRequestBodyWithVersionReleaseFingerprint : MethodFingerprint( + returnType = "L", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf(), + customFingerprint = { methodDef, _ -> + methodDef.containsWideLiteralInstructionValue(1073741824) && + indexOfBuildVersionReleaseInstruction(methodDef) >= 0 + }, +) { + fun indexOfBuildVersionReleaseInstruction(methodDef: Method) = + methodDef.indexOfFirstInstruction { + val reference = getReference() + reference?.definingClass == "Landroid/os/Build\$VERSION;" && + reference.name == "RELEASE" && + reference.type == "Ljava/lang/String;" + } +} + + diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreateStreamingDataFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreateStreamingDataFingerprint.kt deleted file mode 100644 index 104a280b46..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/CreateStreamingDataFingerprint.kt +++ /dev/null @@ -1,25 +0,0 @@ -package app.revanced.patches.youtube.misc.fix.playback.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 CreateStreamingDataFingerprint : MethodFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, - returnType = "V", - parameters = listOf("L"), - opcodes = listOf( - Opcode.MOVE_RESULT_OBJECT, - Opcode.IPUT_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IF_NEZ, - Opcode.SGET_OBJECT, - Opcode.IPUT_OBJECT - ), - customFingerprint = { methodDef, classDef -> - methodDef.name == "" && classDef.fields.any { field -> - field.name == "a" && field.type.contains("StreamingDataOuterClass") - } - }, -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/ParamsMapPutFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/ParamsMapPutFingerprint.kt new file mode 100644 index 0000000000..bb93acc882 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/ParamsMapPutFingerprint.kt @@ -0,0 +1,25 @@ +package app.revanced.patches.youtube.misc.fix.playback.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 + +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object ParamsMapPutFingerprint : MethodFingerprint( + returnType = "V", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf( + "Ljava/lang/String;", + "Ljava/lang/String;", + ), + opcodes = listOf( + Opcode.CONST_4, + Opcode.CONST_4, + Opcode.CONST_4, + Opcode.MOVE_OBJECT, + Opcode.MOVE_OBJECT, + Opcode.MOVE_OBJECT, + Opcode.INVOKE_DIRECT_RANGE, + ), +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerGestureConfigSyntheticFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerGestureConfigSyntheticFingerprint.kt new file mode 100644 index 0000000000..d691d7cfca --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerGestureConfigSyntheticFingerprint.kt @@ -0,0 +1,49 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstruction +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.reference.MethodReference + +internal object PlayerGestureConfigSyntheticFingerprint : MethodFingerprint( + returnType = "V", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf("Ljava/lang/Object;"), + opcodes = listOf( + Opcode.SGET_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT, + Opcode.IF_EQZ, + Opcode.IF_EQZ, + Opcode.IGET_OBJECT, + Opcode.INVOKE_INTERFACE, + Opcode.MOVE_RESULT_OBJECT, + Opcode.INVOKE_VIRTUAL, // playerGestureConfig.downAndOutLandscapeAllowed. + Opcode.MOVE_RESULT, + Opcode.CHECK_CAST, + Opcode.IPUT_BOOLEAN, + Opcode.INVOKE_INTERFACE, + Opcode.MOVE_RESULT_OBJECT, + Opcode.INVOKE_VIRTUAL, // playerGestureConfig.downAndOutPortraitAllowed. + Opcode.MOVE_RESULT, + Opcode.IPUT_BOOLEAN, + Opcode.RETURN_VOID, + ), + customFingerprint = { methodDef, classDef -> + fun indexOfDownAndOutAllowedInstruction(methodDef: Method) = + methodDef.indexOfFirstInstruction { + val reference = getReference() + reference?.definingClass == "Lcom/google/android/libraries/youtube/innertube/model/media/PlayerConfigModel;" && + reference.parameterTypes.isEmpty() && + reference.returnType == "Z" + } + + // This method is always called "a" because this kind of class always has a single method. + methodDef.name == "a" && classDef.methods.count() == 2 && + indexOfDownAndOutAllowedInstruction(methodDef) >= 0 + }, +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelBackgroundAudioPlaybackFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelBackgroundAudioPlaybackFingerprint.kt new file mode 100644 index 0000000000..afe153219a --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelBackgroundAudioPlaybackFingerprint.kt @@ -0,0 +1,25 @@ +package app.revanced.patches.youtube.misc.fix.playback.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 PlayerResponseModelBackgroundAudioPlaybackFingerprint : MethodFingerprint( + returnType = "Z", + accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, + parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"), + opcodes = listOf( + Opcode.CONST_4, + Opcode.IF_EQZ, + Opcode.INVOKE_INTERFACE, + Opcode.MOVE_RESULT_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT, + Opcode.IF_NEZ, + Opcode.GOTO, + Opcode.RETURN, + null, // Opcode.CONST_4 or Opcode.MOVE + Opcode.RETURN, + ) +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt new file mode 100644 index 0000000000..9328dd45c1 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplGeneralFingerprint.kt @@ -0,0 +1,24 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.util.containsWideLiteralInstructionValue +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode + +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object PlayerResponseModelImplGeneralFingerprint : MethodFingerprint( + returnType = "Ljava/lang/String;", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = emptyList(), + opcodes = listOf( + Opcode.RETURN_OBJECT, + Opcode.CONST_4, + Opcode.RETURN_OBJECT, + ), + customFingerprint = handler@{ methodDef, _ -> + if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false + + methodDef.containsWideLiteralInstructionValue(55735497) + }, +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt new file mode 100644 index 0000000000..480bdb11fc --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplLiveStreamFingerprint.kt @@ -0,0 +1,24 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.util.containsWideLiteralInstructionValue +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode + +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object PlayerResponseModelImplLiveStreamFingerprint : MethodFingerprint( + returnType = "Ljava/lang/String;", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = emptyList(), + opcodes = listOf( + Opcode.RETURN_OBJECT, + Opcode.CONST_4, + Opcode.RETURN_OBJECT, + ), + customFingerprint = handler@{ methodDef, _ -> + if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false + + methodDef.containsWideLiteralInstructionValue(70276274) + }, +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplRecommendedLevelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplRecommendedLevelFingerprint.kt new file mode 100644 index 0000000000..11de5b7fe0 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/PlayerResponseModelImplRecommendedLevelFingerprint.kt @@ -0,0 +1,24 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.util.containsWideLiteralInstructionValue +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode + +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object PlayerResponseModelImplRecommendedLevelFingerprint : MethodFingerprint( + returnType = "I", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = emptyList(), + opcodes = listOf( + Opcode.SGET_OBJECT, + Opcode.IGET, + Opcode.RETURN, + ), + customFingerprint = handler@{ methodDef, _ -> + if (!methodDef.definingClass.endsWith("/PlayerResponseModelImpl;")) return@handler false + + methodDef.containsWideLiteralInstructionValue(55735497) + }, +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SetPlayerRequestClientTypeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SetPlayerRequestClientTypeFingerprint.kt new file mode 100644 index 0000000000..78c240ef4c --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SetPlayerRequestClientTypeFingerprint.kt @@ -0,0 +1,13 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.util.patch.LiteralValueFingerprint +import com.android.tools.smali.dexlib2.Opcode + +internal object SetPlayerRequestClientTypeFingerprint : LiteralValueFingerprint( + opcodes = listOf( + Opcode.IGET, + Opcode.IPUT, // Sets ClientInfo.clientId. + ), + strings = listOf("10.29"), + literalSupplier = { 134217728 } +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.kt new file mode 100644 index 0000000000..c15d94db92 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/SpoofSignaturePatchScrubbedPreviewLayoutFingerprint.kt @@ -0,0 +1,28 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patches.youtube.misc.fix.playback.SpoofSignatureResourcePatch +import app.revanced.util.patch.LiteralValueFingerprint +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode + +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object SpoofSignaturePatchScrubbedPreviewLayoutFingerprint : LiteralValueFingerprint( + accessFlags = AccessFlags.PRIVATE or AccessFlags.FINAL, + returnType = "V", + parameters = listOf("Landroid/content/Context;", "Landroid/util/AttributeSet;", "I", "I"), + opcodes = listOf( + Opcode.INVOKE_STATIC, + Opcode.MOVE_RESULT_OBJECT, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT, + Opcode.INVOKE_VIRTUAL, + Opcode.CONST, + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.CHECK_CAST, + Opcode.IPUT_OBJECT, // preview imageview + ), + // This resource is used in ~ 40 different locations, but this method has a distinct list of parameters to match to. + literalSupplier = { SpoofSignatureResourcePatch.scrubbedPreviewThumbnailResourceId }, +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StatsQueryParameterFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StatsQueryParameterFingerprint.kt new file mode 100644 index 0000000000..24c8121367 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StatsQueryParameterFingerprint.kt @@ -0,0 +1,8 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint + +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object StatsQueryParameterFingerprint : MethodFingerprint( + strings = listOf("adunit"), +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderRecommendedLevelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderRecommendedLevelFingerprint.kt new file mode 100644 index 0000000000..482ca51a14 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderRecommendedLevelFingerprint.kt @@ -0,0 +1,24 @@ +package app.revanced.patches.youtube.misc.fix.playback.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 + +/** + * Resolves to the same method as [StoryboardRendererDecoderSpecFingerprint]. + */ +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object StoryboardRendererDecoderRecommendedLevelFingerprint : MethodFingerprint( + returnType = "V", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"), + opcodes = listOf( + Opcode.INVOKE_INTERFACE, + Opcode.MOVE_RESULT_OBJECT, + Opcode.IPUT_OBJECT, + Opcode.INVOKE_INTERFACE, + Opcode.MOVE_RESULT, + ), + strings = listOf("#-1#"), +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderSpecFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderSpecFingerprint.kt new file mode 100644 index 0000000000..a2a31800f5 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererDecoderSpecFingerprint.kt @@ -0,0 +1,24 @@ +package app.revanced.patches.youtube.misc.fix.playback.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 + +/** + * Resolves to the same method as [StoryboardRendererDecoderRecommendedLevelFingerprint]. + */ +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object StoryboardRendererDecoderSpecFingerprint : MethodFingerprint( + returnType = "V", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf("Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;"), + opcodes = listOf( + Opcode.INVOKE_INTERFACE, // First instruction of the method. + Opcode.MOVE_RESULT_OBJECT, + Opcode.CONST_4, + Opcode.CONST_4, + Opcode.IF_NEZ, + ), + strings = listOf("#-1#"), +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererSpecFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererSpecFingerprint.kt new file mode 100644 index 0000000000..cc00d0ccdc --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardRendererSpecFingerprint.kt @@ -0,0 +1,13 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object StoryboardRendererSpecFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, + returnType = "L", + parameters = listOf("Ljava/lang/String;", "J"), + strings = listOf("\\|"), +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailFingerprint.kt new file mode 100644 index 0000000000..88e368db5f --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailFingerprint.kt @@ -0,0 +1,24 @@ +package app.revanced.patches.youtube.misc.fix.playback.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 + +/** + * Resolves using the class found in [StoryboardThumbnailParentFingerprint]. + */ +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object StoryboardThumbnailFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + returnType = "Z", + parameters = listOf(), + opcodes = listOf( + Opcode.MOVE_RESULT, + Opcode.IF_GTZ, + Opcode.GOTO, + Opcode.CONST_4, + Opcode.RETURN, + Opcode.RETURN, // Last instruction of method. + ), +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailParentFingerprint.kt new file mode 100644 index 0000000000..f8e449405f --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/fingerprints/StoryboardThumbnailParentFingerprint.kt @@ -0,0 +1,18 @@ +package app.revanced.patches.youtube.misc.fix.playback.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +/** + * Here lies code that creates the seekbar thumbnails. + * + * An additional change here might force the thumbnails to be created, + * or possibly a change somewhere else (maybe involving YouTube 18.23.35 class `hte`) + */ +@Deprecated("Fingerprint is obsolete and will be deleted soon") +internal object StoryboardThumbnailParentFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + returnType = "Landroid/graphics/Bitmap;", + strings = listOf("Storyboard regionDecoder.decodeRegion exception - "), +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 9f41140ead..2154cfc915 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -32,11 +32,12 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( CompatiblePackage( "com.google.android.youtube", setOf( - "18.37.36", - "18.38.44", - "18.43.45", - "18.44.41", - "18.45.43", + // Patch supports these versions but ClientSpoof does not. + // "18.37.36", + // "18.38.44", + // "18.43.45", + // "18.44.41", + // "18.45.43", "18.48.39", "18.49.37", "19.01.34", diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index e5a20262e9..44bdcd5892 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -97,6 +97,18 @@ END + + + + iOS + Android VR + + + + IOS + ANDROID_VR + + @string/revanced_video_quality_default_entry_1 diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 0b9f4171bd..ea098c9fbb 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1164,10 +1164,34 @@ This is because Crowdin requires temporarily flattening this file and removing t Client is spoofed Client is not spoofed\n\nVideo playback may not work Turning off this setting may cause video playback issues. - Force AVC (H.264) - Video codec is AVC - Video codec is AVC, VP9, or AV1 - Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1. + Spoof client type + Force iOS AVC (H.264) + iOS video codec is AVC + iOS video codec is AVC, VP9, or AV1 + Enabling this might improve battery life and fix playback stuttering.\n\nAVC has a maximum resolution of 1080p, and video playback will use more internet data than VP9 or AV1. + iOS spoofing side effects + • HDR is supported only with AV1 codec\n• Watch history does not work with a brand account + Android VR spoofing side effects + • No HDR video\n• Kids videos do not playback\n• Paused videos can randomly resume\n• Low quality Shorts seekbar thumbnails\n• Download action button is hidden\n• End screen cards are hidden + Spoof client thumbnails not available (API timed out) + Spoof client thumbnails temporarily not available: %s + + + + Spoof app signature + Spoof the app signature to prevent playback issues + Spoof app signature + App signature spoofed\n\nSide effects include:\n• Enhanced bitrate is not available\n• Videos cannot be downloaded\n• No seekbar thumbnails for paid videos + App signature not spoofed\n\nVideo playback may not work + Turning off this setting will cause video playback issues. + Spoof app signature in feed + App signature spoofed\n\nSide effects include:\n• Feed videos are missing subtitles\n• Automatically played feed videos will show up in your watch history + App signature not spoofed for feed videos\n\nFeed videos will play for less than 1 minute before encountering playback issues + Spoof storyboard + Storyboard spoofed + Storyboard not spoofed\n\nSide effects include:\n• No ambient mode\n• Seekbar thumbnails are hidden + Spoof storyboard temporarily not available (API timed out) + Spoof storyboard temporarily not available: %s From e1a425314cd5582ce322e3bb2ca7a710c1d27b6e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 13 Sep 2024 23:16:24 -0700 Subject: [PATCH 042/143] add 19.31 - 19.36 --- .../app/revanced/patches/youtube/ad/general/HideAdsPatch.kt | 6 ++++++ .../patches/youtube/ad/getpremium/HideGetPremiumPatch.kt | 6 ++++++ .../app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt | 6 ++++++ .../interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt | 6 ++++++ .../interaction/dialog/RemoveViewerDiscretionDialogPatch.kt | 6 ++++++ .../patches/youtube/interaction/downloads/DownloadsPatch.kt | 6 ++++++ .../seekbar/DisablePreciseSeekingGesturePatch.kt | 6 ++++++ .../interaction/seekbar/EnableSeekbarTappingPatch.kt | 6 ++++++ .../interaction/swipecontrols/SwipeControlsBytecodePatch.kt | 6 ++++++ .../youtube/layout/autocaptions/AutoCaptionsPatch.kt | 6 ++++++ .../youtube/layout/buttons/action/HideButtonsPatch.kt | 6 ++++++ .../layout/buttons/autoplay/HideAutoplayButtonPatch.kt | 6 ++++++ .../layout/buttons/captions/HideCaptionsButtonPatch.kt | 6 ++++++ .../layout/buttons/navigation/NavigationButtonsPatch.kt | 6 ++++++ .../layout/buttons/player/hide/HidePlayerButtonsPatch.kt | 6 ++++++ .../youtube/layout/hide/albumcards/AlbumCardsPatch.kt | 6 ++++++ .../patches/youtube/layout/hide/comments/CommentsPatch.kt | 6 ++++++ .../layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt | 6 ++++++ .../layout/hide/endscreencards/HideEndscreenCardsPatch.kt | 6 ++++++ .../youtube/layout/hide/filterbar/HideFilterBarPatch.kt | 6 ++++++ .../floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt | 6 ++++++ .../DisableFullscreenAmbientModePatch.kt | 6 ++++++ .../layout/hide/general/HideLayoutComponentsPatch.kt | 6 ++++++ .../youtube/layout/hide/infocards/HideInfoCardsPatch.kt | 6 ++++++ .../player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt | 6 ++++++ .../rollingnumber/DisableRollingNumberAnimationPatch.kt | 6 ++++++ .../patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt | 6 ++++++ .../youtube/layout/hide/shorts/HideShortsComponentsPatch.kt | 6 ++++++ .../DisableSuggestedVideoEndScreenPatch.kt | 6 ++++++ .../patches/youtube/layout/hide/time/HideTimestampPatch.kt | 6 ++++++ .../youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt | 6 ++++++ .../player/background/PlayerControlsBackgroundPatch.kt | 6 ++++++ .../returnyoutubedislike/ReturnYouTubeDislikePatch.kt | 6 ++++++ .../patches/youtube/layout/searchbar/WideSearchbarPatch.kt | 6 ++++++ .../layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt | 1 + .../layout/sponsorblock/SponsorBlockBytecodePatch.kt | 6 ++++++ .../youtube/layout/spoofappversion/SpoofAppVersionPatch.kt | 6 ++++++ .../DisableResumingShortsOnStartupPatch.kt | 6 ++++++ .../youtube/layout/tablet/EnableTabletLayoutPatch.kt | 6 ++++++ .../patches/youtube/layout/theme/ThemeBytecodePatch.kt | 6 ++++++ .../youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt | 6 ++++++ .../layout/thumbnails/BypassImageRegionRestrictions.kt | 6 ++++++ .../patches/youtube/misc/autorepeat/AutoRepeatPatch.kt | 6 ++++++ .../misc/backgroundplayback/BackgroundPlaybackPatch.kt | 6 ++++++ .../misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt | 6 ++++++ .../misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt | 6 ++++++ .../patches/youtube/misc/fix/playback/SpoofClientPatch.kt | 6 ++++++ .../patches/youtube/misc/gms/GmsCoreSupportPatch.kt | 6 ++++++ .../patches/youtube/misc/links/BypassURLRedirectsPatch.kt | 6 ++++++ .../patches/youtube/misc/links/OpenLinksExternallyPatch.kt | 6 ++++++ .../misc/privacy/RemoveTrackingQueryParameterPatch.kt | 6 ++++++ .../youtube/video/quality/RememberVideoQualityPatch.kt | 6 ++++++ .../patches/youtube/video/speed/PlaybackSpeedPatch.kt | 6 ++++++ .../videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt | 6 ++++++ 54 files changed, 319 insertions(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index fef0d4c04b..d44cfbe1fa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -63,6 +63,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt index 74af615aab..ccd4c22cbf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt @@ -57,6 +57,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt index 06005885cc..e0722d308a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt @@ -62,6 +62,12 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt index 0e2a112d24..f4c36074ab 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt @@ -50,6 +50,12 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt index fce77b9d68..a071ab3687 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt @@ -59,6 +59,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt index d2092848fe..fb04fa141f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt @@ -56,6 +56,12 @@ import app.revanced.util.resultOrThrow "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt index 913ace45a7..43c7427aaf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt @@ -59,6 +59,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt index 14686fefaf..99fc9023e6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt @@ -61,6 +61,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt index 6dc65b5f30..b7841f788e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt @@ -63,6 +63,12 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt index f53a0ceafa..a76b0f6b18 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt @@ -61,6 +61,12 @@ import app.revanced.util.exception "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt index 17aa55bb33..9500693569 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt @@ -60,6 +60,12 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt index 0460b11a08..d1a88fa72b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt @@ -71,6 +71,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt index 513fb0746a..2972fa0dfc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt @@ -61,6 +61,12 @@ import com.android.tools.smali.dexlib2.Opcode "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt index f06d840c9a..4a18463ec1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt @@ -74,6 +74,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt index 5cb48bc669..5926f686b6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt @@ -65,6 +65,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt index acd80c5aed..39e7342272 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt @@ -59,6 +59,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index 5273318d28..4603bfee2e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -59,6 +59,12 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt index c053c4cb47..d34163d502 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -59,6 +59,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt index 6eec616db3..1115833b2b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt @@ -62,6 +62,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt index 0c48ecb464..6bf6279353 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt @@ -59,6 +59,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt index 0ca3072575..2f01f7b0b0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt @@ -55,6 +55,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt index 0cce5b39da..0ccc7678af 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt @@ -55,6 +55,12 @@ import app.revanced.util.exception "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 26b8dbee9d..9458bd7226 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -78,6 +78,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index e8d6a5fc64..015ebdd317 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -67,6 +67,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt index f9d1952640..1be073262c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt @@ -60,6 +60,12 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt index a510420500..f9b8df8dc4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt @@ -57,6 +57,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt index f81d09669a..c46aec9ee8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt @@ -62,6 +62,12 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 7119a4bbe8..9cfff30e77 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -73,6 +73,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt index 3e5732a27f..9f6064b781 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt @@ -54,6 +54,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt index 45950a209c..ea5ca198fd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt @@ -55,6 +55,12 @@ import app.revanced.util.exception "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt index acc81858d5..96c4c1957d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt @@ -56,6 +56,12 @@ import app.revanced.util.exception "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt index 3c67e45142..a80842a4fc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt @@ -51,6 +51,12 @@ import org.w3c.dom.Element "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index d2cbcf8eb4..f66e7d8686 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -92,6 +92,12 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index a3b8dd91f4..75d2a95221 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -60,6 +60,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt index 7c7afd9f46..9d45b0ca8b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt @@ -45,6 +45,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39" + // 19.17+ is not supported. ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index ba13370b4e..b40aa338af 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -77,6 +77,12 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt index b732b5dffb..7a3b3dc836 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt @@ -59,6 +59,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index c5b8988e47..4ff699f1e1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -64,6 +64,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt index d58d2aa06f..dd6ddfbdb4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt @@ -63,6 +63,12 @@ import app.revanced.util.resultOrThrow "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ) ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt index 6a4c441afb..7824e21757 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt @@ -71,6 +71,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt index 52ec339c56..b78cded5e1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt @@ -65,6 +65,12 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt index bde87d2d49..44684458a0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt @@ -61,6 +61,12 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt index 99fe7c33bd..34cb9d761b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt @@ -60,6 +60,12 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index b4f076aeb6..b09cd6aadf 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -68,6 +68,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt index 26fa5f6c8b..771ea4a3ae 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt @@ -55,6 +55,12 @@ import app.revanced.util.exception "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt index 8a29eea27c..bc89f4ef94 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt @@ -55,6 +55,12 @@ import app.revanced.util.resultOrThrow "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index a37a996c72..846ded1cc3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -88,6 +88,12 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 2154cfc915..c97a591eb1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -69,6 +69,12 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ), ), ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index 2cc002c35c..3847e583c5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -68,6 +68,12 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt index f8c5328309..d3d0e04324 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt @@ -61,6 +61,12 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt index beb9e136d3..02f603dae3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt @@ -62,6 +62,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt index 00a86133b0..6fd2931ae7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt @@ -66,6 +66,12 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt index 21d1f0a949..8ac05b037b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt @@ -52,6 +52,12 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt index 6f4c54f7f5..5a5e7cc4e7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt @@ -66,6 +66,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.28.42", "19.29.42", "19.30.39", + "19.31.36", + "19.32.36", + "19.33.36", + "19.34.42", + "19.35.36", + "19.36.37", ], ), ], From ee0a9dbf80a68ac697bec516a5a56d7a4a55ac6d Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 13 Sep 2024 23:22:36 -0700 Subject: [PATCH 043/143] fix(Miniplayer): The latest release doesn't seem so beta anymore. --- .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt | 3 --- .../RollingNumberTextViewAnimationUpdateFingerprint.kt | 6 ++---- src/main/resources/addresources/values/strings.xml | 2 -- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 26ca2d0e1e..4292847b18 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -18,7 +18,6 @@ import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.BasePreference import app.revanced.patches.shared.misc.settings.preference.InputType import app.revanced.patches.shared.misc.settings.preference.ListPreference -import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference 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 @@ -190,8 +189,6 @@ object MiniplayerPatch : BytecodePatch( preferences += TextPreference("revanced_miniplayer_opacity", inputType = InputType.NUMBER) } - preferences += NonInteractivePreference("revanced_miniplayer_about") - SettingsPatch.PreferenceScreen.PLAYER.addPreferences( PreferenceScreen( key = "revanced_miniplayer_screen", diff --git a/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt index bafa735c3d..ca5710f8ca 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt @@ -25,9 +25,7 @@ internal object RollingNumberTextViewAnimationUpdateFingerprint : MethodFingerpr Opcode.INVOKE_VIRTUAL, // set textview padding using bitmap width ), customFingerprint = { _, classDef -> - val appCompatTextView = "Landroid/support/v7/widget/AppCompatTextView;" - val youTubeAppCompatTextView = "Lcom/google/android/libraries/youtube/rendering/ui/spec/typography/YouTubeAppCompatTextView;" - - classDef.superclass in listOf(appCompatTextView, youTubeAppCompatTextView) + classDef.superclass == "Landroid/support/v7/widget/AppCompatTextView;" || + classDef.superclass == "Lcom/google/android/libraries/youtube/rendering/ui/spec/typography/YouTubeAppCompatTextView;" } ) \ No newline at end of file diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index ea098c9fbb..9be34395a4 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -1008,8 +1008,6 @@ This is because Crowdin requires temporarily flattening this file and removing t Overlay opacity Opacity value between 0-100, where 0 is transparent Miniplayer overlay opacity must be between 0-100 - About modern miniplayers - Modern miniplayers are under active development, and if selected you may experience bugs or incomplete features Enable gradient loading screen From 6f552dc931e8c055107fbb824365e33299809694 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 14 Sep 2024 09:49:38 -0700 Subject: [PATCH 044/143] fix broken litho filtering? --- .../youtube/misc/litho/filter/LithoFilterPatch.kt | 11 +++++++++++ .../fingerprints/ObfuscationConfigFingerprint.kt | 12 ++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ObfuscationConfigFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index cc1d439b49..bc3e03d563 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -15,6 +15,7 @@ import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ComponentContextParserFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.EmptyComponentFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.LithoFilterFingerprint +import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ObfuscationConfigFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBufferReferenceFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck @@ -22,6 +23,7 @@ import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.indexOfFirstInstructionReversedOrThrow import app.revanced.util.resultOrThrow +import app.revanced.util.returnEarly import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.Field @@ -41,6 +43,7 @@ import java.io.Closeable @Suppress("unused") object LithoFilterPatch : BytecodePatch( setOf( + ObfuscationConfigFingerprint, ComponentContextParserFingerprint, LithoFilterFingerprint, ProtobufBufferReferenceFingerprint, @@ -111,6 +114,14 @@ object LithoFilterPatch : BytecodePatch( */ override fun execute(context: BytecodeContext) { + // region turn off conversion context obfuscation (19.19+) + + if (YouTubeVersionCheck.is_19_19_or_greater) { + ObfuscationConfigFingerprint.returnEarly(false) + } + + // endregion + // Remove dummy filter from Integrations static field // and add the filters included during patching. LithoFilterFingerprint.resultOrThrow().mutableMethod.apply { diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ObfuscationConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ObfuscationConfigFingerprint.kt new file mode 100644 index 0000000000..f118b94644 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ObfuscationConfigFingerprint.kt @@ -0,0 +1,12 @@ +package app.revanced.patches.youtube.misc.litho.filter.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.util.patch.LiteralValueFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +internal object ObfuscationConfigFingerprint : LiteralValueFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + returnType = "Z", + parameters = listOf(), + literalSupplier = { 45631264L } +) \ No newline at end of file From 0d674164addfab57f218e3cd3fb033e49bc6a696 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 14 Sep 2024 21:13:52 -0700 Subject: [PATCH 045/143] Revert "fix broken litho filtering?" This reverts commit 6f552dc931e8c055107fbb824365e33299809694. --- .../youtube/misc/litho/filter/LithoFilterPatch.kt | 11 ----------- .../fingerprints/ObfuscationConfigFingerprint.kt | 12 ------------ 2 files changed, 23 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ObfuscationConfigFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt index bc3e03d563..cc1d439b49 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt @@ -15,7 +15,6 @@ import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ComponentContextParserFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.EmptyComponentFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.LithoFilterFingerprint -import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ObfuscationConfigFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBufferReferenceFingerprint import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck @@ -23,7 +22,6 @@ import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.indexOfFirstInstructionReversedOrThrow import app.revanced.util.resultOrThrow -import app.revanced.util.returnEarly import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.Field @@ -43,7 +41,6 @@ import java.io.Closeable @Suppress("unused") object LithoFilterPatch : BytecodePatch( setOf( - ObfuscationConfigFingerprint, ComponentContextParserFingerprint, LithoFilterFingerprint, ProtobufBufferReferenceFingerprint, @@ -114,14 +111,6 @@ object LithoFilterPatch : BytecodePatch( */ override fun execute(context: BytecodeContext) { - // region turn off conversion context obfuscation (19.19+) - - if (YouTubeVersionCheck.is_19_19_or_greater) { - ObfuscationConfigFingerprint.returnEarly(false) - } - - // endregion - // Remove dummy filter from Integrations static field // and add the filters included during patching. LithoFilterFingerprint.resultOrThrow().mutableMethod.apply { diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ObfuscationConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ObfuscationConfigFingerprint.kt deleted file mode 100644 index f118b94644..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/fingerprints/ObfuscationConfigFingerprint.kt +++ /dev/null @@ -1,12 +0,0 @@ -package app.revanced.patches.youtube.misc.litho.filter.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.util.patch.LiteralValueFingerprint -import com.android.tools.smali.dexlib2.AccessFlags - -internal object ObfuscationConfigFingerprint : LiteralValueFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - returnType = "Z", - parameters = listOf(), - literalSupplier = { 45631264L } -) \ No newline at end of file From 85bf50cf6430358d1a6a8b2dabd9e643e98f2f1f Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 14 Sep 2024 21:37:32 -0700 Subject: [PATCH 046/143] fix Url bypass with 19.34 --- .../misc/links/BypassURLRedirectsPatch.kt | 17 ++++++++++------- .../fingerprints/ABUriParserFingerprint.kt | 11 +++++++++-- .../ABUriParserLegacyFingerprint.kt | 3 --- .../fingerprints/HTTPUriParserFingerprint.kt | 9 ++++++++- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index 3847e583c5..e3948133ae 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -16,8 +16,9 @@ import app.revanced.patches.youtube.misc.links.fingerprints.HTTPUriParserLegacyF import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfFirstInstruction import app.revanced.util.resultOrThrow +import com.android.tools.smali.dexlib2.iface.Method import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.reference.MethodReference @@ -95,7 +96,7 @@ object BypassURLRedirectsPatch : BytecodePatch( ) val fingerprints = - if (YouTubeVersionCheck.is_19_35_or_greater) + if (YouTubeVersionCheck.is_19_33_or_greater) arrayOf( ABUriParserFingerprint, HTTPUriParserFingerprint @@ -108,11 +109,7 @@ object BypassURLRedirectsPatch : BytecodePatch( fingerprints.forEach { fingerprint -> fingerprint.resultOrThrow().let { it.mutableMethod.apply { - val insertIndex = indexOfFirstInstructionOrThrow { - val reference = getReference() - reference?.returnType == "Landroid/net/Uri;" && - reference.name == "parse" - } + val insertIndex = findUriParseIndex() val uriStringRegister = getInstruction(insertIndex).registerC @@ -127,4 +124,10 @@ object BypassURLRedirectsPatch : BytecodePatch( } } } + + internal fun Method.findUriParseIndex(): Int = indexOfFirstInstruction { + val reference = getReference() + reference?.returnType == "Landroid/net/Uri;" && + reference.name == "parse" + } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt index 2bcb18ed9c..f5766ae30f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserFingerprint.kt @@ -2,14 +2,21 @@ package app.revanced.patches.youtube.misc.links.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patches.youtube.misc.links.BypassURLRedirectsPatch.findUriParseIndex import com.android.tools.smali.dexlib2.AccessFlags /** - * Target 19.35+ + * Target 19.33+ */ internal object ABUriParserFingerprint : MethodFingerprint( returnType = "Ljava/lang/Object", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Ljava/lang/Object"), - strings = listOf("` that does not contain a PlaylistVideoEntityId message as it's identifier."), + strings = listOf( + "Found entityKey=`", + "` that does not contain a PlaylistVideoEntityId message as it's identifier." + ), + customFingerprint = { methodDef, _ -> + methodDef.findUriParseIndex() >= 0 + } ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt index 992386df77..b05818e4b7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/ABUriParserLegacyFingerprint.kt @@ -5,9 +5,6 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -/** - * Target 19.35+ - */ internal object ABUriParserLegacyFingerprint : MethodFingerprint( returnType = "Ljava/lang/Object", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserFingerprint.kt index d791408240..f27f23949b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/fingerprints/HTTPUriParserFingerprint.kt @@ -2,11 +2,18 @@ package app.revanced.patches.youtube.misc.links.fingerprints import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patches.youtube.misc.links.BypassURLRedirectsPatch.findUriParseIndex import com.android.tools.smali.dexlib2.AccessFlags +/** + * Target 19.33+ + */ internal object HTTPUriParserFingerprint : MethodFingerprint( returnType = "Landroid/net/Uri", accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, parameters = listOf("Ljava/lang/String"), - strings = listOf("https", "https:", "://") + strings = listOf("https", "https:", "://"), + customFingerprint = { methodDef, _ -> + methodDef.findUriParseIndex() >= 0 + } ) \ No newline at end of file From 9dac823d1a6bdc247acfb0c3b1b109f75f548070 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 14 Sep 2024 21:39:48 -0700 Subject: [PATCH 047/143] fix: For now, remove 19.35 and 19.36 --- .../revanced/patches/youtube/ad/general/HideAdsPatch.kt | 2 -- .../patches/youtube/ad/getpremium/HideGetPremiumPatch.kt | 2 -- .../revanced/patches/youtube/ad/video/VideoAdsPatch.kt | 2 -- .../interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt | 2 -- .../dialog/RemoveViewerDiscretionDialogPatch.kt | 2 -- .../youtube/interaction/downloads/DownloadsPatch.kt | 2 -- .../seekbar/DisablePreciseSeekingGesturePatch.kt | 2 -- .../interaction/seekbar/EnableSeekbarTappingPatch.kt | 2 -- .../swipecontrols/SwipeControlsBytecodePatch.kt | 2 -- .../youtube/layout/autocaptions/AutoCaptionsPatch.kt | 2 -- .../youtube/layout/buttons/action/HideButtonsPatch.kt | 2 -- .../layout/buttons/autoplay/HideAutoplayButtonPatch.kt | 2 -- .../layout/buttons/captions/HideCaptionsButtonPatch.kt | 2 -- .../layout/buttons/navigation/NavigationButtonsPatch.kt | 2 -- .../layout/buttons/player/hide/HidePlayerButtonsPatch.kt | 2 -- .../youtube/layout/hide/albumcards/AlbumCardsPatch.kt | 2 -- .../patches/youtube/layout/hide/comments/CommentsPatch.kt | 2 -- .../layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt | 2 -- .../layout/hide/endscreencards/HideEndscreenCardsPatch.kt | 2 -- .../youtube/layout/hide/filterbar/HideFilterBarPatch.kt | 2 -- .../HideFloatingMicrophoneButtonPatch.kt | 2 -- .../DisableFullscreenAmbientModePatch.kt | 2 -- .../layout/hide/general/HideLayoutComponentsPatch.kt | 2 -- .../youtube/layout/hide/infocards/HideInfoCardsPatch.kt | 2 -- .../player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt | 2 -- .../rollingnumber/DisableRollingNumberAnimationPatch.kt | 2 -- .../youtube/layout/hide/seekbar/HideSeekbarPatch.kt | 2 -- .../layout/hide/shorts/HideShortsComponentsPatch.kt | 2 -- .../DisableSuggestedVideoEndScreenPatch.kt | 2 -- .../youtube/layout/hide/time/HideTimestampPatch.kt | 2 -- .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt | 8 +++----- .../youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt | 2 -- .../player/background/PlayerControlsBackgroundPatch.kt | 2 -- .../returnyoutubedislike/ReturnYouTubeDislikePatch.kt | 2 -- .../youtube/layout/searchbar/WideSearchbarPatch.kt | 2 -- .../layout/sponsorblock/SponsorBlockBytecodePatch.kt | 2 -- .../layout/spoofappversion/SpoofAppVersionPatch.kt | 2 -- .../DisableResumingShortsOnStartupPatch.kt | 2 -- .../youtube/layout/tablet/EnableTabletLayoutPatch.kt | 2 -- .../patches/youtube/layout/theme/ThemeBytecodePatch.kt | 2 -- .../layout/thumbnails/AlternativeThumbnailsPatch.kt | 2 -- .../layout/thumbnails/BypassImageRegionRestrictions.kt | 2 -- .../patches/youtube/misc/autorepeat/AutoRepeatPatch.kt | 2 -- .../misc/backgroundplayback/BackgroundPlaybackPatch.kt | 2 -- .../misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt | 2 -- .../dns/CheckWatchHistoryDomainNameResolutionPatch.kt | 2 -- .../patches/youtube/misc/fix/playback/SpoofClientPatch.kt | 2 -- .../patches/youtube/misc/gms/GmsCoreSupportPatch.kt | 2 -- .../patches/youtube/misc/links/BypassURLRedirectsPatch.kt | 2 -- .../youtube/misc/links/OpenLinksExternallyPatch.kt | 2 -- .../misc/privacy/RemoveTrackingQueryParameterPatch.kt | 2 -- .../youtube/video/quality/RememberVideoQualityPatch.kt | 2 -- .../patches/youtube/video/speed/PlaybackSpeedPatch.kt | 2 -- .../videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt | 2 -- 54 files changed, 3 insertions(+), 111 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index d44cfbe1fa..4c6bc22f41 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -67,8 +67,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt index ccd4c22cbf..60f4cf59e9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt @@ -61,8 +61,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt index e0722d308a..30de88cab1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt @@ -66,8 +66,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt index f4c36074ab..071b1b553c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt @@ -54,8 +54,6 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt index a071ab3687..35f3e85a03 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt @@ -63,8 +63,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt index fb04fa141f..3b9be6f368 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt @@ -60,8 +60,6 @@ import app.revanced.util.resultOrThrow "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt index 43c7427aaf..9cef5f376e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt @@ -63,8 +63,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt index 99fc9023e6..225e2a279c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt @@ -65,8 +65,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt index b7841f788e..9a972c54fe 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt @@ -67,8 +67,6 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt index a76b0f6b18..68072eef87 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt @@ -65,8 +65,6 @@ import app.revanced.util.exception "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt index 9500693569..ad6e72e83f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt @@ -64,8 +64,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt index d1a88fa72b..3e4fd01c41 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt @@ -75,8 +75,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt index 2972fa0dfc..89eb2c5bee 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt @@ -65,8 +65,6 @@ import com.android.tools.smali.dexlib2.Opcode "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt index 4a18463ec1..871d33425f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt @@ -78,8 +78,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt index 5926f686b6..7124417c8b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt @@ -69,8 +69,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt index 39e7342272..5fb940f9d5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt @@ -63,8 +63,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index 4603bfee2e..495171578c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -63,8 +63,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt index d34163d502..c628b19e36 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -63,8 +63,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt index 1115833b2b..055f540156 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt @@ -66,8 +66,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt index 6bf6279353..0bf50f0c9a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt @@ -63,8 +63,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt index 2f01f7b0b0..5fd41b8f1f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt @@ -59,8 +59,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt index 0ccc7678af..3ac4dec206 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt @@ -59,8 +59,6 @@ import app.revanced.util.exception "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 9458bd7226..0a98ec3128 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -82,8 +82,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index 015ebdd317..ac09ef3964 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -71,8 +71,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt index 1be073262c..8458c644d4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt @@ -64,8 +64,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt index f9b8df8dc4..63755b9325 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt @@ -61,8 +61,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt index c46aec9ee8..53bfc12bda 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt @@ -66,8 +66,6 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 9cfff30e77..81d705fafa 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -77,8 +77,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt index 9f6064b781..2e49f6b20a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt @@ -58,8 +58,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt index ea5ca198fd..34ca8ffad8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt @@ -59,8 +59,6 @@ import app.revanced.util.exception "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 4292847b18..cdaaecacf8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -119,11 +119,9 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter // 19.29.42 // All modern players are broken and ignore tapping the miniplayer video. // 19.30.39 // Modern 3 is less broken when double tap expand is enabled, but cannot swipe to expand when double tap is off. // 19.31.36 // All Modern 1 buttons are missing. Unusable. - // 19.32.36 // Works without issues, but no reason to recommend over 19.36. - // 19.33.35 // Works without issues, but no reason to recommend over 19.36. - // 19.34.42 // Works without issues, but no reason to recommend over 19.36. - // 19.35.36 // Works without issues, but no reason to recommend over 19.36. - "19.36.37", // Works without issues. + // 19.32.36 // Works without issues, but no reason to recommend over 19.34. + // 19.33.35 // Works without issues, but no reason to recommend over 19.34. + "19.34.42", // Works without issues. ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt index 96c4c1957d..71ef14a943 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt @@ -60,8 +60,6 @@ import app.revanced.util.exception "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt index a80842a4fc..cadc1691b7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt @@ -55,8 +55,6 @@ import org.w3c.dom.Element "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index f66e7d8686..3bc2b48005 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -96,8 +96,6 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index 75d2a95221..e764731ff4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -64,8 +64,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index b40aa338af..283f3acb8b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -81,8 +81,6 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt index 7a3b3dc836..32c71a83d1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt @@ -63,8 +63,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index 4ff699f1e1..65686d6e20 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -68,8 +68,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt index dd6ddfbdb4..46a373d306 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt @@ -67,8 +67,6 @@ import app.revanced.util.resultOrThrow "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ) ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt index 7824e21757..bb006da499 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt @@ -75,8 +75,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt index b78cded5e1..ab80dd55bb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt @@ -69,8 +69,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt index 44684458a0..ec6eee8046 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt @@ -65,8 +65,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt index 34cb9d761b..c78fbd9b49 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt @@ -64,8 +64,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index b09cd6aadf..8eaf63c688 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -72,8 +72,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt index 771ea4a3ae..91c90c1443 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt @@ -59,8 +59,6 @@ import app.revanced.util.exception "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt index bc89f4ef94..5dfff77953 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt @@ -59,8 +59,6 @@ import app.revanced.util.resultOrThrow "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 846ded1cc3..927e5e96dd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -92,8 +92,6 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index c97a591eb1..3d966b0e0d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -73,8 +73,6 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ), ), ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index e3948133ae..6bc10920c1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -73,8 +73,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt index d3d0e04324..4a5daaa8b6 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt @@ -65,8 +65,6 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt index 02f603dae3..15688e53c9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt @@ -66,8 +66,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt index 6fd2931ae7..644a366a2e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt @@ -70,8 +70,6 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt index 8ac05b037b..96164d3a91 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt @@ -56,8 +56,6 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt index 5a5e7cc4e7..6305ca05cb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt @@ -70,8 +70,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.32.36", "19.33.36", "19.34.42", - "19.35.36", - "19.36.37", ], ), ], From 3c8fa638345965473835dce5e5ca3071e60c4f38 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 14 Sep 2024 23:39:56 -0700 Subject: [PATCH 048/143] fix(Change start page): For now, set 19.31 as max supported version --- .../layout/miniplayer/MiniplayerPatch.kt | 2 +- .../layout/startpage/ChangeStartPagePatch.kt | 55 +++++++++++++++++-- .../fingerprints/StartActivityFingerprint.kt | 7 ++- 3 files changed, 54 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index cdaaecacf8..734382024e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -121,7 +121,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter // 19.31.36 // All Modern 1 buttons are missing. Unusable. // 19.32.36 // Works without issues, but no reason to recommend over 19.34. // 19.33.35 // Works without issues, but no reason to recommend over 19.34. - "19.34.42", // Works without issues. + "19.34.42", // Works without issues. ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt index 16481ea80e..b437dceac9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt @@ -16,7 +16,49 @@ import app.revanced.util.resultOrThrow name = "Change start page", description = "Adds an option to set which page the app opens in instead of the homepage.", dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class], - compatiblePackages = [CompatiblePackage("com.google.android.youtube")] + compatiblePackages = [ + CompatiblePackage( + "com.google.android.youtube", + [ + "18.43.45", + "18.44.41", + "18.45.43", + "18.48.39", + "18.49.37", + "19.01.34", + "19.02.39", + "19.03.36", + "19.04.38", + "19.05.36", + "19.06.39", + "19.07.40", + "19.08.36", + "19.09.38", + "19.10.39", + "19.11.43", + "19.12.41", + "19.13.37", + "19.14.43", + "19.15.36", + "19.16.39", + "19.17.41", + "19.18.41", + "19.19.39", + "19.20.35", + "19.21.40", + "19.22.43", + "19.23.40", + "19.24.45", + "19.25.37", + "19.26.42", + "19.28.42", + "19.29.42", + "19.30.39", + "19.31.36", + // 19.32+ needs changes for this patch to work. + ] + ) + ] ) @Suppress("unused") object ChangeStartPagePatch : BytecodePatch( @@ -28,16 +70,17 @@ object ChangeStartPagePatch : BytecodePatch( override fun execute(context: BytecodeContext) { AddResourcesPatch(this::class) + StartActivityFingerprint.resultOrThrow().mutableMethod.addInstruction( + 0, + "invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeIntent(Landroid/content/Intent;)V" + ) + + // Add settings only after resolving, in case the user turns off version checks and is patching 19.32+ SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences( ListPreference( key = "revanced_start_page", summaryKey = null, ) ) - - StartActivityFingerprint.resultOrThrow().mutableMethod.addInstruction( - 0, - "invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeIntent(Landroid/content/Intent;)V" - ) } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt index a039df2764..c617b0d3b3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt @@ -8,10 +8,11 @@ object StartActivityFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, returnType = "V", parameters = listOf("Landroid/content/Intent;"), - customFingerprint = { method, classDef -> method.name == "startActivity" && - (classDef.type.endsWith("/Shell_HomeActivity;") || - classDef.type.endsWith("/Shell_UrlActivity;")) + classDef.type.endsWith("/Shell_HomeActivity;") + // 19.32+ renamed the target class to "/Shell_UrlActivity;", + // but on app launch startActivity is no longer called so the start page is never changed. + // || classDef.type.endsWith("/Shell_UrlActivity;")) } ) \ No newline at end of file From b81b543b79f223ba7c08119b63e38d94e559c034 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 14 Sep 2024 23:52:02 -0700 Subject: [PATCH 049/143] comments --- .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 734382024e..8a4a401dea 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -105,8 +105,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter // 19.14.43 // Incomplete code for modern miniplayers. // 19.15.36 // Different code for handling sub title texts and not worth supporting. "19.16.39", // First with modern miniplayers. - // 19.17.41 // Works without issues, but no reason to recommend over 19.19. - // 19.18.41 // Works without issues, but no reason to recommend over 19.19. + // 19.17.41 // Works without issues, but no reason to recommend over 19.16. + // 19.18.41 // Works without issues, but no reason to recommend over 19.16. // 19.19.39 // Last bug free version with smaller Modern 1 miniplayer, but no reason to recommend over 19.16. // 19.20.35 // Cannot swipe to expand. // 19.21.40 // Cannot swipe to expand. From 21ce93914f4a05cf82f6e189628edb5d9b315e28 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 15 Sep 2024 00:05:57 -0700 Subject: [PATCH 050/143] fix: Constrain new versions to `19.25`, `19.32`, `19.33`, `19.34` --- .../patches/youtube/ad/general/HideAdsPatch.kt | 13 ------------- .../youtube/ad/getpremium/HideGetPremiumPatch.kt | 13 ------------- .../patches/youtube/ad/video/VideoAdsPatch.kt | 13 ------------- .../copyvideourl/CopyVideoUrlBytecodePatch.kt | 13 ------------- .../dialog/RemoveViewerDiscretionDialogPatch.kt | 13 ------------- .../interaction/downloads/DownloadsPatch.kt | 13 ------------- .../seekbar/DisablePreciseSeekingGesturePatch.kt | 13 ------------- .../seekbar/EnableSeekbarTappingPatch.kt | 13 ------------- .../swipecontrols/SwipeControlsBytecodePatch.kt | 13 ------------- .../layout/autocaptions/AutoCaptionsPatch.kt | 13 ------------- .../layout/buttons/action/HideButtonsPatch.kt | 13 ------------- .../buttons/autoplay/HideAutoplayButtonPatch.kt | 13 ------------- .../buttons/captions/HideCaptionsButtonPatch.kt | 13 ------------- .../buttons/navigation/NavigationButtonsPatch.kt | 13 ------------- .../player/hide/HidePlayerButtonsPatch.kt | 13 ------------- .../layout/hide/albumcards/AlbumCardsPatch.kt | 13 ------------- .../layout/hide/comments/CommentsPatch.kt | 13 ------------- .../hide/crowdfundingbox/CrowdfundingBoxPatch.kt | 13 ------------- .../endscreencards/HideEndscreenCardsPatch.kt | 13 ------------- .../layout/hide/filterbar/HideFilterBarPatch.kt | 13 ------------- .../HideFloatingMicrophoneButtonPatch.kt | 13 ------------- .../DisableFullscreenAmbientModePatch.kt | 13 ------------- .../hide/general/HideLayoutComponentsPatch.kt | 13 ------------- .../layout/hide/infocards/HideInfoCardsPatch.kt | 13 ------------- .../flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt | 13 ------------- .../DisableRollingNumberAnimationPatch.kt | 13 ------------- .../layout/hide/seekbar/HideSeekbarPatch.kt | 13 ------------- .../hide/shorts/HideShortsComponentsPatch.kt | 13 ------------- .../DisableSuggestedVideoEndScreenPatch.kt | 13 ------------- .../layout/hide/time/HideTimestampPatch.kt | 13 ------------- .../youtube/layout/miniplayer/MiniplayerPatch.kt | 4 ++-- .../panels/popup/PlayerPopupPanelsPatch.kt | 13 ------------- .../background/PlayerControlsBackgroundPatch.kt | 13 ------------- .../ReturnYouTubeDislikePatch.kt | 13 ------------- .../layout/searchbar/WideSearchbarPatch.kt | 13 ------------- .../sponsorblock/SponsorBlockBytecodePatch.kt | 13 ------------- .../spoofappversion/SpoofAppVersionPatch.kt | 13 ------------- .../layout/startpage/ChangeStartPagePatch.kt | 16 ++-------------- .../DisableResumingShortsOnStartupPatch.kt | 13 ------------- .../layout/tablet/EnableTabletLayoutPatch.kt | 13 ------------- .../youtube/layout/theme/ThemeBytecodePatch.kt | 13 ------------- .../thumbnails/AlternativeThumbnailsPatch.kt | 13 ------------- .../thumbnails/BypassImageRegionRestrictions.kt | 13 ------------- .../youtube/misc/autorepeat/AutoRepeatPatch.kt | 13 ------------- .../BackgroundPlaybackPatch.kt | 13 ------------- .../spoof/SpoofDeviceDimensionsPatch.kt | 13 ------------- ...CheckWatchHistoryDomainNameResolutionPatch.kt | 13 ------------- .../misc/fix/playback/SpoofClientPatch.kt | 13 ------------- .../youtube/misc/gms/GmsCoreSupportPatch.kt | 13 ------------- .../misc/links/BypassURLRedirectsPatch.kt | 13 ------------- .../misc/links/OpenLinksExternallyPatch.kt | 13 ------------- .../privacy/RemoveTrackingQueryParameterPatch.kt | 13 ------------- .../video/quality/RememberVideoQualityPatch.kt | 13 ------------- .../youtube/video/speed/PlaybackSpeedPatch.kt | 13 ------------- .../RestoreOldVideoQualityMenuPatch.kt | 13 ------------- 55 files changed, 4 insertions(+), 705 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index 4c6bc22f41..d9e65d92da 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -50,20 +50,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt index 60f4cf59e9..4daa61b1c2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt @@ -44,20 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt index 30de88cab1..66faf68ed5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt @@ -49,20 +49,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt index 071b1b553c..9aeaf55673 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt @@ -37,20 +37,7 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt index 35f3e85a03..25294750e3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt @@ -46,20 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt index 3b9be6f368..2e1e6fc7b0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt @@ -43,20 +43,7 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt index 9cef5f376e..c9ab17d3a9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt @@ -46,20 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt index 225e2a279c..ebae0a9156 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt @@ -48,20 +48,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt index 9a972c54fe..e59a811599 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt @@ -50,20 +50,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt index 68072eef87..19a1778d63 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt @@ -48,20 +48,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt index ad6e72e83f..cb1cb9f385 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt @@ -47,20 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt index 3e4fd01c41..8b52264bb9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt @@ -58,20 +58,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt index 89eb2c5bee..49673ecc56 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt @@ -48,20 +48,7 @@ import com.android.tools.smali.dexlib2.Opcode "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt index 871d33425f..ccb5c7bead 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt @@ -61,20 +61,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt index 7124417c8b..c628e25b1f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt @@ -52,20 +52,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt index 5fb940f9d5..1fe5357107 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt @@ -46,20 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index 495171578c..e9615b753e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -46,20 +46,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt index c628b19e36..c41555b21e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -46,20 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt index 055f540156..0d99993a69 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt @@ -49,20 +49,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt index 0bf50f0c9a..5ce14ddfa8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt @@ -46,20 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt index 5fd41b8f1f..e1797bfd9e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt @@ -42,20 +42,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt index 3ac4dec206..d8f2356aae 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt @@ -42,20 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 0a98ec3128..3e19396204 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -65,20 +65,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index ac09ef3964..7fc06535d8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -54,20 +54,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt index 8458c644d4..12e2198f56 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt @@ -47,20 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt index 63755b9325..a6b960a5e3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt @@ -44,20 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt index 53bfc12bda..ad48de92d0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt @@ -49,20 +49,7 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 81d705fafa..2e53a782a9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -60,20 +60,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt index 2e49f6b20a..82e8aa145c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt @@ -41,20 +41,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt index 34ca8ffad8..75c5f95c50 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt @@ -42,20 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 8a4a401dea..8dc53efb15 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -119,8 +119,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter // 19.29.42 // All modern players are broken and ignore tapping the miniplayer video. // 19.30.39 // Modern 3 is less broken when double tap expand is enabled, but cannot swipe to expand when double tap is off. // 19.31.36 // All Modern 1 buttons are missing. Unusable. - // 19.32.36 // Works without issues, but no reason to recommend over 19.34. - // 19.33.35 // Works without issues, but no reason to recommend over 19.34. + "19.32.36", // Works without issues. + "19.33.35", // Works without issues. "19.34.42", // Works without issues. ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt index 71ef14a943..3ac5576250 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt @@ -43,20 +43,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt index cadc1691b7..7011e9c268 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt @@ -38,20 +38,7 @@ import org.w3c.dom.Element "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index 3bc2b48005..8dc0da4032 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -79,20 +79,7 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index e764731ff4..e3aabfbc6c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -47,20 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index 283f3acb8b..7e7bcab497 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -64,20 +64,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt index 32c71a83d1..d3f79b257b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt @@ -46,20 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt index b437dceac9..1fe3385852 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt @@ -41,21 +41,9 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", - // 19.32+ needs changes for this patch to work. + // 19.31.36 // Last version that works with this patch in it's current form. + // 19.32+ // Needs changes for this patch to work. ] ) ] diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index 65686d6e20..6317c15d4b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -51,20 +51,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt index 46a373d306..97b70fd92f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt @@ -50,20 +50,7 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt index bb006da499..6123855910 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt @@ -58,20 +58,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt index ab80dd55bb..f8a9ebccb1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt @@ -52,20 +52,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt index ec6eee8046..2998abac7e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt @@ -48,20 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt index c78fbd9b49..0cea22ed48 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt @@ -47,20 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 8eaf63c688..08e9d399e8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -55,20 +55,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt index 91c90c1443..2e9ef89f63 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt @@ -42,20 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt index 5dfff77953..a1718f453e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt @@ -42,20 +42,7 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 927e5e96dd..246af59c9b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -75,20 +75,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 3d966b0e0d..98706c9b01 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -56,20 +56,7 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index 6bc10920c1..c9978b661c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -56,20 +56,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt index 4a5daaa8b6..ee67bb26b0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt @@ -48,20 +48,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt index 15688e53c9..290fede9cd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt @@ -49,20 +49,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt index 644a366a2e..3f4b2d99d2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt @@ -53,20 +53,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt index 96164d3a91..fd6769c2e8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt @@ -39,20 +39,7 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt index 6305ca05cb..7d3b0ac109 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt @@ -53,20 +53,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.17.41", - "19.18.41", - "19.19.39", - "19.20.35", - "19.21.40", - "19.22.43", - "19.23.40", - "19.24.45", "19.25.37", - "19.26.42", - "19.28.42", - "19.29.42", - "19.30.39", - "19.31.36", "19.32.36", "19.33.36", "19.34.42", From 0b82a85adbfb510ab0111bc288bd028a0f5edf7d Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:23:43 -0700 Subject: [PATCH 051/143] fix Disable resuming Shorts on startup Code adapted from https://github.com/inotia00/revanced-patches/commit/c02510a289e34efe6f3c82cab9d034a24022d43b --- .../DisableResumingShortsOnStartupPatch.kt | 35 ++++++++++++++++++- .../UserWasInShortsConfigFingerprint.kt | 29 +++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsConfigFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index 6317c15d4b..b110099001 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -7,14 +7,18 @@ import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.all.misc.resources.AddResourcesPatch import app.revanced.patches.shared.misc.settings.preference.SwitchPreference +import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserWasInShortsConfigFingerprint +import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserWasInShortsConfigFingerprint.indexOfOptionalInstruction import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserWasInShortsFingerprint import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch import app.revanced.util.exception 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.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -61,7 +65,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference ) @Suppress("unused") object DisableResumingShortsOnStartupPatch : BytecodePatch( - setOf(UserWasInShortsFingerprint) + setOf(UserWasInShortsConfigFingerprint, UserWasInShortsFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = @@ -74,6 +78,35 @@ object DisableResumingShortsOnStartupPatch : BytecodePatch( SwitchPreference("revanced_disable_resuming_shorts_player") ) + UserWasInShortsConfigFingerprint.resultOrThrow().mutableMethod.apply { + val startIndex = indexOfOptionalInstruction(this) + val walkerIndex = indexOfFirstInstructionOrThrow(startIndex) { + val reference = getReference() + opcode == Opcode.INVOKE_VIRTUAL + && reference?.returnType == "Z" + && reference.definingClass != "Lj${'$'}/util/Optional;" + && reference.parameterTypes.size == 0 + } + + val walkerMethod = context.toMethodWalker(this) + .nextMethod(walkerIndex, true) + .getMethod() as MutableMethod + + // This method will only be called for the user being A/B tested. + // Presumably a method that processes the ProtoDataStore value (boolean) for the 'user_was_in_shorts' key. + walkerMethod.addInstructionsWithLabels( + 0, """ + invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->disableResumingStartupShortsPlayer()Z + move-result v0 + if-eqz v0, :show + const/4 v0, 0x0 + return v0 + :show + nop + """ + ) + } + UserWasInShortsFingerprint.result?.mutableMethod?.apply { val listenableInstructionIndex = indexOfFirstInstructionOrThrow { opcode == Opcode.INVOKE_INTERFACE && diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsConfigFingerprint.kt new file mode 100644 index 0000000000..185a6b57c1 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsConfigFingerprint.kt @@ -0,0 +1,29 @@ +package app.revanced.patches.youtube.layout.startupshortsreset.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserWasInShortsConfigFingerprint.indexOfOptionalInstruction +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstruction +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.Method +import com.android.tools.smali.dexlib2.iface.reference.MethodReference + +/** + * 18.15.40+ + */ +internal object UserWasInShortsConfigFingerprint : MethodFingerprint( + returnType = "V", + strings = listOf("Failed to get offline response: "), + customFingerprint = { methodDef, _ -> + indexOfOptionalInstruction(methodDef) >= 0 + } +) { + fun indexOfOptionalInstruction(methodDef: Method) = + methodDef.indexOfFirstInstruction { + val reference = getReference() + opcode == Opcode.INVOKE_STATIC && + reference?.definingClass == "Lj${'$'}/util/Optional;" && + reference.name == "of" && + reference.returnType == "Lj${'$'}/util/Optional;" + } +} \ No newline at end of file From 6f3d0792e11e0821210c9764ad670d658a54fc8f Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 15 Sep 2024 01:29:33 -0700 Subject: [PATCH 052/143] fix: Constrain versions even more. Only 19.25 and 19.34 are newly recommended. --- .../app/revanced/patches/youtube/ad/general/HideAdsPatch.kt | 4 +--- .../patches/youtube/ad/getpremium/HideGetPremiumPatch.kt | 4 +--- .../app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt | 4 +--- .../interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt | 4 +--- .../interaction/dialog/RemoveViewerDiscretionDialogPatch.kt | 4 +--- .../patches/youtube/interaction/downloads/DownloadsPatch.kt | 4 +--- .../interaction/seekbar/DisablePreciseSeekingGesturePatch.kt | 4 +--- .../youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt | 4 +--- .../interaction/swipecontrols/SwipeControlsBytecodePatch.kt | 4 +--- .../patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt | 4 +--- .../patches/youtube/layout/buttons/action/HideButtonsPatch.kt | 4 +--- .../layout/buttons/autoplay/HideAutoplayButtonPatch.kt | 4 +--- .../layout/buttons/captions/HideCaptionsButtonPatch.kt | 4 +--- .../layout/buttons/navigation/NavigationButtonsPatch.kt | 4 +--- .../layout/buttons/player/hide/HidePlayerButtonsPatch.kt | 4 +--- .../patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt | 4 +--- .../patches/youtube/layout/hide/comments/CommentsPatch.kt | 4 +--- .../layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt | 4 +--- .../layout/hide/endscreencards/HideEndscreenCardsPatch.kt | 4 +--- .../youtube/layout/hide/filterbar/HideFilterBarPatch.kt | 4 +--- .../floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt | 4 +--- .../DisableFullscreenAmbientModePatch.kt | 4 +--- .../youtube/layout/hide/general/HideLayoutComponentsPatch.kt | 4 +--- .../youtube/layout/hide/infocards/HideInfoCardsPatch.kt | 4 +--- .../hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt | 4 +--- .../hide/rollingnumber/DisableRollingNumberAnimationPatch.kt | 4 +--- .../patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt | 4 +--- .../youtube/layout/hide/shorts/HideShortsComponentsPatch.kt | 4 +--- .../DisableSuggestedVideoEndScreenPatch.kt | 4 +--- .../patches/youtube/layout/hide/time/HideTimestampPatch.kt | 4 +--- .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt | 4 ++-- .../youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt | 4 +--- .../layout/player/background/PlayerControlsBackgroundPatch.kt | 4 +--- .../layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt | 4 +--- .../patches/youtube/layout/searchbar/WideSearchbarPatch.kt | 4 +--- .../youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt | 4 +--- .../youtube/layout/spoofappversion/SpoofAppVersionPatch.kt | 4 +--- .../startupshortsreset/DisableResumingShortsOnStartupPatch.kt | 4 +--- .../patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt | 4 +--- .../patches/youtube/layout/theme/ThemeBytecodePatch.kt | 4 +--- .../youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt | 4 +--- .../layout/thumbnails/BypassImageRegionRestrictions.kt | 4 +--- .../patches/youtube/misc/autorepeat/AutoRepeatPatch.kt | 4 +--- .../misc/backgroundplayback/BackgroundPlaybackPatch.kt | 4 +--- .../misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt | 4 +--- .../misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt | 4 +--- .../patches/youtube/misc/fix/playback/SpoofClientPatch.kt | 4 +--- .../revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt | 4 +--- .../patches/youtube/misc/links/BypassURLRedirectsPatch.kt | 4 +--- .../patches/youtube/misc/links/OpenLinksExternallyPatch.kt | 4 +--- .../youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt | 4 +--- .../youtube/video/quality/RememberVideoQualityPatch.kt | 4 +--- .../patches/youtube/video/speed/PlaybackSpeedPatch.kt | 4 +--- .../video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt | 4 +--- 54 files changed, 55 insertions(+), 161 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt index d9e65d92da..a68b7ce80d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt @@ -50,9 +50,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt index 4daa61b1c2..05dfa95e73 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt @@ -44,9 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt index 66faf68ed5..a9980aeddd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt @@ -49,9 +49,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt index 9aeaf55673..0013433a74 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt @@ -37,9 +37,7 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt index 25294750e3..f6e00d2b8c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt @@ -46,9 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt index 2e1e6fc7b0..b7d4ffb229 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt @@ -43,9 +43,7 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt index c9ab17d3a9..9bb4696e19 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt @@ -46,9 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt index ebae0a9156..d02f62281e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt @@ -48,9 +48,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt index e59a811599..7fd51d1067 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt @@ -50,9 +50,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt index 19a1778d63..c3d57406d0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt @@ -48,9 +48,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt index cb1cb9f385..b700ef6fbe 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt @@ -47,9 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt index 8b52264bb9..918a7a92fd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt @@ -58,9 +58,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt index 49673ecc56..93d9389a2b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt @@ -48,9 +48,7 @@ import com.android.tools.smali.dexlib2.Opcode "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt index ccb5c7bead..d6e711e595 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt @@ -61,9 +61,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt index c628e25b1f..d09fc2ff61 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt @@ -52,9 +52,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt index 1fe5357107..c0f8cfdec7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt @@ -46,9 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt index e9615b753e..f1438e06a4 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt @@ -46,9 +46,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt index c41555b21e..13019a133e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt @@ -46,9 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt index 0d99993a69..6f308a2615 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt @@ -49,9 +49,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt index 5ce14ddfa8..a9cd0e50dc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt @@ -46,9 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt index e1797bfd9e..47fa09b4d0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt @@ -42,9 +42,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt index d8f2356aae..c7862e554f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt @@ -42,9 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt index 3e19396204..36fdba7043 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt @@ -65,9 +65,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt index 7fc06535d8..4f03e032be 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt @@ -54,9 +54,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt index 12e2198f56..c3e45a93ef 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt @@ -47,9 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt index a6b960a5e3..f2cdd00757 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt @@ -44,9 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt index ad48de92d0..79b8d94a6d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt @@ -49,9 +49,7 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 2e53a782a9..ebdd3e08a2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -60,9 +60,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt index 82e8aa145c..f611df325e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt @@ -41,9 +41,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt index 75c5f95c50..80cf8d3715 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt @@ -42,9 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 8dc53efb15..42e8cc587d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -119,8 +119,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter // 19.29.42 // All modern players are broken and ignore tapping the miniplayer video. // 19.30.39 // Modern 3 is less broken when double tap expand is enabled, but cannot swipe to expand when double tap is off. // 19.31.36 // All Modern 1 buttons are missing. Unusable. - "19.32.36", // Works without issues. - "19.33.35", // Works without issues. + // 19.32.36 // Works without issues. + // 19.33.35 // Works without issues. "19.34.42", // Works without issues. ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt index 3ac5576250..0a613b1e26 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt @@ -43,9 +43,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt index 7011e9c268..302ab905ca 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt @@ -38,9 +38,7 @@ import org.w3c.dom.Element "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt index 8dc0da4032..f963e23fcc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt @@ -79,9 +79,7 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index e3aabfbc6c..785b53cb2d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -47,9 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index 7e7bcab497..07293d4de1 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -64,9 +64,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt index d3f79b257b..ebc53c171a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt @@ -46,9 +46,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt index b110099001..e1708b606c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt @@ -55,9 +55,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt index 97b70fd92f..070068ccf0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt @@ -50,9 +50,7 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ) ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt index 6123855910..11018e2e13 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt @@ -58,9 +58,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt index f8a9ebccb1..c50485ae8b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt @@ -52,9 +52,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt index 2998abac7e..930cb6891f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt @@ -48,9 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt index 0cea22ed48..ae0af098ba 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt @@ -47,9 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 08e9d399e8..2fa0f067dd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -55,9 +55,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt index 2e9ef89f63..de521a9bd0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt @@ -42,9 +42,7 @@ import app.revanced.util.exception "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt index a1718f453e..4d714b488e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt @@ -42,9 +42,7 @@ import app.revanced.util.resultOrThrow "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 246af59c9b..0b34ad4002 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -75,9 +75,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index 98706c9b01..03b9251e0a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -56,9 +56,7 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ), ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt index c9978b661c..0f9cda0ae8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt @@ -56,9 +56,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt index ee67bb26b0..6bc23809bc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt @@ -48,9 +48,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt index 290fede9cd..a69d70adca 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt @@ -49,9 +49,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt index 3f4b2d99d2..448227c83f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt @@ -53,9 +53,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ] ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt index fd6769c2e8..42aa340349 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt @@ -39,9 +39,7 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt index 7d3b0ac109..6ff476231f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt @@ -53,9 +53,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - "19.25.37", - "19.32.36", - "19.33.36", + "19.25.37", "19.34.42", ], ), From 7407940470569d09e4b3a4ba8684cd8e8a9464d8 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 15 Sep 2024 02:34:30 -0700 Subject: [PATCH 053/143] cleanup --- .../hide/shorts/HideShortsComponentsPatch.kt | 41 ++++++++++------- .../BottomNavigationBarFingerprint.kt | 2 +- ...> BottomNavigationBarLegacyFingerprint.kt} | 46 +++++++++---------- .../ReelConstructorFingerprint.kt | 12 ++--- .../RollingNumberSetterFingerprint.kt | 1 + .../RollingNumberTextViewFingerprint.kt | 6 +-- .../misc/fix/playback/SpoofClientPatch.kt | 4 +- .../misc/playservice/YouTubeVersionCheck.kt | 2 + 8 files changed, 57 insertions(+), 57 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/{BottomNavigationBarNewFingerprint.kt => BottomNavigationBarLegacyFingerprint.kt} (85%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index ebdd3e08a2..43b409ba49 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -12,10 +12,12 @@ import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.* import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.util.exception import app.revanced.util.getReference import app.revanced.util.indexOfIdResourceOrThrow import app.revanced.util.injectHideViewCall +import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction @@ -31,6 +33,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference HideShortsComponentsResourcePatch::class, ResourceMappingPatch::class, NavigationBarHookPatch::class, + YouTubeVersionCheck::class ], compatiblePackages = [ CompatiblePackage( @@ -71,8 +74,8 @@ object HideShortsComponentsPatch : BytecodePatch( setOf( CreateShortsButtonsFingerprint, ReelConstructorFingerprint, + BottomNavigationBarLegacyFingerprint, BottomNavigationBarFingerprint, - BottomNavigationBarNewFingerprint, RenderBottomNavigationBarParentFingerprint, SetPivotBarVisibilityParentFingerprint, ), @@ -83,20 +86,21 @@ object HideShortsComponentsPatch : BytecodePatch( // region Hide the Shorts shelf. // This patch point is not present in 19.03.x and greater. - // If 19.02.x and lower is dropped, then this section of code and the fingerprint should be removed. - ReelConstructorFingerprint.result?.let { - it.mutableMethod.apply { - val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2 - val viewRegister = getInstruction(insertIndex).registerA + if (!YouTubeVersionCheck.is_19_03_or_greater) { + ReelConstructorFingerprint.result?.let { + it.mutableMethod.apply { + val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2 + val viewRegister = getInstruction(insertIndex).registerA - injectHideViewCall( - insertIndex, - viewRegister, - FILTER_CLASS_DESCRIPTOR, - "hideShortsShelf", - ) + injectHideViewCall( + insertIndex, + viewRegister, + FILTER_CLASS_DESCRIPTOR, + "hideShortsShelf", + ) + } } - } // Do not throw an exception if not resolved. + } // endregion @@ -149,11 +153,14 @@ object HideShortsComponentsPatch : BytecodePatch( // Required to prevent a black bar from appearing at the bottom of the screen. // BottomNavigationBar class deprecated on 19.29+. - val bottomNavigationBarResult = - BottomNavigationBarFingerprint.result ?: BottomNavigationBarNewFingerprint.result - ?: throw BottomNavigationBarFingerprint.exception + val navbarFingerprint = + if (YouTubeVersionCheck.is_19_29_or_greater) { + BottomNavigationBarFingerprint + } else { + BottomNavigationBarLegacyFingerprint + } - bottomNavigationBarResult.let { + navbarFingerprint.resultOrThrow().let { it.mutableMethod.apply { val moveResultIndex = it.scanResult.patternScanResult!!.startIndex + 2 val viewRegister = getInstruction(moveResultIndex).registerA diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt index 12ca03fb13..3de8096c1b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt @@ -19,6 +19,6 @@ internal object BottomNavigationBarFingerprint : MethodFingerprint( Opcode.IGET_OBJECT, ), strings = listOf( - "ReelWatchPaneFragmentViewModelKey" + "r_pfvc" ), ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarNewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarLegacyFingerprint.kt similarity index 85% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarNewFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarLegacyFingerprint.kt index f756c1adf6..81b6860f1c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarNewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarLegacyFingerprint.kt @@ -1,24 +1,24 @@ -package app.revanced.patches.youtube.layout.hide.shorts.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 BottomNavigationBarNewFingerprint : MethodFingerprint( - returnType = "V", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"), - opcodes = listOf( - Opcode.CONST, // R.id.app_engagement_panel_wrapper - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - Opcode.IF_EQZ, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - ), - strings = listOf( - "r_pfvc" - ), +package app.revanced.patches.youtube.layout.hide.shorts.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 BottomNavigationBarLegacyFingerprint : MethodFingerprint( + returnType = "V", + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"), + opcodes = listOf( + Opcode.CONST, // R.id.app_engagement_panel_wrapper + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.IF_EQZ, + Opcode.IGET_OBJECT, + Opcode.IGET_OBJECT, + Opcode.IGET_OBJECT, + ), + strings = listOf( + "ReelWatchPaneFragmentViewModelKey" + ), ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ReelConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ReelConstructorFingerprint.kt index dece9b3718..912aa9704c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ReelConstructorFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ReelConstructorFingerprint.kt @@ -1,19 +1,13 @@ package app.revanced.patches.youtube.layout.hide.shorts.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patches.youtube.layout.hide.shorts.HideShortsComponentsResourcePatch -import app.revanced.util.containsWideLiteralInstructionValue +import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode -internal object ReelConstructorFingerprint : MethodFingerprint( +internal object ReelConstructorFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR, opcodes = listOf(Opcode.INVOKE_VIRTUAL), - customFingerprint = { methodDef, _ -> - // Cannot use LiteralValueFingerprint, because the resource id may not be present. - val reelMultipleItemShelfId = HideShortsComponentsResourcePatch.reelMultipleItemShelfId - reelMultipleItemShelfId != -1L - && methodDef.containsWideLiteralInstructionValue(reelMultipleItemShelfId) - } + literalSupplier = { HideShortsComponentsResourcePatch.reelMultipleItemShelfId } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberSetterFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberSetterFingerprint.kt index e497007544..57569b2709 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberSetterFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberSetterFingerprint.kt @@ -8,5 +8,6 @@ internal object RollingNumberSetterFingerprint : MethodFingerprint( Opcode.INVOKE_DIRECT, Opcode.IGET_OBJECT ), + // Partial string match. strings = listOf("RollingNumberType required properties missing! Need") ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberTextViewFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberTextViewFingerprint.kt index 2aab0d2071..ba109ac54a 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberTextViewFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/RollingNumberTextViewFingerprint.kt @@ -18,9 +18,7 @@ internal object RollingNumberTextViewFingerprint : MethodFingerprint( Opcode.RETURN_VOID ), customFingerprint = { _, classDef -> - val appCompatTextView = "Landroid/support/v7/widget/AppCompatTextView;" - val youTubeAppCompatTextView = "Lcom/google/android/libraries/youtube/rendering/ui/spec/typography/YouTubeAppCompatTextView;" - - classDef.superclass in listOf(appCompatTextView, youTubeAppCompatTextView) + classDef.superclass == "Landroid/support/v7/widget/AppCompatTextView;" || + classDef.superclass == "Lcom/google/android/libraries/youtube/rendering/ui/spec/typography/YouTubeAppCompatTextView;" } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt index 0b34ad4002..6b2c24a28c 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofClientPatch.kt @@ -210,9 +210,7 @@ object SpoofClientPatch : BytecodePatch( CreatePlayerRequestBodyWithModelFingerprint.indexOfBuildModelInstruction(it.method) // The next IPUT_OBJECT instruction after getting the client model is setting the client model field. - val index = it.mutableMethod.indexOfFirstInstructionOrThrow(getClientModelIndex) { - opcode == Opcode.IPUT_OBJECT - } + val index = it.mutableMethod.indexOfFirstInstructionOrThrow(getClientModelIndex, Opcode.IPUT_OBJECT) it.mutableMethod.getInstruction(index).getReference() ?: throw PatchException("Could not find clientInfoClientModelField") diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt index 5e417e8e16..38a852aa39 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt @@ -18,6 +18,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { private var playStoreServicesVersion by Delegates.notNull() + var is_19_03_or_greater by Delegates.notNull() var is_19_15_or_greater by Delegates.notNull() var is_19_16_or_greater by Delegates.notNull() var is_19_17_or_greater by Delegates.notNull() @@ -36,6 +37,7 @@ internal object YouTubeVersionCheck : ResourcePatch() { override fun execute(context: ResourceContext) { playStoreServicesVersion = findPlayServicesVersion(context) + is_19_03_or_greater = 240402000 <= playStoreServicesVersion is_19_15_or_greater = 241602000 <= playStoreServicesVersion is_19_16_or_greater = 241702000 <= playStoreServicesVersion is_19_17_or_greater = 241802000 <= playStoreServicesVersion From 889e74469dbda3ea3e9be1391a4ac05261069fb8 Mon Sep 17 00:00:00 2001 From: zainarbani Date: Tue, 17 Sep 2024 02:25:13 +0700 Subject: [PATCH 054/143] fix: Restore `Slide to seek` patch --- .../seekbar/EnableSlideToSeekPatch.kt | 64 +++++++++++++------ .../fingerprints/SlideToSeekFingerprint.kt | 16 +++-- 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt index 0a8b86bbe6..9d66d08921 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt @@ -3,6 +3,7 @@ package app.revanced.patches.youtube.interaction.seekbar import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstructions import app.revanced.patcher.extensions.InstructionExtensions.getInstruction +import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.CompatiblePackage import app.revanced.patcher.patch.annotation.Patch @@ -12,8 +13,13 @@ import app.revanced.patches.youtube.interaction.seekbar.fingerprints.DoubleSpeed import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SlideToSeekFingerprint import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.settings.SettingsPatch -import app.revanced.util.exception +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck +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.instruction.formats.Instruction35c +import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Patch( name = "Enable slide to seek", @@ -44,7 +50,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "19.14.43", "19.15.36", "19.16.39", - // 19.17.41 is the last version with the target code. + "19.25.37", + "19.34.42", ] ) ], @@ -66,26 +73,43 @@ 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 + // Restore the behaviour to slide to seek. + SlideToSeekFingerprint.resultOrThrow().let { + val checkIndex = it.scanResult.patternScanResult!!.startIndex + val checkReference = it.mutableMethod + .getInstruction(checkIndex).getReference()!!.toString() - it.mutableMethod.apply { - val isEnabledRegister = getInstruction(insertIndex).registerA + // 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) return@forEachIndexed - addInstructions( - insertIndex, - """ - invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSlideToSeekDisabled()Z - move-result v$isEnabledRegister - """ - ) + val reference = (instruction as Instruction35c).reference as MethodReference + if (reference.toString() != checkReference) return@forEachIndexed + + method.replaceInstruction(index, + "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSlideToSeekDisabled()Z " + ) + } + } + } + + // Disable the double speed seek notice. + // 19.17.41 is the last version with this code. + if (!YouTubeVersionCheck.is_19_17_or_greater) { + DoubleSpeedSeekNoticeFingerprint.resultOrThrow().let { + it.mutableMethod.apply { + val insertIndex = it.scanResult.patternScanResult!!.endIndex + 1 + val targetRegister = getInstruction(insertIndex).registerA + + addInstructions( + insertIndex, + """ + invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSlideToSeekDisabled()Z + move-result v$targetRegister + """ + ) + } } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SlideToSeekFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SlideToSeekFingerprint.kt index b618ea50f1..c3af701bfc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SlideToSeekFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SlideToSeekFingerprint.kt @@ -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 } ) \ No newline at end of file From b978994e5e705d22b5b03f10b58e09793c9f0775 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:27:28 -0400 Subject: [PATCH 055/143] fix(Change start page): Add limited support for 19.25+ --- .../layout/startpage/ChangeStartPagePatch.kt | 50 ++++++++--- .../fingerprints/StartActivityFingerprint.kt | 14 ++-- .../StartActivityLegacyFingerprint.kt | 14 ++++ .../StartActivityParentFingerprint.kt | 12 +++ .../util/patch/LiteralValueFingerprint.kt | 1 + .../resources/addresources/values/arrays.xml | 82 +++++++++++++++---- .../resources/addresources/values/strings.xml | 29 +++---- 7 files changed, 153 insertions(+), 49 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityLegacyFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityParentFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt index 1fe3385852..ead8b472b2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt @@ -2,20 +2,34 @@ package app.revanced.patches.youtube.layout.startpage import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +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.shared.misc.settings.preference.ListPreference import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityFingerprint +import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityLegacyFingerprint +import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityParentFingerprint 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.alsoResolve +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstructionReversed import app.revanced.util.resultOrThrow +import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Patch( name = "Change start page", description = "Adds an option to set which page the app opens in instead of the homepage.", - dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class], + dependencies = [ + IntegrationsPatch::class, + SettingsPatch::class, + AddResourcesPatch::class, + YouTubeVersionCheck::class + ], compatiblePackages = [ CompatiblePackage( "com.google.android.youtube", @@ -42,15 +56,14 @@ import app.revanced.util.resultOrThrow "19.15.36", "19.16.39", "19.25.37", - // 19.31.36 // Last version that works with this patch in it's current form. - // 19.32+ // Needs changes for this patch to work. + "19.34.42", ] ) ] ) @Suppress("unused") object ChangeStartPagePatch : BytecodePatch( - setOf(StartActivityFingerprint) + setOf(StartActivityLegacyFingerprint, StartActivityParentFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/ChangeStartPagePatch;" @@ -58,17 +71,34 @@ object ChangeStartPagePatch : BytecodePatch( override fun execute(context: BytecodeContext) { AddResourcesPatch(this::class) - StartActivityFingerprint.resultOrThrow().mutableMethod.addInstruction( - 0, - "invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeIntent(Landroid/content/Intent;)V" - ) - - // Add settings only after resolving, in case the user turns off version checks and is patching 19.32+ SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences( ListPreference( key = "revanced_start_page", + entriesKey = if (YouTubeVersionCheck.is_19_32_or_greater) "revanced_start_page_entries" + else "revanced_start_page_legacy_entries", + entryValuesKey = if (YouTubeVersionCheck.is_19_32_or_greater) "revanced_start_page_entry_values" + else "revanced_start_page_legacy_entry_values", summaryKey = null, ) ) + + if (YouTubeVersionCheck.is_19_32_or_greater) { + StartActivityFingerprint.alsoResolve(context, StartActivityParentFingerprint).mutableMethod.apply { + val index = indexOfFirstInstructionReversed { + getReference()?.name == "getIntent" + } + val register = getInstruction(index + 1).registerA + + addInstruction( + index + 2, + "invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeStartPage(Landroid/content/Intent;)V" + ) + } + } else { + StartActivityLegacyFingerprint.resultOrThrow().mutableMethod.addInstruction( + 0, + "invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeStartPageLegacy(Landroid/content/Intent;)V" + ) + } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt index c617b0d3b3..8249feba4d 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt @@ -1,18 +1,14 @@ package app.revanced.patches.youtube.layout.startpage.fingerprints -import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.AccessFlags +/** + * Resolves using class found in [StartActivityParentFingerprint]. + */ object StartActivityFingerprint : MethodFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, returnType = "V", - parameters = listOf("Landroid/content/Intent;"), + parameters = listOf("Landroid/os/Bundle;"), customFingerprint = { method, classDef -> - method.name == "startActivity" && - classDef.type.endsWith("/Shell_HomeActivity;") - // 19.32+ renamed the target class to "/Shell_UrlActivity;", - // but on app launch startActivity is no longer called so the start page is never changed. - // || classDef.type.endsWith("/Shell_UrlActivity;")) + method.name == "onCreate" } ) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityLegacyFingerprint.kt new file mode 100644 index 0000000000..085e66ad9d --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityLegacyFingerprint.kt @@ -0,0 +1,14 @@ +package app.revanced.patches.youtube.layout.startpage.fingerprints + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.AccessFlags + +internal object StartActivityLegacyFingerprint : MethodFingerprint( + accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, + returnType = "V", + parameters = listOf("Landroid/content/Intent;"), + customFingerprint = { method, classDef -> + method.name == "startActivity" && classDef.type.endsWith("/Shell_HomeActivity;") + } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityParentFingerprint.kt new file mode 100644 index 0000000000..c33ea35cf2 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityParentFingerprint.kt @@ -0,0 +1,12 @@ +package app.revanced.patches.youtube.layout.startpage.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.util.containsWideLiteralInstructionValue + +internal object StartActivityParentFingerprint : MethodFingerprint( + returnType = "Z", + parameters = listOf(), + customFingerprint = { method, _ -> + method.name == "isInMultiWindowMode" && method.containsWideLiteralInstructionValue(45372462L) + } +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/patch/LiteralValueFingerprint.kt b/src/main/kotlin/app/revanced/util/patch/LiteralValueFingerprint.kt index 6b1b67174e..db53978bcb 100644 --- a/src/main/kotlin/app/revanced/util/patch/LiteralValueFingerprint.kt +++ b/src/main/kotlin/app/revanced/util/patch/LiteralValueFingerprint.kt @@ -28,6 +28,7 @@ abstract class LiteralValueFingerprint( parameters = parameters, opcodes = opcodes, strings = strings, + // TODO: add a way for subclasses to also use their own custom fingerprint. customFingerprint = { methodDef, _ -> methodDef.containsWideLiteralInstructionValue(literalSupplier()) } diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index 44bdcd5892..c26349c131 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -46,30 +46,80 @@ - - @string/revanced_start_page_entry_0 - @string/revanced_start_page_entry_1 - @string/revanced_start_page_entry_2 - @string/revanced_start_page_entry_3 - @string/revanced_start_page_entry_4 - @string/revanced_start_page_entry_5 - @string/revanced_start_page_entry_6 - @string/revanced_start_page_entry_7 - @string/revanced_start_page_entry_8 - @string/revanced_start_page_entry_9 - - + - MAIN + open.search open.subscriptions open.explore - open.shorts + + + www.youtube.com/feed/library - www.youtube.com/playlist?list=LL + www.youtube.com/playlist?list=WL www.youtube.com/feed/history www.youtube.com/feed/trending + www.youtube.com/gaming + www.youtube.com/channel/UC4R8DWoMoI7CAwX8_LjQHig + www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ + www.youtube.com/feed/storefront?bp=ogUCKAI%3D + www.youtube.com/channel/UCEgdi0XIXXZ-qJOFPf4JSKw + www.youtube.com/feed/guide_builder + + + @string/revanced_change_start_page_entry_default + @string/revanced_change_start_page_entry_search + @string/revanced_change_start_page_entry_subscriptions + @string/revanced_change_start_page_entry_explore + @string/revanced_change_start_page_entry_library + @string/revanced_change_start_page_entry_liked_videos + @string/revanced_change_start_page_entry_watch_later + @string/revanced_change_start_page_entry_history + @string/revanced_change_start_page_entry_trending + @string/revanced_change_start_page_entry_gaming + @string/revanced_change_start_page_entry_live + @string/revanced_change_start_page_entry_music + @string/revanced_change_start_page_entry_movies + @string/revanced_change_start_page_entry_sports + @string/revanced_change_start_page_entry_browse + + + @string/revanced_change_start_page_entry_default + @string/revanced_change_start_page_entry_search + @string/revanced_change_start_page_entry_subscriptions + @string/revanced_change_start_page_entry_explore + + + + + + + + + + + + + + + + open.search + open.subscriptions + open.explore + + + + + + + + + + + + diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index 9be34395a4..8da7345054 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -950,20 +950,21 @@ This is because Crowdin requires temporarily flattening this file and removing t Set start page - Default - - Home - Search - - Subscriptions - Explore - Shorts - - You tab - Liked videos - - History - Trending + Default + Browse channels + Explore + Gaming + History + Library + Liked videos + Live + Movies + Music + Search + Sports + Subscriptions + Trending + Watch later Disable resuming Shorts player From 4a59a86e0ad28dc6e80ce655ea12ecd1ebdef5de Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 17 Sep 2024 00:25:43 -0400 Subject: [PATCH 056/143] unofficial support for 19.37.33 --- .../misc/navigation/NavigationBarHookPatch.kt | 12 ++++++++---- .../ActionBarSearchResultsFingerprint.kt | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/NavigationBarHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/NavigationBarHookPatch.kt index ae648899d5..03d19d6cb3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/NavigationBarHookPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/NavigationBarHookPatch.kt @@ -11,8 +11,10 @@ import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.navigation.fingerprints.* import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch +import app.revanced.util.alsoResolve import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow import app.revanced.util.resultOrThrow import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @@ -64,9 +66,7 @@ object NavigationBarHookPatch : BytecodePatch( } } - InitializeButtonsFingerprint.apply { - resolve(context, PivotBarConstructorFingerprint.resultOrThrow().classDef) - }.resultOrThrow().mutableMethod.apply { + InitializeButtonsFingerprint.alsoResolve(context, PivotBarConstructorFingerprint).mutableMethod.apply { // Hook the current navigation bar enum value. Note, the 'You' tab does not have an enum value. val navigationEnumClassName = NavigationEnumFingerprint.resultOrThrow().mutableClass.type addHook(Hook.SET_LAST_APP_NAVIGATION_ENUM) { @@ -121,7 +121,11 @@ object NavigationBarHookPatch : BytecodePatch( // Insert before the first ViewGroup method call after inflating, // so this works regardless which layout is used. ActionBarSearchResultsFingerprint.resultOrThrow().mutableMethod.apply { - val instructionIndex = indexOfFirstInstructionOrThrow { + val searchBarResourceId = indexOfFirstWideLiteralInstructionValueOrThrow( + NavigationBarHookResourcePatch.actionBarSearchResultsViewMicId + ) + + val instructionIndex = indexOfFirstInstructionOrThrow(searchBarResourceId) { opcode == Opcode.INVOKE_VIRTUAL && getReference()?.name == "setLayoutDirection" } diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/fingerprints/ActionBarSearchResultsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/fingerprints/ActionBarSearchResultsFingerprint.kt index 2ba8106f99..921047d50e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/fingerprints/ActionBarSearchResultsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/navigation/fingerprints/ActionBarSearchResultsFingerprint.kt @@ -8,6 +8,5 @@ import com.android.tools.smali.dexlib2.AccessFlags internal object ActionBarSearchResultsFingerprint : LiteralValueFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, returnType = "Landroid/view/View;", - parameters = listOf("Landroid/view/LayoutInflater;"), literalSupplier = { NavigationBarHookResourcePatch.actionBarSearchResultsViewMicId } ) \ No newline at end of file From f035dcc8350fafb38a25cc0268135057bf2ae590 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Tue, 17 Sep 2024 16:55:53 -0400 Subject: [PATCH 057/143] Adjust patch description --- .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt index 42e8cc587d..0b447c6fa9 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt @@ -71,7 +71,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter name = "Miniplayer", description = "Adds options to change the in app minimized player. " + "Patching target 19.16+ adds modern miniplayers. " + - "19.25 has drag and drop, and is the last version that can swipe to expand the miniplayer.", + "19.25 has drag and drop, and is the last version that can swipe to expand modern miniplayers.", dependencies = [ IntegrationsPatch::class, SettingsPatch::class, From 12f40b3dbc5c9972ed2d9248e07d9530f9861e0a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:32:53 -0400 Subject: [PATCH 058/143] fix(Change start page): Fix url start pages Code courtesy of: https://github.com/inotia00/revanced-patches/blob/37e00d462d657fc6def1ebea45f410f1a9f68248/src/main/kotlin/app/revanced/patches/youtube/general/startpage/ChangeStartPagePatch.kt --- .../layout/startpage/ChangeStartPagePatch.kt | 60 +++++++++---------- .../fingerprints/BrowseIdFingerprint.kt | 15 +++++ .../fingerprints/IntentActionFingerprint.kt | 8 +++ .../StartActivityLegacyFingerprint.kt | 14 ----- .../StartActivityParentFingerprint.kt | 12 ---- .../resources/addresources/values/arrays.xml | 46 +++++++------- .../resources/addresources/values/strings.xml | 2 +- 7 files changed, 76 insertions(+), 81 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/BrowseIdFingerprint.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/IntentActionFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityLegacyFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityParentFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt index ead8b472b2..5859328383 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt @@ -2,24 +2,23 @@ package app.revanced.patches.youtube.layout.startpage import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +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.shared.misc.settings.preference.ListPreference -import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityFingerprint -import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityLegacyFingerprint -import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityParentFingerprint +import app.revanced.patches.youtube.layout.startpage.fingerprints.BrowseIdFingerprint +import app.revanced.patches.youtube.layout.startpage.fingerprints.IntentActionFingerprint 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.alsoResolve import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstructionReversed +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 +import com.android.tools.smali.dexlib2.iface.reference.StringReference @Patch( name = "Change start page", @@ -27,8 +26,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference dependencies = [ IntegrationsPatch::class, SettingsPatch::class, - AddResourcesPatch::class, - YouTubeVersionCheck::class + AddResourcesPatch::class ], compatiblePackages = [ CompatiblePackage( @@ -63,7 +61,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference ) @Suppress("unused") object ChangeStartPagePatch : BytecodePatch( - setOf(StartActivityLegacyFingerprint, StartActivityParentFingerprint) + setOf(BrowseIdFingerprint, IntentActionFingerprint) ) { private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/ChangeStartPagePatch;" @@ -73,32 +71,32 @@ object ChangeStartPagePatch : BytecodePatch( SettingsPatch.PreferenceScreen.GENERAL_LAYOUT.addPreferences( ListPreference( - key = "revanced_start_page", - entriesKey = if (YouTubeVersionCheck.is_19_32_or_greater) "revanced_start_page_entries" - else "revanced_start_page_legacy_entries", - entryValuesKey = if (YouTubeVersionCheck.is_19_32_or_greater) "revanced_start_page_entry_values" - else "revanced_start_page_legacy_entry_values", + key = "revanced_change_start_page", summaryKey = null, ) ) - if (YouTubeVersionCheck.is_19_32_or_greater) { - StartActivityFingerprint.alsoResolve(context, StartActivityParentFingerprint).mutableMethod.apply { - val index = indexOfFirstInstructionReversed { - getReference()?.name == "getIntent" - } - val register = getInstruction(index + 1).registerA - - addInstruction( - index + 2, - "invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeStartPage(Landroid/content/Intent;)V" - ) + // Hook broseId. + BrowseIdFingerprint.resultOrThrow().mutableMethod.apply { + val browseIdIndex = indexOfFirstInstructionOrThrow { + opcode == Opcode.CONST_STRING && + getReference()?.string == "FEwhat_to_watch" } - } else { - StartActivityLegacyFingerprint.resultOrThrow().mutableMethod.addInstruction( - 0, - "invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->changeStartPageLegacy(Landroid/content/Intent;)V" + val browseIdRegister = getInstruction(browseIdIndex).registerA + + addInstructions( + browseIdIndex + 1, """ + invoke-static { v$browseIdRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideBrowseId(Ljava/lang/String;)Ljava/lang/String; + move-result-object v$browseIdRegister + """ ) } + + // There is no browserId assigned to Shorts and Search. + // Just hook the Intent action. + IntentActionFingerprint.resultOrThrow().mutableMethod.addInstruction( + 0, + "invoke-static { p1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->overrideIntentAction(Landroid/content/Intent;)V" + ) } -} +} \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/BrowseIdFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/BrowseIdFingerprint.kt new file mode 100644 index 0000000000..f3fc189f3e --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/BrowseIdFingerprint.kt @@ -0,0 +1,15 @@ +package app.revanced.patches.youtube.layout.startpage.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint +import com.android.tools.smali.dexlib2.Opcode + +internal object BrowseIdFingerprint : MethodFingerprint( + returnType = "Lcom/google/android/apps/youtube/app/common/ui/navigation/PaneDescriptor;", + parameters = listOf(), + opcodes = listOf( + Opcode.INVOKE_VIRTUAL, + Opcode.MOVE_RESULT_OBJECT, + Opcode.RETURN_OBJECT, + ), + strings = listOf("FEwhat_to_watch") +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/IntentActionFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/IntentActionFingerprint.kt new file mode 100644 index 0000000000..86c227c29e --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/IntentActionFingerprint.kt @@ -0,0 +1,8 @@ +package app.revanced.patches.youtube.layout.startpage.fingerprints + +import app.revanced.patcher.fingerprint.MethodFingerprint + +internal object IntentActionFingerprint : MethodFingerprint( + parameters = listOf("Landroid/content/Intent;"), + strings = listOf("has_handled_intent"), +) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityLegacyFingerprint.kt deleted file mode 100644 index 085e66ad9d..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityLegacyFingerprint.kt +++ /dev/null @@ -1,14 +0,0 @@ -package app.revanced.patches.youtube.layout.startpage.fingerprints - -import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.AccessFlags - -internal object StartActivityLegacyFingerprint : MethodFingerprint( - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - returnType = "V", - parameters = listOf("Landroid/content/Intent;"), - customFingerprint = { method, classDef -> - method.name == "startActivity" && classDef.type.endsWith("/Shell_HomeActivity;") - } -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityParentFingerprint.kt deleted file mode 100644 index c33ea35cf2..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityParentFingerprint.kt +++ /dev/null @@ -1,12 +0,0 @@ -package app.revanced.patches.youtube.layout.startpage.fingerprints - -import app.revanced.patcher.fingerprint.MethodFingerprint -import app.revanced.util.containsWideLiteralInstructionValue - -internal object StartActivityParentFingerprint : MethodFingerprint( - returnType = "Z", - parameters = listOf(), - customFingerprint = { method, _ -> - method.name == "isInMultiWindowMode" && method.containsWideLiteralInstructionValue(45372462L) - } -) \ No newline at end of file diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml index 206081c665..cb20ec486d 100644 --- a/src/main/resources/addresources/values/arrays.xml +++ b/src/main/resources/addresources/values/arrays.xml @@ -58,31 +58,10 @@ - - - - open.search - open.subscriptions - open.explore - - - - www.youtube.com/feed/library - www.youtube.com/playlist?list=LL - www.youtube.com/playlist?list=WL - www.youtube.com/feed/history - www.youtube.com/feed/trending - www.youtube.com/gaming - www.youtube.com/channel/UC4R8DWoMoI7CAwX8_LjQHig - www.youtube.com/channel/UC-9-kyTW8ZkZNDHQJ6FgpwQ - www.youtube.com/feed/storefront?bp=ogUCKAI%3D - www.youtube.com/channel/UCEgdi0XIXXZ-qJOFPf4JSKw - www.youtube.com/feed/guide_builder - - + @string/revanced_change_start_page_entry_default @string/revanced_change_start_page_entry_search + Shorts @string/revanced_change_start_page_entry_subscriptions @string/revanced_change_start_page_entry_explore @string/revanced_change_start_page_entry_library @@ -97,6 +76,27 @@ @string/revanced_change_start_page_entry_sports @string/revanced_change_start_page_entry_browse + + + ORIGINAL + + SEARCH + SHORTS + + SUBSCRIPTIONS + EXPLORE + LIBRARY + LIKED_VIDEO + WATCH_LATER + HISTORY + TRENDING + GAMING + LIVE + MUSIC + MOVIE + SPORTS + BROWSE + @string/revanced_change_start_page_entry_default @string/revanced_change_start_page_entry_search diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml index c499931851..c3c69d40c5 100644 --- a/src/main/resources/addresources/values/strings.xml +++ b/src/main/resources/addresources/values/strings.xml @@ -952,7 +952,7 @@ This is because Crowdin requires temporarily flattening this file and removing t 17.33.42 - Restore old UI layout - Set start page + Set start page Default Browse channels Explore From 61550248ddab486b4edd625d6756740cb33a1ef7 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 18 Sep 2024 16:29:10 -0400 Subject: [PATCH 059/143] fix(Hide Shorts components): Simplify fingerprints, use weak reference for navigation bar --- .../hide/shorts/HideShortsComponentsPatch.kt | 79 ++++++++----------- .../BottomNavigationBarFingerprint.kt | 10 --- .../BottomNavigationBarLegacyFingerprint.kt | 24 ------ 3 files changed, 31 insertions(+), 82 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarLegacyFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 43b409ba49..095f60e3ce 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -2,6 +2,7 @@ package app.revanced.patches.youtube.layout.hide.shorts import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +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 @@ -13,8 +14,10 @@ import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck +import app.revanced.util.alsoResolve import app.revanced.util.exception import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstructionOrThrow import app.revanced.util.indexOfIdResourceOrThrow import app.revanced.util.injectHideViewCall import app.revanced.util.resultOrThrow @@ -74,7 +77,6 @@ object HideShortsComponentsPatch : BytecodePatch( setOf( CreateShortsButtonsFingerprint, ReelConstructorFingerprint, - BottomNavigationBarLegacyFingerprint, BottomNavigationBarFingerprint, RenderBottomNavigationBarParentFingerprint, SetPivotBarVisibilityParentFingerprint, @@ -122,56 +124,37 @@ object HideShortsComponentsPatch : BytecodePatch( // region Hide the navigation bar. // Hook to get the pivotBar view. - SetPivotBarVisibilityParentFingerprint.result?.let { - if (!SetPivotBarVisibilityFingerprint.resolve(context, it.classDef)) { - throw SetPivotBarVisibilityFingerprint.exception - } - - SetPivotBarVisibilityFingerprint.result!!.let { result -> - result.mutableMethod.apply { - val insertIndex = result.scanResult.patternScanResult!!.endIndex - val viewRegister = getInstruction(insertIndex - 1).registerA - addInstruction( - insertIndex, - "sput-object v$viewRegister, $FILTER_CLASS_DESCRIPTOR->pivotBar:" + - "Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;", - ) - } + SetPivotBarVisibilityFingerprint.alsoResolve(context, SetPivotBarVisibilityParentFingerprint).let { result-> + result.mutableMethod.apply { + val insertIndex = result.scanResult.patternScanResult!!.endIndex + val viewRegister = getInstruction(insertIndex - 1).registerA + addInstruction(insertIndex, "invoke-static {v$viewRegister}," + + " $FILTER_CLASS_DESCRIPTOR->setNavigationBar(Lcom/google/android/libraries/youtube/rendering/ui/pivotbar/PivotBar;)V" + ) } - } ?: throw SetPivotBarVisibilityParentFingerprint.exception + } // Hook to hide the navigation bar when Shorts are being played. - RenderBottomNavigationBarParentFingerprint.result?.let { - if (!RenderBottomNavigationBarFingerprint.resolve(context, it.classDef)) { - throw RenderBottomNavigationBarFingerprint.exception - } - - RenderBottomNavigationBarFingerprint.result!!.mutableMethod.apply { - addInstruction(0, "invoke-static { }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar()V") - } - } ?: throw RenderBottomNavigationBarParentFingerprint.exception - - // Required to prevent a black bar from appearing at the bottom of the screen. - // BottomNavigationBar class deprecated on 19.29+. - val navbarFingerprint = - if (YouTubeVersionCheck.is_19_29_or_greater) { - BottomNavigationBarFingerprint - } else { - BottomNavigationBarLegacyFingerprint - } - - navbarFingerprint.resultOrThrow().let { - it.mutableMethod.apply { - val moveResultIndex = it.scanResult.patternScanResult!!.startIndex + 2 - val viewRegister = getInstruction(moveResultIndex).registerA - val insertIndex = moveResultIndex + 1 - - addInstruction( - insertIndex, - "invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->" + - "hideNavigationBar(Landroid/view/View;)Landroid/view/View;", - ) - } + RenderBottomNavigationBarFingerprint.alsoResolve( + context, + RenderBottomNavigationBarParentFingerprint + ).mutableMethod.addInstruction( + 0, + "invoke-static { }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar()V" + ) + + BottomNavigationBarFingerprint.resultOrThrow().mutableMethod.apply { + val targetIndex = indexOfFirstInstructionOrThrow { + getReference()?.name == "findViewById" + } + 1 + val viewRegister = getInstruction(targetIndex).registerA + + addInstructions( + targetIndex + 1, """ + invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar(Landroid/view/View;)Landroid/view/View; + move-result-object v$viewRegister + """ + ) } // endregion diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt index 3de8096c1b..08dd0a0294 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt @@ -3,21 +3,11 @@ package app.revanced.patches.youtube.layout.hide.shorts.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 BottomNavigationBarFingerprint : MethodFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"), - opcodes = listOf( - Opcode.CONST, // R.id.app_engagement_panel_wrapper - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - Opcode.IF_EQZ, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - ), strings = listOf( "r_pfvc" ), diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarLegacyFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarLegacyFingerprint.kt deleted file mode 100644 index 81b6860f1c..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarLegacyFingerprint.kt +++ /dev/null @@ -1,24 +0,0 @@ -package app.revanced.patches.youtube.layout.hide.shorts.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 BottomNavigationBarLegacyFingerprint : MethodFingerprint( - returnType = "V", - accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, - parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"), - opcodes = listOf( - Opcode.CONST, // R.id.app_engagement_panel_wrapper - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT_OBJECT, - Opcode.IF_EQZ, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, - ), - strings = listOf( - "ReelWatchPaneFragmentViewModelKey" - ), -) \ No newline at end of file From f05f8cb1cafa78326048b1e7e67f51bdf2ca599b Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:35:26 -0400 Subject: [PATCH 060/143] fix(Hide Shorts components): Fix nav bar hiding at wrong times --- .../youtube/layout/hide/shorts/HideShortsComponentsPatch.kt | 2 +- .../shorts/fingerprints/RenderBottomNavigationBarFingerprint.kt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 095f60e3ce..856856fb70 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -140,7 +140,7 @@ object HideShortsComponentsPatch : BytecodePatch( RenderBottomNavigationBarParentFingerprint ).mutableMethod.addInstruction( 0, - "invoke-static { }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar()V" + "invoke-static { p1 }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar(Ljava/lang/String;)V" ) BottomNavigationBarFingerprint.resultOrThrow().mutableMethod.apply { diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/RenderBottomNavigationBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/RenderBottomNavigationBarFingerprint.kt index d6d74b1e83..89a0ef942b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/RenderBottomNavigationBarFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/RenderBottomNavigationBarFingerprint.kt @@ -4,6 +4,8 @@ import app.revanced.patcher.fingerprint.MethodFingerprint import com.android.tools.smali.dexlib2.Opcode internal object RenderBottomNavigationBarFingerprint : MethodFingerprint( + returnType = "V", + parameters = listOf("Ljava/lang/String;"), opcodes = listOf( Opcode.IGET_OBJECT, Opcode.MONITOR_ENTER, From 02109499b750dfa7abdaf9f3c4b8c656d82f16f2 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 18 Sep 2024 21:18:28 -0400 Subject: [PATCH 061/143] fix(Hide Shorts components): Do not cut off Shorts seekbar if navbar is hidden --- .../hide/shorts/HideShortsComponentsPatch.kt | 21 ++++++++++--------- .../HideShortsComponentsResourcePatch.kt | 14 +++++-------- ...=> ShortsBottomBarContainerFingerprint.kt} | 6 ++++-- 3 files changed, 20 insertions(+), 21 deletions(-) rename src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/{BottomNavigationBarFingerprint.kt => ShortsBottomBarContainerFingerprint.kt} (54%) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index 856856fb70..ffb9730ebd 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -2,7 +2,6 @@ package app.revanced.patches.youtube.layout.hide.shorts import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -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 @@ -18,6 +17,7 @@ import app.revanced.util.alsoResolve import app.revanced.util.exception import app.revanced.util.getReference import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfFirstWideLiteralInstructionValue import app.revanced.util.indexOfIdResourceOrThrow import app.revanced.util.injectHideViewCall import app.revanced.util.resultOrThrow @@ -77,7 +77,7 @@ object HideShortsComponentsPatch : BytecodePatch( setOf( CreateShortsButtonsFingerprint, ReelConstructorFingerprint, - BottomNavigationBarFingerprint, + ShortsBottomBarContainerFingerprint, RenderBottomNavigationBarParentFingerprint, SetPivotBarVisibilityParentFingerprint, ), @@ -134,7 +134,7 @@ object HideShortsComponentsPatch : BytecodePatch( } } - // Hook to hide the navigation bar when Shorts are being played. + // Hook to hide the shared navigation bar when the Shorts player is opened. RenderBottomNavigationBarFingerprint.alsoResolve( context, RenderBottomNavigationBarParentFingerprint @@ -143,17 +143,18 @@ object HideShortsComponentsPatch : BytecodePatch( "invoke-static { p1 }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar(Ljava/lang/String;)V" ) - BottomNavigationBarFingerprint.resultOrThrow().mutableMethod.apply { - val targetIndex = indexOfFirstInstructionOrThrow { + // Hide the bottom bar container of the Shorts player. + ShortsBottomBarContainerFingerprint.resultOrThrow().mutableMethod.apply { + val resourceIndex = indexOfFirstWideLiteralInstructionValue(HideShortsComponentsResourcePatch.bottomBarContainer) + + val targetIndex = indexOfFirstInstructionOrThrow(resourceIndex) { getReference()?.name == "findViewById" } + 1 + val viewRegister = getInstruction(targetIndex).registerA - addInstructions( - targetIndex + 1, """ - invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar(Landroid/view/View;)Landroid/view/View; - move-result-object v$viewRegister - """ + addInstruction(targetIndex + 1, "invoke-static { v$viewRegister }," + + " $FILTER_CLASS_DESCRIPTOR->setBottomBarContainerSize(Landroid/view/View;)V" ) } 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 67bd46b554..1372be7136 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 @@ -12,6 +12,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch object HideShortsComponentsResourcePatch : ResourcePatch() { internal var reelMultipleItemShelfId = -1L internal var reelPlayerRightCellButtonHeight = -1L + internal var bottomBarContainer = -1L override fun execute(context: ResourceContext) { AddResourcesPatch(this::class) @@ -57,14 +58,9 @@ object HideShortsComponentsResourcePatch : ResourcePatch() { "reel_player_right_cell_button_height", ] - // Resource not present in new versions of the app. - try { - ResourceMappingPatch[ - "dimen", - "reel_player_right_cell_button_height", - ] - } catch (e: NoSuchElementException) { - return - }.also { reelPlayerRightCellButtonHeight = it } + bottomBarContainer = ResourceMappingPatch[ + "id", + "bottom_bar_container" + ] } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsBottomBarContainerFingerprint.kt similarity index 54% rename from src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsBottomBarContainerFingerprint.kt index 08dd0a0294..ca9fadf590 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/BottomNavigationBarFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsBottomBarContainerFingerprint.kt @@ -1,14 +1,16 @@ package app.revanced.patches.youtube.layout.hide.shorts.fingerprints import app.revanced.patcher.extensions.or -import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patches.youtube.layout.hide.shorts.HideShortsComponentsResourcePatch +import app.revanced.util.patch.LiteralValueFingerprint import com.android.tools.smali.dexlib2.AccessFlags -internal object BottomNavigationBarFingerprint : MethodFingerprint( +internal object ShortsBottomBarContainerFingerprint : LiteralValueFingerprint( returnType = "V", accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("Landroid/view/View;", "Landroid/os/Bundle;"), strings = listOf( "r_pfvc" ), + literalSupplier = { HideShortsComponentsResourcePatch.bottomBarContainer } ) \ No newline at end of file From c32c2b6caddbc76e8ff55562d979f551ecf03c1d Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Wed, 18 Sep 2024 21:26:59 -0400 Subject: [PATCH 062/143] revert fix(Hide Shorts components). Cannot set a height otherwise if comment button is pressed the navbar becomes permanently too short. --- .../layout/hide/shorts/HideShortsComponentsPatch.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index ffb9730ebd..afa9efdaae 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -2,6 +2,7 @@ package app.revanced.patches.youtube.layout.hide.shorts import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +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 @@ -153,8 +154,11 @@ object HideShortsComponentsPatch : BytecodePatch( val viewRegister = getInstruction(targetIndex).registerA - addInstruction(targetIndex + 1, "invoke-static { v$viewRegister }," + - " $FILTER_CLASS_DESCRIPTOR->setBottomBarContainerSize(Landroid/view/View;)V" + addInstructions( + targetIndex + 1, """ + invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar(Landroid/view/View;)Landroid/view/View; + move-result-object v$viewRegister + """ ) } From 4b1cbf1a2a061d4be59af748c2628b89d1520a1f Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:10:45 -0400 Subject: [PATCH 063/143] fix(Hide Shorts components): If hiding the the nav bar, then use padding between seekbar and bottom of screen --- .../hide/shorts/HideShortsComponentsPatch.kt | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index afa9efdaae..e9d58f74f3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -149,16 +149,15 @@ object HideShortsComponentsPatch : BytecodePatch( val resourceIndex = indexOfFirstWideLiteralInstructionValue(HideShortsComponentsResourcePatch.bottomBarContainer) val targetIndex = indexOfFirstInstructionOrThrow(resourceIndex) { - getReference()?.name == "findViewById" + getReference()?.name == "getHeight" } + 1 - val viewRegister = getInstruction(targetIndex).registerA + val heightRegister = getInstruction(targetIndex).registerA - addInstructions( - targetIndex + 1, """ - invoke-static { v$viewRegister }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar(Landroid/view/View;)Landroid/view/View; - move-result-object v$viewRegister - """ + addInstructions(targetIndex + 1, """ + invoke-static { v$heightRegister }, $FILTER_CLASS_DESCRIPTOR->getNavigationBarHeight(I)I + move-result v$heightRegister + """ ) } @@ -175,14 +174,12 @@ object HideShortsComponentsPatch : BytecodePatch( fun injectHideCall(method: MutableMethod) { val referencedIndex = method.indexOfIdResourceOrThrow(resourceName) - val instruction = method.implementation!!.instructions - .subList(referencedIndex, referencedIndex + 20) - .first { - it.opcode == Opcode.INVOKE_VIRTUAL && it.getReference()?.name == "setId" - } + val setIdIndex = method.indexOfFirstInstructionOrThrow(referencedIndex) { + opcode == Opcode.INVOKE_VIRTUAL && getReference()?.name == "setId" + } - val setIdIndex = instruction.location.index val viewRegister = method.getInstruction(setIdIndex).registerC + method.injectHideViewCall(setIdIndex + 1, viewRegister, FILTER_CLASS_DESCRIPTOR, methodName) } } From b1edc0cbdfc5b47c09a1c8d222fad5e87fd050dc Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:47:52 -0400 Subject: [PATCH 064/143] fix(Hide Shorts components): Also hide empty space if sound button is hidden --- .../hide/shorts/HideShortsComponentsPatch.kt | 19 +++++++++++++++++++ .../HideShortsComponentsResourcePatch.kt | 6 ++++++ .../ShortsSoundButtonSizeFingerprint.kt | 8 ++++++++ 3 files changed, 33 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsSoundButtonSizeFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index e9d58f74f3..c64924ea54 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -81,6 +81,7 @@ object HideShortsComponentsPatch : BytecodePatch( ShortsBottomBarContainerFingerprint, RenderBottomNavigationBarParentFingerprint, SetPivotBarVisibilityParentFingerprint, + ShortsSoundButtonSizeFingerprint ), ) { private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/components/ShortsFilter;" @@ -120,6 +121,24 @@ object HideShortsComponentsPatch : BytecodePatch( LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR) + ShortsSoundButtonSizeFingerprint.resultOrThrow().mutableMethod.apply { + val resourceIndex = indexOfFirstWideLiteralInstructionValue( + HideShortsComponentsResourcePatch.reelPlayerRightPivotV2Size + ) + + val targetIndex = indexOfFirstInstructionOrThrow(resourceIndex) { + getReference()?.name == "getDimensionPixelSize" + } + 1 + + val sizeRegister = getInstruction(targetIndex).registerA + + addInstructions(targetIndex + 1, """ + invoke-static { v$sizeRegister }, $FILTER_CLASS_DESCRIPTOR->getSoundButtonSize(I)I + move-result v$sizeRegister + """ + ) + } + // endregion // region Hide the navigation bar. 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 1372be7136..7fe7b08c70 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 @@ -13,6 +13,7 @@ object HideShortsComponentsResourcePatch : ResourcePatch() { internal var reelMultipleItemShelfId = -1L internal var reelPlayerRightCellButtonHeight = -1L internal var bottomBarContainer = -1L + internal var reelPlayerRightPivotV2Size = -1L override fun execute(context: ResourceContext) { AddResourcesPatch(this::class) @@ -62,5 +63,10 @@ object HideShortsComponentsResourcePatch : ResourcePatch() { "id", "bottom_bar_container" ] + + reelPlayerRightPivotV2Size = ResourceMappingPatch[ + "dimen", + "reel_player_right_pivot_v2_size" + ] } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsSoundButtonSizeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsSoundButtonSizeFingerprint.kt new file mode 100644 index 0000000000..79b09fa1f6 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsSoundButtonSizeFingerprint.kt @@ -0,0 +1,8 @@ +package app.revanced.patches.youtube.layout.hide.shorts.fingerprints + +import app.revanced.patches.youtube.layout.hide.shorts.HideShortsComponentsResourcePatch +import app.revanced.util.patch.LiteralValueFingerprint + +internal object ShortsSoundButtonSizeFingerprint : LiteralValueFingerprint( + literalSupplier = { HideShortsComponentsResourcePatch.reelPlayerRightPivotV2Size } +) \ No newline at end of file From cd49a13bf859d0cd78996fa8f747195d48ec02bb Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 20 Sep 2024 02:00:08 -0400 Subject: [PATCH 065/143] fix VideoIdPatch with older targets --- .../copyvideourl/CopyVideoUrlBytecodePatch.kt | 5 ++ .../interaction/downloads/DownloadsPatch.kt | 5 ++ .../layout/searchbar/WideSearchbarPatch.kt | 1 + .../sponsorblock/SponsorBlockBytecodePatch.kt | 4 ++ .../BackgroundPlaybackPatch.kt | 5 ++ .../youtube/misc/gms/GmsCoreSupportPatch.kt | 4 +- .../quality/RememberVideoQualityPatch.kt | 5 ++ .../youtube/video/speed/PlaybackSpeedPatch.kt | 5 ++ .../youtube/video/videoid/VideoIdPatch.kt | 59 +++++++++---------- .../VideoIdBackgroundPlayFingerprint.kt | 30 ++++++++++ .../videoid/fingerprint/VideoIdFingerprint.kt | 10 ++-- .../VideoIdFingerprintBackgroundPlay.kt | 19 ------ .../fingerprint/VideoIdParentFingerprint.kt | 9 +++ 13 files changed, 105 insertions(+), 56 deletions(-) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprintBackgroundPlay.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt index 0013433a74..d448dc1c38 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt @@ -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", diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt index b7d4ffb229..3df7ba58bb 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt @@ -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", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt index 785b53cb2d..6be7171519 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt @@ -28,6 +28,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction "18.37.36", "18.38.44", "18.43.45", + // 18.44.41 // Does not resolve. "18.45.43", "18.48.39", "18.49.37", diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt index 07293d4de1..d59854a543 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt @@ -46,6 +46,10 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference CompatiblePackage( "com.google.android.youtube", [ + "18.38.44", + "18.43.45", + "18.44.41", + "18.45.43", "18.48.39", "18.49.37", "19.01.34", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt index 2fa0f067dd..7ac7fe7d2b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt @@ -37,6 +37,11 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference 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", diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt index aecd302d82..581b950466 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt @@ -3,7 +3,7 @@ package app.revanced.patches.youtube.misc.gms import app.revanced.patches.shared.fingerprints.CastContextFetchFingerprint import app.revanced.patches.shared.misc.gms.BaseGmsCoreSupportPatch import app.revanced.patches.youtube.layout.buttons.cast.HideCastButtonPatch -import app.revanced.patches.youtube.misc.fix.playback.SpoofClientPatch +import app.revanced.patches.youtube.misc.fix.playback.SpoofVideoStreamsPatch import app.revanced.patches.youtube.misc.gms.Constants.REVANCED_YOUTUBE_PACKAGE_NAME import app.revanced.patches.youtube.misc.gms.Constants.YOUTUBE_PACKAGE_NAME import app.revanced.patches.youtube.misc.gms.GmsCoreSupportResourcePatch.gmsCoreVendorGroupIdOption @@ -25,7 +25,7 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch( integrationsPatchDependency = IntegrationsPatch::class, dependencies = setOf( HideCastButtonPatch::class, - SpoofClientPatch::class, + SpoofVideoStreamsPatch::class, ), gmsCoreSupportResourcePatch = GmsCoreSupportResourcePatch, compatiblePackages = setOf( diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt index 448227c83f..c41bd7201e 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt @@ -35,6 +35,11 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference compatiblePackages = [ 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", diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt index 42aa340349..5885c84925 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt @@ -21,6 +21,11 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa 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", diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt index efe99d7afd..572800528f 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt @@ -3,26 +3,32 @@ package app.revanced.patches.youtube.video.videoid import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstruction -import app.revanced.patcher.fingerprint.MethodFingerprint import app.revanced.patcher.patch.BytecodePatch import app.revanced.patcher.patch.annotation.Patch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch +import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdBackgroundPlayFingerprint import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprint -import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprintBackgroundPlay -import app.revanced.util.exception +import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdParentFingerprint +import app.revanced.util.alsoResolve +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstruction +import app.revanced.util.resultOrThrow +import com.android.tools.smali.dexlib2.iface.Method import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction +import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Patch( description = "Hooks to detect when the video id changes", - dependencies = [IntegrationsPatch::class, PlayerResponseMethodHookPatch::class], + dependencies = [IntegrationsPatch::class, PlayerResponseMethodHookPatch::class, YouTubeVersionCheck::class], ) object VideoIdPatch : BytecodePatch( setOf( - VideoIdFingerprint, - VideoIdFingerprintBackgroundPlay + VideoIdParentFingerprint, + VideoIdBackgroundPlayFingerprint, ) ) { private var videoIdRegister = 0 @@ -35,35 +41,28 @@ object VideoIdPatch : BytecodePatch( override fun execute(context: BytecodeContext) { - /** - * Supplies the method and register index of the video id register. - * - * @param consumer Consumer that receives the method, insert index and video id register index. - */ - fun MethodFingerprint.setFields(consumer: (MutableMethod, Int, Int) -> Unit) = result?.let { result -> - val videoIdRegisterIndex = result.scanResult.patternScanResult!!.endIndex - - result.mutableMethod.let { - val videoIdRegister = it.getInstruction(videoIdRegisterIndex).registerA - val insertIndex = videoIdRegisterIndex + 1 - consumer(it, insertIndex, videoIdRegister) - - } - } ?: throw exception - - VideoIdFingerprint.setFields { method, index, register -> - videoIdMethod = method - videoIdInsertIndex = index - videoIdRegister = register + VideoIdFingerprint.alsoResolve(context, VideoIdParentFingerprint).mutableMethod.apply { + videoIdMethod = this + val index = indexOfPlayerResponseModelString() + videoIdRegister = getInstruction(index + 1).registerA + videoIdInsertIndex = index + 2 } - VideoIdFingerprintBackgroundPlay.setFields { method, insertIndex, videoIdRegister -> - backgroundPlaybackMethod = method - backgroundPlaybackInsertIndex = insertIndex - backgroundPlaybackVideoIdRegister = videoIdRegister + VideoIdBackgroundPlayFingerprint.resultOrThrow().mutableMethod.apply { + backgroundPlaybackMethod = this + val index = indexOfPlayerResponseModelString() + backgroundPlaybackVideoIdRegister = getInstruction(index + 1).registerA + backgroundPlaybackInsertIndex = index + 2 } } + internal fun Method.indexOfPlayerResponseModelString() = + indexOfFirstInstruction { + val reference = getReference() + reference?.definingClass == "Lcom/google/android/libraries/youtube/innertube/model/player/PlayerResponseModel;" && + reference.returnType == "Ljava/lang/String;" + } + /** * Hooks the new video id when the video changes. * diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt new file mode 100644 index 0000000000..857912716c --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt @@ -0,0 +1,30 @@ +package app.revanced.patches.youtube.video.videoid.fingerprint + +import app.revanced.patcher.extensions.or +import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patches.youtube.video.videoid.VideoIdPatch.indexOfPlayerResponseModelString +import com.android.tools.smali.dexlib2.AccessFlags +import com.android.tools.smali.dexlib2.Opcode + +internal object VideoIdBackgroundPlayFingerprint : MethodFingerprint( + returnType = "V", + parameters = listOf("L"), + opcodes = listOf( + Opcode.IF_EQZ, + Opcode.INVOKE_INTERFACE, + Opcode.MOVE_RESULT_OBJECT, + Opcode.IPUT_OBJECT, + Opcode.MONITOR_EXIT, + Opcode.RETURN_VOID, + Opcode.MONITOR_EXIT, + Opcode.RETURN_VOID + ), + customFingerprint = { methodDef, classDef -> + // Access flags changed in 19.36 + (methodDef.accessFlags == (AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.DECLARED_SYNCHRONIZED) || + methodDef.accessFlags == (AccessFlags.FINAL or AccessFlags.DECLARED_SYNCHRONIZED)) && + classDef.methods.count() == 17 && + methodDef.implementation != null && + methodDef.indexOfPlayerResponseModelString() >= 0 + } +) diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprint.kt index a01b2ebdcc..cb032b18e7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprint.kt @@ -2,6 +2,7 @@ package app.revanced.patches.youtube.video.videoid.fingerprint import app.revanced.patcher.extensions.or import app.revanced.patcher.fingerprint.MethodFingerprint +import app.revanced.patches.youtube.video.videoid.VideoIdPatch.indexOfPlayerResponseModelString import com.android.tools.smali.dexlib2.AccessFlags import com.android.tools.smali.dexlib2.Opcode @@ -10,13 +11,12 @@ internal object VideoIdFingerprint : MethodFingerprint( accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, parameters = listOf("L"), opcodes = listOf( - Opcode.MOVE_RESULT_OBJECT, - Opcode.IF_EQZ, - Opcode.IGET_OBJECT, - Opcode.IGET_OBJECT, Opcode.INVOKE_INTERFACE, Opcode.MOVE_RESULT_OBJECT, Opcode.INVOKE_INTERFACE, Opcode.MOVE_RESULT_OBJECT, - ) + ), + customFingerprint = { methodDef, _ -> + methodDef.indexOfPlayerResponseModelString() >= 0 + } ) diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprintBackgroundPlay.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprintBackgroundPlay.kt deleted file mode 100644 index 5379272c6f..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdFingerprintBackgroundPlay.kt +++ /dev/null @@ -1,19 +0,0 @@ -package app.revanced.patches.youtube.video.videoid.fingerprint - -import app.revanced.patcher.fingerprint.MethodFingerprint -import com.android.tools.smali.dexlib2.Opcode - -internal object VideoIdFingerprintBackgroundPlay : MethodFingerprint( - returnType = "V", - // accessFlags are "public final synchronized", or "(package protected) final synchronized" - parameters = listOf("L"), - opcodes = listOf( - Opcode.INVOKE_VIRTUAL, - Opcode.MOVE_RESULT, - Opcode.IF_EQZ, - Opcode.IGET_OBJECT, - Opcode.IF_EQZ, - Opcode.INVOKE_INTERFACE, - Opcode.MOVE_RESULT_OBJECT, - ), -) diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt new file mode 100644 index 0000000000..2063659b7c --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt @@ -0,0 +1,9 @@ +package app.revanced.patches.youtube.video.videoid.fingerprint + +import app.revanced.patcher.fingerprint.MethodFingerprint + +internal object VideoIdParentFingerprint : MethodFingerprint( + returnType = "V", + parameters = listOf("Ljava/lang/Object;", "Ljava/lang/Exception;"), + strings = listOf("error retrieving subtitle"), +) \ No newline at end of file From 5a0d2b3e999f2ab36e0eb429ab136082e20c9f3e Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 20 Sep 2024 03:05:16 -0400 Subject: [PATCH 066/143] fix: Add version declaration --- .../patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt index 828b54784e..ec2d491bd2 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt @@ -72,6 +72,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter "19.14.43", "19.15.36", "19.16.39", + "19.25.37", + "19.34.42", ], ), ], From ca9e9f9d686f0be642730ff25d60b3ec443ae8d5 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 20 Sep 2024 03:07:16 -0400 Subject: [PATCH 067/143] fix(Hide Shorts components): Hide sound button in older versions --- api/revanced-patches.api | 1 + .../hide/shorts/HideShortsComponentsPatch.kt | 13 ++++++------ .../HideShortsComponentsResourcePatch.kt | 17 +++++++++++++++- .../ShortsSoundButtonSizeFingerprint.kt | 8 -------- .../kotlin/app/revanced/util/BytecodeUtils.kt | 20 +++++++++++++++++++ 5 files changed, 43 insertions(+), 16 deletions(-) delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsSoundButtonSizeFingerprint.kt diff --git a/api/revanced-patches.api b/api/revanced-patches.api index 932eb3ac2d..afb2dba517 100644 --- a/api/revanced-patches.api +++ b/api/revanced-patches.api @@ -2167,6 +2167,7 @@ public final class app/revanced/util/BytecodeUtilsKt { 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 diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt index c64924ea54..33ba3b6ec3 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt @@ -14,6 +14,7 @@ import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck +import app.revanced.util.forEachLiteralValueInstruction import app.revanced.util.alsoResolve import app.revanced.util.exception import app.revanced.util.getReference @@ -81,7 +82,6 @@ object HideShortsComponentsPatch : BytecodePatch( ShortsBottomBarContainerFingerprint, RenderBottomNavigationBarParentFingerprint, SetPivotBarVisibilityParentFingerprint, - ShortsSoundButtonSizeFingerprint ), ) { private const val FILTER_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/components/ShortsFilter;" @@ -121,12 +121,10 @@ object HideShortsComponentsPatch : BytecodePatch( LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR) - ShortsSoundButtonSizeFingerprint.resultOrThrow().mutableMethod.apply { - val resourceIndex = indexOfFirstWideLiteralInstructionValue( - HideShortsComponentsResourcePatch.reelPlayerRightPivotV2Size - ) - - val targetIndex = indexOfFirstInstructionOrThrow(resourceIndex) { + context.forEachLiteralValueInstruction( + HideShortsComponentsResourcePatch.reelPlayerRightPivotV2Size, + ) { literalInstructionIndex -> + val targetIndex = indexOfFirstInstructionOrThrow(literalInstructionIndex) { getReference()?.name == "getDimensionPixelSize" } + 1 @@ -139,6 +137,7 @@ object HideShortsComponentsPatch : BytecodePatch( ) } + // endregion // region Hide the navigation bar. 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 7fe7b08c70..b56bc29cf8 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 @@ -6,9 +6,17 @@ 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.SwitchPreference +import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck import app.revanced.patches.youtube.misc.settings.SettingsPatch -@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class, AddResourcesPatch::class]) +@Patch( + dependencies = [ + SettingsPatch::class, + ResourceMappingPatch::class, + AddResourcesPatch::class, + YouTubeVersionCheck::class + ] +) object HideShortsComponentsResourcePatch : ResourcePatch() { internal var reelMultipleItemShelfId = -1L internal var reelPlayerRightCellButtonHeight = -1L @@ -68,5 +76,12 @@ object HideShortsComponentsResourcePatch : ResourcePatch() { "dimen", "reel_player_right_pivot_v2_size" ] + + if (!YouTubeVersionCheck.is_19_03_or_greater) { + reelMultipleItemShelfId = ResourceMappingPatch[ + "dimen", + "reel_player_right_cell_button_height", + ] + } } } diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsSoundButtonSizeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsSoundButtonSizeFingerprint.kt deleted file mode 100644 index 79b09fa1f6..0000000000 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/ShortsSoundButtonSizeFingerprint.kt +++ /dev/null @@ -1,8 +0,0 @@ -package app.revanced.patches.youtube.layout.hide.shorts.fingerprints - -import app.revanced.patches.youtube.layout.hide.shorts.HideShortsComponentsResourcePatch -import app.revanced.util.patch.LiteralValueFingerprint - -internal object ShortsSoundButtonSizeFingerprint : LiteralValueFingerprint( - literalSupplier = { HideShortsComponentsResourcePatch.reelPlayerRightPivotV2Size } -) \ No newline at end of file diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index 1390da513e..b2baf478e1 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -306,6 +306,26 @@ fun Method.findOpcodeIndicesReversed(filter: Instruction.() -> Boolean): List Unit, +) { + classes.forEach { classDef -> + classDef.methods.forEach { method -> + method.implementation?.instructions?.forEachIndexed { index, instruction -> + if (instruction.opcode == Opcode.CONST && + (instruction as WideLiteralInstruction).wideLiteral == literal + ) { + val mutableMethod = proxy(classDef).mutableClass.findMutableMethodOf(method) + block.invoke(mutableMethod, index) + } + } + } + } +} /** * Return the resolved method early. From 0e42bf4ec5912f4f2b3b3da904f87d1a414612b3 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:41:17 -0400 Subject: [PATCH 068/143] fix: Use reverse order to handle if the same literal is in a method twice --- src/main/kotlin/app/revanced/util/BytecodeUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index b2baf478e1..247f26c938 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -315,7 +315,7 @@ fun BytecodeContext.forEachLiteralValueInstruction( ) { classes.forEach { classDef -> classDef.methods.forEach { method -> - method.implementation?.instructions?.forEachIndexed { index, instruction -> + method.implementation?.instructions?.reversed()?.forEachIndexed { index, instruction -> if (instruction.opcode == Opcode.CONST && (instruction as WideLiteralInstruction).wideLiteral == literal ) { From 5ebf61c3b4bc54739c2aee0ad76bd95f68b12ff0 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:03:54 -0400 Subject: [PATCH 069/143] revert fix: Use reverse order to handle if the same literal is in a method twice. This breaks some patches. Can handle a literal more than once in a method when it happens --- src/main/kotlin/app/revanced/util/BytecodeUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt index 247f26c938..b2baf478e1 100644 --- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt +++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt @@ -315,7 +315,7 @@ fun BytecodeContext.forEachLiteralValueInstruction( ) { classes.forEach { classDef -> classDef.methods.forEach { method -> - method.implementation?.instructions?.reversed()?.forEachIndexed { index, instruction -> + method.implementation?.instructions?.forEachIndexed { index, instruction -> if (instruction.opcode == Opcode.CONST && (instruction as WideLiteralInstruction).wideLiteral == literal ) { From 4371a7249aa03f8856c73f1ca4e08e63e587ffba Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:56:35 -0400 Subject: [PATCH 070/143] Work in progress, all code from 19.16 seems to be applied, but at least 1 more change is needed. --- .../RestoreOldSeekbarThumbnailsPatch.kt | 127 ++++++++++++++++-- 1 file changed, 116 insertions(+), 11 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt index 9d45b0ca8b..1e6f527672 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt @@ -2,9 +2,12 @@ package app.revanced.patches.youtube.layout.seekbar import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels +import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions +import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction +import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions 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 @@ -13,7 +16,14 @@ import app.revanced.patches.youtube.layout.seekbar.fingerprints.FullscreenSeekba 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.findOpcodeIndicesReversed +import app.revanced.util.getReference +import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow +import app.revanced.util.resultOrThrow +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction +import com.android.tools.smali.dexlib2.iface.reference.MethodReference @Patch( name = "Restore old seekbar thumbnails", @@ -44,8 +54,8 @@ import app.revanced.util.exception "19.13.37", "19.14.43", "19.15.36", - "19.16.39" - // 19.17+ is not supported. + "19.16.39", + "19.34.42", ] ) ] @@ -58,24 +68,119 @@ object RestoreOldSeekbarThumbnailsPatch : BytecodePatch( "Lapp/revanced/integrations/youtube/patches/RestoreOldSeekbarThumbnailsPatch;" override fun execute(context: BytecodeContext) { - if (YouTubeVersionCheck.is_19_17_or_greater) { - // Give a more informative error, if the user has turned off version checks. - throw PatchException("'Restore old seekbar thumbnails' cannot be patched to any version after 19.16.39") - } - AddResourcesPatch(this::class) SettingsPatch.PreferenceScreen.SEEKBAR.addPreferences( SwitchPreference("revanced_restore_old_seekbar_thumbnails") ) - FullscreenSeekbarThumbnailsFingerprint.result?.mutableMethod?.apply { + if (false) FullscreenSeekbarThumbnailsFingerprint.resultOrThrow().mutableMethod.apply { val moveResultIndex = getInstructions().lastIndex - 1 addInstruction( moveResultIndex, "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z" ) - } ?: throw FullscreenSeekbarThumbnailsFingerprint.exception + } + + context.proxy(context.classes.first { it.type == "Laaxp;" }).mutableClass.methods + .find { it.name == "bX" }!!.apply { + val index = indexOfFirstWideLiteralInstructionValueOrThrow(45611695L) + val insertIndex = + indexOfFirstInstructionOrThrow(index) { opcode == Opcode.MOVE_RESULT } + + addInstruction( + insertIndex, + "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z" + ) + } + + + context.proxy(context.classes.first { it.type == "Lfwa;" }).mutableClass.methods + .find { it.name == "N" }!!.apply { + val index = indexOfFirstWideLiteralInstructionValueOrThrow(45367320L) + val insertIndex = + indexOfFirstInstructionOrThrow(index) { opcode == Opcode.MOVE_RESULT } + + addInstruction( + insertIndex, + "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z" + ) + } + + context.proxy(context.classes.first { it.type == "Lkrx;" }).mutableClass.methods + .find { it.name == "mF" }!!.apply { + val index = indexOfFirstInstructionOrThrow{ opcode == Opcode.INVOKE_VIRTUAL && getReference()?.name == "mF" } + + removeInstructions(index, getInstructions().size - index - 1) + } + + context.proxy(context.classes.first { it.type == "Lkvm;" }).mutableClass.methods + .find { it.name == "ab" }!!.apply { + val index = indexOfFirstInstructionOrThrow{ + val reference = getReference() + opcode == Opcode.INVOKE_VIRTUAL && reference?.definingClass == "Lkzh;" && reference.name == "l" + } + + removeInstruction(index) + } + + context.proxy(context.classes.first { it.type == "Lbbfq;" }).mutableClass.methods + .find { it.name == "dx" }!!.apply { + val insertIndex = + indexOfFirstInstructionOrThrow { opcode == Opcode.MOVE_RESULT } + + addInstruction( + insertIndex, + "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z" + ) + } + + context.proxy(context.classes.first { it.type == "Lkvk;" }).mutableClass.methods + .find { it.name == "mF" }!!.apply { + findOpcodeIndicesReversed { + val reference = getReference() + opcode == Opcode.INVOKE_VIRTUAL && reference?.definingClass == "Lkzh;" && reference.name == "mF" + }.forEach { index -> + val instruction = getInstruction(index) + val free = instruction.registerC + + addInstructionsWithLabels(index + 1, """ + move-object/from16 v$free, p0 + iget-object v$free, v$free, Lkvk;->b:Lkvm; + invoke-virtual { v$free }, Lkvm;->F()V # Inflate layout + iget-object v$free, v$free, Lkvm;->s:Lkvx; + iget-object v$free, v$free, Lgym;->d:Lahhj; + # + # FIXME: this field is always null. Something else needs to be set for this to work. + # + if-eqz v$free, :is_null + + invoke-virtual { v$free }, Lahhj;->j()Z + move-result v$free + if-eqz v$free, :do_not_show + + # This duplicate code can be fixed by using a second free register (or adding a helper method). + move-object/from16 v$free, p0 + iget-object v$free, v$free, Lkvk;->b:Lkvm; + iget-object v$free, v$free, Lkvm;->s:Lkvx; + iget-object v$free, v$free, Lgym;->d:Lahhj; + + invoke-virtual { v$free, v${instruction.registerD}, v${instruction.registerE}, v${instruction.registerF} }, Lahhj;->mF(IJ)V + + :is_null + :do_not_show + nop + """) + removeInstruction(index) + } + + findOpcodeIndicesReversed { + val reference = getReference() + opcode == Opcode.INVOKE_VIRTUAL && reference?.definingClass == "Lkov;" && reference.name == "j" + }.forEach { index -> + removeInstruction(index) + } + } } } From 1a8c562c8debdfb325f56375115172677656f3ee Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:56:40 -0400 Subject: [PATCH 071/143] Revert "Work in progress, all code from 19.16 seems to be applied, but at least 1 more change is needed." This reverts commit 4371a7249aa03f8856c73f1ca4e08e63e587ffba. --- .../RestoreOldSeekbarThumbnailsPatch.kt | 127 ++---------------- 1 file changed, 11 insertions(+), 116 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt index 1e6f527672..9d45b0ca8b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt @@ -2,12 +2,9 @@ package app.revanced.patches.youtube.layout.seekbar import app.revanced.patcher.data.BytecodeContext import app.revanced.patcher.extensions.InstructionExtensions.addInstruction -import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels -import app.revanced.patcher.extensions.InstructionExtensions.getInstruction import app.revanced.patcher.extensions.InstructionExtensions.getInstructions -import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction -import app.revanced.patcher.extensions.InstructionExtensions.removeInstructions 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 @@ -16,14 +13,7 @@ import app.revanced.patches.youtube.layout.seekbar.fingerprints.FullscreenSeekba 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.findOpcodeIndicesReversed -import app.revanced.util.getReference -import app.revanced.util.indexOfFirstInstructionOrThrow -import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow -import app.revanced.util.resultOrThrow -import com.android.tools.smali.dexlib2.Opcode -import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction -import com.android.tools.smali.dexlib2.iface.reference.MethodReference +import app.revanced.util.exception @Patch( name = "Restore old seekbar thumbnails", @@ -54,8 +44,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference "19.13.37", "19.14.43", "19.15.36", - "19.16.39", - "19.34.42", + "19.16.39" + // 19.17+ is not supported. ] ) ] @@ -68,119 +58,24 @@ object RestoreOldSeekbarThumbnailsPatch : BytecodePatch( "Lapp/revanced/integrations/youtube/patches/RestoreOldSeekbarThumbnailsPatch;" override fun execute(context: BytecodeContext) { + if (YouTubeVersionCheck.is_19_17_or_greater) { + // Give a more informative error, if the user has turned off version checks. + throw PatchException("'Restore old seekbar thumbnails' cannot be patched to any version after 19.16.39") + } + AddResourcesPatch(this::class) SettingsPatch.PreferenceScreen.SEEKBAR.addPreferences( SwitchPreference("revanced_restore_old_seekbar_thumbnails") ) - if (false) FullscreenSeekbarThumbnailsFingerprint.resultOrThrow().mutableMethod.apply { + FullscreenSeekbarThumbnailsFingerprint.result?.mutableMethod?.apply { val moveResultIndex = getInstructions().lastIndex - 1 addInstruction( moveResultIndex, "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z" ) - } - - context.proxy(context.classes.first { it.type == "Laaxp;" }).mutableClass.methods - .find { it.name == "bX" }!!.apply { - val index = indexOfFirstWideLiteralInstructionValueOrThrow(45611695L) - val insertIndex = - indexOfFirstInstructionOrThrow(index) { opcode == Opcode.MOVE_RESULT } - - addInstruction( - insertIndex, - "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z" - ) - } - - - context.proxy(context.classes.first { it.type == "Lfwa;" }).mutableClass.methods - .find { it.name == "N" }!!.apply { - val index = indexOfFirstWideLiteralInstructionValueOrThrow(45367320L) - val insertIndex = - indexOfFirstInstructionOrThrow(index) { opcode == Opcode.MOVE_RESULT } - - addInstruction( - insertIndex, - "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z" - ) - } - - context.proxy(context.classes.first { it.type == "Lkrx;" }).mutableClass.methods - .find { it.name == "mF" }!!.apply { - val index = indexOfFirstInstructionOrThrow{ opcode == Opcode.INVOKE_VIRTUAL && getReference()?.name == "mF" } - - removeInstructions(index, getInstructions().size - index - 1) - } - - context.proxy(context.classes.first { it.type == "Lkvm;" }).mutableClass.methods - .find { it.name == "ab" }!!.apply { - val index = indexOfFirstInstructionOrThrow{ - val reference = getReference() - opcode == Opcode.INVOKE_VIRTUAL && reference?.definingClass == "Lkzh;" && reference.name == "l" - } - - removeInstruction(index) - } - - context.proxy(context.classes.first { it.type == "Lbbfq;" }).mutableClass.methods - .find { it.name == "dx" }!!.apply { - val insertIndex = - indexOfFirstInstructionOrThrow { opcode == Opcode.MOVE_RESULT } - - addInstruction( - insertIndex, - "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->useFullscreenSeekbarThumbnails()Z" - ) - } - - context.proxy(context.classes.first { it.type == "Lkvk;" }).mutableClass.methods - .find { it.name == "mF" }!!.apply { - findOpcodeIndicesReversed { - val reference = getReference() - opcode == Opcode.INVOKE_VIRTUAL && reference?.definingClass == "Lkzh;" && reference.name == "mF" - }.forEach { index -> - val instruction = getInstruction(index) - val free = instruction.registerC - - addInstructionsWithLabels(index + 1, """ - move-object/from16 v$free, p0 - iget-object v$free, v$free, Lkvk;->b:Lkvm; - invoke-virtual { v$free }, Lkvm;->F()V # Inflate layout - iget-object v$free, v$free, Lkvm;->s:Lkvx; - iget-object v$free, v$free, Lgym;->d:Lahhj; - # - # FIXME: this field is always null. Something else needs to be set for this to work. - # - if-eqz v$free, :is_null - - invoke-virtual { v$free }, Lahhj;->j()Z - move-result v$free - if-eqz v$free, :do_not_show - - # This duplicate code can be fixed by using a second free register (or adding a helper method). - move-object/from16 v$free, p0 - iget-object v$free, v$free, Lkvk;->b:Lkvm; - iget-object v$free, v$free, Lkvm;->s:Lkvx; - iget-object v$free, v$free, Lgym;->d:Lahhj; - - invoke-virtual { v$free, v${instruction.registerD}, v${instruction.registerE}, v${instruction.registerF} }, Lahhj;->mF(IJ)V - - :is_null - :do_not_show - nop - """) - removeInstruction(index) - } - - findOpcodeIndicesReversed { - val reference = getReference() - opcode == Opcode.INVOKE_VIRTUAL && reference?.definingClass == "Lkov;" && reference.name == "j" - }.forEach { index -> - removeInstruction(index) - } - } + } ?: throw FullscreenSeekbarThumbnailsFingerprint.exception } } From 8ba8642fb75b4e405a447067e1168f85de2f62af Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sat, 21 Sep 2024 12:58:44 -0400 Subject: [PATCH 072/143] fix: Do not use Cairo settings as too much stuff is broken. Code adapted from: https://github.com/inotia00/revanced-patches/blob/revanced-extended/src/main/kotlin/app/revanced/patches/youtube/utils/fix/cairo/CairoSettingsPatch.kt --- .../misc/fix/cairo/CairoSettingsPatch.kt | 49 +++++++++++++++++++ .../CarioFragmentConfigFingerprint.kt | 20 ++++++++ .../youtube/misc/settings/SettingsPatch.kt | 2 + 3 files changed, 71 insertions(+) create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt create mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/fingerprints/CarioFragmentConfigFingerprint.kt diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt new file mode 100644 index 0000000000..5708de35c5 --- /dev/null +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt @@ -0,0 +1,49 @@ +package app.revanced.patches.youtube.misc.fix.cairo + +import app.revanced.patcher.data.BytecodeContext +import app.revanced.patcher.extensions.InstructionExtensions.addInstruction +import app.revanced.patcher.extensions.InstructionExtensions.getInstruction +import app.revanced.patcher.patch.BytecodePatch +import app.revanced.patcher.patch.annotation.Patch +import app.revanced.patches.youtube.misc.backgroundplayback.BackgroundPlaybackPatch +import app.revanced.patches.youtube.misc.fix.cairo.fingerprints.CarioFragmentConfigFingerprint +import app.revanced.util.indexOfFirstInstructionOrThrow +import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow +import app.revanced.util.resultOrThrow +import com.android.tools.smali.dexlib2.Opcode +import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction + +@Patch( + description = "Prevents Cairo Fragment from being used." +) +internal object CairoSettingsPatch : BytecodePatch( + setOf(CarioFragmentConfigFingerprint) +) { + override fun execute(context: BytecodeContext) { + + /** + *
+         * Cairo Fragment was added since YouTube v19.04.38.
+         *
+         * Disable this for the following reasons:
+         * 1. [BackgroundPlaybackPatch] does not activate the Minimized playback setting of Cairo Fragment.
+         * 2. Some patches do not yet support Cairo Fragments (ie: custom Seekbar color).
+         * 3. Settings preferences added by ReVanced are missing.
+         *
+         * Screenshots of the Cairo Fragment:
+         * uYouPlus#1468.
+         */
+        CarioFragmentConfigFingerprint.resultOrThrow().mutableMethod.apply {
+            val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
+                CarioFragmentConfigFingerprint.CAIRO_CONFIG_LITERAL_VALUE
+            )
+            val targetIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
+            val targetRegister = getInstruction(targetIndex).registerA
+
+            addInstruction(
+                targetIndex + 1,
+                "const/16 v$targetRegister, 0x0"
+            )
+        }
+    }
+}
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/fingerprints/CarioFragmentConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/fingerprints/CarioFragmentConfigFingerprint.kt
new file mode 100644
index 0000000000..fc24be05c2
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/fingerprints/CarioFragmentConfigFingerprint.kt
@@ -0,0 +1,20 @@
+package app.revanced.patches.youtube.misc.fix.cairo.fingerprints
+
+import app.revanced.patcher.extensions.or
+import app.revanced.patches.youtube.misc.fix.cairo.fingerprints.CarioFragmentConfigFingerprint.CAIRO_CONFIG_LITERAL_VALUE
+import app.revanced.util.patch.LiteralValueFingerprint
+import com.android.tools.smali.dexlib2.AccessFlags
+
+/**
+ * Added in YouTube v19.04.38
+ *
+ * When this value is TRUE, Cairo Fragment is used.
+ * In this case, some of patches may be broken, so set this value to FALSE.
+ */
+internal object CarioFragmentConfigFingerprint : LiteralValueFingerprint(
+    returnType = "Z",
+    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
+    literalSupplier = { CAIRO_CONFIG_LITERAL_VALUE }
+) {
+  const val CAIRO_CONFIG_LITERAL_VALUE = 45532100L
+}
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 819b9d3b9b..69ba416952 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
@@ -16,6 +16,7 @@ import app.revanced.patches.shared.misc.settings.preference.NonInteractivePrefer
 import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting
 import app.revanced.patches.shared.misc.settings.preference.TextPreference
 import app.revanced.patches.youtube.misc.check.CheckEnvironmentPatch
+import app.revanced.patches.youtube.misc.fix.cairo.CairoSettingsPatch
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.settings.fingerprints.LicenseActivityOnCreateFingerprint
 import app.revanced.patches.youtube.misc.settings.fingerprints.SetThemeFingerprint
@@ -31,6 +32,7 @@ import java.io.Closeable
         IntegrationsPatch::class,
         SettingsResourcePatch::class,
         AddResourcesPatch::class,
+        CairoSettingsPatch::class,
         // Currently there is no easy way to make a mandatory patch,
         // so for now this is a dependent of this patch.
         CheckEnvironmentPatch::class,

From 0f07583544793c7017ef30df52211d36e5ae76ac Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 21 Sep 2024 13:08:49 -0400
Subject: [PATCH 073/143] refactor: Simplify

---
 .../seekbar/EnableSlideToSeekPatch.kt         | 30 +++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
index 9d66d08921..38c13faec7 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
@@ -5,6 +5,7 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
 import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
 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
@@ -12,13 +13,12 @@ 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.SlideToSeekFingerprint
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
-import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.settings.SettingsPatch
 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.instruction.formats.Instruction35c
 import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 
 @Patch(
@@ -73,30 +73,36 @@ object EnableSlideToSeekPatch : BytecodePatch(
             SwitchPreference("revanced_slide_to_seek")
         )
 
+        var modifiedMethods = false
+
         // Restore the behaviour to slide to seek.
         SlideToSeekFingerprint.resultOrThrow().let {
             val checkIndex = it.scanResult.patternScanResult!!.startIndex
             val checkReference = it.mutableMethod
-                .getInstruction(checkIndex).getReference()!!.toString()
+                .getInstruction(checkIndex).getReference()!!
 
             // 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) return@forEachIndexed
+                method.implementation!!.instructions.forEachIndexed { index, instruction ->
+                    if (instruction.opcode == Opcode.INVOKE_VIRTUAL &&
+                        instruction.getReference() == checkReference
+                    ) {
+                        method.replaceInstruction(
+                            index,
+                            "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSlideToSeekDisabled()Z "
+                        )
 
-                    val reference = (instruction as Instruction35c).reference as MethodReference
-                    if (reference.toString() != checkReference) return@forEachIndexed
-
-                    method.replaceInstruction(index,
-                        "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSlideToSeekDisabled()Z "
-                    )
+                        modifiedMethods = true
+                    }
                 }
             }
         }
 
+        if (!modifiedMethods) throw PatchException("Could not find methods to modify")
+
         // Disable the double speed seek notice.
         // 19.17.41 is the last version with this code.
-        if (!YouTubeVersionCheck.is_19_17_or_greater) {
+        if (!YouTubeVersionCheck.is_19_18_or_greater) {
             DoubleSpeedSeekNoticeFingerprint.resultOrThrow().let {
                 it.mutableMethod.apply {
                     val insertIndex = it.scanResult.patternScanResult!!.endIndex + 1

From c17c28e328467e7cfca3b57f232abae6b93bf67a Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 21 Sep 2024 13:13:20 -0400
Subject: [PATCH 074/143] fix(Enable slide to seek): Adjust summary text

---
 .../youtube/interaction/seekbar/EnableSlideToSeekPatch.kt       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
index 38c13faec7..1ef9eab057 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
@@ -23,7 +23,7 @@ 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(

From dd43aaa024cb92e742f8d60f1f2040225973ef74 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 21 Sep 2024 13:31:49 -0400
Subject: [PATCH 075/143] Comments

---
 .../fingerprints/StandalonePlayerActivityFingerprint.kt         | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt
index 9148f5fdb5..ad53e14f63 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt
@@ -10,6 +10,8 @@ import com.android.tools.smali.dexlib2.AccessFlags
  * In 2023 supported was ended and is no longer available,
  * but this may still be used by older apps:
  * https://developers.google.com/youtube/android/player
+ *
+ * StandalonePlayerActivity was removed in 19.38
  */
 internal object StandalonePlayerActivityFingerprint : IntegrationsFingerprint(
     accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,

From ccc67d5f84112fac67532c2f2813df7d266c11df Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 21 Sep 2024 15:11:56 -0400
Subject: [PATCH 076/143] fix: Add version check to cairo patch

---
 .../youtube/misc/fix/cairo/CairoSettingsPatch.kt       | 10 +++++++++-
 .../youtube/misc/playservice/YouTubeVersionCheck.kt    |  2 ++
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt
index 5708de35c5..a79831f44a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt
@@ -7,6 +7,7 @@ import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patches.youtube.misc.backgroundplayback.BackgroundPlaybackPatch
 import app.revanced.patches.youtube.misc.fix.cairo.fingerprints.CarioFragmentConfigFingerprint
+import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
 import app.revanced.util.indexOfFirstInstructionOrThrow
 import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow
 import app.revanced.util.resultOrThrow
@@ -14,13 +15,20 @@ import com.android.tools.smali.dexlib2.Opcode
 import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
 
 @Patch(
-    description = "Prevents Cairo Fragment from being used."
+    description = "Prevents Cairo Fragment from being used.",
+    dependencies = [
+        YouTubeVersionCheck::class
+    ]
 )
 internal object CairoSettingsPatch : BytecodePatch(
     setOf(CarioFragmentConfigFingerprint)
 ) {
     override fun execute(context: BytecodeContext) {
 
+        if (!YouTubeVersionCheck.is_19_04_or_greater) {
+            return
+        }
+
         /**
          * 
          * Cairo Fragment was added since YouTube v19.04.38.
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt
index 38a852aa39..b66691fa0b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt
@@ -19,6 +19,7 @@ internal object YouTubeVersionCheck : ResourcePatch() {
     private var playStoreServicesVersion by Delegates.notNull()
 
     var is_19_03_or_greater by Delegates.notNull()
+    var is_19_04_or_greater by Delegates.notNull()
     var is_19_15_or_greater by Delegates.notNull()
     var is_19_16_or_greater by Delegates.notNull()
     var is_19_17_or_greater by Delegates.notNull()
@@ -38,6 +39,7 @@ internal object YouTubeVersionCheck : ResourcePatch() {
         playStoreServicesVersion = findPlayServicesVersion(context)
 
         is_19_03_or_greater = 240402000 <= playStoreServicesVersion
+        is_19_04_or_greater = 240502000 <= playStoreServicesVersion
         is_19_15_or_greater = 241602000 <= playStoreServicesVersion
         is_19_16_or_greater = 241702000 <= playStoreServicesVersion
         is_19_17_or_greater = 241802000 <= playStoreServicesVersion

From 08fa0e04e6401ee4669700718b6291b05810ad4f Mon Sep 17 00:00:00 2001
From: zainarbani 
Date: Sun, 22 Sep 2024 15:39:11 +0700
Subject: [PATCH 077/143] fix: Resolve `slide to seek` remaining issue

---
 .../seekbar/EnableSlideToSeekPatch.kt         | 54 ++++++++++++++-----
 .../DisableFastForwardGestureFingerprint.kt   | 22 ++++++++
 ...=> DisableFastForwardLegacyFingerprint.kt} |  2 +-
 .../DisableFastForwardNoticeFingerprint.kt    | 20 +++++++
 4 files changed, 84 insertions(+), 14 deletions(-)
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt
 rename src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/{DoubleSpeedSeekNoticeFingerprint.kt => DisableFastForwardLegacyFingerprint.kt} (79%)
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
index 1ef9eab057..79a5e03b08 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
@@ -3,14 +3,15 @@ package app.revanced.patches.youtube.interaction.seekbar
 import app.revanced.patcher.data.BytecodeContext
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
 import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
-import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
 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
@@ -61,10 +62,13 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 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)
@@ -87,10 +91,17 @@ object EnableSlideToSeekPatch : BytecodePatch(
                     if (instruction.opcode == Opcode.INVOKE_VIRTUAL &&
                         instruction.getReference() == checkReference
                     ) {
-                        method.replaceInstruction(
-                            index,
-                            "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSlideToSeekDisabled()Z "
-                        )
+                        method.apply {
+                            val targetRegister = getInstruction(index + 1).registerA
+
+                            addInstructions(
+                                index + 2,
+                                """
+                                    invoke-static { v$targetRegister }, $INTEGRATIONS_METHOD_DESCRIPTOR
+                                    move-result v$targetRegister
+                               """
+                            )
+                        }
 
                         modifiedMethods = true
                     }
@@ -100,10 +111,9 @@ object EnableSlideToSeekPatch : BytecodePatch(
 
         if (!modifiedMethods) throw PatchException("Could not find methods to modify")
 
-        // Disable the double speed seek notice.
-        // 19.17.41 is the last version with this code.
-        if (!YouTubeVersionCheck.is_19_18_or_greater) {
-            DoubleSpeedSeekNoticeFingerprint.resultOrThrow().let {
+        // 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(insertIndex).registerA
@@ -111,12 +121,30 @@ object EnableSlideToSeekPatch : BytecodePatch(
                     addInstructions(
                         insertIndex,
                         """
-                            invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->isSlideToSeekDisabled()Z
+                            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(targetIndex).registerA
+
+                    addInstructions(
+                        targetIndex + 1,
+                        """
+                            invoke-static { v$targetRegister }, $INTEGRATIONS_METHOD_DESCRIPTOR
+                            move-result v$targetRegister
+                        """
+                    )
+                }
+            }}
         }
     }
 }
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt
new file mode 100644
index 0000000000..6949a75ea1
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt
@@ -0,0 +1,22 @@
+package app.revanced.patches.youtube.interaction.seekbar.fingerprints
+
+import app.revanced.patcher.extensions.or
+import app.revanced.patcher.fingerprint.MethodFingerprint
+import app.revanced.util.containsWideLiteralInstructionValue
+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;")
+    }
+)
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DoubleSpeedSeekNoticeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardLegacyFingerprint.kt
similarity index 79%
rename from src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DoubleSpeedSeekNoticeFingerprint.kt
rename to src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardLegacyFingerprint.kt
index eee74fde59..1762c20431 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DoubleSpeedSeekNoticeFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardLegacyFingerprint.kt
@@ -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),
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt
new file mode 100644
index 0000000000..e16c87917c
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt
@@ -0,0 +1,20 @@
+package app.revanced.patches.youtube.interaction.seekbar.fingerprints
+
+import app.revanced.patcher.extensions.or
+import app.revanced.patcher.fingerprint.MethodFingerprint
+import app.revanced.util.containsWideLiteralInstructionValue
+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")
+)
\ No newline at end of file

From 62e7da2237734d00c9afa3ff229ddb65437250ac Mon Sep 17 00:00:00 2001
From: zainarbani 
Date: Sun, 22 Sep 2024 15:52:08 +0700
Subject: [PATCH 078/143] fix: Remove Unnecessary import

---
 .../seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt | 1 -
 .../seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt
index 6949a75ea1..a1c5bf9870 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardGestureFingerprint.kt
@@ -2,7 +2,6 @@ package app.revanced.patches.youtube.interaction.seekbar.fingerprints
 
 import app.revanced.patcher.extensions.or
 import app.revanced.patcher.fingerprint.MethodFingerprint
-import app.revanced.util.containsWideLiteralInstructionValue
 import com.android.tools.smali.dexlib2.AccessFlags
 import com.android.tools.smali.dexlib2.Opcode
 
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt
index e16c87917c..99be205e87 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/DisableFastForwardNoticeFingerprint.kt
@@ -2,7 +2,6 @@ package app.revanced.patches.youtube.interaction.seekbar.fingerprints
 
 import app.revanced.patcher.extensions.or
 import app.revanced.patcher.fingerprint.MethodFingerprint
-import app.revanced.util.containsWideLiteralInstructionValue
 import com.android.tools.smali.dexlib2.AccessFlags
 import com.android.tools.smali.dexlib2.Opcode
 

From ce00b2b74872dceaaa973410428680aa7e726d44 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 23 Sep 2024 03:57:44 -0400
Subject: [PATCH 079/143] fix: use `19.37.39` instead of `19.34`

---
 .../app/revanced/patches/youtube/ad/general/HideAdsPatch.kt     | 2 +-
 .../patches/youtube/ad/getpremium/HideGetPremiumPatch.kt        | 2 +-
 .../app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt      | 2 +-
 .../interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt       | 2 +-
 .../interaction/dialog/RemoveViewerDiscretionDialogPatch.kt     | 2 +-
 .../patches/youtube/interaction/downloads/DownloadsPatch.kt     | 2 +-
 .../interaction/seekbar/DisablePreciseSeekingGesturePatch.kt    | 2 +-
 .../youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt    | 2 +-
 .../youtube/interaction/seekbar/EnableSlideToSeekPatch.kt       | 2 +-
 .../interaction/swipecontrols/SwipeControlsBytecodePatch.kt     | 2 +-
 .../patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt    | 2 +-
 .../patches/youtube/layout/buttons/action/HideButtonsPatch.kt   | 2 +-
 .../youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt  | 2 +-
 .../youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt  | 2 +-
 .../youtube/layout/buttons/navigation/NavigationButtonsPatch.kt | 2 +-
 .../layout/buttons/player/hide/HidePlayerButtonsPatch.kt        | 2 +-
 .../patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt   | 2 +-
 .../patches/youtube/layout/hide/comments/CommentsPatch.kt       | 2 +-
 .../youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt | 2 +-
 .../layout/hide/endscreencards/HideEndscreenCardsPatch.kt       | 2 +-
 .../patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt | 2 +-
 .../floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt     | 2 +-
 .../fullscreenambientmode/DisableFullscreenAmbientModePatch.kt  | 2 +-
 .../youtube/layout/hide/general/HideLayoutComponentsPatch.kt    | 2 +-
 .../patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt | 2 +-
 .../hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt    | 2 +-
 .../hide/rollingnumber/DisableRollingNumberAnimationPatch.kt    | 2 +-
 .../patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt     | 2 +-
 .../youtube/layout/hide/shorts/HideShortsComponentsPatch.kt     | 2 +-
 .../DisableSuggestedVideoEndScreenPatch.kt                      | 2 +-
 .../patches/youtube/layout/hide/time/HideTimestampPatch.kt      | 2 +-
 .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt        | 2 +-
 .../youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt       | 2 +-
 .../layout/player/background/PlayerControlsBackgroundPatch.kt   | 2 +-
 .../layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt    | 2 +-
 .../patches/youtube/layout/searchbar/WideSearchbarPatch.kt      | 2 +-
 .../youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt    | 2 +-
 .../youtube/layout/spoofappversion/SpoofAppVersionPatch.kt      | 2 +-
 .../patches/youtube/layout/startpage/ChangeStartPagePatch.kt    | 2 +-
 .../startupshortsreset/DisableResumingShortsOnStartupPatch.kt   | 2 +-
 .../patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt    | 2 +-
 .../revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt | 2 +-
 .../youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt     | 2 +-
 .../youtube/layout/thumbnails/BypassImageRegionRestrictions.kt  | 2 +-
 .../revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt | 2 +-
 .../youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt  | 2 +-
 .../youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt | 2 +-
 .../misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt      | 2 +-
 .../patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt | 2 +-
 .../revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt    | 2 +-
 .../patches/youtube/misc/links/BypassURLRedirectsPatch.kt       | 2 +-
 .../patches/youtube/misc/links/OpenLinksExternallyPatch.kt      | 2 +-
 .../youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt   | 2 +-
 .../patches/youtube/video/quality/RememberVideoQualityPatch.kt  | 2 +-
 .../revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt  | 2 +-
 .../video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt   | 2 +-
 56 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
index a68b7ce80d..b39753d9c8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
@@ -51,7 +51,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
index 05dfa95e73..f66611d507 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
@@ -45,7 +45,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
index a9980aeddd..012d9c10c4 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
@@ -50,7 +50,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
index d448dc1c38..b8bba091e9 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
@@ -43,7 +43,7 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
index f6e00d2b8c..2abe4888b5 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
index 3df7ba58bb..5c7ab88e91 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
@@ -49,7 +49,7 @@ import app.revanced.util.resultOrThrow
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
index 9bb4696e19..2130c31bb4 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
index d02f62281e..70caef8059 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
@@ -49,7 +49,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
index 79a5e03b08..94cc62fd86 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
@@ -52,7 +52,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
index 7fd51d1067..729d9935ba 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
@@ -51,7 +51,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
index c3d57406d0..552bb275af 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
@@ -49,7 +49,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
index b700ef6fbe..fb5310971a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
@@ -48,7 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
index 918a7a92fd..12149001a9 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
@@ -59,7 +59,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
index 93d9389a2b..20aaaca2be 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
@@ -49,7 +49,7 @@ import com.android.tools.smali.dexlib2.Opcode
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
index d6e711e595..4e800cdd67 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
@@ -62,7 +62,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
index d09fc2ff61..36f4709d2a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
@@ -53,7 +53,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
index c0f8cfdec7..881766a961 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
index f1438e06a4..2054d47586 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
@@ -47,7 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
index 13019a133e..810d4de10a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
index 6f308a2615..add32a5591 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
@@ -50,7 +50,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
index a9cd0e50dc..2972ad8545 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
index 47fa09b4d0..f42c405957 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
@@ -43,7 +43,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
index c7862e554f..286d61a2f0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
@@ -43,7 +43,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
index 36fdba7043..04562bb775 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
@@ -66,7 +66,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
index 4f03e032be..98c495a283 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
@@ -55,7 +55,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
index c3e45a93ef..7246109670 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
@@ -48,7 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
index f2cdd00757..ab7fd9c55d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
@@ -45,7 +45,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
index 79b8d94a6d..c60127eed9 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
@@ -50,7 +50,7 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
index 33ba3b6ec3..7b040ceb0e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
@@ -69,7 +69,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
index f611df325e..0b9558fc0c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
@@ -42,7 +42,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
index 80cf8d3715..eb67ff57ab 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
@@ -43,7 +43,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 0b447c6fa9..43da8d6e0d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -121,7 +121,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
                 // 19.31.36 // All Modern 1 buttons are missing. Unusable.
                 // 19.32.36 // Works without issues.
                 // 19.33.35 // Works without issues.
-                "19.34.42", // Works without issues.
+                "19.37.39", // Works without issues.
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
index 0a613b1e26..f1eb34ca5f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
@@ -44,7 +44,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
index 302ab905ca..8597d732b3 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
@@ -39,7 +39,7 @@ import org.w3c.dom.Element
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
index f963e23fcc..a29334c238 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
@@ -80,7 +80,7 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
index 6be7171519..0c1cbf536f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
@@ -49,7 +49,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
index d59854a543..4ce5331857 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
@@ -69,7 +69,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
index ebc53c171a..82ebde5f47 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
index 5859328383..c50a935c49 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
@@ -54,7 +54,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
index e1708b606c..b66a3e36d8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
@@ -56,7 +56,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
index 070068ccf0..dcd164739b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
@@ -51,7 +51,7 @@ import app.revanced.util.resultOrThrow
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             )
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
index 11018e2e13..4fcadfaac7 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
@@ -59,7 +59,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
index c50485ae8b..b536cc7f1a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
@@ -53,7 +53,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
index 930cb6891f..586e5976bc 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
@@ -49,7 +49,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
index ae0af098ba..49b8f69714 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
@@ -48,7 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
index 7ac7fe7d2b..8d394a64d0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
@@ -61,7 +61,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
index de521a9bd0..b343fc8ef0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
@@ -43,7 +43,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
index 4d714b488e..08a689da72 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
@@ -43,7 +43,7 @@ import app.revanced.util.resultOrThrow
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
index ec2d491bd2..46d5d30f27 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
@@ -73,7 +73,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
index 581b950466..b24452b15b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
@@ -56,7 +56,7 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ),
         ),
     ),
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
index 0f9cda0ae8..a1f722f839 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
@@ -57,7 +57,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
index 6bc23809bc..1ada08fbd8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
@@ -49,7 +49,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
index a69d70adca..fbd470ebb6 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
@@ -50,7 +50,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
index c41bd7201e..3a34ebe529 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
@@ -59,7 +59,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
index 5885c84925..5225e77993 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
@@ -45,7 +45,7 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
index 6ff476231f..a281daf2ac 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
@@ -54,7 +54,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                "19.37.39",
             ],
         ),
     ],

From b0127b617a47424e2ff7794c8c4d86ced25483f6 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 23 Sep 2024 13:38:59 -0400
Subject: [PATCH 080/143] fix: Remove obsolete and redundant integrations
 fingerprint

---
 .../misc/integrations/IntegrationsPatch.kt      |  8 ++++++--
 .../fingerprints/APIPlayerServiceFingerprint.kt | 17 -----------------
 2 files changed, 6 insertions(+), 19 deletions(-)
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/APIPlayerServiceFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
index ed161b2540..8dbdb55c05 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
@@ -2,7 +2,12 @@ package app.revanced.patches.youtube.misc.integrations
 
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch
-import app.revanced.patches.youtube.misc.integrations.fingerprints.*
+import app.revanced.patches.youtube.misc.integrations.fingerprints.ApplicationInitFingerprint
+import app.revanced.patches.youtube.misc.integrations.fingerprints.EmbeddedPlayerControlsOverlayFingerprint
+import app.revanced.patches.youtube.misc.integrations.fingerprints.EmbeddedPlayerFingerprint
+import app.revanced.patches.youtube.misc.integrations.fingerprints.RemoteEmbedFragmentFingerprint
+import app.revanced.patches.youtube.misc.integrations.fingerprints.RemoteEmbeddedPlayerFingerprint
+import app.revanced.patches.youtube.misc.integrations.fingerprints.StandalonePlayerActivityFingerprint
 
 @Patch(requiresIntegrations = true)
 object IntegrationsPatch : BaseIntegrationsPatch(
@@ -13,6 +18,5 @@ object IntegrationsPatch : BaseIntegrationsPatch(
         RemoteEmbedFragmentFingerprint,
         EmbeddedPlayerControlsOverlayFingerprint,
         EmbeddedPlayerFingerprint,
-        APIPlayerServiceFingerprint,
     ),
 )
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/APIPlayerServiceFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/APIPlayerServiceFingerprint.kt
deleted file mode 100644
index ca4ad846e6..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/APIPlayerServiceFingerprint.kt
+++ /dev/null
@@ -1,17 +0,0 @@
-package app.revanced.patches.youtube.misc.integrations.fingerprints
-
-import app.revanced.patcher.extensions.or
-import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
-import com.android.tools.smali.dexlib2.AccessFlags
-
-/**
- * For embedded playback.
- * It appears this hook may no longer be needed as one of the constructor parameters is the already hooked
- * [EmbeddedPlayerControlsOverlayFingerprint]
- */
-internal object APIPlayerServiceFingerprint : IntegrationsFingerprint(
-    accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
-    customFingerprint = { methodDef, _ -> methodDef.definingClass == "Lcom/google/android/apps/youtube/embeddedplayer/service/service/jar/ApiPlayerService;" },
-    // Integrations context is the first method parameter.
-    contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size }
-)
\ No newline at end of file

From 42c5ccf1f6e7050c8c91ec0e627a4d93084f05b9 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 23 Sep 2024 19:09:01 -0400
Subject: [PATCH 081/143] fix: add missing target version

---
 .../youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt     | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
index 88af979ce0..95ef880281 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
@@ -44,6 +44,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
+                "18.37.36",
                 "18.38.44",
                 "18.43.45",
                 "18.44.41",

From b55a7b02ad8bafda8f58e1f8021b86d89eb988e1 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 23 Sep 2024 19:13:26 -0400
Subject: [PATCH 082/143] cleanup

---
 .../miniplayer/MiniplayerResourcePatch.kt     | 27 +++++++++----------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
index 0741d10283..c74a70c1aa 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
@@ -27,12 +27,19 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
             "floaty_bar_button_top_margin"
         ]
 
-        // Only required for 19.16
-        if (YouTubeVersionCheck.is_19_16_or_greater && !YouTubeVersionCheck.is_19_17_or_greater) {
-            ytOutlinePictureInPictureWhite24 = ResourceMappingPatch[
-                "drawable",
-                "yt_outline_picture_in_picture_white_24"
+        if (YouTubeVersionCheck.is_19_16_or_greater) {
+            modernMiniplayerClose = ResourceMappingPatch[
+                "id",
+                "modern_miniplayer_close"
             ]
+
+            // Only required for exactly 19.16
+            if (!YouTubeVersionCheck.is_19_17_or_greater) {
+                ytOutlinePictureInPictureWhite24 = ResourceMappingPatch[
+                    "drawable",
+                    "yt_outline_picture_in_picture_white_24"
+                ]
+            }
         }
 
         ytOutlineXWhite24 = ResourceMappingPatch[
@@ -45,16 +52,6 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
             "scrim_overlay"
         ]
 
-        try {
-            modernMiniplayerClose = ResourceMappingPatch[
-                "id",
-                "modern_miniplayer_close"
-            ]
-        } catch (exception: PatchException) {
-            // Ignore, and assume the app is 19.14 or earlier.
-            return
-        }
-
         modernMiniplayerExpand = ResourceMappingPatch[
             "id",
             "modern_miniplayer_expand"

From cccf288eb11cf556af17dade44c8e83e59d16fd7 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 23 Sep 2024 19:26:51 -0400
Subject: [PATCH 083/143] cleanup

---
 api/revanced-patches.api                      |  2 ++
 .../cleardisplay/RememberClearDisplayPatch.kt |  6 ++---
 .../layout/miniplayer/MiniplayerPatch.kt      | 13 ++++------
 .../sponsorblock/SponsorBlockBytecodePatch.kt |  5 ++--
 .../kotlin/app/revanced/util/BytecodeUtils.kt | 24 +++++++++++++------
 5 files changed, 28 insertions(+), 22 deletions(-)

diff --git a/api/revanced-patches.api b/api/revanced-patches.api
index 05ba06e097..75246e94f4 100644
--- a/api/revanced-patches.api
+++ b/api/revanced-patches.api
@@ -2177,11 +2177,13 @@ public final class app/revanced/util/BytecodeUtilsKt {
 	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;Lcom/android/tools/smali/dexlib2/Opcode;)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 final fun indexOfFirstInstructionOrThrow (Lcom/android/tools/smali/dexlib2/iface/Method;Lcom/android/tools/smali/dexlib2/Opcode;)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
diff --git a/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch.kt b/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch.kt
index 60eb637c47..b1522e880c 100644
--- a/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/tiktok/interaction/cleardisplay/RememberClearDisplayPatch.kt
@@ -13,7 +13,7 @@ import app.revanced.patches.tiktok.shared.fingerprints.OnRenderFirstFrameFingerp
 import app.revanced.util.exception
 import app.revanced.util.indexOfFirstInstructionOrThrow
 import com.android.tools.smali.dexlib2.Opcode
-import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction22c
+import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
 
 @Patch(
     name = "Remember clear display",
@@ -34,8 +34,8 @@ object RememberClearDisplayPatch : BytecodePatch(
         OnClearDisplayEventFingerprint.result?.mutableMethod?.let {
             // region Hook the "Clear display" configuration save event to remember the state of clear display.
 
-            val isEnabledIndex = it.indexOfFirstInstructionOrThrow { opcode == Opcode.IGET_BOOLEAN } + 1
-            val isEnabledRegister = it.getInstruction(isEnabledIndex - 1).registerA
+            val isEnabledIndex = it.indexOfFirstInstructionOrThrow(Opcode.IGET_BOOLEAN) + 1
+            val isEnabledRegister = it.getInstruction(isEnabledIndex - 1).registerA
 
             it.addInstructions(
                 isEnabledIndex,
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 43da8d6e0d..5db44056d8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -279,9 +279,8 @@ object MiniplayerPatch : BytecodePatch(
                 val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
                     MiniplayerModernConstructorFingerprint.INITIAL_SIZE_FEATURE_KEY_LITERAL
                 )
-                val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) {
-                    opcode == Opcode.LONG_TO_INT
-                }
+                val targetIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.LONG_TO_INT)
+
                 val register = getInstruction(targetIndex).registerA
 
                 addInstructions(
@@ -445,9 +444,7 @@ object MiniplayerPatch : BytecodePatch(
     ) {
         resultOrThrow().mutableMethod.apply {
             val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(literal)
-            val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) {
-                opcode == Opcode.MOVE_RESULT
-            }
+            val targetIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
 
             insertBooleanOverride(targetIndex + 1, integrationsMethod)
         }
@@ -459,9 +456,7 @@ object MiniplayerPatch : BytecodePatch(
     ) {
         resultOrThrow().mutableMethod.apply {
             val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(literal)
-            val targetIndex = indexOfFirstInstructionOrThrow(literalIndex) {
-                opcode == Opcode.DOUBLE_TO_FLOAT
-            }
+            val targetIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.DOUBLE_TO_FLOAT)
             val register = getInstruction(targetIndex).registerA
 
             addInstructions(
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
index 95ef880281..ad29ec9d66 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
@@ -119,9 +119,8 @@ object SponsorBlockBytecodePatch : BytecodePatch(
         // Seekbar drawing
         SeekbarOnDrawFingerprint.alsoResolve(context, SeekbarFingerprint).mutableMethod.apply {
             // Get left and right of seekbar rectangle.
-            val moveRectangleToRegisterIndex = indexOfFirstInstructionOrThrow {
-                opcode == Opcode.MOVE_OBJECT_FROM16
-            }
+            val moveRectangleToRegisterIndex = indexOfFirstInstructionOrThrow(Opcode.MOVE_OBJECT_FROM16)
+
             addInstruction(
                 moveRectangleToRegisterIndex + 1,
                 "invoke-static/range { p0 .. p0 }, " +
diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
index fafdc3e8d6..accec70de4 100644
--- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
+++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
@@ -15,7 +15,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.WideLiteralInstruction
 import com.android.tools.smali.dexlib2.iface.reference.Reference
 import com.android.tools.smali.dexlib2.util.MethodUtil
-import org.stringtemplate.v4.compiler.Bytecode.instructions
 
 fun MethodFingerprint.resultOrThrow() = result ?: throw exception
 
@@ -190,10 +189,15 @@ inline fun  Instruction.getReference() = (this as? Refere
 fun Method.indexOfFirstInstruction(predicate: Instruction.() -> Boolean) = indexOfFirstInstruction(0, predicate)
 
 /**
- * Get the index of the first [Instruction] that matches the predicate, starting from [startIndex].
- *
+ * @return The index of the first opcode specified, or -1 if not found.
+ * @see indexOfFirstInstructionOrThrow
+ */
+fun Method.indexOfFirstInstruction(targetOpcode: Opcode): Int =
+    indexOfFirstInstruction(0, targetOpcode)
+
+/**
  * @param startIndex Optional starting index to start searching from.
- * @return -1 if the instruction is not found.
+ * @return The index of the first opcode specified, or -1 if not found.
  * @see indexOfFirstInstructionOrThrow
  */
 fun Method.indexOfFirstInstruction(startIndex: Int = 0, targetOpcode: Opcode): Int =
@@ -223,9 +227,15 @@ fun Method.indexOfFirstInstruction(startIndex: Int = 0, predicate: Instruction.(
 }
 
 /**
- * Get the index of the first [Instruction] that matches the predicate, starting from [startIndex].
- *
- * @return the index of the instruction
+ * @return The index of the first opcode specified
+ * @throws PatchException
+ * @see indexOfFirstInstruction
+ */
+fun Method.indexOfFirstInstructionOrThrow(targetOpcode: Opcode): Int =
+    indexOfFirstInstructionOrThrow(0, targetOpcode)
+
+/**
+ * @return The index of the first opcode specified, starting from the index specified.
  * @throws PatchException
  * @see indexOfFirstInstruction
  */

From cf806e8cfd5e058ba8d121e022567f085ed49010 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 23 Sep 2024 19:31:21 -0400
Subject: [PATCH 084/143] Remove unused declarations

---
 .../resources/addresources/values/arrays.xml  | 36 -------------------
 1 file changed, 36 deletions(-)

diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml
index b42141e15b..88d233d9d1 100644
--- a/src/main/resources/addresources/values/arrays.xml
+++ b/src/main/resources/addresources/values/arrays.xml
@@ -97,42 +97,6 @@
                 SPORTS
                 BROWSE
             
-            
-                @string/revanced_change_start_page_entry_default
-                @string/revanced_change_start_page_entry_search
-                @string/revanced_change_start_page_entry_subscriptions
-                @string/revanced_change_start_page_entry_explore
-                
-                
-                
-                
-                
-                
-                
-                
-                
-                
-                
-            
-            
-                
-                
-                open.search
-                open.subscriptions
-                open.explore
-                
-                
-                
-                
-                
-                
-                
-                
-                
-                
-                
-                
-            
         
         
             

From 53f9b6e33ef0e9bfedbc0e9b9b0dc1d049c45dc0 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Mon, 23 Sep 2024 20:37:08 -0400
Subject: [PATCH 085/143] fix(Miniplayer): Override minimum allowable size

---
 .../layout/miniplayer/MiniplayerPatch.kt       | 18 +++++++++++++++++-
 .../miniplayer/MiniplayerResourcePatch.kt      |  7 ++++++-
 .../MiniplayerMinimumSizeFingerprint.kt        | 16 ++++++++++++++++
 3 files changed, 39 insertions(+), 2 deletions(-)
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerMinimumSizeFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 5db44056d8..32a8312c4d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -42,6 +42,7 @@ import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerMod
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerOverrideFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerOverrideNoContextFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerResponseModelSizeCheckFingerprint
+import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerMinimumSizeFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.YouTubePlayerOverlaysLayoutFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.YouTubePlayerOverlaysLayoutFingerprint.YOUTUBE_PLAYER_OVERLAYS_LAYOUT_CLASS_NAME
 import app.revanced.patches.youtube.layout.tablet.fingerprints.GetFormFactorFingerprint
@@ -58,6 +59,7 @@ import com.android.tools.smali.dexlib2.AccessFlags
 import com.android.tools.smali.dexlib2.Opcode
 import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation
 import com.android.tools.smali.dexlib2.iface.Method
+import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
@@ -134,6 +136,7 @@ object MiniplayerPatch : BytecodePatch(
         MiniplayerOverrideFingerprint,
         MiniplayerModernConstructorFingerprint,
         MiniplayerModernViewParentFingerprint,
+        MiniplayerMinimumSizeFingerprint,
         YouTubePlayerOverlaysLayoutFingerprint
     )
 ) {
@@ -286,11 +289,24 @@ object MiniplayerPatch : BytecodePatch(
                 addInstructions(
                     targetIndex + 1,
                     """
-                        invoke-static {v$register}, $INTEGRATIONS_CLASS_DESCRIPTOR->setMiniplayerDefaultSize(I)I
+                        invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->setMiniplayerDefaultSize(I)I
                         move-result v$register
                     """
                 )
             }
+
+            // Override a mininimum miniplayer size constant.
+            MiniplayerMinimumSizeFingerprint.resultOrThrow().mutableMethod.apply {
+                val index = indexOfFirstInstructionOrThrow {
+                    opcode == Opcode.CONST_16 && (this as NarrowLiteralInstruction).narrowLiteral == 192
+                }
+                val register = getInstruction(index).registerA
+
+                // Smaller sizes can be used, but the miniplayer will always start in size 170 if set any smaller.
+                // The 170 initial limit probably could be patched to allow even smaller initial sizes,
+                // but 170 is already half the horizontal space and smaller does not seem useful.
+                replaceInstruction(index, "const/16 v$register, 170")
+            }
         }
 
         if (YouTubeVersionCheck.is_19_32_or_greater) {
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
index c74a70c1aa..fd33fa4934 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
@@ -1,7 +1,6 @@
 package app.revanced.patches.youtube.layout.miniplayer
 
 import app.revanced.patcher.data.ResourceContext
-import app.revanced.patcher.patch.PatchException
 import app.revanced.patcher.patch.ResourcePatch
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
@@ -20,6 +19,7 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
     var modernMiniplayerRewindButton = -1L
     var modernMiniplayerForwardButton = -1L
     var playerOverlays = -1L
+    var miniplayerMaxSize = -1L
 
     override fun execute(context: ResourceContext) {
         floatyBarButtonTopMargin = ResourceMappingPatch[
@@ -52,6 +52,11 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
             "scrim_overlay"
         ]
 
+        miniplayerMaxSize = ResourceMappingPatch[
+            "dimen",
+            "miniplayer_max_size"
+        ]
+
         modernMiniplayerExpand = ResourceMappingPatch[
             "id",
             "modern_miniplayer_expand"
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerMinimumSizeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerMinimumSizeFingerprint.kt
new file mode 100644
index 0000000000..134eaed429
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerMinimumSizeFingerprint.kt
@@ -0,0 +1,16 @@
+package app.revanced.patches.youtube.layout.miniplayer.fingerprints
+
+import app.revanced.patcher.extensions.or
+import app.revanced.patcher.fingerprint.MethodFingerprint
+import app.revanced.patches.youtube.layout.miniplayer.MiniplayerResourcePatch
+import app.revanced.util.containsWideLiteralInstructionValue
+import com.android.tools.smali.dexlib2.AccessFlags
+
+internal object MiniplayerMinimumSizeFingerprint : MethodFingerprint(
+    accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
+    customFingerprint = { methodDef, _ ->
+        methodDef.containsWideLiteralInstructionValue(192)
+                && methodDef.containsWideLiteralInstructionValue(128)
+                && methodDef.containsWideLiteralInstructionValue(MiniplayerResourcePatch.miniplayerMaxSize)
+    }
+)
\ No newline at end of file

From 1ad7cc16c10f8ca8275a066eb8884913eb51be81 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Wed, 25 Sep 2024 01:32:35 -0400
Subject: [PATCH 086/143] fix: Revert back to 19.34.42

---
 .../app/revanced/patches/youtube/ad/general/HideAdsPatch.kt     | 2 +-
 .../patches/youtube/ad/getpremium/HideGetPremiumPatch.kt        | 2 +-
 .../app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt      | 2 +-
 .../interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt       | 2 +-
 .../interaction/dialog/RemoveViewerDiscretionDialogPatch.kt     | 2 +-
 .../patches/youtube/interaction/downloads/DownloadsPatch.kt     | 2 +-
 .../interaction/seekbar/DisablePreciseSeekingGesturePatch.kt    | 2 +-
 .../youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt    | 2 +-
 .../youtube/interaction/seekbar/EnableSlideToSeekPatch.kt       | 2 +-
 .../interaction/swipecontrols/SwipeControlsBytecodePatch.kt     | 2 +-
 .../patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt    | 2 +-
 .../patches/youtube/layout/buttons/action/HideButtonsPatch.kt   | 2 +-
 .../youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt  | 2 +-
 .../youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt  | 2 +-
 .../youtube/layout/buttons/navigation/NavigationButtonsPatch.kt | 2 +-
 .../layout/buttons/player/hide/HidePlayerButtonsPatch.kt        | 2 +-
 .../patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt   | 2 +-
 .../patches/youtube/layout/hide/comments/CommentsPatch.kt       | 2 +-
 .../youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt | 2 +-
 .../layout/hide/endscreencards/HideEndscreenCardsPatch.kt       | 2 +-
 .../patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt | 2 +-
 .../floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt     | 2 +-
 .../fullscreenambientmode/DisableFullscreenAmbientModePatch.kt  | 2 +-
 .../youtube/layout/hide/general/HideLayoutComponentsPatch.kt    | 2 +-
 .../patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt | 2 +-
 .../hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt    | 2 +-
 .../hide/rollingnumber/DisableRollingNumberAnimationPatch.kt    | 2 +-
 .../patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt     | 2 +-
 .../youtube/layout/hide/shorts/HideShortsComponentsPatch.kt     | 2 +-
 .../DisableSuggestedVideoEndScreenPatch.kt                      | 2 +-
 .../patches/youtube/layout/hide/time/HideTimestampPatch.kt      | 2 +-
 .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt        | 2 +-
 .../youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt       | 2 +-
 .../layout/player/background/PlayerControlsBackgroundPatch.kt   | 2 +-
 .../layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt    | 2 +-
 .../patches/youtube/layout/searchbar/WideSearchbarPatch.kt      | 2 +-
 .../youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt    | 2 +-
 .../youtube/layout/spoofappversion/SpoofAppVersionPatch.kt      | 2 +-
 .../patches/youtube/layout/startpage/ChangeStartPagePatch.kt    | 2 +-
 .../startupshortsreset/DisableResumingShortsOnStartupPatch.kt   | 2 +-
 .../patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt    | 2 +-
 .../revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt | 2 +-
 .../youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt     | 2 +-
 .../youtube/layout/thumbnails/BypassImageRegionRestrictions.kt  | 2 +-
 .../revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt | 2 +-
 .../youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt  | 2 +-
 .../youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt | 2 +-
 .../misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt      | 2 +-
 .../patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt | 2 +-
 .../revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt    | 2 +-
 .../patches/youtube/misc/links/BypassURLRedirectsPatch.kt       | 2 +-
 .../patches/youtube/misc/links/OpenLinksExternallyPatch.kt      | 2 +-
 .../youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt   | 2 +-
 .../patches/youtube/video/quality/RememberVideoQualityPatch.kt  | 2 +-
 .../revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt  | 2 +-
 .../video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt   | 2 +-
 56 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
index b39753d9c8..a68b7ce80d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
@@ -51,7 +51,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
index f66611d507..05dfa95e73 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
@@ -45,7 +45,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
index 012d9c10c4..a9980aeddd 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
@@ -50,7 +50,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
index 57a9e0a05b..cf4383f68c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
@@ -43,7 +43,7 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
index 2abe4888b5..f6e00d2b8c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
index 3096d3ff85..efa9223e8a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
@@ -49,7 +49,7 @@ import app.revanced.util.resultOrThrow
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
index 2130c31bb4..9bb4696e19 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
index 70caef8059..d02f62281e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
@@ -49,7 +49,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
index 94cc62fd86..79a5e03b08 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
@@ -52,7 +52,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
index 729d9935ba..7fd51d1067 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
@@ -51,7 +51,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
index 552bb275af..c3d57406d0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
@@ -49,7 +49,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
index fb5310971a..b700ef6fbe 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
@@ -48,7 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
index 12149001a9..918a7a92fd 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
@@ -59,7 +59,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
index 20aaaca2be..93d9389a2b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
@@ -49,7 +49,7 @@ import com.android.tools.smali.dexlib2.Opcode
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
index 4e800cdd67..d6e711e595 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
@@ -62,7 +62,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
index 36f4709d2a..d09fc2ff61 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
@@ -53,7 +53,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
index 881766a961..c0f8cfdec7 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
index 2054d47586..f1438e06a4 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
@@ -47,7 +47,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
index 810d4de10a..13019a133e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
index add32a5591..6f308a2615 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
@@ -50,7 +50,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
index 2972ad8545..a9cd0e50dc 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
index f42c405957..47fa09b4d0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
@@ -43,7 +43,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
index 286d61a2f0..c7862e554f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
@@ -43,7 +43,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
index 04562bb775..36fdba7043 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
@@ -66,7 +66,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
index 98c495a283..4f03e032be 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
@@ -55,7 +55,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
index 7246109670..c3e45a93ef 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
@@ -48,7 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
index ab7fd9c55d..f2cdd00757 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
@@ -45,7 +45,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
index c60127eed9..79b8d94a6d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
@@ -50,7 +50,7 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
index 7b040ceb0e..33ba3b6ec3 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
@@ -69,7 +69,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
index 0b9558fc0c..f611df325e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
@@ -42,7 +42,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
index eb67ff57ab..80cf8d3715 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
@@ -43,7 +43,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 32a8312c4d..40b3e8a739 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -123,7 +123,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
                 // 19.31.36 // All Modern 1 buttons are missing. Unusable.
                 // 19.32.36 // Works without issues.
                 // 19.33.35 // Works without issues.
-                "19.37.39", // Works without issues.
+                "19.34.42", // Works without issues.
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
index f1eb34ca5f..0a613b1e26 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
@@ -44,7 +44,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
index 8597d732b3..302ab905ca 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
@@ -39,7 +39,7 @@ import org.w3c.dom.Element
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
index a29334c238..f963e23fcc 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
@@ -80,7 +80,7 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
index 0c1cbf536f..6be7171519 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
@@ -49,7 +49,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
index ad29ec9d66..661b7bf0d7 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
@@ -68,7 +68,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
index 82ebde5f47..ebc53c171a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
@@ -47,7 +47,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
index c50a935c49..5859328383 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
@@ -54,7 +54,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
index b66a3e36d8..e1708b606c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
@@ -56,7 +56,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
index dcd164739b..070068ccf0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
@@ -51,7 +51,7 @@ import app.revanced.util.resultOrThrow
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             )
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
index 4fcadfaac7..11018e2e13 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
@@ -59,7 +59,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
index b536cc7f1a..c50485ae8b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
@@ -53,7 +53,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
index 586e5976bc..930cb6891f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
@@ -49,7 +49,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
index 49b8f69714..ae0af098ba 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
@@ -48,7 +48,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
index 8d394a64d0..7ac7fe7d2b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
@@ -61,7 +61,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
index b343fc8ef0..de521a9bd0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
@@ -43,7 +43,7 @@ import app.revanced.util.exception
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
index 08a689da72..4d714b488e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
@@ -43,7 +43,7 @@ import app.revanced.util.resultOrThrow
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
index 3afd384ac9..51f3529cc2 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
@@ -73,7 +73,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
index b24452b15b..581b950466 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
@@ -56,7 +56,7 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ),
         ),
     ),
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
index a1f722f839..0f9cda0ae8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
@@ -57,7 +57,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
index 1ada08fbd8..6bc23809bc 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
@@ -49,7 +49,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
index fbd470ebb6..a69d70adca 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
@@ -50,7 +50,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
index 3a34ebe529..c41bd7201e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
@@ -59,7 +59,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
index 5225e77993..5885c84925 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
@@ -45,7 +45,7 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
index a281daf2ac..6ff476231f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
@@ -54,7 +54,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
                 "19.15.36",
                 "19.16.39",
                 "19.25.37",
-                "19.37.39",
+                "19.34.42",
             ],
         ),
     ],

From 00b322c24f8ba3e4ced3f6efcee3895d2ec7f6df Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 26 Sep 2024 07:26:57 -0400
Subject: [PATCH 087/143] fix patching 19.16

---
 .../layout/miniplayer/MiniplayerResourcePatch.kt     | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
index fd33fa4934..133c7a4383 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
@@ -40,6 +40,13 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
                     "yt_outline_picture_in_picture_white_24"
                 ]
             }
+
+            if (YouTubeVersionCheck.is_19_26_or_greater) {
+                miniplayerMaxSize = ResourceMappingPatch[
+                    "dimen",
+                    "miniplayer_max_size"
+                ]
+            }
         }
 
         ytOutlineXWhite24 = ResourceMappingPatch[
@@ -52,11 +59,6 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
             "scrim_overlay"
         ]
 
-        miniplayerMaxSize = ResourceMappingPatch[
-            "dimen",
-            "miniplayer_max_size"
-        ]
-
         modernMiniplayerExpand = ResourceMappingPatch[
             "id",
             "modern_miniplayer_expand"

From d1e27e67e683c64850d68dcc15fde4a9fe1cc2bd Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 26 Sep 2024 15:39:01 -0400
Subject: [PATCH 088/143] fix Miniplayer patching of older targets

---
 .../miniplayer/MiniplayerResourcePatch.kt     | 74 +++++++++----------
 1 file changed, 37 insertions(+), 37 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
index 133c7a4383..012a1e0adb 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
@@ -27,18 +27,55 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
             "floaty_bar_button_top_margin"
         ]
 
+        scrimOverlay = ResourceMappingPatch[
+            "id",
+            "scrim_overlay"
+        ]
+
+        playerOverlays = ResourceMappingPatch[
+            "layout",
+            "player_overlays"
+        ]
+
         if (YouTubeVersionCheck.is_19_16_or_greater) {
             modernMiniplayerClose = ResourceMappingPatch[
                 "id",
                 "modern_miniplayer_close"
             ]
 
+            modernMiniplayerExpand = ResourceMappingPatch[
+                "id",
+                "modern_miniplayer_expand"
+            ]
+
+            modernMiniplayerRewindButton = ResourceMappingPatch[
+                "id",
+                "modern_miniplayer_rewind_button"
+            ]
+
+            modernMiniplayerForwardButton = ResourceMappingPatch[
+                "id",
+                "modern_miniplayer_forward_button"
+            ]
+
+            // Resource id is not used during patching, but is used by integrations.
+            // Verify the resource is present while patching.
+            ResourceMappingPatch[
+                "id",
+                "modern_miniplayer_subtitle_text"
+            ]
+
             // Only required for exactly 19.16
             if (!YouTubeVersionCheck.is_19_17_or_greater) {
                 ytOutlinePictureInPictureWhite24 = ResourceMappingPatch[
                     "drawable",
                     "yt_outline_picture_in_picture_white_24"
                 ]
+
+                ytOutlineXWhite24 = ResourceMappingPatch[
+                    "drawable",
+                    "yt_outline_x_white_24"
+                ]
             }
 
             if (YouTubeVersionCheck.is_19_26_or_greater) {
@@ -48,42 +85,5 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
                 ]
             }
         }
-
-        ytOutlineXWhite24 = ResourceMappingPatch[
-            "drawable",
-            "yt_outline_x_white_24"
-        ]
-
-        scrimOverlay = ResourceMappingPatch[
-            "id",
-            "scrim_overlay"
-        ]
-
-        modernMiniplayerExpand = ResourceMappingPatch[
-            "id",
-            "modern_miniplayer_expand"
-        ]
-
-        modernMiniplayerRewindButton = ResourceMappingPatch[
-            "id",
-            "modern_miniplayer_rewind_button"
-        ]
-
-        modernMiniplayerForwardButton = ResourceMappingPatch[
-            "id",
-            "modern_miniplayer_forward_button"
-        ]
-
-        playerOverlays = ResourceMappingPatch[
-            "layout",
-            "player_overlays"
-        ]
-
-        // Resource id is not used during patching, but is used by integrations.
-        // Verify the resource is present while patching.
-        ResourceMappingPatch[
-            "id",
-            "modern_miniplayer_subtitle_text"
-        ]
     }
 }

From f428c672a8895a628165c2b45aa6de732350e8b9 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 27 Sep 2024 18:16:04 -0400
Subject: [PATCH 089/143] fix(Settings): Do not show background color in edit
 text preference copy/paste popup

Code adapted from https://github.com/inotia00/revanced-patches/commit/4667cbfde9ea2d2d26c75c31cf3f699e4905d92b
---
 .../misc/settings/SettingsResourcePatch.kt    | 14 ++++++++++
 .../resources/settings/host/values/styles.xml | 26 +++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 src/main/resources/settings/host/values/styles.xml

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
index 28833df23c..9c1e6fe7ce 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
@@ -8,6 +8,8 @@ import app.revanced.patches.shared.misc.settings.BaseSettingsResourcePatch
 import app.revanced.patches.shared.misc.settings.preference.IntentPreference
 import app.revanced.util.ResourceGroup
 import app.revanced.util.copyResources
+import app.revanced.util.copyXmlNode
+import app.revanced.util.inputStreamFromBundledResource
 import org.w3c.dom.Element
 
 object SettingsResourcePatch : BaseSettingsResourcePatch(
@@ -37,6 +39,18 @@ object SettingsResourcePatch : BaseSettingsResourcePatch(
             context.copyResources("settings", resourceGroup)
         }
 
+        // Copy style properties used to fix oversized copy menu that appear in EditTextPreference.
+        val targetResource = "values/styles.xml"
+        inputStreamFromBundledResource(
+            "settings/host",
+            targetResource
+        )!!.let { inputStream ->
+            "resources".copyXmlNode(
+                context.xmlEditor[inputStream],
+                context.xmlEditor["res/${targetResource}"]
+            ).close()
+        }
+
         // Remove horizontal divider from the settings Preferences
         // To better match the appearance of the stock YouTube settings.
         context.xmlEditor["res/values/styles.xml"].use { editor ->
diff --git a/src/main/resources/settings/host/values/styles.xml b/src/main/resources/settings/host/values/styles.xml
new file mode 100644
index 0000000000..41e66d8195
--- /dev/null
+++ b/src/main/resources/settings/host/values/styles.xml
@@ -0,0 +1,26 @@
+
+
+
+    
+

From 697f6d17daf43876a92a54c80a8c80319881e504 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 27 Sep 2024 23:12:18 -0400
Subject: [PATCH 090/143] refactor: simplify

---
 .../misc/settings/SettingsResourcePatch.kt    | 63 ++++++++-----------
 1 file changed, 26 insertions(+), 37 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
index 9c1e6fe7ce..c7756c4363 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
@@ -1,7 +1,6 @@
 package app.revanced.patches.youtube.misc.settings
 
 import app.revanced.patcher.data.ResourceContext
-import app.revanced.patcher.patch.PatchException
 import app.revanced.patches.all.misc.resources.AddResourcesPatch
 import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
 import app.revanced.patches.shared.misc.settings.BaseSettingsResourcePatch
@@ -9,8 +8,8 @@ import app.revanced.patches.shared.misc.settings.preference.IntentPreference
 import app.revanced.util.ResourceGroup
 import app.revanced.util.copyResources
 import app.revanced.util.copyXmlNode
+import app.revanced.util.findElementByAttributeValueOrThrow
 import app.revanced.util.inputStreamFromBundledResource
-import org.w3c.dom.Element
 
 object SettingsResourcePatch : BaseSettingsResourcePatch(
     IntentPreference(
@@ -54,50 +53,40 @@ object SettingsResourcePatch : BaseSettingsResourcePatch(
         // Remove horizontal divider from the settings Preferences
         // To better match the appearance of the stock YouTube settings.
         context.xmlEditor["res/values/styles.xml"].use { editor ->
-            val resourcesNode = editor.file.getElementsByTagName("resources").item(0) as Element
+            val document = editor.file
+
+            arrayOf(
+                "Theme.YouTube.Settings",
+                "Theme.YouTube.Settings.Dark"
+            ).forEach { value ->
+                val listDividerNode = document.createElement("item")
+                listDividerNode.setAttribute("name", "android:listDivider")
+                listDividerNode.appendChild(document.createTextNode("@null"))
 
-            for (i in 0 until resourcesNode.childNodes.length) {
-                val node = resourcesNode.childNodes.item(i) as? Element ?: continue
-                val name = node.getAttribute("name")
-                if (name == "Theme.YouTube.Settings" || name == "Theme.YouTube.Settings.Dark") {
-                    val listDividerNode = editor.file.createElement("item")
-                    listDividerNode.setAttribute("name", "android:listDivider")
-                    listDividerNode.appendChild(editor.file.createTextNode("@null"))
-                    node.appendChild(listDividerNode)
-                }
+                document.childNodes.findElementByAttributeValueOrThrow(
+                    "name", value
+                ).appendChild(listDividerNode)
             }
         }
 
         // Modify the manifest and add a data intent filter to the LicenseActivity.
         // Some devices freak out if undeclared data is passed to an intent,
         // and this change appears to fix the issue.
-        var modifiedIntent = false
         context.xmlEditor["AndroidManifest.xml"].use { editor ->
             val document = editor.file
-            // A xml regular-expression would probably work better than this manual searching.
-            val manifestNodes = document.getElementsByTagName("manifest").item(0).childNodes
-            for (i in 0..manifestNodes.length) {
-                val node = manifestNodes.item(i)
-                if (node != null && node.nodeName == "application") {
-                    val applicationNodes = node.childNodes
-                    for (j in 0..applicationNodes.length) {
-                        val applicationChild = applicationNodes.item(j)
-                        if (applicationChild is Element && applicationChild.nodeName == "activity" &&
-                            applicationChild.getAttribute("android:name") == "com.google.android.libraries.social.licenses.LicenseActivity"
-                        ) {
-                            val intentFilter = document.createElement("intent-filter")
-                            val mimeType = document.createElement("data")
-                            mimeType.setAttribute("android:mimeType", "text/plain")
-                            intentFilter.appendChild(mimeType)
-                            applicationChild.appendChild(intentFilter)
-                            modifiedIntent = true
-                            break
-                        }
-                    }
-                }
-            }
-        }
 
-        if (!modifiedIntent) throw PatchException("Could not modify activity intent")
+            val licenseElement = document.childNodes.findElementByAttributeValueOrThrow(
+                "android:name",
+                "com.google.android.libraries.social.licenses.LicenseActivity"
+            )
+
+            val mimeType = document.createElement("data")
+            mimeType.setAttribute("android:mimeType", "text/plain")
+
+            val intentFilter = document.createElement("intent-filter")
+            intentFilter.appendChild(mimeType)
+
+            licenseElement.appendChild(intentFilter)
+        }
     }
 }

From e39d87133269df2f123dcf503a16ea27ad19be71 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 28 Sep 2024 00:21:05 -0400
Subject: [PATCH 091/143] Unofficial support for 19.39 (although need to
 manually comment out `StandalonePlayerActivityFingerprint` in
 IntegrationsPatch).  Verified relative seek works correctly with tv casting.

---
 .../information/VideoInformationPatch.kt      | 27 ++++++++++++-------
 .../MdxSeekRelativeFingerprint.kt             |  3 +--
 .../fingerprints/SeekRelativeFingerprint.kt   |  4 +--
 3 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt
index 88b90ba33e..55c2282bac 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt
@@ -183,9 +183,9 @@ object VideoInformationPatch : BytecodePatch(
         targetClass.interfaces.add(INTEGRATIONS_PLAYER_INTERFACE)
 
         arrayOf(
-            seekToMethod to "seekTo",
-            seekToRelativeMethod to "seekToRelative"
-        ).forEach { (method, name) ->
+            Triple(seekToMethod, "seekTo", true),
+            Triple(seekToRelativeMethod, "seekToRelative", false)
+        ).forEach { (method, name, hasBooleanReturn) ->
             // Add interface method.
             // Get enum type for the seek helper method.
             val seekSourceEnumType = method.parameterTypes[1].toString()
@@ -194,22 +194,29 @@ object VideoInformationPatch : BytecodePatch(
                 targetClass.type,
                 name,
                 listOf(ImmutableMethodParameter("J", null, "time")),
-                "Z",
+                if (hasBooleanReturn) "Z" else "V",
                 AccessFlags.PUBLIC or AccessFlags.FINAL,
                 null, null,
                 MutableMethodImplementation(4)
             ).toMutable()
 
-            // Insert helper method instructions.
-            interfaceImplementation.addInstructions(
-                0,
-                """
+            var instructions = """
                     # first enum (field a) is SEEK_SOURCE_UNKNOWN
                     sget-object v0, $seekSourceEnumType->a:$seekSourceEnumType
                     invoke-virtual { p0, p1, p2, v0 }, $method
-                    move-result p1
-                    return p1
                 """
+
+            instructions += if (hasBooleanReturn) """
+                move-result p1
+                return p1                
+            """ else """
+                return-void                
+            """
+
+            // Insert helper method instructions.
+            interfaceImplementation.addInstructions(
+                0,
+                instructions
             )
 
             targetClass.methods.add(interfaceImplementation)
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekRelativeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekRelativeFingerprint.kt
index 3fd89abf16..5d0b13343c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekRelativeFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekRelativeFingerprint.kt
@@ -10,10 +10,9 @@ import com.android.tools.smali.dexlib2.Opcode
  */
 internal object MdxSeekRelativeFingerprint : MethodFingerprint(
     accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
-    returnType = "Z",
+    // returnType is boolean up to 19.39, and void with 19.39+
     parameters = listOf("J", "L"),
     opcodes = listOf(
         Opcode.IGET_OBJECT,
-        Opcode.INVOKE_INTERFACE
     )
 )
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/SeekRelativeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/SeekRelativeFingerprint.kt
index 05c89b933e..3580daca87 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/SeekRelativeFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/SeekRelativeFingerprint.kt
@@ -10,12 +10,10 @@ import com.android.tools.smali.dexlib2.Opcode
  */
 internal object SeekRelativeFingerprint : MethodFingerprint(
     accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
-    returnType = "Z",
+    // returnType is boolean up to 19.39, and void with 19.39+
     parameters = listOf("J", "L"),
     opcodes = listOf(
         Opcode.ADD_LONG_2ADDR,
         Opcode.INVOKE_VIRTUAL,
-        Opcode.MOVE_RESULT,
-        Opcode.RETURN
     )
 )
\ No newline at end of file

From a80f80f94f3c3bdafff292079f66513124026a77 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 1 Oct 2024 15:58:23 -0400
Subject: [PATCH 092/143] fix: Remove obsolete standalone player hook and
 redundant embedded player hooks.  Can delete the RemoteEmbedded fingerprints
 when they stop resolving.

---
 .../misc/integrations/IntegrationsPatch.kt    |  6 -----
 ...mbeddedPlayerControlsOverlayFingerprint.kt | 22 ----------------
 .../fingerprints/EmbeddedPlayerFingerprint.kt | 20 ---------------
 .../RemoteEmbedFragmentFingerprint.kt         |  3 +++
 .../RemoteEmbeddedPlayerFingerprint.kt        |  3 +++
 .../StandalonePlayerActivityFingerprint.kt    | 25 -------------------
 6 files changed, 6 insertions(+), 73 deletions(-)
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerControlsOverlayFingerprint.kt
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerFingerprint.kt
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
index 8dbdb55c05..ef7211ef44 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
@@ -3,20 +3,14 @@ package app.revanced.patches.youtube.misc.integrations
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch
 import app.revanced.patches.youtube.misc.integrations.fingerprints.ApplicationInitFingerprint
-import app.revanced.patches.youtube.misc.integrations.fingerprints.EmbeddedPlayerControlsOverlayFingerprint
-import app.revanced.patches.youtube.misc.integrations.fingerprints.EmbeddedPlayerFingerprint
 import app.revanced.patches.youtube.misc.integrations.fingerprints.RemoteEmbedFragmentFingerprint
 import app.revanced.patches.youtube.misc.integrations.fingerprints.RemoteEmbeddedPlayerFingerprint
-import app.revanced.patches.youtube.misc.integrations.fingerprints.StandalonePlayerActivityFingerprint
 
 @Patch(requiresIntegrations = true)
 object IntegrationsPatch : BaseIntegrationsPatch(
     setOf(
         ApplicationInitFingerprint,
-        StandalonePlayerActivityFingerprint,
         RemoteEmbeddedPlayerFingerprint,
         RemoteEmbedFragmentFingerprint,
-        EmbeddedPlayerControlsOverlayFingerprint,
-        EmbeddedPlayerFingerprint,
     ),
 )
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerControlsOverlayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerControlsOverlayFingerprint.kt
deleted file mode 100644
index 1b57540675..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerControlsOverlayFingerprint.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-package app.revanced.patches.youtube.misc.integrations.fingerprints
-
-import app.revanced.patcher.extensions.or
-import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
-import com.android.tools.smali.dexlib2.AccessFlags
-
-/**
- * For embedded playback inside Google Play store (and probably other situations as well).
- *
- * Note: this fingerprint may no longer be needed, as it appears
- * [RemoteEmbedFragmentFingerprint] may be set before this hook is called.
- */
-internal object EmbeddedPlayerControlsOverlayFingerprint : IntegrationsFingerprint(
-    accessFlags = AccessFlags.PRIVATE or AccessFlags.CONSTRUCTOR,
-    returnType = "V",
-    parameters = listOf("Landroid/content/Context;", "L", "L"),
-    customFingerprint = { methodDef, _ ->
-        methodDef.definingClass.startsWith("Lcom/google/android/apps/youtube/embeddedplayer/service/ui/overlays/controlsoverlay/remoteloaded/")
-    },
-    // Integrations context is the first method parameter.
-    contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size }
-)
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerFingerprint.kt
deleted file mode 100644
index fbc2ab0dbf..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/EmbeddedPlayerFingerprint.kt
+++ /dev/null
@@ -1,20 +0,0 @@
-package app.revanced.patches.youtube.misc.integrations.fingerprints
-
-import app.revanced.patcher.extensions.or
-import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
-import com.android.tools.smali.dexlib2.AccessFlags
-
-/**
- * For embedded playback inside the Google app (such as the in app 'discover' tab).
- *
- * Note: this fingerprint may or may not be needed, as
- * [RemoteEmbedFragmentFingerprint] might be set before this is called.
- */
-internal object EmbeddedPlayerFingerprint : IntegrationsFingerprint(
-    accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC,
-    returnType = "L",
-    parameters = listOf("L", "L", "Landroid/content/Context;"),
-    strings = listOf("android.hardware.type.television"), // String is also found in other classes
-    // Integrations context is the third method parameter.
-    contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size + 2 }
-)
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt
index 77eeec32dc..a3561e2837 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt
@@ -6,6 +6,9 @@ import com.android.tools.smali.dexlib2.AccessFlags
 
 /**
  * For embedded playback.  Likely covers Google Play store and other Google products.
+ *
+ * Note: This fingerprint may be obsolete and non functional,
+ * as the embedded player was deprecated in 2023 and support ended in 2024.
  */
 internal object RemoteEmbedFragmentFingerprint : IntegrationsFingerprint(
     accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt
index 196994f49b..425747c6dd 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt
@@ -6,6 +6,9 @@ import com.android.tools.smali.dexlib2.AccessFlags
 
 /**
  * For embedded playback inside 3rd party android app (such as 3rd party Reddit apps).
+ *
+ * Note: This fingerprint may be obsolete and non functional,
+ * as the embedded player was deprecated in 2023 and support ended in 2024.
  */
 internal object RemoteEmbeddedPlayerFingerprint : IntegrationsFingerprint(
     accessFlags = AccessFlags.PRIVATE or AccessFlags.CONSTRUCTOR,
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt
deleted file mode 100644
index ad53e14f63..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/StandalonePlayerActivityFingerprint.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-package app.revanced.patches.youtube.misc.integrations.fingerprints
-
-import app.revanced.patcher.extensions.or
-import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
-import com.android.tools.smali.dexlib2.AccessFlags
-
-/**
- * Old API activity to embed YouTube into 3rd party Android apps.
- *
- * In 2023 supported was ended and is no longer available,
- * but this may still be used by older apps:
- * https://developers.google.com/youtube/android/player
- *
- * StandalonePlayerActivity was removed in 19.38
- */
-internal object StandalonePlayerActivityFingerprint : IntegrationsFingerprint(
-    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
-    returnType = "V",
-    parameters = listOf("L"),
-    customFingerprint = { methodDef, _ ->
-        methodDef.definingClass == "Lcom/google/android/youtube/api/StandalonePlayerActivity;"
-                && methodDef.name == "onCreate"
-    },
-    // Integrations context is the Activity itself.
-)
\ No newline at end of file

From 37abd8e49468b9839e64fe61d8092896549c6cf5 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Wed, 2 Oct 2024 04:00:53 -0400
Subject: [PATCH 093/143] fix(Theme): Use dark color for night mode splash
 screen

---
 .../layout/theme/ThemeResourcePatch.kt        | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
index 80cff8a722..cf6f5a7434 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
@@ -11,6 +11,7 @@ import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
 import app.revanced.patches.shared.misc.settings.preference.TextPreference
 import app.revanced.patches.youtube.layout.theme.ThemeBytecodePatch.darkThemeBackgroundColor
 import app.revanced.patches.youtube.layout.theme.ThemeBytecodePatch.lightThemeBackgroundColor
+import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import org.w3c.dom.Element
 
@@ -19,6 +20,7 @@ import org.w3c.dom.Element
         SettingsPatch::class,
         ResourceMappingPatch::class,
         AddResourcesPatch::class,
+        YouTubeVersionCheck::class,
     ],
 )
 internal object ThemeResourcePatch : ResourcePatch() {
@@ -89,12 +91,36 @@ internal object ThemeResourcePatch : ResourcePatch() {
                             return@editSplashScreen
                         }
                     }
+
                     throw PatchException("Failed to modify launch screen")
                 }
             }
+
+            // Fix the splash screen dark mode background color.
+            // Normally this is white and makes no sense for dark mode.
+            if (YouTubeVersionCheck.is_19_32_or_greater) {
+                // Only dark mode needs this fix as light mode correctly uses the custom color.
+                context.xmlEditor["res/values-night/styles.xml"].use { editor ->
+                    val document = editor.file
+
+                    // Create a night mode specific override for the splash screen background.
+                    val style = document.createElement("style")
+                    style.setAttribute("name", "Theme.YouTube.Home")
+                    style.setAttribute("parent", "@style/Base.V23.Theme.YouTube.Home")
+
+                    val windowItem = document.createElement("item")
+                    windowItem.setAttribute("name", "android:windowBackground")
+                    windowItem.textContent = "@color/$SPLASH_BACKGROUND_COLOR"
+                    style.appendChild(windowItem)
+
+                    val resourcesNode = document.getElementsByTagName("resources").item(0) as Element
+                    resourcesNode.appendChild(style)
+                }
+            }
         }
     }
 
+    @Suppress("SameParameterValue")
     private fun addColorResource(
         context: ResourceContext,
         resourceFile: String,

From 3efe59dd911fb67bc4f3cd18d09aeb5e0154a7aa Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 01:56:40 -0400
Subject: [PATCH 094/143] fix: Remove obsolete fingerprints removed in 19.40

---
 .../misc/integrations/IntegrationsPatch.kt    |  4 ----
 .../RemoteEmbedFragmentFingerprint.kt         | 22 -------------------
 .../RemoteEmbeddedPlayerFingerprint.kt        | 22 -------------------
 3 files changed, 48 deletions(-)
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
index ef7211ef44..1c426f6cd1 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/IntegrationsPatch.kt
@@ -3,14 +3,10 @@ package app.revanced.patches.youtube.misc.integrations
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch
 import app.revanced.patches.youtube.misc.integrations.fingerprints.ApplicationInitFingerprint
-import app.revanced.patches.youtube.misc.integrations.fingerprints.RemoteEmbedFragmentFingerprint
-import app.revanced.patches.youtube.misc.integrations.fingerprints.RemoteEmbeddedPlayerFingerprint
 
 @Patch(requiresIntegrations = true)
 object IntegrationsPatch : BaseIntegrationsPatch(
     setOf(
         ApplicationInitFingerprint,
-        RemoteEmbeddedPlayerFingerprint,
-        RemoteEmbedFragmentFingerprint,
     ),
 )
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt
deleted file mode 100644
index a3561e2837..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbedFragmentFingerprint.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-package app.revanced.patches.youtube.misc.integrations.fingerprints
-
-import app.revanced.patcher.extensions.or
-import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
-import com.android.tools.smali.dexlib2.AccessFlags
-
-/**
- * For embedded playback.  Likely covers Google Play store and other Google products.
- *
- * Note: This fingerprint may be obsolete and non functional,
- * as the embedded player was deprecated in 2023 and support ended in 2024.
- */
-internal object RemoteEmbedFragmentFingerprint : IntegrationsFingerprint(
-    accessFlags = AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
-    returnType = "V",
-    parameters = listOf("Landroid/content/Context;", "L", "L"),
-    customFingerprint = { methodDef, _ ->
-        methodDef.definingClass == "Lcom/google/android/apps/youtube/embeddedplayer/service/jar/client/RemoteEmbedFragment;"
-    },
-    // Integrations context is the first method parameter.
-    contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size }
-)
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt
deleted file mode 100644
index 425747c6dd..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/integrations/fingerprints/RemoteEmbeddedPlayerFingerprint.kt
+++ /dev/null
@@ -1,22 +0,0 @@
-package app.revanced.patches.youtube.misc.integrations.fingerprints
-
-import app.revanced.patcher.extensions.or
-import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
-import com.android.tools.smali.dexlib2.AccessFlags
-
-/**
- * For embedded playback inside 3rd party android app (such as 3rd party Reddit apps).
- *
- * Note: This fingerprint may be obsolete and non functional,
- * as the embedded player was deprecated in 2023 and support ended in 2024.
- */
-internal object RemoteEmbeddedPlayerFingerprint : IntegrationsFingerprint(
-    accessFlags = AccessFlags.PRIVATE or AccessFlags.CONSTRUCTOR,
-    returnType = "V",
-    parameters = listOf("Landroid/content/Context;", "L", "L", "Z"),
-    customFingerprint = { methodDef, _ ->
-        methodDef.definingClass == "Lcom/google/android/youtube/api/jar/client/RemoteEmbeddedPlayer;"
-    },
-    // Integrations context is the first method parameter.
-    contextRegisterResolver = { it.implementation!!.registerCount - it.parameters.size }
-)
\ No newline at end of file

From acbee0a966e114599185bbd8322e1f57f5b6d11b Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 02:07:54 -0400
Subject: [PATCH 095/143] fix patching 18.49

---
 .../seekbar/fingerprints/SwipingUpGestureParentFingerprint.kt  | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SwipingUpGestureParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SwipingUpGestureParentFingerprint.kt
index cb33e72a23..98a03b3cbf 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SwipingUpGestureParentFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SwipingUpGestureParentFingerprint.kt
@@ -1,11 +1,8 @@
 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
 
 internal object SwipingUpGestureParentFingerprint : LiteralValueFingerprint(
-    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
     returnType = "Z",
     parameters = listOf(),
     literalSupplier = { 45379021 }

From 05a0356f97e1e3f1ed0e75b4c5a81cf138b53ee6 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 02:08:48 -0400
Subject: [PATCH 096/143] feat: Unofficial support for 19.40 beta

---
 .../misc/playertype/fingerprint/VideoStateFingerprint.kt     | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/fingerprint/VideoStateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/fingerprint/VideoStateFingerprint.kt
index 7df451a4a3..1f58ddd871 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/fingerprint/VideoStateFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playertype/fingerprint/VideoStateFingerprint.kt
@@ -8,11 +8,8 @@ import com.android.tools.smali.dexlib2.Opcode
 internal object VideoStateFingerprint : MethodFingerprint(
     accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
     returnType = "V",
-    parameters = listOf("L"),
+    parameters = listOf("Lcom/google/android/libraries/youtube/player/features/overlay/controls/ControlsState;"),
     opcodes = listOf(
-        Opcode.IGET_OBJECT,
-        Opcode.INVOKE_VIRTUAL,
-        Opcode.IGET_OBJECT,
         Opcode.CONST_4,
         Opcode.IF_EQZ,
         Opcode.IF_EQZ,

From 3d1058195815a9724272f67a9eaa1460706a16c2 Mon Sep 17 00:00:00 2001
From: oSumAtrIX 
Date: Thu, 3 Oct 2024 17:32:19 +0200
Subject: [PATCH 097/143] Small random refactors

---
 .../layout/miniplayer/MiniplayerPatch.kt      |  2 +-
 ...sPatch.kt => DisableCairoSettingsPatch.kt} |  5 +-
 .../misc/playservice/YouTubeVersionCheck.kt   | 50 +++++++++----------
 .../youtube/misc/settings/SettingsPatch.kt    |  4 +-
 ...umberTextViewAnimationUpdateFingerprint.kt |  4 +-
 .../information/VideoInformationPatch.kt      |  6 +--
 .../MdxSeekRelativeFingerprint.kt             |  4 +-
 7 files changed, 37 insertions(+), 38 deletions(-)
 rename src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/{CairoSettingsPatch.kt => DisableCairoSettingsPatch.kt} (95%)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 40b3e8a739..fa2fbfbe96 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -105,7 +105,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
                 "19.12.41",
                 "19.13.37",
                 // 19.14.43 // Incomplete code for modern miniplayers.
-                // 19.15.36 // Different code for handling sub title texts and not worth supporting.
+                // 19.15.36 // Different code for handling subtitle texts and not worth supporting.
                 "19.16.39", // First with modern miniplayers.
                 // 19.17.41 // Works without issues, but no reason to recommend over 19.16.
                 // 19.18.41 // Works without issues, but no reason to recommend over 19.16.
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
similarity index 95%
rename from src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt
rename to src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
index a79831f44a..54d1b6d9de 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/CairoSettingsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
@@ -15,16 +15,15 @@ import com.android.tools.smali.dexlib2.Opcode
 import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
 
 @Patch(
-    description = "Prevents Cairo Fragment from being used.",
+    description = "Disables Cairo Fragment from being used.",
     dependencies = [
         YouTubeVersionCheck::class
     ]
 )
-internal object CairoSettingsPatch : BytecodePatch(
+internal object DisableCairoSettingsPatch : BytecodePatch(
     setOf(CarioFragmentConfigFingerprint)
 ) {
     override fun execute(context: BytecodeContext) {
-
         if (!YouTubeVersionCheck.is_19_04_or_greater) {
             return
         }
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt
index b66691fa0b..e2e20d24dc 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt
@@ -36,7 +36,31 @@ internal object YouTubeVersionCheck : ResourcePatch() {
     var is_19_36_or_greater by Delegates.notNull()
 
     override fun execute(context: ResourceContext) {
-        playStoreServicesVersion = findPlayServicesVersion(context)
+        /**
+         * Used to check what version an app is.
+         * Returns the Google Play services version,
+         * since the decoded app manifest does not have the app version.
+         */
+        fun getPlayServicesVersion(context: ResourceContext): Int {
+            // The app version is missing from the decompiled manifest,
+            // so instead use the Google Play services version and compare against specific releases.
+            context.document["res/values/integers.xml"].use { document ->
+                val nodeList = document.documentElement.childNodes
+                for (i in 0 until nodeList.length) {
+                    val node = nodeList.item(i)
+                    if (node.nodeType == Node.ELEMENT_NODE) {
+                        val element = node as Element
+                        if (element.getAttribute("name") == "google_play_services_version") {
+                            return element.textContent.toInt()
+                        }
+                    }
+                }
+            }
+
+            throw PatchException("integers.xml does not contain a Google Play services version")
+        }
+
+        playStoreServicesVersion = getPlayServicesVersion(context)
 
         is_19_03_or_greater = 240402000 <= playStoreServicesVersion
         is_19_04_or_greater = 240502000 <= playStoreServicesVersion
@@ -55,28 +79,4 @@ internal object YouTubeVersionCheck : ResourcePatch() {
         is_19_35_or_greater = 243605000 <= playStoreServicesVersion
         is_19_36_or_greater = 243705000 <= playStoreServicesVersion
     }
-
-    /**
-     * Used to check what version an app is.
-     * Returns the Google Play services version,
-     * since the decoded app manifest does not have the app version.
-     */
-    private fun findPlayServicesVersion(context: ResourceContext): Int {
-        // The app version is missing from the decompiled manifest,
-        // so instead use the Google Play services version and compare against specific releases.
-        context.document["res/values/integers.xml"].use { document ->
-            val nodeList = document.documentElement.childNodes
-            for (i in 0 until nodeList.length) {
-                val node = nodeList.item(i)
-                if (node.nodeType == Node.ELEMENT_NODE) {
-                    val element = node as Element
-                    if (element.getAttribute("name") == "google_play_services_version") {
-                        return element.textContent.toInt()
-                    }
-                }
-            }
-        }
-
-        throw PatchException("integers.xml does not contain a Google Play services version")
-    }
 }
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 69ba416952..ade624eaf9 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
@@ -16,7 +16,7 @@ import app.revanced.patches.shared.misc.settings.preference.NonInteractivePrefer
 import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen.Sorting
 import app.revanced.patches.shared.misc.settings.preference.TextPreference
 import app.revanced.patches.youtube.misc.check.CheckEnvironmentPatch
-import app.revanced.patches.youtube.misc.fix.cairo.CairoSettingsPatch
+import app.revanced.patches.youtube.misc.fix.cairo.DisableCairoSettingsPatch
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.settings.fingerprints.LicenseActivityOnCreateFingerprint
 import app.revanced.patches.youtube.misc.settings.fingerprints.SetThemeFingerprint
@@ -32,7 +32,7 @@ import java.io.Closeable
         IntegrationsPatch::class,
         SettingsResourcePatch::class,
         AddResourcesPatch::class,
-        CairoSettingsPatch::class,
+        DisableCairoSettingsPatch::class,
         // Currently there is no easy way to make a mandatory patch,
         // so for now this is a dependent of this patch.
         CheckEnvironmentPatch::class,
diff --git a/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt
index ca5710f8ca..a4eda997e8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/shared/fingerprints/RollingNumberTextViewAnimationUpdateFingerprint.kt
@@ -25,7 +25,7 @@ internal object RollingNumberTextViewAnimationUpdateFingerprint : MethodFingerpr
         Opcode.INVOKE_VIRTUAL, // set textview padding using bitmap width
     ),
     customFingerprint = { _, classDef ->
-        classDef.superclass == "Landroid/support/v7/widget/AppCompatTextView;" ||
-                classDef.superclass == "Lcom/google/android/libraries/youtube/rendering/ui/spec/typography/YouTubeAppCompatTextView;"
+        classDef.superclass == "Landroid/support/v7/widget/AppCompatTextView;" || classDef.superclass ==
+                "Lcom/google/android/libraries/youtube/rendering/ui/spec/typography/YouTubeAppCompatTextView;"
     }
 )
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt
index 55c2282bac..71c0a2d146 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/information/VideoInformationPatch.kt
@@ -185,7 +185,7 @@ object VideoInformationPatch : BytecodePatch(
         arrayOf(
             Triple(seekToMethod, "seekTo", true),
             Triple(seekToRelativeMethod, "seekToRelative", false)
-        ).forEach { (method, name, hasBooleanReturn) ->
+        ).forEach { (method, name, returnsBoolean) ->
             // Add interface method.
             // Get enum type for the seek helper method.
             val seekSourceEnumType = method.parameterTypes[1].toString()
@@ -194,7 +194,7 @@ object VideoInformationPatch : BytecodePatch(
                 targetClass.type,
                 name,
                 listOf(ImmutableMethodParameter("J", null, "time")),
-                if (hasBooleanReturn) "Z" else "V",
+                if (returnsBoolean) "Z" else "V",
                 AccessFlags.PUBLIC or AccessFlags.FINAL,
                 null, null,
                 MutableMethodImplementation(4)
@@ -206,7 +206,7 @@ object VideoInformationPatch : BytecodePatch(
                     invoke-virtual { p0, p1, p2, v0 }, $method
                 """
 
-            instructions += if (hasBooleanReturn) """
+            instructions += if (returnsBoolean) """
                 move-result p1
                 return p1                
             """ else """
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekRelativeFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekRelativeFingerprint.kt
index 5d0b13343c..2146a88d47 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekRelativeFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/information/fingerprints/MdxSeekRelativeFingerprint.kt
@@ -10,9 +10,9 @@ import com.android.tools.smali.dexlib2.Opcode
  */
 internal object MdxSeekRelativeFingerprint : MethodFingerprint(
     accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
-    // returnType is boolean up to 19.39, and void with 19.39+
+    // Return type is boolean up to 19.39, and void with 19.39+.
     parameters = listOf("J", "L"),
     opcodes = listOf(
         Opcode.IGET_OBJECT,
     )
-)
\ No newline at end of file
+)

From f51062dbbb1603e5f28e60f54306c7bd5cfcfd2b Mon Sep 17 00:00:00 2001
From: oSumAtrIX 
Date: Thu, 3 Oct 2024 17:42:28 +0200
Subject: [PATCH 098/143] Rename

---
 .../seekbar/EnableSlideToSeekPatch.kt         |  4 +--
 .../hide/shorts/HideShortsComponentsPatch.kt  |  6 ++---
 .../HideShortsComponentsResourcePatch.kt      |  6 ++---
 .../layout/miniplayer/MiniplayerPatch.kt      | 26 +++++++++----------
 .../miniplayer/MiniplayerResourcePatch.kt     | 10 +++----
 .../ReturnYouTubeDislikePatch.kt              |  6 ++---
 .../RestoreOldSeekbarThumbnailsPatch.kt       |  6 ++---
 .../layout/theme/ThemeResourcePatch.kt        |  6 ++---
 .../fix/cairo/DisableCairoSettingsPatch.kt    |  6 ++---
 .../misc/links/BypassURLRedirectsPatch.kt     |  6 ++---
 .../misc/litho/filter/LithoFilterPatch.kt     |  8 +++---
 ...beVersionCheck.kt => VersionCheckPatch.kt} |  2 +-
 .../PlayerResponseMethodHookPatch.kt          |  6 ++---
 .../youtube/video/videoid/VideoIdPatch.kt     |  4 +--
 14 files changed, 51 insertions(+), 51 deletions(-)
 rename src/main/kotlin/app/revanced/patches/youtube/misc/playservice/{YouTubeVersionCheck.kt => VersionCheckPatch.kt} (98%)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
index 79a5e03b08..6873f6f34d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
@@ -14,7 +14,7 @@ import app.revanced.patches.youtube.interaction.seekbar.fingerprints.DisableFast
 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.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.util.getReference
 import app.revanced.util.resultOrThrow
@@ -112,7 +112,7 @@ object EnableSlideToSeekPatch : BytecodePatch(
         if (!modifiedMethods) throw PatchException("Could not find methods to modify")
 
         // Disable the double speed seek gesture.
-        if (!YouTubeVersionCheck.is_19_17_or_greater) {
+        if (!VersionCheckPatch.is_19_17_or_greater) {
             DisableFastForwardLegacyFingerprint.resultOrThrow().let {
                 it.mutableMethod.apply {
                     val insertIndex = it.scanResult.patternScanResult!!.endIndex + 1
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
index 94867decf7..bffdbe6ce8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
@@ -14,7 +14,7 @@ import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.*
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
 import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.util.forEachLiteralValueInstruction
 import app.revanced.util.alsoResolve
 import app.revanced.util.exception
@@ -39,7 +39,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         HideShortsComponentsResourcePatch::class,
         ResourceMappingPatch::class,
         NavigationBarHookPatch::class,
-        YouTubeVersionCheck::class
+        VersionCheckPatch::class
     ],
     compatiblePackages = [
         CompatiblePackage(
@@ -105,7 +105,7 @@ object HideShortsComponentsPatch : BytecodePatch(
         // region Hide the Shorts shelf.
 
         // This patch point is not present in 19.03.x and greater.
-        if (!YouTubeVersionCheck.is_19_03_or_greater) {
+        if (!VersionCheckPatch.is_19_03_or_greater) {
             ReelConstructorFingerprint.result?.let {
                 it.mutableMethod.apply {
                     val insertIndex = it.scanResult.patternScanResult!!.startIndex + 2
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 61a769f4e5..05ddc9d742 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
@@ -8,7 +8,7 @@ import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
 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
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.util.findElementByAttributeValueOrThrow
 
@@ -17,7 +17,7 @@ import app.revanced.util.findElementByAttributeValueOrThrow
         SettingsPatch::class,
         ResourceMappingPatch::class,
         AddResourcesPatch::class,
-        YouTubeVersionCheck::class
+        VersionCheckPatch::class
     ]
 )
 object HideShortsComponentsResourcePatch : ResourcePatch() {
@@ -102,7 +102,7 @@ object HideShortsComponentsResourcePatch : ResourcePatch() {
             "reel_player_right_pivot_v2_size"
         ]
 
-        if (!YouTubeVersionCheck.is_19_03_or_greater) {
+        if (!VersionCheckPatch.is_19_03_or_greater) {
             reelMultipleItemShelfId = ResourceMappingPatch[
                 "dimen",
                 "reel_player_right_cell_button_height",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index fa2fbfbe96..b0d5555561 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -47,7 +47,7 @@ import app.revanced.patches.youtube.layout.miniplayer.fingerprints.YouTubePlayer
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.YouTubePlayerOverlaysLayoutFingerprint.YOUTUBE_PLAYER_OVERLAYS_LAYOUT_CLASS_NAME
 import app.revanced.patches.youtube.layout.tablet.fingerprints.GetFormFactorFingerprint
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.util.alsoResolve
 import app.revanced.util.findOpcodeIndicesReversed
@@ -146,7 +146,7 @@ object MiniplayerPatch : BytecodePatch(
         AddResourcesPatch(this::class)
 
         val preferences = mutableSetOf()
-        if (!YouTubeVersionCheck.is_19_16_or_greater) {
+        if (!VersionCheckPatch.is_19_16_or_greater) {
             preferences += ListPreference(
                 "revanced_miniplayer_type",
                 summaryKey = null,
@@ -160,8 +160,8 @@ object MiniplayerPatch : BytecodePatch(
                 entriesKey = "revanced_miniplayer_type_19_16_entries",
                 entryValuesKey = "revanced_miniplayer_type_19_16_entry_values"
             )
-            if (YouTubeVersionCheck.is_19_25_or_greater) {
-                if (!YouTubeVersionCheck.is_19_29_or_greater) {
+            if (VersionCheckPatch.is_19_25_or_greater) {
+                if (!VersionCheckPatch.is_19_29_or_greater) {
                     preferences += SwitchPreference("revanced_miniplayer_double_tap_action")
                 }
                 preferences += SwitchPreference("revanced_miniplayer_drag_and_drop")
@@ -170,20 +170,20 @@ object MiniplayerPatch : BytecodePatch(
             preferences += SwitchPreference(
                 key = "revanced_miniplayer_hide_expand_close",
                 summaryOnKey =
-                if (YouTubeVersionCheck.is_19_26_or_greater) {
+                if (VersionCheckPatch.is_19_26_or_greater) {
                     "revanced_miniplayer_hide_expand_close_19_26_summary_on"
                 } else {
                     "revanced_miniplayer_hide_expand_close_summary_on"
                 }
             )
 
-            if (!YouTubeVersionCheck.is_19_26_or_greater) {
+            if (!VersionCheckPatch.is_19_26_or_greater) {
                 preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward")
             }
 
             preferences += SwitchPreference("revanced_miniplayer_hide_subtext")
 
-            if (YouTubeVersionCheck.is_19_26_or_greater) {
+            if (VersionCheckPatch.is_19_26_or_greater) {
                 preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER)
             }
 
@@ -229,7 +229,7 @@ object MiniplayerPatch : BytecodePatch(
             it.mutableMethod.insertLegacyTabletMiniplayerOverride(it.scanResult.patternScanResult!!.endIndex)
         }
 
-        if (!YouTubeVersionCheck.is_19_16_or_greater) {
+        if (!VersionCheckPatch.is_19_16_or_greater) {
             // Return here, as patch below is only intended for new versions of the app.
             return
         }
@@ -253,14 +253,14 @@ object MiniplayerPatch : BytecodePatch(
             }
         }
 
-        if (YouTubeVersionCheck.is_19_23_or_greater) {
+        if (VersionCheckPatch.is_19_23_or_greater) {
             MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
                 MiniplayerModernConstructorFingerprint.DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL,
                 "enableMiniplayerDragAndDrop"
             )
         }
 
-        if (YouTubeVersionCheck.is_19_25_or_greater) {
+        if (VersionCheckPatch.is_19_25_or_greater) {
             MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
                 MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_OLD_TARGETS_FEATURE_KEY_LITERAL,
                 "getModernMiniplayerOverride"
@@ -277,7 +277,7 @@ object MiniplayerPatch : BytecodePatch(
             )
         }
 
-        if (YouTubeVersionCheck.is_19_26_or_greater) {
+        if (VersionCheckPatch.is_19_26_or_greater) {
             MiniplayerModernConstructorFingerprint.resultOrThrow().mutableMethod.apply {
                 val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
                     MiniplayerModernConstructorFingerprint.INITIAL_SIZE_FEATURE_KEY_LITERAL
@@ -309,7 +309,7 @@ object MiniplayerPatch : BytecodePatch(
             }
         }
 
-        if (YouTubeVersionCheck.is_19_32_or_greater) {
+        if (VersionCheckPatch.is_19_32_or_greater) {
             // Feature is not exposed in the settings, and currently only for debugging.
 
             MiniplayerModernConstructorFingerprint.insertLiteralValueFloatOverride(
@@ -318,7 +318,7 @@ object MiniplayerPatch : BytecodePatch(
             )
         }
 
-        if (YouTubeVersionCheck.is_19_36_or_greater) {
+        if (VersionCheckPatch.is_19_36_or_greater) {
             MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
                 MiniplayerModernConstructorFingerprint.DROP_SHADOW_FEATURE_KEY,
                 "setDropShadow"
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
index 012a1e0adb..1c8649c097 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerResourcePatch.kt
@@ -4,9 +4,9 @@ import app.revanced.patcher.data.ResourceContext
 import app.revanced.patcher.patch.ResourcePatch
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 
-@Patch(dependencies = [ResourceMappingPatch::class, YouTubeVersionCheck::class])
+@Patch(dependencies = [ResourceMappingPatch::class, VersionCheckPatch::class])
 internal object MiniplayerResourcePatch : ResourcePatch() {
     var floatyBarButtonTopMargin = -1L
 
@@ -37,7 +37,7 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
             "player_overlays"
         ]
 
-        if (YouTubeVersionCheck.is_19_16_or_greater) {
+        if (VersionCheckPatch.is_19_16_or_greater) {
             modernMiniplayerClose = ResourceMappingPatch[
                 "id",
                 "modern_miniplayer_close"
@@ -66,7 +66,7 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
             ]
 
             // Only required for exactly 19.16
-            if (!YouTubeVersionCheck.is_19_17_or_greater) {
+            if (!VersionCheckPatch.is_19_17_or_greater) {
                 ytOutlinePictureInPictureWhite24 = ResourceMappingPatch[
                     "drawable",
                     "yt_outline_picture_in_picture_white_24"
@@ -78,7 +78,7 @@ internal object MiniplayerResourcePatch : ResourcePatch() {
                 ]
             }
 
-            if (YouTubeVersionCheck.is_19_26_or_greater) {
+            if (VersionCheckPatch.is_19_26_or_greater) {
                 miniplayerMaxSize = ResourceMappingPatch[
                     "dimen",
                     "miniplayer_max_size"
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
index f963e23fcc..9a2ee80d81 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
@@ -29,7 +29,7 @@ import app.revanced.patches.youtube.layout.returnyoutubedislike.fingerprints.Tex
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
 import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.shared.fingerprints.RollingNumberTextViewAnimationUpdateFingerprint
 import app.revanced.patches.youtube.video.videoid.VideoIdPatch
 import app.revanced.util.alsoResolve
@@ -57,7 +57,7 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference
         VideoIdPatch::class,
         ReturnYouTubeDislikeResourcePatch::class,
         PlayerTypeHookPatch::class,
-        YouTubeVersionCheck::class
+        VersionCheckPatch::class
     ],
     compatiblePackages = [
         CompatiblePackage(
@@ -162,7 +162,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                 val tempRegister : Int
                 val charSequenceRegister : Int
 
-                if (YouTubeVersionCheck.is_19_33_or_greater) {
+                if (VersionCheckPatch.is_19_33_or_greater) {
                     insertIndex = indexOfFirstInstructionOrThrow {
                         opcode == Opcode.INVOKE_STATIC_RANGE &&
                                 getReference()?.returnType == textDataClassType
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
index 9d45b0ca8b..5a72288a61 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
@@ -11,14 +11,14 @@ import app.revanced.patches.all.misc.resources.AddResourcesPatch
 import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.FullscreenSeekbarThumbnailsFingerprint
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.util.exception
 
 @Patch(
     name = "Restore old seekbar thumbnails",
     description = "Adds an option to restore the old seekbar thumbnails that appear above the seekbar while seeking instead of fullscreen thumbnails.",
-    dependencies = [IntegrationsPatch::class, AddResourcesPatch::class, YouTubeVersionCheck::class],
+    dependencies = [IntegrationsPatch::class, AddResourcesPatch::class, VersionCheckPatch::class],
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
@@ -58,7 +58,7 @@ object RestoreOldSeekbarThumbnailsPatch : BytecodePatch(
         "Lapp/revanced/integrations/youtube/patches/RestoreOldSeekbarThumbnailsPatch;"
 
     override fun execute(context: BytecodeContext) {
-        if (YouTubeVersionCheck.is_19_17_or_greater) {
+        if (VersionCheckPatch.is_19_17_or_greater) {
             // Give a more informative error, if the user has turned off version checks.
             throw PatchException("'Restore old seekbar thumbnails' cannot be patched to any version after 19.16.39")
         }
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
index cf6f5a7434..3c4356b49b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
@@ -11,7 +11,7 @@ import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
 import app.revanced.patches.shared.misc.settings.preference.TextPreference
 import app.revanced.patches.youtube.layout.theme.ThemeBytecodePatch.darkThemeBackgroundColor
 import app.revanced.patches.youtube.layout.theme.ThemeBytecodePatch.lightThemeBackgroundColor
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import org.w3c.dom.Element
 
@@ -20,7 +20,7 @@ import org.w3c.dom.Element
         SettingsPatch::class,
         ResourceMappingPatch::class,
         AddResourcesPatch::class,
-        YouTubeVersionCheck::class,
+        VersionCheckPatch::class,
     ],
 )
 internal object ThemeResourcePatch : ResourcePatch() {
@@ -98,7 +98,7 @@ internal object ThemeResourcePatch : ResourcePatch() {
 
             // Fix the splash screen dark mode background color.
             // Normally this is white and makes no sense for dark mode.
-            if (YouTubeVersionCheck.is_19_32_or_greater) {
+            if (VersionCheckPatch.is_19_32_or_greater) {
                 // Only dark mode needs this fix as light mode correctly uses the custom color.
                 context.xmlEditor["res/values-night/styles.xml"].use { editor ->
                     val document = editor.file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
index 54d1b6d9de..1322f0ec56 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
@@ -7,7 +7,7 @@ import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patches.youtube.misc.backgroundplayback.BackgroundPlaybackPatch
 import app.revanced.patches.youtube.misc.fix.cairo.fingerprints.CarioFragmentConfigFingerprint
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.util.indexOfFirstInstructionOrThrow
 import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow
 import app.revanced.util.resultOrThrow
@@ -17,14 +17,14 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
 @Patch(
     description = "Disables Cairo Fragment from being used.",
     dependencies = [
-        YouTubeVersionCheck::class
+        VersionCheckPatch::class
     ]
 )
 internal object DisableCairoSettingsPatch : BytecodePatch(
     setOf(CarioFragmentConfigFingerprint)
 ) {
     override fun execute(context: BytecodeContext) {
-        if (!YouTubeVersionCheck.is_19_04_or_greater) {
+        if (!VersionCheckPatch.is_19_04_or_greater) {
             return
         }
 
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
index 0f9cda0ae8..acb78cb1a1 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
@@ -13,7 +13,7 @@ import app.revanced.patches.youtube.misc.links.fingerprints.ABUriParserFingerpri
 import app.revanced.patches.youtube.misc.links.fingerprints.ABUriParserLegacyFingerprint
 import app.revanced.patches.youtube.misc.links.fingerprints.HTTPUriParserFingerprint
 import app.revanced.patches.youtube.misc.links.fingerprints.HTTPUriParserLegacyFingerprint
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.util.getReference
 import app.revanced.util.indexOfFirstInstruction
@@ -29,7 +29,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         IntegrationsPatch::class,
         SettingsPatch::class,
         AddResourcesPatch::class,
-        YouTubeVersionCheck::class
+        VersionCheckPatch::class
    ],
     compatiblePackages = [
         CompatiblePackage(
@@ -79,7 +79,7 @@ object BypassURLRedirectsPatch : BytecodePatch(
         )
 
         val fingerprints =
-            if (YouTubeVersionCheck.is_19_33_or_greater)
+            if (VersionCheckPatch.is_19_33_or_greater)
                 arrayOf(
                     ABUriParserFingerprint,
                     HTTPUriParserFingerprint
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt
index cc1d439b49..08c73e9b82 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/litho/filter/LithoFilterPatch.kt
@@ -17,7 +17,7 @@ import app.revanced.patches.youtube.misc.litho.filter.fingerprints.EmptyComponen
 import app.revanced.patches.youtube.misc.litho.filter.fingerprints.LithoFilterFingerprint
 import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ProtobufBufferReferenceFingerprint
 import app.revanced.patches.youtube.misc.litho.filter.fingerprints.ReadComponentIdentifierFingerprint
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.util.getReference
 import app.revanced.util.indexOfFirstInstructionOrThrow
 import app.revanced.util.indexOfFirstInstructionReversedOrThrow
@@ -36,7 +36,7 @@ import java.io.Closeable
 
 @Patch(
     description = "Hooks the method which parses the bytes into a ComponentContext to filter components.",
-    dependencies = [IntegrationsPatch::class, YouTubeVersionCheck::class]
+    dependencies = [IntegrationsPatch::class, VersionCheckPatch::class]
 )
 @Suppress("unused")
 object LithoFilterPatch : BytecodePatch(
@@ -156,7 +156,7 @@ object LithoFilterPatch : BytecodePatch(
 
                 // 19.18 and later require patching 2 methods instead of one.
                 // Otherwise the patched code is the same.
-                if (YouTubeVersionCheck.is_19_18_or_greater) {
+                if (VersionCheckPatch.is_19_18_or_greater) {
                     // Get the method name of the ReadComponentIdentifierFingerprint call.
                     val readComponentMethodCallIndex = indexOfFirstInstructionOrThrow {
                         val reference = getReference()
@@ -230,7 +230,7 @@ object LithoFilterPatch : BytecodePatch(
 
                 addInstructionsWithLabels(
                     insertHookIndex,
-                    if (YouTubeVersionCheck.is_19_18_or_greater) """
+                    if (VersionCheckPatch.is_19_18_or_greater) """
                         $commonInstructions
                         
                         # Return null, and the ComponentContextParserFingerprint hook 
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt
similarity index 98%
rename from src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt
rename to src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt
index e2e20d24dc..52631e093b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/YouTubeVersionCheck.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/playservice/VersionCheckPatch.kt
@@ -14,7 +14,7 @@ import kotlin.properties.Delegates
  * All bug fix releases always seem to use the same play store version.
  */
 @Patch(dependencies = [ResourceMappingPatch::class])
-internal object YouTubeVersionCheck : ResourcePatch() {
+internal object VersionCheckPatch : ResourcePatch() {
 
     private var playStoreServicesVersion by Delegates.notNull()
 
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt
index 717a27f807..dbf70a0aac 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/playerresponse/PlayerResponseMethodHookPatch.kt
@@ -7,14 +7,14 @@ import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.video.playerresponse.fingerprint.PlayerParameterBuilderFingerprint
 import app.revanced.patches.youtube.video.playerresponse.fingerprint.PlayerParameterBuilderLegacyFingerprint
 import app.revanced.util.resultOrThrow
 import java.io.Closeable
 
 @Patch(
-    dependencies = [IntegrationsPatch::class, YouTubeVersionCheck::class],
+    dependencies = [IntegrationsPatch::class, VersionCheckPatch::class],
 )
 object PlayerResponseMethodHookPatch :
     BytecodePatch(
@@ -41,7 +41,7 @@ object PlayerResponseMethodHookPatch :
     private var numberOfInstructionsAdded = 0
 
     override fun execute(context: BytecodeContext) {
-        if (YouTubeVersionCheck.is_19_23_or_greater) {
+        if (VersionCheckPatch.is_19_23_or_greater) {
             playerResponseMethod = PlayerParameterBuilderFingerprint.resultOrThrow().mutableMethod
             PARAMETER_IS_SHORT_AND_OPENING_OR_PLAYING = 12
         } else {
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
index 572800528f..222c8f7766 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
@@ -8,7 +8,7 @@ import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
-import app.revanced.patches.youtube.misc.playservice.YouTubeVersionCheck
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
 import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdBackgroundPlayFingerprint
 import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprint
@@ -23,7 +23,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 
 @Patch(
     description = "Hooks to detect when the video id changes",
-    dependencies = [IntegrationsPatch::class, PlayerResponseMethodHookPatch::class, YouTubeVersionCheck::class],
+    dependencies = [IntegrationsPatch::class, PlayerResponseMethodHookPatch::class, VersionCheckPatch::class],
 )
 object VideoIdPatch : BytecodePatch(
     setOf(

From b0347aa7ecc2e69eb71ca82c4e7ab87c7a5751d0 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 15:13:16 -0400
Subject: [PATCH 099/143] fix: Remove unused dependency

---
 .../app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
index 222c8f7766..a1297ed31d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
@@ -8,7 +8,6 @@ import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
-import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
 import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdBackgroundPlayFingerprint
 import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprint
@@ -23,7 +22,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 
 @Patch(
     description = "Hooks to detect when the video id changes",
-    dependencies = [IntegrationsPatch::class, PlayerResponseMethodHookPatch::class, VersionCheckPatch::class],
+    dependencies = [IntegrationsPatch::class, PlayerResponseMethodHookPatch::class],
 )
 object VideoIdPatch : BytecodePatch(
     setOf(

From 65dc1bb8190ea0a3cec1847224149b16434ab722 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 15:15:13 -0400
Subject: [PATCH 100/143] comments

---
 .../patches/youtube/misc/settings/SettingsResourcePatch.kt     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
index c7756c4363..33d12a5c4d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
@@ -38,7 +38,8 @@ object SettingsResourcePatch : BaseSettingsResourcePatch(
             context.copyResources("settings", resourceGroup)
         }
 
-        // Copy style properties used to fix oversized copy menu that appear in EditTextPreference.
+        // Copy style properties used to fix over-sized copy menu that appear in EditTextPreference.
+        // See integrations code for a full explanation of how this fixes the issue.
         val targetResource = "values/styles.xml"
         inputStreamFromBundledResource(
             "settings/host",

From 0ae4b300b2e995e8c747c4c664b49c275a2258b9 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 15:16:13 -0400
Subject: [PATCH 101/143] cleanup

---
 .../misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt
index a5852d06e9..4db3b08b23 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt
@@ -21,12 +21,12 @@ internal object RecyclerViewTreeHookPatch : BytecodePatch(
 
         RecyclerViewTreeObserverFingerprint.result?.let {
             it.mutableMethod.apply {
-                val insertIndex = it.scanResult.patternScanResult!!.startIndex
+                val startIndex = it.scanResult.patternScanResult!!.startIndex
                 val recyclerViewParameter = 2
 
                 addHook = { classDescriptor ->
                     addInstruction(
-                        insertIndex + 1,
+                        startIndex + 1,
                         "invoke-static/range { p$recyclerViewParameter .. p$recyclerViewParameter }, $classDescriptor->onFlyoutMenuCreate(Landroid/support/v7/widget/RecyclerView;)V"
                     )
                 }

From b654370ec80f76d56137591c76bf2bb8b36362f2 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 15:34:57 -0400
Subject: [PATCH 102/143] refactor

---
 .../misc/playservice/VersionCheckPatch.kt     | 28 ++++---------------
 1 file changed, 5 insertions(+), 23 deletions(-)

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 52631e093b..2c31823e70 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
@@ -1,12 +1,10 @@
 package app.revanced.patches.youtube.misc.playservice
 
 import app.revanced.patcher.data.ResourceContext
-import app.revanced.patcher.patch.PatchException
 import app.revanced.patcher.patch.ResourcePatch
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
-import org.w3c.dom.Element
-import org.w3c.dom.Node
+import app.revanced.util.findElementByAttributeValueOrThrow
 import kotlin.properties.Delegates
 
 /**
@@ -20,19 +18,15 @@ internal object VersionCheckPatch : ResourcePatch() {
 
     var is_19_03_or_greater by Delegates.notNull()
     var is_19_04_or_greater by Delegates.notNull()
-    var is_19_15_or_greater by Delegates.notNull()
     var is_19_16_or_greater by Delegates.notNull()
     var is_19_17_or_greater by Delegates.notNull()
     var is_19_18_or_greater by Delegates.notNull()
-    var is_19_19_or_greater by Delegates.notNull()
     var is_19_23_or_greater by Delegates.notNull()
-    var is_19_24_or_greater by Delegates.notNull()
     var is_19_25_or_greater by Delegates.notNull()
     var is_19_26_or_greater by Delegates.notNull()
     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()
 
     override fun execute(context: ResourceContext) {
@@ -45,38 +39,26 @@ internal object VersionCheckPatch : ResourcePatch() {
             // The app version is missing from the decompiled manifest,
             // so instead use the Google Play services version and compare against specific releases.
             context.document["res/values/integers.xml"].use { document ->
-                val nodeList = document.documentElement.childNodes
-                for (i in 0 until nodeList.length) {
-                    val node = nodeList.item(i)
-                    if (node.nodeType == Node.ELEMENT_NODE) {
-                        val element = node as Element
-                        if (element.getAttribute("name") == "google_play_services_version") {
-                            return element.textContent.toInt()
-                        }
-                    }
-                }
+                return document.documentElement.childNodes.findElementByAttributeValueOrThrow(
+                    "name",
+                    "google_play_services_version"
+                ).textContent.toInt()
             }
-
-            throw PatchException("integers.xml does not contain a Google Play services version")
         }
 
         playStoreServicesVersion = getPlayServicesVersion(context)
 
         is_19_03_or_greater = 240402000 <= playStoreServicesVersion
         is_19_04_or_greater = 240502000 <= playStoreServicesVersion
-        is_19_15_or_greater = 241602000 <= playStoreServicesVersion
         is_19_16_or_greater = 241702000 <= playStoreServicesVersion
         is_19_17_or_greater = 241802000 <= playStoreServicesVersion
         is_19_18_or_greater = 241902000 <= playStoreServicesVersion
-        is_19_19_or_greater = 241999000 <= playStoreServicesVersion
         is_19_23_or_greater = 242402000 <= playStoreServicesVersion
-        is_19_24_or_greater = 242505000 <= playStoreServicesVersion
         is_19_25_or_greater = 242599000 <= playStoreServicesVersion
         is_19_26_or_greater = 242705000 <= playStoreServicesVersion
         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
     }
 }

From 702c0496e53beb3f1dcf41461fec83665b9f0a27 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 17:40:30 -0400
Subject: [PATCH 103/143] cleanup

---
 .../misc/playservice/VersionCheckPatch.kt     | 34 ++++++-------------
 1 file changed, 10 insertions(+), 24 deletions(-)

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 2c31823e70..a1acea8a16 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
@@ -3,19 +3,12 @@ package app.revanced.patches.youtube.misc.playservice
 import app.revanced.patcher.data.ResourceContext
 import app.revanced.patcher.patch.ResourcePatch
 import app.revanced.patcher.patch.annotation.Patch
-import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
 import app.revanced.util.findElementByAttributeValueOrThrow
 import kotlin.properties.Delegates
 
-/**
- * Uses the Play Store service version to find the major/minor version of the target app.
- * All bug fix releases always seem to use the same play store version.
- */
-@Patch(dependencies = [ResourceMappingPatch::class])
+@Patch(description = "Uses the Play Store service version to find the major/minor version of the YouTube target app.")
 internal object VersionCheckPatch : ResourcePatch() {
 
-    private var playStoreServicesVersion by Delegates.notNull()
-
     var is_19_03_or_greater by Delegates.notNull()
     var is_19_04_or_greater by Delegates.notNull()
     var is_19_16_or_greater by Delegates.notNull()
@@ -30,24 +23,17 @@ internal object VersionCheckPatch : ResourcePatch() {
     var is_19_36_or_greater by Delegates.notNull()
 
     override fun execute(context: ResourceContext) {
-        /**
-         * Used to check what version an app is.
-         * Returns the Google Play services version,
-         * since the decoded app manifest does not have the app version.
-         */
-        fun getPlayServicesVersion(context: ResourceContext): Int {
-            // The app version is missing from the decompiled manifest,
-            // so instead use the Google Play services version and compare against specific releases.
-            context.document["res/values/integers.xml"].use { document ->
-                return document.documentElement.childNodes.findElementByAttributeValueOrThrow(
-                    "name",
-                    "google_play_services_version"
-                ).textContent.toInt()
-            }
-        }
 
-        playStoreServicesVersion = getPlayServicesVersion(context)
+        // The app version is missing from the decompiled manifest,
+        // so instead use the Google Play services version and compare against specific releases.
+        val playStoreServicesVersion = context.document["res/values/integers.xml"].use { document ->
+            document.documentElement.childNodes.findElementByAttributeValueOrThrow(
+                "name",
+                "google_play_services_version"
+            ).textContent.toInt()
+        }
 
+        // All bug fix releases always seem to use the same play store version as the minor version.
         is_19_03_or_greater = 240402000 <= playStoreServicesVersion
         is_19_04_or_greater = 240502000 <= playStoreServicesVersion
         is_19_16_or_greater = 241702000 <= playStoreServicesVersion

From cc9972786af309943e7981a740410e2eaa763803 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 18:34:37 -0400
Subject: [PATCH 104/143] Simplify supported versions. All versions support
 GmsCore support patch.

---
 .../youtube/ad/general/HideAdsPatch.kt        | 20 -------------------
 .../ad/getpremium/HideGetPremiumPatch.kt      | 20 -------------------
 .../patches/youtube/ad/video/VideoAdsPatch.kt | 20 -------------------
 .../copyvideourl/CopyVideoUrlBytecodePatch.kt | 19 ------------------
 .../RemoveViewerDiscretionDialogPatch.kt      | 20 -------------------
 .../interaction/downloads/DownloadsPatch.kt   | 19 ------------------
 .../DisablePreciseSeekingGesturePatch.kt      | 20 -------------------
 .../seekbar/EnableSeekbarTappingPatch.kt      | 19 +-----------------
 .../seekbar/EnableSlideToSeekPatch.kt         | 19 +-----------------
 .../SwipeControlsBytecodePatch.kt             | 20 -------------------
 .../layout/autocaptions/AutoCaptionsPatch.kt  | 20 -------------------
 .../layout/buttons/action/HideButtonsPatch.kt | 20 -------------------
 .../autoplay/HideAutoplayButtonPatch.kt       | 20 -------------------
 .../captions/HideCaptionsButtonPatch.kt       | 20 -------------------
 .../navigation/NavigationButtonsPatch.kt      | 20 -------------------
 .../player/hide/HidePlayerButtonsPatch.kt     | 20 -------------------
 .../layout/hide/albumcards/AlbumCardsPatch.kt | 20 -------------------
 .../layout/hide/comments/CommentsPatch.kt     | 20 -------------------
 .../crowdfundingbox/CrowdfundingBoxPatch.kt   | 20 -------------------
 .../endscreencards/HideEndscreenCardsPatch.kt | 20 -------------------
 .../hide/filterbar/HideFilterBarPatch.kt      | 20 -------------------
 .../HideFloatingMicrophoneButtonPatch.kt      | 20 -------------------
 .../DisableFullscreenAmbientModePatch.kt      | 19 ------------------
 .../hide/general/HideLayoutComponentsPatch.kt | 20 -------------------
 .../hide/infocards/HideInfoCardsPatch.kt      | 20 -------------------
 .../HidePlayerFlyoutMenuPatch.kt              | 20 -------------------
 .../DisableRollingNumberAnimationPatch.kt     | 19 +-----------------
 .../layout/hide/seekbar/HideSeekbarPatch.kt   | 20 -------------------
 .../hide/shorts/HideShortsComponentsPatch.kt  | 20 -------------------
 .../DisableSuggestedVideoEndScreenPatch.kt    | 19 ------------------
 .../layout/hide/time/HideTimestampPatch.kt    | 19 ------------------
 .../layout/miniplayer/MiniplayerPatch.kt      | 18 -----------------
 .../panels/popup/PlayerPopupPanelsPatch.kt    | 20 -------------------
 .../PlayerControlsBackgroundPatch.kt          | 20 -------------------
 .../ReturnYouTubeDislikePatch.kt              | 18 -----------------
 .../ConversionContextFingerprint.kt           |  5 +----
 .../layout/searchbar/WideSearchbarPatch.kt    | 20 -------------------
 .../RestoreOldSeekbarThumbnailsPatch.kt       | 19 ------------------
 .../sponsorblock/SponsorBlockBytecodePatch.kt | 19 ------------------
 .../spoofappversion/SpoofAppVersionPatch.kt   | 20 -------------------
 .../layout/startpage/ChangeStartPagePatch.kt  | 19 +-----------------
 .../DisableResumingShortsOnStartupPatch.kt    | 20 -------------------
 .../layout/tablet/EnableTabletLayoutPatch.kt  | 20 -------------------
 .../layout/theme/ThemeBytecodePatch.kt        | 19 ------------------
 .../thumbnails/AlternativeThumbnailsPatch.kt  | 20 -------------------
 .../BypassImageRegionRestrictions.kt          | 20 -------------------
 .../misc/autorepeat/AutoRepeatPatch.kt        | 20 -------------------
 .../BackgroundPlaybackPatch.kt                | 19 ------------------
 .../spoof/SpoofDeviceDimensionsPatch.kt       | 18 -----------------
 ...ckWatchHistoryDomainNameResolutionPatch.kt | 20 -------------------
 .../fix/playback/SpoofVideoStreamsPatch.kt    | 19 ------------------
 .../youtube/misc/gms/GmsCoreSupportPatch.kt   | 19 ------------------
 .../misc/links/BypassURLRedirectsPatch.kt     | 19 +-----------------
 .../misc/links/OpenLinksExternallyPatch.kt    | 20 -------------------
 .../RemoveTrackingQueryParameterPatch.kt      | 19 +-----------------
 .../quality/RememberVideoQualityPatch.kt      | 19 ------------------
 .../youtube/video/speed/PlaybackSpeedPatch.kt | 19 ------------------
 .../RestoreOldVideoQualityMenuPatch.kt        | 20 -------------------
 58 files changed, 7 insertions(+), 1113 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
index a68b7ce80d..83289ba2aa 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
@@ -26,29 +26,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
index 05dfa95e73..d3b8b191b0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
@@ -20,29 +20,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
index a9980aeddd..777084de56 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
@@ -25,29 +25,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
index cf4383f68c..f1a5c4543b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
@@ -19,28 +19,9 @@ 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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
index f6e00d2b8c..f796334752 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
@@ -22,29 +22,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
index efa9223e8a..362ab9d3e3 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
@@ -25,28 +25,9 @@ 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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
index f0d714e542..933c912ae8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
@@ -24,29 +24,9 @@ import app.revanced.util.alsoResolve
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
index d02f62281e..fd142ca797 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
@@ -27,26 +27,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
+                // 18.38.44 patches but crashes on startup.
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
index 6873f6f34d..bfd4613cfc 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
@@ -30,26 +30,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
+                "18.38.44",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
index 7fd51d1067..fd434b8254 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
@@ -26,29 +26,9 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
index c3d57406d0..ca8d33860a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
@@ -24,29 +24,9 @@ import app.revanced.util.exception
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
index b700ef6fbe..139ef98536 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
@@ -23,29 +23,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
index 918a7a92fd..1f5790b92c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
@@ -34,29 +34,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
index 93d9389a2b..639f51424e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
@@ -24,29 +24,9 @@ import com.android.tools.smali.dexlib2.Opcode
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
index d6e711e595..763e96cfb2 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
@@ -37,29 +37,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
index d09fc2ff61..ef159bb3c0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
@@ -28,29 +28,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
index c0f8cfdec7..cf91532b72 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
@@ -22,29 +22,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
index f1438e06a4..7d894aa701 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
@@ -22,29 +22,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
index 13019a133e..e7a4b2cae4 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
@@ -22,29 +22,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
index 6f308a2615..436f52ea99 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
@@ -25,29 +25,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
index a9cd0e50dc..ef91437c0e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
@@ -22,29 +22,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
index 47fa09b4d0..58da6970b8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
@@ -18,29 +18,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
index c7862e554f..238ab29909 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
@@ -19,28 +19,9 @@ import app.revanced.util.exception
     compatiblePackages = [
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
index 64da7e43cf..ccdb0822b9 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
@@ -41,29 +41,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
index 4f03e032be..b7eafec80e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
@@ -30,29 +30,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
index c3e45a93ef..0f7485e27f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
@@ -23,29 +23,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
index f2cdd00757..e9c92fbc86 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
@@ -23,26 +23,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
+                // 18.43 is the earliest target this patch works.
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
index 79b8d94a6d..e84c5abb2d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
@@ -25,29 +25,9 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
index bffdbe6ce8..f2c0f3fd0f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
@@ -45,29 +45,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
index f611df325e..955bb6fa44 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
@@ -18,28 +18,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
     compatiblePackages = [
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
index 80cf8d3715..c79b55a00e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
@@ -19,28 +19,9 @@ import app.revanced.util.exception
     compatiblePackages = [
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index b0d5555561..80849ee145 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -83,27 +83,9 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
                 // 19.14.43 // Incomplete code for modern miniplayers.
                 // 19.15.36 // Different code for handling subtitle texts and not worth supporting.
                 "19.16.39", // First with modern miniplayers.
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
index 0a613b1e26..b058d0fdcd 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
@@ -19,29 +19,9 @@ import app.revanced.util.exception
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
index 302ab905ca..d1b8ec592c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
@@ -14,29 +14,9 @@ import org.w3c.dom.Element
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
index 9a2ee80d81..1e548aeab7 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
@@ -63,21 +63,7 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference
         CompatiblePackage(
             "com.google.android.youtube", [
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
@@ -307,10 +293,6 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
 
         // region Hook rolling numbers.
 
-        // Do this last to allow patching old unsupported versions (if the user really wants),
-        // On older unsupported version this will fail to resolve and throw an exception,
-        // but everything will still work correctly anyways.
-
         RollingNumberSetterFingerprint.result?.let {
             val dislikesIndex = it.scanResult.patternScanResult!!.endIndex
 
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/ConversionContextFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/ConversionContextFingerprint.kt
index 75b6eb55cc..92ff788295 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/ConversionContextFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/fingerprints/ConversionContextFingerprint.kt
@@ -10,9 +10,6 @@ internal object ConversionContextFingerprint : MethodFingerprint(
         ", heightConstraint=",
         ", templateLoggerFactory=",
         ", rootDisposableContainer=",
-        // 18.37.36 and after this String is: ConversionContext{containerInternal=
-        // and before it is: ConversionContext{container=
-        // Use a partial string to match both.
-        "ConversionContext{container"
+        "ConversionContext{containerInternal="
     )
 )
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
index 6be7171519..99b2fa42f9 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
@@ -24,29 +24,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                // 18.44.41 // Does not resolve.
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
index 5a72288a61..a50e5e1ee6 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
@@ -22,28 +22,9 @@ import app.revanced.util.exception
     compatiblePackages = [
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39"
                 // 19.17+ is not supported.
             ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
index 661b7bf0d7..b7780819fd 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
@@ -44,28 +44,9 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
index ebc53c171a..ffd2ae9df3 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
@@ -22,29 +22,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
index 5859328383..33af5a18d2 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
@@ -32,26 +32,9 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
+                "18.38.44",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
index e1708b606c..2ad43511c5 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
@@ -31,29 +31,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
index 070068ccf0..bb9955f5bc 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
@@ -26,29 +26,9 @@ import app.revanced.util.resultOrThrow
     compatiblePackages = [
         CompatiblePackage(
             "com.google.android.youtube", arrayOf(
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
index 11018e2e13..0574bf3b29 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
@@ -35,28 +35,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
index c50485ae8b..b01739543f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
@@ -28,29 +28,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
index 930cb6891f..b63be1e064 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
@@ -24,29 +24,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
index ae0af098ba..ced12fd37e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
@@ -23,29 +23,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
index 7ac7fe7d2b..4776df24e4 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
@@ -37,28 +37,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
index de521a9bd0..d5a54f4996 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
@@ -21,26 +21,8 @@ import app.revanced.util.exception
             "com.google.android.youtube",
             [
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
index 4d714b488e..09ce0fe16d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
@@ -18,29 +18,9 @@ import app.revanced.util.resultOrThrow
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
index 51f3529cc2..320128d89f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
@@ -49,28 +49,9 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
index 581b950466..4571667c2c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
@@ -32,28 +32,9 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
         CompatiblePackage(
             "com.google.android.youtube",
             setOf(
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
index acb78cb1a1..6954e23abf 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
@@ -35,26 +35,9 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
+                "18.38.44",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
index 6bc23809bc..783755bf21 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
@@ -24,29 +24,9 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
index a69d70adca..439d09292a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
@@ -28,26 +28,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
+                "18.38.44",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
index c41bd7201e..2eb1d2a48e 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
@@ -35,28 +35,9 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
     compatiblePackages = [
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
index 5885c84925..f4b0e430ec 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
@@ -21,28 +21,9 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
         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",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
index 6ff476231f..9a1b33069d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
@@ -29,29 +29,9 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
         CompatiblePackage(
             "com.google.android.youtube",
             [
-                "18.32.39",
-                "18.37.36",
                 "18.38.44",
-                "18.43.45",
-                "18.44.41",
-                "18.45.43",
-                "18.48.39",
                 "18.49.37",
-                "19.01.34",
-                "19.02.39",
-                "19.03.36",
-                "19.04.38",
                 "19.05.36",
-                "19.06.39",
-                "19.07.40",
-                "19.08.36",
-                "19.09.38",
-                "19.10.39",
-                "19.11.43",
-                "19.12.41",
-                "19.13.37",
-                "19.14.43",
-                "19.15.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",

From 4fddf1a58bca07fc889a4217d607108ff89c398f Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 19:34:45 -0400
Subject: [PATCH 105/143] fix variable naming

---
 .../layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt  | 4 ++--
 .../misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
index 1e548aeab7..e96966cdee 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
@@ -219,7 +219,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
 
         ShortsTextViewFingerprint.result?.let {
             it.mutableMethod.apply {
-                val insertIndex = it.scanResult.patternScanResult!!.endIndex
+                val insertIndex = it.scanResult.patternScanResult!!.endIndex + 1
 
                 // If the field is true, the TextView is for a dislike button.
                 val isDisLikesBooleanInstruction = getInstructions().first { instruction ->
@@ -239,7 +239,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                 // If RYD is disabled, or the TextView object is not that of the dislike button, the execution flow is not interrupted.
                 // Otherwise, the TextView object is modified, and the execution flow is interrupted to prevent it from being changed afterward.
                 addInstructionsWithLabels(
-                    insertIndex + 1,
+                    insertIndex,
                     """
                         # Check, if the TextView is for a dislike button
                         iget-boolean v0, p0, $isDisLikesBooleanReference
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt
index 4db3b08b23..575d93e3ef 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/recyclerviewtree/hook/RecyclerViewTreeHookPatch.kt
@@ -21,12 +21,12 @@ internal object RecyclerViewTreeHookPatch : BytecodePatch(
 
         RecyclerViewTreeObserverFingerprint.result?.let {
             it.mutableMethod.apply {
-                val startIndex = it.scanResult.patternScanResult!!.startIndex
+                val insertIndex = it.scanResult.patternScanResult!!.startIndex + 1
                 val recyclerViewParameter = 2
 
                 addHook = { classDescriptor ->
                     addInstruction(
-                        startIndex + 1,
+                        insertIndex,
                         "invoke-static/range { p$recyclerViewParameter .. p$recyclerViewParameter }, $classDescriptor->onFlyoutMenuCreate(Landroid/support/v7/widget/RecyclerView;)V"
                     )
                 }

From 4fd89eafa3cfb8332a8efd7b10f0d9b3c0af9bdd Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 19:49:06 -0400
Subject: [PATCH 106/143] fix string keys

---
 .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt      | 4 ++--
 src/main/resources/addresources/values/strings.xml            | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 80849ee145..8b8b5e9f70 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -153,9 +153,9 @@ object MiniplayerPatch : BytecodePatch(
                 key = "revanced_miniplayer_hide_expand_close",
                 summaryOnKey =
                 if (VersionCheckPatch.is_19_26_or_greater) {
-                    "revanced_miniplayer_hide_expand_close_19_26_summary_on"
-                } else {
                     "revanced_miniplayer_hide_expand_close_summary_on"
+                } else {
+                    "revanced_miniplayer_hide_expand_close_legacy_summary_on"
                 }
             )
 
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index d617e8b7c6..cb23e2cc1e 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -1003,8 +1003,8 @@ This is because Crowdin requires temporarily flattening this file and removing t
             Drag and drop is enabled\n\nMiniplayer can be dragged to any corner of the screen
             Drag and drop is disabled
             Hide expand and close buttons
-            Buttons are hidden\n\nSwipe to expand or close
-            Buttons are hidden\n\nTap to expand, swipe to close
+            Buttons are hidden\n\nTap to expand, swipe to close
+            Buttons are hidden\n\nSwipe to expand or close
             Expand and close buttons are shown
             Hide subtexts
             Subtexts are hidden

From aa27ca83b04d81da7a44be1c2daa27fab6ae4e0a Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 3 Oct 2024 19:51:25 -0400
Subject: [PATCH 107/143] Comments

---
 .../patches/youtube/misc/settings/SettingsResourcePatch.kt     | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
index 33d12a5c4d..a5c5962406 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/settings/SettingsResourcePatch.kt
@@ -39,7 +39,8 @@ object SettingsResourcePatch : BaseSettingsResourcePatch(
         }
 
         // Copy style properties used to fix over-sized copy menu that appear in EditTextPreference.
-        // See integrations code for a full explanation of how this fixes the issue.
+        // For a full explanation of how this fixes the issue, see the comments in this style file
+        // and the comments in the integrations code.
         val targetResource = "values/styles.xml"
         inputStreamFromBundledResource(
             "settings/host",

From 84243fccf4623237add67da7a64bbb4144146078 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 4 Oct 2024 19:50:27 -0400
Subject: [PATCH 108/143] refactor: Simplify

---
 .../layout/miniplayer/MiniplayerPatch.kt      | 13 ++--
 .../ReturnYouTubeDislikePatch.kt              | 59 ++++++-------------
 .../kotlin/app/revanced/util/BytecodeUtils.kt | 23 ++++++++
 3 files changed, 45 insertions(+), 50 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 8b8b5e9f70..69a2ab6092 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -6,7 +6,6 @@ import app.revanced.patcher.data.BytecodeContext
 import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
 import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
-import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
 import app.revanced.patcher.fingerprint.MethodFingerprint
 import app.revanced.patcher.patch.BytecodePatch
@@ -30,6 +29,7 @@ import app.revanced.patches.youtube.layout.miniplayer.MiniplayerResourcePatch.sc
 import app.revanced.patches.youtube.layout.miniplayer.MiniplayerResourcePatch.ytOutlinePictureInPictureWhite24
 import app.revanced.patches.youtube.layout.miniplayer.MiniplayerResourcePatch.ytOutlineXWhite24
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerDimensionsCalculatorParentFingerprint
+import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerMinimumSizeFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernAddViewListenerFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernCloseButtonFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerModernConstructorFingerprint
@@ -42,13 +42,13 @@ import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerMod
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerOverrideFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerOverrideNoContextFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerResponseModelSizeCheckFingerprint
-import app.revanced.patches.youtube.layout.miniplayer.fingerprints.MiniplayerMinimumSizeFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.YouTubePlayerOverlaysLayoutFingerprint
 import app.revanced.patches.youtube.layout.miniplayer.fingerprints.YouTubePlayerOverlaysLayoutFingerprint.YOUTUBE_PLAYER_OVERLAYS_LAYOUT_CLASS_NAME
 import app.revanced.patches.youtube.layout.tablet.fingerprints.GetFormFactorFingerprint
 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.util.addInstructionsAtControlFlowLabel
 import app.revanced.util.alsoResolve
 import app.revanced.util.findOpcodeIndicesReversed
 import app.revanced.util.getReference
@@ -61,7 +61,6 @@ import com.android.tools.smali.dexlib2.builder.MutableMethodImplementation
 import com.android.tools.smali.dexlib2.iface.Method
 import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
-import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
 import com.android.tools.smali.dexlib2.iface.reference.FieldReference
 import com.android.tools.smali.dexlib2.iface.reference.TypeReference
@@ -483,17 +482,13 @@ object MiniplayerPatch : BytecodePatch(
      */
     private fun MutableMethod.insertModernMiniplayerTypeOverride(iPutIndex: Int) {
         val targetInstruction = getInstruction(iPutIndex)
-        val targetReference = (targetInstruction as ReferenceInstruction).reference
 
-        addInstructions(
-            iPutIndex + 1, """
+        addInstructionsAtControlFlowLabel(
+            iPutIndex, """
                 invoke-static { v${targetInstruction.registerA} }, $INTEGRATIONS_CLASS_DESCRIPTOR->getModernMiniplayerOverrideType(I)I
                 move-result v${targetInstruction.registerA}
-                # Original instruction
-                iput v${targetInstruction.registerA}, v${targetInstruction.registerB}, $targetReference 
             """
         )
-        removeInstruction(iPutIndex)
     }
 
     private fun MutableMethod.hookInflatedView(
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
index e96966cdee..0bcd06ea13 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
@@ -6,7 +6,6 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
 import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
-import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
 import app.revanced.patcher.fingerprint.MethodFingerprint
 import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.PatchException
@@ -36,16 +35,15 @@ import app.revanced.util.alsoResolve
 import app.revanced.util.exception
 import app.revanced.util.getReference
 import app.revanced.util.indexOfFirstInstructionOrThrow
+import app.revanced.util.addInstructionsAtControlFlowLabel
 import app.revanced.util.resultOrThrow
 import com.android.tools.smali.dexlib2.Opcode
 import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
-import com.android.tools.smali.dexlib2.iface.instruction.RegisterRangeInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
 import com.android.tools.smali.dexlib2.iface.reference.FieldReference
 import com.android.tools.smali.dexlib2.iface.reference.MethodReference
-import com.android.tools.smali.dexlib2.iface.reference.Reference
 import com.android.tools.smali.dexlib2.iface.reference.TypeReference
 
 @Patch(
@@ -112,7 +110,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
             DislikeFingerprint.toPatch(Vote.DISLIKE),
             RemoveLikeFingerprint.toPatch(Vote.REMOVE_LIKE)
         ).forEach { (fingerprint, vote) ->
-            fingerprint.result?.mutableMethod?.apply {
+            fingerprint.resultOrThrow().mutableMethod.apply {
                 addInstructions(
                     0,
                     """
@@ -120,7 +118,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                         invoke-static {v0}, $INTEGRATIONS_CLASS_DESCRIPTOR->sendVote(I)V
                     """
                 )
-            } ?: throw fingerprint.exception
+            }
         }
 
         // endregion
@@ -143,7 +141,6 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                 // Find the instruction for creating the text data object.
                 val textDataClassType = TextComponentDataFingerprint.resultOrThrow().classDef.type
 
-                val originalSmali : String
                 val insertIndex : Int
                 val tempRegister : Int
                 val charSequenceRegister : Int
@@ -154,15 +151,6 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                                 getReference()?.returnType == textDataClassType
                     }
 
-                    // Convert the original instruction to smali.
-                    // Would be handy if BuilderInstruction.toString() gave the smali, but it doesn't.
-                    // Maybe there's an easier way.
-                    val originalInstruction = getInstruction(insertIndex)
-                    val originalStartRegister = originalInstruction.startRegister
-                    val originalEndRegister = originalStartRegister + originalInstruction.registerCount - 1
-                    val originalReference = originalInstruction.getReference()
-                    originalSmali = "invoke-static/range { v$originalStartRegister .. v$originalEndRegister }, $originalReference"
-
                     tempRegister = getInstruction(insertIndex + 1).registerA
 
                     // Find the instruction that sets the span to an instance field.
@@ -179,11 +167,6 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                                 getReference()?.type == textDataClassType
                     }
 
-                    val originalInstruction = getInstruction(insertIndex)
-                    val originalRegister = originalInstruction.registerA
-                    val originalReference = originalInstruction.getReference()
-                    originalSmali = "new-instance v$originalRegister, $originalReference"
-
                     tempRegister = getInstruction(insertIndex).registerA
 
                     charSequenceRegister = getInstruction(
@@ -194,22 +177,15 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                     ).registerA
                 }
 
-                // Add original instruction to preserve control flow.
-                // Would be helpful if instructions could be added at a control label.
-                addInstructions(
-                    insertIndex + 1,
+                addInstructionsAtControlFlowLabel(insertIndex,
                     """
                         # Copy conversion context
                         move-object/from16 v$tempRegister, p0
                         iget-object v$tempRegister, v$tempRegister, $conversionContextField
                         invoke-static { v$tempRegister, v$charSequenceRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->onLithoTextLoaded(Ljava/lang/Object;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;
                         move-result-object v$charSequenceRegister
-                        
-                        $originalSmali
                     """
                 )
-
-                removeInstruction(insertIndex)
             }
         }
 
@@ -217,7 +193,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
 
         // region Hook for non-litho Short videos.
 
-        ShortsTextViewFingerprint.result?.let {
+        ShortsTextViewFingerprint.resultOrThrow().let {
             it.mutableMethod.apply {
                 val insertIndex = it.scanResult.patternScanResult!!.endIndex + 1
 
@@ -258,7 +234,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                     """
                 )
             }
-        } ?: throw ShortsTextViewFingerprint.exception
+        }
 
         // endregion
 
@@ -293,16 +269,14 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
 
         // region Hook rolling numbers.
 
-        RollingNumberSetterFingerprint.result?.let {
+        RollingNumberSetterFingerprint.resultOrThrow().let {
             val dislikesIndex = it.scanResult.patternScanResult!!.endIndex
 
             it.mutableMethod.apply {
                 val insertIndex = 1
 
-                val charSequenceInstanceRegister =
-                    getInstruction(0).registerA
-                val charSequenceFieldReference =
-                    getInstruction(dislikesIndex).reference
+                val charSequenceInstanceRegister = getInstruction(0).registerA
+                val charSequenceFieldReference = getInstruction(dislikesIndex).reference
 
                 val registerCount = implementation!!.registerCount
 
@@ -320,7 +294,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                     """
                 )
             }
-        } ?: throw RollingNumberSetterFingerprint.exception
+        }
 
         // Rolling Number text views use the measured width of the raw string for layout.
         // Modify the measure text calculation to include the left drawable separator if needed.
@@ -344,8 +318,12 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
 
         // Additional text measurement method. Used if YouTube decides not to animate the likes count
         // and sometimes used for initial video load.
-        RollingNumberMeasureStaticLabelFingerprint.alsoResolve(context, RollingNumberMeasureStaticLabelParentFingerprint).let {
+        RollingNumberMeasureStaticLabelFingerprint.alsoResolve(
+            context,
+            RollingNumberMeasureStaticLabelParentFingerprint
+        ).let {
             val measureTextIndex = it.scanResult.patternScanResult!!.startIndex + 1
+
             it.mutableMethod.apply {
                 val freeRegister = getInstruction(0).registerA
 
@@ -361,15 +339,14 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
 
         // The rolling number Span is missing styling since it's initially set as a String.
         // Modify the UI text view and use the styled like/dislike Span.
-        RollingNumberTextViewFingerprint.result?.let {
+        RollingNumberTextViewFingerprint.resultOrThrow().let {
             // Initial TextView is set in this method.
             val initiallyCreatedTextViewMethod = it.mutableMethod
 
             // Videos less than 24 hours after uploaded, like counts will be updated in real time.
             // Whenever like counts are updated, TextView is set in this method.
             val realTimeUpdateTextViewMethod =
-                RollingNumberTextViewAnimationUpdateFingerprint.result?.mutableMethod
-                    ?: throw RollingNumberTextViewAnimationUpdateFingerprint.exception
+                RollingNumberTextViewAnimationUpdateFingerprint.resultOrThrow().mutableMethod
 
             arrayOf(
                 initiallyCreatedTextViewMethod,
@@ -394,7 +371,7 @@ object ReturnYouTubeDislikePatch : BytecodePatch(
                     )
                 }
             }
-        } ?: throw RollingNumberTextViewFingerprint.exception
+        }
 
         // endregion
 
diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
index accec70de4..c2bb6bea17 100644
--- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
+++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
@@ -3,6 +3,8 @@ package app.revanced.util
 import app.revanced.patcher.data.BytecodeContext
 import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
+import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
+import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
 import app.revanced.patcher.fingerprint.MethodFingerprint
 import app.revanced.patcher.patch.PatchException
 import app.revanced.patcher.util.proxy.mutableTypes.MutableClass
@@ -65,6 +67,27 @@ fun MutableMethod.injectHideViewCall(
     "invoke-static { v$viewRegister }, $classDescriptor->$targetMethod(Landroid/view/View;)V",
 )
 
+/**
+ * Inserts instructions at a given index, using the existing control flow label at that index.
+ */
+internal fun MutableMethod.addInstructionsAtControlFlowLabel(
+    insertIndex: Int,
+    instructions: String,
+) {
+    // Duplicate original instruction and add to +1 index.
+    addInstruction(insertIndex + 1, getInstruction(insertIndex))
+
+    // Add patch code at same index as duplicated instruction,
+    // so it uses the original instruction control flow label.
+    addInstructions(insertIndex + 1, instructions)
+
+    // Remove original non duplicated instruction.
+    removeInstruction(insertIndex)
+
+    // Original instruction is now after the inserted patch instructions,
+    // and the original control flow label is on the first instruction of the patch code.
+}
+
 /**
  * Get the index of the first instruction with the id of the given resource name.
  *

From cd8f83ba76a0d760ff19fec05f7f69098a35f892 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sun, 6 Oct 2024 06:52:33 -0400
Subject: [PATCH 109/143] fix dialog text background if theme patch is excluded

---
 src/main/resources/settings/host/values/styles.xml | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/main/resources/settings/host/values/styles.xml b/src/main/resources/settings/host/values/styles.xml
index 41e66d8195..7c8412f9f6 100644
--- a/src/main/resources/settings/host/values/styles.xml
+++ b/src/main/resources/settings/host/values/styles.xml
@@ -5,8 +5,7 @@
     'android:windowBackground' is the background color of the alert dialog.
         If not overridden, the background color of the parent theme 'android.R.style.ThemeOverlay_Material_Dialog' is used.
 
-    'R.attr.ytBaseBackground' is the background color in YouTube settings.
-        'R.color.yt_white1' color is used in light theme, and the 'R.color.yt_black3' color is used in dark theme.
+    'R.attr.ytRaisedBackground' is the background color of the YouTube alert dialog.
 
     'android:windowIsTranslucent' makes the dialog window transparent.
 
@@ -19,7 +18,7 @@
 -->
 
     

From b6b759f7d1e3b8a9f579988dd9da35810d88724d Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 15 Oct 2024 01:53:49 -0400
Subject: [PATCH 110/143] Miniplayer: Add rounded corners setting if patching
 19.36+

---
 .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt  | 8 ++++++--
 .../MiniplayerModernConstructorFingerprint.kt             | 2 +-
 src/main/resources/addresources/values/strings.xml        | 3 +++
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 69a2ab6092..c87ba88f79 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -164,6 +164,10 @@ object MiniplayerPatch : BytecodePatch(
 
             preferences += SwitchPreference("revanced_miniplayer_hide_subtext")
 
+            if (VersionCheckPatch.is_19_36_or_greater) {
+                preferences += SwitchPreference("revanced_miniplayer_rounded_corners")
+            }
+
             if (VersionCheckPatch.is_19_26_or_greater) {
                 preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER)
             }
@@ -306,8 +310,8 @@ object MiniplayerPatch : BytecodePatch(
             )
 
             MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
-                MiniplayerModernConstructorFingerprint.VIEW_OUTLINE_PROVIDER_FEATURE_KEY,
-                "setUseBackgroundViewOutlineProvider"
+                MiniplayerModernConstructorFingerprint.ROUNDED_CORNERS,
+                "setRoundedCorners"
             )
         }
 
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt
index e7d976b433..5fdd6ecdc1 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt
@@ -17,5 +17,5 @@ internal object MiniplayerModernConstructorFingerprint : LiteralValueFingerprint
     const val INITIAL_SIZE_FEATURE_KEY_LITERAL = 45640023L
     const val ANIMATION_INTERPOLATION_FEATURE_KEY = 45647018L
     const val DROP_SHADOW_FEATURE_KEY = 45652223L
-    const val VIEW_OUTLINE_PROVIDER_FEATURE_KEY = 45652224L
+    const val ROUNDED_CORNERS = 45652224L
 }
\ No newline at end of file
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index fcce2716f0..3f78c5ba85 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -1020,6 +1020,9 @@ This is because Crowdin requires temporarily flattening this file and removing t
             Hide skip forward and back buttons
             Skip forward and back are hidden
             Skip forward and back are shown
+            Use rounded corners
+            Corners are rounded
+            Corners are square
             Overlay opacity
             Opacity value between 0-100, where 0 is transparent
             Miniplayer overlay opacity must be between 0-100

From 4123b01c456a2b607e4e4cabe99a21d342459de3 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 15 Oct 2024 19:52:28 -0400
Subject: [PATCH 111/143] fix(Hide player buttons patch): fix 19.34

---
 .../player/hide/HidePlayerButtonsPatch.kt     | 56 +++++++++----------
 .../hide/HidePlayerButtonsResourcePatch.kt    | 24 ++++++++
 ...PlayerControlsPreviousButtonFingerprint.kt | 20 +++++++
 ...layerControlsVisibilityModelFingerprint.kt |  9 ---
 4 files changed, 71 insertions(+), 38 deletions(-)
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsResourcePatch.kt
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousButtonFingerprint.kt
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsVisibilityModelFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
index ef159bb3c0..739d1220e1 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
@@ -1,20 +1,23 @@
 package app.revanced.patches.youtube.layout.buttons.player.hide
 
 import app.revanced.patcher.data.BytecodeContext
-import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
+import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
 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.shared.misc.settings.preference.SwitchPreference
-import app.revanced.patches.youtube.layout.buttons.player.hide.HidePlayerButtonsPatch.ParameterOffsets.HAS_NEXT
-import app.revanced.patches.youtube.layout.buttons.player.hide.HidePlayerButtonsPatch.ParameterOffsets.HAS_PREVIOUS
-import app.revanced.patches.youtube.layout.buttons.player.hide.fingerprints.PlayerControlsVisibilityModelFingerprint
+import app.revanced.patches.youtube.layout.buttons.player.hide.fingerprints.PlayerControlsPreviousButtonFingerprint
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
-import app.revanced.util.exception
-import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
+import app.revanced.util.getReference
+import app.revanced.util.indexOfFirstInstructionOrThrow
+import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow
+import app.revanced.util.resultOrThrow
+import com.android.tools.smali.dexlib2.Opcode
+import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
+import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 
 @Patch(
     name = "Hide player buttons",
@@ -22,7 +25,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
     dependencies = [
         IntegrationsPatch::class,
         SettingsPatch::class,
-        AddResourcesPatch::class
+        AddResourcesPatch::class,
+        HidePlayerButtonsResourcePatch::class,
     ],
     compatiblePackages = [
         CompatiblePackage(
@@ -40,7 +44,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
 )
 @Suppress("unused")
 object HidePlayerButtonsPatch : BytecodePatch(
-    setOf(PlayerControlsVisibilityModelFingerprint)
+    setOf(PlayerControlsPreviousButtonFingerprint)
 ) {
     override fun execute(context: BytecodeContext) {
         AddResourcesPatch(this::class)
@@ -49,29 +53,23 @@ object HidePlayerButtonsPatch : BytecodePatch(
             SwitchPreference("revanced_hide_player_buttons")
         )
 
-        PlayerControlsVisibilityModelFingerprint.result?.apply {
-            val callIndex = scanResult.patternScanResult!!.endIndex
-            val callInstruction = mutableMethod.getInstruction(callIndex)
+        PlayerControlsPreviousButtonFingerprint.resultOrThrow().mutableMethod.apply {
+            val resourceIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
+                HidePlayerButtonsResourcePatch.playerControlPreviousButton
+            )
 
-            // overriding this parameter register hides the previous and next buttons
-            val hasNextParameterRegister = callInstruction.startRegister + HAS_NEXT
-            val hasPreviousParameterRegister = callInstruction.startRegister + HAS_PREVIOUS
+            val insertIndex = indexOfFirstInstructionOrThrow(resourceIndex) {
+                opcode == Opcode.INVOKE_STATIC
+                        && getReference()?.parameterTypes?.firstOrNull() == "Landroid/view/View;"
+            }
 
-            mutableMethod.addInstructions(
-                callIndex,
-                """
-                    invoke-static { v$hasNextParameterRegister }, Lapp/revanced/integrations/youtube/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z
-                    move-result v$hasNextParameterRegister
-                    
-                    invoke-static { v$hasPreviousParameterRegister }, Lapp/revanced/integrations/youtube/patches/HidePlayerButtonsPatch;->previousOrNextButtonIsVisible(Z)Z
-                    move-result v$hasPreviousParameterRegister
-                """
-            )
-        } ?: throw PlayerControlsVisibilityModelFingerprint.exception
-    }
+            val viewRegister = getInstruction(insertIndex).registerC
 
-    private object ParameterOffsets {
-        const val HAS_NEXT = 5
-        const val HAS_PREVIOUS = 6
+            addInstruction(
+                insertIndex,
+                "invoke-static { v$viewRegister }, Lapp/revanced/integrations/youtube/patches/HidePlayerButtonsPatch;" +
+                        "->hidePreviousNextButtons(Landroid/view/View;)V"
+            )
+        }
     }
 }
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsResourcePatch.kt
new file mode 100644
index 0000000000..eec87b7a66
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsResourcePatch.kt
@@ -0,0 +1,24 @@
+package app.revanced.patches.youtube.layout.buttons.player.hide
+
+import app.revanced.patcher.data.ResourceContext
+import app.revanced.patcher.patch.ResourcePatch
+import app.revanced.patcher.patch.annotation.Patch
+import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
+
+@Patch(dependencies = [ResourceMappingPatch::class])
+internal object HidePlayerButtonsResourcePatch : ResourcePatch() {
+    var playerControlPreviousButton = -1L
+    var playerControlNextButton = -1L
+
+    override fun execute(context: ResourceContext) {
+        playerControlPreviousButton = ResourceMappingPatch[
+            "id",
+            "player_control_previous_button"
+        ]
+
+        playerControlNextButton = ResourceMappingPatch[
+            "id",
+            "player_control_next_button"
+        ]
+    }
+}
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousButtonFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousButtonFingerprint.kt
new file mode 100644
index 0000000000..6383897e1f
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousButtonFingerprint.kt
@@ -0,0 +1,20 @@
+package app.revanced.patches.youtube.layout.buttons.player.hide.fingerprints
+
+import app.revanced.patcher.extensions.or
+import app.revanced.patcher.fingerprint.MethodFingerprint
+import app.revanced.patches.youtube.layout.buttons.player.hide.HidePlayerButtonsResourcePatch
+import app.revanced.util.containsWideLiteralInstructionValue
+import com.android.tools.smali.dexlib2.AccessFlags
+
+internal object PlayerControlsPreviousButtonFingerprint : MethodFingerprint(
+    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
+    returnType = "V",
+    strings = listOf("1.0x"),
+    customFingerprint = { methodDef, _ ->
+        methodDef.containsWideLiteralInstructionValue(
+            HidePlayerButtonsResourcePatch.playerControlPreviousButton
+        ) && methodDef.containsWideLiteralInstructionValue(
+            HidePlayerButtonsResourcePatch.playerControlNextButton
+        )
+    }
+)
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsVisibilityModelFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsVisibilityModelFingerprint.kt
deleted file mode 100644
index 4aae5c27ed..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsVisibilityModelFingerprint.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package app.revanced.patches.youtube.layout.buttons.player.hide.fingerprints
-
-import app.revanced.patcher.fingerprint.MethodFingerprint
-import com.android.tools.smali.dexlib2.Opcode
-
-internal object PlayerControlsVisibilityModelFingerprint : MethodFingerprint(
-    opcodes = listOf(Opcode.INVOKE_DIRECT_RANGE),
-    strings = listOf("Missing required properties:", "hasNext", "hasPrevious")
-)
\ No newline at end of file

From 53a2917f3a36fdc43fd83393c5b78560822d6be5 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 15 Oct 2024 21:45:21 -0400
Subject: [PATCH 112/143] refactor

---
 .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt      | 4 ++--
 .../fingerprints/MiniplayerModernConstructorFingerprint.kt    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index c87ba88f79..b60caecc74 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -247,7 +247,7 @@ object MiniplayerPatch : BytecodePatch(
 
         if (VersionCheckPatch.is_19_25_or_greater) {
             MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
-                MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_OLD_TARGETS_FEATURE_KEY_LITERAL,
+                MiniplayerModernConstructorFingerprint.MODERN_MINIPLAYER_ENABLED_OLD_TARGETS_FEATURE_KEY,
                 "getModernMiniplayerOverride"
             )
 
@@ -310,7 +310,7 @@ object MiniplayerPatch : BytecodePatch(
             )
 
             MiniplayerModernConstructorFingerprint.insertLiteralValueBooleanOverride(
-                MiniplayerModernConstructorFingerprint.ROUNDED_CORNERS,
+                MiniplayerModernConstructorFingerprint.ROUNDED_CORNERS_FEATURE_KEY,
                 "setRoundedCorners"
             )
         }
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt
index 5fdd6ecdc1..1b0c7096e2 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/fingerprints/MiniplayerModernConstructorFingerprint.kt
@@ -11,11 +11,11 @@ internal object MiniplayerModernConstructorFingerprint : LiteralValueFingerprint
 ) {
     const val MODERN_FEATURE_FLAGS_ENABLED_KEY_LITERAL = 45622882L
     // In later targets this feature flag does nothing and is dead code.
-    const val MODERN_MINIPLAYER_ENABLED_OLD_TARGETS_FEATURE_KEY_LITERAL = 45630429L
+    const val MODERN_MINIPLAYER_ENABLED_OLD_TARGETS_FEATURE_KEY = 45630429L
     const val DOUBLE_TAP_ENABLED_FEATURE_KEY_LITERAL = 45628823L
     const val DRAG_DROP_ENABLED_FEATURE_KEY_LITERAL = 45628752L
     const val INITIAL_SIZE_FEATURE_KEY_LITERAL = 45640023L
     const val ANIMATION_INTERPOLATION_FEATURE_KEY = 45647018L
     const val DROP_SHADOW_FEATURE_KEY = 45652223L
-    const val ROUNDED_CORNERS = 45652224L
+    const val ROUNDED_CORNERS_FEATURE_KEY = 45652224L
 }
\ No newline at end of file

From e8043a2321f38d45854737fcd5cc8354d51f2655 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Tue, 15 Oct 2024 23:13:47 -0400
Subject: [PATCH 113/143] fix: Allow double tapping area where forward/back
 normally is.

---
 .../buttons/player/hide/HidePlayerButtonsPatch.kt    |  8 ++++----
 .../player/hide/HidePlayerButtonsResourcePatch.kt    | 12 ++++++------
 ...erControlsPreviousNextOverlayTouchFingerprint.kt} |  6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)
 rename src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/{PlayerControlsPreviousButtonFingerprint.kt => PlayerControlsPreviousNextOverlayTouchFingerprint.kt} (87%)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
index 739d1220e1..eaf29c9630 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
@@ -8,7 +8,7 @@ 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.layout.buttons.player.hide.fingerprints.PlayerControlsPreviousButtonFingerprint
+import app.revanced.patches.youtube.layout.buttons.player.hide.fingerprints.PlayerControlsPreviousNextOverlayTouchFingerprint
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.util.getReference
@@ -44,7 +44,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 )
 @Suppress("unused")
 object HidePlayerButtonsPatch : BytecodePatch(
-    setOf(PlayerControlsPreviousButtonFingerprint)
+    setOf(PlayerControlsPreviousNextOverlayTouchFingerprint)
 ) {
     override fun execute(context: BytecodeContext) {
         AddResourcesPatch(this::class)
@@ -53,9 +53,9 @@ object HidePlayerButtonsPatch : BytecodePatch(
             SwitchPreference("revanced_hide_player_buttons")
         )
 
-        PlayerControlsPreviousButtonFingerprint.resultOrThrow().mutableMethod.apply {
+        PlayerControlsPreviousNextOverlayTouchFingerprint.resultOrThrow().mutableMethod.apply {
             val resourceIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
-                HidePlayerButtonsResourcePatch.playerControlPreviousButton
+                HidePlayerButtonsResourcePatch.playerControlPreviousButtonTouchArea
             )
 
             val insertIndex = indexOfFirstInstructionOrThrow(resourceIndex) {
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsResourcePatch.kt
index eec87b7a66..7bd23b17a1 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsResourcePatch.kt
@@ -7,18 +7,18 @@ import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
 
 @Patch(dependencies = [ResourceMappingPatch::class])
 internal object HidePlayerButtonsResourcePatch : ResourcePatch() {
-    var playerControlPreviousButton = -1L
-    var playerControlNextButton = -1L
+    var playerControlPreviousButtonTouchArea = -1L
+    var playerControlNextButtonTouchArea = -1L
 
     override fun execute(context: ResourceContext) {
-        playerControlPreviousButton = ResourceMappingPatch[
+        playerControlPreviousButtonTouchArea = ResourceMappingPatch[
             "id",
-            "player_control_previous_button"
+            "player_control_previous_button_touch_area"
         ]
 
-        playerControlNextButton = ResourceMappingPatch[
+        playerControlNextButtonTouchArea = ResourceMappingPatch[
             "id",
-            "player_control_next_button"
+            "player_control_next_button_touch_area"
         ]
     }
 }
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousButtonFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousNextOverlayTouchFingerprint.kt
similarity index 87%
rename from src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousButtonFingerprint.kt
rename to src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousNextOverlayTouchFingerprint.kt
index 6383897e1f..131bf47130 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousButtonFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/fingerprints/PlayerControlsPreviousNextOverlayTouchFingerprint.kt
@@ -6,15 +6,15 @@ import app.revanced.patches.youtube.layout.buttons.player.hide.HidePlayerButtons
 import app.revanced.util.containsWideLiteralInstructionValue
 import com.android.tools.smali.dexlib2.AccessFlags
 
-internal object PlayerControlsPreviousButtonFingerprint : MethodFingerprint(
+internal object PlayerControlsPreviousNextOverlayTouchFingerprint : MethodFingerprint(
     accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
     returnType = "V",
     strings = listOf("1.0x"),
     customFingerprint = { methodDef, _ ->
         methodDef.containsWideLiteralInstructionValue(
-            HidePlayerButtonsResourcePatch.playerControlPreviousButton
+            HidePlayerButtonsResourcePatch.playerControlPreviousButtonTouchArea
         ) && methodDef.containsWideLiteralInstructionValue(
-            HidePlayerButtonsResourcePatch.playerControlNextButton
+            HidePlayerButtonsResourcePatch.playerControlNextButtonTouchArea
         )
     }
 )
\ No newline at end of file

From e419412079592302c22fd7f0edddaf5874820125 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Thu, 17 Oct 2024 22:11:38 -0400
Subject: [PATCH 114/143] Work in progress: Do not use Cairo seekbar in the
 player.  Still needs more work as the feed seekbar is set somewhere else.

---
 .../seekbar/SeekbarColorBytecodePatch.kt      | 37 +++++++++++++++++--
 .../CairoSeekbarConfigFingerprint.kt          | 12 ++++++
 .../layout/theme/ThemeResourcePatch.kt        |  6 +++
 .../resources/addresources/values/strings.xml |  5 ++-
 4 files changed, 55 insertions(+), 5 deletions(-)
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/CairoSeekbarConfigFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
index 08d3fa0274..81da990814 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
@@ -7,14 +7,19 @@ import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.CompatiblePackage
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.CairoSeekbarConfigFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.SetSeekbarClickedColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.ShortsSeekbarColorFingerprint
 import app.revanced.patches.youtube.layout.theme.LithoColorHookPatch
 import app.revanced.patches.youtube.layout.theme.LithoColorHookPatch.lithoColorOverrideHook
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
+import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.util.exception
+import app.revanced.util.indexOfFirstInstructionOrThrow
 import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow
+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.instruction.TwoRegisterInstruction
 
@@ -24,7 +29,12 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
     compatiblePackages = [CompatiblePackage("com.google.android.youtube")]
 )
 internal object SeekbarColorBytecodePatch : BytecodePatch(
-    setOf(PlayerSeekbarColorFingerprint, ShortsSeekbarColorFingerprint, SetSeekbarClickedColorFingerprint)
+    setOf(
+        PlayerSeekbarColorFingerprint,
+        ShortsSeekbarColorFingerprint,
+        SetSeekbarClickedColorFingerprint,
+        CairoSeekbarConfigFingerprint,
+    )
 ) {
     private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/theme/SeekbarColorPatch;"
 
@@ -32,12 +42,13 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
         fun MutableMethod.addColorChangeInstructions(resourceId: Long) {
             val registerIndex = indexOfFirstWideLiteralInstructionValueOrThrow(resourceId) + 2
             val colorRegister = getInstruction(registerIndex).registerA
+
             addInstructions(
                 registerIndex + 1,
                 """
-                        invoke-static { v$colorRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getVideoPlayerSeekbarColor(I)I
-                        move-result v$colorRegister
-                    """
+                    invoke-static { v$colorRegister }, $INTEGRATIONS_CLASS_DESCRIPTOR->getVideoPlayerSeekbarColor(I)I
+                    move-result v$colorRegister
+                """
             )
         }
 
@@ -71,6 +82,24 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
             }
         } ?: throw SetSeekbarClickedColorFingerprint.exception
 
+        if (VersionCheckPatch.is_19_23_or_greater) {
+            CairoSeekbarConfigFingerprint.resultOrThrow().mutableMethod.apply {
+                val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
+                    CairoSeekbarConfigFingerprint.CAIRO_SEEKBAR_FEATURE_FLAG
+                )
+                val resultIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
+                val register = getInstruction(resultIndex).registerA
+
+                addInstructions(
+                    resultIndex + 1,
+                    """
+                        invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->cairoSeekbarEnabled(Z)Z
+                        move-result v$register
+                    """
+                )
+            }
+        }
+
         lithoColorOverrideHook(INTEGRATIONS_CLASS_DESCRIPTOR, "getLithoColor")
     }
 }
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/CairoSeekbarConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/CairoSeekbarConfigFingerprint.kt
new file mode 100644
index 0000000000..cd874a37ef
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/CairoSeekbarConfigFingerprint.kt
@@ -0,0 +1,12 @@
+package app.revanced.patches.youtube.layout.seekbar.fingerprints
+
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.CairoSeekbarConfigFingerprint.CAIRO_SEEKBAR_FEATURE_FLAG
+import app.revanced.util.patch.LiteralValueFingerprint
+
+internal object CairoSeekbarConfigFingerprint : LiteralValueFingerprint(
+    returnType = "Z",
+    parameters = listOf(),
+    literalSupplier = { CAIRO_SEEKBAR_FEATURE_FLAG },
+) {
+    const val CAIRO_SEEKBAR_FEATURE_FLAG = 45617850L
+}
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
index 3c4356b49b..f91afe56a2 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
@@ -29,6 +29,12 @@ internal object ThemeResourcePatch : ResourcePatch() {
     override fun execute(context: ResourceContext) {
         AddResourcesPatch(this::class)
 
+        if (VersionCheckPatch.is_19_23_or_greater) {
+            SettingsPatch.PreferenceScreen.SEEKBAR.addPreferences(
+                SwitchPreference("revanced_seekbar_cairo")
+            )
+        }
+
         SettingsPatch.PreferenceScreen.SEEKBAR.addPreferences(
             SwitchPreference("revanced_seekbar_custom_color"),
             TextPreference("revanced_seekbar_custom_color_value", inputType = InputType.TEXT_CAP_CHARACTERS),
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 4170a07016..5e636d26bc 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -1042,12 +1042,15 @@ This is because Crowdin requires temporarily flattening this file and removing t
             Loading screen will have a solid background
         
         
+            Enable Cairo seekbar
+            Cairo style seekbar is shown
+            Original style seekbar is shown
             Enable custom seekbar color
             Custom seekbar color is shown
             Original seekbar color is shown
             Custom seekbar color
             The color of the seekbar
-            Invalid seekbar color value. Using default value.
+            Invalid seekbar color value
         
         
             Bypass image region restrictions

From 31a555c8046f6a0c17573cd9bcfac113d19c5062 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 18 Oct 2024 05:40:03 -0400
Subject: [PATCH 115/143] refactor: Simplify seekbar cairo setting

---
 .../patches/youtube/layout/theme/ThemeResourcePatch.kt      | 6 ------
 src/main/resources/addresources/values/strings.xml          | 3 ---
 2 files changed, 9 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
index f91afe56a2..3c4356b49b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
@@ -29,12 +29,6 @@ internal object ThemeResourcePatch : ResourcePatch() {
     override fun execute(context: ResourceContext) {
         AddResourcesPatch(this::class)
 
-        if (VersionCheckPatch.is_19_23_or_greater) {
-            SettingsPatch.PreferenceScreen.SEEKBAR.addPreferences(
-                SwitchPreference("revanced_seekbar_cairo")
-            )
-        }
-
         SettingsPatch.PreferenceScreen.SEEKBAR.addPreferences(
             SwitchPreference("revanced_seekbar_custom_color"),
             TextPreference("revanced_seekbar_custom_color_value", inputType = InputType.TEXT_CAP_CHARACTERS),
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 5e636d26bc..1df5d9c3b1 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -1042,9 +1042,6 @@ This is because Crowdin requires temporarily flattening this file and removing t
             Loading screen will have a solid background
         
         
-            Enable Cairo seekbar
-            Cairo style seekbar is shown
-            Original style seekbar is shown
             Enable custom seekbar color
             Custom seekbar color is shown
             Original seekbar color is shown

From 837cde8a0e5666da96cb159a6360999506bbfe13 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 18 Oct 2024 07:08:49 -0400
Subject: [PATCH 116/143] fix: Restrict hide seekbar until it's fixed for the
 feed

---
 .../youtube/layout/hide/seekbar/HideSeekbarPatch.kt    | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
index e84c5abb2d..09f30b6f24 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
@@ -12,6 +12,7 @@ import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.patches.youtube.shared.fingerprints.SeekbarFingerprint
 import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
+import app.revanced.util.alsoResolve
 
 @Patch(
     name = "Hide seekbar",
@@ -30,7 +31,7 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
                 "19.05.36",
                 "19.16.39",
                 "19.25.37",
-                "19.34.42",
+                // "19.34.42", // Hide seekbar in feed currently does not work with gradient seekbar.
             ]
         )
     ]
@@ -47,9 +48,10 @@ object HideSeekbarPatch : BytecodePatch(
             SwitchPreference("revanced_hide_seekbar_thumbnail")
         )
 
-        SeekbarFingerprint.result!!.let {
-            SeekbarOnDrawFingerprint.apply { resolve(context, it.mutableClass) }
-        }.result!!.mutableMethod.addInstructionsWithLabels(
+        SeekbarOnDrawFingerprint.alsoResolve(
+            context,
+            SeekbarFingerprint
+        ).mutableMethod.addInstructionsWithLabels(
             0,
             """
                 const/4 v0, 0x0

From e5aa8aa5f8a1c648c4f19871b4e0d52a25af21a8 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 18 Oct 2024 07:12:04 -0400
Subject: [PATCH 117/143] refactor: Use more descriptive fingerprint name

---
 .../layout/seekbar/SeekbarColorBytecodePatch.kt   | 10 +++++-----
 .../fingerprints/CairoSeekbarConfigFingerprint.kt | 12 ------------
 .../PlayerSeekbarGraidentConfigFingerprint.kt     | 15 +++++++++++++++
 3 files changed, 20 insertions(+), 17 deletions(-)
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/CairoSeekbarConfigFingerprint.kt
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGraidentConfigFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
index 81da990814..179ee4e692 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
@@ -7,7 +7,7 @@ import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.CompatiblePackage
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
-import app.revanced.patches.youtube.layout.seekbar.fingerprints.CairoSeekbarConfigFingerprint
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGraidentConfigFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.SetSeekbarClickedColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.ShortsSeekbarColorFingerprint
@@ -33,7 +33,7 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
         PlayerSeekbarColorFingerprint,
         ShortsSeekbarColorFingerprint,
         SetSeekbarClickedColorFingerprint,
-        CairoSeekbarConfigFingerprint,
+        PlayerSeekbarGraidentConfigFingerprint,
     )
 ) {
     private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/theme/SeekbarColorPatch;"
@@ -83,9 +83,9 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
         } ?: throw SetSeekbarClickedColorFingerprint.exception
 
         if (VersionCheckPatch.is_19_23_or_greater) {
-            CairoSeekbarConfigFingerprint.resultOrThrow().mutableMethod.apply {
+            PlayerSeekbarGraidentConfigFingerprint.resultOrThrow().mutableMethod.apply {
                 val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
-                    CairoSeekbarConfigFingerprint.CAIRO_SEEKBAR_FEATURE_FLAG
+                    PlayerSeekbarGraidentConfigFingerprint.PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG
                 )
                 val resultIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
                 val register = getInstruction(resultIndex).registerA
@@ -93,7 +93,7 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
                 addInstructions(
                     resultIndex + 1,
                     """
-                        invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->cairoSeekbarEnabled(Z)Z
+                        invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->playerSeekbarGraidentEnabled(Z)Z
                         move-result v$register
                     """
                 )
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/CairoSeekbarConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/CairoSeekbarConfigFingerprint.kt
deleted file mode 100644
index cd874a37ef..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/CairoSeekbarConfigFingerprint.kt
+++ /dev/null
@@ -1,12 +0,0 @@
-package app.revanced.patches.youtube.layout.seekbar.fingerprints
-
-import app.revanced.patches.youtube.layout.seekbar.fingerprints.CairoSeekbarConfigFingerprint.CAIRO_SEEKBAR_FEATURE_FLAG
-import app.revanced.util.patch.LiteralValueFingerprint
-
-internal object CairoSeekbarConfigFingerprint : LiteralValueFingerprint(
-    returnType = "Z",
-    parameters = listOf(),
-    literalSupplier = { CAIRO_SEEKBAR_FEATURE_FLAG },
-) {
-    const val CAIRO_SEEKBAR_FEATURE_FLAG = 45617850L
-}
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGraidentConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGraidentConfigFingerprint.kt
new file mode 100644
index 0000000000..d5d48bfcc8
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGraidentConfigFingerprint.kt
@@ -0,0 +1,15 @@
+package app.revanced.patches.youtube.layout.seekbar.fingerprints
+
+import app.revanced.patcher.extensions.or
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGraidentConfigFingerprint.PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG
+import app.revanced.util.patch.LiteralValueFingerprint
+import com.android.tools.smali.dexlib2.AccessFlags
+
+internal object PlayerSeekbarGraidentConfigFingerprint : LiteralValueFingerprint(
+    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
+    returnType = "Z",
+    parameters = listOf(),
+    literalSupplier = { PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG },
+) {
+    const val PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG = 45617850L
+}
\ No newline at end of file

From 483f948e6bac2c7c8f3ee0540eab390b711f9f28 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 18 Oct 2024 07:51:16 -0400
Subject: [PATCH 118/143] fix: Unofficial support for 19.41.39

---
 .../patches/youtube/video/videoid/VideoIdPatch.kt        | 6 ++----
 .../videoid/fingerprint/VideoIdParentFingerprint.kt      | 9 ---------
 2 files changed, 2 insertions(+), 13 deletions(-)
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
index a1297ed31d..1e437129ce 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
@@ -11,8 +11,6 @@ import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
 import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
 import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdBackgroundPlayFingerprint
 import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprint
-import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdParentFingerprint
-import app.revanced.util.alsoResolve
 import app.revanced.util.getReference
 import app.revanced.util.indexOfFirstInstruction
 import app.revanced.util.resultOrThrow
@@ -26,7 +24,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 )
 object VideoIdPatch : BytecodePatch(
     setOf(
-        VideoIdParentFingerprint,
+        VideoIdFingerprint,
         VideoIdBackgroundPlayFingerprint,
     )
 ) {
@@ -40,7 +38,7 @@ object VideoIdPatch : BytecodePatch(
 
     override fun execute(context: BytecodeContext) {
 
-        VideoIdFingerprint.alsoResolve(context, VideoIdParentFingerprint).mutableMethod.apply {
+        VideoIdFingerprint.resultOrThrow().mutableMethod.apply {
             videoIdMethod = this
             val index = indexOfPlayerResponseModelString()
             videoIdRegister = getInstruction(index + 1).registerA
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt
deleted file mode 100644
index 2063659b7c..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt
+++ /dev/null
@@ -1,9 +0,0 @@
-package app.revanced.patches.youtube.video.videoid.fingerprint
-
-import app.revanced.patcher.fingerprint.MethodFingerprint
-
-internal object VideoIdParentFingerprint : MethodFingerprint(
-    returnType = "V",
-    parameters = listOf("Ljava/lang/Object;", "Ljava/lang/Exception;"),
-    strings = listOf("error retrieving subtitle"),
-)
\ No newline at end of file

From cb620b2be89c532118503dad3841d43e1708bed9 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 18 Oct 2024 08:08:55 -0400
Subject: [PATCH 119/143] fix: Unofficial support for 19.42 beta

---
 .../hide/shorts/HideShortsComponentsPatch.kt  | 19 ++++++++++++-------
 ...derBottomNavigationBarParentFingerprint.kt | 15 +++++++++++++++
 ...derBottomNavigationBarParentFingerprint.kt | 17 ++++++++++++++++-
 .../misc/playservice/VersionCheckPatch.kt     |  2 ++
 4 files changed, 45 insertions(+), 8 deletions(-)
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/LegacyRenderBottomNavigationBarParentFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
index f2c0f3fd0f..33cdbbd503 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
@@ -17,7 +17,6 @@ import app.revanced.patches.youtube.misc.navigation.NavigationBarHookPatch
 import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
 import app.revanced.util.forEachLiteralValueInstruction
 import app.revanced.util.alsoResolve
-import app.revanced.util.exception
 import app.revanced.util.getReference
 import app.revanced.util.indexOfFirstInstructionOrThrow
 import app.revanced.util.indexOfFirstWideLiteralInstructionValue
@@ -61,6 +60,7 @@ object HideShortsComponentsPatch : BytecodePatch(
         CreateShortsButtonsFingerprint,
         ReelConstructorFingerprint,
         ShortsBottomBarContainerFingerprint,
+        LegacyRenderBottomNavigationBarParentFingerprint,
         RenderBottomNavigationBarParentFingerprint,
         SetPivotBarVisibilityParentFingerprint,
     ),
@@ -106,9 +106,9 @@ object HideShortsComponentsPatch : BytecodePatch(
         // region Hide the Shorts buttons in older versions of YouTube.
 
         // Some Shorts buttons are views, hide them by setting their visibility to GONE.
-        CreateShortsButtonsFingerprint.result?.let {
+        CreateShortsButtonsFingerprint.resultOrThrow().let {
             ShortsButtons.entries.forEach { button -> button.injectHideCall(it.mutableMethod) }
-        } ?: throw CreateShortsButtonsFingerprint.exception
+        }
 
         // endregion
 
@@ -117,7 +117,7 @@ object HideShortsComponentsPatch : BytecodePatch(
         LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
 
         context.forEachLiteralValueInstruction(
-            HideShortsComponentsResourcePatch.reelPlayerRightPivotV2Size,
+            HideShortsComponentsResourcePatch.reelPlayerRightPivotV2Size
         ) { literalInstructionIndex ->
             val targetIndex = indexOfFirstInstructionOrThrow(literalInstructionIndex) {
                 getReference()?.name == "getDimensionPixelSize"
@@ -132,13 +132,15 @@ object HideShortsComponentsPatch : BytecodePatch(
             )
         }
 
-
         // endregion
 
         // region Hide the navigation bar.
 
         // Hook to get the pivotBar view.
-        SetPivotBarVisibilityFingerprint.alsoResolve(context, SetPivotBarVisibilityParentFingerprint).let { result->
+        SetPivotBarVisibilityFingerprint.alsoResolve(
+            context,
+            SetPivotBarVisibilityParentFingerprint
+        ).let { result->
             result.mutableMethod.apply {
                 val insertIndex = result.scanResult.patternScanResult!!.endIndex
                 val viewRegister = getInstruction(insertIndex - 1).registerA
@@ -151,7 +153,10 @@ object HideShortsComponentsPatch : BytecodePatch(
         // Hook to hide the shared navigation bar when the Shorts player is opened.
         RenderBottomNavigationBarFingerprint.alsoResolve(
             context,
-            RenderBottomNavigationBarParentFingerprint
+            if (VersionCheckPatch.is_19_41_or_greater)
+                RenderBottomNavigationBarParentFingerprint
+            else
+                LegacyRenderBottomNavigationBarParentFingerprint
         ).mutableMethod.addInstruction(
             0,
             "invoke-static { p1 }, $FILTER_CLASS_DESCRIPTOR->hideNavigationBar(Ljava/lang/String;)V"
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/LegacyRenderBottomNavigationBarParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/LegacyRenderBottomNavigationBarParentFingerprint.kt
new file mode 100644
index 0000000000..de25cf8706
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/LegacyRenderBottomNavigationBarParentFingerprint.kt
@@ -0,0 +1,15 @@
+package app.revanced.patches.youtube.layout.hide.shorts.fingerprints
+
+import app.revanced.patcher.fingerprint.MethodFingerprint
+
+internal object LegacyRenderBottomNavigationBarParentFingerprint : MethodFingerprint(
+    parameters = listOf(
+        "I",
+        "I",
+        "L",
+        "L",
+        "J",
+        "L",
+    ),
+    strings = listOf("aa")
+)
\ No newline at end of file
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/RenderBottomNavigationBarParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/RenderBottomNavigationBarParentFingerprint.kt
index cb606d5c31..00ee226b3d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/RenderBottomNavigationBarParentFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/fingerprints/RenderBottomNavigationBarParentFingerprint.kt
@@ -1,8 +1,23 @@
 package app.revanced.patches.youtube.layout.hide.shorts.fingerprints
 
+import app.revanced.patcher.extensions.or
 import app.revanced.patcher.fingerprint.MethodFingerprint
+import com.android.tools.smali.dexlib2.AccessFlags
 
+/**
+ * Identical to [LegacyRenderBottomNavigationBarParentFingerprint]
+ * except this has an extra parameter.
+ */
 internal object RenderBottomNavigationBarParentFingerprint : MethodFingerprint(
-    parameters = listOf("I", "I", "L", "L", "J", "L"),
+    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
+    parameters = listOf(
+        "I",
+        "I",
+        "L", // ReelWatchEndpointOuterClass
+        "L",
+        "J",
+        "Ljava/lang/String;",
+        "L"
+    ),
     strings = listOf("aa")
 )
\ No newline at end of file
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 a1acea8a16..5ef04463c6 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
@@ -21,6 +21,7 @@ internal object VersionCheckPatch : ResourcePatch() {
     var is_19_32_or_greater by Delegates.notNull()
     var is_19_33_or_greater by Delegates.notNull()
     var is_19_36_or_greater by Delegates.notNull()
+    var is_19_41_or_greater by Delegates.notNull()
 
     override fun execute(context: ResourceContext) {
 
@@ -46,5 +47,6 @@ internal object VersionCheckPatch : ResourcePatch() {
         is_19_32_or_greater = 243199000 <= playStoreServicesVersion
         is_19_33_or_greater = 243405000 <= playStoreServicesVersion
         is_19_36_or_greater = 243705000 <= playStoreServicesVersion
+        is_19_41_or_greater = 244305000 <= playStoreServicesVersion
     }
 }

From de6c6ebb714b40316f7fadcb6abb8c0698886257 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 18 Oct 2024 22:39:16 -0400
Subject: [PATCH 120/143] fix typo

---
 .../patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
index 179ee4e692..da1ab9ea54 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
@@ -93,7 +93,7 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
                 addInstructions(
                     resultIndex + 1,
                     """
-                        invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->playerSeekbarGraidentEnabled(Z)Z
+                        invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->playerSeekbarGradientEnabled(Z)Z
                         move-result v$register
                     """
                 )

From 505901f2ac06d282fff1d8d83fba7a9457102830 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 18 Oct 2024 23:39:45 -0400
Subject: [PATCH 121/143] fix(Seekbar color): Support gradient seekbar

---
 .../youtube/layout/hide/seekbar/HideSeekbarPatch.kt    |  2 +-
 .../layout/seekbar/SeekbarColorBytecodePatch.kt        |  9 +++++++++
 .../seekbar/fingerprints/LinearGradientFingerprint.kt  | 10 ++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LinearGradientFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
index 09f30b6f24..5360f82024 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
@@ -31,7 +31,7 @@ import app.revanced.util.alsoResolve
                 "19.05.36",
                 "19.16.39",
                 "19.25.37",
-                // "19.34.42", // Hide seekbar in feed currently does not work with gradient seekbar.
+                "19.34.42",
             ]
         )
     ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
index da1ab9ea54..4cba26d061 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
@@ -1,6 +1,7 @@
 package app.revanced.patches.youtube.layout.seekbar
 
 import app.revanced.patcher.data.BytecodeContext
+import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
 import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
 import app.revanced.patcher.patch.BytecodePatch
@@ -11,6 +12,7 @@ import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGra
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.SetSeekbarClickedColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.ShortsSeekbarColorFingerprint
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.LinearGradientFingerprint
 import app.revanced.patches.youtube.layout.theme.LithoColorHookPatch
 import app.revanced.patches.youtube.layout.theme.LithoColorHookPatch.lithoColorOverrideHook
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
@@ -34,6 +36,7 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
         ShortsSeekbarColorFingerprint,
         SetSeekbarClickedColorFingerprint,
         PlayerSeekbarGraidentConfigFingerprint,
+        LinearGradientFingerprint
     )
 ) {
     private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/theme/SeekbarColorPatch;"
@@ -98,6 +101,12 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
                     """
                 )
             }
+
+            LinearGradientFingerprint.resultOrThrow().mutableMethod.apply {
+                addInstruction(0, "invoke-static/range { p4 .. p5 },  " +
+                        "$INTEGRATIONS_CLASS_DESCRIPTOR->setLinearGradient([I[F)V"
+                )
+            }
         }
 
         lithoColorOverrideHook(INTEGRATIONS_CLASS_DESCRIPTOR, "getLithoColor")
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LinearGradientFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LinearGradientFingerprint.kt
new file mode 100644
index 0000000000..d894b65d5c
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LinearGradientFingerprint.kt
@@ -0,0 +1,10 @@
+package app.revanced.patches.youtube.layout.seekbar.fingerprints
+
+import app.revanced.patcher.fingerprint.MethodFingerprint
+import com.android.tools.smali.dexlib2.AccessFlags
+
+internal object LinearGradientFingerprint : MethodFingerprint(
+    accessFlags = AccessFlags.STATIC.value,
+    returnType = "Landroid/graphics/LinearGradient;",
+    parameters = listOf("F", "F", "F", "F", "[I", "[F"),
+)
\ No newline at end of file

From f9aee23b73807c23263b2f0926dead1ddcddae59 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Fri, 18 Oct 2024 23:55:55 -0400
Subject: [PATCH 122/143] refactor

---
 .../layout/seekbar/SeekbarColorBytecodePatch.kt    | 14 +++++++-------
 ...rprint.kt => LithoLinearGradientFingerprint.kt} |  2 +-
 ...t => PlayerSeekbarGradientConfigFingerprint.kt} |  4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)
 rename src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/{LinearGradientFingerprint.kt => LithoLinearGradientFingerprint.kt} (83%)
 rename src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/{PlayerSeekbarGraidentConfigFingerprint.kt => PlayerSeekbarGradientConfigFingerprint.kt} (81%)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
index 4cba26d061..5abae4fcf5 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
@@ -8,11 +8,11 @@ import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.CompatiblePackage
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
-import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGraidentConfigFingerprint
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGradientConfigFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.SetSeekbarClickedColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.ShortsSeekbarColorFingerprint
-import app.revanced.patches.youtube.layout.seekbar.fingerprints.LinearGradientFingerprint
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.LithoLinearGradientFingerprint
 import app.revanced.patches.youtube.layout.theme.LithoColorHookPatch
 import app.revanced.patches.youtube.layout.theme.LithoColorHookPatch.lithoColorOverrideHook
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
@@ -35,8 +35,8 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
         PlayerSeekbarColorFingerprint,
         ShortsSeekbarColorFingerprint,
         SetSeekbarClickedColorFingerprint,
-        PlayerSeekbarGraidentConfigFingerprint,
-        LinearGradientFingerprint
+        PlayerSeekbarGradientConfigFingerprint,
+        LithoLinearGradientFingerprint
     )
 ) {
     private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/theme/SeekbarColorPatch;"
@@ -86,9 +86,9 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
         } ?: throw SetSeekbarClickedColorFingerprint.exception
 
         if (VersionCheckPatch.is_19_23_or_greater) {
-            PlayerSeekbarGraidentConfigFingerprint.resultOrThrow().mutableMethod.apply {
+            PlayerSeekbarGradientConfigFingerprint.resultOrThrow().mutableMethod.apply {
                 val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
-                    PlayerSeekbarGraidentConfigFingerprint.PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG
+                    PlayerSeekbarGradientConfigFingerprint.PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG
                 )
                 val resultIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
                 val register = getInstruction(resultIndex).registerA
@@ -102,7 +102,7 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
                 )
             }
 
-            LinearGradientFingerprint.resultOrThrow().mutableMethod.apply {
+            LithoLinearGradientFingerprint.resultOrThrow().mutableMethod.apply {
                 addInstruction(0, "invoke-static/range { p4 .. p5 },  " +
                         "$INTEGRATIONS_CLASS_DESCRIPTOR->setLinearGradient([I[F)V"
                 )
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LinearGradientFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LithoLinearGradientFingerprint.kt
similarity index 83%
rename from src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LinearGradientFingerprint.kt
rename to src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LithoLinearGradientFingerprint.kt
index d894b65d5c..6185420bf2 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LinearGradientFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/LithoLinearGradientFingerprint.kt
@@ -3,7 +3,7 @@ package app.revanced.patches.youtube.layout.seekbar.fingerprints
 import app.revanced.patcher.fingerprint.MethodFingerprint
 import com.android.tools.smali.dexlib2.AccessFlags
 
-internal object LinearGradientFingerprint : MethodFingerprint(
+internal object LithoLinearGradientFingerprint : MethodFingerprint(
     accessFlags = AccessFlags.STATIC.value,
     returnType = "Landroid/graphics/LinearGradient;",
     parameters = listOf("F", "F", "F", "F", "[I", "[F"),
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGraidentConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGradientConfigFingerprint.kt
similarity index 81%
rename from src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGraidentConfigFingerprint.kt
rename to src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGradientConfigFingerprint.kt
index d5d48bfcc8..2d7730fb52 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGraidentConfigFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/fingerprints/PlayerSeekbarGradientConfigFingerprint.kt
@@ -1,11 +1,11 @@
 package app.revanced.patches.youtube.layout.seekbar.fingerprints
 
 import app.revanced.patcher.extensions.or
-import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGraidentConfigFingerprint.PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGradientConfigFingerprint.PLAYER_SEEKBAR_GRADIENT_FEATURE_FLAG
 import app.revanced.util.patch.LiteralValueFingerprint
 import com.android.tools.smali.dexlib2.AccessFlags
 
-internal object PlayerSeekbarGraidentConfigFingerprint : LiteralValueFingerprint(
+internal object PlayerSeekbarGradientConfigFingerprint : LiteralValueFingerprint(
     accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
     returnType = "Z",
     parameters = listOf(),

From c518659c01f71692f27b19c50a3db3fceee10e95 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 00:15:19 -0400
Subject: [PATCH 123/143] refactor: simplify

---
 .../layout/seekbar/SeekbarColorBytecodePatch.kt | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
index 5abae4fcf5..8d3050c29f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/SeekbarColorBytecodePatch.kt
@@ -8,16 +8,15 @@ import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.CompatiblePackage
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
-import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGradientConfigFingerprint
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.LithoLinearGradientFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarColorFingerprint
+import app.revanced.patches.youtube.layout.seekbar.fingerprints.PlayerSeekbarGradientConfigFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.SetSeekbarClickedColorFingerprint
 import app.revanced.patches.youtube.layout.seekbar.fingerprints.ShortsSeekbarColorFingerprint
-import app.revanced.patches.youtube.layout.seekbar.fingerprints.LithoLinearGradientFingerprint
 import app.revanced.patches.youtube.layout.theme.LithoColorHookPatch
 import app.revanced.patches.youtube.layout.theme.LithoColorHookPatch.lithoColorOverrideHook
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.playservice.VersionCheckPatch
-import app.revanced.util.exception
 import app.revanced.util.indexOfFirstInstructionOrThrow
 import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow
 import app.revanced.util.resultOrThrow
@@ -55,16 +54,16 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
             )
         }
 
-        PlayerSeekbarColorFingerprint.result?.mutableMethod?.apply {
+        PlayerSeekbarColorFingerprint.resultOrThrow().mutableMethod.apply {
             addColorChangeInstructions(SeekbarColorResourcePatch.inlineTimeBarColorizedBarPlayedColorDarkId)
             addColorChangeInstructions(SeekbarColorResourcePatch.inlineTimeBarPlayedNotHighlightedColorId)
-        } ?: throw PlayerSeekbarColorFingerprint.exception
+        }
 
-        ShortsSeekbarColorFingerprint.result?.mutableMethod?.apply {
+        ShortsSeekbarColorFingerprint.resultOrThrow().mutableMethod.apply {
             addColorChangeInstructions(SeekbarColorResourcePatch.reelTimeBarPlayedColorId)
-        } ?: throw ShortsSeekbarColorFingerprint.exception
+        }
 
-        SetSeekbarClickedColorFingerprint.result?.let { result ->
+        SetSeekbarClickedColorFingerprint.resultOrThrow().let { result ->
             result.mutableMethod.let {
                 val setColorMethodIndex = result.scanResult.patternScanResult!!.startIndex + 1
                 val method = context
@@ -83,7 +82,7 @@ internal object SeekbarColorBytecodePatch : BytecodePatch(
                     )
                 }
             }
-        } ?: throw SetSeekbarClickedColorFingerprint.exception
+        }
 
         if (VersionCheckPatch.is_19_23_or_greater) {
             PlayerSeekbarGradientConfigFingerprint.resultOrThrow().mutableMethod.apply {

From a63932327241e1ade49448c95dbb56e51764636d Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 00:46:01 -0400
Subject: [PATCH 124/143] refactor

---
 .../backgroundplayback/BackgroundPlaybackPatch.kt   | 13 ++++---------
 src/main/kotlin/app/revanced/util/BytecodeUtils.kt  |  9 +++++++++
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
index 4776df24e4..8b6b809cb7 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
@@ -4,7 +4,6 @@ import app.revanced.patcher.data.BytecodeContext
 import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
 import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
-import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
 import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.CompatiblePackage
 import app.revanced.patcher.patch.annotation.Patch
@@ -16,6 +15,7 @@ import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.patches.youtube.video.information.VideoInformationPatch
+import app.revanced.util.addInstructionsAtControlFlowLabel
 import app.revanced.util.findOpcodeIndicesReversed
 import app.revanced.util.resultOrThrow
 import com.android.tools.smali.dexlib2.Opcode
@@ -63,16 +63,11 @@ object BackgroundPlaybackPatch : BytecodePatch(
             findOpcodeIndicesReversed(Opcode.RETURN).forEach{ index ->
                 val register = getInstruction(index).registerA
 
-                // Replace to preserve control flow label.
-                replaceInstruction(
+                addInstructionsAtControlFlowLabel(
                     index,
-                    "invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->allowBackgroundPlayback(Z)Z"
-                )
-
-                addInstructions(index + 1,
                     """
-                       move-result v$register
-                       return v$register
+                        invoke-static { v$register }, $INTEGRATIONS_CLASS_DESCRIPTOR->allowBackgroundPlayback(Z)Z
+                        move-result v$register 
                     """
                 )
             }
diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
index f9031f7820..02b95b5109 100644
--- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
+++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
@@ -69,6 +69,15 @@ fun MutableMethod.injectHideViewCall(
 
 /**
  * Inserts instructions at a given index, using the existing control flow label at that index.
+ *
+ * Effectively this changes the code from:
+ * :label
+ * (original code)
+ *
+ * Into:
+ * :label
+ * (patch code)
+ * (original code)
  */
 internal fun MutableMethod.addInstructionsAtControlFlowLabel(
     insertIndex: Int,

From 278a26f112caa58c4dd9192bfe145c8acc74fa58 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 00:50:15 -0400
Subject: [PATCH 125/143] fix: Apply dark mode launch screen fix to all targets

---
 .../layout/theme/ThemeResourcePatch.kt        | 37 +++++++++----------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
index 3c4356b49b..98606ab8c5 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeResourcePatch.kt
@@ -97,25 +97,24 @@ internal object ThemeResourcePatch : ResourcePatch() {
             }
 
             // Fix the splash screen dark mode background color.
-            // Normally this is white and makes no sense for dark mode.
-            if (VersionCheckPatch.is_19_32_or_greater) {
-                // Only dark mode needs this fix as light mode correctly uses the custom color.
-                context.xmlEditor["res/values-night/styles.xml"].use { editor ->
-                    val document = editor.file
-
-                    // Create a night mode specific override for the splash screen background.
-                    val style = document.createElement("style")
-                    style.setAttribute("name", "Theme.YouTube.Home")
-                    style.setAttribute("parent", "@style/Base.V23.Theme.YouTube.Home")
-
-                    val windowItem = document.createElement("item")
-                    windowItem.setAttribute("name", "android:windowBackground")
-                    windowItem.textContent = "@color/$SPLASH_BACKGROUND_COLOR"
-                    style.appendChild(windowItem)
-
-                    val resourcesNode = document.getElementsByTagName("resources").item(0) as Element
-                    resourcesNode.appendChild(style)
-                }
+            // In earlier versions of the app this is white and makes no sense for dark mode.
+            // This is only required for 19.32 and greater, but is applied to all targets.
+            // Only dark mode needs this fix as light mode correctly uses the custom color.
+            context.xmlEditor["res/values-night/styles.xml"].use { editor ->
+                val document = editor.file
+
+                // Create a night mode specific override for the splash screen background.
+                val style = document.createElement("style")
+                style.setAttribute("name", "Theme.YouTube.Home")
+                style.setAttribute("parent", "@style/Base.V23.Theme.YouTube.Home")
+
+                val windowItem = document.createElement("item")
+                windowItem.setAttribute("name", "android:windowBackground")
+                windowItem.textContent = "@color/$SPLASH_BACKGROUND_COLOR"
+                style.appendChild(windowItem)
+
+                val resourcesNode = document.getElementsByTagName("resources").item(0) as Element
+                resourcesNode.appendChild(style)
             }
         }
     }

From acaa34d50bb8fa1f6f0fe4c23afa73fb059f2d1b Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 00:50:27 -0400
Subject: [PATCH 126/143] refactor

---
 .../fingerprints/SeekbarTappingFingerprint.kt       | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SeekbarTappingFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SeekbarTappingFingerprint.kt
index ddb8bf47d9..3989aa2d5c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SeekbarTappingFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/fingerprints/SeekbarTappingFingerprint.kt
@@ -2,10 +2,9 @@ package app.revanced.patches.youtube.interaction.seekbar.fingerprints
 
 import app.revanced.patcher.extensions.or
 import app.revanced.patcher.fingerprint.MethodFingerprint
+import app.revanced.util.containsWideLiteralInstructionValue
 import com.android.tools.smali.dexlib2.AccessFlags
 import com.android.tools.smali.dexlib2.Opcode
-import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction
-
 
 internal object SeekbarTappingFingerprint : MethodFingerprint(
     returnType = "Z",
@@ -21,14 +20,6 @@ internal object SeekbarTappingFingerprint : MethodFingerprint(
     customFingerprint = custom@{ methodDef, _ ->
         if (methodDef.name != "onTouchEvent") return@custom false
 
-        methodDef.implementation!!.instructions.any { instruction ->
-            if (instruction.opcode != Opcode.CONST) return@any false
-
-            val literal = (instruction as NarrowLiteralInstruction).narrowLiteral
-
-            // onTouchEvent method contains a CONST instruction
-            // with this literal making it unique with the rest of the properties of this fingerprint.
-            literal == Integer.MAX_VALUE
-        }
+        methodDef.containsWideLiteralInstructionValue(Integer.MAX_VALUE.toLong())
     }
 )
\ No newline at end of file

From 7119906503eff85de294f4b78b852243f0d2902c Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 00:52:56 -0400
Subject: [PATCH 127/143] refactor: Simplify

---
 .../patches/youtube/layout/startpage/ChangeStartPagePatch.kt  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
index 33af5a18d2..d450f44e38 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
@@ -16,7 +16,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
 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.StringReference
 
@@ -62,8 +61,7 @@ object ChangeStartPagePatch : BytecodePatch(
         // Hook broseId.
         BrowseIdFingerprint.resultOrThrow().mutableMethod.apply {
             val browseIdIndex = indexOfFirstInstructionOrThrow {
-                opcode == Opcode.CONST_STRING &&
-                        getReference()?.string == "FEwhat_to_watch"
+                getReference()?.string == "FEwhat_to_watch"
             }
             val browseIdRegister = getInstruction(browseIdIndex).registerA
 

From cc0be6df9d9c3cf88438ff911b0591d5c70b7c72 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 00:53:33 -0400
Subject: [PATCH 128/143] fix typo

---
 .../patches/youtube/layout/startpage/ChangeStartPagePatch.kt    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
index d450f44e38..defc3b5883 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
@@ -58,7 +58,7 @@ object ChangeStartPagePatch : BytecodePatch(
             )
         )
 
-        // Hook broseId.
+        // Hook browseId.
         BrowseIdFingerprint.resultOrThrow().mutableMethod.apply {
             val browseIdIndex = indexOfFirstInstructionOrThrow {
                 getReference()?.string == "FEwhat_to_watch"

From 5f3e1339ef8f02614a402fdfd31eb4a105e889dd Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 00:54:51 -0400
Subject: [PATCH 129/143] fix: Remove unused fingerprint that never should have
 been public

---
 api/revanced-patches.api                           |  4 ----
 .../fingerprints/StartActivityFingerprint.kt       | 14 --------------
 2 files changed, 18 deletions(-)
 delete mode 100644 src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt

diff --git a/api/revanced-patches.api b/api/revanced-patches.api
index 0ff2fa976a..ed2f78f371 100644
--- a/api/revanced-patches.api
+++ b/api/revanced-patches.api
@@ -1850,10 +1850,6 @@ public final class app/revanced/patches/youtube/layout/startpage/ChangeStartPage
 	public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
 }
 
-public final class app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint : app/revanced/patcher/fingerprint/MethodFingerprint {
-	public static final field INSTANCE Lapp/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint;
-}
-
 public final class app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch : app/revanced/patcher/patch/BytecodePatch {
 	public static final field INSTANCE Lapp/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch;
 	public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt
deleted file mode 100644
index 8249feba4d..0000000000
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/fingerprints/StartActivityFingerprint.kt
+++ /dev/null
@@ -1,14 +0,0 @@
-package app.revanced.patches.youtube.layout.startpage.fingerprints
-
-import app.revanced.patcher.fingerprint.MethodFingerprint
-
-/**
- * Resolves using class found in [StartActivityParentFingerprint].
- */
-object StartActivityFingerprint : MethodFingerprint(
-    returnType = "V",
-    parameters = listOf("Landroid/os/Bundle;"),
-    customFingerprint = { method, classDef ->
-        method.name == "onCreate"
-    }
-)
\ No newline at end of file

From 62f53564bec989f2c8bf084078250977c3eb6b76 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 00:59:22 -0400
Subject: [PATCH 130/143] refactor: Use utility method

---
 .../DisableResumingShortsOnStartupPatch.kt    | 23 +++++++------------
 1 file changed, 8 insertions(+), 15 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
index 2ad43511c5..ab3504ffc0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
@@ -3,7 +3,6 @@ package app.revanced.patches.youtube.layout.startupshortsreset
 import app.revanced.patcher.data.BytecodeContext
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
 import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
-import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
 import app.revanced.patcher.patch.BytecodePatch
 import app.revanced.patcher.patch.annotation.CompatiblePackage
 import app.revanced.patcher.patch.annotation.Patch
@@ -15,12 +14,11 @@ import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserW
 import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserWasInShortsFingerprint
 import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
-import app.revanced.util.exception
+import app.revanced.util.addInstructionsAtControlFlowLabel
 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.FiveRegisterInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
 import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 
@@ -70,10 +68,10 @@ object DisableResumingShortsOnStartupPatch : BytecodePatch(
                 .nextMethod(walkerIndex, true)
                 .getMethod() as MutableMethod
 
-            // This method will only be called for the user being A/B tested.
             // Presumably a method that processes the ProtoDataStore value (boolean) for the 'user_was_in_shorts' key.
             walkerMethod.addInstructionsWithLabels(
-                0, """
+                0,
+                """
                     invoke-static {}, $INTEGRATIONS_CLASS_DESCRIPTOR->disableResumingStartupShortsPlayer()Z
                     move-result v0
                     if-eqz v0, :show
@@ -85,30 +83,25 @@ object DisableResumingShortsOnStartupPatch : BytecodePatch(
             )
         }
 
-        UserWasInShortsFingerprint.result?.mutableMethod?.apply {
+        UserWasInShortsFingerprint.resultOrThrow().mutableMethod.apply {
             val listenableInstructionIndex = indexOfFirstInstructionOrThrow {
                 opcode == Opcode.INVOKE_INTERFACE &&
                         getReference()?.definingClass == "Lcom/google/common/util/concurrent/ListenableFuture;" &&
                         getReference()?.name == "isDone"
             }
-            val originalInstructionRegister = getInstruction(listenableInstructionIndex).registerC
             val freeRegister = getInstruction(listenableInstructionIndex + 1).registerA
 
-            // Replace original instruction to preserve control flow label.
-            replaceInstruction(
+            addInstructionsAtControlFlowLabel(
                 listenableInstructionIndex,
-                "invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->disableResumingStartupShortsPlayer()Z"
-            )
-            addInstructionsWithLabels(
-                listenableInstructionIndex + 1,
                 """
+                    invoke-static { }, $INTEGRATIONS_CLASS_DESCRIPTOR->disableResumingStartupShortsPlayer()Z
                     move-result v$freeRegister
                     if-eqz v$freeRegister, :show_startup_shorts_player
                     return-void
                     :show_startup_shorts_player
-                    invoke-interface {v$originalInstructionRegister}, Lcom/google/common/util/concurrent/ListenableFuture;->isDone()Z
+                    nop
                 """
             )
-        } ?: throw UserWasInShortsFingerprint.exception
+        }
     }
 }

From ef5eb82867e5e8348eaf78f951a6c5689e5af749 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 01:08:00 -0400
Subject: [PATCH 131/143] refactor: Use utility method

---
 .../UserWasInShortsConfigFingerprint.kt        | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsConfigFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsConfigFingerprint.kt
index 185a6b57c1..21bf07c246 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsConfigFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/fingerprints/UserWasInShortsConfigFingerprint.kt
@@ -4,9 +4,10 @@ import app.revanced.patcher.fingerprint.MethodFingerprint
 import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserWasInShortsConfigFingerprint.indexOfOptionalInstruction
 import app.revanced.util.getReference
 import app.revanced.util.indexOfFirstInstruction
-import com.android.tools.smali.dexlib2.Opcode
 import com.android.tools.smali.dexlib2.iface.Method
 import com.android.tools.smali.dexlib2.iface.reference.MethodReference
+import com.android.tools.smali.dexlib2.immutable.reference.ImmutableMethodReference
+import com.android.tools.smali.dexlib2.util.MethodUtil
 
 /**
  * 18.15.40+
@@ -18,12 +19,17 @@ internal object UserWasInShortsConfigFingerprint : MethodFingerprint(
         indexOfOptionalInstruction(methodDef) >= 0
     }
 ) {
+    private val optionalOfMethodReference = ImmutableMethodReference(
+        "Lj${'$'}/util/Optional;",
+        "of",
+        listOf("Ljava/lang/Object;"),
+        "Lj${'$'}/util/Optional;",
+    )
+
     fun indexOfOptionalInstruction(methodDef: Method) =
         methodDef.indexOfFirstInstruction {
-            val reference = getReference()
-            opcode == Opcode.INVOKE_STATIC &&
-                    reference?.definingClass == "Lj${'$'}/util/Optional;" &&
-                    reference.name == "of" &&
-                    reference.returnType == "Lj${'$'}/util/Optional;"
+            val reference = getReference() ?: return@indexOfFirstInstruction false
+
+            MethodUtil.methodSignaturesMatch(reference, optionalOfMethodReference)
         }
 }
\ No newline at end of file

From 5ce840aacc075bd0e9ffd497f83e39f52f4e9f2b Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 01:14:17 -0400
Subject: [PATCH 132/143] Comments

---
 .../videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt
index 857912716c..afddaca5a9 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdBackgroundPlayFingerprint.kt
@@ -19,6 +19,8 @@ internal object VideoIdBackgroundPlayFingerprint : MethodFingerprint(
         Opcode.MONITOR_EXIT,
         Opcode.RETURN_VOID
     ),
+    // The target snippet of code is buried in a huge switch block and the target method
+    // has been changed many times by YT which makes identifying it more difficult than usual.
     customFingerprint = { methodDef, classDef ->
         // Access flags changed in 19.36
         (methodDef.accessFlags == (AccessFlags.PUBLIC or AccessFlags.FINAL or AccessFlags.DECLARED_SYNCHRONIZED) ||

From 1ee0fc5b395b8b0d49ae79a477d51aec8466ed70 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 01:59:09 -0400
Subject: [PATCH 133/143] fix: Use add instructions with label

---
 src/main/kotlin/app/revanced/util/BytecodeUtils.kt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
index 02b95b5109..f12834b488 100644
--- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
+++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
@@ -3,6 +3,7 @@ package app.revanced.util
 import app.revanced.patcher.data.BytecodeContext
 import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
+import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
 import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.removeInstruction
 import app.revanced.patcher.fingerprint.MethodFingerprint
@@ -69,6 +70,7 @@ fun MutableMethod.injectHideViewCall(
 
 /**
  * Inserts instructions at a given index, using the existing control flow label at that index.
+ * Inserted instructions can have it's own control flow labels as well.
  *
  * Effectively this changes the code from:
  * :label
@@ -88,7 +90,7 @@ internal fun MutableMethod.addInstructionsAtControlFlowLabel(
 
     // Add patch code at same index as duplicated instruction,
     // so it uses the original instruction control flow label.
-    addInstructions(insertIndex + 1, instructions)
+    addInstructionsWithLabels(insertIndex + 1, instructions)
 
     // Remove original non duplicated instruction.
     removeInstruction(insertIndex)

From 8ea483937f0dca07c04a9f401a49f30211b7b7d4 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 02:09:00 -0400
Subject: [PATCH 134/143] Comment

---
 src/main/kotlin/app/revanced/util/BytecodeUtils.kt | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
index f12834b488..c9b146645a 100644
--- a/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
+++ b/src/main/kotlin/app/revanced/util/BytecodeUtils.kt
@@ -131,6 +131,9 @@ fun Method.indexOfIdResourceOrThrow(resourceName: String): Int {
     return index
 }
 
+// TODO Rename these from 'FirstWideLiteralInstruction' to 'FirstLiteralInstruction',
+// since NarrowLiteralInstruction is a subclass of WideLiteralInstruction.
+
 /**
  * Find the index of the first wide literal instruction with the given value.
  *

From 47bbfe5f1349d10e49af7d7e883b8ebed1c72ef3 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 03:31:55 -0400
Subject: [PATCH 135/143] Revert "fix: Unofficial support for 19.41.39"

This reverts commit 483f948e6bac2c7c8f3ee0540eab390b711f9f28.
---
 .../patches/youtube/video/videoid/VideoIdPatch.kt        | 6 ++++--
 .../videoid/fingerprint/VideoIdParentFingerprint.kt      | 9 +++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt

diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
index 1e437129ce..a1297ed31d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/VideoIdPatch.kt
@@ -11,6 +11,8 @@ import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
 import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
 import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdBackgroundPlayFingerprint
 import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdFingerprint
+import app.revanced.patches.youtube.video.videoid.fingerprint.VideoIdParentFingerprint
+import app.revanced.util.alsoResolve
 import app.revanced.util.getReference
 import app.revanced.util.indexOfFirstInstruction
 import app.revanced.util.resultOrThrow
@@ -24,7 +26,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 )
 object VideoIdPatch : BytecodePatch(
     setOf(
-        VideoIdFingerprint,
+        VideoIdParentFingerprint,
         VideoIdBackgroundPlayFingerprint,
     )
 ) {
@@ -38,7 +40,7 @@ object VideoIdPatch : BytecodePatch(
 
     override fun execute(context: BytecodeContext) {
 
-        VideoIdFingerprint.resultOrThrow().mutableMethod.apply {
+        VideoIdFingerprint.alsoResolve(context, VideoIdParentFingerprint).mutableMethod.apply {
             videoIdMethod = this
             val index = indexOfPlayerResponseModelString()
             videoIdRegister = getInstruction(index + 1).registerA
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt
new file mode 100644
index 0000000000..2063659b7c
--- /dev/null
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt
@@ -0,0 +1,9 @@
+package app.revanced.patches.youtube.video.videoid.fingerprint
+
+import app.revanced.patcher.fingerprint.MethodFingerprint
+
+internal object VideoIdParentFingerprint : MethodFingerprint(
+    returnType = "V",
+    parameters = listOf("Ljava/lang/Object;", "Ljava/lang/Exception;"),
+    strings = listOf("error retrieving subtitle"),
+)
\ No newline at end of file

From d1b23acab06b86b2d4d3d2779171ee7e26d2727e Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 04:00:55 -0400
Subject: [PATCH 136/143] fix video id hook with 19.41+

---
 .../videoid/fingerprint/VideoIdParentFingerprint.kt | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt
index 2063659b7c..d91633ed46 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoid/fingerprint/VideoIdParentFingerprint.kt
@@ -1,9 +1,12 @@
 package app.revanced.patches.youtube.video.videoid.fingerprint
 
-import app.revanced.patcher.fingerprint.MethodFingerprint
+import app.revanced.patcher.extensions.or
+import app.revanced.util.patch.LiteralValueFingerprint
+import com.android.tools.smali.dexlib2.AccessFlags
 
-internal object VideoIdParentFingerprint : MethodFingerprint(
-    returnType = "V",
-    parameters = listOf("Ljava/lang/Object;", "Ljava/lang/Exception;"),
-    strings = listOf("error retrieving subtitle"),
+internal object VideoIdParentFingerprint : LiteralValueFingerprint(
+    accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
+    returnType = "[L",
+    parameters = listOf("L"),
+    literalSupplier = { 524288L }
 )
\ No newline at end of file

From 405508ea8161295f92d7542bc0b597118eab0158 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 04:02:35 -0400
Subject: [PATCH 137/143] fix: 19.05 has a YouTube bug where on first load the
 layout is broken.  No reason to keep it when 19.49 and 19.16 are better
 choices..

---
 .../app/revanced/patches/youtube/ad/general/HideAdsPatch.kt      | 1 -
 .../patches/youtube/ad/getpremium/HideGetPremiumPatch.kt         | 1 -
 .../app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt       | 1 -
 .../interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt        | 1 -
 .../interaction/dialog/RemoveViewerDiscretionDialogPatch.kt      | 1 -
 .../patches/youtube/interaction/downloads/DownloadsPatch.kt      | 1 -
 .../interaction/seekbar/DisablePreciseSeekingGesturePatch.kt     | 1 -
 .../youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt     | 1 -
 .../youtube/interaction/seekbar/EnableSlideToSeekPatch.kt        | 1 -
 .../interaction/swipecontrols/SwipeControlsBytecodePatch.kt      | 1 -
 .../patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt     | 1 -
 .../patches/youtube/layout/buttons/action/HideButtonsPatch.kt    | 1 -
 .../youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt   | 1 -
 .../youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt   | 1 -
 .../youtube/layout/buttons/navigation/NavigationButtonsPatch.kt  | 1 -
 .../youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt | 1 -
 .../patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt    | 1 -
 .../patches/youtube/layout/hide/comments/CommentsPatch.kt        | 1 -
 .../youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt  | 1 -
 .../layout/hide/endscreencards/HideEndscreenCardsPatch.kt        | 1 -
 .../patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt  | 1 -
 .../hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt | 1 -
 .../fullscreenambientmode/DisableFullscreenAmbientModePatch.kt   | 1 -
 .../youtube/layout/hide/general/HideLayoutComponentsPatch.kt     | 1 -
 .../patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt  | 1 -
 .../hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt     | 1 -
 .../hide/rollingnumber/DisableRollingNumberAnimationPatch.kt     | 1 -
 .../patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt      | 1 -
 .../youtube/layout/hide/shorts/HideShortsComponentsPatch.kt      | 1 -
 .../DisableSuggestedVideoEndScreenPatch.kt                       | 1 -
 .../patches/youtube/layout/hide/time/HideTimestampPatch.kt       | 1 -
 .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt         | 1 -
 .../youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt        | 1 -
 .../layout/player/background/PlayerControlsBackgroundPatch.kt    | 1 -
 .../layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt     | 1 -
 .../patches/youtube/layout/searchbar/WideSearchbarPatch.kt       | 1 -
 .../youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt   | 1 -
 .../youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt     | 1 -
 .../youtube/layout/spoofappversion/SpoofAppVersionPatch.kt       | 1 -
 .../patches/youtube/layout/startpage/ChangeStartPagePatch.kt     | 1 -
 .../startupshortsreset/DisableResumingShortsOnStartupPatch.kt    | 1 -
 .../patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt     | 1 -
 .../revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt  | 1 -
 .../youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt      | 1 -
 .../youtube/layout/thumbnails/BypassImageRegionRestrictions.kt   | 1 -
 .../revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt  | 1 -
 .../youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt   | 1 -
 .../youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt  | 1 -
 .../misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt       | 1 -
 .../patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt  | 1 -
 .../app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt | 1 -
 .../patches/youtube/misc/links/BypassURLRedirectsPatch.kt        | 1 -
 .../patches/youtube/misc/links/OpenLinksExternallyPatch.kt       | 1 -
 .../youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt    | 1 -
 .../patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt    | 1 -
 .../patches/youtube/video/quality/RememberVideoQualityPatch.kt   | 1 -
 .../revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt   | 1 -
 .../video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt    | 1 -
 58 files changed, 58 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
index 83289ba2aa..9cb064b597 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/general/HideAdsPatch.kt
@@ -28,7 +28,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
index d3b8b191b0..4cb81e2fbd 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/getpremium/HideGetPremiumPatch.kt
@@ -22,7 +22,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
index 777084de56..aa3a7f71eb 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/VideoAdsPatch.kt
@@ -27,7 +27,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
index f1a5c4543b..ac5d7499b5 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/copyvideourl/CopyVideoUrlBytecodePatch.kt
@@ -21,7 +21,6 @@ import app.revanced.patches.youtube.video.information.VideoInformationPatch
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
index f796334752..88df4beae6 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/dialog/RemoveViewerDiscretionDialogPatch.kt
@@ -24,7 +24,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
index 362ab9d3e3..7d2dd4a9ac 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/downloads/DownloadsPatch.kt
@@ -27,7 +27,6 @@ import app.revanced.util.resultOrThrow
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
index 933c912ae8..04be050176 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/DisablePreciseSeekingGesturePatch.kt
@@ -26,7 +26,6 @@ import app.revanced.util.alsoResolve
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
index fd142ca797..e37eb7f38c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSeekbarTappingPatch.kt
@@ -29,7 +29,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 // 18.38.44 patches but crashes on startup.
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
index bfd4613cfc..5b40947aac 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/seekbar/EnableSlideToSeekPatch.kt
@@ -32,7 +32,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
index fd434b8254..63cffeb675 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/interaction/swipecontrols/SwipeControlsBytecodePatch.kt
@@ -28,7 +28,6 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
index ca8d33860a..f5ea004743 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/autocaptions/AutoCaptionsPatch.kt
@@ -26,7 +26,6 @@ import app.revanced.util.exception
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
index 139ef98536..f2994c824c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/action/HideButtonsPatch.kt
@@ -25,7 +25,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
index 1f5790b92c..161a3a2b3c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/autoplay/HideAutoplayButtonPatch.kt
@@ -36,7 +36,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
index 639f51424e..bf41baa3be 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/captions/HideCaptionsButtonPatch.kt
@@ -26,7 +26,6 @@ import com.android.tools.smali.dexlib2.Opcode
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
index 763e96cfb2..3ef0caba2a 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/navigation/NavigationButtonsPatch.kt
@@ -39,7 +39,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
index eaf29c9630..9581f8f8ac 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/buttons/player/hide/HidePlayerButtonsPatch.kt
@@ -34,7 +34,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
index cf91532b72..937f2b509d 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/albumcards/AlbumCardsPatch.kt
@@ -24,7 +24,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
index 7d894aa701..9c595da663 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/comments/CommentsPatch.kt
@@ -24,7 +24,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
index e7a4b2cae4..e186babd7b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/crowdfundingbox/CrowdfundingBoxPatch.kt
@@ -24,7 +24,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
index 436f52ea99..3585f800d5 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/endscreencards/HideEndscreenCardsPatch.kt
@@ -27,7 +27,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction21c
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
index ef91437c0e..7e4ad51230 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/filterbar/HideFilterBarPatch.kt
@@ -24,7 +24,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
index 58da6970b8..07b8425727 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/floatingmicrophone/HideFloatingMicrophoneButtonPatch.kt
@@ -20,7 +20,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
index 238ab29909..1e596071bd 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/fullscreenambientmode/DisableFullscreenAmbientModePatch.kt
@@ -21,7 +21,6 @@ import app.revanced.util.exception
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
index cdff7b898a..3930d17716 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/general/HideLayoutComponentsPatch.kt
@@ -48,7 +48,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
index b7eafec80e..cd162823eb 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/infocards/HideInfoCardsPatch.kt
@@ -32,7 +32,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
index 0f7485e27f..76ac414085 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/player/flyoutmenupanel/HidePlayerFlyoutMenuPatch.kt
@@ -25,7 +25,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
index e9c92fbc86..a2fe2ad1c4 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/rollingnumber/DisableRollingNumberAnimationPatch.kt
@@ -25,7 +25,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
             "com.google.android.youtube", [
                 // 18.43 is the earliest target this patch works.
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
index 5360f82024..0f4473523b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/seekbar/HideSeekbarPatch.kt
@@ -28,7 +28,6 @@ import app.revanced.util.alsoResolve
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
index 33cdbbd503..87986185de 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/shorts/HideShortsComponentsPatch.kt
@@ -46,7 +46,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
index 955bb6fa44..ec2802ed21 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/suggestedvideoendscreen/DisableSuggestedVideoEndScreenPatch.kt
@@ -20,7 +20,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
index c79b55a00e..47b89e353c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/hide/time/HideTimestampPatch.kt
@@ -21,7 +21,6 @@ import app.revanced.util.exception
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index b60caecc74..6f9309fc75 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -84,7 +84,6 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 // 19.14.43 // Incomplete code for modern miniplayers.
                 // 19.15.36 // Different code for handling subtitle texts and not worth supporting.
                 "19.16.39", // First with modern miniplayers.
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
index b058d0fdcd..5675204b13 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/panels/popup/PlayerPopupPanelsPatch.kt
@@ -21,7 +21,6 @@ import app.revanced.util.exception
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
index d1b8ec592c..f67bdc9f98 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/player/background/PlayerControlsBackgroundPatch.kt
@@ -16,7 +16,6 @@ import org.w3c.dom.Element
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
index 0bcd06ea13..9485bc3d24 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/returnyoutubedislike/ReturnYouTubeDislikePatch.kt
@@ -61,7 +61,6 @@ import com.android.tools.smali.dexlib2.iface.reference.TypeReference
         CompatiblePackage(
             "com.google.android.youtube", [
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
index 99b2fa42f9..cc029b92c0 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/searchbar/WideSearchbarPatch.kt
@@ -26,7 +26,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
index a50e5e1ee6..c28aa2564b 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/seekbar/RestoreOldSeekbarThumbnailsPatch.kt
@@ -24,7 +24,6 @@ import app.revanced.util.exception
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39"
                 // 19.17+ is not supported.
             ]
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
index b7780819fd..ea99e000ee 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/sponsorblock/SponsorBlockBytecodePatch.kt
@@ -46,7 +46,6 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
index ffd2ae9df3..df2fcf9c64 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/spoofappversion/SpoofAppVersionPatch.kt
@@ -24,7 +24,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
index defc3b5883..d58e772f18 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startpage/ChangeStartPagePatch.kt
@@ -33,7 +33,6 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
index ab3504ffc0..389c2a1cb9 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/startupshortsreset/DisableResumingShortsOnStartupPatch.kt
@@ -31,7 +31,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
index bb9955f5bc..d5c3aed445 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/tablet/EnableTabletLayoutPatch.kt
@@ -28,7 +28,6 @@ import app.revanced.util.resultOrThrow
             "com.google.android.youtube", arrayOf(
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
index 0574bf3b29..eb476cf337 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/theme/ThemeBytecodePatch.kt
@@ -37,7 +37,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
index b01739543f..f4088bbcae 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/AlternativeThumbnailsPatch.kt
@@ -30,7 +30,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
index b63be1e064..8ca354b88f 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/thumbnails/BypassImageRegionRestrictions.kt
@@ -26,7 +26,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
index ced12fd37e..a9521378fd 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/autorepeat/AutoRepeatPatch.kt
@@ -25,7 +25,6 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
index 8b6b809cb7..c639abb5e8 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/backgroundplayback/BackgroundPlaybackPatch.kt
@@ -39,7 +39,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
index d5a54f4996..3c3e2c45ab 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dimensions/spoof/SpoofDeviceDimensionsPatch.kt
@@ -22,7 +22,6 @@ import app.revanced.util.exception
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
index 09ce0fe16d..d816f24a68 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/dns/CheckWatchHistoryDomainNameResolutionPatch.kt
@@ -20,7 +20,6 @@ import app.revanced.util.resultOrThrow
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
index ee90b1d72f..f97553fc87 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/playback/SpoofVideoStreamsPatch.kt
@@ -51,7 +51,6 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
index 4571667c2c..e66efc9c60 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/gms/GmsCoreSupportPatch.kt
@@ -34,7 +34,6 @@ object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
             setOf(
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
index 6954e23abf..71052a3f3c 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/BypassURLRedirectsPatch.kt
@@ -37,7 +37,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
index 783755bf21..a19ff03cec 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/links/OpenLinksExternallyPatch.kt
@@ -26,7 +26,6 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
index 439d09292a..de5ecb2063 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/privacy/RemoveTrackingQueryParameterPatch.kt
@@ -30,7 +30,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt
index 31141a3113..437eea94e4 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/hdrbrightness/HDRBrightnessPatch.kt
@@ -35,7 +35,6 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
                 "19.02.39",
                 "19.03.36",
                 "19.04.38",
-                "19.05.36",
                 "19.06.39",
                 "19.07.40",
                 "19.08.36",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
index 2eb1d2a48e..71849406ab 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/quality/RememberVideoQualityPatch.kt
@@ -37,7 +37,6 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
             "com.google.android.youtube", [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
index f4b0e430ec..155ccecc50 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/PlaybackSpeedPatch.kt
@@ -23,7 +23,6 @@ import app.revanced.patches.youtube.video.speed.remember.RememberPlaybackSpeedPa
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",
diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
index 9a1b33069d..8f577d6885 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/videoqualitymenu/RestoreOldVideoQualityMenuPatch.kt
@@ -31,7 +31,6 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
             [
                 "18.38.44",
                 "18.49.37",
-                "19.05.36",
                 "19.16.39",
                 "19.25.37",
                 "19.34.42",

From a401e2ce567aa3ef1edcc9844fb60e76dcb8fcb3 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 05:15:23 -0400
Subject: [PATCH 138/143] Miniplayer: Adjust settings text

---
 .../layout/miniplayer/MiniplayerPatch.kt      | 29 ++++++++++---------
 .../resources/addresources/values/strings.xml | 20 +++++++------
 2 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 6f9309fc75..0d38ae45e9 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -101,9 +101,9 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
                 // 19.29.42 // All modern players are broken and ignore tapping the miniplayer video.
                 // 19.30.39 // Modern 3 is less broken when double tap expand is enabled, but cannot swipe to expand when double tap is off.
                 // 19.31.36 // All Modern 1 buttons are missing. Unusable.
-                // 19.32.36 // Works without issues.
-                // 19.33.35 // Works without issues.
-                "19.34.42", // Works without issues.
+                // 19.32.36 // 19.32+ and beyond all work without issues.
+                // 19.33.35
+                "19.34.42",
             ]
         )
     ]
@@ -140,6 +140,7 @@ object MiniplayerPatch : BytecodePatch(
                 entriesKey = "revanced_miniplayer_type_19_16_entries",
                 entryValuesKey = "revanced_miniplayer_type_19_16_entry_values"
             )
+
             if (VersionCheckPatch.is_19_25_or_greater) {
                 if (!VersionCheckPatch.is_19_29_or_greater) {
                     preferences += SwitchPreference("revanced_miniplayer_double_tap_action")
@@ -147,15 +148,21 @@ object MiniplayerPatch : BytecodePatch(
                 preferences += SwitchPreference("revanced_miniplayer_drag_and_drop")
             }
 
-            preferences += SwitchPreference(
-                key = "revanced_miniplayer_hide_expand_close",
-                summaryOnKey =
+            if (VersionCheckPatch.is_19_36_or_greater) {
+                preferences += SwitchPreference("revanced_miniplayer_rounded_corners")
+            }
+
+            preferences +=
                 if (VersionCheckPatch.is_19_26_or_greater) {
-                    "revanced_miniplayer_hide_expand_close_summary_on"
+                    SwitchPreference("revanced_miniplayer_hide_expand_close")
                 } else {
-                    "revanced_miniplayer_hide_expand_close_legacy_summary_on"
+                    SwitchPreference(
+                        key = "revanced_miniplayer_hide_expand_close",
+                        titleKey = "revanced_miniplayer_hide_expand_close_legacy_title",
+                        summaryOnKey = "revanced_miniplayer_hide_expand_close_legacy_summary_on",
+                        summaryOffKey = "revanced_miniplayer_hide_expand_close_legacy_summary_off",
+                    )
                 }
-            )
 
             if (!VersionCheckPatch.is_19_26_or_greater) {
                 preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward")
@@ -163,10 +170,6 @@ object MiniplayerPatch : BytecodePatch(
 
             preferences += SwitchPreference("revanced_miniplayer_hide_subtext")
 
-            if (VersionCheckPatch.is_19_36_or_greater) {
-                preferences += SwitchPreference("revanced_miniplayer_rounded_corners")
-            }
-
             if (VersionCheckPatch.is_19_26_or_greater) {
                 preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER)
             }
diff --git a/src/main/resources/addresources/values/strings.xml b/src/main/resources/addresources/values/strings.xml
index 1df5d9c3b1..00f138b057 100644
--- a/src/main/resources/addresources/values/strings.xml
+++ b/src/main/resources/addresources/values/strings.xml
@@ -1010,28 +1010,30 @@ This is because Crowdin requires temporarily flattening this file and removing t
             Modern 1
             Modern 2
             Modern 3
-            Miniplayer size
-            On screen size, in pixels
-            Pixel size must be between %1$s and %2$s
+            Enable rounded corners
+            Corners are rounded
+            Corners are square
             Enable double-tap and pinch to resize
             Double-tap action and pinch to resize is enabled\n\n• Double tap to increase miniplayer size\n• Double tap again to restore original size
             Double-tap action and pinch to resize is disabled
             Enable drag and drop
             Drag and drop is enabled\n\nMiniplayer can be dragged to any corner of the screen
             Drag and drop is disabled
-            Hide expand and close buttons
-            Buttons are hidden\n\nTap to expand, swipe to close
+            Hide close button
+            Close button is hidden
+            Close button is shown
+            Hide expand and close buttons
             Buttons are hidden\n\nSwipe to expand or close
-            Expand and close buttons are shown
+            Expand and close buttons are shown
             Hide subtexts
             Subtexts are hidden
             Subtexts are shown
             Hide skip forward and back buttons
             Skip forward and back are hidden
             Skip forward and back are shown
-            Use rounded corners
-            Corners are rounded
-            Corners are square
+            Initial size
+            Initial on screen size, in pixels
+            Pixel size must be between %1$s and %2$s
             Overlay opacity
             Opacity value between 0-100, where 0 is transparent
             Miniplayer overlay opacity must be between 0-100

From 85a35cf09995439c9a68ae269f64dbbb79120f21 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 05:40:23 -0400
Subject: [PATCH 139/143] fix(Miniplayer): Adjust settings order

---
 .../youtube/layout/miniplayer/MiniplayerPatch.kt       | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 0d38ae45e9..4345690dc7 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -71,8 +71,7 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter
 @Patch(
     name = "Miniplayer",
     description = "Adds options to change the in app minimized player. " +
-            "Patching target 19.16+ adds modern miniplayers. " +
-            "19.25 has drag and drop, and is the last version that can swipe to expand modern miniplayers.",
+            "Patching target 19.16+ adds modern miniplayers.",
     dependencies = [
         IntegrationsPatch::class,
         SettingsPatch::class,
@@ -126,6 +125,7 @@ object MiniplayerPatch : BytecodePatch(
         AddResourcesPatch(this::class)
 
         val preferences = mutableSetOf()
+
         if (!VersionCheckPatch.is_19_16_or_greater) {
             preferences += ListPreference(
                 "revanced_miniplayer_type",
@@ -152,6 +152,8 @@ object MiniplayerPatch : BytecodePatch(
                 preferences += SwitchPreference("revanced_miniplayer_rounded_corners")
             }
 
+            preferences += SwitchPreference("revanced_miniplayer_hide_subtext")
+
             preferences +=
                 if (VersionCheckPatch.is_19_26_or_greater) {
                     SwitchPreference("revanced_miniplayer_hide_expand_close")
@@ -168,8 +170,6 @@ object MiniplayerPatch : BytecodePatch(
                 preferences += SwitchPreference("revanced_miniplayer_hide_rewind_forward")
             }
 
-            preferences += SwitchPreference("revanced_miniplayer_hide_subtext")
-
             if (VersionCheckPatch.is_19_26_or_greater) {
                 preferences += TextPreference("revanced_miniplayer_width_dip", inputType = InputType.NUMBER)
             }
@@ -217,7 +217,7 @@ object MiniplayerPatch : BytecodePatch(
         }
 
         if (!VersionCheckPatch.is_19_16_or_greater) {
-            // Return here, as patch below is only intended for new versions of the app.
+            // Return here, as patch below is only for the current versions of the app.
             return
         }
 

From 01adee09ec0a19fabfb96c2eb2017d6c25d559c3 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 08:00:25 -0400
Subject: [PATCH 140/143] refactor: Cleanup and use of newer and simpler
 utility methods

---
 .../speed/custom/CustomPlaybackSpeedPatch.kt  | 175 +++++++++---------
 1 file changed, 91 insertions(+), 84 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt
index 826d9eeaa5..d5c5343807 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt
@@ -4,10 +4,10 @@ import app.revanced.patcher.data.BytecodeContext
 import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
 import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
+import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
 import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
 import app.revanced.patcher.extensions.or
 import app.revanced.patcher.patch.BytecodePatch
-import app.revanced.patcher.patch.PatchException
 import app.revanced.patcher.patch.annotation.Patch
 import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable
 import app.revanced.patches.all.misc.resources.AddResourcesPatch
@@ -18,11 +18,14 @@ import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
 import app.revanced.patches.youtube.misc.recyclerviewtree.hook.RecyclerViewTreeHookPatch
 import app.revanced.patches.youtube.misc.settings.SettingsPatch
 import app.revanced.patches.youtube.video.speed.custom.fingerprints.*
-import app.revanced.util.exception
+import app.revanced.util.alsoResolve
+import app.revanced.util.getReference
+import app.revanced.util.indexOfFirstInstructionOrThrow
+import app.revanced.util.indexOfFirstWideLiteralInstructionValue
+import app.revanced.util.indexOfFirstWideLiteralInstructionValueOrThrow
+import app.revanced.util.resultOrThrow
 import com.android.tools.smali.dexlib2.AccessFlags
-import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction
 import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
-import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
 import com.android.tools.smali.dexlib2.iface.reference.FieldReference
 import com.android.tools.smali.dexlib2.iface.reference.MethodReference
 import com.android.tools.smali.dexlib2.immutable.ImmutableField
@@ -59,83 +62,79 @@ object CustomPlaybackSpeedPatch : BytecodePatch(
             TextPreference("revanced_custom_playback_speeds", inputType = InputType.TEXT_MULTI_LINE)
         )
 
-        val arrayGenMethod = SpeedArrayGeneratorFingerprint.result?.mutableMethod!!
-        val arrayGenMethodImpl = arrayGenMethod.implementation!!
-
-        val sizeCallIndex = arrayGenMethodImpl.instructions
-            .indexOfFirst { ((it as? ReferenceInstruction)?.reference as? MethodReference)?.name == "size" }
-
-        if (sizeCallIndex == -1) throw PatchException("Couldn't find call to size()")
-
-        val sizeCallResultRegister =
-            (arrayGenMethodImpl.instructions.elementAt(sizeCallIndex + 1) as OneRegisterInstruction).registerA
-
-        arrayGenMethod.replaceInstruction(
-            sizeCallIndex + 1,
-            "const/4 v$sizeCallResultRegister, 0x0"
-        )
-
-        val (arrayLengthConstIndex, arrayLengthConst) = arrayGenMethodImpl.instructions.withIndex()
-            .first { (it.value as? NarrowLiteralInstruction)?.narrowLiteral == 7 }
-
-        val arrayLengthConstDestination = (arrayLengthConst as OneRegisterInstruction).registerA
-
-        val playbackSpeedsArrayType = "$INTEGRATIONS_CLASS_DESCRIPTOR->customPlaybackSpeeds:[F"
-
-        arrayGenMethod.addInstructions(
-            arrayLengthConstIndex + 1,
-            """
-                sget-object v$arrayLengthConstDestination, $playbackSpeedsArrayType
-                array-length v$arrayLengthConstDestination, v$arrayLengthConstDestination
-            """
-        )
-
-        val (originalArrayFetchIndex, originalArrayFetch) = arrayGenMethodImpl.instructions.withIndex()
-            .first {
-                val reference = ((it.value as? ReferenceInstruction)?.reference as? FieldReference)
-                reference?.definingClass?.contains("PlayerConfigModel") ?: false &&
-                        reference?.type == "[F"
+        SpeedArrayGeneratorFingerprint.resultOrThrow().mutableMethod.apply {
+            val sizeCallIndex = indexOfFirstInstructionOrThrow {
+                getReference()?.name == "size"
+            }
+            val sizeCallResultRegister = getInstruction(
+                sizeCallIndex + 1
+            ).registerA
+
+            replaceInstruction(
+                sizeCallIndex + 1,
+                "const/4 v$sizeCallResultRegister, 0x0"
+            )
+
+            val arrayLengthConstIndex = indexOfFirstWideLiteralInstructionValueOrThrow(7)
+            val arrayLengthConstDestination = getInstruction(
+                arrayLengthConstIndex
+            ).registerA
+            val playbackSpeedsArrayType = "$INTEGRATIONS_CLASS_DESCRIPTOR->customPlaybackSpeeds:[F"
+
+            addInstructions(
+                arrayLengthConstIndex + 1,
+                """
+                    sget-object v$arrayLengthConstDestination, $playbackSpeedsArrayType
+                    array-length v$arrayLengthConstDestination, v$arrayLengthConstDestination
+                """
+            )
+
+            val originalArrayFetchIndex = indexOfFirstInstructionOrThrow {
+                val reference = getReference()
+                reference?.type == "[F" && reference.definingClass.contains("PlayerConfigModel")
+            }
+            val originalArrayFetchDestination = getInstruction(
+                originalArrayFetchIndex
+            ).registerA
+
+            replaceInstruction(
+                originalArrayFetchIndex,
+                "sget-object v$originalArrayFetchDestination, $playbackSpeedsArrayType"
+            )
+        }
+
+        SpeedLimiterFingerprint.resultOrThrow().mutableMethod.apply {
+            val lowerLimitConst = 0.25f.toRawBits()
+            val upperLimitConst2x = 2.0f.toRawBits()
+            val upperLimitConst4x = 4.0f.toRawBits()
+
+            val limiterMinConstIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
+                lowerLimitConst.toLong()
+            )
+            var limiterMaxConstIndex = indexOfFirstWideLiteralInstructionValue(
+                upperLimitConst2x.toLong()
+            )
+            // Newer targets have 4x max speed.
+            if (limiterMaxConstIndex < 0) {
+                limiterMaxConstIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
+                    upperLimitConst4x.toLong()
+                )
             }
 
-        val originalArrayFetchDestination = (originalArrayFetch as OneRegisterInstruction).registerA
-
-        arrayGenMethod.replaceInstruction(
-            originalArrayFetchIndex,
-            "sget-object v$originalArrayFetchDestination, $playbackSpeedsArrayType"
-        )
-
-        val limiterMethod = SpeedLimiterFingerprint.result?.mutableMethod!!
-        val limiterMethodImpl = limiterMethod.implementation!!
-
-        val lowerLimitConst = 0.25f.toRawBits()
-        val upperLimitConst2x = 2.0f.toRawBits()
-        val upperLimitConst4x = 4.0f.toRawBits()
-        val (limiterMinConstIndex, limiterMinConst) = limiterMethodImpl.instructions.withIndex()
-            .first { (it.value as? NarrowLiteralInstruction)?.narrowLiteral == lowerLimitConst }
-        val (limiterMaxConstIndex, limiterMaxConst) = limiterMethodImpl.instructions.withIndex()
-            .first { (it.value as? NarrowLiteralInstruction)?.narrowLiteral in listOf(upperLimitConst2x, upperLimitConst4x) }
-
-        val limiterMinConstDestination = (limiterMinConst as OneRegisterInstruction).registerA
-        val limiterMaxConstDestination = (limiterMaxConst as OneRegisterInstruction).registerA
-
-        limiterMethod.replaceInstruction(
-            limiterMinConstIndex,
-            "const/high16 v$limiterMinConstDestination, 0x0"
-        )
-        limiterMethod.replaceInstruction(
-            limiterMaxConstIndex,
-            "const/high16 v$limiterMaxConstDestination, 0x41200000  # 10.0f"
-        )
-
-        // region Force old video quality menu.
-        // This is necessary, because there is no known way of adding custom playback speeds to the new menu.
-
-        RecyclerViewTreeHookPatch.addHook(INTEGRATIONS_CLASS_DESCRIPTOR)
+            val limiterMinConstDestination = getInstruction(limiterMinConstIndex).registerA
+            val limiterMaxConstDestination = getInstruction(limiterMaxConstIndex).registerA
 
-        // Required to check if the playback speed menu is currently shown.
-        LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
+            replaceInstruction(
+                limiterMinConstIndex,
+                "const/high16 v$limiterMinConstDestination, 0.0f"
+            )
+            replaceInstruction(
+                limiterMaxConstIndex,
+                "const/high16 v$limiterMaxConstDestination, 10.0f"
+            )
+        }
 
-        GetOldPlaybackSpeedsFingerprint.result?.let { result ->
+        GetOldPlaybackSpeedsFingerprint.resultOrThrow().let { result ->
             // Add a static INSTANCE field to the class.
             // This is later used to call "showOldPlaybackSpeedMenu" on the instance.
             val instanceField = ImmutableField(
@@ -155,13 +154,13 @@ object CustomPlaybackSpeedPatch : BytecodePatch(
 
             // Get the "showOldPlaybackSpeedMenu" method.
             // This is later called on the field INSTANCE.
-            val showOldPlaybackSpeedMenuMethod = ShowOldPlaybackSpeedMenuFingerprint.also {
-                if (!it.resolve(context, result.classDef))
-                    throw ShowOldPlaybackSpeedMenuFingerprint.exception
-            }.result!!.method.toString()
+            val showOldPlaybackSpeedMenuMethod = ShowOldPlaybackSpeedMenuFingerprint.alsoResolve(
+                context,
+                GetOldPlaybackSpeedsFingerprint
+            ).method.toString()
 
             // Insert the call to the "showOldPlaybackSpeedMenu" method on the field INSTANCE.
-            ShowOldPlaybackSpeedMenuIntegrationsFingerprint.result?.mutableMethod?.apply {
+            ShowOldPlaybackSpeedMenuIntegrationsFingerprint.resultOrThrow().mutableMethod.apply {
                 addInstructionsWithLabels(
                     implementation!!.instructions.lastIndex,
                     """
@@ -172,8 +171,16 @@ object CustomPlaybackSpeedPatch : BytecodePatch(
                         invoke-virtual { v0 }, $showOldPlaybackSpeedMenuMethod
                     """
                 )
-            } ?: throw ShowOldPlaybackSpeedMenuIntegrationsFingerprint.exception
-        } ?: throw GetOldPlaybackSpeedsFingerprint.exception
+            }
+        }
+
+        // region Force old video quality menu.
+        // This is necessary, because there is no known way of adding custom playback speeds to the new menu.
+
+        RecyclerViewTreeHookPatch.addHook(INTEGRATIONS_CLASS_DESCRIPTOR)
+
+        // Required to check if the playback speed menu is currently shown.
+        LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
 
         // endregion
     }

From 5c6a903c954ead182e66008ae300164d04a0c997 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 08:00:52 -0400
Subject: [PATCH 141/143] refactor: Use correct variable name

---
 .../youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt   | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
index 1322f0ec56..b936d7bf91 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/misc/fix/cairo/DisableCairoSettingsPatch.kt
@@ -44,12 +44,12 @@ internal object DisableCairoSettingsPatch : BytecodePatch(
             val literalIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
                 CarioFragmentConfigFingerprint.CAIRO_CONFIG_LITERAL_VALUE
             )
-            val targetIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
-            val targetRegister = getInstruction(targetIndex).registerA
+            val resultIndex = indexOfFirstInstructionOrThrow(literalIndex, Opcode.MOVE_RESULT)
+            val register = getInstruction(resultIndex).registerA
 
             addInstruction(
-                targetIndex + 1,
-                "const/16 v$targetRegister, 0x0"
+                resultIndex + 1,
+                "const/16 v$register, 0x0"
             )
         }
     }

From 6a8da9b004976b8dfcc89b63f0368166c0cdb460 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 08:03:26 -0400
Subject: [PATCH 142/143] refactor

---
 .../patches/youtube/layout/miniplayer/MiniplayerPatch.kt      | 2 --
 src/main/resources/addresources/values/arrays.xml             | 4 ++--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
index 4345690dc7..58f80a72d2 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/layout/miniplayer/MiniplayerPatch.kt
@@ -137,8 +137,6 @@ object MiniplayerPatch : BytecodePatch(
             preferences += ListPreference(
                 "revanced_miniplayer_type",
                 summaryKey = null,
-                entriesKey = "revanced_miniplayer_type_19_16_entries",
-                entryValuesKey = "revanced_miniplayer_type_19_16_entry_values"
             )
 
             if (VersionCheckPatch.is_19_25_or_greater) {
diff --git a/src/main/resources/addresources/values/arrays.xml b/src/main/resources/addresources/values/arrays.xml
index 88d233d9d1..829f9533e5 100644
--- a/src/main/resources/addresources/values/arrays.xml
+++ b/src/main/resources/addresources/values/arrays.xml
@@ -29,7 +29,7 @@
             
         
         
-            
+            
                 @string/revanced_miniplayer_type_entry_1
                 @string/revanced_miniplayer_type_entry_2
                 @string/revanced_miniplayer_type_entry_3
@@ -37,7 +37,7 @@
                 @string/revanced_miniplayer_type_entry_5
                 @string/revanced_miniplayer_type_entry_6
             
-            
+            
                 
                 ORIGINAL
                 PHONE

From a792c40a76932e201ec31cffb63e7359ebc3d062 Mon Sep 17 00:00:00 2001
From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Date: Sat, 19 Oct 2024 08:21:53 -0400
Subject: [PATCH 143/143] refactor

---
 .../video/speed/custom/CustomPlaybackSpeedPatch.kt | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt
index d5c5343807..bfdf2bfd85 100644
--- a/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt
+++ b/src/main/kotlin/app/revanced/patches/youtube/video/speed/custom/CustomPlaybackSpeedPatch.kt
@@ -62,6 +62,7 @@ object CustomPlaybackSpeedPatch : BytecodePatch(
             TextPreference("revanced_custom_playback_speeds", inputType = InputType.TEXT_MULTI_LINE)
         )
 
+        // Replace the speeds float array with custom speeds.
         SpeedArrayGeneratorFingerprint.resultOrThrow().mutableMethod.apply {
             val sizeCallIndex = indexOfFirstInstructionOrThrow {
                 getReference()?.name == "size"
@@ -91,7 +92,7 @@ object CustomPlaybackSpeedPatch : BytecodePatch(
 
             val originalArrayFetchIndex = indexOfFirstInstructionOrThrow {
                 val reference = getReference()
-                reference?.type == "[F" && reference.definingClass.contains("PlayerConfigModel")
+                reference?.type == "[F" && reference.definingClass.endsWith("/PlayerConfigModel;")
             }
             val originalArrayFetchDestination = getInstruction(
                 originalArrayFetchIndex
@@ -103,21 +104,18 @@ object CustomPlaybackSpeedPatch : BytecodePatch(
             )
         }
 
+        // Override the min/max speeds that can be used.
         SpeedLimiterFingerprint.resultOrThrow().mutableMethod.apply {
-            val lowerLimitConst = 0.25f.toRawBits()
-            val upperLimitConst2x = 2.0f.toRawBits()
-            val upperLimitConst4x = 4.0f.toRawBits()
-
             val limiterMinConstIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
-                lowerLimitConst.toLong()
+                0.25f.toRawBits().toLong()
             )
             var limiterMaxConstIndex = indexOfFirstWideLiteralInstructionValue(
-                upperLimitConst2x.toLong()
+                2.0f.toRawBits().toLong()
             )
             // Newer targets have 4x max speed.
             if (limiterMaxConstIndex < 0) {
                 limiterMaxConstIndex = indexOfFirstWideLiteralInstructionValueOrThrow(
-                    upperLimitConst4x.toLong()
+                    4.0f.toRawBits().toLong()
                 )
             }