|
|
@ -23,7 +23,6 @@ import android.content.Context;
|
|
|
|
import android.net.MailTo;
|
|
|
|
import android.net.MailTo;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.text.TextUtils;
|
|
|
|
import android.text.TextUtils;
|
|
|
|
import android.util.Base64;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.sun.mail.util.FolderClosedIOException;
|
|
|
|
import com.sun.mail.util.FolderClosedIOException;
|
|
|
|
import com.sun.mail.util.MessageRemovedIOException;
|
|
|
|
import com.sun.mail.util.MessageRemovedIOException;
|
|
|
@ -33,6 +32,7 @@ import org.jsoup.nodes.Document;
|
|
|
|
import java.io.BufferedInputStream;
|
|
|
|
import java.io.BufferedInputStream;
|
|
|
|
import java.io.BufferedOutputStream;
|
|
|
|
import java.io.BufferedOutputStream;
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.FileInputStream;
|
|
|
|
import java.io.FileInputStream;
|
|
|
@ -58,6 +58,7 @@ import java.util.TimeZone;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.activation.DataHandler;
|
|
|
|
import javax.activation.DataHandler;
|
|
|
|
|
|
|
|
import javax.activation.DataSource;
|
|
|
|
import javax.activation.FileDataSource;
|
|
|
|
import javax.activation.FileDataSource;
|
|
|
|
import javax.activation.FileTypeMap;
|
|
|
|
import javax.activation.FileTypeMap;
|
|
|
|
import javax.mail.Address;
|
|
|
|
import javax.mail.Address;
|
|
|
@ -392,7 +393,27 @@ public class MessageHelper {
|
|
|
|
ct.setParameter("smime-type", "enveloped-data");
|
|
|
|
ct.setParameter("smime-type", "enveloped-data");
|
|
|
|
imessage.setDisposition(Part.ATTACHMENT);
|
|
|
|
imessage.setDisposition(Part.ATTACHMENT);
|
|
|
|
imessage.setFileName(attachment.name);
|
|
|
|
imessage.setFileName(attachment.name);
|
|
|
|
imessage.setContent(Base64.encodeToString(encryptedData, Base64.DEFAULT), ct.toString());
|
|
|
|
imessage.setDataHandler(new DataHandler(new DataSource() {
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public InputStream getInputStream() throws IOException {
|
|
|
|
|
|
|
|
return new ByteArrayInputStream(encryptedData);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public OutputStream getOutputStream() throws IOException {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public String getContentType() {
|
|
|
|
|
|
|
|
return ct.toString();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public String getName() {
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
return imessage;
|
|
|
|
return imessage;
|
|
|
|
}
|
|
|
|
}
|
|
|
|