summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2015-07-10 21:41:58 +0200
committerArne Schwabe <arne@rfc2549.org>2015-07-10 21:42:12 +0200
commit94c16c43f6c039819dcf45ce473d5ff452c0f347 (patch)
treeaf18bb982c9d467c74280b1d9187552c155ab909 /main
parent649e1ac59bd174d65e5a4fb442e39e2a5968226c (diff)
Separate code that depends on the system OpenSSL library into a separate library that is only used on Android 4.1 (fixes #343)
Diffstat (limited to 'main')
-rw-r--r--main/jni/Android.mk15
-rw-r--r--main/src/main/java/de/blinkt/openvpn/core/NativeUtils.java4
2 files changed, 16 insertions, 3 deletions
diff --git a/main/jni/Android.mk b/main/jni/Android.mk
index df8cbb34..342c66dc 100644
--- a/main/jni/Android.mk
+++ b/main/jni/Android.mk
@@ -46,13 +46,22 @@ endif
LOCAL_PATH := $(JNI_DIR)
-# The only real JNI library
+# The only real JNI libraries
include $(CLEAR_VARS)
LOCAL_LDLIBS := -llog -lz
LOCAL_CFLAGS = --std=c99
-LOCAL_C_INCLUDES := openssl/include openssl/crypto openssl
-LOCAL_SRC_FILES:= jniglue.c jbcrypto.cpp scan_ifs.c
+LOCAL_SRC_FILES:= jniglue.c scan_ifs.c
LOCAL_MODULE = opvpnutil
+include $(BUILD_SHARED_LIBRARY)
+
+
+# The only real JNI libraries
+include $(CLEAR_VARS)
+LOCAL_LDLIBS := -llog -lz
+LOCAL_CFLAGS = --std=c99
+LOCAL_C_INCLUDES := openssl/include openssl/crypto openssl
+LOCAL_SRC_FILES:= jbcrypto.cpp
+LOCAL_MODULE = jbcrypto
LOCAL_SHARED_LIBRARIES := libcrypto
include $(BUILD_SHARED_LIBRARY)
diff --git a/main/src/main/java/de/blinkt/openvpn/core/NativeUtils.java b/main/src/main/java/de/blinkt/openvpn/core/NativeUtils.java
index f67b7730..27c9120a 100644
--- a/main/src/main/java/de/blinkt/openvpn/core/NativeUtils.java
+++ b/main/src/main/java/de/blinkt/openvpn/core/NativeUtils.java
@@ -5,6 +5,8 @@
package de.blinkt.openvpn.core;
+import android.os.Build;
+
import java.security.InvalidKeyException;
public class NativeUtils {
@@ -15,5 +17,7 @@ public class NativeUtils {
static {
System.loadLibrary("stlport_shared");
System.loadLibrary("opvpnutil");
+ if (Build.VERSION.SDK_INT== Build.VERSION_CODES.JELLY_BEAN)
+ System.loadLibrary("jbcrypto");
}
}