Compare commits

...

9 Commits

Author SHA1 Message Date
Marcel Bokhorst feef4c7b3b
Updated FAQ 2024-05-04 08:47:40 +02:00
M66B f050f90e2c RLAH: not La Réunion
https://en.wikipedia.org/wiki/European_Union_roaming_regulations#Areas_not_covered
2024-04-24 08:17:36 +02:00
M66B 1f56b996f5 Improved logging 2024-02-22 18:34:39 +01:00
M66B 69e2a37200 2.328 release 2024-02-22 17:25:26 +01:00
M66B c5e9414bb4 Rebuild VPN on active network change 2024-02-22 17:24:44 +01:00
M66B 589b4828b1 Allow Samsung find my phone by default 2024-02-18 23:21:52 +01:00
M66B 37ff174b1f COpy search domain from active network 2024-02-17 16:03:37 +01:00
M66B a3375e11c8 2.327 release 2023-12-03 17:54:36 +01:00
M66B d786249594 Revert "Simplification"
This reverts commit 2861b11661.
2023-12-03 17:53:59 +01:00
5 changed files with 42 additions and 5 deletions

2
FAQ.md
View File

@ -37,6 +37,8 @@ However, this does not work properly on all Android versions/variants causing Ne
On Android N and later NetGuard can be configured as [Always-On VPN](https://developer.android.com/guide/topics/connectivity/vpn#always-on).
On Android O **do not** enable the sub option '*Block connections without VPN*', see [question 51](#user-content-faq51)) for more information on this.
The app obviously can't protect you from bugs in Android, such a documented [here](https://mullvad.net/en/blog/dns-traffic-can-leak-outside-the-vpn-tunnel-on-android).
To protect yourself more, remember to disable Wi-Fi and mobile data before rebooting,
and only enable them on reboot, after the firewall service has started (and the key icon is visible in the status bar).

View File

@ -9,10 +9,10 @@ android {
defaultConfig {
applicationId = "eu.faircode.netguard"
versionName = "2.326"
versionName = "2.328"
minSdkVersion 22
targetSdkVersion 34
versionCode = 2023120101
versionCode = 2024022201
archivesBaseName = "NetGuard-v$versionName"
externalNativeBuild {

View File

@ -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});
}
}
@ -1291,6 +1292,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
if (subnet) {
// Exclude IP ranges
@ -3231,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<>();
@ -3242,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();
}
@ -3300,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;

View File

@ -38,7 +38,6 @@ import android.graphics.BitmapFactory;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
import android.net.Network;
import android.net.NetworkCapabilities;
import android.net.NetworkInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
@ -112,7 +111,6 @@ public class Util {
"NO", // Norway
"PL", // Poland
"PT", // Portugal
"RE", // La Réunion
"RO", // Romania
"SK", // Slovakia
"SI", // Slovenia
@ -166,6 +164,16 @@ public class Util {
if (ni != null && ni.isConnected())
return true;
Network[] networks = cm.getAllNetworks();
if (networks == null)
return false;
for (Network network : networks) {
ni = cm.getNetworkInfo(network);
if (ni != null && ni.getType() != ConnectivityManager.TYPE_VPN && ni.isConnected())
return true;
}
return false;
}

View File

@ -46,6 +46,13 @@
package="com.google.android.apps.gcs"
roaming="false" />
<wifi
blocked="false"
package="com.samsung.android.fmm" />
<other
blocked="false"
package="com.samsung.android.fmm" />
<relation
package="com.android.vending"
related="com.google.android.gms,com.android.providers.downloads" />