Skip to content

What about Android 4.0 support? #34

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

Closed
Vitaly-Olshevsky opened this issue Dec 7, 2011 · 11 comments
Closed

What about Android 4.0 support? #34

Vitaly-Olshevsky opened this issue Dec 7, 2011 · 11 comments

Comments

@Vitaly-Olshevsky
Copy link

It seems that the latest release (0.0.6-FINAL) doesn't work properly on Android 4.0 (at least on emulator).

I've tested the library on notepadbot application, as well as on this sample activity:

public class HelloSQLCipherActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        InitializeSQLCipher();
    }

    private void InitializeSQLCipher() {
        SQLiteDatabase.loadLibs(this);
        File databaseFile = getDatabasePath("demo.db");
        databaseFile.mkdirs();
        databaseFile.delete();
        SQLiteDatabase database = SQLiteDatabase.openOrCreateDatabase(databaseFile, "test123", null);
        database.execSQL("create table t1(a, b)");
        database.execSQL("insert into t1(a, b) values(?, ?)", new Object[]{"one for the money",
                                                                        "two for the show"});
    }
}

And i'm always getting the next exception during the database creation:

12-07 13:02:44.364: E/AndroidRuntime(682): Caused by: info.guardianproject.database.sqlcipher.SQLiteException: not an error
12-07 13:02:44.364: E/AndroidRuntime(682):  at info.guardianproject.database.sqlcipher.SQLiteDatabase.dbopen(Native Method)
12-07 13:02:44.364: E/AndroidRuntime(682):  at info.guardianproject.database.sqlcipher.SQLiteDatabase.<init>(SQLiteDatabase.java:1870)
12-07 13:02:44.364: E/AndroidRuntime(682):  at info.guardianproject.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:863)
12-07 13:02:44.364: E/AndroidRuntime(682):  at info.guardianproject.database.sqlcipher.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:897)
12-07 13:02:44.364: E/AndroidRuntime(682):  at info.guardianproject.database.sqlcipher.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:890)
12-07 13:02:44.364: E/AndroidRuntime(682):  at com.sqlcipher.test.SQLCipherTestActivity.initializeSQLCipher(SQLCipherTestActivity.java:23)
12-07 13:02:44.364: E/AndroidRuntime(682):  at com.sqlcipher.test.SQLCipherTestActivity.onCreate(SQLCipherTestActivity.java:15)
12-07 13:02:44.364: E/AndroidRuntime(682):  at android.app.Activity.performCreate(Activity.java:4465)
12-07 13:02:44.364: E/AndroidRuntime(682):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
12-07 13:02:44.364: E/AndroidRuntime(682):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
12-07 13:02:44.364: E/AndroidRuntime(682):  ... 11 more

On all version below 3.2 everything works fine.

Does SQLCipher for android currently supports version 4.0? Have it been tested yet? Is there some workaround?
(Or maybe i'm just doing something wrong?)

@developernotes
Copy link
Member

Hello,

We had not tested SQLCipher for Android on 4.0 at the time of the release. We will look into the issue you are seeing on 4.0. Thanks!

@inuwan
Copy link

inuwan commented Dec 16, 2011

I experienced a similar issue on a "real" Galaxy Nexus phone with Android 4.0. The app works find on 2.2 and 2.3. I was calling getReadableDatabase().

12-15 16:47:27.819: ERROR/AndroidRuntime(28459): FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{xyz.activity.SplashActivity}: info.guardianproject.database.sqlcipher.SQLiteException: not an error
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1955)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
at android.app.ActivityThread.access$600(ActivityThread.java:122)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4340)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: info.guardianproject.database.sqlcipher.SQLiteException: not an error
at info.guardianproject.database.sqlcipher.SQLiteDatabase.dbopen(Native Method)
at info.guardianproject.database.sqlcipher.SQLiteDatabase.(SQLiteDatabase.java:1870)
at info.guardianproject.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:863)
at info.guardianproject.database.sqlcipher.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:183)

@developernotes
Copy link
Member

Hello Vitaly-Olshevsky,

We have put together a branch that includes our work to support Android 4.0, would you be willing to try it out? If so, you can find the repository below:

https://github.com/developernotes/android-database-sqlcipher/tree/icu46

@inuwan
Copy link

inuwan commented Jan 4, 2012

I used the sqlcipher.jar that was present in the dist folder of the downloaded zip and I still got an exception on android 4.0 opening a readable database.

    java.lang.NullPointerException
    at info.guardianproject.database.sqlcipher.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:329)
    at info.guardianproject.database.sqlcipher.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:279)

The date on the jar is 11/29, are those out of date and I have to create the jars myself?

-----Original Message-----
From: Nick Parker [mailto:[email protected]]
Sent: Friday, December 30, 2011 2:42 PM
To: Mori, Ken
Subject: Re: [android-database-sqlcipher] What about Android 4.0 support? (#34)

Hello Vitaly-Olshevsky,

We have put together a branch that includes our work to support Android 4.0, would you be willing to try it out? If so, you can find the repository below:

https://github.com/developernotes/android-database-sqlcipher/tree/icu46


Reply to this email directly or view it on GitHub:
https://github.com/guardianproject/android-database-sqlcipher/issues/34#issuecomment-3317930

@inuwan
Copy link

inuwan commented Jan 5, 2012

I also build from source and got the following exception calling getReadableDatabase():

01-04 23:54:41.767: ERROR/CMC/DataProvider(451): Exception on getting readable DB
info.guardianproject.database.sqlcipher.SQLiteException: not an error
at info.guardianproject.database.sqlcipher.SQLiteDatabase.dbopen(Native Method)
at info.guardianproject.database.sqlcipher.SQLiteDatabase.(SQLiteDatabase.java:1870)
at info.guardianproject.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:863)
at info.guardianproject.database.sqlcipher.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:183)

01-04 23:54:41.767: ERROR/CMC/DataProvider(451): info.guardianproject.database.sqlcipher.SQLiteDatabase.dbopen(Native Method)
01-04 23:54:41.767: ERROR/CMC/DataProvider(451): info.guardianproject.database.sqlcipher.SQLiteDatabase.(SQLiteDatabase.java:1870)
01-04 23:54:41.777: ERROR/CMC/DataProvider(451): info.guardianproject.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:863)
01-04 23:54:41.777: ERROR/CMC/DataProvider(451): info.guardianproject.database.sqlcipher.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:183)

-----Original Message-----
From: Mori, Ken
Sent: Wednesday, January 04, 2012 1:35 PM
To: 'Nick Parker'
Subject: RE: [android-database-sqlcipher] What about Android 4.0 support? (#34)

I used the sqlcipher.jar that was present in the dist folder of the downloaded zip and I still got an exception on android 4.0 opening a readable database.

    java.lang.NullPointerException
    at info.guardianproject.database.sqlcipher.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:329)
    at info.guardianproject.database.sqlcipher.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:279)

The date on the jar is 11/29, are those out of date and I have to create the jars myself?

-----Original Message-----
From: Nick Parker [mailto:[email protected]]
Sent: Friday, December 30, 2011 2:42 PM
To: Mori, Ken
Subject: Re: [android-database-sqlcipher] What about Android 4.0 support? (#34)

Hello Vitaly-Olshevsky,

We have put together a branch that includes our work to support Android 4.0, would you be willing to try it out? If so, you can find the repository below:

https://github.com/developernotes/android-database-sqlcipher/tree/icu46


Reply to this email directly or view it on GitHub:
https://github.com/guardianproject/android-database-sqlcipher/issues/34#issuecomment-3317930

@developernotes
Copy link
Member

Hello inuwan,

Can you verify you were building the source from the icu46 branch? Also, you will need to package the new icudt46l.zip file located in the assets directory into your applications assets directory instead of the old icudt44l.zip as the localization library needed to be upgraded for Android 4.0. You should be able to get the binaries out of the libs directory once the build is complete.

@Vitaly-Olshevsky
Copy link
Author

Hi,

I've tested improvements for the SQLCipher from the specified repository and it seems to works perfectly on Android 4.0.

Thanks for the fix.

@developernotes
Copy link
Member

Hi Vitaly-Olshevsky,

Thanks for the feedback, glad to hear it is working well for you!

@pavaniakella
Copy link

Hi,
I am facing the same error on google nexus 4.1.1. Can you provide me the updated files.

Regards,
Pavani

@developernotes
Copy link
Member

Hi pavaniakella,

The latest binary can be downloaded here.

@pavaniakella
Copy link

Thank you Nick. it worked for me.

Sent from my iPhone

On 27 Nov 2012, at 19:25, Nick Parker [email protected] wrote:

Hi pavaniakella,

The latest binary can be downloaded here.


Reply to this email directly or view it on GitHub.

@sqlcipher sqlcipher locked and limited conversation to collaborators Feb 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants