diff options
author | Thialfihar <thialfihar@gmail.com> | 2010-04-15 14:37:46 +0000 |
---|---|---|
committer | Thialfihar <thialfihar@gmail.com> | 2010-04-15 14:37:46 +0000 |
commit | acd71a45c09ad6668a03ec74399d8f526ab647e2 (patch) | |
tree | da6f4d3ee14825120083d9c838a804e9e918a2a0 /src/org/thialfihar/android/apg/DecryptMessageActivity.java | |
parent | b8009d6d43277a7840819885a64aeda9e5f582e7 (diff) | |
download | open-keychain-acd71a45c09ad6668a03ec74399d8f526ab647e2.tar.gz open-keychain-acd71a45c09ad6668a03ec74399d8f526ab647e2.tar.bz2 open-keychain-acd71a45c09ad6668a03ec74399d8f526ab647e2.zip |
minor layout fixes, replace non breakable spaces if found in an encrypted armored message, as they break the decryption, the HTML representation of GMail introduces them for empty lines ending in a normal space, also adjusted the PGP_MESSAGE regex to allow for spaces after the -----, which seems to be added by some implementations
Diffstat (limited to 'src/org/thialfihar/android/apg/DecryptMessageActivity.java')
-rw-r--r-- | src/org/thialfihar/android/apg/DecryptMessageActivity.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/thialfihar/android/apg/DecryptMessageActivity.java b/src/org/thialfihar/android/apg/DecryptMessageActivity.java index 179d5be55..055c8256c 100644 --- a/src/org/thialfihar/android/apg/DecryptMessageActivity.java +++ b/src/org/thialfihar/android/apg/DecryptMessageActivity.java @@ -190,6 +190,8 @@ public class DecryptMessageActivity extends Activity Matcher matcher = Apg.PGP_MESSAGE.matcher(data); if (matcher.matches()) { data = matcher.group(1); + // replace non breakable spaces + data = data.replaceAll("\\xa0", " "); mMessage.setText(data); } } @@ -312,8 +314,9 @@ public class DecryptMessageActivity extends Activity Bundle data = new Bundle(); Message msg = new Message(); - ByteArrayInputStream in = - new ByteArrayInputStream(mMessage.getText().toString().getBytes()); + String messageData = mMessage.getText().toString(); + + ByteArrayInputStream in = new ByteArrayInputStream(messageData.getBytes()); ByteArrayOutputStream out = new ByteArrayOutputStream(); try { |