mirror of
https://github.com/Corewala/Buran
synced 2024-12-22 07:42:43 +00:00
Made preferences less vulnerable to accidentally changing certificates
This commit is contained in:
parent
df6c159c2c
commit
bedbc9fb98
1 changed files with 2 additions and 4 deletions
|
@ -365,7 +365,7 @@ class SettingsFragment: PreferenceFragmentCompat(), Preference.OnPreferenceChang
|
|||
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT).apply {
|
||||
addCategory(Intent.CATEGORY_OPENABLE)
|
||||
addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
|
||||
type = "*/*"
|
||||
type = "application/x-pkcs12"
|
||||
}
|
||||
startActivityForResult(intent, PREFS_SET_CLIENT_CERT_REQ)
|
||||
true
|
||||
|
@ -373,7 +373,6 @@ class SettingsFragment: PreferenceFragmentCompat(), Preference.OnPreferenceChang
|
|||
|
||||
certificateCategory.addPreference(clientCertPref)
|
||||
|
||||
|
||||
val clientCertPassword = EditTextPreference(context)
|
||||
clientCertPassword.key = Buran.PREF_KEY_CLIENT_CERT_PASSWORD
|
||||
clientCertPassword.title = getString(R.string.client_certificate_password)
|
||||
|
@ -399,7 +398,6 @@ class SettingsFragment: PreferenceFragmentCompat(), Preference.OnPreferenceChang
|
|||
useBiometrics.isVisible = false
|
||||
certificateCategory.addPreference(useBiometrics)
|
||||
|
||||
|
||||
val passwordCiphertext = EditTextPreference(context)
|
||||
passwordCiphertext.key = "password_ciphertext"
|
||||
passwordCiphertext.isVisible = false
|
||||
|
@ -445,6 +443,7 @@ class SettingsFragment: PreferenceFragmentCompat(), Preference.OnPreferenceChang
|
|||
clientCertPassword.summary = getDots(clientCertPassword.text)
|
||||
}
|
||||
clientCertPassword.isVisible = !(newValue as Boolean)
|
||||
clientCertPref.isEnabled = !(newValue as Boolean)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -497,7 +496,6 @@ class SettingsFragment: PreferenceFragmentCompat(), Preference.OnPreferenceChang
|
|||
persistPermissions(uri)
|
||||
findFilename(uri)
|
||||
}
|
||||
|
||||
}
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue