summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2023-01-05 01:27:45 +0000
committercyberta <cyberta@riseup.net>2023-01-05 01:27:45 +0000
commit13c75b3b6ab8861f654eaf03c384df7173aa63f5 (patch)
treea037c5897fc844b4cf57a9d8646d3267b3840590 /app/src/main/java/se/leap
parent638966bffa3b53d4924fdf9571ee35b060427f91 (diff)
parent1998947ede1724fca2efb1788d343a362fc39069 (diff)
Merge branch 'beta_and_debug_settings' into 'master'
hide gateway pinning entry and obfuscation pinning entry in releases See merge request leap/bitmask_android!242
Diffstat (limited to 'app/src/main/java/se/leap')
-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() {