I am transitioning my app to use SQLCipher through the 'appcelerator.encrypteddatabase' module.
Existing devices will have an unencrypted SQLite database which the app will need to do a sqlcipher_export() on.
See documentation here https://www.zetetic.net/sqlcipher/sqlcipher-api/#sqlcipher_export
I am now able to get the ATTACH command to work. But I cannot use the database for anything afterwards. It is as though the encrypteddatabase module is holding on to a reference to the DB.
See my attached app.js example.
1.You can click the first button as many times as you like to create and add data to an unencrypted DB.
2. This will create an encrypted DB, attach it, export it.
3. This will now cause an exception
4. Restart the app
5. Button 3 now works perfectly.
I have tried everything I can think of to get around this, and there's nothing in the SQLCipher documentation that I appear to be doing wrong.
Thanks for your help!. app.js