diff --git a/PLAY-ro.md b/PLAY-ro.md index 0f3c2ac4..72cb6e67 100644 --- a/PLAY-ro.md +++ b/PLAY-ro.md @@ -3,7 +3,7 @@ Play store Title ----- -NetGuard +NetGuard - firewall fara root Short description @@ -44,6 +44,10 @@ Caracteristici: Majoritatea functiilor sunt rezultatul trimiterii traficului selectat intr-o "gaura neagra", in loc sa fie filtrat tot traficul de internet. Acest lucru presupune ca functii avansate, cum ar fi filtrarea adreselor (necesara pentru blocarea unor gazde), urmarirea traficului si detectarea aplicatiilor la acces, nu sunt posibile. +Cum NetGuard efectiv nu are permisiunea de a accesa internetul, esti sigur ca traficul tau de internet nu este redirectionat nicaieri. + Pentru informatii la zi despre compatibilitatea dispozitivelor, intrebari si raspunsuri va rugam sa cititi mai multe aici: http://forum.xda-developers.com/showthread.php?t=3233012 Daca doriti sa testati caracteristile in dezvoltare ale aplicatiei, va puteti alatura programului de testare: https://play.google.com/apps/testing/eu.faircode.netguard + +Codul sursa este disponibil aici: https://github.com/M66B/NetGuard diff --git a/PLAY-zh-rCN.md b/PLAY-zh-rCN.md index b6a26f6d..30343f91 100644 --- a/PLAY-zh-rCN.md +++ b/PLAY-zh-rCN.md @@ -3,7 +3,7 @@ Play store Title ----- -NetGuard +NetGuard - no-root firewall Short description diff --git a/PLAY.md b/PLAY.md index 972f1905..ba6c4f1d 100644 --- a/PLAY.md +++ b/PLAY.md @@ -3,7 +3,7 @@ Play store Title ----- -NetGuard +NetGuard - no-root firewall Short description @@ -44,6 +44,10 @@ Features: Most of these features are the result of sending selected traffic to a VPN sinkhole, instead of filtering all internet traffic. This means that advanced features, like address-based filtering (needed for hosts blocking), traffic logging, and on-demand configuration, are not possible. +Since NetGuard has no internet permission, you know your internet traffic is not being sent anywhere. + For up to date info on device compatibility, questions and answers please read more here: http://forum.xda-developers.com/showthread.php?t=3233012 If you like to test new features, you can participate in the test program: https://play.google.com/apps/testing/eu.faircode.netguard + +The source code is available here: https://github.com/M66B/NetGuard diff --git a/README.md b/README.md index 1802e32f..4a6db6c2 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,9 @@ Compatibility Devices / ROMs with a broken VPN implementation: -* [Samsung Galaxy A5 / Android 5.02](https://github.com/M66B/NetGuard/issues/20) (all traffic blocked) -* Asus ZenFone 2 / Android 5.0.2/5.1.1, reported on XDA (all traffic blocked) +* Samsung Galaxy A5 / Android 5.0.2, [reported on Github](https://github.com/M66B/NetGuard/issues/20) (all traffic blocked) +* Asus ZenFone 2 / Android 5.0.2/5.1.1, [reported on XDA](http://forum.xda-developers.com/showpost.php?p=63619542&postcount=121) (all traffic blocked) +* Lenovo YOGA Tablet Pro-1380L/Yoga Tablet 2 Pro 5.0.1, [reported on XDA](http://forum.xda-developers.com/showpost.php?p=63784102&postcount=278) (all traffic blocked) NetGuard will crash when the package *com.android.vpndialogs* has been removed or otherwise is unavailable. @@ -185,6 +186,12 @@ Note that, whether or not you get a dialog warning to agree upon, this operation Please read [here](https://community.f-secure.com/t5/F-Secure/Android-Lollipop-Cannot-select/td-p/64502). + +**(15) Why don't you support F-Droid?** + +Because F-Droid doesn't support reproducible builds. +Read [here](https://blog.torproject.org/blog/deterministic-builds-part-one-cyberwar-and-global-compromise) why this is important. + Support ------- @@ -203,6 +210,7 @@ Translations: * Copy [this file](https://github.com/M66B/NetGuard/blob/master/app/src/main/res/values/strings.xml) to the [correct locale folder](https://github.com/M66B/NetGuard/blob/master/app/src/main/res/) * Translate the strings in the copied file and omit all lines with **translatable="false"** * Create a [pull request on GitHub](https://help.github.com/articles/using-pull-requests) for the new/updated translation +* If you don't feel comfortable using GitHub, you can sent the translation to *marcel(plus)netguard(at)faircode.eu* Current translations: diff --git a/app/build.gradle b/app/build.gradle index a985e6cb..35f9f861 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "eu.faircode.netguard" minSdkVersion 21 targetSdkVersion 23 - versionCode 28 - versionName "0.28" + versionCode 29 + versionName "0.29" } buildTypes { release { @@ -34,8 +34,7 @@ def setOutputFile(variant, defaultConfig) { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:23.1.0' - compile 'com.android.support:recyclerview-v7:23.1.0' - compile 'com.squareup.picasso:picasso:2.5.2' + compile 'com.android.support:appcompat-v7:23.1.+' + compile 'com.android.support:recyclerview-v7:23.1.+' + compile 'com.squareup.picasso:picasso:2.5.+' } diff --git a/app/src/main/java/eu/faircode/netguard/ActivityMain.java b/app/src/main/java/eu/faircode/netguard/ActivityMain.java index 55bfd029..ec0fbd2d 100644 --- a/app/src/main/java/eu/faircode/netguard/ActivityMain.java +++ b/app/src/main/java/eu/faircode/netguard/ActivityMain.java @@ -128,6 +128,8 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences swEnabled.setChecked(enabled); swEnabled.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + prefs.edit().putBoolean("enabled", isChecked).apply(); + if (isChecked) { Log.i(TAG, "Switch on"); final Intent prepare = VpnService.prepare(ActivityMain.this); @@ -388,7 +390,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences ivNetwork.setVisibility(View.VISIBLE); ivMetered.setVisibility(View.VISIBLE); - if (Util.isWifiActive(context)) + if (Util.isLocalNetwork(context)) ivNetwork.setImageLevel(1); else { if (Util.isRoaming(context)) @@ -396,7 +398,7 @@ public class ActivityMain extends AppCompatActivity implements SharedPreferences else ivNetwork.setImageLevel(2); } - ivMetered.setImageLevel(Util.isMetered(context) ? 1 : 0); + ivMetered.setImageLevel(Util.isMeteredNetwork(context) ? 1 : 0); actionView.postInvalidate(); } diff --git a/app/src/main/java/eu/faircode/netguard/SinkholeService.java b/app/src/main/java/eu/faircode/netguard/SinkholeService.java index f34a671e..a315f31f 100644 --- a/app/src/main/java/eu/faircode/netguard/SinkholeService.java +++ b/app/src/main/java/eu/faircode/netguard/SinkholeService.java @@ -141,10 +141,10 @@ public class SinkholeService extends VpnService { Log.i(TAG, "Starting"); // Check state - boolean wifi = Util.isWifiActive(this); - boolean metered = Util.isMetered(this); + boolean local = Util.isLocalNetwork(this); + boolean metered = Util.isMeteredNetwork(this); boolean interactive = Util.isInteractive(this); - Log.i(TAG, "wifi=" + wifi + + Log.i(TAG, "local=" + local + " metered=" + metered + " roaming=" + last_roaming + " interactive=" + interactive); @@ -304,8 +304,9 @@ public class SinkholeService extends VpnService { Log.i(TAG, "New state roaming=" + last_roaming); reload(null, SinkholeService.this); - } else if (networkType == ConnectivityManager.TYPE_WIFI) { - // Wifi connected/disconnected + } else if (networkType == ConnectivityManager.TYPE_WIFI || + networkType == ConnectivityManager.TYPE_ETHERNET) { + // Local network connected/disconnected reload(null, SinkholeService.this); } } @@ -454,7 +455,7 @@ public class SinkholeService extends VpnService { public static void reload(String network, Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); if (prefs.getBoolean("enabled", false)) - if (network == null || ("wifi".equals(network) ? !Util.isMetered(context) : Util.isMetered(context))) { + if (network == null || ("wifi".equals(network) ? !Util.isMeteredNetwork(context) : Util.isMeteredNetwork(context))) { getLock(context).acquire(); Intent intent = new Intent(context, SinkholeService.class); intent.putExtra(EXTRA_COMMAND, Command.reload); diff --git a/app/src/main/java/eu/faircode/netguard/Util.java b/app/src/main/java/eu/faircode/netguard/Util.java index 6d0a478f..b9299628 100644 --- a/app/src/main/java/eu/faircode/netguard/Util.java +++ b/app/src/main/java/eu/faircode/netguard/Util.java @@ -60,14 +60,14 @@ public class Util { return tm.isNetworkRoaming(); } - public static boolean isWifiActive(Context context) { + public static boolean isLocalNetwork(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo ni = cm.getActiveNetworkInfo(); - return (ni != null && ni.getType() == ConnectivityManager.TYPE_WIFI); + return (ni != null && (ni.getType() == ConnectivityManager.TYPE_WIFI || ni.getType() == ConnectivityManager.TYPE_ETHERNET)); } - public static boolean isMetered(Context context) { + public static boolean isMeteredNetwork(Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); return cm.isActiveNetworkMetered(); } diff --git a/app/src/main/res/layout/about.xml b/app/src/main/res/layout/about.xml index c0f12a11..c6cd47e0 100644 --- a/app/src/main/res/layout/about.xml +++ b/app/src/main/res/layout/about.xml @@ -45,46 +45,66 @@ android:text="@string/app_copyright" android:textAppearance="@android:style/TextAppearance.Material.Small" /> - + android:orientation="vertical"> -