summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorcyberta <cyberta@riseup.net>2020-07-25 11:24:39 -0700
committercyberta <cyberta@riseup.net>2020-07-25 11:24:39 -0700
commit32c0ca9f843f80fb3a6541fe1938a2cab1047483 (patch)
treefe2ad75030582894790be433dcc7f219e02f07b7 /app/src/main/java
parente0123c8c5cd5f5def76810170b3d1202f5d8dbb3 (diff)
parentc070390d6eca9b185ca8c409712c64d10bd68118 (diff)
Merge branch 'upgrade_to_1.0.4' into 'master'
Upgrade to 1.0.4 See merge request leap/bitmask_android!111
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/CustomProviderSetupActivity.java2
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/FeatureVersionCode.java1
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/Provider.java3
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/StartActivity.java12
4 files changed, 16 insertions, 2 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/CustomProviderSetupActivity.java b/app/src/main/java/se/leap/bitmaskclient/CustomProviderSetupActivity.java
index 29d1b09e..0974f427 100644
--- a/app/src/main/java/se/leap/bitmaskclient/CustomProviderSetupActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/CustomProviderSetupActivity.java
@@ -37,7 +37,7 @@ public class CustomProviderSetupActivity extends ProviderSetupBaseActivity {
super.onCreate(savedInstanceState);
setUpInitialUI();
restoreState(savedInstanceState);
- setProvider(new Provider(BuildConfig.customProviderUrl, BuildConfig.customProviderIp, BuildConfig.customProviderApiIp));
+ setProvider(new Provider(BuildConfig.customProviderUrl, BuildConfig.geoipUrl, BuildConfig.customProviderIp, BuildConfig.customProviderApiIp));
}
@Override
diff --git a/app/src/main/java/se/leap/bitmaskclient/FeatureVersionCode.java b/app/src/main/java/se/leap/bitmaskclient/FeatureVersionCode.java
index 969f006a..3b67d96b 100644
--- a/app/src/main/java/se/leap/bitmaskclient/FeatureVersionCode.java
+++ b/app/src/main/java/se/leap/bitmaskclient/FeatureVersionCode.java
@@ -3,4 +3,5 @@ package se.leap.bitmaskclient;
public interface FeatureVersionCode {
int MULTIPLE_PROFILES = 132;
int RENAMED_EIP_IN_PREFERENCES = 132;
+ int GEOIP_SERVICE = 148;
}
diff --git a/app/src/main/java/se/leap/bitmaskclient/Provider.java b/app/src/main/java/se/leap/bitmaskclient/Provider.java
index 186ce11e..ce428a54 100644
--- a/app/src/main/java/se/leap/bitmaskclient/Provider.java
+++ b/app/src/main/java/se/leap/bitmaskclient/Provider.java
@@ -571,7 +571,8 @@ public final class Provider implements Parcelable {
}
/**
- * resets everything except the main url and the providerIp
+ * resets everything except the main url, the providerIp and the geoip
+ * service url (currently preseeded)
*/
public void reset() {
definition = new JSONObject();
diff --git a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
index dd4878f3..9937eeeb 100644
--- a/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/StartActivity.java
@@ -31,6 +31,7 @@ import java.lang.annotation.RetentionPolicy;
import de.blinkt.openvpn.core.VpnStatus;
import se.leap.bitmaskclient.eip.EipCommand;
+import se.leap.bitmaskclient.utils.PreferenceHelper;
import static se.leap.bitmaskclient.Constants.APP_ACTION_CONFIGURE_ALWAYS_ON_PROFILE;
import static se.leap.bitmaskclient.Constants.EIP_RESTART_ON_BOOT;
@@ -143,6 +144,17 @@ public class StartActivity extends Activity{
}
}
+ if (hasNewFeature(FeatureVersionCode.GEOIP_SERVICE)) {
+ // deletion of current configured provider so that the geoip url will picked out
+ // from the preseeded *.url file / geoipUrl buildconfigfield (build.gradle) during
+ // next setup
+ Provider provider = ProviderObservable.getInstance().getCurrentProvider();
+ if (provider != null && !provider.isDefault()) {
+ PreferenceHelper.deleteProviderDetailsFromPreferences(preferences, provider.getDomain());
+ ProviderObservable.getInstance().updateProvider(null);
+ }
+ }
+
// ensure all upgrades have passed before storing new information
storeAppVersion();
}