refactor
This commit is contained in:
parent
f153600dd1
commit
5d3b171e21
|
@ -118,6 +118,9 @@ public class BackupUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void restoreZipBackup(File backup) {
|
public void restoreZipBackup(File backup) {
|
||||||
|
|
||||||
|
int port;
|
||||||
|
Cursor service;
|
||||||
String backupName = backup.getName();
|
String backupName = backup.getName();
|
||||||
String hsDir = backupName.substring(0, backupName.lastIndexOf('.'));
|
String hsDir = backupName.substring(0, backupName.lastIndexOf('.'));
|
||||||
String configFilePath = mHSBasePath + "/" + hsDir + "/" + configFileName;
|
String configFilePath = mHSBasePath + "/" + hsDir + "/" + configFileName;
|
||||||
|
@ -149,15 +152,12 @@ public class BackupUtils {
|
||||||
try {
|
try {
|
||||||
JSONObject savedValues = new JSONObject(jString);
|
JSONObject savedValues = new JSONObject(jString);
|
||||||
ContentValues fields = new ContentValues();
|
ContentValues fields = new ContentValues();
|
||||||
int port = savedValues.getInt(HSContentProvider.HiddenService.PORT);
|
|
||||||
|
|
||||||
fields.put(
|
fields.put(
|
||||||
HSContentProvider.HiddenService.NAME,
|
HSContentProvider.HiddenService.NAME,
|
||||||
savedValues.getString(HSContentProvider.HiddenService.NAME)
|
savedValues.getString(HSContentProvider.HiddenService.NAME)
|
||||||
);
|
);
|
||||||
|
|
||||||
fields.put(HSContentProvider.HiddenService.PORT, port);
|
|
||||||
|
|
||||||
fields.put(
|
fields.put(
|
||||||
HSContentProvider.HiddenService.ONION_PORT,
|
HSContentProvider.HiddenService.ONION_PORT,
|
||||||
savedValues.getInt(HSContentProvider.HiddenService.ONION_PORT)
|
savedValues.getInt(HSContentProvider.HiddenService.ONION_PORT)
|
||||||
|
@ -173,7 +173,10 @@ public class BackupUtils {
|
||||||
savedValues.getInt(HSContentProvider.HiddenService.CREATED_BY_USER)
|
savedValues.getInt(HSContentProvider.HiddenService.CREATED_BY_USER)
|
||||||
);
|
);
|
||||||
|
|
||||||
Cursor service = mResolver.query(
|
port = savedValues.getInt(HSContentProvider.HiddenService.PORT);
|
||||||
|
fields.put(HSContentProvider.HiddenService.PORT, port);
|
||||||
|
|
||||||
|
service = mResolver.query(
|
||||||
HSContentProvider.CONTENT_URI,
|
HSContentProvider.CONTENT_URI,
|
||||||
HSContentProvider.PROJECTION,
|
HSContentProvider.PROJECTION,
|
||||||
HSContentProvider.HiddenService.PORT + "=" + port,
|
HSContentProvider.HiddenService.PORT + "=" + port,
|
||||||
|
|
Loading…
Reference in New Issue