From f1c2c13193acab258292cd4a333d1b4eab58a026 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 14 Feb 2016 15:06:45 +0100 Subject: [PATCH] Revert "Do not route system traffic into the VPN when not managing system apps" This reverts commit 41f9ec66445b47d0a82f2afb6e2daee5a78610ba. Refs #321 --- .../eu/faircode/netguard/SinkholeService.java | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/faircode/netguard/SinkholeService.java b/app/src/main/java/eu/faircode/netguard/SinkholeService.java index 26cf3be2..5e2f04cb 100644 --- a/app/src/main/java/eu/faircode/netguard/SinkholeService.java +++ b/app/src/main/java/eu/faircode/netguard/SinkholeService.java @@ -94,9 +94,8 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS private boolean last_connected = false; private boolean last_metered = true; private boolean last_interactive = false; - private boolean last_manage_system = false; - private boolean last_filter = false; private boolean last_tethering = false; + private boolean last_filter = false; private String last_vpn4 = null; private String last_vpn6 = null; private InetAddress last_dns = null; @@ -358,7 +357,6 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(SinkholeService.this); boolean tethering = prefs.getBoolean("tethering", false); boolean filter = prefs.getBoolean("filter", false); - boolean manage_system = prefs.getBoolean("manage_system", false); String vpn4 = prefs.getString("vpn4", "10.1.10.1"); String vpn6 = prefs.getString("vpn6", "fd00:1:fd00:1:fd00:1:fd00:1"); InetAddress dns = getDns(SinkholeService.this); @@ -377,7 +375,6 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS List listAllowed = getAllowedRules(listRule); if (filter && - manage_system == last_manage_system && filter == last_filter && tethering == last_tethering && vpn4.equals(last_vpn4) && @@ -834,11 +831,9 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS @TargetApi(Build.VERSION_CODES.LOLLIPOP) private ParcelFileDescriptor startVPN(List listAllowed) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this); - boolean manage_system = prefs.getBoolean("manage_system", false); - boolean filter = prefs.getBoolean("filter", false); boolean tethering = prefs.getBoolean("tethering", false); + boolean filter = prefs.getBoolean("filter", false); - last_manage_system = manage_system; last_filter = filter; last_tethering = tethering; last_vpn4 = prefs.getString("vpn4", "10.1.10.1"); @@ -889,14 +884,6 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS } catch (PackageManager.NameNotFoundException ex) { Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex)); } - else if (filter && !manage_system && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) - for (Rule rule : listAllowed) - if (rule.system) - try { - builder.addDisallowedApplication(rule.info.packageName); - } catch (PackageManager.NameNotFoundException ex) { - Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex)); - } // Build configure intent Intent configure = new Intent(this, ActivityMain.class);