From bfc662ec41dae061229fe05a692f0293c32fdc63 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 16 Oct 2019 15:36:49 +0200 Subject: [PATCH] Added message about invalid settings files Some people try to import K9 settings files --- app/src/main/java/eu/faircode/email/ActivitySetup.java | 3 +++ app/src/main/res/values/strings.xml | 1 + 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 9af8b47582..95928a8875 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -91,6 +91,7 @@ import javax.crypto.BadPaddingException; import javax.crypto.Cipher; import javax.crypto.CipherInputStream; import javax.crypto.CipherOutputStream; +import javax.crypto.IllegalBlockSizeException; import javax.crypto.SecretKey; import javax.crypto.SecretKeyFactory; import javax.crypto.spec.IvParameterSpec; @@ -962,6 +963,8 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac protected void onException(Bundle args, Throwable ex) { if (ex.getCause() instanceof BadPaddingException) ToastEx.makeText(ActivitySetup.this, R.string.title_setup_password_invalid, Toast.LENGTH_LONG).show(); + else if (ex instanceof IOException && ex.getCause() instanceof IllegalBlockSizeException) + ToastEx.makeText(ActivitySetup.this, R.string.title_setup_import_invalid, Toast.LENGTH_LONG).show(); else if (ex instanceof IllegalArgumentException) ToastEx.makeText(ActivitySetup.this, ex.getMessage(), Toast.LENGTH_LONG).show(); else diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 75d2e01c14..2be343bd07 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -175,6 +175,7 @@ Password invalid Settings exported Settings imported + Invalid settings file Manage notifications Order accounts