mirror of https://github.com/M66B/FairEmail.git
Import whitelisted settings only
This commit is contained in:
parent
6cc20c7542
commit
ec4205c783
|
@ -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…
Reference in New Issue