8000 Fix for devices unable to locate 'signal' at runtime · dw3/android-database-sqlcipher@172e1fc · GitHub
[go: up one dir, main page]

Skip to content

Commit 172e1fc

Browse files
Fix for devices unable to locate 'signal' at runtime
1 parent 330ae18 commit 172e1fc

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

Makefile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ build-java:
3838

3939
build-native:
4040
cd ${JNI_DIR} && \
41-
ndk-build V=1 --environment-overrides NDK_LIBS_OUT=$(JNI_DIR)/libs \
41+
ndk-build V=1 --environment-overrides NDK_LIBS_OUT=$(JNI_DIR)/libs32 \
42+
NDK_APPLICATION_MK=$(JNI_DIR)/Application32.mk \
43+
SQLCIPHER_CFLAGS="${SQLCIPHER_CFLAGS}" && \
44+
ndk-build V=1 --environment-overrides NDK_LIBS_OUT=$(JNI_DIR)/libs64 \
45+
NDK_APPLICATION_MK=$(JNI_DIR)/Application64.mk \
4246
SQLCIPHER_CFLAGS="${SQLCIPHER_CFLAGS}"
4347

4448
clean-java:
@@ -47,7 +51,11 @@ clean-java:
4751

4852
clean-ndk:
4953
-cd ${JNI_DIR} && \
50-
ndk-build clean
54+
ndk-build clean --environment-overrides NDK_LIBS_OUT=$(JNI_DIR)/libs32 \
55+
NDK_APPLICATION_MK=$(JNI_DIR)/Application32.mk && \
56+
ndk-build clean --environment-overrides NDK_LIBS_OUT=$(JNI_DIR)/libs64 \
57+
NDK_APPLICATION_MK=$(JNI_DIR)/Application64.mk
58+
-rm -rf ${JNI_DIR}/libs32 ${JNI_DIR}/libs64
5159

5260
clean: clean-ndk clean-java
5361
-cd ${SQLCIPHER_DIR} && \
@@ -58,7 +66,7 @@ distclean: clean
5866
rm -rf ${EXTERNAL_DIR}/android-libs
5967

6068
copy-libs:
61-
cp -R ${JNI_DIR}/libs/* ${LIBS_DIR}
69+
cp -R ${JNI_DIR}/libs32/* ${JNI_DIR}/libs64/* ${LIBS_DIR}
6270

6371
release-aar:
6472
-rm ${LIBS_DIR}/sqlcipher.jar

build-openssl-libraries.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
fi
88

99
ANDROID_LIB_ROOT=../android-libs
10-
ANDROID_PLATFORM_VERSION=android-23
1110
ANDROID_TOOLCHAIN_DIR=/tmp/sqlcipher-android-toolchain
1211
OPENSSL_CONFIGURE_OPTIONS="no-krb5 no-idea no-camellia \
1312
no-seed no-bf no-cast no-rc2 no-rc4 no-rc5 no-md2 \
@@ -49,30 +48,35 @@
4948
TOOLCHAIN_PREFIX=arm-linux-androideabi
5049
CONFIGURE_ARCH=android
5150
PLATFORM_OUTPUT_DIR=armeabi
51+
ANDROID_PLATFORM_VERSION=android-9
5252
;;
5353
armeabi-v7a)
5454
TOOLCHAIN_ARCH=arm
5555
TOOLCHAIN_PREFIX=arm-linux-androideabi
5656
CONFIGURE_ARCH=android -march=armv7-a
5757
PLATFORM_OUTPUT_DIR=armeabi-v7a
58+
ANDROID_PLATFORM_VERSION=android-9
5859
;;
5960
x86)
6061
TOOLCHAIN_ARCH=x86
6162
TOOLCHAIN_PREFIX=i686-linux-android
6263
CONFIGURE_ARCH=android-x86
6364
PLATFORM_OUTPUT_DIR=x86
65+
ANDROID_PLATFORM_VERSION=android-9
6466
;;
6567
x86_64)
6668
TOOLCHAIN_ARCH=x86_64
6769
TOOLCHAIN_PREFIX=x86_64-linux-android
6870
CONFIGURE_ARCH=android64
6971
PLATFORM_OUTPUT_DIR=x86_64
72+
ANDROID_PLATFORM_VERSION=android-21
7073
;;
7174
arm64-v8a)
7275
TOOLCHAIN_ARCH=arm64
7376
TOOLCHAIN_PREFIX=aarch64-linux-android
7477
CONFIGURE_ARCH=android64-aarch64
7578
PLATFORM_OUTPUT_DIR=arm64-v8a
79+
ANDROID_PLATFORM_VERSION=android-21
7680
;;
7781
*)
7882
echo "Unsupported build platform:${SQLCIPHER_TARGET_PLATFORM}"
@@ -84,7 +88,7 @@
8488
--platform=${ANDROID_PLATFORM_VERSION} \
8589
--install-dir=${ANDROID_TOOLCHAIN_DIR} \
8690
--arch=${TOOLCHAIN_ARCH}
87-
91+
8892
export PATH=${ANDROID_TOOLCHAIN_DIR}/bin:$PATH
8993
export CROSS_SYSROOT=${ANDROID_TOOLCHAIN_DIR}/sysroot
9094

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
APP_PROJECT_PATH := $(shell pwd)
2-
APP_ABI := armeabi armeabi-v7a x86 x86_64 arm64-v8a
3-
APP_PLATFORM := 21
2+
APP_ABI := armeabi armeabi-v7a x86
3+
APP_PLATFORM := android-9
44
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk
55
APP_STL := stlport_static

jni/Application64.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
APP_PROJECT_PATH := $(shell pwd)
2+
APP_ABI := x86_64 arm64-v8a
3+
APP_PLATFORM := android-21
4+
APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk
5+
APP_STL := stlport_static

jni/net_sqlcipher_CursorWindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ namespace sqlcipher {
283283
int64_t value;
284284
if (window->getLong(row, column, &value)) {
285285
char buf[32];
286-
snprintf(buf, sizeof(buf), "%"PRId64"", value);
286+
snprintf(buf, sizeof(buf), "%lld", value);
287287
return env->NewStringUTF((const char*)buf);
288288
}
289289
return NULL;
@@ -359,7 +359,7 @@ namespace sqlcipher {
359359
if (window->getLong(row, column, &value)) {
360360
int len;
361361
char buf[32];
362-
len = snprintf(buf, sizeof(buf), "%"PRId64"", value);
362+
len = snprintf(buf, sizeof(buf), "%lld", value);
363363
jint bufferLength = env->GetArrayLength(buffer);
364364
if(len > bufferLength || dst == NULL){
365365
jstring content = env->NewStringUTF(buf);

0 commit comments

Comments
 (0)
0