1
0
Fork 0
mirror of https://github.com/M66B/NetGuard.git synced 2024-12-21 23:33:21 +00:00

Revert "skip automatic update check notification for beta releases"

This reverts commit cf63219eaf.
This commit is contained in:
M66B 2024-10-14 18:13:28 +02:00
parent 3aab3d7aad
commit f65c7d247d
6 changed files with 4 additions and 26 deletions

View file

@ -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");

View file

@ -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");
}

View file

@ -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) {

View file

@ -84,7 +84,6 @@
<string name="setting_auto">Auto enable after %1$s minutes</string>
<string name="setting_delay">Delay screen off %1$s minutes</string>
<string name="setting_update">Check for updates</string>
<string name="setting_beta_release">Beta releases</string>
<string name="setting_network_options">Network options</string>
<string name="setting_subnet">Subnet routing</string>
@ -156,7 +155,6 @@
<string name="summary_auto">After disabling using the widget, automatically enable NetGuard again after the selected number of minutes (enter zero to disable this option)</string>
<string name="summary_delay">After turning the screen off, keep screen on rules active for the selected number of minutes (enter zero to disable this option)</string>
<string name="summary_update">Check for new releases on GitHub twice daily</string>
<string name="summary_beta_release">Notify for beta releases</string>
<string name="summary_tethering">Depending on the Android version, tethering may work or may not work. Tethered traffic cannot be filtered.</string>
<string name="summary_subnet">Enable subnet routing; might enable Wi-Fi calling, but might also trigger bugs in Android and increase battery usage</string>

View file

@ -70,12 +70,6 @@
android:key="update_check"
android:summary="@string/summary_update"
android:title="@string/setting_update" />
<CheckBoxPreference
android:defaultValue="false"
android:dependency="update_check"
android:key="beta_release"
android:summary="@string/summary_beta_release"
android:title="@string/setting_beta_release" />
</PreferenceCategory>
</PreferenceScreen>

View file

@ -70,12 +70,6 @@
android:key="update_check"
android:summary="@string/summary_update"
android:title="@string/setting_update" />
<eu.faircode.netguard.SwitchPreference
android:defaultValue="false"
android:dependency="update_check"
android:key="beta_release"
android:summary="@string/summary_beta_release"
android:title="@string/setting_beta_release" />
</PreferenceCategory>
</PreferenceScreen>