summaryrefslogtreecommitdiff
path: root/src/de/blinkt/openvpn/LaunchVPN.java
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2012-07-24 21:31:20 +0200
committerArne Schwabe <arne@rfc2549.org>2012-07-24 21:31:20 +0200
commitc5e4ffc2ecbd6781f7b0ca454391f02f99d0f77e (patch)
tree2b59983735efebb6c1c002c7646274630984c171 /src/de/blinkt/openvpn/LaunchVPN.java
parent83007ae1abc16de9489431cef599e9d60a518d6a (diff)
Build openssl as shared library again, build for all Android ABIs
Diffstat (limited to 'src/de/blinkt/openvpn/LaunchVPN.java')
-rw-r--r--src/de/blinkt/openvpn/LaunchVPN.java26
1 files changed, 19 insertions, 7 deletions
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;