Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 8. Database and device protected storage #104

Open
nikedlab opened this issue Sep 12, 2018 · 0 comments
Open

Android 8. Database and device protected storage #104

nikedlab opened this issue Sep 12, 2018 · 0 comments

Comments

@nikedlab
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant