Removed DNSSEC option

Needs to be per host
pull/214/head
M66B 2 years ago
parent c92d8a91bf
commit cd0ccba175

@ -90,7 +90,7 @@ public class DnsHelper {
String domain = UriHelper.getEmailDomain(email); String domain = UriHelper.getEmailDomain(email);
if (domain == null) if (domain == null)
continue; continue;
DnsRecord[] records = _lookup(context, domain, "mx", CHECK_TIMEOUT); DnsRecord[] records = _lookup(context, domain, "mx", CHECK_TIMEOUT, false);
if (records.length == 0) if (records.length == 0)
throw new UnknownHostException(domain); throw new UnknownHostException(domain);
} }
@ -98,14 +98,13 @@ public class DnsHelper {
@NonNull @NonNull
static DnsRecord[] lookup(Context context, String name, String type) { 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 @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); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean dns_custom = prefs.getBoolean("dns_custom", false); boolean dns_custom = prefs.getBoolean("dns_custom", false);
boolean dns_secure = prefs.getBoolean("dns_secure", false);
String filter = null; String filter = null;
int colon = type.indexOf(':'); int colon = type.indexOf(':');

@ -98,7 +98,6 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private SwitchCompat swStandaloneVpn; private SwitchCompat swStandaloneVpn;
private SwitchCompat swDnsCustom; private SwitchCompat swDnsCustom;
private EditText etDnsExtra; private EditText etDnsExtra;
private SwitchCompat swDnsSecure;
private SwitchCompat swTcpKeepAlive; private SwitchCompat swTcpKeepAlive;
private SwitchCompat swSslUpdate; private SwitchCompat swSslUpdate;
private SwitchCompat swSslHarden; private SwitchCompat swSslHarden;
@ -131,7 +130,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
"download_headers", "download_eml", "download_plain", "download_headers", "download_eml", "download_plain",
"require_validated", "require_validated_captive", "vpn_only", "require_validated", "require_validated_captive", "vpn_only",
"timeout", "prefer_ip4", "bind_socket", "standalone_vpn", "timeout", "prefer_ip4", "bind_socket", "standalone_vpn",
"dns_extra", "dns_custom", "dns_secure", "dns_extra", "dns_custom",
"tcp_keep_alive", "tcp_keep_alive",
"ssl_update", "ssl_harden", "ssl_harden_strict", "cert_strict", "cert_transparency", "check_names", "ssl_update", "ssl_harden", "ssl_harden_strict", "cert_strict", "cert_transparency", "check_names",
"open_safe", "http_redirect", "open_safe", "http_redirect",
@ -166,7 +165,6 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
swStandaloneVpn = view.findViewById(R.id.swStandaloneVpn); swStandaloneVpn = view.findViewById(R.id.swStandaloneVpn);
swDnsCustom = view.findViewById(R.id.swDnsCustom); swDnsCustom = view.findViewById(R.id.swDnsCustom);
etDnsExtra = view.findViewById(R.id.etDnsExtra); etDnsExtra = view.findViewById(R.id.etDnsExtra);
swDnsSecure = view.findViewById(R.id.swDnsSecure);
swTcpKeepAlive = view.findViewById(R.id.swTcpKeepAlive); swTcpKeepAlive = view.findViewById(R.id.swTcpKeepAlive);
swSslUpdate = view.findViewById(R.id.swSslUpdate); swSslUpdate = view.findViewById(R.id.swSslUpdate);
swSslHarden = view.findViewById(R.id.swSslHarden); swSslHarden = view.findViewById(R.id.swSslHarden);
@ -351,7 +349,6 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
DnsHelper.clear(buttonView.getContext()); DnsHelper.clear(buttonView.getContext());
prefs.edit().putBoolean("dns_custom", checked).apply(); prefs.edit().putBoolean("dns_custom", checked).apply();
etDnsExtra.setEnabled(checked || Build.VERSION.SDK_INT < Build.VERSION_CODES.Q); 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() { swTcpKeepAlive.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override @Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { 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)); swDnsCustom.setChecked(prefs.getBoolean("dns_custom", false));
etDnsExtra.setText(prefs.getString("dns_extra", null)); etDnsExtra.setText(prefs.getString("dns_extra", null));
etDnsExtra.setEnabled(swDnsCustom.isChecked() || Build.VERSION.SDK_INT < Build.VERSION_CODES.Q); 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)); swTcpKeepAlive.setChecked(prefs.getBoolean("tcp_keep_alive", false));
swSslUpdate.setChecked(prefs.getBoolean("ssl_update", true)); swSslUpdate.setChecked(prefs.getBoolean("ssl_update", true));
swSslHarden.setChecked(prefs.getBoolean("ssl_harden", false)); swSslHarden.setChecked(prefs.getBoolean("ssl_harden", false));

@ -172,7 +172,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
"sync_shared_folders", "sync_shared_folders",
"download_headers", "download_eml", "download_headers", "download_eml",
"prefer_ip4", "bind_socket", "standalone_vpn", // force reconnect "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 "tcp_keep_alive", // force reconnect
"ssl_harden", "ssl_harden_strict", "cert_strict", "cert_transparency", "check_names", "bouncy_castle", "bc_fips", // force reconnect "ssl_harden", "ssl_harden_strict", "cert_strict", "cert_transparency", "check_names", "bouncy_castle", "bc_fips", // force reconnect
"experiments", "debug", "protocol", // force reconnect "experiments", "debug", "protocol", // force reconnect

@ -461,18 +461,6 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvDns" /> app:layout_constraintTop_toBottomOf="@id/tvDns" />
<androidx.appcompat.widget.SwitchCompat
android:id="@+id/swDnsSecure"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:text="@string/title_advanced_dns_secure"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/etDnsExtra"
app:switchPadding="12dp" />
<androidx.appcompat.widget.SwitchCompat <androidx.appcompat.widget.SwitchCompat
android:id="@+id/swTcpKeepAlive" android:id="@+id/swTcpKeepAlive"
android:layout_width="0dp" android:layout_width="0dp"
@ -482,7 +470,7 @@
android:text="@string/title_advanced_tcp_keep_alive" android:text="@string/title_advanced_tcp_keep_alive"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/swDnsSecure" app:layout_constraintTop_toBottomOf="@id/etDnsExtra"
app:switchPadding="12dp" /> app:switchPadding="12dp" />
<TextView <TextView

Loading…
Cancel
Save