Skip to content

Commit 7523416

Browse files
authored
Merge pull request #212 from rizqi-developer/disable-update-check
feat: add disable check update
2 parents 16710fa + 315f18f commit 7523416

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

app/src/main/java/com/wmods/wppenhacer/ui/fragments/base/BasePreferenceFragment.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ private boolean checkStoragePermission(Object newValue) {
103103

104104
@SuppressLint("ApplySharedPref")
105105
private void chanceStates(String key) {
106+
107+
var update_check = mPrefs.getBoolean("update_check", true);
108+
setPreferenceState("update_check", update_check);
106109

107110
var lite_mode = mPrefs.getBoolean("lite_mode", false);
108111

app/src/main/java/com/wmods/wppenhacer/xposed/core/FeatureLoader.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ private static void initComponents(ClassLoader loader, XSharedPreferences pref)
187187
checkUpdate(activity);
188188
}
189189

190-
// Check for Update
191-
if (App.isOriginalPackage()) {
190+
// Check for WAE Update
191+
if (App.isOriginalPackage() && pref.getBoolean("update_check", true)) {
192192
if (activity.getClass().getSimpleName().equals("HomeActivity") && state == WppCore.ActivityChangeState.ChangeType.START) {
193193
CompletableFuture.runAsync(new UpdateChecker(activity));
194194
}

app/src/main/res/values/strings.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,13 @@
405405
<string name="download_folder_permission">Download Folder Permission</string>
406406
<string name="lite_mode">Lite Mode</string>
407407
<string name="lite_mode_sum">Lite Mode disables most theme features and the connection bridge that keeps WhatsApp always active is turned off.</string>
408+
<string name="update_check">Automatically Check for Update</string>
409+
<string name="update_check_sum">
410+
Enable or Disable Auto Check for Update. This will disable the popup inside the WhatsApp Application.\n
411+
<font color="#FFFF0000">
412+
WARNING: YOU WILL NOT BE NOTIFIED WHEN THERE'S A NEW UPDATE, USE THIS CAREFULLY AND DON'T REPORT ISSUE IF YOU'RE USING OUTDATED VERSION!
413+
</font>
414+
</string>
408415
<string name="change_default_dpi">Change Default DPI</string>
409416
<string name="change_default_dpi_sum">Change the DPI setting for the application. Use 0 to reset to default.</string>
410417
</resources>

app/src/main/res/xml/preference_general_home.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
app:key="thememode"
1212
app:summary="%s"
1313
app:title="@string/theme_mode" />
14+
15+
<rikka.material.preference.MaterialSwitchPreference
16+
app:key="update_check"
17+
app:defaultValue="true"
18+
app:summary="@string/update_check_sum"
19+
app:title="@string/update_check" />
1420

1521
<rikka.material.preference.MaterialSwitchPreference
1622
app:key="lite_mode"

0 commit comments

Comments
 (0)