mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 11:25:13 +01:00
Disable DNSSEC for Android 7-
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user