summaryrefslogtreecommitdiff
path: root/src/se/leap/openvpn/VpnProfile.java
diff options
context:
space:
mode:
authorParménides GV <parmegv@sdf.org>2014-01-14 19:44:10 +0100
committerParménides GV <parmegv@sdf.org>2014-01-14 19:54:58 +0100
commit1fe78d00244f52f903435c970c0ebf0071a08f36 (patch)
tree5e4f600dba76a39ab5fa23e13f638e6ce58b29fa /src/se/leap/openvpn/VpnProfile.java
parentdbf1265f736c00aa31289e75818b1ec56311d31c (diff)
No sharedprefs methods in ConfigHelper.
This means we obtain the SharedPreferences object each time we want to use it. This yields to longer code lines while reading and writing to them.
Diffstat (limited to 'src/se/leap/openvpn/VpnProfile.java')
-rw-r--r--src/se/leap/openvpn/VpnProfile.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/se/leap/openvpn/VpnProfile.java b/src/se/leap/openvpn/VpnProfile.java
index 99e1c676..481819ad 100644
--- a/src/se/leap/openvpn/VpnProfile.java
+++ b/src/se/leap/openvpn/VpnProfile.java
@@ -22,6 +22,7 @@ import org.spongycastle.util.io.pem.PemObject;
import org.spongycastle.util.io.pem.PemWriter;
import se.leap.bitmaskclient.ConfigHelper;
+import se.leap.bitmaskclient.Dashboard;
import se.leap.bitmaskclient.EIP;
import se.leap.bitmaskclient.Provider;
import se.leap.bitmaskclient.R;
@@ -249,9 +250,10 @@ public class VpnProfile implements Serializable{
cfg+=insertFileData("cert",mClientCertFilename);
*/
// FIXME This is all we need...The whole switch statement can go...
- cfg+="<ca>\n"+ConfigHelper.getStringFromSharedPref(Provider.CA_CERT)+"\n</ca>\n";
- cfg+="<key>\n"+ConfigHelper.getStringFromSharedPref(EIP.PRIVATE_KEY)+"\n</key>\n";
- cfg+="<cert>\n"+ConfigHelper.getStringFromSharedPref(EIP.CERTIFICATE)+"\n</cert>\n";
+ SharedPreferences preferences = context.getSharedPreferences(Dashboard.SHARED_PREFERENCES, context.MODE_PRIVATE);
+ cfg+="<ca>\n"+preferences.getString(Provider.CA_CERT, "")+"\n</ca>\n";
+ cfg+="<key>\n"+preferences.getString(EIP.PRIVATE_KEY, "")+"\n</key>\n";
+ cfg+="<cert>\n"+preferences.getString(EIP.CERTIFICATE, "")+"\n</cert>\n";
break;
case VpnProfile.TYPE_USERPASS_PKCS12: