mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-08-31 14:25:28 +00:00
Fix TOTP import button check semantics (#982)
* Improve TOTP checking semantics
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Fix return label
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* update CHANGELOG
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
* Move updateViewState() call outside with(binding) scope
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
(cherry picked from commit ecf96aa066
)
This commit is contained in:
committed by
Harsh Shandilya
parent
64a6e0f4e9
commit
c132cc98e6
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Properly handle cases where files contain only TOTP secrets and no password
|
- Properly handle cases where files contain only TOTP secrets and no password
|
||||||
|
- Correctly hide TOTP import button when TOTP secret/OTPAUTH URL is already present in extra content
|
||||||
|
|
||||||
## [1.10.1] - 2020-07-23
|
## [1.10.1] - 2020-07-23
|
||||||
|
|
||||||
|
@@ -177,13 +177,11 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
|
|||||||
extraContent.setText(entry.extraContentWithoutAuthData)
|
extraContent.setText(entry.extraContentWithoutAuthData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateViewState()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
listOf(filename, extraContent).forEach {
|
listOf(filename, extraContent).forEach {
|
||||||
it.doOnTextChanged { _, _, _, _ -> updateViewState() }
|
it.doOnTextChanged { _, _, _, _ -> updateViewState() }
|
||||||
}
|
}
|
||||||
updateViewState()
|
|
||||||
}
|
}
|
||||||
suggestedPass?.let {
|
suggestedPass?.let {
|
||||||
password.setText(it)
|
password.setText(it)
|
||||||
@@ -195,6 +193,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
|
|||||||
password.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
|
password.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
updateViewState()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
override fun onCreateOptionsMenu(menu: Menu?): Boolean {
|
||||||
@@ -235,7 +234,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
|
|||||||
val entry = PasswordEntry("PLACEHOLDER\n${extraContent.text}")
|
val entry = PasswordEntry("PLACEHOLDER\n${extraContent.text}")
|
||||||
encryptUsername.apply {
|
encryptUsername.apply {
|
||||||
if (visibility != View.VISIBLE)
|
if (visibility != View.VISIBLE)
|
||||||
return@with
|
return@apply
|
||||||
val hasUsernameInFileName = filename.text.toString().isNotBlank()
|
val hasUsernameInFileName = filename.text.toString().isNotBlank()
|
||||||
val hasUsernameInExtras = entry.hasUsername()
|
val hasUsernameInExtras = entry.hasUsername()
|
||||||
isEnabled = hasUsernameInFileName xor hasUsernameInExtras
|
isEnabled = hasUsernameInFileName xor hasUsernameInExtras
|
||||||
@@ -420,8 +419,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB
|
|||||||
AutofillPreferences.directoryStructure(applicationContext)
|
AutofillPreferences.directoryStructure(applicationContext)
|
||||||
val entry = PasswordEntry(content)
|
val entry = PasswordEntry(content)
|
||||||
returnIntent.putExtra(RETURN_EXTRA_PASSWORD, entry.password)
|
returnIntent.putExtra(RETURN_EXTRA_PASSWORD, entry.password)
|
||||||
val username = PasswordEntry(content).username
|
val username = entry.username ?: directoryStructure.getUsernameFor(file)
|
||||||
?: directoryStructure.getUsernameFor(file)
|
|
||||||
returnIntent.putExtra(RETURN_EXTRA_USERNAME, username)
|
returnIntent.putExtra(RETURN_EXTRA_USERNAME, username)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user