intent api: restore key

This commit is contained in:
arrase 2016-11-27 20:07:49 +01:00
parent 5d3b171e21
commit bb7ffd9692
2 changed files with 934 additions and 1039 deletions

View File

@ -58,7 +58,7 @@ public class BackupUtils {
JSONObject config = new JSONObject(); JSONObject config = new JSONObject();
try { try {
if (portData.getCount() != 1) if (portData == null || portData.getCount() != 1)
return null; return null;
portData.moveToNext(); portData.moveToNext();
@ -184,7 +184,7 @@ public class BackupUtils {
null null
); );
if (service.getCount() == 0) { if (service == null || service.getCount() == 0) {
mResolver.insert(HSContentProvider.CONTENT_URI, fields); mResolver.insert(HSContentProvider.CONTENT_URI, fields);
} else { } else {
mResolver.update( mResolver.update(
@ -193,9 +193,9 @@ public class BackupUtils {
HSContentProvider.HiddenService.PORT + "=" + port, HSContentProvider.HiddenService.PORT + "=" + port,
null null
); );
}
service.close(); service.close();
}
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();