Decode base64 message text

* Who the f*** sends text in base64.  Oh, that's right - we do.

Bug: 7074378
Change-Id: Ic20c6e2aba0b700cbb2cd032f5e541c9a9f83239
This commit is contained in:
Marc Blank 2012-09-03 14:01:30 -07:00
parent b82ae909d7
commit e6c576a629

View File

@ -26,8 +26,8 @@ import android.database.Cursor;
import android.net.TrafficStats; import android.net.TrafficStats;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Debug;
import android.os.RemoteException; import android.os.RemoteException;
import android.util.Base64;
import android.util.Log; import android.util.Log;
import com.android.email.imap2.smtp.SmtpSender; import com.android.email.imap2.smtp.SmtpSender;
@ -915,6 +915,7 @@ public class Imap2SyncService extends AbstractSyncService {
//String charset = getCharset(thisLoc); //String charset = getCharset(thisLoc);
boolean qp = att.mEncoding.equalsIgnoreCase("quoted-printable"); boolean qp = att.mEncoding.equalsIgnoreCase("quoted-printable");
boolean b64 = att.mEncoding.equalsIgnoreCase("base64");
int br = res.indexOf('{'); int br = res.indexOf('{');
if (br > 0) { if (br > 0) {
@ -931,6 +932,9 @@ public class Imap2SyncService extends AbstractSyncService {
if (qp) { if (qp) {
length = QuotedPrintable.decode(buf, length); length = QuotedPrintable.decode(buf, length);
} else if (b64) {
buf = Base64.decode(buf, Base64.DEFAULT);
length = buf.length;
} }
if (lastPart) { if (lastPart) {