summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/VpnProfile.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-05-10 00:13:08 +0200
committerArne Schwabe <arne@rfc2549.org>2012-05-10 00:13:08 +0200
commit2dcc54d15d5d864ba98f7d7d857cb74fa3cc5e60 (patch)
treed49d7731cceb994a3ea79a320e68a8a8c3b79aed /src/de/blinkt/openvpn/VpnProfile.java
parent9b87e180b4956b036917ab81e40d92804bacef8b (diff)
parente652cd62a450aa4bb284d717a1f0bd1b1d1b86a2 (diff)
Merge
Diffstat (limited to 'src/de/blinkt/openvpn/VpnProfile.java')
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index 26cf50bd..1b855f5d 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -90,10 +90,13 @@ public class VpnProfile implements Serializable{
public boolean mUseCustomConfig=false;
public String mCustomConfigOptions="";
public String mVerb="1";
+ public String mCipher="";
- public static String openVpnEscape(String unescape) {
- String escapedString = unescape.replace("\\", "\\\\");
+ public static String openVpnEscape(String unescaped) {
+ if(unescaped==null)
+ return null;
+ String escapedString = unescaped.replace("\\", "\\\\");
escapedString = escapedString.replace("\"","\\\"");
escapedString = escapedString.replace("\n","\\n");
return '"' + escapedString + '"';
@@ -269,6 +272,9 @@ public class VpnProfile implements Serializable{
cfg += "remote-cert-tls server\n";
+ if(nonNull(mCipher)){
+ cfg += "cipher " + mCipher + "\n";
+ }
// Obscure Settings dialog
@@ -291,6 +297,13 @@ public class VpnProfile implements Serializable{
return cfg;
}
+ private boolean nonNull(String val) {
+ if(val == null || val.equals(""))
+ return false;
+ else
+ return true;
+ }
+
private Collection<String> getCustomRoutes() {
Vector<String> cidrRoutes=new Vector<String>();
if(mCustomRoutes==null) {
@@ -343,8 +356,8 @@ public class VpnProfile implements Serializable{
Vector<String> args = new Vector<String>();
// Add fixed paramenters
- //args.add(cacheDir.getAbsolutePath() +"/" +"openvpn");
- args.add(cacheDir.getAbsolutePath() +"/" +"minivpn");
+ //args.add("/data/data/de.blinkt.openvpn/lib/openvpn");
+ args.add(cacheDir.getAbsolutePath() +"/" +"openvpn");
args.add("--config");
args.add(cacheDir.getAbsolutePath() + "/" + OVPNCONFIGFILE);