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 10888ae65..28aea81e7 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]); + boolean showPassword = settings.getBoolean("show_password", true); - String extraContent = os.toString("UTF-8").replaceFirst(".*\n", ""); - if (extraContent.length() != 0) { - ((TextView) findViewById(R.id.crypto_extra_show)) + 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(); } diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 3e8f2d71c..e41cda980 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -124,5 +124,8 @@ Synchronize repository Pull from remote Push to remote + Show the password + Control the visibility of the passwords once decrypted, this does not disable the password copy + Password copied into the clipboard diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 36ecb1d81..a8db99ffa 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -125,5 +125,8 @@ Synchronize repository Pull from remote Push to remote + Show the password + Control the visibility of the passwords once decrypted, this does not disable the password copy + Password copied into the clipboard diff --git a/app/src/main/res/xml/preference.xml b/app/src/main/res/xml/preference.xml index d9d4603de..1ddcde413 100644 --- a/app/src/main/res/xml/preference.xml +++ b/app/src/main/res/xml/preference.xml @@ -1,40 +1,67 @@ - - - - - - - - + + + + + + + + - - - - - + + + + + - - - - - + + + + + + \ No newline at end of file