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

This commit is contained in:
Thialfihar
2010-04-15 14:37:46 +00:00
parent b8009d6d43
commit acd71a45c0
4 changed files with 19 additions and 9 deletions

View File

@@ -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 {