Prepare secure connections only

pull/214/head
M66B 9 months ago
parent 1d58b1c85f
commit 4f408c5d1c

@ -38,6 +38,7 @@ public class ActivityError extends ActivityBase {
private TextView tvTitle;
private TextView tvMessage;
private TextView tvCertificate;
private Button btnPassword;
private ImageButton ibSetting;
private ImageButton ibInfo;
@ -52,6 +53,7 @@ public class ActivityError extends ActivityBase {
tvTitle = findViewById(R.id.tvTitle);
tvMessage = findViewById(R.id.tvMessage);
tvCertificate = findViewById(R.id.tvCertificate);
btnPassword = findViewById(R.id.btnPassword);
ibSetting = findViewById(R.id.ibSetting);
ibInfo = findViewById(R.id.ibInfo);
@ -86,18 +88,16 @@ public class ActivityError extends ActivityBase {
long identity = intent.getLongExtra("identity", -1L);
int protocol = intent.getIntExtra("protocol", -1);
int auth_type = intent.getIntExtra("auth_type", -1);
if (message != null &&
(message.contains("CertPathValidatorException") ||
message.contains("CertificateExpiredException")))
intent.putExtra("faq", 4);
int faq = intent.getIntExtra("faq", -1);
boolean isCertificateException = (message != null && message.contains("CertificateException"));
tvTitle.setText(title);
tvMessage.setMovementMethod(LinkMovementMethodCompat.getInstance());
tvMessage.setText(message);
tvCertificate.setVisibility(isCertificateException ? View.VISIBLE : View.GONE);
boolean password = (auth_type == ServiceAuthenticator.AUTH_TYPE_PASSWORD);
btnPassword.setText(password ? R.string.title_password : R.string.title_setup_oauth_authorize);
@ -169,7 +169,7 @@ public class ActivityError extends ActivityBase {
ibInfo.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Helper.viewFAQ(view.getContext(), faq);
Helper.viewFAQ(view.getContext(), isCertificateException ? 4 : faq);
}
});

@ -67,6 +67,19 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvTitle" />
<TextView
android:id="@+id/tvCertificate"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="24dp"
android:text="@string/title_certificate_error"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?attr/colorError"
android:textStyle="bold|italic"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMessage" />
<Button
android:id="@+id/btnPassword"
android:layout_width="wrap_content"
@ -75,7 +88,7 @@
android:drawablePadding="6dp"
android:text="@string/title_password"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMessage" />
app:layout_constraintTop_toBottomOf="@id/tvCertificate" />
<ImageButton
android:id="@+id/ibSetting"

@ -1271,6 +1271,10 @@
<string name="title_service_port">Please double check the port number</string>
<string name="title_service_protocol">Please double check the protocol (SSL/TLS or STARTTLS)</string>
<string name="title_service_error10">This account needs to be authenticated again, which can be done via the quick setup wizard</string>
<string name="title_certificate_error">
Due to Google\'s Play Store policies, it is no longer possible for the version of FairEmail distributed in the Play Store to support insecure connections to email servers with certificate issues.
Therefore, this issue can only be resolved by your email provider - the above error information may help them resolve this issue.
</string>
<string name="title_advanced_browse">Browse messages on the server</string>
<string name="title_advanced_expand_read">Mark messages read on expanding</string>

Loading…
Cancel
Save