Closed
Description
In my android app, I need to give user an option to create an encrypted or non-encrypted database; The database will be saved in device sdcard.
For the non-encrypted db I'm using :-
db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + DB_NAME, "", null);
but when I open the db through command line,it gives error: file is encrypted or is not a database. So the above code line always creates encrypted database.
My code is below:
if(db == null){
try{
SQLiteDatabase.loadLibs(context);
String encryptStr = "";
if(new File(DB_PATH + DB_NAME).exists()){
db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + DB_NAME, encryptStr, null);
}else{
db = SQLiteDatabase.openOrCreateDatabase(DB_PATH + DB_NAME, encryptStr, null);
executeSchema(context);
}
db.setVersion(1);
db.setLocale(Locale.getDefault());
db.setLockingEnabled(true);
}catch(Exception e){
db = null;
AlertHelper.logError(e);
}
}
Any way to create non-encrypted database using sqlcipher in android?.
Metadata
Metadata
Assignees
Labels
No labels