Let use hosts settings depend on filtering mode only

Refs #459
This commit is contained in:
M66B 2016-07-08 07:17:07 +02:00
parent d72a170fe1
commit 2bfffec9bf
2 changed files with 1 additions and 5 deletions

View File

@ -5,8 +5,8 @@ Instructions:
* Download/install the latest NetGuard version [from GitHub](https://github.com/M66B/NetGuard/releases)
* Enable the setting '*Filter traffic*' in the advanced options (always enabled on Android 5.0 or earlier)
* Import or download [a hosts file](https://en.wikipedia.org/wiki/Hosts_(file)) using the NetGuard backup settings
* Enable the setting '*Block domain names*' in the advanced options (default enabled)
* Import or download [a hosts file](https://en.wikipedia.org/wiki/Hosts_(file)) using the NetGuard backup settings
* Disable browser compression (Chrome: three dot menu > Settings > Data Saver > Off)
* Wait 10 minutes to let the Android DNS cache time out
* Test if it works by opening [this page](http://www.netguard.me/test)

View File

@ -270,8 +270,6 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
cat_backup.removePreference(pref_hosts_download);
} else {
pref_block_domains.setEnabled(new File(getFilesDir(), "hosts.txt").exists());
String last_import = prefs.getString("hosts_last_import", null);
String last_download = prefs.getString("hosts_last_download", null);
if (last_import != null)
@ -310,7 +308,6 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
prefs.edit().putString("hosts_last_download", last).apply();
if (running) {
getPreferenceScreen().findPreference("use_hosts").setEnabled(true);
pref_hosts_download.setSummary(getString(R.string.msg_download_last, last));
Toast.makeText(ActivitySettings.this, R.string.msg_downloaded, Toast.LENGTH_LONG).show();
}
@ -947,7 +944,6 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
prefs.edit().putString("hosts_last_import", last).apply();
if (running) {
getPreferenceScreen().findPreference("use_hosts").setEnabled(true);
getPreferenceScreen().findPreference("hosts_import").setSummary(getString(R.string.msg_import_last, last));
Toast.makeText(ActivitySettings.this, R.string.msg_completed, Toast.LENGTH_LONG).show();
}