mirror of https://github.com/M66B/NetGuard.git
Added development option to set DNS
This commit is contained in:
parent
dc968e449f
commit
f4e1382cb5
|
@ -199,6 +199,9 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Preference pref_dns = screen.findPreference("dns");
|
||||||
|
pref_dns.setSummary(Util.getDefaultDNS(this));
|
||||||
|
|
||||||
// Handle technical info
|
// Handle technical info
|
||||||
Preference.OnPreferenceClickListener listener = new Preference.OnPreferenceClickListener() {
|
Preference.OnPreferenceClickListener listener = new Preference.OnPreferenceClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -457,6 +460,16 @@ public class ActivitySettings extends AppCompatActivity implements SharedPrefere
|
||||||
|
|
||||||
} else if ("loglevel".equals(name))
|
} else if ("loglevel".equals(name))
|
||||||
SinkholeService.reload(null, "setting changed", this);
|
SinkholeService.reload(null, "setting changed", this);
|
||||||
|
|
||||||
|
else if ("dns".equals(name)) {
|
||||||
|
if (TextUtils.isEmpty(prefs.getString(name, null)))
|
||||||
|
prefs.edit().remove(name).apply();
|
||||||
|
if (prefs.getBoolean("filter", false)) {
|
||||||
|
// Requires a full stop to reconfigure the VPN
|
||||||
|
SinkholeService.stop("dns", this);
|
||||||
|
SinkholeService.start("dns", this);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -153,6 +153,11 @@
|
||||||
android:entryValues="@array/logLevelValues"
|
android:entryValues="@array/logLevelValues"
|
||||||
android:key="loglevel"
|
android:key="loglevel"
|
||||||
android:title="Native log level" />
|
android:title="Native log level" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:defaultValue=""
|
||||||
|
android:inputType="text"
|
||||||
|
android:key="dns"
|
||||||
|
android:title="DNS" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory
|
<PreferenceCategory
|
||||||
android:key="category_technical"
|
android:key="category_technical"
|
||||||
|
|
Loading…
Reference in New Issue