Skip to content

Android 4.0 Support #39

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

Merged
merged 10 commits into from
Jan 25, 2012
Merged
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
25 changes: 13 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,39 @@ init:
git submodule update --init
android update project -p .

all: clean build-external build-jni build-java copy-libs
all: build-external build-jni build-java copy-libs

build-external:
cd external/ && \
make -f Android.mk build-local-hack && \
ndk-build clean && \
ndk-build && \
make -f Android.mk copy-libs-hack
make -f Android.mk copy-libs-hack

build-jni:
cd jni/ && \
ndk-build clean && \
ndk-build

build-java:
ant clean && \
ant release && \
cd bin/classes && \
jar -cvf sqlcipher.jar .

clean:
-rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so && \
rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so && \
rm ${LIBRARY_ROOT}/sqlcipher.jar
ant clean
cd external/ && ndk-build clean
cd jni/ && ndk-build clean
-rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so
-rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so
-rm ${LIBRARY_ROOT}/sqlcipher.jar

copy-libs:
mkdir -p ${LIBRARY_ROOT}/armeabi
cp external/libs/armeabi/libsqlcipher_android.so \
${LIBRARY_ROOT}/armeabi && \
cp jni/libs/armeabi/libdatabase_sqlcipher.so \
${LIBRARY_ROOT}/armeabi && \
cp bin/classes/sqlcipher.jar ${LIBRARY_ROOT} && \
cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so \
cp jni/libs/armeabi/libdatabase_sqlcipher.so \
${LIBRARY_ROOT}/armeabi && \
cp bin/classes/sqlcipher.jar ${LIBRARY_ROOT} && \
cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so \
${LIBRARY_ROOT}/armeabi

copy-libs-dist:
Expand Down
Binary file removed assets/icudt44l.zip
Binary file not shown.
Binary file added assets/icudt46l.zip
Binary file not shown.
1 change: 0 additions & 1 deletion default.properties

This file was deleted.

60 changes: 36 additions & 24 deletions external/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ sqlcipher_cflags := -DSQLITE_HAS_CODEC -DHAVE_FDATASYNC=0 -Dfdatasync=fsync
include $(CLEAR_VARS)

LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlcipher_cflags)
LOCAL_C_INCLUDES := openssl/include sqlcipher
LOCAL_C_INCLUDES := includes openssl/include sqlcipher
LOCAL_LDFLAGS += $(project_ldflags)
LOCAL_LDLIBS += -lcrypto
LOCAL_MODULE := libsqlcipher
Expand All @@ -64,7 +64,8 @@ libsqlite3_android_local_src_files := \
android-sqlite/android/PhoneNumberUtils.cpp \
android-sqlite/android/OldPhoneNumberUtils.cpp \
android-sqlite/android/PhoneticStringUtils.cpp \
platform-frameworks-base/libs/utils/String8.cpp
String16.cpp \
String8.cpp
# android-sqlite/android/PhoneNumberUtilsTest.cpp \
# android-sqlite/android/PhoneticStringUtilsTest.cpp \

Expand All @@ -81,8 +82,8 @@ LOCAL_STATIC_LIBRARIES := libsqlcipher libicui18n libicuuc
LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlite_cflags) -DOS_PATH_SEPARATOR="'/'"

LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/includes \
$(LOCAL_PATH)/sqlcipher \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/icu4c/i18n \
$(LOCAL_PATH)/icu4c/common \
$(LOCAL_PATH)/platform-system-core/include \
Expand All @@ -109,6 +110,8 @@ include $(BUILD_SHARED_LIBRARY)

ICU_COMMON_PATH := icu4c/common

# new icu common build begin

icu_src_files := \
$(ICU_COMMON_PATH)/cmemory.c $(ICU_COMMON_PATH)/cstring.c \
$(ICU_COMMON_PATH)/cwchar.c $(ICU_COMMON_PATH)/locmap.c \
Expand All @@ -130,7 +133,7 @@ icu_src_files := \
$(ICU_COMMON_PATH)/ucnv_set.c $(ICU_COMMON_PATH)/ucnv_u16.c \
$(ICU_COMMON_PATH)/ucnv_u32.c $(ICU_COMMON_PATH)/ucnv_u7.c \
$(ICU_COMMON_PATH)/ucnv_u8.c \
$(ICU_COMMON_PATH)/udata.c $(ICU_COMMON_PATH)/udatamem.c \
$(ICU_COMMON_PATH)/udatamem.c \
$(ICU_COMMON_PATH)/udataswp.c $(ICU_COMMON_PATH)/uenum.c \
$(ICU_COMMON_PATH)/uhash.c $(ICU_COMMON_PATH)/uinit.c \
$(ICU_COMMON_PATH)/uinvchar.c $(ICU_COMMON_PATH)/uloc.c \
Expand Down Expand Up @@ -188,13 +191,16 @@ icu_src_files += \
$(ICU_COMMON_PATH)/loclikely.cpp $(ICU_COMMON_PATH)/locresdata.cpp \
$(ICU_COMMON_PATH)/normalizer2impl.cpp $(ICU_COMMON_PATH)/normalizer2.cpp \
$(ICU_COMMON_PATH)/filterednormalizer2.cpp $(ICU_COMMON_PATH)/ucol_swp.cpp \
$(ICU_COMMON_PATH)/uprops.cpp $(ICU_COMMON_PATH)/utrie2.cpp

$(ICU_COMMON_PATH)/uprops.cpp $(ICU_COMMON_PATH)/utrie2.cpp \
$(ICU_COMMON_PATH)/charstr.cpp $(ICU_COMMON_PATH)/uts46.cpp \
$(ICU_COMMON_PATH)/udata.cpp

# This is the empty compiled-in icu data structure
# that we need to satisfy the linker.
icu_src_files += $(ICU_COMMON_PATH)/../stubdata/stubdata.c

# new icu common build end

icu_c_includes := \
$(ICU_COMMON_PATH)/ \
$(ICU_COMMON_PATH)//../i18n
Expand All @@ -203,10 +209,10 @@ 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
icu_local_cflags += -D_REENTRANT -DU_COMMON_IMPLEMENTATION -O3 -DHAVE_ANDROID_OS=1 -fvisibility=hidden
icu_local_cflags += '-DICU_DATA_DIR_PREFIX_ENV_VAR="SQLCIPHER_ICU_PREFIX"'
icu_local_cflags += '-DICU_DATA_DIR="/icu"'
icu_local_ldlibs := -lc
icu_local_ldlibs := -lc -lpthread -lm

#
# Build for the target (device).
Expand All @@ -216,6 +222,8 @@ include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(icu_src_files)
LOCAL_C_INCLUDES := $(icu_c_includes)
LOCAL_CFLAGS := $(icu_local_cflags) -DPIC -fPIC
LOCAL_RTTI_FLAG := -frtti
LOCAL_SHARED_LIBRARIES += libgabi++
LOCAL_LDLIBS += $(icu_local_ldlibs)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libicuuc
Expand All @@ -233,15 +241,17 @@ LOCAL_PATH := $(PROJECT_ROOT_PATH)
#ICU_I18N_PATH := $(LOCAL_PATH)/icu4c/i18n
ICU_I18N_PATH := icu4c/i18n

# start new icu18n

src_files := \
$(ICU_I18N_PATH)/bocsu.c $(ICU_I18N_PATH)/ucln_in.c $(ICU_I18N_PATH)/decContext.c \
$(ICU_I18N_PATH)/ulocdata.c $(ICU_I18N_PATH)/utmscale.c $(ICU_I18N_PATH)/decNumber.c

src_files += \
$(ICU_I18N_PATH)/indiancal.cpp $(ICU_I18N_PATH)/dtptngen.cpp $(ICU_I18N_PATH)/dtrule.cpp \
$(ICU_I18N_PATH)/persncal.cpp $(ICU_I18N_PATH)/rbtz.cpp $(ICU_I18N_PATH)/reldtfmt.cpp \
$(ICU_I18N_PATH)/taiwncal.cpp $(ICU_I18N_PATH)/tzrule.cpp $(ICU_I18N_PATH)/tztrans.cpp \
$(ICU_I18N_PATH)/udatpg.cpp $(ICU_I18N_PATH)/vtzone.cpp \
$(ICU_I18N_PATH)/indiancal.cpp $(ICU_I18N_PATH)/dtptngen.cpp $(ICU_I18N_PATH)/dtrule.cpp \
$(ICU_I18N_PATH)/persncal.cpp $(ICU_I18N_PATH)/rbtz.cpp $(ICU_I18N_PATH)/reldtfmt.cpp \
$(ICU_I18N_PATH)/taiwncal.cpp $(ICU_I18N_PATH)/tzrule.cpp $(ICU_I18N_PATH)/tztrans.cpp \
$(ICU_I18N_PATH)/udatpg.cpp $(ICU_I18N_PATH)/vtzone.cpp \
$(ICU_I18N_PATH)/anytrans.cpp $(ICU_I18N_PATH)/astro.cpp $(ICU_I18N_PATH)/buddhcal.cpp \
$(ICU_I18N_PATH)/basictz.cpp $(ICU_I18N_PATH)/calendar.cpp $(ICU_I18N_PATH)/casetrn.cpp \
$(ICU_I18N_PATH)/choicfmt.cpp $(ICU_I18N_PATH)/coleitr.cpp $(ICU_I18N_PATH)/coll.cpp \
Expand Down Expand Up @@ -281,32 +291,34 @@ src_files += \
$(ICU_I18N_PATH)/plurfmt.cpp $(ICU_I18N_PATH)/dtitvfmt.cpp $(ICU_I18N_PATH)/dtitvinf.cpp \
$(ICU_I18N_PATH)/tmunit.cpp $(ICU_I18N_PATH)/tmutamt.cpp $(ICU_I18N_PATH)/tmutfmt.cpp \
$(ICU_I18N_PATH)/colldata.cpp $(ICU_I18N_PATH)/bmsearch.cpp $(ICU_I18N_PATH)/bms.cpp \
$(ICU_I18N_PATH)/currpinf.cpp $(ICU_I18N_PATH)/uspoof.cpp $(ICU_I18N_PATH)/uspoof_impl.cpp \
$(ICU_I18N_PATH)/uspoof_build.cpp \
$(ICU_I18N_PATH)/regextxt.cpp $(ICU_I18N_PATH)/selfmt.cpp $(ICU_I18N_PATH)/uspoof_conf.cpp \
$(ICU_I18N_PATH)/uspoof_wsconf.cpp $(ICU_I18N_PATH)/ztrans.cpp $(ICU_I18N_PATH)/zrule.cpp \
$(ICU_I18N_PATH)/vzone.cpp $(ICU_I18N_PATH)/fphdlimp.cpp $(ICU_I18N_PATH)/fpositer.cpp\
$(ICU_I18N_PATH)/locdspnm.cpp $(ICU_I18N_PATH)/decnumstr.cpp $(ICU_I18N_PATH)/ucol_wgt.cpp
$(ICU_I18N_PATH)/currpinf.cpp $(ICU_I18N_PATH)/uspoof.cpp $(ICU_I18N_PATH)/uspoof_impl.cpp \
$(ICU_I18N_PATH)/uspoof_build.cpp \
$(ICU_I18N_PATH)/regextxt.cpp $(ICU_I18N_PATH)/selfmt.cpp $(ICU_I18N_PATH)/uspoof_conf.cpp \
$(ICU_I18N_PATH)/uspoof_wsconf.cpp $(ICU_I18N_PATH)/ztrans.cpp $(ICU_I18N_PATH)/zrule.cpp \
$(ICU_I18N_PATH)/vzone.cpp $(ICU_I18N_PATH)/fphdlimp.cpp $(ICU_I18N_PATH)/fpositer.cpp\
$(ICU_I18N_PATH)/locdspnm.cpp $(ICU_I18N_PATH)/decnumstr.cpp $(ICU_I18N_PATH)/ucol_wgt.cpp

# end new icu18n

c_includes = \
$(ICU_I18N_PATH)/ \
$(ICU_I18N_PATH)/../common


#
# Build for the target (device).
#

include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(src_files)
LOCAL_C_INCLUDES := $(c_includes)

LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_I18N_IMPLEMENTATION -fPIC
LOCAL_C_INCLUDES := $(c_includes) \
abi/cpp/include
LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_I18N_IMPLEMENTATION -fPIC -fvisibility=hidden
LOCAL_CFLAGS += -O3

LOCAL_RTTI_FLAG := -frtti
LOCAL_SHARED_LIBRARIES += libgabi++
LOCAL_STATIC_LIBRARIES += libicuuc
LOCAL_LDLIBS += -lc
LOCAL_LDLIBS += -lc -lpthread -lm
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libicui18n

Expand Down
Loading