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 | 016c2b5baddc374bebb606d3bcbef559c1bc7588 (patch) | |
tree | 416c9e29be6f58ab921a76306a69a5be0f6cda48 /src/de/blinkt/openvpn/OpenVPNThread.java | |
parent | 0291c756696f9ef5a8e2a23ed3b4b1ff79e91e08 (diff) |
Add native dir approach from http://stackoverflow.com/questions/10517016/android-get-jni-library-dir/10536284
Diffstat (limited to 'src/de/blinkt/openvpn/OpenVPNThread.java')
-rw-r--r-- | src/de/blinkt/openvpn/OpenVPNThread.java | 10 |
1 files changed, 8 insertions, 2 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 {
|