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

IOS on app update to a major version with same key failing to open database #110

Open itismelito opened 3 years ago

itismelito commented 3 years ago

I have an IOS app version 3.0.0 ionic 3 that uses this plugin and is using the encryption method with a password, it works fine and it does what it says but the problem happens when i update the app to a new version 3.1.0 ionic 5 database wont open with same password.

This issue happens only on IOS and only on app upgrade. Android works fine.

I have checked the path of the database which shows the same so the plugin is pointing to the same database as previous version.

This is the code i am using to access database:

{ name: "myDatabase.db", key: '123456', location: "default" }

Same code is used with new app update.

This is the messaging that logs out:

Open DB with encryption ERROR reading sqlite master table OPEN database: myDatabase.db FAILED, aborting any pending transactions Could not open database

This has really blocked me pushing new app updates.

Please can anyone comment what could be the cause of this issue? Have you ever had this issue and how you solve it?

Thank you in advance.