summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2021-05-18 17:45:52 +0200
committercyberta <cyberta@riseup.net>2021-05-18 17:45:52 +0200
commit4853d6a3d3d8c1077feb61899f6b07b5f528607c (patch)
tree80afb89361633181a2b8868af42e88ce936a1ff4
parentf1d4b39bdc30417247bc1c8dccc75476e9eb9317 (diff)
implement feature switch, so that gateway selection can be turned off on compile time, turned off for Bitmask for now
-rw-r--r--app/build.gradle4
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java6
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java4
3 files changed, 14 insertions, 0 deletions
diff --git a/app/build.gradle b/app/build.gradle
index e13fae73..76a34feb 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -34,6 +34,8 @@ android {
buildConfigField 'int', 'donation_reminder_duration', '30'
//skip the account creation / login screen if the provider offers anonymous vpn usage, use directly the anonymous cert instead
buildConfigField 'boolean', 'priotize_anonymous_usage', 'false'
+ //allow manual gateway selection
+ buildConfigField 'boolean', 'allow_manual_gateway_selection', 'false'
// static update url pointing to the latest stable release apk
buildConfigField "String", "update_apk_url", '"https://dl.bitmask.net/client/android/Bitmask-Android-latest.apk"'
@@ -113,6 +115,8 @@ android {
//skip the account creation / login screen if the provider offers anonymous vpn usage, use directly the anonymous cert instead
buildConfigField 'boolean', 'priotize_anonymous_usage', 'true'
+ //allow manual gateway selection
+ buildConfigField 'boolean', 'allow_manual_gateway_selection', 'true'
//Build Config Fields for automatic apk update checks
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java b/app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java
index cf64905a..9d689e5d 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java
@@ -30,6 +30,7 @@ import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import de.blinkt.openvpn.core.VpnStatus;
+import se.leap.bitmaskclient.BuildConfig;
import se.leap.bitmaskclient.providersetup.ProviderListActivity;
import se.leap.bitmaskclient.eip.EipCommand;
import se.leap.bitmaskclient.base.models.FeatureVersionCode;
@@ -157,6 +158,11 @@ public class StartActivity extends Activity{
}
}
+ // always check if manual gateway selection feature switch has been disabled
+ if (!BuildConfig.allow_manual_gateway_selection && PreferenceHelper.getPreferredCity(this) != null) {
+ PreferenceHelper.setPreferredCity(this, null);
+ }
+
// ensure all upgrades have passed before storing new information
storeAppVersion();
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java
index cbfe8a71..5cae1591 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/fragments/NavigationDrawerFragment.java
@@ -50,6 +50,7 @@ import java.util.Observer;
import java.util.Set;
import de.blinkt.openvpn.core.VpnStatus;
+import se.leap.bitmaskclient.BuildConfig;
import se.leap.bitmaskclient.base.FragmentManagerEnhanced;
import se.leap.bitmaskclient.base.MainActivity;
import se.leap.bitmaskclient.base.models.Provider;
@@ -417,6 +418,9 @@ public class NavigationDrawerFragment extends Fragment implements SharedPreferen
}
private void initManualGatewayEntry() {
+ if (!BuildConfig.allow_manual_gateway_selection) {
+ return;
+ }
manualGatewaySelection = drawerView.findViewById(R.id.manualGatewaySelection);
String preferredGateway = getPreferredCity(getContext());
String subtitle = preferredGateway != null ? preferredGateway : getString(R.string.gateway_selection_best_location);