From c54d28af8a0366b195019e153b276e5d570684ec Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Wed, 26 Aug 2015 03:49:36 -0400 Subject: Disallow name change when editing password --- app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/src/main/java/com') 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 67311774..d7664780 100644 --- a/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java +++ b/app/src/main/java/com/zeapo/pwdstore/crypto/PgpHandler.java @@ -160,16 +160,20 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne ((EditText) findViewById(R.id.crypto_extra_edit)).setTypeface(monoTypeface); ((TextView) findViewById(R.id.crypto_password_category)).setText(category); - ((TextView) findViewById(R.id.crypto_password_file_edit)).setText(file); + ((EditText) findViewById(R.id.crypto_password_file_edit)).setText(file); ((EditText) findViewById(R.id.crypto_password_edit)).setText(password); ((EditText) findViewById(R.id.crypto_extra_edit)).setText(extra); + // strictly editing only i.e. can't save this password's info to another file by changing name + findViewById(R.id.crypto_password_file_edit).setEnabled(false); + // the original intent was to decrypt so FILE_PATH will have the file, not enclosing dir // PgpCallback expects the dir when encrypting String filePath = getIntent().getExtras().getString("FILE_PATH"); String directoryPath = filePath.substring(0, filePath.lastIndexOf(File.separator)); Intent intent = new Intent(this, PgpHandler.class); intent.putExtra("FILE_PATH", directoryPath); + intent.putExtra("Operation", "ENCRYPT"); setIntent(intent); } -- cgit v1.2.3