diff options
author | cyberta <cyberta@riseup.net> | 2017-10-13 11:08:54 +0000 |
---|---|---|
committer | cyberta <cyberta@riseup.net> | 2017-10-13 11:08:54 +0000 |
commit | ef98b18734c25da77abe4f0067635cf795218c65 (patch) | |
tree | c0d4e87751f8720f27c2c1f0b5c5b97bd959c163 /app/src/main | |
parent | ee442a9ee54face7a8f71fc0428ff6d1184e382f (diff) | |
parent | de722d9c14a0ce4353d677081b077efe15eb9525 (diff) |
Merge branch '8746_client_must_honor_specified_protocol' into 'master'
#8746 fixes client must honor the protocol default specified by the provider
See merge request leap/bitmask_android!10
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java index 0b9c5832..53d81ed3 100644 --- a/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java +++ b/app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java @@ -56,7 +56,7 @@ public class VpnConfigGenerator { String key = keys.next().toString(); common_options += key + " "; - for (String word : general_configuration.getString(key).split(" ")) + for (String word : String.valueOf(general_configuration.get(key)).split(" ")) common_options += word + " "; common_options += new_line; @@ -79,7 +79,6 @@ public class VpnConfigGenerator { String ports_keyword = "ports"; String protocol_keyword = "protocols"; String capabilities_keyword = "capabilities"; - String udp = "udp"; try { String ip_address = gateway.getString(ip_address_keyword); @@ -93,9 +92,7 @@ public class VpnConfigGenerator { String protocol = protocols.optString(j); String new_remote = remote_keyword + " " + ip_address + " " + port + " " + protocol + new_line; - port_specific_remotes = protocol.equalsIgnoreCase(udp) ? - port_specific_remotes.replaceFirst(remote_keyword, new_remote + new_line + remote_keyword) : - new_remote; + port_specific_remotes += new_remote; } remotes += port_specific_remotes; } @@ -103,7 +100,9 @@ public class VpnConfigGenerator { // TODO Auto-generated catch block e.printStackTrace(); } - + if (remotes.endsWith(new_line)) { + remotes = remotes.substring(0, remotes.lastIndexOf(new_line)); + } return remotes; } |