Skip to content

Commit

Permalink
Pass DB password for encrypted DB only
Browse files Browse the repository at this point in the history
  • Loading branch information
prattpratt committed Dec 3, 2024
1 parent a25949a commit 8be5a8b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import android.content.res.AssetManager;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Pair;

import androidx.sqlite.db.SupportSQLiteDatabase;

Expand Down Expand Up @@ -306,7 +305,11 @@ private String getTableListResponse(String route) {
mSelectedDatabase = Constants.APP_SHARED_PREFERENCES;
} else {
try {
openDatabase(database, password);
if (Utils.isDbEncrypted(database, mDatabaseFiles)) {
openDatabase(database, password);
} else {
openDatabase(database, null);
}
response = DatabaseHelper.getAllTableName(sqLiteDB);
} catch (Exception e) {
response = new Response();
Expand Down

0 comments on commit 8be5a8b

Please sign in to comment.