diff options
author | akuma <akuma> | 2019-09-08 20:40:29 +0200 |
---|---|---|
committer | akuma <akuma> | 2019-09-08 20:40:29 +0200 |
commit | 2e1c94d3f51dc6d667435b2a2bbd81a036d57bae (patch) | |
tree | 43590440908ce85ef286487bb5c44155b3de1f8e /app/src/main/java/se/leap/bitmaskclient/eip | |
parent | f510feb3130f7f28a5b9116c903a33e92d37ba5c (diff) |
New icon and text for Excluded Apps. Using PreferenceHelper. Test done.
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/eip')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java | 11 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java index 77666378..09b33845 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/Gateway.java @@ -32,6 +32,7 @@ import java.util.Set; import de.blinkt.openvpn.VpnProfile; import de.blinkt.openvpn.core.ConfigParser; import se.leap.bitmaskclient.BitmaskApp; +import se.leap.bitmaskclient.utils.PreferenceHelper; /** * Gateway provides objects defining gateways and their metadata. @@ -71,8 +72,14 @@ public class Gateway { System.out.println("###########" + mName + "###########"); mVpnProfile.mName = mName; - SharedPreferences allow_apps = context.getSharedPreferences("BITMASK", Context.MODE_MULTI_PROCESS); - mVpnProfile.mAllowedAppsVpn = new HashSet<String>(allow_apps.getStringSet("ALLOW_APPS", new HashSet<String>())); + Set<String> excludedAppsVpn = PreferenceHelper.getExcludedApps(context); + if (excludedAppsVpn != null) { + mVpnProfile.mAllowedAppsVpn = new HashSet<>(excludedAppsVpn); + } + else { + mVpnProfile.mAllowedAppsVpn = null; + } + } private JSONObject getGeneralConfiguration(JSONObject eip_definition) { diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java index 8edf81ef..6bd7b4a3 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/GatewaysManager.java @@ -93,7 +93,7 @@ public class GatewaysManager { JSONObject gw = gatewaysDefined.getJSONObject(i); if (isOpenVpnGateway(gw)) { JSONObject secrets = secretsConfiguration(); - Gateway aux = new Gateway(eipDefinition, secrets, gw, context); + Gateway aux = new Gateway(eipDefinition, secrets, gw, this.context); if (!gateways.contains(aux)) { addGateway(aux); } |