From b0afe8adaa4c8043798120f8638fe95153572857 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Thu, 10 Dec 2020 21:06:45 +0530 Subject: Try to fix missing `.gpg-id` files as well (#1246) (cherry picked from commit c02ad427be3652298f4a07a5f1a0d68e4ac44c45) Signed-off-by: Harsh Shandilya --- .../main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'app/src/main/java/com/zeapo') diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt index 01d85f2b..94a32ea4 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PasswordCreationActivity.kt @@ -335,10 +335,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB // pass enters the key ID into `.gpg-id`. val repoRoot = PasswordRepository.getRepositoryDirectory() val gpgIdentifierFile = File(repoRoot, directory.text.toString()).findTillRoot(".gpg-id", repoRoot) - if (gpgIdentifierFile == null) { - snackbar(message = resources.getString(R.string.failed_to_find_key_id)) - return@with - } + ?: File(repoRoot, ".gpg-id").apply { createNewFile() } val gpgIdentifiers = gpgIdentifierFile.readLines() .filter { it.isNotBlank() } .map { line -> -- cgit v1.2.3