哪里Android商店的SQLite的数据库版本?商店、版本、数据库、Android

2023-09-12 08:40:38 作者:心弦已被触动

我无法寻找到的Andr​​oid商店的数据库版本中的SQLite数据库文件。到底是哪里的数据库版本的信息存储在哪里?

I am unable to find where Android stores the database version in the SQLite db file. Where exactly is the database version info stored?

推荐答案

您可以使用阅读版本 android.database.sqlite.SQLiteDatabase.getVersion()

在内部,这个方法执行SQL语句 PRAGMA user_version 。我从Android来源$ C ​​$ C 。

Internally, this method executes the SQL statement "PRAGMA user_version". I got that from the Android source code.

在数据库文件,该版本被存储在字节偏移60 ,在该领域用户cookie。

In the database file, the version is stored at byte offset 60 in the database header of the database file, in the field 'user cookie'.