aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorHarsh Shandilya <msfjarvis@gmail.com>2020-11-06 10:50:34 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2020-12-21 20:16:42 +0530
commitda8ca8b46d5d842670c9400c9a55b181eceb10b2 (patch)
tree79d3392614fc7718dba804e4abdcc5b4873a9f93 /app/src/main/java
parent7aee68f1fa60c4565361883511cd4eb490bc4929 (diff)
Fix extra content for multiple username fields (#1192)
Fixes #1190 Signed-off-by: Harsh Shandilya <me@msfjarvis.dev> (cherry picked from commit df6ebfee27597887075b94a945e707ecd69decb1)
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/model/PasswordEntry.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/model/PasswordEntry.kt b/app/src/main/java/com/zeapo/pwdstore/model/PasswordEntry.kt
index a143fcb9..5727c4ba 100644
--- a/app/src/main/java/com/zeapo/pwdstore/model/PasswordEntry.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/model/PasswordEntry.kt
@@ -60,9 +60,11 @@ class PasswordEntry(content: String, private val totpFinder: TotpFinder = UriTot
}
val extraContentWithoutAuthData by lazy(LazyThreadSafetyMode.NONE) {
+ var foundUsername = false
extraContent.splitToSequence("\n").filter { line ->
return@filter when {
- USERNAME_FIELDS.any { prefix -> line.startsWith(prefix, ignoreCase = true) } -> {
+ USERNAME_FIELDS.any { prefix -> line.startsWith(prefix, ignoreCase = true) } && !foundUsername -> {
+ foundUsername = true
false
}
line.startsWith("otpauth://", ignoreCase = true) ||