Resolved a few MMS issues.

1) Fixed the "Unsupported Encoding!" problem.

2) Workaround for the Sprint issue, where the MMSC is adding a single
   extra byte to the end of each encrypted message.

3) Fixed the "large blob of base64 text" on encrypted MMS problem.
This commit is contained in:
Moxie Marlinspike
2013-05-25 13:17:18 -07:00
parent d2a78ea84c
commit 8524cc5598
6 changed files with 38 additions and 19 deletions

View File

@@ -209,20 +209,21 @@ public class MmsSender extends MmscProcessor {
EncodedStringValue[] encodedRecipient = pdu.getTo();
String recipient = encodedRecipient[0].getString();
byte[] pduBytes = new PduComposer(context, pdu).make();
byte[] encryptedPdu = getEncryptedPdu(masterSecret, recipient, pduBytes);
Log.w("MmsSendeR", "Got encrypted bytes: " + encryptedPdu.length);
PduBody body = new PduBody();
PduPart part = new PduPart();
byte[] encryptedPduBytes = getEncryptedPdu(masterSecret, recipient, pduBytes);
PduBody body = new PduBody();
PduPart part = new PduPart();
SendReq encryptedPdu = new SendReq(pdu.getPduHeaders(), body);
part.setContentId((System.currentTimeMillis()+"").getBytes());
part.setContentType(ContentType.TEXT_PLAIN.getBytes());
part.setName((System.currentTimeMillis()+"").getBytes());
part.setData(encryptedPdu);
part.setData(encryptedPduBytes);
body.addPart(part);
pdu.setSubject(new EncodedStringValue(WirePrefix.calculateEncryptedMmsSubject()));
pdu.setBody(body);
encryptedPdu.setSubject(new EncodedStringValue(WirePrefix.calculateEncryptedMmsSubject()));
encryptedPdu.setBody(body);
return pdu;
return encryptedPdu;
}
private void scheduleSendWithMmsRadioAndProxy(SendItem item) {