mirror of
https://github.com/M66B/NetGuard.git
synced 2024-12-22 07:43:15 +00:00
COpy search domain from active network
This commit is contained in:
parent
a3375e11c8
commit
37ff174b1f
1 changed files with 14 additions and 0 deletions
|
@ -1291,6 +1291,20 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
|
||||||
|
try {
|
||||||
|
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
Network active = (cm == null ? null : cm.getActiveNetwork());
|
||||||
|
LinkProperties props = (active == null ? null : cm.getLinkProperties(active));
|
||||||
|
String domain = (props == null ? null : props.getDomains());
|
||||||
|
if (domain != null) {
|
||||||
|
Log.i(TAG, "Using search domain=" + domain);
|
||||||
|
builder.addSearchDomain(domain);
|
||||||
|
}
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex));
|
||||||
|
}
|
||||||
|
|
||||||
// Subnet routing
|
// Subnet routing
|
||||||
if (subnet) {
|
if (subnet) {
|
||||||
// Exclude IP ranges
|
// Exclude IP ranges
|
||||||
|
|
Loading…
Reference in a new issue