aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorMiles Breslin <finalbrez@gmail.com>2019-07-04 00:14:47 -0700
committerHarsh Shandilya <msfjarvis@gmail.com>2019-07-04 12:44:47 +0530
commit2e8fe06b2bbe42009820fd191b3ce740b9cd90ca (patch)
treeb1bf8abf8849ac2cd693ec1403dfb9de4bd6bbe4 /app/src/main
parent143a24efc636d239e9a64835f171cb6e2ac12b85 (diff)
Allow alternate totp format (#523)
Fixes #495
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt b/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt
index 0fad38d7..52ab93d0 100644
--- a/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt
+++ b/app/src/main/java/com/zeapo/pwdstore/PasswordEntry.kt
@@ -83,6 +83,9 @@ class PasswordEntry(private val content: String) {
if (line.startsWith("otpauth://totp/")) {
return Uri.parse(line).getQueryParameter("secret")
}
+ if (line.toLowerCase().startsWith("totp:")) {
+ return line.split(": *".toRegex(), 2).toTypedArray()[1]
+ }
}
return null
}