greenDAO
greenDAO copied to clipboard
When using an encrypted database, onDowngrade is not supported, and the database will crash when it is downgraded
使用加密数据库时,通过getEncryptedWritableDb获取EncryptedHelper,EncryptedHelper不支持onDowngrade,数据库降级时会崩溃
When using an encrypted database, get the EncryptedHelper through getEncryptedWritableDb. EncryptedHelper does not support onDowngrade, and the database will crash when it is downgraded
The greenDAO API is using a rather outdated version of the SQLite and SQLCipher APIs which did not support onDowngrade()
, yet.
A workaround is to write a custom open helper and manually call the relevant DaoMaster
methods.
Then pass whatever Database
got created to DaoMaster(database)
.