Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. private fun createDbFlowConfig(cipherSecret: String, context: Context): FlowConfig? {
  2. return try {
  3. FlowConfig.Builder(context)
  4. .database(
  5. DatabaseConfig.Builder(AppDatabase::class)
  6. { db, callback -> SQLCipherHelper(context, db, callback, cipherSecret) }
  7. .databaseName("AppDatabase") // This will load 'AppDatabase.db' located in your assets folder
  8. .build())
  9. .openDatabasesOnInit(true)
  10. .build()
  11. }
  12. catch (e: Exception) {
  13. Timber.e("Encrypted AppDatabase config could not be created using key $cipherSecret ")
  14. Timber.e(e)
  15. null
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement