From f65c7d247d62778025d0fe78a50b3b6a9bbc9b9d Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 14 Oct 2024 18:13:28 +0200 Subject: [PATCH] Revert "skip automatic update check notification for beta releases" This reverts commit cf63219eafdc15feac56a68f1e6ae9ced04a63a1. --- .../java/eu/faircode/netguard/ActivitySettings.java | 4 +--- .../java/eu/faircode/netguard/ReceiverAutostart.java | 1 - .../java/eu/faircode/netguard/ServiceSinkhole.java | 11 +++-------- app/src/main/res/values/strings.xml | 2 -- app/src/main/res/xml-v14/preferences.xml | 6 ------ app/src/main/res/xml-v21/preferences.xml | 6 ------ 6 files changed, 4 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/ActivitySettings.java b/app/src/main/java/eu/faircode/netguard/ActivitySettings.java index f8d41df5..55b5dcee 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivitySettings.java +++ b/app/src/main/java/eu/faircode/netguard/ActivitySettings.java @@ -319,10 +319,8 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere pref_rcode.setTitle(getString(R.string.setting_rcode, prefs.getString("rcode", "3"))); - if (Util.isPlayStoreInstall(this) || !Util.hasValidFingerprint(this)) { + if (Util.isPlayStoreInstall(this) || !Util.hasValidFingerprint(this)) cat_options.removePreference(screen.findPreference("update_check")); - cat_options.removePreference(screen.findPreference("beta_release")); - } if (Util.isPlayStoreInstall(this)) { Log.i(TAG, "Play store install"); diff --git a/app/src/main/java/eu/faircode/netguard/ReceiverAutostart.java b/app/src/main/java/eu/faircode/netguard/ReceiverAutostart.java index 91e10b2e..3831a4ef 100644 --- a/app/src/main/java/eu/faircode/netguard/ReceiverAutostart.java +++ b/app/src/main/java/eu/faircode/netguard/ReceiverAutostart.java @@ -118,7 +118,6 @@ public class ReceiverAutostart extends BroadcastReceiver { if (Util.isPlayStoreInstall(context)) { editor.remove("update_check"); - editor.remove("beta_release"); editor.remove("use_hosts"); editor.remove("hosts_url"); } diff --git a/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java b/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java index 8ae5c69a..c37db24e 100644 --- a/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java +++ b/app/src/main/java/eu/faircode/netguard/ServiceSinkhole.java @@ -671,7 +671,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS if (!Util.isPlayStoreInstall(ServiceSinkhole.this) && Util.hasValidFingerprint(ServiceSinkhole.this) && prefs.getBoolean("update_check", true)) - checkUpdate(prefs.getBoolean("beta_release", false)); + checkUpdate(); } private void watchdog(Intent intent) { @@ -684,7 +684,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS } } - private void checkUpdate(boolean notifyForBetaReleases) { + private void checkUpdate() { StringBuilder json = new StringBuilder(); HttpsURLConnection urlConnection = null; try { @@ -705,12 +705,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS try { JSONObject jroot = new JSONObject(json.toString()); - if (jroot.has("tag_name") && jroot.has("html_url") && jroot.has("assets") && jroot.has("name")) { - String releaseName = jroot.getString("name"); - if (!notifyForBetaReleases && releaseName.contains("beta")) { - Log.i(TAG, "Skipping beta release '" + releaseName + "' due to update preferences"); - return; - } + if (jroot.has("tag_name") && jroot.has("html_url") && jroot.has("assets")) { String url = jroot.getString("html_url"); JSONArray jassets = jroot.getJSONArray("assets"); if (jassets.length() > 0) { diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 269d0e05..7ce7c003 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -84,7 +84,6 @@ Auto enable after %1$s minutes Delay screen off %1$s minutes Check for updates - Beta releases Network options Subnet routing @@ -156,7 +155,6 @@ After disabling using the widget, automatically enable NetGuard again after the selected number of minutes (enter zero to disable this option) After turning the screen off, keep screen on rules active for the selected number of minutes (enter zero to disable this option) Check for new releases on GitHub twice daily - Notify for beta releases Depending on the Android version, tethering may work or may not work. Tethered traffic cannot be filtered. Enable subnet routing; might enable Wi-Fi calling, but might also trigger bugs in Android and increase battery usage diff --git a/app/src/main/res/xml-v14/preferences.xml b/app/src/main/res/xml-v14/preferences.xml index dafd366d..7278b291 100644 --- a/app/src/main/res/xml-v14/preferences.xml +++ b/app/src/main/res/xml-v14/preferences.xml @@ -70,12 +70,6 @@ android:key="update_check" android:summary="@string/summary_update" android:title="@string/setting_update" /> - diff --git a/app/src/main/res/xml-v21/preferences.xml b/app/src/main/res/xml-v21/preferences.xml index 8ceb2f8c..59fdcb59 100644 --- a/app/src/main/res/xml-v21/preferences.xml +++ b/app/src/main/res/xml-v21/preferences.xml @@ -70,12 +70,6 @@ android:key="update_check" android:summary="@string/summary_update" android:title="@string/setting_update" /> -