My old code is
public static DataBaseManager getInstance(Context context) {
// context = AppContext.getAppContext();
mContext = context;
if (sInstance == null && context != null) {
sInstance = new DataBaseManager(context);
mDataBase = sInstance.getWritableDatabase(masterpassword);
}
return sInstance;
}
But since I have upgrade to
implementation 'net.zetetic:sqlcipher-android:4.5.5@aar'
implementation 'androidx.sqlite:sqlite:2.4.0'
getWritableDatabase doesn’t allow the password parameter.
I have tried adding the password in the oncreate
@Override
public void onCreate(SQLiteDatabase db) {
System.loadLibrary("sqlcipher");
try {
db.execSQL("PRAGMA key = '"+masterpassword+"'");
db.execSQL("CREATE TABLE IF NOT EXISTS..
But this still doesn’t work and if it did work this call is only used when creating the db so I’ve no idea how to set the password when calling queries.
Can someone point me in the right direction, this is a new application and not any sort of update
Thanks