summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2017-10-09 00:42:01 +0200
committercyBerta <cyberta@riseup.net>2017-10-09 00:42:01 +0200
commitde722d9c14a0ce4353d677081b077efe15eb9525 (patch)
tree9bb16c69fd271868fdfeac70163d655886a33832 /app/src/main/java
parentadc6f7672c380d534fc963d868fe5aebcab54b4a (diff)
#8746 fixes client must honor the protocol default specified by the provider
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/eip/VpnConfigGenerator.java11
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;
}