From cdf45bc323bd21eeb6252c9d9b70a990f7b39b75 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sun, 27 Oct 2019 00:14:42 +0530 Subject: Add setting to save OpenKeychain auth keyid (#554) * Add setting to save OpenKeychain auth keyid * Hide pref not disable Co-Authored-By: Reagan Sanders Signed-off-by: Harsh Shandilya --- app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt') diff --git a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt index cf9c3442..53ed3461 100644 --- a/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/git/GitActivity.kt @@ -613,7 +613,7 @@ open class GitActivity : AppCompatActivity() { } } - override fun onActivityResult( + public override fun onActivityResult( requestCode: Int, resultCode: Int, data: Intent? @@ -625,9 +625,17 @@ open class GitActivity : AppCompatActivity() { // background thread - the actual signing of the SSH challenge. We pass through the // completed signature to the ApiIdentity, which will be blocked in the other thread // waiting for it. - if (requestCode == SshApiSessionFactory.POST_SIGNATURE && identity != null) + if (requestCode == SshApiSessionFactory.POST_SIGNATURE && identity != null) { identity!!.postSignature(data) + // If the signature failed (usually because it was cancelled), reset state + if (data == null) { + identity = null + identityBuilder = null + } + return + } + if (resultCode == AppCompatActivity.RESULT_CANCELED) { setResult(AppCompatActivity.RESULT_CANCELED) finish() -- cgit v1.2.3