summaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/SettingsFragment.java47
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() {