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
Your test case for sqlcipher_export() uses SQLiteDatabase directly. However, when I try using it in conjunction with your SQLiteOpenHelper, I run into some issues. Specifically, the metadata that Android stores for version info does not seem to make it over to the encrypted database. As a result, when I turn around and try to use the encrypted database with SQLiteOpenHelper, Android tries upgrading the database from version 0 to 1, running through the SQLiteOpenHelperonCreate() logic again, which should not be necessary.
Here is the encrypt-my-unencrypted-database method that I am using:
The user_version PRAGMA is explicitly excluded from the sqlcipher_export convenience function. There certain instances where migrating the current user_version is not preferable. The sqlcipher_export function does not require that the attached database be empty, thus you could legitimately have an existing user_version that you are migrating into and do not want to change.
In cases where you do want to carry over the user_version, you can do this manually by capturing the value with getVersion(), setting it after your migration with setVersion(...).
Your test case for
sqlcipher_export()
usesSQLiteDatabase
directly. However, when I try using it in conjunction with yourSQLiteOpenHelper
, I run into some issues. Specifically, the metadata that Android stores for version info does not seem to make it over to the encrypted database. As a result, when I turn around and try to use the encrypted database withSQLiteOpenHelper
, Android tries upgrading the database from version 0 to 1, running through theSQLiteOpenHelper
onCreate()
logic again, which should not be necessary.Here is the encrypt-my-unencrypted-database method that I am using:
Thoughts?
Thanks!
The text was updated successfully, but these errors were encountered: