From e7982f1f0c5801a42065e803fa36110a9fdf4d62 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 13 Jun 2023 00:44:50 +0530 Subject: fix: allow `gpg-id` to be the first line of a `.gpg-id` file --- app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt b/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt index fe59b4ff..417565a7 100644 --- a/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt +++ b/app/src/main/java/app/passwordstore/ui/crypto/BasePgpActivity.kt @@ -168,6 +168,8 @@ open class BasePgpActivity : AppCompatActivity() { // file we created. Skip the validation so we can make the user add a // real ID. if (line.isEmpty()) return@run + // Apparently `gpg-id` being the first line is also acceptable? + if (line == "gpg-id") return@run if (line.removePrefix("0x").matches("[a-fA-F0-9]{8}".toRegex()).not()) { snackbar(message = resources.getString(R.string.invalid_gpg_id)) } -- cgit v1.2.3