mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-26 03:46:46 -08:00
Setting to delete the password entered after a connection attempt #214
This commit is contained in:
1 parent
9c597665bf
commit
b3b2bb90e1
5 files changed
+33
-5
No files matched your search
@@ -589,6 +589,11 @@ class PasswordActivity : StylishActivity(),
|
||||
loadDatabase(password, keyUri)
|
||||
}
|
||||
|
||||
private fun removePassword() {
|
||||
passwordView?.setText("")
|
||||
checkboxPasswordView?.isChecked = false
|
||||
}
|
||||
|
||||
private fun loadDatabase(password: String?, keyFile: Uri?) {
|
||||
|
||||
// Deactivate the open button
|
||||
@@ -596,6 +601,10 @@ class PasswordActivity : StylishActivity(),
|
||||
// Hide credentials
|
||||
unlockContainer?.visibility = View.INVISIBLE
|
||||
|
||||
if (PreferencesUtil.deletePasswordAfterConnexionAttempt(this)) {
|
||||
removePassword()
|
||||
}
|
||||
|
||||
// Clear before we load
|
||||
val database = App.currentDatabase
|
||||
database.closeAndClear(applicationContext.filesDir)
|
||||
@@ -632,12 +641,10 @@ class PasswordActivity : StylishActivity(),
|
||||
reInitWithFingerprintMode()
|
||||
}
|
||||
|
||||
// Show credentials
|
||||
unlockContainer?.visibility = View.VISIBLE
|
||||
// Activate the open button
|
||||
confirmButtonView?.isEnabled = true
|
||||
|
||||
if (result.isSuccess) {
|
||||
// Remove the password in view in all cases
|
||||
removePassword()
|
||||
|
||||
if (database.validatePasswordEncoding(password)) {
|
||||
launchGroupActivity()
|
||||
} else {
|
||||
@@ -649,10 +656,16 @@ class PasswordActivity : StylishActivity(),
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Activate the open button
|
||||
confirmButtonView?.isEnabled = true
|
||||
|
||||
if (result.message != null && result.message!!.isNotEmpty()) {
|
||||
Toast.makeText(this@PasswordActivity, result.message, Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}
|
||||
|
||||
// Show credentials
|
||||
unlockContainer?.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,6 +227,12 @@ object PreferencesUtil {
|
||||
context.resources.getBoolean(R.bool.enable_read_only_default))
|
||||
}
|
||||
|
||||
fun deletePasswordAfterConnexionAttempt(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.delete_entered_password_key),
|
||||
context.resources.getBoolean(R.bool.delete_entered_password_default))
|
||||
}
|
||||
|
||||
fun enableKeyboardNotificationEntry(context: Context): Boolean {
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(context)
|
||||
return prefs.getBoolean(context.getString(R.string.keyboard_notification_entry_key),
|
||||
|
||||
Reference in new issue
Block a user