process passwords in preferences correctly

This commit is contained in:
Milos Kozak 2020-04-02 19:14:50 +02:00
parent 7ab5bea93d
commit ff67c44e8f

View file

@ -285,8 +285,15 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
}
}
val hmacPasswords = arrayOf(
resourceHelper.gs(R.string.key_bolus_password),
resourceHelper.gs(R.string.key_master_password),
resourceHelper.gs(R.string.key_application_password),
resourceHelper.gs(R.string.key_settings_password)
)
if (pref is Preference) {
if ((pref.key != null) && (pref.key.contains("_password"))) {
if ((pref.key != null) && (hmacPasswords.contains(pref.key))) {
if (sp.getString(pref.key, "").startsWith("hmac:")) {
pref.summary = "******"
} else {