Skip to content

Project Update #19

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 20 commits into from
Oct 29, 2011
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8fe294e
Adding the .DS_Store file to the ignore list
developernotes Aug 25, 2011
884119f
Adding libandroid_runtime.so and libbinder.so to ease linking
developernotes Aug 25, 2011
38679e8
Changing the SQLite build to allow extension loading
developernotes Aug 25, 2011
95c3059
Adding a build file for ant
developernotes Aug 30, 2011
5be3f35
Build configuration that includes a statically linked version of the …
developernotes Oct 4, 2011
41668d6
Adding updates for the icu project
developernotes Oct 4, 2011
bf9f016
Update gitmodule for the icu project
developernotes Oct 4, 2011
1e3039f
Initial merge of icu build project into the root external build file
developernotes Oct 6, 2011
2796385
Fix to allow cross process cursors to work with sqlcipher
developernotes Oct 21, 2011
ed7d5d2
Updating icu4c submodule back to correct commit and repository
developernotes Oct 25, 2011
608f142
Creating the directories for libcrypto and libssl for install
developernotes Oct 25, 2011
d4ee12b
Removing user specific files for build system
developernotes Oct 25, 2011
c9ad76d
Updating the README with build instructions and formatting
developernotes Oct 25, 2011
b234b5c
Revert "refactored code to use android/database/CursorWindow instead …
sjlombardo Oct 25, 2011
a486208
Revert "refactoed to code to use android/database/CursorWindow instea…
sjlombardo Oct 25, 2011
702b730
bring master inline with gp-cursor following reverts
sjlombardo Oct 25, 2011
878aaff
remove generated files from version control
sjlombardo Oct 25, 2011
79b1890
add bin/ and gen/ to ignore list
sjlombardo Oct 25, 2011
feade3a
Adding Makefile for building project and updating documentation
developernotes Oct 25, 2011
a6f071f
Adjustment to the build instructions
developernotes Oct 25, 2011
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
Prev Previous commit
Next Next commit
Build configuration that includes a statically linked version of the …
…icu project and sqlcipher
  • Loading branch information
developernotes committed Oct 28, 2011
commit 5be3f355782a42cfa591b9d2e978cd445c611e6b
Binary file added bin/classes/example/EventDataSQLHelper.class
Binary file not shown.
Binary file added bin/classes/example/SQLDemoActivity.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added bin/classes/info/guardianproject/database/R.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="android-database-sqlcipher" default="help">
<project name="foobar" default="help">

<!-- The local.properties file is created and updated by the 'android'
tool.
Expand Down
20 changes: 13 additions & 7 deletions external/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ copy-libs-hack: build-local-hack
install -p -m644 libs/armeabi/*.so ../obj/local/armeabi/
## install -p -m644 android-2.2/*.so ../obj/local/armeabi/

project_ldflags:= -Llibs/armeabi/ -Landroid-2.3/
project_ldflags:= -Llibs/armeabi/ -Landroid-2.1/

#------------------------------------------------------------------------------#
# libsqlite3
Expand All @@ -51,7 +51,7 @@ LOCAL_LDLIBS += -lcrypto
LOCAL_MODULE := libsqlcipher
LOCAL_SRC_FILES := $(sqlcipher_files)

include $(BUILD_SHARED_LIBRARY)
include $(BUILD_STATIC_LIBRARY)

#------------------------------------------------------------------------------#
# libsqlcipher_android (our version of Android's libsqlite_android)
Expand All @@ -63,6 +63,7 @@ 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
# android-sqlite/android/PhoneNumberUtilsTest.cpp \
# android-sqlite/android/PhoneticStringUtilsTest.cpp \

Expand All @@ -73,20 +74,25 @@ include $(CLEAR_VARS)
LOCAL_ALLOW_UNDEFINED_SYMBOLS := false

# TODO this needs to depend on libsqlcipher being built, how to do that?
#LOCAL_REQUIRED_MODULES += libsqlcipher libicui18n libicuuc
LOCAL_STATIC_LIBRARIES := libsqlcipher libicui18n libicuuc

LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlite_cflags) -DOS_PATH_SEPARATOR="'/'"

LOCAL_REQUIRED_MODULES += libsqlcipher
LOCAL_CFLAGS += $(android_sqlite_cflags) $(sqlite_cflags)
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/sqlcipher \
$(LOCAL_PATH)/include \
$(LOCAL_PATH)/icu4c/i18n \
$(LOCAL_PATH)/icu4c/common \
$(LOCAL_PATH)/platform-system-core/include \
$(LOCAL_PATH)/platform-frameworks-base/include
#LOCAL_LDFLAGS += $(project_ldflags)
LOCAL_LDFLAGS += -L$(LOCAL_PATH)/android-2.3/ -L$(LOCAL_PATH)/libs/armeabi/
LOCAL_LDLIBS := -lsqlcipher -llog -licuuc -licui18n -lutils -lcutils

LOCAL_LDFLAGS += -L$(LOCAL_PATH)/android-2.1/ -L$(LOCAL_PATH)/libs/armeabi/
LOCAL_LDLIBS := -llog -lutils -lcutils -lcrypto
LOCAL_MODULE := libsqlcipher_android
LOCAL_MODULE_FILENAME := libsqlcipher_android
LOCAL_SRC_FILES := $(libsqlite3_android_local_src_files)

include $(BUILD_SHARED_LIBRARY)

include $(LOCAL_PATH)/icu4c/Android.mk
2 changes: 1 addition & 1 deletion external/icu4c
Submodule icu4c updated from fa7b84 to fd2170
100 changes: 100 additions & 0 deletions gen/info/guardianproject/database/IContentObserver.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/*
* This file is auto-generated. DO NOT MODIFY.
* Original file: /Users/nparker/code/android-database-sqlcipher/src/info/guardianproject/database/IContentObserver.aidl
*/
package info.guardianproject.database;
/**
* @hide
*/
public interface IContentObserver extends android.os.IInterface
{
/** Local-side IPC implementation stub class. */
public static abstract class Stub extends android.os.Binder implements info.guardianproject.database.IContentObserver
{
private static final java.lang.String DESCRIPTOR = "info.guardianproject.database.IContentObserver";
/** Construct the stub at attach it to the interface. */
public Stub()
{
this.attachInterface(this, DESCRIPTOR);
}
/**
* Cast an IBinder object into an info.guardianproject.database.IContentObserver interface,
* generating a proxy if needed.
*/
public static info.guardianproject.database.IContentObserver asInterface(android.os.IBinder obj)
{
if ((obj==null)) {
return null;
}
android.os.IInterface iin = (android.os.IInterface)obj.queryLocalInterface(DESCRIPTOR);
if (((iin!=null)&&(iin instanceof info.guardianproject.database.IContentObserver))) {
return ((info.guardianproject.database.IContentObserver)iin);
}
return new info.guardianproject.database.IContentObserver.Stub.Proxy(obj);
}
public android.os.IBinder asBinder()
{
return this;
}
@Override public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException
{
switch (code)
{
case INTERFACE_TRANSACTION:
{
reply.writeString(DESCRIPTOR);
return true;
}
case TRANSACTION_onChange:
{
data.enforceInterface(DESCRIPTOR);
boolean _arg0;
_arg0 = (0!=data.readInt());
this.onChange(_arg0);
return true;
}
}
return super.onTransact(code, data, reply, flags);
}
private static class Proxy implements info.guardianproject.database.IContentObserver
{
private android.os.IBinder mRemote;
Proxy(android.os.IBinder remote)
{
mRemote = remote;
}
public android.os.IBinder asBinder()
{
return mRemote;
}
public java.lang.String getInterfaceDescriptor()
{
return DESCRIPTOR;
}
/**
* This method is called when an update occurs to the cursor that is being
* observed. selfUpdate is true if the update was caused by a call to
* commit on the cursor that is being observed.
*/
public void onChange(boolean selfUpdate) throws android.os.RemoteException
{
android.os.Parcel _data = android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeInt(((selfUpdate)?(1):(0)));
mRemote.transact(Stub.TRANSACTION_onChange, _data, null, android.os.IBinder.FLAG_ONEWAY);
}
finally {
_data.recycle();
}
}
}
static final int TRANSACTION_onChange = (android.os.IBinder.FIRST_CALL_TRANSACTION + 0);
}
/**
* This method is called when an update occurs to the cursor that is being
* observed. selfUpdate is true if the update was caused by a call to
* commit on the cursor that is being observed.
*/
public void onChange(boolean selfUpdate) throws android.os.RemoteException;
}
23 changes: 23 additions & 0 deletions gen/info/guardianproject/database/R.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/

package info.guardianproject.database;

public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040001;
public static final int hello=0x7f040000;
}
}
8 changes: 5 additions & 3 deletions jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ else
LOCAL_CFLAGS += -DPACKED=""
endif

TARGET_PLATFORM := android-8
#TARGET_PLATFORM := android-8

ifeq ($(WITH_JIT),true)
LOCAL_CFLAGS += -DWITH_JIT
Expand Down Expand Up @@ -50,15 +50,17 @@ LOCAL_SHARED_LIBRARIES := \
libsqlite3_android

LOCAL_CFLAGS += -U__APPLE__
LOCAL_LDFLAGS += -L../external/android-2.2/ -L../external/libs/armeabi/
LOCAL_LDFLAGS += -L../external/android-2.3/ -L../external/libs/armeabi/
LOCAL_LDFLAGS += -L/home/n8fr8/android/mydroid/out/target/product/generic/obj/SHARED_LIBRARIES/libutils_intermediates/LINKED/ -L/home/n8fr8/android/mydroid/out/target/product/generic/obj/SHARED_LIBRARIES/libbinder_intermediates/LINKED/ -L/home/n8fr8/android/mydroid/out/target/product/generic/obj/SHARED_LIBRARIES/libandroid_runtime_intermediates/LINKED/

# libs from the NDK
LOCAL_LDLIBS += -ldl -llog
# libnativehelper and libandroid_runtime are included with Android but not the NDK
LOCAL_LDLIBS += -lnativehelper -landroid_runtime -lutils -lbinder
# these are build in the ../external section
LOCAL_LDLIBS += -lsqlcipher -lsqlcipher_android

#LOCAL_REQUIRED_MODULES += libsqlcipher libicuuc libicui18n
LOCAL_LDLIBS += -lsqlcipher_android

ifeq ($(WITH_MALLOC_LEAK_CHECK),true)
LOCAL_CFLAGS += -DMALLOC_LEAK_CHECK
Expand Down
11 changes: 8 additions & 3 deletions jni/info_guardianproject_database_sqlcipher_SQLiteDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,13 @@ static void registerLoggingFunc(const char *path) {
loggingFuncSet = true;
}



/* public native void setICURoot(String path); */
void setICURoot(JNIEnv* env, jobject object, jstring ICURoot)
{
char const * ICURootPath = env->GetStringUTFChars(ICURoot, NULL);
setenv("SQLCIPHER_ICU_PREFIX", ICURootPath, 1);
env->ReleaseStringUTFChars(ICURoot, ICURootPath);
}


/* public native void dbopen(String path, int flags, String locale); */
Expand Down Expand Up @@ -463,7 +468,7 @@ static JNINativeMethod sMethods[] =
{"native_setLocale", "(Ljava/lang/String;I)V", (void *)native_setLocale},
{"native_getDbLookaside", "()I", (void *)native_getDbLookaside},
{"releaseMemory", "()I", (void *)native_releaseMemory},

{"setICURoot", "(Ljava/lang/String;)V", (void *)setICURoot},
};

int register_android_database_SQLiteDatabase(JNIEnv *env)
Expand Down
Binary file removed libs/armeabi/libdatabase_sqlcipher.so
Binary file not shown.
Binary file removed libs/armeabi/libsqlcipher.so
Binary file not shown.
Binary file removed libs/armeabi/libsqlcipher_android-10.so
Binary file not shown.
Binary file removed libs/armeabi/libsqlcipher_android-8.so
Binary file not shown.
Binary file removed libs/armeabi/libsqlcipher_android-9.so
Binary file not shown.
1 change: 1 addition & 0 deletions local.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk.dir=/Users/nparker/bin/android-sdk
Loading