Skip to content

Commit 17d6086

Browse files
Merge branch 'openssl' into prerelease
2 parents d8f5409 + 52f2072 commit 17d6086

File tree

9 files changed

+96
-9
lines changed

9 files changed

+96
-9
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "external/openssl"]
22
path = external/openssl
3-
url = https://github.com/guardianproject/openssl-android.git
3+
url = git://git.openssl.org/openssl.git
44
[submodule "external/sqlcipher"]
55
path = external/sqlcipher
66
url = https://github.com/sqlcipher/sqlcipher.git

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ release:
4747

4848
clean:
4949
-rm SQLCipher\ for\ Android\*.zip
50-
ant clean
51-
cd ${EXTERNAL_DIR} && ndk-build clean
50+
-ant clean
51+
-cd ${EXTERNAL_DIR} && ndk-build clean
5252
-cd ${SQLCIPHER_DIR} && make clean
53-
cd ${JNI_DIR} && ndk-build clean
53+
-cd ${JNI_DIR} && ndk-build clean
5454
-rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so
5555
-rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so
5656
-rm ${LIBRARY_ROOT}/armeabi/libstlport_shared.so
@@ -79,3 +79,6 @@ copy-libs:
7979
copy-libs-dist:
8080
cp ${LIBRARY_ROOT}/*.jar dist/SQLCipherForAndroid-SDK/libs/ && \
8181
cp ${LIBRARY_ROOT}/armeabi/*.so dist/SQLCipherForAndroid-SDK/libs/armeabi/
82+
83+
build-openssl-libraries:
84+
./build-openssl-libraries.sh

build-openssl-libraries.sh

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
(cd external/openssl;
2+
3+
if [ ! ${ANDROID_NDK_ROOT} ]; then
4+
echo "ANDROID_NDK_ROOT environment variable not set, set and rerun"
5+
exit 1
6+
fi
7+
8+
HOST_INFO=`uname -a`
9+
case ${HOST_INFO} in
10+
Darwin*)
11+
TOOLCHAIN_SYSTEM=darwin-x86_64
12+
;;
13+
Linux*)
14+
if [[ "${HOST_INFO}" == *i686* ]]
15+
then
16+
TOOLCHAIN_SYSTEM=linux-x86
17+
else
18+
TOOLCHAIN_SYSTEM=linux-x86_64
19+
fi
20+
;;
21+
*)
22+
echo "Toolchain unknown for host system"
23+
exit 1
24+
;;
25+
esac
26+
27+
rm ../android-libs/armeabi/libcrypto.a \
28+
../android-libs/x86/libcrypto.a
29+
30+
git clean -dfx && git checkout -f
31+
./Configure dist
32+
33+
ANDROID_PLATFORM_VERSION=android-14
34+
ANDROID_TOOLCHAIN_DIR=/tmp/sqlcipher-android-toolchain
35+
OPENSSL_EXCLUSION_LIST=no-krb5 no-gost no-idea no-camellia \
36+
no-seed no-bf no-cast no-rc2 no-rc4 no-rc5 no-md2 \
37+
no-md4 no-ripemd no-rsa no-ecdh no-sock no-ssl2 no-ssl3 \
38+
no-dsa no-dh no-ec no-ecdsa no-tls1 no-x509 no-pkcs7 \
39+
no-pbe no-pkcs no-tlsext no-pem no-rfc3779 no-whirlpool \
40+
no-ocsp no-x509v3 no-ui no-srp no-ssltrace no-tlsext \
41+
no-mdc2 no-ecdh no-engine no-tls2 no-srtp
42+
43+
${ANDROID_NDK_ROOT}/build/tools/make-standalone-toolchain.sh \
44+
--platform=${ANDROID_PLATFORM_VERSION} \
45+
--install-dir=${ANDROID_TOOLCHAIN_DIR} \
46+
--system=${TOOLCHAIN_SYSTEM} \
47+
--arch=arm
48+
49+
export PATH=${ANDROID_TOOLCHAIN_DIR}/bin:$PATH
50+
51+
RANLIB=arm-linux-androideabi-ranlib \
52+
AR=arm-linux-androideabi-ar \
53+
CC=arm-linux-androideabi-gcc \
54+
./Configure android ${OPENSSL_EXCLUSION_LIST}
55+
56+
make build_crypto
57+
58+
mv libcrypto.a ../android-libs/armeabi/
59+
60+
rm -rf ${ANDROID_TOOLCHAIN_DIR}
61+
62+
${ANDROID_NDK_ROOT}/build/tools/make-standalone-toolchain.sh \
63+
--platform=${ANDROID_PLATFORM_VERSION} \
64+
--install-dir=${ANDROID_TOOLCHAIN_DIR} \
65+
--system=${TOOLCHAIN_SYSTEM} \
66+
--arch=x86
67+
68+
export PATH=${ANDROID_TOOLCHAIN_DIR}/bin:$PATH
69+
70+
RANLIB=i686-linux-android-ranlib \
71+
AR=i686-linux-android-ar \
72+
CC=i686-linux-android-gcc \
73+
./Configure android-x86 ${OPENSSL_EXCLUSION_LIST}
74+
75+
make build_crypto
76+
77+
mv libcrypto.a ../android-libs/x86/
78+
)

external/Android.mk

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,21 @@ sqlcipher_cflags := -DSQLITE_HAS_CODEC -DHAVE_FDATASYNC=0 -Dfdatasync=fsync
4141

4242
include $(CLEAR_VARS)
4343

44+
LOCAL_STATIC_LIBRARIES += static-libcrypto
4445
LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlcipher_cflags)
45-
LOCAL_C_INCLUDES := includes openssl/include sqlcipher
46+
LOCAL_C_INCLUDES := includes sqlcipher
4647
LOCAL_LDFLAGS += $(project_ldflags)
47-
LOCAL_LDLIBS += -lcrypto
4848
LOCAL_MODULE := libsqlcipher
4949
LOCAL_SRC_FILES := $(sqlcipher_files)
5050

5151
include $(BUILD_STATIC_LIBRARY)
5252

53+
include $(CLEAR_VARS)
54+
LOCAL_MODULE := static-libcrypto
55+
LOCAL_EXPORT_C_INCLUDES := openssl/include
56+
LOCAL_SRC_FILES := android-libs/$(TARGET_ARCH_ABI)/libcrypto.a
57+
include $(PREBUILT_STATIC_LIBRARY)
58+
5359
#------------------------------------------------------------------------------#
5460
# libsqlcipher_android (our version of Android's libsqlite_android)
5561

@@ -73,7 +79,7 @@ LOCAL_ALLOW_UNDEFINED_SYMBOLS := false
7379

7480
# TODO this needs to depend on libsqlcipher being built, how to do that?
7581
#LOCAL_REQUIRED_MODULES += libsqlcipher libicui18n libicuuc
76-
LOCAL_STATIC_LIBRARIES := libsqlcipher libicui18n libicuuc
82+
LOCAL_STATIC_LIBRARIES := libsqlcipher libicui18n libicuuc static-libcrypto
7783

7884
LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlite_cflags) \
7985
-DOS_PATH_SEPARATOR="'/'" -DHAVE_SYS_UIO_H
@@ -87,7 +93,7 @@ LOCAL_C_INCLUDES := \
8793
$(LOCAL_PATH)/platform-frameworks-base/include
8894

8995
LOCAL_LDFLAGS += -L${LOCAL_PATH}/android-libs/$(TARGET_ARCH_ABI)/ -L$(LOCAL_PATH)/libs/$(TARGET_ARCH_ABI)/
90-
LOCAL_LDLIBS := -llog -lutils -lcutils -lcrypto
96+
LOCAL_LDLIBS := -llog -lutils -lcutils
9197
LOCAL_MODULE := libsqlcipher_android
9298
LOCAL_MODULE_FILENAME := libsqlcipher_android
9399
LOCAL_SRC_FILES := $(libsqlite3_android_local_src_files)
2.51 MB
Binary file not shown.
-729 KB
Binary file not shown.
3.06 MB
Binary file not shown.
-1.54 MB
Binary file not shown.

external/openssl

Submodule openssl updated from 1a3c579 to 46ebd9e

0 commit comments

Comments
 (0)