mirror of https://github.com/M66B/FairEmail.git
Disable DNSSEC for Android 7-
This commit is contained in:
parent
d0f72d56ca
commit
88c7cb5bf4
|
@ -322,6 +322,9 @@ public class DnsHelper {
|
|||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean dns_custom = prefs.getBoolean("dns_custom", false);
|
||||
|
||||
if (!hasDnsSec())
|
||||
dnssec = false;
|
||||
|
||||
if (!dns_custom && !dnssec)
|
||||
return InetAddress.getByName(host);
|
||||
|
||||
|
@ -335,6 +338,9 @@ public class DnsHelper {
|
|||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean dns_custom = prefs.getBoolean("dns_custom", false);
|
||||
|
||||
if (!hasDnsSec())
|
||||
dnssec = false;
|
||||
|
||||
if (!dns_custom && !dnssec)
|
||||
return InetAddress.getAllByName(host);
|
||||
|
||||
|
@ -360,6 +366,9 @@ public class DnsHelper {
|
|||
}
|
||||
|
||||
static void verifyDane(X509Certificate[] chain, String server, int port) throws CertificateException {
|
||||
if (!hasDnsSec())
|
||||
return;
|
||||
|
||||
Handler handler = new Handler() {
|
||||
@Override
|
||||
public void publish(LogRecord record) {
|
||||
|
@ -452,6 +461,11 @@ public class DnsHelper {
|
|||
editor.apply();
|
||||
}
|
||||
|
||||
static boolean hasDnsSec() {
|
||||
// DNSSEC causes crashes in libc
|
||||
return (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O);
|
||||
}
|
||||
|
||||
static void test(Context context) throws UnknownHostException {
|
||||
test(context, "gmail.com", "ns");
|
||||
test(context, "web.de", "mx");
|
||||
|
|
|
@ -633,10 +633,18 @@ public class FragmentAccount extends FragmentBase {
|
|||
btnAutoConfig.setEnabled(false);
|
||||
pbAutoConfig.setVisibility(View.GONE);
|
||||
|
||||
if (!DnsHelper.hasDnsSec()) {
|
||||
Helper.hide(cbDnsSec);
|
||||
Helper.hide(view.findViewById(R.id.tvDnsRemark));
|
||||
Helper.hide(cbDane);
|
||||
Helper.hide(view.findViewById(R.id.tvDaneRemark));
|
||||
}
|
||||
|
||||
if (!SSLHelper.customTrustManager()) {
|
||||
Helper.hide(cbInsecure);
|
||||
Helper.hide(tvInsecureRemark);
|
||||
Helper.hide(cbDane);
|
||||
Helper.hide(view.findViewById(R.id.tvDaneRemark));
|
||||
}
|
||||
|
||||
if (id < 0)
|
||||
|
|
|
@ -33,6 +33,7 @@ import android.database.Cursor;
|
|||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.ContactsContract;
|
||||
import android.text.Editable;
|
||||
|
@ -580,10 +581,18 @@ public class FragmentIdentity extends FragmentBase {
|
|||
btnAutoConfig.setEnabled(false);
|
||||
pbAutoConfig.setVisibility(View.GONE);
|
||||
|
||||
if (!DnsHelper.hasDnsSec()) {
|
||||
Helper.hide(cbDnsSec);
|
||||
Helper.hide(view.findViewById(R.id.tvDnsRemark));
|
||||
Helper.hide(cbDane);
|
||||
Helper.hide(view.findViewById(R.id.tvDaneRemark));
|
||||
}
|
||||
|
||||
if (!SSLHelper.customTrustManager()) {
|
||||
Helper.hide(cbInsecure);
|
||||
Helper.hide(tvInsecureRemark);
|
||||
Helper.hide(cbDane);
|
||||
Helper.hide(view.findViewById(R.id.tvDaneRemark));
|
||||
}
|
||||
|
||||
btnAdvanced.setVisibility(View.GONE);
|
||||
|
|
|
@ -365,10 +365,18 @@ public class FragmentPop extends FragmentBase {
|
|||
Helper.setViewsEnabled(view, false);
|
||||
FragmentDialogTheme.setBackground(getContext(), view, false);
|
||||
|
||||
if (!DnsHelper.hasDnsSec()) {
|
||||
Helper.hide(cbDnsSec);
|
||||
Helper.hide(view.findViewById(R.id.tvDnsRemark));
|
||||
Helper.hide(cbDane);
|
||||
Helper.hide(view.findViewById(R.id.tvDaneRemark));
|
||||
}
|
||||
|
||||
if (!SSLHelper.customTrustManager()) {
|
||||
Helper.hide(cbInsecure);
|
||||
Helper.hide(tvInsecureRemark);
|
||||
Helper.hide(cbDane);
|
||||
Helper.hide(view.findViewById(R.id.tvDaneRemark));
|
||||
}
|
||||
|
||||
if (id < 0)
|
||||
|
|
Loading…
Reference in New Issue