storesafe / cordova-sqlcipher-adapter

A Cordova/PhoneGap plugin to create and access encrypted databases on Android, iOS, and Windows with API similar to HTML5/Web SQL API
Other
89 stars 55 forks source link

Cipher Migrate feature for iOS and Android #113

Open jlorente opened 3 years ago

jlorente commented 3 years ago

This PR includes a new feature for those who want to upgrade from an old version of the plugin to a newer one without making its users uninstall and reinstall the application.

The feature is activated by adding a cipherMigrate param "true" when calling window.sqlitePlugin.openDatabase. It only executes the "PRAGMA cipher_migrate" sentence if the cipherMigrate param is true and there is some error when opening the database.

It has been tested successfully on iOS and Android by upgrading apps from plugin version 0.1.12-rc3 to plugin version 0.5.4.

I have not updated the docs yet, because I thought that maybe this needs some discussion, but I will do if there is no problem with the feature.

bhandaribhuminpfizer commented 2 months ago

Are you going to merge this? Because of this issue we have to fork the code and update it. I see it's not in the new version either.