From 2d1ba27de2ed0b477f88ed8cc64fcccd709d8221 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 25 Jul 2012 15:05:12 +0200 Subject: restore compatibility with Android 4.0 --- build-native.sh | 1 + jni/Android.mk | 4 +--- jni/Application.mk | 1 + src/de/blinkt/openvpn/LaunchVPN.java | 4 ++-- src/de/blinkt/openvpn/OpenVPNThread.java | 2 +- src/de/blinkt/openvpn/VpnProfile.java | 3 ++- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/build-native.sh b/build-native.sh index af9fcf57..2848fdd2 100755 --- a/build-native.sh +++ b/build-native.sh @@ -1,6 +1,7 @@ ndk-build APP_API=all -j 8 if [ $? = 0 ]; then cd libs + mkdir -p ../assets for i in * do cp -v $i/minivpn ../assets/minivpn.$i diff --git a/jni/Android.mk b/jni/Android.mk index cdfbed8d..3514b920 100644 --- a/jni/Android.mk +++ b/jni/Android.mk @@ -1,6 +1,4 @@ # Path of the sources - - JNI_DIR := $(call my-dir) include lzo/Android.mk @@ -23,7 +21,7 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) -LOCAL_LDLIBS := -lz -lc +LOCAL_LDLIBS := -lz -lc LOCAL_SHARED_LIBRARIES := libssl libcrypto openvpn LOCAL_SRC_FILES:= minivpn.c LOCAL_MODULE = minivpn diff --git a/jni/Application.mk b/jni/Application.mk index e33410ed..38ce95f3 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -1,4 +1,5 @@ APP_ABI := all +NDK_TOOLCHAIN_VERSION=4.4.3 #APP_PLATFORM := android-14 #APP_OPTIM := release diff --git a/src/de/blinkt/openvpn/LaunchVPN.java b/src/de/blinkt/openvpn/LaunchVPN.java index 04294c33..bfc6256e 100644 --- a/src/de/blinkt/openvpn/LaunchVPN.java +++ b/src/de/blinkt/openvpn/LaunchVPN.java @@ -90,7 +90,7 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { mPM =ProfileManager.getInstance(this); - } + } @Override protected void onStart() { @@ -224,7 +224,7 @@ public class LaunchVPN extends ListActivity implements OnItemClickListener { } private boolean writeMiniVPN() { - File mvpnout = new File(getCacheDir(),"miniovpn"); + File mvpnout = new File(getCacheDir(),VpnProfile.MINIVPN); if (mvpnout.exists() && mvpnout.canExecute()) return true; diff --git a/src/de/blinkt/openvpn/OpenVPNThread.java b/src/de/blinkt/openvpn/OpenVPNThread.java index 4477fa5f..97e07c9d 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/miniovpn", "/lib"); + String applibpath = argv[0].replace("/cache/" + VpnProfile.MINIVPN , "/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 91c4c494..f6c3261a 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -97,6 +97,7 @@ public class VpnProfile implements Serializable{ public boolean mUseDefaultRoutev6=true; public String mCustomRoutesv6=""; public String mKeyPassword=""; + static final String MINIVPN = "miniopenvpn"; @@ -428,7 +429,7 @@ public class VpnProfile implements Serializable{ // Add fixed paramenters //args.add("/data/data/de.blinkt.openvpn/lib/openvpn"); - args.add(cacheDir.getAbsolutePath() +"/" +"miniovpn"); + args.add(cacheDir.getAbsolutePath() +"/" + VpnProfile.MINIVPN); args.add("--config"); args.add(cacheDir.getAbsolutePath() + "/" + OVPNCONFIGFILE); -- cgit v1.2.3 From c3287935914ef81941bc65a6ff9956a074fbc32a Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 25 Jul 2012 15:22:47 +0200 Subject: Fix importing custom options with spaces --- AndroidManifest.xml | 4 ++-- src/de/blinkt/openvpn/ConfigParser.java | 2 +- src/de/blinkt/openvpn/VpnProfile.java | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 4a694c0b..0818447f 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -17,8 +17,8 @@ + android:versionCode="43" + android:versionName="0.5.16" > diff --git a/src/de/blinkt/openvpn/ConfigParser.java b/src/de/blinkt/openvpn/ConfigParser.java index f9eac745..c8fb3870 100644 --- a/src/de/blinkt/openvpn/ConfigParser.java +++ b/src/de/blinkt/openvpn/ConfigParser.java @@ -472,7 +472,7 @@ public class ConfigParser { for(Vector> option:options.values()) { for(Vector optionsline: option) { for (String arg : optionsline) - custom+= arg + " "; + custom+= VpnProfile.openVpnEscape(arg) + " "; } custom+="\n"; diff --git a/src/de/blinkt/openvpn/VpnProfile.java b/src/de/blinkt/openvpn/VpnProfile.java index f6c3261a..4e381fcc 100644 --- a/src/de/blinkt/openvpn/VpnProfile.java +++ b/src/de/blinkt/openvpn/VpnProfile.java @@ -117,7 +117,11 @@ public class VpnProfile implements Serializable{ String escapedString = unescaped.replace("\\", "\\\\"); escapedString = escapedString.replace("\"","\\\""); escapedString = escapedString.replace("\n","\\n"); - return '"' + escapedString + '"'; + + if (escapedString.equals(unescaped) && !escapedString.contains(" ")) + return unescaped; + else + return '"' + escapedString + '"'; } -- cgit v1.2.3 From 313c779e2debefb660e59043bc2ee6e654e5bc2b Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 25 Jul 2012 15:23:36 +0200 Subject: right version number --- AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 0818447f..e86761c3 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -18,7 +18,7 @@ + android:versionName="0.5.17" > -- cgit v1.2.3 From 2b811c50e5b5202eedab9d0a9768ec5e0d7168a3 Mon Sep 17 00:00:00 2001 From: Arne Schwabe Date: Wed, 25 Jul 2012 15:23:52 +0200 Subject: Added tag v0.5.17 for changeset 8dabc8451ef0 --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index a4fc7097..f34e87d7 100644 --- a/.hgtags +++ b/.hgtags @@ -11,3 +11,4 @@ f9326cc1b082b81c9bbddbced8c837924510a261 v0.5.9b 15393c522dbed84342cbe7d737f7e38c633952c5 v0.5.12a 21fd68421904c63d315f2e96c68751588ab5d125 v0.5.14 2c7e441dd0f20b2d0c702e828784e212a1e34913 v5.15 +8dabc8451ef028f16b2e8c2334d08819f2c1539d v0.5.17 -- cgit v1.2.3