0

I have an app that uses a database that is encrypted with SQLCipher. All worked fine. But now I added some data into the database. Before it was about 1.4 MB now it is about 6 MB. Trying to run the same app with the new database produces the following error:

06-10 17:20:31.819: E/Database(3821): CREATE TABLE android_metadata failed
06-10 17:20:31.889: E/Database(3821): Failed to setLocale() when constructing, closing the database
06-10 17:20:31.889: E/Database(3821): info.guardianproject.database.sqlcipher.SQLiteDatabaseCorruptException: database disk image is malformed
06-10 17:20:31.889: E/Database(3821):   at info.guardianproject.database.sqlcipher.SQLiteDatabase.native_setLocale(Native Method)
06-10 17:20:31.889: E/Database(3821):   at info.guardianproject.database.sqlcipher.SQLiteDatabase.setLocale(SQLiteDatabase.java:2015)
06-10 17:20:31.889: E/Database(3821):   at info.guardianproject.database.sqlcipher.SQLiteDatabase.<init>(SQLiteDatabase.java:1881)
06-10 17:20:31.889: E/Database(3821):   at info.guardianproject.database.sqlcipher.SQLiteDatabase.openDatabase(SQLiteDatabase.java:864)

But like in the old version of the databse the table android_metadata already exists. The only changes are some more fields in the db and more rows in one table.

I would be happy for every hint :-)

AWiget
  • 5
  • 2
  • 1
    Did you supply the password when trying to access the database? – CommonsWare Jun 10 '13 at 17:38
  • Yes I supplied the password. When I have the old DB in the assets directory it works. When I replace it with the new one it doesn't work. I can also see, that the DB is on the target device installed. – AWiget Jun 11 '13 at 04:43

1 Answers1

0

You appear to be using the older version of the SQLCipher for Android library based on the package name in the stack trace. You might consider upgrading to the latest version of the library which is available here. Also, you should attempt to open the database locally on your desktop to verify the file is not corrupt.

Nick Parker
  • 1,378
  • 1
  • 7
  • 10