Skip to content

Commit 1441907

Browse files
Merge branch 'v2'
Conflicts: .gitmodules
2 parents c82e659 + c0d8f98 commit 1441907

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+308
-191
lines changed

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
url = git://github.com/guardianproject/openssl-android.git
44
[submodule "external/sqlcipher"]
55
path = external/sqlcipher
6-
url = git://github.com/guardianproject/sqlcipher-android.git
6+
url = git://github.com/sqlcipher/sqlcipher.git
77
[submodule "external/dalvik"]
88
path = external/dalvik
99
url = git://github.com/android/platform_dalvik.git

AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3-
package="info.guardianproject.database" android:versionCode="4"
3+
package="net.sqlcipher" android:versionCode="4"
44
android:versionName="v1 (0.0.6.FINAL)">
55
<uses-sdk android:minSdkVersion="7"></uses-sdk>
66
<application android:icon="@drawable/icon" android:label="@string/app_name">

Makefile

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11

22
.DEFAULT_GOAL := all
33
LIBRARY_ROOT := libs
4+
JNI_DIR := ${CURDIR}/jni
5+
EXTERNAL_DIR := ${CURDIR}/external
6+
SQLCIPHER_DIR := ${EXTERNAL_DIR}/sqlcipher
47

58
init:
69
git submodule update --init
@@ -9,35 +12,36 @@ init:
912
all: build-external build-jni build-java copy-libs
1013

1114
build-external:
12-
cd external/ && \
15+
cd ${EXTERNAL_DIR} && \
1316
make -f Android.mk build-local-hack && \
1417
ndk-build && \
1518
make -f Android.mk copy-libs-hack
1619

1720
build-jni:
18-
cd jni/ && \
21+
cd ${JNI_DIR} && \
1922
ndk-build
2023

2124
build-java:
2225
ant release && \
23-
cd bin/classes && \
26+
cd ${CURDIR}/bin/classes && \
2427
jar -cvf sqlcipher.jar .
2528

2629
clean:
2730
ant clean
28-
cd external/ && ndk-build clean
29-
cd jni/ && ndk-build clean
31+
cd ${EXTERNAL_DIR} && ndk-build clean
32+
-cd ${SQLCIPHER_DIR} && make clean
33+
cd ${JNI_DIR} && ndk-build clean
3034
-rm ${LIBRARY_ROOT}/armeabi/libsqlcipher_android.so
3135
-rm ${LIBRARY_ROOT}/armeabi/libdatabase_sqlcipher.so
3236
-rm ${LIBRARY_ROOT}/sqlcipher.jar
3337

3438
copy-libs:
3539
mkdir -p ${LIBRARY_ROOT}/armeabi
36-
cp external/libs/armeabi/libsqlcipher_android.so \
40+
cp ${EXTERNAL_DIR}/libs/armeabi/libsqlcipher_android.so \
3741
${LIBRARY_ROOT}/armeabi && \
38-
cp jni/libs/armeabi/libdatabase_sqlcipher.so \
42+
cp ${JNI_DIR}/libs/armeabi/libdatabase_sqlcipher.so \
3943
${LIBRARY_ROOT}/armeabi && \
40-
cp bin/classes/sqlcipher.jar ${LIBRARY_ROOT} && \
44+
cp ${CURDIR}/bin/classes/sqlcipher.jar ${LIBRARY_ROOT} && \
4145
cp ${ANDROID_NDK_ROOT}/sources/cxx-stl/stlport/libs/armeabi/libstlport_shared.so \
4246
${LIBRARY_ROOT}/armeabi
4347

external/Android.mk

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,13 @@ LOCAL_PATH := $(PROJECT_ROOT_PATH)
1010
LOCAL_PRELINK_MODULE := false
1111

1212
# how on earth to you make this damn Android build system run cmd line progs?!?!
13-
build-local-hack: sqlcipher/sqlite3.c ../obj/local/armeabi/libcrypto.so
13+
build-local-hack: sqlcipher/sqlite3.c
1414

1515
sqlcipher/sqlite3.c:
16-
cd sqlcipher && ./configure --enable-tempstore=yes CFLAGS="-DSQL_HAS_CODEC" LDFLAGS="-lcrypto"
16+
cd ${CURDIR}/sqlcipher && ./configure
1717
make -C sqlcipher sqlite3.c
1818

19-
# TODO include this Android.mk to integrate this into the build
20-
../obj/local/armeabi/libcrypto.so:
21-
cd openssl && ndk-build -j4
22-
mkdir -p ../obj/local/armeabi
23-
install -p openssl/libs/armeabi/libcrypto.so openssl/libs/armeabi/libssl.so \
24-
../obj/local/armeabi/
25-
2619
copy-libs-hack: build-local-hack
27-
install -p -m644 openssl/libs/armeabi/*.so ../obj/local/armeabi/
2820
install -p -m644 libs/armeabi/*.so ../obj/local/armeabi/
2921

3022
project_ldflags:= -Llibs/armeabi/ -Landroid-libs/
@@ -36,7 +28,7 @@ project_ldflags:= -Llibs/armeabi/ -Landroid-libs/
3628
# SQLITE_TEMP_STORE=3 causes all TEMP files to go into RAM. and thats the behavior we want
3729
# SQLITE_ENABLE_FTS3 enables usage of FTS3 - NOT FTS1 or 2.
3830
# SQLITE_DEFAULT_AUTOVACUUM=1 causes the databases to be subject to auto-vacuum
39-
android_sqlite_cflags := -DHAVE_USLEEP=1 -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 -DSQLITE_THREADSAFE=1 -DNDEBUG=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_DEFAULT_AUTOVACUUM=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_BACKWARDS -DSQLITE_ENABLE_LOAD_EXTENSION
31+
android_sqlite_cflags := -DHAVE_USLEEP=1 -DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 -DSQLITE_THREADSAFE=1 -DNDEBUG=1 -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 -DSQLITE_DEFAULT_AUTOVACUUM=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_BACKWARDS -DSQLITE_ENABLE_LOAD_EXTENSION -DCODEC_DEBUG
4032

4133
sqlcipher_files := \
4234
sqlcipher/sqlite3.c

external/sqlcipher

Submodule sqlcipher updated 587 files

jni/Android.mk

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ endif
2121
include $(CLEAR_VARS)
2222

2323
LOCAL_SRC_FILES:= \
24-
info_guardianproject_database_sqlcipher_SQLiteCompiledSql.cpp \
25-
info_guardianproject_database_sqlcipher_SQLiteDatabase.cpp \
26-
info_guardianproject_database_sqlcipher_SQLiteProgram.cpp \
27-
info_guardianproject_database_sqlcipher_SQLiteQuery.cpp \
28-
info_guardianproject_database_sqlcipher_SQLiteStatement.cpp \
29-
info_guardianproject_database_CursorWindow.cpp \
24+
net_sqlcipher_database_SQLiteCompiledSql.cpp \
25+
net_sqlcipher_database_SQLiteDatabase.cpp \
26+
net_sqlcipher_database_SQLiteProgram.cpp \
27+
net_sqlcipher_database_SQLiteQuery.cpp \
28+
net_sqlcipher_database_SQLiteStatement.cpp \
29+
net_sqlcipher_CursorWindow.cpp \
3030
CursorWindow.cpp
31-
# info_guardianproject_database_sqlcipher_SQLiteDebug.cpp
31+
# net_sqlcipher_database_sqlcipher_SQLiteDebug.cpp
3232

3333
LOCAL_C_INCLUDES += \
3434
$(JNI_H_INCLUDE) \

jni/CursorWindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "CursorWindow.h"
3232

3333

34-
namespace guardianproject {
34+
namespace sqlcipher {
3535

3636
CursorWindow::CursorWindow(size_t maxSize) :
3737
mMaxSize(maxSize)
@@ -410,4 +410,4 @@ bool CursorWindow::getNull(unsigned int row, unsigned int col, bool * valueOut)
410410
return true;
411411
}
412412

413-
}; // namespace guardianproject
413+
}; // namespace sqlcipher

jni/CursorWindow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
// When defined to true numberic values are stored inline in the field_slot_t, otherwise they're allocated in the window
6363
#define WINDOW_STORAGE_INLINE_NUMERICS 1
6464

65-
namespace guardianproject {
65+
namespace sqlcipher {
6666

6767
typedef struct
6868
{
@@ -203,6 +203,6 @@ class CursorWindow
203203
uint32_t mFreeOffset;
204204
};
205205

206-
}; // namespace guardianproject
206+
}; // namespace sqlcipher
207207

208208
#endif

jni/info_guardianproject_database_CursorWindow.cpp renamed to jni/net_sqlcipher_CursorWindow.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "sqlite3_exception.h"
3232
#include "android_util_Binder.h"
3333

34-
namespace guardianproject {
34+
namespace sqlcipher {
3535

3636
static jfieldID gWindowField;
3737
static jfieldID gBufferField;
@@ -683,9 +683,9 @@ int register_android_database_CursorWindow(JNIEnv * env)
683683
{
684684
jclass clazz;
685685

686-
clazz = env->FindClass("info/guardianproject/database/CursorWindow");
686+
clazz = env->FindClass("net/sqlcipher/CursorWindow");
687687
if (clazz == NULL) {
688-
LOGE("Can't find info/guardianproject/database/CursorWindow");
688+
LOGE("Can't find net/sqlcipher/CursorWindow");
689689
return -1;
690690
}
691691

@@ -716,8 +716,8 @@ int register_android_database_CursorWindow(JNIEnv * env)
716716
return -1;
717717
}
718718

719-
return android::AndroidRuntime::registerNativeMethods(env, "info/guardianproject/database/CursorWindow",
719+
return android::AndroidRuntime::registerNativeMethods(env, "net/sqlcipher/CursorWindow",
720720
sMethods, NELEM(sMethods));
721721
}
722722

723-
} // namespace guardianproject
723+
} // namespace sqlcipher

jni/info_guardianproject_database_sqlcipher_SQLiteCompiledSql.cpp renamed to jni/net_sqlcipher_database_SQLiteCompiledSql.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "sqlite3_exception.h"
3333

3434

35-
namespace guardianproject {
35+
namespace sqlcipher {
3636

3737
static jfieldID gHandleField;
3838
static jfieldID gStatementField;
@@ -113,9 +113,9 @@ int register_android_database_SQLiteCompiledSql(JNIEnv * env)
113113
{
114114
jclass clazz;
115115

116-
clazz = env->FindClass("info/guardianproject/database/sqlcipher/SQLiteCompiledSql");
116+
clazz = env->FindClass("net/sqlcipher/database/SQLiteCompiledSql");
117117
if (clazz == NULL) {
118-
LOGE("Can't find info/guardianproject/database/sqlcipher/SQLiteCompiledSql");
118+
LOGE("Can't find net/sqlcipher/database/SQLiteCompiledSql");
119119
return -1;
120120
}
121121

@@ -128,10 +128,10 @@ int register_android_database_SQLiteCompiledSql(JNIEnv * env)
128128
}
129129

130130
return android::AndroidRuntime::registerNativeMethods(env,
131-
"info/guardianproject/database/sqlcipher/SQLiteCompiledSql", sMethods, NELEM(sMethods));
131+
"net/sqlcipher/database/SQLiteCompiledSql", sMethods, NELEM(sMethods));
132132
}
133133

134134

135135

136136

137-
} // namespace guardianproject
137+
} // namespace sqlcipher

0 commit comments

Comments
 (0)