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 +---- app/src/main/res/values-fr/strings.xml | 1 - app/src/main/res/values-pt-rBR/strings.xml | 1 - app/src/main/res/values-ru/strings.xml | 1 - app/src/main/res/values/strings.xml | 1 - 5 files changed, 1 insertion(+), 8 deletions(-) (limited to 'app/src/main') 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 -> diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index cac0550d..b4e35467 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -264,7 +264,6 @@ Erreur Exportation des mots de passe… - Impossible de localiser .gpg-id, votre dépôt est-il correctement configuré ? Un ID de clé dans .gpg-id est trop court, veuillez utiliser soit des identifiants de clés longs (16 caractères) soit des empreintes digitales (40 caractères) Dossier Définir la clé GPG pour le dossier diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 284b1cf6..846a9993 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -299,7 +299,6 @@ Configuração TOTP importada com sucesso Falha ao importar a configuração TOTP Exportando senhas… - Falha ao localizar .gpg-id, seu store está configurado corretamente? Encontrado .gpg-id, mas contém uma ID de chave inválida, fingerprint ou ID de usuário O ID de chave em .gpg-id é muito curto, por favor utilize os IDs de chaves longos (16 caracteres) ou fingerprints (40 caracteres) Nome do arquivo não deve conter \'/\', defina o diretório acima diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 157023eb..3bf97f11 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -303,7 +303,6 @@ Конфигурация TOTP успешно импортирована Не удалось импортировать конфигурацию TOTP Экспорт паролей… - Не удалось найти .gpg-id, ваше хранилище настроено корректно? Найден .gpg-id, но он содержит неверный ID ключа, fingerprint или ID пользователя Идентификатор ключа в .gpg-id слишком короткий, пожалуйста, используйте длинные идентификаторы (16 символов) или fingerprint (40 символов) Имя файла не должно содержать \'/\', укажите директорию выше diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 984b961c..6bfc1977 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -361,7 +361,6 @@ Successfully imported TOTP configuration Failed to import TOTP configuration Exporting passwords… - Failed to locate .gpg-id, is your store set up correctly? Found .gpg-id, but it contains an invalid key ID, fingerprint or user ID A key ID in .gpg-id is too short, please use either long key IDs (16 characters) or fingerprints (40 characters) File name must not contain \'/\', set directory above -- cgit v1.2.3