Remove exportAsJSON function from DatabaseHelper
This commit is contained in:
parent
08ad01b3db
commit
cb155823f7
2 changed files with 2 additions and 11 deletions
|
@ -399,9 +399,9 @@ public class BackupActivity extends BaseActivity {
|
|||
|
||||
private void doBackupPlain(Uri uri) {
|
||||
if (Tools.isExternalStorageWritable()) {
|
||||
boolean success = DatabaseHelper.exportAsJSON(this, uri);
|
||||
ArrayList<Entry> entries = DatabaseHelper.loadDatabase(this);
|
||||
|
||||
if (success)
|
||||
if (FileHelper.writeStringToFile(this, uri, DatabaseHelper.entriesToString(entries)))
|
||||
Toast.makeText(this, R.string.backup_toast_export_success, Toast.LENGTH_LONG).show();
|
||||
else
|
||||
Toast.makeText(this, R.string.backup_toast_export_failed, Toast.LENGTH_LONG).show();
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
package org.shadowice.flocke.andotp.Utilities;
|
||||
|
||||
import android.content.Context;
|
||||
import android.net.Uri;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.shadowice.flocke.andotp.Database.Entry;
|
||||
|
@ -108,12 +107,4 @@ public class DatabaseHelper {
|
|||
|
||||
return entries;
|
||||
}
|
||||
|
||||
/* Export functions */
|
||||
|
||||
public static boolean exportAsJSON(Context context, Uri file) {
|
||||
ArrayList<Entry> entries = loadDatabase(context);
|
||||
|
||||
return FileHelper.writeStringToFile(context, file, entriesToString(entries));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue