Browse Source

Import whitelisted settings only

main
M66B 6 years ago
parent
commit
ec4205c783
1 changed files with 10 additions and 8 deletions
  1. +10
    -8
      app/src/main/java/eu/faircode/email/FragmentSetup.java

+ 10
- 8
app/src/main/java/eu/faircode/email/FragmentSetup.java View File

@ -554,14 +554,16 @@ public class FragmentSetup extends FragmentEx {
for (int s = 0; s < jsettings.length(); s++) {
JSONObject jsetting = (JSONObject) jsettings.get(s);
String key = jsetting.getString("key");
Object value = jsetting.get("value");
if (value instanceof Boolean)
editor.putBoolean(key, (Boolean) value);
else if (value instanceof String)
editor.putString(key, (String) value);
else
throw new IllegalArgumentException("Unknown settings type key=" + key);
Log.i(Helper.TAG, "Imported setting=" + key);
if (EXPORT_SETTINGS.contains(key)) {
Object value = jsetting.get("value");
if (value instanceof Boolean)
editor.putBoolean(key, (Boolean) value);
else if (value instanceof String)
editor.putString(key, (String) value);
else
throw new IllegalArgumentException("Unknown settings type key=" + key);
Log.i(Helper.TAG, "Imported setting=" + key);
}
}
editor.apply();


Loading…
Cancel
Save