summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2021-12-21 01:42:42 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2021-12-21 13:01:42 +0530
commit17860407f9451b3ac90caa1fc20a10cfd4c44489 (patch)
treea717a4fb5385e1d98fd7e65f08b89ad607831dfd /app/src/main/java
parenta0a8200393671f92d7d587750d01cf7915f4d2b8 (diff)
app: migrate XkPasswd users to Diceware
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/dev/msfjarvis/aps/util/settings/Migrations.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/src/main/java/dev/msfjarvis/aps/util/settings/Migrations.kt b/app/src/main/java/dev/msfjarvis/aps/util/settings/Migrations.kt
index c001091d..5d61e75b 100644
--- a/app/src/main/java/dev/msfjarvis/aps/util/settings/Migrations.kt
+++ b/app/src/main/java/dev/msfjarvis/aps/util/settings/Migrations.kt
@@ -25,6 +25,7 @@ fun runMigrations(filesDirPath: String, sharedPrefs: SharedPreferences, gitSetti
migrateToHideAll(sharedPrefs)
migrateToSshKey(filesDirPath, sharedPrefs)
migrateToClipboardHistory(sharedPrefs)
+ migrateToDiceware(sharedPrefs)
}
private fun migrateToGitUrlBasedConfig(sharedPrefs: SharedPreferences, gitSettings: GitSettings) {
@@ -121,3 +122,13 @@ private fun migrateToClipboardHistory(sharedPrefs: SharedPreferences) {
}
}
}
+
+private fun migrateToDiceware(sharedPrefs: SharedPreferences) {
+ if (sharedPrefs.contains(PreferenceKeys.PREF_KEY_PWGEN_TYPE)) {
+ sharedPrefs.edit {
+ if (sharedPrefs.getString(PreferenceKeys.PREF_KEY_PWGEN_TYPE) == "xkpasswd") {
+ putString(PreferenceKeys.PREF_KEY_PWGEN_TYPE, "diceware")
+ }
+ }
+ }
+}