From 197af98bb541b12eb24b1c0e3c8976763114e647 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 13 Mar 2021 03:05:03 +0530 Subject: Append trailing newline to `.gpg-id` during creation (#1344) --- .../main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt | 2 +- .../dev/msfjarvis/aps/ui/onboarding/fragments/KeySelectionFragment.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt index dfde4845..17b99935 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt @@ -105,7 +105,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB lifecycleScope.launch { val gpgIdentifierFile = File(PasswordRepository.getRepositoryDirectory(), ".gpg-id") withContext(Dispatchers.IO) { - gpgIdentifierFile.writeText(keyIds.joinToString("\n")) + gpgIdentifierFile.writeText((keyIds + "").joinToString("\n")) } commitChange(getString( R.string.git_commit_gpg_id, diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/onboarding/fragments/KeySelectionFragment.kt b/app/src/main/java/dev/msfjarvis/aps/ui/onboarding/fragments/KeySelectionFragment.kt index 6ba73aef..44e533cb 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/onboarding/fragments/KeySelectionFragment.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/onboarding/fragments/KeySelectionFragment.kt @@ -39,7 +39,7 @@ class KeySelectionFragment : Fragment(R.layout.fragment_key_selection) { lifecycleScope.launch { withContext(Dispatchers.IO) { val gpgIdentifierFile = File(PasswordRepository.getRepositoryDirectory(), ".gpg-id") - gpgIdentifierFile.writeText(keyIds.joinToString("\n")) + gpgIdentifierFile.writeText((keyIds + "").joinToString("\n")) } settings.edit { putBoolean(PreferenceKeys.REPOSITORY_INITIALIZED, true) } requireActivity().commitChange(getString( -- cgit v1.2.3