mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-31 22:26:06 +02:00
Removed DNSSEC option
Needs to be per host
This commit is contained in:
@@ -90,7 +90,7 @@ public class DnsHelper {
|
||||
String domain = UriHelper.getEmailDomain(email);
|
||||
if (domain == null)
|
||||
continue;
|
||||
DnsRecord[] records = _lookup(context, domain, "mx", CHECK_TIMEOUT);
|
||||
DnsRecord[] records = _lookup(context, domain, "mx", CHECK_TIMEOUT, false);
|
||||
if (records.length == 0)
|
||||
throw new UnknownHostException(domain);
|
||||
}
|
||||
@@ -98,14 +98,13 @@ public class DnsHelper {
|
||||
|
||||
@NonNull
|
||||
static DnsRecord[] lookup(Context context, String name, String type) {
|
||||
return _lookup(context, name, type, LOOKUP_TIMEOUT);
|
||||
return _lookup(context, name, type, LOOKUP_TIMEOUT, false);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private static DnsRecord[] _lookup(Context context, String name, String type, int timeout) {
|
||||
private static DnsRecord[] _lookup(Context context, String name, String type, int timeout, boolean dns_secure) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
boolean dns_custom = prefs.getBoolean("dns_custom", false);
|
||||
boolean dns_secure = prefs.getBoolean("dns_secure", false);
|
||||
|
||||
String filter = null;
|
||||
int colon = type.indexOf(':');
|
||||
|
||||
@@ -98,7 +98,6 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
private SwitchCompat swStandaloneVpn;
|
||||
private SwitchCompat swDnsCustom;
|
||||
private EditText etDnsExtra;
|
||||
private SwitchCompat swDnsSecure;
|
||||
private SwitchCompat swTcpKeepAlive;
|
||||
private SwitchCompat swSslUpdate;
|
||||
private SwitchCompat swSslHarden;
|
||||
@@ -131,7 +130,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
"download_headers", "download_eml", "download_plain",
|
||||
"require_validated", "require_validated_captive", "vpn_only",
|
||||
"timeout", "prefer_ip4", "bind_socket", "standalone_vpn",
|
||||
"dns_extra", "dns_custom", "dns_secure",
|
||||
"dns_extra", "dns_custom",
|
||||
"tcp_keep_alive",
|
||||
"ssl_update", "ssl_harden", "ssl_harden_strict", "cert_strict", "cert_transparency", "check_names",
|
||||
"open_safe", "http_redirect",
|
||||
@@ -166,7 +165,6 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
swStandaloneVpn = view.findViewById(R.id.swStandaloneVpn);
|
||||
swDnsCustom = view.findViewById(R.id.swDnsCustom);
|
||||
etDnsExtra = view.findViewById(R.id.etDnsExtra);
|
||||
swDnsSecure = view.findViewById(R.id.swDnsSecure);
|
||||
swTcpKeepAlive = view.findViewById(R.id.swTcpKeepAlive);
|
||||
swSslUpdate = view.findViewById(R.id.swSslUpdate);
|
||||
swSslHarden = view.findViewById(R.id.swSslHarden);
|
||||
@@ -351,7 +349,6 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
DnsHelper.clear(buttonView.getContext());
|
||||
prefs.edit().putBoolean("dns_custom", checked).apply();
|
||||
etDnsExtra.setEnabled(checked || Build.VERSION.SDK_INT < Build.VERSION_CODES.Q);
|
||||
swDnsSecure.setEnabled(checked);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -372,15 +369,6 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
}
|
||||
});
|
||||
|
||||
swDnsSecure.setVisibility(debug || BuildConfig.DEBUG ? View.VISIBLE : View.GONE);
|
||||
swDnsSecure.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean checked) {
|
||||
DnsHelper.clear(buttonView.getContext());
|
||||
prefs.edit().putBoolean("dns_secure", checked).apply();
|
||||
}
|
||||
});
|
||||
|
||||
swTcpKeepAlive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
@@ -768,8 +756,6 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||
swDnsCustom.setChecked(prefs.getBoolean("dns_custom", false));
|
||||
etDnsExtra.setText(prefs.getString("dns_extra", null));
|
||||
etDnsExtra.setEnabled(swDnsCustom.isChecked() || Build.VERSION.SDK_INT < Build.VERSION_CODES.Q);
|
||||
swDnsSecure.setChecked(prefs.getBoolean("dns_secure", false));
|
||||
swDnsSecure.setEnabled(swDnsCustom.isChecked());
|
||||
swTcpKeepAlive.setChecked(prefs.getBoolean("tcp_keep_alive", false));
|
||||
swSslUpdate.setChecked(prefs.getBoolean("ssl_update", true));
|
||||
swSslHarden.setChecked(prefs.getBoolean("ssl_harden", false));
|
||||
|
||||
@@ -172,7 +172,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
"sync_shared_folders",
|
||||
"download_headers", "download_eml",
|
||||
"prefer_ip4", "bind_socket", "standalone_vpn", // force reconnect
|
||||
"dns_extra", "dns_custom", "dns_secure", // force reconnect
|
||||
"dns_extra", "dns_custom", // force reconnect
|
||||
"tcp_keep_alive", // force reconnect
|
||||
"ssl_harden", "ssl_harden_strict", "cert_strict", "cert_transparency", "check_names", "bouncy_castle", "bc_fips", // force reconnect
|
||||
"experiments", "debug", "protocol", // force reconnect
|
||||
|
||||
Reference in New Issue
Block a user