From ec4205c78315ea48e00d122e47674bfb95c137d1 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 14 Sep 2018 11:36:49 +0000 Subject: [PATCH] Import whitelisted settings only --- .../java/eu/faircode/email/FragmentSetup.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentSetup.java b/app/src/main/java/eu/faircode/email/FragmentSetup.java index 494f93b673..0b1494a083 100644 --- a/app/src/main/java/eu/faircode/email/FragmentSetup.java +++ b/app/src/main/java/eu/faircode/email/FragmentSetup.java @@ -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();