mirror of https://github.com/M66B/NetGuard.git
Compare commits
3 Commits
589b4828b1
...
1f56b996f5
Author | SHA1 | Date |
---|---|---|
M66B | 1f56b996f5 | |
M66B | 69e2a37200 | |
M66B | c5e9414bb4 |
|
@ -9,10 +9,10 @@ android {
|
|||
|
||||
defaultConfig {
|
||||
applicationId = "eu.faircode.netguard"
|
||||
versionName = "2.327"
|
||||
versionName = "2.328"
|
||||
minSdkVersion 22
|
||||
targetSdkVersion 34
|
||||
versionCode = 2023120301
|
||||
versionCode = 2024022201
|
||||
archivesBaseName = "NetGuard-v$versionName"
|
||||
|
||||
externalNativeBuild {
|
||||
|
|
|
@ -104,6 +104,7 @@ import java.util.HashMap;
|
|||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
|
@ -1242,7 +1243,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
ConnectivityManager cm = (ConnectivityManager) getSystemService(CONNECTIVITY_SERVICE);
|
||||
Network active = (cm == null ? null : cm.getActiveNetwork());
|
||||
if (active != null) {
|
||||
Log.i(TAG, "Setting underlying network=" + cm.getNetworkInfo(active));
|
||||
Log.i(TAG, "Setting underlying network=" + active + " " + cm.getNetworkInfo(active));
|
||||
setUnderlyingNetworks(new Network[]{active});
|
||||
}
|
||||
}
|
||||
|
@ -3245,6 +3246,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
}
|
||||
|
||||
private class Builder extends VpnService.Builder {
|
||||
private Network activeNetwork;
|
||||
private NetworkInfo networkInfo;
|
||||
private int mtu;
|
||||
private List<String> listAddress = new ArrayList<>();
|
||||
|
@ -3256,6 +3258,7 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
private Builder() {
|
||||
super();
|
||||
ConnectivityManager cm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
activeNetwork = (Build.VERSION.SDK_INT < Build.VERSION_CODES.M ? null : cm.getActiveNetwork());
|
||||
networkInfo = cm.getActiveNetworkInfo();
|
||||
}
|
||||
|
||||
|
@ -3314,6 +3317,9 @@ public class ServiceSinkhole extends VpnService implements SharedPreferences.OnS
|
|||
if (other == null)
|
||||
return false;
|
||||
|
||||
if (!Objects.equals(this.activeNetwork, other.activeNetwork))
|
||||
return false;
|
||||
|
||||
if (this.networkInfo == null || other.networkInfo == null ||
|
||||
this.networkInfo.getType() != other.networkInfo.getType())
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue