diff --git a/FAQ.md b/FAQ.md index 67f70467d4..0f698f7d97 100644 --- a/FAQ.md +++ b/FAQ.md @@ -180,8 +180,7 @@ IMAP STARTTLS: the EFF [writes](https://www.eff.org/nl/deeplinks/2018/06/announc Empty password: your username is likely easily guessed, so this is very insecure. If you still want to use an invalid security certificate, IMAP STARTTLS or an empty password, -you'll need to enable insecure connections in the advanced settings and also in the account and/or identity settings. -Additionally, IMAP STARTTLS needs to be enabled in the account settings too. +you'll need to enable insecure connections in the account and/or identity settings. diff --git a/app/src/main/java/eu/faircode/email/FragmentAccount.java b/app/src/main/java/eu/faircode/email/FragmentAccount.java index 0ea0710aa4..417bea4979 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccount.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccount.java @@ -29,14 +29,12 @@ import android.app.NotificationManager; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; -import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; import android.os.Build; import android.os.Bundle; import android.os.Handler; -import android.preference.PreferenceManager; import android.text.Editable; import android.text.TextUtils; import android.text.TextWatcher; @@ -157,9 +155,6 @@ public class FragmentAccount extends FragmentEx { setSubtitle(R.string.title_edit_account); setHasOptionsMenu(true); - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); - final boolean insecure = prefs.getBoolean("insecure", false); - view = (ViewGroup) inflater.inflate(R.layout.fragment_account, container, false); // Get controls @@ -218,8 +213,6 @@ public class FragmentAccount extends FragmentEx { public void onItemSelected(AdapterView adapterView, View view, int position, long itemid) { Provider provider = (Provider) adapterView.getSelectedItem(); grpServer.setVisibility(position == 1 ? View.VISIBLE : View.GONE); - cbStartTls.setVisibility(position == 1 && insecure ? View.VISIBLE : View.GONE); - cbInsecure.setVisibility(position == 1 && insecure ? View.VISIBLE : View.GONE); grpAuthorize.setVisibility(position > 0 ? View.VISIBLE : View.GONE); btnAuthorize.setVisibility(provider.type == null ? View.GONE : View.VISIBLE); diff --git a/app/src/main/java/eu/faircode/email/FragmentIdentity.java b/app/src/main/java/eu/faircode/email/FragmentIdentity.java index faa9a88b01..cb0f8a9525 100644 --- a/app/src/main/java/eu/faircode/email/FragmentIdentity.java +++ b/app/src/main/java/eu/faircode/email/FragmentIdentity.java @@ -21,12 +21,10 @@ package eu.faircode.email; import android.content.Context; import android.content.DialogInterface; -import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; import android.os.Bundle; import android.os.Handler; -import android.preference.PreferenceManager; import android.text.Editable; import android.text.Html; import android.text.TextUtils; @@ -115,6 +113,7 @@ public class FragmentIdentity extends FragmentEx { private ProgressBar pbSave; private ProgressBar pbWait; + private Group grpAuthorize; private Group grpAdvanced; private long id = -1; @@ -136,9 +135,6 @@ public class FragmentIdentity extends FragmentEx { setSubtitle(R.string.title_edit_identity); setHasOptionsMenu(true); - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); - final boolean insecure = prefs.getBoolean("insecure", false); - view = (ViewGroup) inflater.inflate(R.layout.fragment_identity, container, false); // Get controls @@ -177,6 +173,7 @@ public class FragmentIdentity extends FragmentEx { pbSave = view.findViewById(R.id.pbSave); pbWait = view.findViewById(R.id.pbWait); + grpAuthorize = view.findViewById(R.id.grpAuthorize); grpAdvanced = view.findViewById(R.id.grpAdvanced); // Wire controls @@ -184,11 +181,10 @@ public class FragmentIdentity extends FragmentEx { spAccount.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView adapterView, View view, int position, long id) { - btnAdvanced.setVisibility(position > 0 ? View.VISIBLE : View.GONE); + grpAuthorize.setVisibility(position > 0 ? View.VISIBLE : View.GONE); if (position == 0) grpAdvanced.setVisibility(View.GONE); tilPassword.setPasswordVisibilityToggleEnabled(position == 0); - btnSave.setVisibility(position > 0 ? View.VISIBLE : View.GONE); Integer tag = (Integer) adapterView.getTag(); if (tag != null && tag.equals(position)) @@ -284,7 +280,6 @@ public class FragmentIdentity extends FragmentEx { public void onClick(View v) { int visibility = (grpAdvanced.getVisibility() == View.VISIBLE ? View.GONE : View.VISIBLE); grpAdvanced.setVisibility(visibility); - cbInsecure.setVisibility(insecure ? visibility : View.GONE); if (visibility == View.VISIBLE) new Handler().post(new Runnable() { @Override @@ -606,9 +601,11 @@ public class FragmentIdentity extends FragmentEx { tilPassword.setPasswordVisibilityToggleEnabled(id < 0); btnSave.setVisibility(View.GONE); btnAdvanced.setVisibility(View.GONE); - grpAdvanced.setVisibility(View.GONE); pbSave.setVisibility(View.GONE); + grpAuthorize.setVisibility(View.GONE); + grpAdvanced.setVisibility(View.GONE); + return view; } diff --git a/app/src/main/java/eu/faircode/email/FragmentOptions.java b/app/src/main/java/eu/faircode/email/FragmentOptions.java index ce0d824b9c..3cc6f1430e 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptions.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptions.java @@ -55,7 +55,6 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS private SwitchCompat swMetered; private Spinner spDownload; - private SwitchCompat swInsecure; private SwitchCompat swUnified; private SwitchCompat swThreading; @@ -94,7 +93,6 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS swMetered = view.findViewById(R.id.swMetered); spDownload = view.findViewById(R.id.spDownload); - swInsecure = view.findViewById(R.id.swInsecure); swUnified = view.findViewById(R.id.swUnified); swThreading = view.findViewById(R.id.swThreading); @@ -161,14 +159,6 @@ public class FragmentOptions extends FragmentEx implements SharedPreferences.OnS } }); - swInsecure.setChecked(prefs.getBoolean("insecure", false)); - swInsecure.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { - prefs.edit().putBoolean("insecure", checked).apply(); - } - }); - swUnified.setChecked(prefs.getBoolean("unified", true)); swUnified.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override diff --git a/app/src/main/res/layout/fragment_account.xml b/app/src/main/res/layout/fragment_account.xml index 2b3bd0fc19..73071a3fc8 100644 --- a/app/src/main/res/layout/fragment_account.xml +++ b/app/src/main/res/layout/fragment_account.xml @@ -567,7 +567,7 @@ android:id="@+id/grpServer" android:layout_width="0dp" android:layout_height="0dp" - app:constraint_referenced_ids="tvDomain,etDomain,btnAutoConfig,tvImap,tvPop,tvHost,etHost,tvPort,etPort" /> + app:constraint_referenced_ids="tvDomain,etDomain,btnAutoConfig,tvImap,tvPop,tvHost,etHost,cbStartTls,cbInsecure,tvPort,etPort" /> + + + + + + + app:layout_constraintTop_toBottomOf="@id/spAccount" /> - - - - - - + app:layout_constraintTop_toBottomOf="@id/etEmail" /> + + + app:constraint_referenced_ids="tvReplyTo,etReplyTo,tvBcc,etBcc,cbDeliveryReceipt,cbReadReceipt,tvReceipt,tvProvider,spProvider,tvDomain,etDomain,btnAutoConfig,tvSmtp,tvHost,etHost,cbStartTls,cbInsecure,tvPort,etPort,tvUser,etUser,tvPassword,tilPassword,cbSynchronize,cbPrimary,tvSent,spSent,tvSentHint" /> diff --git a/app/src/main/res/layout/fragment_options.xml b/app/src/main/res/layout/fragment_options.xml index a2b9650a26..2c4ae896bd 100644 --- a/app/src/main/res/layout/fragment_options.xml +++ b/app/src/main/res/layout/fragment_options.xml @@ -135,18 +135,6 @@ app:barrierDirection="bottom" app:constraint_referenced_ids="tvDownload,spDownload" /> - - + app:layout_constraintTop_toBottomOf="@id/barrier1" />