From 97c6ff95cd85588c87666769d723f1d2e02d8f78 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Thu, 18 Sep 2014 08:24:39 +0800 Subject: [PATCH] fix an issue in the build scripts --- build-ndk.sh | 22 ++++++++++++++++++---- jni/system.cpp | 10 +++++----- src/main/AndroidManifest.xml | 4 ++-- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/build-ndk.sh b/build-ndk.sh index 1031190d28..76dcf72e83 100755 --- a/build-ndk.sh +++ b/build-ndk.sh @@ -1,14 +1,28 @@ #!/bin/bash -ndk-build clean -ndk-build +function try () { + "$@" || exit -1 +} + +# Build +try ndk-build clean +try ndk-build + +# copy executables rm -rf src/main/assets/armeabi-v7a rm -rf src/main/assets/x86 mkdir -p src/main/assets/armeabi-v7a mkdir -p src/main/assets/x86 for app in pdnsd redsocks do - mv libs/armeabi-v7a/$app src/main/assets/armeabi-v7a/ - mv libs/x86/$app src/main/assets/x86/ + try mv libs/armeabi-v7a/$app src/main/assets/armeabi-v7a/ + try mv libs/x86/$app src/main/assets/x86/ done +# copy libraries +rm -rf src/main/jni/armeabi-v7a +rm -rf src/main/jni/x86 +mkdir -p src/main/jni/armeabi-v7a +mkdir -p src/main/jni/x86 +try mv libs/armeabi-v7a/*.so src/main/jni/armeabi-v7a/ +try mv libs/x86/*.so src/main/jni/x86/ diff --git a/jni/system.cpp b/jni/system.cpp index 4e491eb2e7..1132d79a7d 100644 --- a/jni/system.cpp +++ b/jni/system.cpp @@ -21,11 +21,11 @@ jstring Java_com_github_shadowsocks_system_getabi(JNIEnv *env, jobject thiz) { } else if (family == ANDROID_CPU_FAMILY_MIPS) { abi = "mips"; } else if (family == ANDROID_CPU_FAMILY_ARM) { - if (features & ANDROID_CPU_ARM_FEATURE_ARMv7) { - abi = "armeabi-v7a"; - } else { - abi = "armeabi"; - } + // if (features & ANDROID_CPU_ARM_FEATURE_ARMv7) { + abi = "armeabi-v7a"; + // } else { + // abi = "armeabi"; + // } } return env->NewStringUTF(abi); } diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index ad6fd36ffd..e66787d475 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,7 +1,7 @@ + android:versionCode="72" + android:versionName="2.2.4">