Hi,
I am using SQLCipher for database encryption in using SQLCipher. I am used to get exceptions in call to getWritableDatabase(). This issue happens very randomly, but easily reproducible in any android device if we try 5-10 times. The issue starts appearing after I changed the key generation method. I am using Android Key Store for generating the password as android dev guide. Before using new Android Keystore mechanism, I was using Java KeyGenerator, which does not lead the exception. Below is the stack trace:
E/AndroidRuntime(16077): net.sqlcipher.database.SQLiteException: file is encrypted or is not a database: create locale table failed
E/AndroidRuntime(16077): at net.sqlcipher.database.SQLiteDatabase.native_setLocale(Native Method)
E/AndroidRuntime(16077): at net.sqlcipher.database.SQLiteDatabase.setLocale(SQLiteDatabase.java:2475)
E/AndroidRuntime(16077): at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:2339)
E/AndroidRuntime(16077): at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1087)
E/AndroidRuntime(16077): at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1150)
E/AndroidRuntime(16077): at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:162)
I tried putting logs in JNI files to check if passwork generated / sent to SQLCipher correctly, which seems absolutely fine. Can anyone please suggest something on it.
Thanks