From c64f8a1b2d1b3f6b5252cdd614ec5fb98af0ea39 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Tue, 30 Jan 2024 11:47:08 +0300 Subject: [PATCH] disabler force traffic saver --- .../main/java/ru/vtosters/hooks/TogglesHook.java | 1 + .../java/ru/vtosters/hooks/other/Preferences.java | 4 ++++ .../lite/ui/fragments/DataSettingsFragment.java | 14 ++++++++++++++ smali/res/values-be/strings.xml | 3 +++ smali/res/values-ru/strings.xml | 3 +++ smali/res/values-uk/strings.xml | 3 +++ smali/res/values/strings.xml | 3 +++ 7 files changed, 31 insertions(+) diff --git a/app/src/main/java/ru/vtosters/hooks/TogglesHook.java b/app/src/main/java/ru/vtosters/hooks/TogglesHook.java index 95d98d849..435c6af30 100644 --- a/app/src/main/java/ru/vtosters/hooks/TogglesHook.java +++ b/app/src/main/java/ru/vtosters/hooks/TogglesHook.java @@ -25,6 +25,7 @@ public static boolean redirect(Features.Type feature) { postsredesign(); case FEATURE_IMAGE_QUALITY_UPGRADE -> MediaImageEncoder.needToSkipCompression(); case FEATURE_MENU_GAMES_CAROUSEL -> miniapps(); + case FEATURE_TRAFFIC_SAVER -> !disableForceTrafficSaver(); default -> true; }; } diff --git a/app/src/main/java/ru/vtosters/hooks/other/Preferences.java b/app/src/main/java/ru/vtosters/hooks/other/Preferences.java index b93d5a0aa..bb277ef83 100644 --- a/app/src/main/java/ru/vtosters/hooks/other/Preferences.java +++ b/app/src/main/java/ru/vtosters/hooks/other/Preferences.java @@ -177,6 +177,10 @@ public static boolean miniapps() { return getBoolValue("miniapps", true); } + public static boolean disableForceTrafficSaver() { + return getBoolValue("disableForceTrafficSaver", false); + } + public static boolean savemsgsett() { return getBoolValue("savemsgsett", false); } diff --git a/app/src/main/java/ru/vtosters/lite/ui/fragments/DataSettingsFragment.java b/app/src/main/java/ru/vtosters/lite/ui/fragments/DataSettingsFragment.java index 287cfc66f..1afb80eb6 100644 --- a/app/src/main/java/ru/vtosters/lite/ui/fragments/DataSettingsFragment.java +++ b/app/src/main/java/ru/vtosters/lite/ui/fragments/DataSettingsFragment.java @@ -287,6 +287,20 @@ public void onCreate(Bundle bundle) { PreferenceFragmentUtils.addPreferenceCategory(getPreferenceScreen(), AndroidUtils.getString("sett_other")); + PreferenceFragmentUtils.addMaterialSwitchPreference( + getPreferenceScreen(), + "disableForceTrafficSaver", + AndroidUtils.getString("disable_roaming_state"), + AndroidUtils.getString("disable_roaming_state_submit"), + null, + false, + (preference, o) -> { + Preferences.getPreferences().edit().putBoolean("disableForceTrafficSaver", (boolean) o).apply(); + LifecycleUtils.restartApplicationWithTimer(); + return true; + } + ); + if (!Preferences.serverFeaturesDisable()) { PreferenceFragmentUtils.addMaterialSwitchPreference( getPreferenceScreen(), diff --git a/smali/res/values-be/strings.xml b/smali/res/values-be/strings.xml index 1efb4c924..f2d4a62cf 100644 --- a/smali/res/values-be/strings.xml +++ b/smali/res/values-be/strings.xml @@ -7064,4 +7064,7 @@ Паменшаны MicroG (ReVanced) Альтэрнатыўны MicroG (ReVanced) Паўнавартасны MicroG (Замена GMS) + + Адключыць эканомію трафіку + Адключыць прымусовую функцыю эканоміі трафіку \ No newline at end of file diff --git a/smali/res/values-ru/strings.xml b/smali/res/values-ru/strings.xml index 83a2a26fc..89e516f2e 100644 --- a/smali/res/values-ru/strings.xml +++ b/smali/res/values-ru/strings.xml @@ -6447,4 +6447,7 @@ Уменьшенный MicroG (ReVanced) Альтернативный MicroG (ReVanced) Полноценный MicroG (Замена GMS) + + Отключить экономию трафика + Отключить принудительную функцию экономии трафика \ No newline at end of file diff --git a/smali/res/values-uk/strings.xml b/smali/res/values-uk/strings.xml index 7fab1bf5b..978cae5ba 100644 --- a/smali/res/values-uk/strings.xml +++ b/smali/res/values-uk/strings.xml @@ -6372,4 +6372,7 @@ Зменшений MicroG (ReVanced) Альтернативний MicroG (ReVanced) Повноцінний MicroG (Заміна GMS) + + Відключення примусової економії трафіку + Вимкніть примусову функцію економії трафіку diff --git a/smali/res/values/strings.xml b/smali/res/values/strings.xml index 11ef74c4c..c659858a5 100644 --- a/smali/res/values/strings.xml +++ b/smali/res/values/strings.xml @@ -6584,4 +6584,7 @@ May look like a fake leaving the online" Reduced MicroG (ReVanced) Alternate MicroG (ReVanced) Full MicroG (GMS Replacement) + + Disable force traffic saver + Disable forcing traffic saver feature