Fixed hosts file URIs

This commit is contained in:
M66B 2020-09-09 22:58:33 +02:00
parent 5b53dd32d8
commit 9dede18b51
3 changed files with 4 additions and 4 deletions

View File

@ -55,7 +55,7 @@ android {
proguardFiles.add(file('proguard-rules.pro'))
signingConfig signingConfigs.release
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "String", "HOSTS_FILE_URI", "\"https://www.netguard.me/hosts\""
buildConfigField "String", "HOSTS_FILE_URI", "\"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts\""
buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/NetGuard/releases/latest\""
}
play {
@ -72,7 +72,7 @@ android {
useProguard = true
proguardFiles.add(file('proguard-rules.pro'))
buildConfigField "boolean", "PLAY_STORE_RELEASE", "false"
buildConfigField "String", "HOSTS_FILE_URI", "\"https://www.netguard.me/hosts\""
buildConfigField "String", "HOSTS_FILE_URI", "\"https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts\""
buildConfigField "String", "GITHUB_LATEST_API", "\"https://api.github.com/repos/M66B/NetGuard/releases/latest\""
}
}

View File

@ -363,7 +363,7 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
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";
hosts_url = BuildConfig.HOSTS_FILE_URI;
try {
new DownloadTask(ActivitySettings.this, new URL(hosts_url), tmp, new DownloadTask.Listener() {

View File

@ -63,7 +63,7 @@ public class ServiceExternal extends IntentService {
String hosts_url = prefs.getString("hosts_url", null);
if ("https://www.netguard.me/hosts".equals(hosts_url))
hosts_url = "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts";
hosts_url = BuildConfig.HOSTS_FILE_URI;
File tmp = new File(getFilesDir(), "hosts.tmp");
File hosts = new File(getFilesDir(), "hosts.txt");