mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-22 07:43:15 +00:00
Direct StevenBlack's hosts file download
This commit is contained in:
parent
0fc9b51933
commit
785a425b8c
1 changed files with 6 additions and 1 deletions
|
@ -359,9 +359,14 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
|||
public boolean onPreferenceClick(Preference preference) {
|
||||
final File tmp = new File(getFilesDir(), "hosts.tmp");
|
||||
final File hosts = new File(getFilesDir(), "hosts.txt");
|
||||
|
||||
EditTextPreference pref_hosts_url = (EditTextPreference) screen.findPreference("hosts_url");
|
||||
String hosts_url = pref_hosts_url.getText();
|
||||
if ("https://www.netguard.me/hosts".equals(hosts_url))
|
||||
hosts_url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts";
|
||||
|
||||
try {
|
||||
new DownloadTask(ActivitySettings.this, new URL(pref_hosts_url.getText()), tmp, new DownloadTask.Listener() {
|
||||
new DownloadTask(ActivitySettings.this, new URL(hosts_url), tmp, new DownloadTask.Listener() {
|
||||
@Override
|
||||
public void onCompleted() {
|
||||
if (hosts.exists())
|
||||
|
|
Loading…
Reference in a new issue