diff options
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/PasswordStore.java | 6 | ||||
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt | 9 |
2 files changed, 11 insertions, 4 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java index 665e1676..0013bc66 100644 --- a/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java +++ b/app/src/main/java/com/zeapo/pwdstore/PasswordStore.java @@ -425,10 +425,12 @@ public class PasswordStore extends AppCompatActivity { } public void editPassword(PasswordItem item) { - Intent intent = new Intent(this, PgpHandler.class); + Intent intent = new Intent(this, PgpActivity.class); intent.putExtra("NAME", item.toString()); intent.putExtra("FILE_PATH", item.getFile().getAbsolutePath()); - intent.putExtra("Operation", "EDIT"); + intent.putExtra("PARENT_PATH", getCurrentDir().getAbsolutePath()); + intent.putExtra("REPO_PATH", PasswordRepository.getRepositoryDirectory(getApplicationContext()).getAbsolutePath()); + intent.putExtra("OPERATION", "EDIT"); startActivityForResult(intent, PgpHandler.REQUEST_CODE_EDIT); } diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt index 749d0be3..dabf9f81 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpActivity.kt @@ -76,7 +76,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { } when (operation) { - "DECRYPT" -> { + "DECRYPT", "EDIT" -> { setContentView(R.layout.decrypt_layout) crypto_password_category_decrypt.text = "$cat/" crypto_password_file.text = name @@ -168,6 +168,11 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { passwordEntry = entry + if (operation == "EDIT") { + editPassword() + return@executeApiAsync + } + crypto_password_show.typeface = monoTypeface crypto_password_show.text = entry.password @@ -343,7 +348,7 @@ class PgpActivity : AppCompatActivity(), OpenPgpServiceConnection.OnBound { * The action to take when the PGP service is bound */ override fun onBound(service: IOpenPgpService2?) { - if (operation == "DECRYPT") decryptAndVerify() + if (operation in arrayOf("EDIT", "DECRYPT")) decryptAndVerify() } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |