diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-05-11 17:14:19 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-05-11 17:14:19 +0200 |
commit | 700d8a7b13287cb15f55fae8f5da5f99ca4bff1b (patch) | |
tree | 416c9e29be6f58ab921a76306a69a5be0f6cda48 | |
parent | 82940714ebe944e63ed70c745e1abe950673fe5b (diff) |
Add native dir approach from http://stackoverflow.com/questions/10517016/android-get-jni-library-dir/10536284
-rw-r--r-- | src/de/blinkt/openvpn/OpenVPNThread.java | 10 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/OpenVpnService.java | 3 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/VpnProfile.java | 4 | ||||
-rw-r--r-- | todo.txt | 12 |
4 files changed, 24 insertions, 5 deletions
diff --git a/src/de/blinkt/openvpn/OpenVPNThread.java b/src/de/blinkt/openvpn/OpenVPNThread.java index ce332677..4c00707b 100644 --- a/src/de/blinkt/openvpn/OpenVPNThread.java +++ b/src/de/blinkt/openvpn/OpenVPNThread.java @@ -13,11 +13,13 @@ public class OpenVPNThread implements Runnable { private OpenVpnService mService;
private String[] mArgv;
private Process mProcess;
+ private String mNativeDir;
- public OpenVPNThread(OpenVpnService service,String[] argv)
+ public OpenVPNThread(OpenVpnService service,String[] argv, String nativelibdir)
{
mService = service;
mArgv = argv;
+ mNativeDir = nativelibdir;
}
public void stopProcess() {
@@ -76,11 +78,15 @@ public class OpenVPNThread implements Runnable { String applibpath = argv[0].replace("/cache/minivpn", "/lib");
String lbpath = pb.environment().get("LD_LIBRARY_PATH");
- if(lbpath==null)
+ if(lbpath==null)
lbpath = applibpath;
else
lbpath = lbpath + ":" + applibpath;
+ if (!applibpath.equals(mNativeDir)) {
+ lbpath = lbpath + ":" + mNativeDir;
+ }
+
pb.environment().put("LD_LIBRARY_PATH", lbpath);
pb.redirectErrorStream(true);
try {
diff --git a/src/de/blinkt/openvpn/OpenVpnService.java b/src/de/blinkt/openvpn/OpenVpnService.java index ad20737b..fb60d84c 100644 --- a/src/de/blinkt/openvpn/OpenVpnService.java +++ b/src/de/blinkt/openvpn/OpenVpnService.java @@ -148,6 +148,7 @@ public class OpenVpnService extends VpnService implements Handler.Callback { // Extract information from the intent. String prefix = getPackageName(); String[] argv = intent.getStringArrayExtra(prefix + ".ARGV"); + String nativelibdir = intent.getStringExtra(prefix + ".nativelib"); String profileUUID = intent.getStringExtra(prefix + ".profileUUID"); mProfile = ProfileManager.get(profileUUID); @@ -191,7 +192,7 @@ public class OpenVpnService extends VpnService implements Handler.Callback { // Start a new session by creating a new thread. - OpenVPNThread serviceThread = new OpenVPNThread(this, argv); + OpenVPNThread serviceThread = new OpenVPNThread(this, argv,nativelibdir); mServiceThread = new Thread(serviceThread, "OpenVPNServiceThread"); mServiceThread.start(); diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index b3ce6a47..639619ff 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -19,6 +19,7 @@ import java.util.Vector; import android.content.Context; import android.content.Intent; +import android.content.pm.ApplicationInfo; import android.security.KeyChain; import android.security.KeyChainException; @@ -385,6 +386,9 @@ public class VpnProfile implements Serializable{ intent.putExtra(prefix + ".ARGV" , buildOpenvpnArgv(context.getCacheDir())); intent.putExtra(prefix + ".profileUUID", mUuid.toString()); + + ApplicationInfo info = context.getApplicationInfo(); + intent.putExtra(prefix +".nativelib",info.nativeLibraryDir); try { FileWriter cfg = new FileWriter(context.getCacheDir().getAbsolutePath() + "/" + OVPNCONFIGFILE); @@ -1,4 +1,9 @@ Ideas: + +- Implement tabbed filebrowser with + 1. tab file selection + 2. tab inline file for safer storage + - implement security notice fragment - explain plain text storage of all data except for android keystore - explain even more insecure of storage on sd card @@ -15,6 +20,10 @@ Ideas: - implement general settings dialog - encryption of profiles - Speed/Transfered in notification bar (byte counter of managment) + - Kick openvpn on network state change (Wifi <-> GPRS/EDGE/UMTS) + +- map SIGUSR1 to SIGINT + Missing configuration options: @@ -33,9 +42,8 @@ Tap support: - need to chose right mac of receiver Requested by users: -keepalive 10 120 +cipher auth mtu-link nobind - |