diff options
author | Markus Doits <markus.doits@gmail.com> | 2011-01-18 22:24:28 +0000 |
---|---|---|
committer | Markus Doits <markus.doits@gmail.com> | 2011-01-18 22:24:28 +0000 |
commit | 79cf07f1e23f5b19c151b360cc25fc9c5a62589f (patch) | |
tree | eb99f6019e1ccd31b9d209ddeead0ea5adfe6f83 /src | |
parent | 945e8bb25bd3bff3b03be3061113895ab78033a9 (diff) | |
download | open-keychain-79cf07f1e23f5b19c151b360cc25fc9c5a62589f.tar.gz open-keychain-79cf07f1e23f5b19c151b360cc25fc9c5a62589f.tar.bz2 open-keychain-79cf07f1e23f5b19c151b360cc25fc9c5a62589f.zip |
Compare strings like they should be compared
Diffstat (limited to 'src')
-rw-r--r-- | src/org/thialfihar/android/apg/ApgService.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/thialfihar/android/apg/ApgService.java b/src/org/thialfihar/android/apg/ApgService.java index 72f0e5dcc..fe9e84d4b 100644 --- a/src/org/thialfihar/android/apg/ApgService.java +++ b/src/org/thialfihar/android/apg/ApgService.java @@ -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 { |