From 0bba2154bf55af766a10c32fae75b154c9adb65b Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 14 Oct 2021 16:51:51 +0200 Subject: [PATCH] Debug plain settings files --- .../java/eu/faircode/email/ActivitySetup.java | 10 ++++++++-- .../res/layout/fragment_options_synchronize.xml | 17 ++++------------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index c548317909..70a989803c 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -1679,7 +1679,10 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac String password1 = etPassword1.getEditText().getText().toString(); String password2 = etPassword2.getEditText().getText().toString(); - if (TextUtils.isEmpty(password1) && !BuildConfig.DEBUG) + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + boolean debug = prefs.getBoolean("debug", false); + + if (TextUtils.isEmpty(password1) && !(debug || BuildConfig.DEBUG)) ToastEx.makeText(context, R.string.title_setup_password_missing, Toast.LENGTH_LONG).show(); else { if (password1.equals(password2)) { @@ -1739,7 +1742,10 @@ public class ActivitySetup extends ActivityBase implements FragmentManager.OnBac public void onClick(DialogInterface dialog, int which) { String password1 = etPassword1.getEditText().getText().toString(); - if (TextUtils.isEmpty(password1) && !BuildConfig.DEBUG) + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); + boolean debug = prefs.getBoolean("debug", false); + + if (TextUtils.isEmpty(password1) && !(debug || BuildConfig.DEBUG)) ToastEx.makeText(context, R.string.title_setup_password_missing, Toast.LENGTH_LONG).show(); else { ActivitySetup activity = (ActivitySetup) getActivity(); diff --git a/app/src/main/res/layout/fragment_options_synchronize.xml b/app/src/main/res/layout/fragment_options_synchronize.xml index afa261f190..b9c100b858 100644 --- a/app/src/main/res/layout/fragment_options_synchronize.xml +++ b/app/src/main/res/layout/fragment_options_synchronize.xml @@ -659,8 +659,11 @@