Skip to content

Replace libstlport with libgabi++ #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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/ && \
Expand Down
6 changes: 5 additions & 1 deletion external/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 := \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions jni/Application.mk
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/net/sqlcipher/database/SQLiteDatabase.java
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down