Hello
I am migrating from net.zetetic:android-database-sqlcipher:3.5.9 to net.zetetic:sqlcipher-android:4.5.5
My implementation looks like below.
private DatabaseHelper(Context context) {
super(context, DBNAME, null, VERSION);
this.context = context;
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(CREATE_PERFORMANCE);
db.execSQL(CREATE_TICKET);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
Log.w(Constants.tag, "Upgrading database from version " + oldVersion + " to " + newVersion
+ ", which will destroy all old data");
db.execSQL("DROP TABLE IF EXISTS ticket"); //
db.execSQL("DROP TABLE IF EXISTS performance"); //
onCreate(db);
}
public DatabaseHelper open() throws SQLException {
System.loadLibrary("sqlcipher");
database = this.getWritableDatabase();
return this;
}
public SQLiteDatabase getDatabase() {
if(database == null){
System.loadLibrary("sqlcipher");
database = getWritableDatabase();
}
return database;
}
I made changes after referring SQLCipher for Android Migration - How to Convert Applications from android-database-sqlcipher to sqlcipher-android | Zetetic
but when getWritableDatabase() gets called , crashing with below message
Caused by: android.database.sqlite.SQLiteException: file is not a database (code 26): , while compiling: PRAGMA journal_mode
please help on this, I am stuck since few days.