问题
I need to use a custom build of SQLite (based on sqlite.org version https://sqlite.org/android/doc/trunk/www/index.wiki) so that I can use custom FTS Tokenizers and to use SEE to encrypt my databases.
I'm using the following code to create a Room database:
val mainDb = Room.databaseBuilder(context, MainDatabase::class.java, "main")
.openHelperFactory(SqliteOrgSQLiteOpenHelperFactory())
.build()
I tried to implement my own "SupportSQLiteOpenHelper.Factory" (SqliteOrgSQLiteOpenHelperFactory) and tried to implement all of the needed classes, but there are too many direct dependencies to "android.database." and "android.database.sqlite.". All of these dependencies seem to need to be wrapped in "SupportXXX" classes
Example: SupportSQLiteOpenHelper.Configuration depends on:
- android.database.DatabaseErrorHandler
- android.database.DefaultDatabaseErrorHandler
- android.database.sqlite.SQLiteDatabase.CursorFactory
SupportSQLiteDatabase depends on:
- android.database.sqlite.SQLiteTransactionListener
- android.database.sqlite.SQLiteDatabase.CursorFactory
Am I missing something? Am I approaching this all wrong?
回答1:
There is a github repo https://github.com/hannesa2/SafeRoom , based on attached zip from https://issuetracker.google.com/issues/38481640 which apply SQLCipher to Room
来源:https://stackoverflow.com/questions/44097662/android-room-orm-support-custom-build-of-sqlite