mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-01 14:55:19 +00:00
Disallow name change when editing password
This commit is contained in:
@@ -160,16 +160,20 @@ public class PgpHandler extends AppCompatActivity implements OpenPgpServiceConne
|
|||||||
((EditText) findViewById(R.id.crypto_extra_edit)).setTypeface(monoTypeface);
|
((EditText) findViewById(R.id.crypto_extra_edit)).setTypeface(monoTypeface);
|
||||||
|
|
||||||
((TextView) findViewById(R.id.crypto_password_category)).setText(category);
|
((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_password_edit)).setText(password);
|
||||||
((EditText) findViewById(R.id.crypto_extra_edit)).setText(extra);
|
((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
|
// the original intent was to decrypt so FILE_PATH will have the file, not enclosing dir
|
||||||
// PgpCallback expects the dir when encrypting
|
// PgpCallback expects the dir when encrypting
|
||||||
String filePath = getIntent().getExtras().getString("FILE_PATH");
|
String filePath = getIntent().getExtras().getString("FILE_PATH");
|
||||||
String directoryPath = filePath.substring(0, filePath.lastIndexOf(File.separator));
|
String directoryPath = filePath.substring(0, filePath.lastIndexOf(File.separator));
|
||||||
Intent intent = new Intent(this, PgpHandler.class);
|
Intent intent = new Intent(this, PgpHandler.class);
|
||||||
intent.putExtra("FILE_PATH", directoryPath);
|
intent.putExtra("FILE_PATH", directoryPath);
|
||||||
|
intent.putExtra("Operation", "ENCRYPT");
|
||||||
setIntent(intent);
|
setIntent(intent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user