PDA

View Full Version : App using sqlcipher on Android crashes at start up.



faizol
27th November 2016, 21:53
Hi,

I've been using sqlcipher on Linux desktop with no problem so far, and trying to port my applications to Android. However the application crashes at start up. I've bundled the binary libsqlcipher.so compiled from https://github.com/sqlcipher/android-database-sqlcipher with the Qt app.

According to the Readme.md on the github;


We’ve packaged up a very simple SDK for any Android developer to add SQLCipher into their app with the following three steps:


Add a single sqlcipher.jar and a few .so’s to the application libs directory
Update the import path from android.database.sqlite.* to net.sqlcipher.database.* in any source files that reference it. The original android.database.Cursor can still be used unchanged.
Init the database in onCreate() and pass a variable argument to the open database method with a password:


SQLiteDatabase.loadLibs(this); //first init the db libraries with the context
SQLiteOpenHelper.getWritableDatabase("thisismysecret"):

Is there something that I have missed in deploying sqlcipher bundled with Qt application on Android platform?

Thanks.

faizol
29th November 2016, 18:19
Turns out that it's the latest sqlcipher from the git that causes the problem.

Thanks