4

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?

4

1 回答 1

1

有一个 github存储库https://github.com/hannesa2/SafeRoom,基于来自https://issuetracker.google.com/issues/38481640的附加 zip,它将 SQLCipher 应用于 Room

于 2017-06-01T21:03:34.443 回答