From 3e7b690d76ae9bba2e823b543c726d68035fb794 Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Sun, 22 Dec 2024 18:23:45 +0900 Subject: [PATCH] fix(YouTube): Some strings are missing https://github.com/inotia00/ReVanced_Extended/issues/2597 --- .../patches/youtube/utils/settings/SettingsPatch.kt | 13 +++++++++++++ .../youtube/settings/values-v21/strings.xml | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 patches/src/main/resources/youtube/settings/values-v21/strings.xml diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt index e1bcc7c8c..13e59bb69 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/utils/settings/SettingsPatch.kt @@ -29,6 +29,7 @@ import app.revanced.util.removeStringsElements import app.revanced.util.valueOrThrow import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction import org.w3c.dom.Element +import java.nio.file.Files import java.util.jar.Manifest private const val EXTENSION_INITIALIZATION_CLASS_DESCRIPTOR = @@ -182,6 +183,18 @@ val settingsPatch = resourcePatch( copyXmlNode("youtube/settings/host", "values/$xmlFile", "resources") } + val valuesV21Directory = get("res").resolve("values-v21") + if (!valuesV21Directory.isDirectory) + Files.createDirectories(valuesV21Directory.toPath()) + + copyResources( + "youtube/settings", + ResourceGroup( + "values-v21", + "strings.xml" + ) + ) + arrayOf( ResourceGroup( "drawable", diff --git a/patches/src/main/resources/youtube/settings/values-v21/strings.xml b/patches/src/main/resources/youtube/settings/values-v21/strings.xml new file mode 100644 index 000000000..6fe87a4c3 --- /dev/null +++ b/patches/src/main/resources/youtube/settings/values-v21/strings.xml @@ -0,0 +1,7 @@ + + + + @string/revanced_spoof_streaming_data_side_effects_android + @string/revanced_spoof_streaming_data_side_effects_android + @string/revanced_spoof_streaming_data_side_effects_android +