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.
What is the correct way to migrate an existing SQLCipher-encrypted Room database from SafeHelperFactory to SupportOpenHelperFactory while preserving the data.
Thanks.