Added message about invalid settings files

Some people try to import K9 settings files
This commit is contained in:
M66B 2019-10-16 15:36:49 +02:00
parent 327f004c7a
commit bfc662ec41
2 changed files with 4 additions and 0 deletions

View File

@ -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

View File

@ -175,6 +175,7 @@
<string name="title_setup_password_invalid">Password invalid</string>
<string name="title_setup_exported">Settings exported</string>
<string name="title_setup_imported">Settings imported</string>
<string name="title_setup_import_invalid">Invalid settings file</string>
<string name="title_setup_notifications">Manage notifications</string>
<string name="title_setup_reorder_accounts">Order accounts</string>