SQLCipher with Room Persistence Library exception in SQLCipherUtils.getDatabaseState
I have a Room database in my Android app, and in my AppClass, I have some logic that checks the database encryption state in order to handle some potential encryption operations that might need to be performed on the database. However, whenever I call SQLCipherUtils.getDatabaseState on an encrypted database, it throws a SQLiteException. But the funny thing is that the state that is returned from getDatabaseState is not null and works perfectly fine, and the try-catch block surrounding the call to getDatabaseState doesn't catch the exception. So the exception doesn't affect the rest of the logic, from what I can tell. However, it is frustrating to see this error show up in the LogCat every single time the app lauches after the database has been encrypted. So my question is, is this error actually indicative of a problem? If so, how can I fix it, and if not, how can I silence the error?
Database Logic in Application class (Exception thrown on first line):
try {
// Get database state
SQLCipherUtils.State state = SQLCipherUtils.getDatabaseState(getApplicationContext(), DB_NAME);
// Check whether database is encrypted
if (state == SQLCipherUtils.State.UNENCRYPTED) {
// If it's unencrypted, encrypt the database
try {
// Get database instance
FinancesDatabase db = FinancesDatabase.getDatabase(getApplicationContext());
// Close database
db.close();
// Encrypt database with encryption key
SQLCipherUtils.encrypt(getApplicationContext(), DB_NAME, sharedPrefs.getEncryptKey());
Timber.i("Successfully encrypted database!");
} catch (IOException e) {
Timber.e(e, "Failed to encrypt previously unencrypted database!");
}
} else if (state == SQLCipherUtils.State.ENCRYPTED)
// Otherwise, good to go
Timber.i("Database is encrypted. No action necessary.");
else if (state == SQLCipherUtils.State.DOES_NOT_EXIST)
// No database found. Normal if first launch
Timber.w("No database found.");
} catch(Exception e) {
Timber.e(e, "Failed to get database encryption state!");
}
Exception:
E/Database: file is not a database: , while compiling: select count(*) from sqlite_master;
net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;
at net.sqlcipher.database.SQLiteCompiledSql.native_compile(Native Method)
at net.sqlcipher.database.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
at net.sqlcipher.database.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
at net.sqlcipher.database.SQLiteProgram.<init>(SQLiteProgram.java:89)
at net.sqlcipher.database.SQLiteQuery.<init>(SQLiteQuery.java:48)
at net.sqlcipher.database.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:60)
at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1867)
at net.sqlcipher.database.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1785)
at net.sqlcipher.database.SQLiteDatabase.keyDatabase(SQLiteDatabase.java:2486)
at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:2415)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1149)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1116)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1065)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1019)
at com.commonsware.cwac.saferoom.SQLCipherUtils.getDatabaseState(SQLCipherUtils.java:62)
at com.commonsware.cwac.saferoom.SQLCipherUtils.getDatabaseState(SQLCipherUtils.java:46)
at edu.usm.cs.csc414.pocketfinances.AppClass.onCreate(AppClass.java:118)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6056)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
SQLCipherUtils.getDatabaseState implementation in library:
public static State getDatabaseState(Context ctxt, String dbName) {
SQLiteDatabase.loadLibs(ctxt);
return(getDatabaseState(ctxt.getDatabasePath(dbName)));
}
public static State getDatabaseState(File dbPath) {
if (dbPath.exists()) {
SQLiteDatabase db=null;
try {
db=
SQLiteDatabase.openDatabase(dbPath.getAbsolutePath(), "",
null, SQLiteDatabase.OPEN_READONLY);
db.getVersion();
return(State.UNENCRYPTED);
}
catch (Exception e) {
return(State.ENCRYPTED);
}
finally {
if (db != null) {
db.close();
}
}
}
return(State.DOES_NOT_EXIST);
}
android sqlcipher commonsware-cwac
add a comment |
I have a Room database in my Android app, and in my AppClass, I have some logic that checks the database encryption state in order to handle some potential encryption operations that might need to be performed on the database. However, whenever I call SQLCipherUtils.getDatabaseState on an encrypted database, it throws a SQLiteException. But the funny thing is that the state that is returned from getDatabaseState is not null and works perfectly fine, and the try-catch block surrounding the call to getDatabaseState doesn't catch the exception. So the exception doesn't affect the rest of the logic, from what I can tell. However, it is frustrating to see this error show up in the LogCat every single time the app lauches after the database has been encrypted. So my question is, is this error actually indicative of a problem? If so, how can I fix it, and if not, how can I silence the error?
Database Logic in Application class (Exception thrown on first line):
try {
// Get database state
SQLCipherUtils.State state = SQLCipherUtils.getDatabaseState(getApplicationContext(), DB_NAME);
// Check whether database is encrypted
if (state == SQLCipherUtils.State.UNENCRYPTED) {
// If it's unencrypted, encrypt the database
try {
// Get database instance
FinancesDatabase db = FinancesDatabase.getDatabase(getApplicationContext());
// Close database
db.close();
// Encrypt database with encryption key
SQLCipherUtils.encrypt(getApplicationContext(), DB_NAME, sharedPrefs.getEncryptKey());
Timber.i("Successfully encrypted database!");
} catch (IOException e) {
Timber.e(e, "Failed to encrypt previously unencrypted database!");
}
} else if (state == SQLCipherUtils.State.ENCRYPTED)
// Otherwise, good to go
Timber.i("Database is encrypted. No action necessary.");
else if (state == SQLCipherUtils.State.DOES_NOT_EXIST)
// No database found. Normal if first launch
Timber.w("No database found.");
} catch(Exception e) {
Timber.e(e, "Failed to get database encryption state!");
}
Exception:
E/Database: file is not a database: , while compiling: select count(*) from sqlite_master;
net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;
at net.sqlcipher.database.SQLiteCompiledSql.native_compile(Native Method)
at net.sqlcipher.database.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
at net.sqlcipher.database.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
at net.sqlcipher.database.SQLiteProgram.<init>(SQLiteProgram.java:89)
at net.sqlcipher.database.SQLiteQuery.<init>(SQLiteQuery.java:48)
at net.sqlcipher.database.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:60)
at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1867)
at net.sqlcipher.database.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1785)
at net.sqlcipher.database.SQLiteDatabase.keyDatabase(SQLiteDatabase.java:2486)
at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:2415)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1149)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1116)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1065)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1019)
at com.commonsware.cwac.saferoom.SQLCipherUtils.getDatabaseState(SQLCipherUtils.java:62)
at com.commonsware.cwac.saferoom.SQLCipherUtils.getDatabaseState(SQLCipherUtils.java:46)
at edu.usm.cs.csc414.pocketfinances.AppClass.onCreate(AppClass.java:118)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6056)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
SQLCipherUtils.getDatabaseState implementation in library:
public static State getDatabaseState(Context ctxt, String dbName) {
SQLiteDatabase.loadLibs(ctxt);
return(getDatabaseState(ctxt.getDatabasePath(dbName)));
}
public static State getDatabaseState(File dbPath) {
if (dbPath.exists()) {
SQLiteDatabase db=null;
try {
db=
SQLiteDatabase.openDatabase(dbPath.getAbsolutePath(), "",
null, SQLiteDatabase.OPEN_READONLY);
db.getVersion();
return(State.UNENCRYPTED);
}
catch (Exception e) {
return(State.ENCRYPTED);
}
finally {
if (db != null) {
db.close();
}
}
}
return(State.DOES_NOT_EXIST);
}
android sqlcipher commonsware-cwac
add a comment |
I have a Room database in my Android app, and in my AppClass, I have some logic that checks the database encryption state in order to handle some potential encryption operations that might need to be performed on the database. However, whenever I call SQLCipherUtils.getDatabaseState on an encrypted database, it throws a SQLiteException. But the funny thing is that the state that is returned from getDatabaseState is not null and works perfectly fine, and the try-catch block surrounding the call to getDatabaseState doesn't catch the exception. So the exception doesn't affect the rest of the logic, from what I can tell. However, it is frustrating to see this error show up in the LogCat every single time the app lauches after the database has been encrypted. So my question is, is this error actually indicative of a problem? If so, how can I fix it, and if not, how can I silence the error?
Database Logic in Application class (Exception thrown on first line):
try {
// Get database state
SQLCipherUtils.State state = SQLCipherUtils.getDatabaseState(getApplicationContext(), DB_NAME);
// Check whether database is encrypted
if (state == SQLCipherUtils.State.UNENCRYPTED) {
// If it's unencrypted, encrypt the database
try {
// Get database instance
FinancesDatabase db = FinancesDatabase.getDatabase(getApplicationContext());
// Close database
db.close();
// Encrypt database with encryption key
SQLCipherUtils.encrypt(getApplicationContext(), DB_NAME, sharedPrefs.getEncryptKey());
Timber.i("Successfully encrypted database!");
} catch (IOException e) {
Timber.e(e, "Failed to encrypt previously unencrypted database!");
}
} else if (state == SQLCipherUtils.State.ENCRYPTED)
// Otherwise, good to go
Timber.i("Database is encrypted. No action necessary.");
else if (state == SQLCipherUtils.State.DOES_NOT_EXIST)
// No database found. Normal if first launch
Timber.w("No database found.");
} catch(Exception e) {
Timber.e(e, "Failed to get database encryption state!");
}
Exception:
E/Database: file is not a database: , while compiling: select count(*) from sqlite_master;
net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;
at net.sqlcipher.database.SQLiteCompiledSql.native_compile(Native Method)
at net.sqlcipher.database.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
at net.sqlcipher.database.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
at net.sqlcipher.database.SQLiteProgram.<init>(SQLiteProgram.java:89)
at net.sqlcipher.database.SQLiteQuery.<init>(SQLiteQuery.java:48)
at net.sqlcipher.database.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:60)
at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1867)
at net.sqlcipher.database.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1785)
at net.sqlcipher.database.SQLiteDatabase.keyDatabase(SQLiteDatabase.java:2486)
at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:2415)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1149)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1116)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1065)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1019)
at com.commonsware.cwac.saferoom.SQLCipherUtils.getDatabaseState(SQLCipherUtils.java:62)
at com.commonsware.cwac.saferoom.SQLCipherUtils.getDatabaseState(SQLCipherUtils.java:46)
at edu.usm.cs.csc414.pocketfinances.AppClass.onCreate(AppClass.java:118)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6056)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
SQLCipherUtils.getDatabaseState implementation in library:
public static State getDatabaseState(Context ctxt, String dbName) {
SQLiteDatabase.loadLibs(ctxt);
return(getDatabaseState(ctxt.getDatabasePath(dbName)));
}
public static State getDatabaseState(File dbPath) {
if (dbPath.exists()) {
SQLiteDatabase db=null;
try {
db=
SQLiteDatabase.openDatabase(dbPath.getAbsolutePath(), "",
null, SQLiteDatabase.OPEN_READONLY);
db.getVersion();
return(State.UNENCRYPTED);
}
catch (Exception e) {
return(State.ENCRYPTED);
}
finally {
if (db != null) {
db.close();
}
}
}
return(State.DOES_NOT_EXIST);
}
android sqlcipher commonsware-cwac
I have a Room database in my Android app, and in my AppClass, I have some logic that checks the database encryption state in order to handle some potential encryption operations that might need to be performed on the database. However, whenever I call SQLCipherUtils.getDatabaseState on an encrypted database, it throws a SQLiteException. But the funny thing is that the state that is returned from getDatabaseState is not null and works perfectly fine, and the try-catch block surrounding the call to getDatabaseState doesn't catch the exception. So the exception doesn't affect the rest of the logic, from what I can tell. However, it is frustrating to see this error show up in the LogCat every single time the app lauches after the database has been encrypted. So my question is, is this error actually indicative of a problem? If so, how can I fix it, and if not, how can I silence the error?
Database Logic in Application class (Exception thrown on first line):
try {
// Get database state
SQLCipherUtils.State state = SQLCipherUtils.getDatabaseState(getApplicationContext(), DB_NAME);
// Check whether database is encrypted
if (state == SQLCipherUtils.State.UNENCRYPTED) {
// If it's unencrypted, encrypt the database
try {
// Get database instance
FinancesDatabase db = FinancesDatabase.getDatabase(getApplicationContext());
// Close database
db.close();
// Encrypt database with encryption key
SQLCipherUtils.encrypt(getApplicationContext(), DB_NAME, sharedPrefs.getEncryptKey());
Timber.i("Successfully encrypted database!");
} catch (IOException e) {
Timber.e(e, "Failed to encrypt previously unencrypted database!");
}
} else if (state == SQLCipherUtils.State.ENCRYPTED)
// Otherwise, good to go
Timber.i("Database is encrypted. No action necessary.");
else if (state == SQLCipherUtils.State.DOES_NOT_EXIST)
// No database found. Normal if first launch
Timber.w("No database found.");
} catch(Exception e) {
Timber.e(e, "Failed to get database encryption state!");
}
Exception:
E/Database: file is not a database: , while compiling: select count(*) from sqlite_master;
net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master;
at net.sqlcipher.database.SQLiteCompiledSql.native_compile(Native Method)
at net.sqlcipher.database.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:91)
at net.sqlcipher.database.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:64)
at net.sqlcipher.database.SQLiteProgram.<init>(SQLiteProgram.java:89)
at net.sqlcipher.database.SQLiteQuery.<init>(SQLiteQuery.java:48)
at net.sqlcipher.database.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:60)
at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1867)
at net.sqlcipher.database.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1785)
at net.sqlcipher.database.SQLiteDatabase.keyDatabase(SQLiteDatabase.java:2486)
at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:2415)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1149)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1116)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1065)
at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1019)
at com.commonsware.cwac.saferoom.SQLCipherUtils.getDatabaseState(SQLCipherUtils.java:62)
at com.commonsware.cwac.saferoom.SQLCipherUtils.getDatabaseState(SQLCipherUtils.java:46)
at edu.usm.cs.csc414.pocketfinances.AppClass.onCreate(AppClass.java:118)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1125)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6056)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1764)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6938)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
SQLCipherUtils.getDatabaseState implementation in library:
public static State getDatabaseState(Context ctxt, String dbName) {
SQLiteDatabase.loadLibs(ctxt);
return(getDatabaseState(ctxt.getDatabasePath(dbName)));
}
public static State getDatabaseState(File dbPath) {
if (dbPath.exists()) {
SQLiteDatabase db=null;
try {
db=
SQLiteDatabase.openDatabase(dbPath.getAbsolutePath(), "",
null, SQLiteDatabase.OPEN_READONLY);
db.getVersion();
return(State.UNENCRYPTED);
}
catch (Exception e) {
return(State.ENCRYPTED);
}
finally {
if (db != null) {
db.close();
}
}
}
return(State.DOES_NOT_EXIST);
}
android sqlcipher commonsware-cwac
android sqlcipher commonsware-cwac
edited Nov 23 '18 at 20:52
CommonsWare
767k13818721922
767k13818721922
asked Nov 23 '18 at 20:39
Andrew FinkAndrew Fink
228
228
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
That is being logged directly by SQLCipher for Android. It will be logged any time an invalid passphrase is used. getDatabaseState()
tries opening the database with the empty string as a passphrase, as that is the "passphrase" for an unencrypted database.
Your options to avoid this log message are:
Don't use SQLCipher for Android, or
Don't use
getDatabaseState()
, plus ensure that the user never provides an invalid passphrase
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452700%2fsqlcipher-with-room-persistence-library-exception-in-sqlcipherutils-getdatabases%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
That is being logged directly by SQLCipher for Android. It will be logged any time an invalid passphrase is used. getDatabaseState()
tries opening the database with the empty string as a passphrase, as that is the "passphrase" for an unencrypted database.
Your options to avoid this log message are:
Don't use SQLCipher for Android, or
Don't use
getDatabaseState()
, plus ensure that the user never provides an invalid passphrase
add a comment |
That is being logged directly by SQLCipher for Android. It will be logged any time an invalid passphrase is used. getDatabaseState()
tries opening the database with the empty string as a passphrase, as that is the "passphrase" for an unencrypted database.
Your options to avoid this log message are:
Don't use SQLCipher for Android, or
Don't use
getDatabaseState()
, plus ensure that the user never provides an invalid passphrase
add a comment |
That is being logged directly by SQLCipher for Android. It will be logged any time an invalid passphrase is used. getDatabaseState()
tries opening the database with the empty string as a passphrase, as that is the "passphrase" for an unencrypted database.
Your options to avoid this log message are:
Don't use SQLCipher for Android, or
Don't use
getDatabaseState()
, plus ensure that the user never provides an invalid passphrase
That is being logged directly by SQLCipher for Android. It will be logged any time an invalid passphrase is used. getDatabaseState()
tries opening the database with the empty string as a passphrase, as that is the "passphrase" for an unencrypted database.
Your options to avoid this log message are:
Don't use SQLCipher for Android, or
Don't use
getDatabaseState()
, plus ensure that the user never provides an invalid passphrase
answered Nov 23 '18 at 20:59
CommonsWareCommonsWare
767k13818721922
767k13818721922
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53452700%2fsqlcipher-with-room-persistence-library-exception-in-sqlcipherutils-getdatabases%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown