Remove unused Context from DatabaseHelper
This commit is contained in:
parent
69910ebc15
commit
5fb3666dfd
2 changed files with 5 additions and 5 deletions
|
@ -439,7 +439,7 @@ public class BackupActivity extends BaseActivity {
|
|||
SecretKey key = EncryptionHelper.generateSymmetricKeyFromPassword(password);
|
||||
byte[] decrypted = EncryptionHelper.decrypt(key, encrypted);
|
||||
|
||||
ArrayList<Entry> entries = DatabaseHelper.stringToEntries(this, new String(decrypted, StandardCharsets.UTF_8));
|
||||
ArrayList<Entry> entries = DatabaseHelper.stringToEntries(new String(decrypted, StandardCharsets.UTF_8));
|
||||
|
||||
if (! replace.isChecked()) {
|
||||
ArrayList<Entry> currentEntries = DatabaseHelper.loadDatabase(this);
|
||||
|
@ -508,7 +508,7 @@ public class BackupActivity extends BaseActivity {
|
|||
|
||||
private void doRestoreEncrypted(String content) {
|
||||
if (Tools.isExternalStorageReadable()) {
|
||||
ArrayList<Entry> entries = DatabaseHelper.stringToEntries(this, content);
|
||||
ArrayList<Entry> entries = DatabaseHelper.stringToEntries(content);
|
||||
|
||||
if (entries.size() > 0) {
|
||||
if (! replace.isChecked()) {
|
||||
|
|
|
@ -65,7 +65,7 @@ public class DatabaseHelper {
|
|||
SecretKey key = KeyStoreHelper.loadOrGenerateWrappedKey(context, new File(context.getFilesDir() + "/" + KEY_FILE));
|
||||
data = EncryptionHelper.decrypt(key, data);
|
||||
|
||||
entries = stringToEntries(context, new String(data));
|
||||
entries = stringToEntries(new String(data));
|
||||
} catch (Exception error) {
|
||||
error.printStackTrace();
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public class DatabaseHelper {
|
|||
return json.toString();
|
||||
}
|
||||
|
||||
public static ArrayList<Entry> stringToEntries(Context context, String data) {
|
||||
public static ArrayList<Entry> stringToEntries(String data) {
|
||||
ArrayList<Entry> entries = new ArrayList<>();
|
||||
|
||||
try {
|
||||
|
@ -120,7 +120,7 @@ public class DatabaseHelper {
|
|||
ArrayList<Entry> entries = null;
|
||||
|
||||
if (! content.isEmpty())
|
||||
entries = stringToEntries(context, content);
|
||||
entries = stringToEntries(content);
|
||||
|
||||
return entries;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue