Hi,
I am not able to integrate SQLCipher to my Android app.
App is throwing -
net.sqlcipher.database.SQLiteException: error code 14: Could not open database
Here is the code snippet
private static SQLiteDatabaseHook keyHook = new SQLiteDatabaseHook() {
@Override
public void preKey(SQLiteDatabase database) {
database.rawExecSQL(“PRAGMA cipher_license = '” + SQL_CIPHER_LICENSE + “’;”);
}
public void postKey(SQLiteDatabase database) {
}
};
public static void initializeSQLCipher(Context context) {
SQLiteDatabase.loadLibs(context);
File databaseFile = new File(getDatabasePath());
databaseFile.mkdirs();
databaseFile.delete();
SQLiteDatabase database = SQLiteDatabase.openOrCreateDatabase(databaseFile, PWD, null, keyHook);
}
References -
https://www.zetetic.net/sqlcipher/sqlcipher-for-android/