Test an Android program that reads an sqlite database mydb. After I perform the following operations, the getWritableDatabase method of SQLiteOpenHelper has an exception.
1. backed up this database in adb shell: mv mydb mydb_bak
2. Restore the database again: mv mydb_bak mydb
3. Run the program and the above error occurs.
Use a program to generate an available database. The following differences exist between the available database and the database backed up:
Ls-l
Available databases:
-Rw ---- app_48 app_48 37888 mydb
Databases backed up:
-Rw ---- root 37888 2010-11-20 20:34 mydb
The problem is clear at a glance. The permission has not changed, and the group to which the permission belongs has changed. The program does not have the root permission. Of course, mydb that has been backed up cannot be opened.
Modify file permission: chown app_48.app_48 mydb
Solve the problem.