mirror of
https://github.com/moparisthebest/open-keychain
synced 2025-02-17 07:30:14 -05:00
Compare strings like they should be compared
This commit is contained in:
parent
945e8bb25b
commit
79cf07f1e2
@ -382,10 +382,10 @@ public class ApgService extends Service {
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception in encrypt");
|
||||
String _msg = e.getMessage();
|
||||
if (_msg == getBaseContext().getString(R.string.error_noSignaturePassPhrase)) {
|
||||
if (_msg.equals(getBaseContext().getString(R.string.error_noSignaturePassPhrase))) {
|
||||
pReturn.getStringArrayList(ret.ERRORS.name()).add("Cannot encrypt (" + arg.PRIVATE_KEY_PASSPHRASE.name() + " missing): " + _msg);
|
||||
pReturn.putInt(ret.ERROR.name(), error.PRIVATE_KEY_PASSPHRASE_MISSING.ordinal());
|
||||
} else if (_msg == getBaseContext().getString(R.string.error_couldNotExtractPrivateKey)) {
|
||||
} else if (_msg.equals(getBaseContext().getString(R.string.error_couldNotExtractPrivateKey))) {
|
||||
pReturn.getStringArrayList(ret.ERRORS.name()).add("Cannot encrypt (" + arg.PRIVATE_KEY_PASSPHRASE.name() + " probably wrong): " + _msg);
|
||||
pReturn.putInt(ret.ERROR.name(), error.PRIVATE_KEY_PASSPHRASE_WRONG.ordinal());
|
||||
} else {
|
||||
@ -436,10 +436,10 @@ public class ApgService extends Service {
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "Exception in decrypt");
|
||||
String _msg = e.getMessage();
|
||||
if (_msg == getBaseContext().getString(R.string.error_noSecretKeyFound)) {
|
||||
if (_msg.equals(getBaseContext().getString(R.string.error_noSecretKeyFound))) {
|
||||
pReturn.getStringArrayList(ret.ERRORS.name()).add("Cannot decrypt: " + _msg);
|
||||
pReturn.putInt(ret.ERROR.name(), error.NO_MATCHING_SECRET_KEY.ordinal());
|
||||
} else if (_msg == getBaseContext().getString(R.string.error_wrongPassPhrase)) {
|
||||
} else if (_msg.equals(getBaseContext().getString(R.string.error_wrongPassPhrase))) {
|
||||
pReturn.getStringArrayList(ret.ERRORS.name()).add("Cannot decrypt (" + arg.PRIVATE_KEY_PASSPHRASE.name() + " wrong/missing): " + _msg);
|
||||
pReturn.putInt(ret.ERROR.name(), error.PRIVATE_KEY_PASSPHRASE_WRONG.ordinal());
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user