summaryrefslogtreecommitdiff
path: root/app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java8
1 files changed, 7 insertions, 1 deletions
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 6426c3d6..b622f5ca 100644
--- a/app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java
+++ b/app/src/main/java/se/leap/bitmaskclient/base/StartActivity.java
@@ -38,6 +38,7 @@ import android.util.Log;
import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
+import androidx.security.crypto.EncryptedSharedPreferences;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@@ -81,7 +82,7 @@ public class StartActivity extends Activity{
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- preferences = getSharedPreferences(SHARED_PREFERENCES, MODE_PRIVATE);
+ preferences = PreferenceHelper.getSharedPreferences(this);
Log.d(TAG, "Started");
@@ -197,6 +198,11 @@ public class StartActivity extends Activity{
}
}
+ if (hasNewFeature(FeatureVersionCode.ENCRYPTED_SHARED_PREFS)) {
+ PreferenceHelper.migrateToEncryptedPrefs(this);
+ preferences = PreferenceHelper.getSharedPreferences(this);
+ }
+
// 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);