diff options
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 { |