Compile SQLCipher
Source:
http://qiita.com/idaisuke/items/b4386705db7ec714f98a
My NDK version is r10d.
# export LIBRARY_PATH=/your/library/path
arm platform
# $NDK_ROOT/build/tools/make-standalone-toolchain.sh --arch=arm --install-dir=toolchain --platform=android-19
# HOST=arm-linux
# find toolchain/bin -name arm-linux-androideabi* -type f | while read FILE
do
cp -f $FILE ${FILE%/*}/arm-linux${FILE##*-androideabi}
done
# cd src
# export PATH=$LIBRARY_PATH/SQLCipher/toolchain/bin:$PATH
armeabi
# ARCH=armv5
# PREFIX=$LIBRARY_PATH/SQLCipher/dest/armeabi
# OPENSSL_INCLUDE_PATH=$LIBRARY_PATH/OpenSSL/dest/armeabi/include
# OPENSSL_LIBRARY_PATH=$LIBRARY_PATH/OpenSSL/dest/armeabi/lib
# ./configure --prefix=$PREFIX -host=$HOST --enable-tempstore=yes --disable-tcl --disable-readline --with-pic CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -march=$ARCH -fPIE -I$OPENSSL_INCLUDE_PATH" LDFLAGS="-L$OPENSSL_LIBRARY_PATH"
# make clean && make && make install
armeabi-v7a
# ARCH=armv7-a
# PREFIX=$LIBRARY_PATH/SQLCipher/dest/armeabi-v7a
# OPENSSL_INCLUDE_PATH=$LIBRARY_PATH/OpenSSL/dest/armeabi-v7a/include
# OPENSSL_LIBRARY_PATH=$LIBRARY_PATH/OpenSSL/dest/armeabi-v7a/lib
# ./configure --prefix=$PREFIX -host=$HOST --enable-tempstore=yes --disable-tcl --disable-readline --with-pic CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -march=$ARCH -fPIE -I$OPENSSL_INCLUDE_PATH" LDFLAGS="-L$OPENSSL_LIBRARY_PATH"
# make clean && make && make install
x86 platform
# $NDK_ROOT/build/tools/make-standalone-toolchain.sh --arch=x86 --install-dir=toolchainx86 --platform=android-19
# HOST=i686-linux
# find toolchainx86/bin -name i686-linux-android* -type f | while read FILE
do
cp -f $FILE ${FILE%/*}/i686-linux${FILE##*-android}
done
# cd src
# export PATH=$LIBRARY_PATH/SQLCipher/toolchainx86/bin:$PATH
x86
# ARCH=i386
# PREFIX=$LIBRARY_PATH/SQLCipher/dest/x86
# OPENSSL_INCLUDE_PATH=$LIBRARY_PATH/OpenSSL/dest/x86/include
# OPENSSL_LIBRARY_PATH=$LIBRARY_PATH/OpenSSL/dest/x86/lib
# ./configure --prefix=$PREFIX -host=$HOST --enable-tempstore=yes --disable-tcl --disable-readline CFLAGS="-DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -march=$ARCH -fPIE -fPIC -I$OPENSSL_INCLUDE_PATH" LDFLAGS="-L$OPENSSL_LIBRARY_PATH"
# make clean && make && make install
Add Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/$(TARGET_ARCH_ABI)/include/sqlcipher
LOCAL_MODULE := sqlcipher
LOCAL_SRC_FILES := $(TARGET_ARCH_ABI)/lib/libsqlcipher.a
include $(PREBUILT_STATIC_LIBRARY)
Modify Android.mk & Application.mk