From c5e4ffc2ecbd6781f7b0ca454391f02f99d0f77e Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Tue, 24 Jul 2012 21:31:20 +0200 Subject: Build openssl as shared library again, build for all Android ABIs --- src/de/blinkt/openvpn/LaunchVPN.java | 26 +++++++++++++++++++------- src/de/blinkt/openvpn/OpenVPNThread.java | 2 +- src/de/blinkt/openvpn/VpnProfile.java | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java index a3fb0829..04294c33 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 22a08763..4477fa5f 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 8d506f9b..91c4c494 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); -- cgit v1.2.3