diff options
author | cyBerta <cyberta@riseup.net> | 2020-07-25 16:45:02 +0200 |
---|---|---|
committer | cyBerta <cyberta@riseup.net> | 2020-07-25 16:45:02 +0200 |
commit | 98f13dbf52ad6358ea5d7d56db0cd2a487060fb5 (patch) | |
tree | d758320fcb896fd95f41643dd5625eaa62a540e2 /app/src/main | |
parent | 6b45b15d4ebc3ed2a8fabea4467f9a6509f8a606 (diff) |
reset configured provider on update to version 1.0.4 so that the geoip url is picked correctly
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/FeatureVersionCode.java | 1 | ||||
-rw-r--r-- | app/src/main/java/se/leap/bitmaskclient/StartActivity.java | 12 |
2 files changed, 13 insertions, 0 deletions
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/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(); } |