sqlcipher / sqlcipher-android

SQLCipher for Android provides an interface to SQLCipher databases on the Android platform.
Other
110 stars 20 forks source link

[Question] Are migrations automatically applied to encrypted database? #37

Closed agustinsivoplas closed 4 months ago

agustinsivoplas commented 4 months ago

We have a current database in production that we want to encrypt in the next version.

Checking some examples looks like we need to call the encrypt database method and add the SupportOpenHelperFactory to the room database.

1- I saw this example https://github.com/commonsguy/cwac-saferoom/blob/master/saferoom/src/main/java/com/commonsware/cwac/saferoom/SQLCipherUtils.java (it is an old code) to encrypt the database based in current state. This is still needed? Or will be automatically encrypted the first time?

2 - If we need to add migrations, the migrations will be applied automatically by the SupportOpenHelperFactory or we need to:

Sorry to post here but I am not able to found a reasonable answer in the web.

I saw this two post but are confusing about encrypt and migrations.

https://medium.com/@khambhaytajaydip/encrypting-an-existing-room-database-with-sqlcipher-in-android-50cdc98fe6c

https://medium.com/@munbonecci/how-to-encrypt-room-db-using-sqlcipher-7138ba5f0d75

Thanks in advance and sorry again to ask here

developernotes commented 4 months ago

Hello @agustinsivoplas,

Thanks for your interest in SQLCipher. We reserve GitHub Issues for tracking defects within the software library itself. This particular question should be posted to the SQLCipher Community Discuss site, please consider reposting there instead. Thanks!