diff --git a/Makefile b/Makefile index 28832386..0c1be187 100644 --- a/Makefile +++ b/Makefile @@ -33,11 +33,11 @@ clean: cd ${JNI_DIR} && ndk-build clean -rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so -rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so - -rm ${LIBRARY_ROOT}/armeabi/libstlport_shared.so + -rm ${LIBRARY_ROOT}/armeabi/libgabi++_shared.so -rm ${LIBRARY_ROOT}/sqlcipher.jar -rm ${LIBRARY_ROOT}/x86/libsqlcipher_android.so -rm ${LIBRARY_ROOT}/x86/libdatabase_sqlcipher.so - -rm ${LIBRARY_ROOT}/x86/libstlport_shared.so + -rm ${LIBRARY_ROOT}/x86/libgabi++_shared.so copy-libs: mkdir -p ${LIBRARY_ROOT}/armeabi @@ -46,15 +46,13 @@ copy-libs: cp ${JNI_DIR}/libs/armeabi/libdatabase_sqlcipher.so \ ${LIBRARY_ROOT}/armeabi && \ cp ${CURDIR}/bin/classes/sqlcipher.jar ${LIBRARY_ROOT} && \ - cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so \ - ${LIBRARY_ROOT}/armeabi + cp $(JNI_DIR)/libs/armeabi/libgabi++_shared.so ${LIBRARY_ROOT}/armeabi && \ mkdir -p ${LIBRARY_ROOT}/x86 cp ${EXTERNAL_DIR}/libs/x86/libsqlcipher_android.so \ ${LIBRARY_ROOT}/x86 && \ cp ${JNI_DIR}/libs/x86/libdatabase_sqlcipher.so \ ${LIBRARY_ROOT}/x86 && \ - cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/x86/libstlport_shared.so \ - ${LIBRARY_ROOT}/x86 + cp $(JNI_DIR)/libs/x86/libgabi++_shared.so ${LIBRARY_ROOT}/x86 copy-libs-dist: cp ${LIBRARY_ROOT}/*.jar dist/SQLCipherForAndroid-SDK/libs/ && \ diff --git a/external/Android.mk b/external/Android.mk index 36442ca8..6e6500bd 100644 --- a/external/Android.mk +++ b/external/Android.mk @@ -20,6 +20,7 @@ copy-libs-hack: build-local-hack install -p -m644 libs/armeabi/*.so ../obj/local/armeabi/ project_ldflags:= -Llibs/$(TARGET_ARCH_ABI)/ -Landroid-libs/$(TARGET_ARCH_ABI)/ +icu_project_cflags := -DHAVE_ANDROID_OS=1 #------------------------------------------------------------------------------# # libsqlite3 @@ -76,6 +77,7 @@ LOCAL_ALLOW_UNDEFINED_SYMBOLS := false LOCAL_STATIC_LIBRARIES := libsqlcipher libicui18n libicuuc LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlite_cflags) \ + $(icu_project_cflags) \ -DOS_PATH_SEPARATOR="'/'" -DHAVE_SYS_UIO_H LOCAL_C_INCLUDES := \ @@ -206,7 +208,8 @@ icu_c_includes := \ # device and sim builds can use the same codepath, and it's hard to break one # without noticing because the other still works. -icu_local_cflags += -D_REENTRANT -DU_COMMON_IMPLEMENTATION -O3 -DHAVE_ANDROID_OS=1 -fvisibility=hidden +icu_local_cflags += -D_REENTRANT -O3 -DU_COMMON_IMPLEMENTATION -fvisibility=hidden +icu_local_cflags += $(icu_project_cflags) icu_local_cflags += '-DICU_DATA_DIR_PREFIX_ENV_VAR="SQLCIPHER_ICU_PREFIX"' icu_local_cflags += '-DICU_DATA_DIR="/icu"' icu_local_ldlibs := -lc -lpthread -lm @@ -312,6 +315,7 @@ LOCAL_C_INCLUDES := $(c_includes) \ abi/cpp/include LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_I18N_IMPLEMENTATION -fPIC -fvisibility=hidden LOCAL_CFLAGS += -O3 +LOCAL_CFLAGS += $(icu_project_cflags) LOCAL_RTTI_FLAG := -frtti LOCAL_SHARED_LIBRARIES += libgabi++ LOCAL_STATIC_LIBRARIES += libicuuc diff --git a/jni/Application.mk b/jni/Application.mk index ea9d6e28..ee48f675 100644 --- a/jni/Application.mk +++ b/jni/Application.mk @@ -1,6 +1,5 @@ APP_PROJECT_PATH := $(shell pwd) APP_ABI := armeabi x86 APP_BUILD_SCRIPT := $(APP_PROJECT_PATH)/Android.mk -# fixes this error when building external/android-sqlite/android/sqlite3_android.cpp -# icu4c/common/unicode/std_string.h:39:18: error: string: No such file or directory -APP_STL := stlport_shared +APP_STL := gabi++_shared +APP_CPPFLAGS += -frtti diff --git a/src/net/sqlcipher/database/SQLiteDatabase.java b/src/net/sqlcipher/database/SQLiteDatabase.java index b45c0d79..f6c42dde 100644 --- a/src/net/sqlcipher/database/SQLiteDatabase.java +++ b/src/net/sqlcipher/database/SQLiteDatabase.java @@ -138,7 +138,7 @@ public static void loadLibs (Context context) { public static void loadLibs (Context context, File workingDir) { - System.loadLibrary("stlport_shared"); + System.loadLibrary("gabi++_shared"); System.loadLibrary("sqlcipher_android"); System.loadLibrary("database_sqlcipher");