diff options
author | Mohamed Zenadi <mohamed@zenadi.com> | 2015-06-17 21:18:26 +0200 |
---|---|---|
committer | Mohamed Zenadi <mohamed@zenadi.com> | 2015-06-17 21:18:26 +0200 |
commit | 1db4f7bbc31d0e9f24247e4973474d37f12ab72d (patch) | |
tree | 05dda1938b72db7eed2d741a33cc22d9f1cf7dfd /app/src/main/java | |
parent | bfdccf4d920f5172a3d88ac0358e0b06ad5fe520 (diff) |
Add the option for not showing the passwords after decrypt
fixes #90
Diffstat (limited to 'app/src/main/java')
-rw-r--r-- | app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java index 10888ae6..28aea81e 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -318,22 +318,29 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne if (requestCode == REQUEST_CODE_DECRYPT_AND_VERIFY && os != null) { try { if (returnToCiphertextField) { - findViewById(R.id.crypto_container).setVisibility(View.VISIBLE); - Typeface type = Typeface.createFromAsset(getAssets(), "fonts/sourcecodepro.ttf"); - String[] passContent = os.toString("UTF-8").split("\n"); - ((TextView) findViewById(R.id.crypto_password_show)) - .setTypeface(type); - ((TextView) findViewById(R.id.crypto_password_show)) - .setText(passContent[0]); - - String extraContent = os.toString("UTF-8").replaceFirst(".*\n", ""); - if (extraContent.length() != 0) { - ((TextView) findViewById(R.id.crypto_extra_show)) + boolean showPassword = settings.getBoolean("show_password", true); + + if (showPassword) { + findViewById(R.id.crypto_container).setVisibility(View.VISIBLE); + Typeface type = Typeface.createFromAsset(getAssets(), "fonts/sourcecodepro.ttf"); + String[] passContent = os.toString("UTF-8").split("\n"); + ((TextView) findViewById(R.id.crypto_password_show)) .setTypeface(type); - ((TextView) findViewById(R.id.crypto_extra_show)) - .setText(extraContent); + ((TextView) findViewById(R.id.crypto_password_show)) + .setText(passContent[0]); + + String extraContent = os.toString("UTF-8").replaceFirst(".*\n", ""); + if (extraContent.length() != 0) { + ((TextView) findViewById(R.id.crypto_extra_show)) + .setTypeface(type); + ((TextView) findViewById(R.id.crypto_extra_show)) + .setText(extraContent); + } + new DelayShow().execute(); + } else { + activity.setResult(RESULT_CANCELED); + activity.finish(); } - new DelayShow().execute(); if (settings.getBoolean("copy_on_decrypt", true)) { copyToClipBoard(); } |