ormlite-android icon indicating copy to clipboard operation
ormlite-android copied to clipboard

Android 8. Database and device protected storage

Open nikedlab opened this issue 6 years ago • 0 comments

It is unable to use database when device just booted and not unlocked yet. I got error

SQLiteCantOpenDatabaseException: unknown error (code 14 SQLITE_CANTOPEN): Could not open database

I know it is issue of Credential Encrypted Storage, and when I try to get OrmLiteSqliteOpenHelper with DeviceProtectedStorageContext I still got same error

There is my code, may be I doing something wrong?

Context safeContext = ContextCompat.createDeviceProtectedStorageContext(appContext);
if (safeContext == null) {
    safeContext = appContext;
}
databaseHelper = OpenHelperManager.getHelper(safeContext, DatabaseHelper.class);

Thank you

nikedlab avatar Sep 12 '18 08:09 nikedlab