summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/VpnProfile.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-07-30 20:43:49 +0200
committerArne Schwabe <arne@rfc2549.org>2012-07-30 20:43:49 +0200
commit704d06d967022737ddd3e6d6549c18402fe75b0f (patch)
treee5ad08d96eae745d631a7cd83f4b7ccecf8ea038 /src/de/blinkt/openvpn/VpnProfile.java
parentaa222a0434ad2c270e94fc2370e71e49d6b5331f (diff)
Use system proxy settings for openvpn
Diffstat (limited to 'src/de/blinkt/openvpn/VpnProfile.java')
-rw-r--r--src/de/blinkt/openvpn/VpnProfile.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java
index 4e381fcc..199f6b54 100644
--- a/src/de/blinkt/openvpn/VpnProfile.java
+++ b/src/de/blinkt/openvpn/VpnProfile.java
@@ -23,7 +23,9 @@ import org.spongycastle.util.io.pem.PemWriter;
import android.content.Context;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.content.pm.ApplicationInfo;
+import android.preference.PreferenceManager;
import android.security.KeyChain;
import android.security.KeyChainException;
@@ -144,9 +146,10 @@ public class VpnProfile implements Serializable{
}
- public String getConfigFile(File cacheDir)
+ public String getConfigFile(Context context)
{
+ File cacheDir= context.getCacheDir();
String cfg="";
// Enable managment interface
@@ -331,6 +334,14 @@ public class VpnProfile implements Serializable{
if(mUseFloat)
cfg+= "float\n";
+ SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
+ boolean usesystemproxy = prefs.getBoolean("usesystemproxy", true);
+ if(usesystemproxy) {
+ cfg+= "# Use system proxy setting\n";
+ cfg+= "management-query-proxy\n";
+ }
+
+
if(mUseCustomConfig) {
cfg += "# Custom configuration options\n";
cfg += "# You are on your on own here :)\n";
@@ -464,7 +475,7 @@ public class VpnProfile implements Serializable{
try {
FileWriter cfg = new FileWriter(context.getCacheDir().getAbsolutePath() + "/" + OVPNCONFIGFILE);
- cfg.write(getConfigFile(context.getCacheDir()));
+ cfg.write(getConfigFile(context));
cfg.flush();
cfg.close();
} catch (IOException e) {