I would like to use OrmLite with SQLCipher in my Android project, but both libraries have their own abstract SQLiteOpenHelper
class to implement. Java don\'t a
I have distilled the answer by Rejinderi into a patch for ORMLite 4.43 and compiled it into a JAR file. To integrate it in your Android project, do the following:
libs/ormlite-android.jar
with ormlite-android-sqlcipher.jarHowever, you should not trust me to provide an unmanipulated JAR file and follow the build instructions in the patch instead.
EDIT: With the patched library, the calls to getReadableDatabase()
, getWritableDatabase()
and the OrmLiteSqliteOpenHelper
constructor need to be passed the password as additional parameter. If you are using a DB helper, extend it appropriately to pass the password to OrmLiteSqliteOpenHelper.