Check decrypted json

This commit is contained in:
M66B 2020-11-02 08:09:34 +01:00
parent 27f327e8ea
commit d99e0c893f
1 changed files with 5 additions and 1 deletions

View File

@ -738,8 +738,12 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac
data.append(line);
}
String json = data.toString();
if (!json.startsWith("{") || !json.endsWith("}"))
throw new BadPaddingException("JSON");
Log.i("Importing data");
JSONObject jimport = new JSONObject(data.toString());
JSONObject jimport = new JSONObject(json);
DB db = DB.getInstance(context);
NotificationManager nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);