Sqlcipher数据库加密框架是一个比较流行的Sqlite数据库加密框架,微信的WCDB数据库也是使用的此框架。由于历史原因,项目使用的Sqlcipher框架是3.0.x的版本,具体哪个版本都无从查找,因为是使用的源码。最近由于业务需要,项目要加入androidx的支持,发现Sqlcipher的3.0版本只能支持23以下目标版本的编译支持,于是升级Sqlcipher版本至4.0以上。于是……问题来了,升级后发现原有的数据库无法打开,无法打开。于是开始重新梳理Sqlcipher数据库框架。
一、查看Sqlcipher的GitHub上关于版本兼容性的说 https://github.com/sqlcipher/sqlcipher
Compatibility
SQLCipher maintains database format compatibility within the same major version number so an application on any platform can open databases created by any other application provided the major version of SQLCipher is the same between them. However, major version updates (e.g. from 3.x to 4.x) often include changes to default settings. This means that newer major versions of SQLCipher will not open databases created by older versions without using special settings. For example, SQLCipher 4 introduces many new performan