Added option to disable HTTP redirecting

This commit is contained in:
M66B
2023-12-10 09:24:24 +01:00
parent b10ea057aa
commit 0c87e0f9cf
4 changed files with 27 additions and 3 deletions

View File

@@ -99,6 +99,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private SwitchCompat swSslHardenStrict;
private SwitchCompat swCertStrict;
private SwitchCompat swOpenSafe;
private SwitchCompat swHttpRedirect;
private SwitchCompat swBouncyCastle;
private SwitchCompat swFipsMode;
private ImageButton ibBouncyCastle;
@@ -120,7 +121,8 @@ 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", "tcp_keep_alive",
"ssl_harden", "ssl_harden_strict", "cert_strict", "open_safe", "bouncy_castle", "bc_fips"
"ssl_harden", "ssl_harden_strict", "cert_strict", "open_safe", "http_redirect",
"bouncy_castle", "bc_fips"
};
@Override
@@ -154,6 +156,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
swSslHardenStrict = view.findViewById(R.id.swSslHardenStrict);
swCertStrict = view.findViewById(R.id.swCertStrict);
swOpenSafe = view.findViewById(R.id.swOpenSafe);
swHttpRedirect = view.findViewById(R.id.swHttpRedirect);
swBouncyCastle = view.findViewById(R.id.swBouncyCastle);
swFipsMode = view.findViewById(R.id.swFipsMode);
ibBouncyCastle = view.findViewById(R.id.ibBouncyCastle);
@@ -361,6 +364,13 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
}
});
swHttpRedirect.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("http_redirect", checked).apply();
}
});
swBouncyCastle.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -660,6 +670,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
swSslHardenStrict.setEnabled(swSslHarden.isChecked());
swCertStrict.setChecked(prefs.getBoolean("cert_strict", true));
swOpenSafe.setChecked(prefs.getBoolean("open_safe", false));
swHttpRedirect.setChecked(prefs.getBoolean("http_redirect", true));
swBouncyCastle.setChecked(prefs.getBoolean("bouncy_castle", false));
swFipsMode.setChecked(prefs.getBoolean("bc_fips", false));
swFipsMode.setEnabled(swBouncyCastle.isChecked());