From ff0c03cf2d408a388e511f1821a5c4fcd96cd9c0 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Fri, 6 Dec 2024 19:51:56 +0400 Subject: [PATCH] fix: Remove least spoken languages --- .../ReVancedPreferenceFragment.java | 8 +++- .../resources/addresources/values/arrays.xml | 47 ------------------- .../resources/addresources/values/strings.xml | 23 --------- 3 files changed, 6 insertions(+), 72 deletions(-) diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java index a930504caf..ed4502aef4 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/settings/preference/ReVancedPreferenceFragment.java @@ -54,9 +54,13 @@ private static void sortListPreferenceByValues(ListPreference listPreference) { CharSequence[] entryValues = listPreference.getEntryValues(); final int entrySize = entries.length; + if (entrySize != entryValues.length) { + throw new IllegalStateException(); + } + // Ensure the first entry remains the first after sorting. - String firstEntry = entries[0].toString(); - String firstEntryValue = entryValues[0].toString(); + CharSequence firstEntry = entries[0]; + CharSequence firstEntryValue = entryValues[0]; List> entryPairs = new ArrayList<>(entrySize); for (int i = 1; i < entrySize; i++) { diff --git a/patches/src/main/resources/addresources/values/arrays.xml b/patches/src/main/resources/addresources/values/arrays.xml index 8b24eddf42..ee9b80f789 100644 --- a/patches/src/main/resources/addresources/values/arrays.xml +++ b/patches/src/main/resources/addresources/values/arrays.xml @@ -13,15 +13,10 @@ @string/revanced_spoof_video_streams_language_DEFAULT - @string/revanced_spoof_video_streams_language_AF - @string/revanced_spoof_video_streams_language_AM @string/revanced_spoof_video_streams_language_AR - @string/revanced_spoof_video_streams_language_AS @string/revanced_spoof_video_streams_language_AZ - @string/revanced_spoof_video_streams_language_BE @string/revanced_spoof_video_streams_language_BG @string/revanced_spoof_video_streams_language_BN - @string/revanced_spoof_video_streams_language_BS @string/revanced_spoof_video_streams_language_CA @string/revanced_spoof_video_streams_language_CS @string/revanced_spoof_video_streams_language_DA @@ -30,39 +25,26 @@ @string/revanced_spoof_video_streams_language_EN @string/revanced_spoof_video_streams_language_ES @string/revanced_spoof_video_streams_language_ET - @string/revanced_spoof_video_streams_language_EU @string/revanced_spoof_video_streams_language_FA @string/revanced_spoof_video_streams_language_FI @string/revanced_spoof_video_streams_language_FR - @string/revanced_spoof_video_streams_language_GL @string/revanced_spoof_video_streams_language_GU - @string/revanced_spoof_video_streams_language_HE @string/revanced_spoof_video_streams_language_HI @string/revanced_spoof_video_streams_language_HR @string/revanced_spoof_video_streams_language_HU - @string/revanced_spoof_video_streams_language_HY @string/revanced_spoof_video_streams_language_ID - @string/revanced_spoof_video_streams_language_IS @string/revanced_spoof_video_streams_language_IT @string/revanced_spoof_video_streams_language_JA - @string/revanced_spoof_video_streams_language_KA @string/revanced_spoof_video_streams_language_KK - @string/revanced_spoof_video_streams_language_KM - @string/revanced_spoof_video_streams_language_KN @string/revanced_spoof_video_streams_language_KO - @string/revanced_spoof_video_streams_language_KY - @string/revanced_spoof_video_streams_language_LO @string/revanced_spoof_video_streams_language_LT @string/revanced_spoof_video_streams_language_LV @string/revanced_spoof_video_streams_language_MK - @string/revanced_spoof_video_streams_language_ML @string/revanced_spoof_video_streams_language_MN @string/revanced_spoof_video_streams_language_MR @string/revanced_spoof_video_streams_language_MS @string/revanced_spoof_video_streams_language_MY - @string/revanced_spoof_video_streams_language_NE @string/revanced_spoof_video_streams_language_NL - @string/revanced_spoof_video_streams_language_NB @string/revanced_spoof_video_streams_language_OR @string/revanced_spoof_video_streams_language_PA @string/revanced_spoof_video_streams_language_PL @@ -70,10 +52,8 @@ @string/revanced_spoof_video_streams_language_PT_PT @string/revanced_spoof_video_streams_language_RO @string/revanced_spoof_video_streams_language_RU - @string/revanced_spoof_video_streams_language_SI @string/revanced_spoof_video_streams_language_SK @string/revanced_spoof_video_streams_language_SL - @string/revanced_spoof_video_streams_language_SQ @string/revanced_spoof_video_streams_language_SR @string/revanced_spoof_video_streams_language_SR_LATN @string/revanced_spoof_video_streams_language_SV @@ -81,27 +61,19 @@ @string/revanced_spoof_video_streams_language_TA @string/revanced_spoof_video_streams_language_TE @string/revanced_spoof_video_streams_language_TH - @string/revanced_spoof_video_streams_language_TL @string/revanced_spoof_video_streams_language_TR @string/revanced_spoof_video_streams_language_UK @string/revanced_spoof_video_streams_language_UR - @string/revanced_spoof_video_streams_language_UZ @string/revanced_spoof_video_streams_language_VI @string/revanced_spoof_video_streams_language_ZH_CN @string/revanced_spoof_video_streams_language_ZH_TW - @string/revanced_spoof_video_streams_language_ZU DEFAULT - AF - AM AR - AS AZ - BE BG BN - BS CA CS DA @@ -110,39 +82,26 @@ EN ES ET - EU FA FI FR - GL GU - HE HI HR HU - HY ID - IS IT JA - KA KK - KM - KN KO - KY - LO LT LV MK - ML MN MR MS MY - NE NL - NB OR PA PL @@ -150,10 +109,8 @@ PT_PT RO RU - SI SK SL - SQ SR SR_LATN SV @@ -161,16 +118,12 @@ TA TE TH - TL TR UK UR - UZ VI ZH_CN - ZH_HK ZH_TW - ZU diff --git a/patches/src/main/resources/addresources/values/strings.xml b/patches/src/main/resources/addresources/values/strings.xml index dac4514812..77ef6e5fb3 100644 --- a/patches/src/main/resources/addresources/values/strings.xml +++ b/patches/src/main/resources/addresources/values/strings.xml @@ -1231,15 +1231,10 @@ This is because Crowdin requires temporarily flattening this file and removing t Video streams are spoofed Preferred audio stream language App language - Afrikaans - Amharic Arabic - Assamese Azerbaijani - Belarusian Bulgarian Bengali - Bosnian Catalan Czech Danish @@ -1248,39 +1243,26 @@ This is because Crowdin requires temporarily flattening this file and removing t English Spanish Estonian - Basque Persian Finnish French - Galician Gujarati - Hebrew Hindi Croatian Hungarian - Armenian Indonesian - Icelandic Italian Japanese - Georgian Kazakh - Khmer - Kannada Korean - Kyrgyz - Lao Lithuanian Latvian Macedonian - Malayalam Mongolian Marathi Malay Burmese - Nepali Dutch - Norwegian Bokmål Odia Punjabi Polish @@ -1288,10 +1270,8 @@ This is because Crowdin requires temporarily flattening this file and removing t Portuguese (Portugal) Romanian Russian - Sinhala Slovak Slovene - Albanian Serbian Serbian (Latin) Swedish @@ -1299,15 +1279,12 @@ This is because Crowdin requires temporarily flattening this file and removing t Tamil Telugu Thai - Tagalog Turkish Ukrainian Urdu - Uzbek Vietnamese Chinese (Simplified) Chinese (Traditional) - Zulu