Skip to content

Commit 9bbe0fc

Browse files
Merge pull request #39 from developernotes/icu46
Android 4.0 Support
2 parents e481923 + 88ab69c commit 9bbe0fc

20 files changed

+2115
-50
lines changed

Makefile

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,38 +6,39 @@ init:
66
git submodule update --init
77
android update project -p .
88

9-
all: clean build-external build-jni build-java copy-libs
9+
all: build-external build-jni build-java copy-libs
1010

1111
build-external:
1212
cd external/ && \
1313
make -f Android.mk build-local-hack && \
14-
ndk-build clean && \
1514
ndk-build && \
16-
make -f Android.mk copy-libs-hack
15+
make -f Android.mk copy-libs-hack
1716

1817
build-jni:
1918
cd jni/ && \
20-
ndk-build clean && \
2119
ndk-build
2220

2321
build-java:
24-
ant clean && \
2522
ant release && \
2623
cd bin/classes && \
2724
jar -cvf sqlcipher.jar .
2825

2926
clean:
30-
-rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so && \
31-
rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so && \
32-
rm ${LIBRARY_ROOT}/sqlcipher.jar
27+
ant clean
28+
cd external/ && ndk-build clean
29+
cd jni/ && ndk-build clean
30+
-rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so
31+
-rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so
32+
-rm ${LIBRARY_ROOT}/sqlcipher.jar
3333

3434
copy-libs:
35+
mkdir -p ${LIBRARY_ROOT}/armeabi
3536
cp external/libs/armeabi/libsqlcipher_android.so \
3637
${LIBRARY_ROOT}/armeabi && \
37-
cp jni/libs/armeabi/libdatabase_sqlcipher.so \
38-
${LIBRARY_ROOT}/armeabi && \
39-
cp bin/classes/sqlcipher.jar ${LIBRARY_ROOT} && \
40-
cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so \
38+
cp jni/libs/armeabi/libdatabase_sqlcipher.so \
39+
${LIBRARY_ROOT}/armeabi && \
40+
cp bin/classes/sqlcipher.jar ${LIBRARY_ROOT} && \
41+
cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so \
4142
${LIBRARY_ROOT}/armeabi
4243

4344
copy-libs-dist:

assets/icudt44l.zip

-1.96 MB
Binary file not shown.

assets/icudt46l.zip

2.2 MB
Binary file not shown.

default.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.

external/Android.mk

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ sqlcipher_cflags := -DSQLITE_HAS_CODEC -DHAVE_FDATASYNC=0 -Dfdatasync=fsync
4646
include $(CLEAR_VARS)
4747

4848
LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlcipher_cflags)
49-
LOCAL_C_INCLUDES := openssl/include sqlcipher
49+
LOCAL_C_INCLUDES := includes openssl/include sqlcipher
5050
LOCAL_LDFLAGS += $(project_ldflags)
5151
LOCAL_LDLIBS += -lcrypto
5252
LOCAL_MODULE := libsqlcipher
@@ -64,7 +64,8 @@ libsqlite3_android_local_src_files := \
6464
android-sqlite/android/PhoneNumberUtils.cpp \
6565
android-sqlite/android/OldPhoneNumberUtils.cpp \
6666
android-sqlite/android/PhoneticStringUtils.cpp \
67-
platform-frameworks-base/libs/utils/String8.cpp
67+
String16.cpp \
68+
String8.cpp
6869
# android-sqlite/android/PhoneNumberUtilsTest.cpp \
6970
# android-sqlite/android/PhoneticStringUtilsTest.cpp \
7071
@@ -81,8 +82,8 @@ LOCAL_STATIC_LIBRARIES := libsqlcipher libicui18n libicuuc
8182
LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlite_cflags) -DOS_PATH_SEPARATOR="'/'"
8283

8384
LOCAL_C_INCLUDES := \
85+
$(LOCAL_PATH)/includes \
8486
$(LOCAL_PATH)/sqlcipher \
85-
$(LOCAL_PATH)/include \
8687
$(LOCAL_PATH)/icu4c/i18n \
8788
$(LOCAL_PATH)/icu4c/common \
8889
$(LOCAL_PATH)/platform-system-core/include \
@@ -109,6 +110,8 @@ include $(BUILD_SHARED_LIBRARY)
109110

110111
ICU_COMMON_PATH := icu4c/common
111112

113+
# new icu common build begin
114+
112115
icu_src_files := \
113116
$(ICU_COMMON_PATH)/cmemory.c $(ICU_COMMON_PATH)/cstring.c \
114117
$(ICU_COMMON_PATH)/cwchar.c $(ICU_COMMON_PATH)/locmap.c \
@@ -130,7 +133,7 @@ icu_src_files := \
130133
$(ICU_COMMON_PATH)/ucnv_set.c $(ICU_COMMON_PATH)/ucnv_u16.c \
131134
$(ICU_COMMON_PATH)/ucnv_u32.c $(ICU_COMMON_PATH)/ucnv_u7.c \
132135
$(ICU_COMMON_PATH)/ucnv_u8.c \
133-
$(ICU_COMMON_PATH)/udata.c $(ICU_COMMON_PATH)/udatamem.c \
136+
$(ICU_COMMON_PATH)/udatamem.c \
134137
$(ICU_COMMON_PATH)/udataswp.c $(ICU_COMMON_PATH)/uenum.c \
135138
$(ICU_COMMON_PATH)/uhash.c $(ICU_COMMON_PATH)/uinit.c \
136139
$(ICU_COMMON_PATH)/uinvchar.c $(ICU_COMMON_PATH)/uloc.c \
@@ -188,13 +191,16 @@ icu_src_files += \
188191
$(ICU_COMMON_PATH)/loclikely.cpp $(ICU_COMMON_PATH)/locresdata.cpp \
189192
$(ICU_COMMON_PATH)/normalizer2impl.cpp $(ICU_COMMON_PATH)/normalizer2.cpp \
190193
$(ICU_COMMON_PATH)/filterednormalizer2.cpp $(ICU_COMMON_PATH)/ucol_swp.cpp \
191-
$(ICU_COMMON_PATH)/uprops.cpp $(ICU_COMMON_PATH)/utrie2.cpp
192-
194+
$(ICU_COMMON_PATH)/uprops.cpp $(ICU_COMMON_PATH)/utrie2.cpp \
195+
$(ICU_COMMON_PATH)/charstr.cpp $(ICU_COMMON_PATH)/uts46.cpp \
196+
$(ICU_COMMON_PATH)/udata.cpp
193197

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

202+
# new icu common build end
203+
198204
icu_c_includes := \
199205
$(ICU_COMMON_PATH)/ \
200206
$(ICU_COMMON_PATH)//../i18n
@@ -203,10 +209,10 @@ icu_c_includes := \
203209
# device and sim builds can use the same codepath, and it's hard to break one
204210
# without noticing because the other still works.
205211

206-
icu_local_cflags += -D_REENTRANT -DU_COMMON_IMPLEMENTATION -O3 -DHAVE_ANDROID_OS=1
212+
icu_local_cflags += -D_REENTRANT -DU_COMMON_IMPLEMENTATION -O3 -DHAVE_ANDROID_OS=1 -fvisibility=hidden
207213
icu_local_cflags += '-DICU_DATA_DIR_PREFIX_ENV_VAR="SQLCIPHER_ICU_PREFIX"'
208214
icu_local_cflags += '-DICU_DATA_DIR="/icu"'
209-
icu_local_ldlibs := -lc
215+
icu_local_ldlibs := -lc -lpthread -lm
210216

211217
#
212218
# Build for the target (device).
@@ -216,6 +222,8 @@ include $(CLEAR_VARS)
216222
LOCAL_SRC_FILES := $(icu_src_files)
217223
LOCAL_C_INCLUDES := $(icu_c_includes)
218224
LOCAL_CFLAGS := $(icu_local_cflags) -DPIC -fPIC
225+
LOCAL_RTTI_FLAG := -frtti
226+
LOCAL_SHARED_LIBRARIES += libgabi++
219227
LOCAL_LDLIBS += $(icu_local_ldlibs)
220228
LOCAL_MODULE_TAGS := optional
221229
LOCAL_MODULE := libicuuc
@@ -233,15 +241,17 @@ LOCAL_PATH := $(PROJECT_ROOT_PATH)
233241
#ICU_I18N_PATH := $(LOCAL_PATH)/icu4c/i18n
234242
ICU_I18N_PATH := icu4c/i18n
235243

244+
# start new icu18n
245+
236246
src_files := \
237247
$(ICU_I18N_PATH)/bocsu.c $(ICU_I18N_PATH)/ucln_in.c $(ICU_I18N_PATH)/decContext.c \
238248
$(ICU_I18N_PATH)/ulocdata.c $(ICU_I18N_PATH)/utmscale.c $(ICU_I18N_PATH)/decNumber.c
239249

240250
src_files += \
241-
$(ICU_I18N_PATH)/indiancal.cpp $(ICU_I18N_PATH)/dtptngen.cpp $(ICU_I18N_PATH)/dtrule.cpp \
242-
$(ICU_I18N_PATH)/persncal.cpp $(ICU_I18N_PATH)/rbtz.cpp $(ICU_I18N_PATH)/reldtfmt.cpp \
243-
$(ICU_I18N_PATH)/taiwncal.cpp $(ICU_I18N_PATH)/tzrule.cpp $(ICU_I18N_PATH)/tztrans.cpp \
244-
$(ICU_I18N_PATH)/udatpg.cpp $(ICU_I18N_PATH)/vtzone.cpp \
251+
$(ICU_I18N_PATH)/indiancal.cpp $(ICU_I18N_PATH)/dtptngen.cpp $(ICU_I18N_PATH)/dtrule.cpp \
252+
$(ICU_I18N_PATH)/persncal.cpp $(ICU_I18N_PATH)/rbtz.cpp $(ICU_I18N_PATH)/reldtfmt.cpp \
253+
$(ICU_I18N_PATH)/taiwncal.cpp $(ICU_I18N_PATH)/tzrule.cpp $(ICU_I18N_PATH)/tztrans.cpp \
254+
$(ICU_I18N_PATH)/udatpg.cpp $(ICU_I18N_PATH)/vtzone.cpp \
245255
$(ICU_I18N_PATH)/anytrans.cpp $(ICU_I18N_PATH)/astro.cpp $(ICU_I18N_PATH)/buddhcal.cpp \
246256
$(ICU_I18N_PATH)/basictz.cpp $(ICU_I18N_PATH)/calendar.cpp $(ICU_I18N_PATH)/casetrn.cpp \
247257
$(ICU_I18N_PATH)/choicfmt.cpp $(ICU_I18N_PATH)/coleitr.cpp $(ICU_I18N_PATH)/coll.cpp \
@@ -281,32 +291,34 @@ src_files += \
281291
$(ICU_I18N_PATH)/plurfmt.cpp $(ICU_I18N_PATH)/dtitvfmt.cpp $(ICU_I18N_PATH)/dtitvinf.cpp \
282292
$(ICU_I18N_PATH)/tmunit.cpp $(ICU_I18N_PATH)/tmutamt.cpp $(ICU_I18N_PATH)/tmutfmt.cpp \
283293
$(ICU_I18N_PATH)/colldata.cpp $(ICU_I18N_PATH)/bmsearch.cpp $(ICU_I18N_PATH)/bms.cpp \
284-
$(ICU_I18N_PATH)/currpinf.cpp $(ICU_I18N_PATH)/uspoof.cpp $(ICU_I18N_PATH)/uspoof_impl.cpp \
285-
$(ICU_I18N_PATH)/uspoof_build.cpp \
286-
$(ICU_I18N_PATH)/regextxt.cpp $(ICU_I18N_PATH)/selfmt.cpp $(ICU_I18N_PATH)/uspoof_conf.cpp \
287-
$(ICU_I18N_PATH)/uspoof_wsconf.cpp $(ICU_I18N_PATH)/ztrans.cpp $(ICU_I18N_PATH)/zrule.cpp \
288-
$(ICU_I18N_PATH)/vzone.cpp $(ICU_I18N_PATH)/fphdlimp.cpp $(ICU_I18N_PATH)/fpositer.cpp\
289-
$(ICU_I18N_PATH)/locdspnm.cpp $(ICU_I18N_PATH)/decnumstr.cpp $(ICU_I18N_PATH)/ucol_wgt.cpp
294+
$(ICU_I18N_PATH)/currpinf.cpp $(ICU_I18N_PATH)/uspoof.cpp $(ICU_I18N_PATH)/uspoof_impl.cpp \
295+
$(ICU_I18N_PATH)/uspoof_build.cpp \
296+
$(ICU_I18N_PATH)/regextxt.cpp $(ICU_I18N_PATH)/selfmt.cpp $(ICU_I18N_PATH)/uspoof_conf.cpp \
297+
$(ICU_I18N_PATH)/uspoof_wsconf.cpp $(ICU_I18N_PATH)/ztrans.cpp $(ICU_I18N_PATH)/zrule.cpp \
298+
$(ICU_I18N_PATH)/vzone.cpp $(ICU_I18N_PATH)/fphdlimp.cpp $(ICU_I18N_PATH)/fpositer.cpp\
299+
$(ICU_I18N_PATH)/locdspnm.cpp $(ICU_I18N_PATH)/decnumstr.cpp $(ICU_I18N_PATH)/ucol_wgt.cpp
300+
301+
# end new icu18n
290302

291303
c_includes = \
292304
$(ICU_I18N_PATH)/ \
293305
$(ICU_I18N_PATH)/../common
294306

295-
296307
#
297308
# Build for the target (device).
298309
#
299310

300311
include $(CLEAR_VARS)
301312

302313
LOCAL_SRC_FILES := $(src_files)
303-
LOCAL_C_INCLUDES := $(c_includes)
304-
305-
LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_I18N_IMPLEMENTATION -fPIC
314+
LOCAL_C_INCLUDES := $(c_includes) \
315+
abi/cpp/include
316+
LOCAL_CFLAGS += -D_REENTRANT -DPIC -DU_I18N_IMPLEMENTATION -fPIC -fvisibility=hidden
306317
LOCAL_CFLAGS += -O3
307-
318+
LOCAL_RTTI_FLAG := -frtti
319+
LOCAL_SHARED_LIBRARIES += libgabi++
308320
LOCAL_STATIC_LIBRARIES += libicuuc
309-
LOCAL_LDLIBS += -lc
321+
LOCAL_LDLIBS += -lc -lpthread -lm
310322
LOCAL_MODULE_TAGS := optional
311323
LOCAL_MODULE := libicui18n
312324

0 commit comments

Comments
 (0)