diff options
author | Arne Schwabe <arne@rfc2549.org> | 2012-07-24 21:31:20 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2012-07-24 21:31:20 +0200 |
commit | c5e4ffc2ecbd6781f7b0ca454391f02f99d0f77e (patch) | |
tree | 2b59983735efebb6c1c002c7646274630984c171 /src/de | |
parent | 83007ae1abc16de9489431cef599e9d60a518d6a (diff) |
Build openssl as shared library again, build for all Android ABIs
Diffstat (limited to 'src/de')
-rw-r--r-- | src/de/blinkt/openvpn/LaunchVPN.java | 26 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/OpenVPNThread.java | 2 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/VpnProfile.java | 2 |
3 files changed, 21 insertions, 9 deletions
diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java index a3fb082..04294c3 100644 --- a/src/de/blinkt/openvpn/LaunchVPN.java +++ b/src/de/blinkt/openvpn/LaunchVPN.java @@ -32,6 +32,7 @@ import android.content.DialogInterface.OnClickListener; import android.content.Intent; import android.content.SharedPreferences; import android.net.VpnService; +import android.os.Build; import android.os.Bundle; import android.os.Parcelable; import android.preference.PreferenceManager; @@ -82,7 +83,6 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { private boolean mCmfixed=false; - static boolean minivpnwritten=false; @Override public void onCreate(Bundle icicle) { @@ -224,14 +224,25 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { } private boolean writeMiniVPN() { - File mvpnout = new File(getCacheDir(),"minivpn"); + File mvpnout = new File(getCacheDir(),"miniovpn"); if (mvpnout.exists() && mvpnout.canExecute()) return true; - if(minivpnwritten) - return true; + IOException e2 = null; + try { - InputStream mvpn = getAssets().open("minivpn"); + + + InputStream mvpn; + + try { + mvpn = getAssets().open("minivpn." + Build.CPU_ABI); + } + catch (IOException errabi) { + e2=errabi; + mvpn = getAssets().open("minivpn." + Build.CPU_ABI2); + } + FileOutputStream fout = new FileOutputStream(mvpnout); @@ -246,10 +257,11 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { if(!mvpnout.setExecutable(true)) return false; - - minivpnwritten=true; + return true; } catch (IOException e) { + if(e2!=null) + OpenVPN.logMessage(0, "",e2.getLocalizedMessage()); OpenVPN.logMessage(0, "",e.getLocalizedMessage()); e.printStackTrace(); return false; diff --git a/src/de/blinkt/openvpn/OpenVPNThread.java b/src/de/blinkt/openvpn/OpenVPNThread.java index 22a0876..4477fa5 100644 --- a/src/de/blinkt/openvpn/OpenVPNThread.java +++ b/src/de/blinkt/openvpn/OpenVPNThread.java @@ -58,7 +58,7 @@ public class OpenVPNThread implements Runnable { // Hack O rama
// Hack until I find a good way to get the real library path
- String applibpath = argv[0].replace("/cache/minivpn", "/lib");
+ String applibpath = argv[0].replace("/cache/miniovpn", "/lib");
String lbpath = pb.environment().get("LD_LIBRARY_PATH");
if(lbpath==null)
diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index 8d506f9..91c4c49 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -428,7 +428,7 @@ public class VpnProfile implements Serializable{ // Add fixed paramenters //args.add("/data/data/de.blinkt.openvpn/lib/openvpn"); - args.add(cacheDir.getAbsolutePath() +"/" +"minivpn"); + args.add(cacheDir.getAbsolutePath() +"/" +"miniovpn"); args.add("--config"); args.add(cacheDir.getAbsolutePath() + "/" + OVPNCONFIGFILE); |