I started using sqlCipher for Android (ver) 2.1.1 on Android 4.0.3 and it works like charm. Thanks for that. However I found that the SQLiteOpenHelper class does not have the constructor that takes the custom Error handler. This is very much there in the original SQLiteOpenHelper class provided in android.database and it is very useful to handle the errors in an app specific manner. Does anyone know how to incorporate a custom error handler when using sqlCipher?
Constructors available in android.database.sqlite
public SQLiteOpenHelper (Context context, String name, SQLiteDatabase.CursorFactory factory, int version);
public SQLiteOpenHelper (Context context, String name, SQLiteDatabase.CursorFactory factory, int version, DatabaseErrorHandler errorHandler);
Constructors available in net.sqlcipher.database
public SQLiteOpenHelper(Context context, String name, SQLiteDatabase.CursorFactory factory, int version); In specific, when encountered with certain types of errors the default error handler (when using sqlcipher) is removing the database, albeit after providing a Log.e message. But I need to avoid it. Any help is appreciated.
Chris,
SQLiteDirectCursorDriver.java implements SQLiteCursorDriver. hence the implemented functions come with @Override preceeding them. This is not allowed in Android 4.0.3 and 4.1. So I had to remove the @Override line for each of those 2-3 functions.
3.Major Issue (at least to me): The size of libstlport_shared.so has increased significantly (from 582KB in 2.1.1 to 1.15MB now. This threq my project out of memory and I retained the old SO files from 2.1.1 hoping there wouldn't be any serious changes that would affect the operation and Java code in the project. Things seem to work. Please advice if this is incorrect. A little bit of explanation is appreciated. you can assume a good knowledge of native (jni) and Java/Android in your explanation.
4. Major Issue: Demo project did not work. It failed at SQLiteOpenHelper.getWritableDatabase() saying null pointer exception. It looks like the db that is created is null, probably because the password is incorrect. Once it also gave classDefNotFound error for Maps.newHashmap(). Please look at it.
Overall I would say it is working. Thanks again for the quick fix. Can you please get back on #3 above?