Skip to content

Commit

Permalink
disabler force traffic saver
Browse files Browse the repository at this point in the history
  • Loading branch information
gdlbo committed Jan 30, 2024
1 parent dd6916c commit c64f8a1
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/src/main/java/ru/vtosters/hooks/TogglesHook.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/ru/vtosters/hooks/other/Preferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
3 changes: 3 additions & 0 deletions smali/res/values-be/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7064,4 +7064,7 @@
<string name="microg_dialog1">Паменшаны MicroG (ReVanced)</string>
<string name="microg_dialog2">Альтэрнатыўны MicroG (ReVanced)</string>
<string name="microg_dialog3">Паўнавартасны MicroG (Замена GMS)</string>

<string name="disable_roaming_state">Адключыць эканомію трафіку</string>
<string name="disable_roaming_state_submit">Адключыць прымусовую функцыю эканоміі трафіку</string>
</resources>
3 changes: 3 additions & 0 deletions smali/res/values-ru/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6447,4 +6447,7 @@
<string name="microg_dialog1">Уменьшенный MicroG (ReVanced)</string>
<string name="microg_dialog2">Альтернативный MicroG (ReVanced)</string>
<string name="microg_dialog3">Полноценный MicroG (Замена GMS)</string>

<string name="disable_roaming_state">Отключить экономию трафика</string>
<string name="disable_roaming_state_submit">Отключить принудительную функцию экономии трафика</string>
</resources>
3 changes: 3 additions & 0 deletions smali/res/values-uk/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6372,4 +6372,7 @@
<string name="microg_dialog1">Зменшений MicroG (ReVanced)</string>
<string name="microg_dialog2">Альтернативний MicroG (ReVanced)</string>
<string name="microg_dialog3">Повноцінний MicroG (Заміна GMS)</string>

<string name="disable_roaming_state">Відключення примусової економії трафіку</string>
<string name="disable_roaming_state_submit">Вимкніть примусову функцію економії трафіку</string>
</resources>
3 changes: 3 additions & 0 deletions smali/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6584,4 +6584,7 @@ May look like a fake leaving the online"</string>
<string name="microg_dialog1">Reduced MicroG (ReVanced)</string>
<string name="microg_dialog2">Alternate MicroG (ReVanced)</string>
<string name="microg_dialog3">Full MicroG (GMS Replacement)</string>

<string name="disable_roaming_state">Disable force traffic saver</string>
<string name="disable_roaming_state_submit">Disable forcing traffic saver feature</string>
</resources>

0 comments on commit c64f8a1

Please sign in to comment.