diff options
author | cyBerta <cyberta@riseup.net> | 2023-01-05 01:04:45 +0100 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2023-01-05 01:04:45 +0100 |
commit | 1998947ede1724fca2efb1788d343a362fc39069 (patch) | |
tree | a037c5897fc844b4cf57a9d8646d3267b3840590 /app/src/main/java | |
parent | 638966bffa3b53d4924fdf9571ee35b060427f91 (diff) |
hide gateway pinning entry and obfuscation pinning entry in releases
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java index d57d725e..40bc256c 100644 --- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java +++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java @@ -228,14 +228,15 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh } private void initGatewayPinningEntry(View rootView) { + IconTextEntry gatewayPinning = rootView.findViewById(R.id.gateway_pinning); if (!BuildConfig.BUILD_TYPE.equals("debug")) { + gatewayPinning.setVisibility(GONE); return; } Context context = this.getContext(); if (context == null) { return; } - IconTextEntry gatewayPinning = rootView.findViewById(R.id.gateway_pinning); String pinnedGateway = PreferenceHelper.getPinnedGateway(rootView.getContext()); gatewayPinning.setSubtitle(pinnedGateway != null ? pinnedGateway : "Connect to a specific Gateway for debugging purposes"); @@ -264,30 +265,30 @@ public class SettingsFragment extends Fragment implements SharedPreferences.OnSh public void initObfuscationPinningEntry(View rootView) { IconSwitchEntry obfuscationPinning = rootView.findViewById(R.id.obfuscation_proxy_pinning); - if (useObfsVpn()) { - obfuscationPinning.setVisibility(VISIBLE); - boolean useBridges = getUseBridges(getContext()); - obfuscationPinning.setEnabled(useBridges); - obfuscationPinning.setSubtitle(useBridges ? "Connect to a specific obfuscation proxy for debugging purposes" : "Enable Bridges to use this option"); - obfuscationPinning.setChecked(useObfuscationPinning(getContext())); - obfuscationPinning.setOnCheckedChangeListener((buttonView, isChecked) -> { - if (!buttonView.isPressed()) { - return; - } - if (!isChecked) { - setUseObfuscationPinning(getContext(), false); - } else { - showObfuscationPinningDialog(); - } - }); - obfuscationPinning.setOnClickListener(v -> { - if (obfuscationPinning.isChecked()) { - showObfuscationPinningDialog(); - } - }); - } else { + if (!BuildConfig.BUILD_TYPE.equals("debug") || !useObfsVpn()) { obfuscationPinning.setVisibility(GONE); + return; } + obfuscationPinning.setVisibility(VISIBLE); + boolean useBridges = getUseBridges(getContext()); + obfuscationPinning.setEnabled(useBridges); + obfuscationPinning.setSubtitle(useBridges ? "Connect to a specific obfuscation proxy for debugging purposes" : "Enable Bridges to use this option"); + obfuscationPinning.setChecked(useObfuscationPinning(getContext())); + obfuscationPinning.setOnCheckedChangeListener((buttonView, isChecked) -> { + if (!buttonView.isPressed()) { + return; + } + if (!isChecked) { + setUseObfuscationPinning(getContext(), false); + } else { + showObfuscationPinningDialog(); + } + }); + obfuscationPinning.setOnClickListener(v -> { + if (obfuscationPinning.isChecked()) { + showObfuscationPinningDialog(); + } + }); } public void showObfuscationPinningDialog() { |