无法使用SQLCipher打开加密数据库

时间:2015-10-05 10:24:05

标签: android sql encryption sqlcipher

我使用SQLiteManager创建encrypted database并将其存储在assets文件夹中。然后,我将此databaseassets移动到data/data/package_name/databases文件夹,并尝试在运行时打开它。 已使用原始密码在SQLiteManager中成功打开复制的文件,这意味着我有正确的复制代码(使用DDMS导出文件,然后在SQLiteManager中打开它)。 但是,在程序中,我使用

dbFile = context.getDatabasePath(DataProvider.DATABASE_NAME);

SQLiteDatabase.openOrCreateDatabase(dbFile, context.getString(R.string.KEY_DATABASE), null);

打开文件,但应用程序崩溃并出现此错误:

file is encrypted or is not a database: create locale table failed

openOrCreateDatabase行。我该如何解决这个烂摊子?

0 个答案:

没有答案
相关问题