You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m migrating from SQLCipher’s legacy SafeHelperFactory to SupportOpenHelperFactory in the new net.zetetic:sqlcipher-android library
Previously, I used:
val phrase: CharArray = password.toCharArray()
factory = SafeHelperFactory(phrase, SafeHelperFactory.POST_KEY_SQL_MIGRATE)
Now I changed it to:
val phrase: ByteArray = password.toByteArray(Charsets.UTF_8)
factory = SupportOpenHelperFactory(phrase)
But I can no longer open the database encrypted with the previous SafeHelperFactory. It throws a net.sqlcipher.database.SQLiteException: file is not a database.
The password is the same
The database file is preserved
Migration fails silently or throws an error
What is the correct way to migrate an existing SQLCipher-encrypted Room database from SafeHelperFactory to SupportOpenHelperFactory while preserving the data.