mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-03 10:32:39 +00:00
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:
@@ -23,16 +23,15 @@ import android.util.Log;
|
||||
import org.apache.http.HttpHost;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.StatusLine;
|
||||
import org.apache.http.client.ClientProtocolException;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
|
||||
import ws.com.google.android.mms.pdu.PduParser;
|
||||
import ws.com.google.android.mms.pdu.RetrieveConf;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import ws.com.google.android.mms.pdu.PduParser;
|
||||
import ws.com.google.android.mms.pdu.RetrieveConf;
|
||||
|
||||
public class MmsDownloadHelper extends MmsCommunication {
|
||||
|
||||
private static byte[] makeRequest(Context context, MmsConnectionParameters connectionParameters, String url)
|
||||
|
||||
@@ -30,13 +30,13 @@ import org.apache.http.entity.ByteArrayEntity;
|
||||
import org.thoughtcrime.securesms.service.MmscProcessor;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
|
||||
import ws.com.google.android.mms.pdu.PduParser;
|
||||
import ws.com.google.android.mms.pdu.SendConf;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import ws.com.google.android.mms.pdu.PduParser;
|
||||
import ws.com.google.android.mms.pdu.SendConf;
|
||||
|
||||
public class MmsSendHelper extends MmsCommunication {
|
||||
|
||||
private static byte[] makePost(Context context, MmsConnectionParameters parameters, byte[] mms) throws ClientProtocolException, IOException {
|
||||
|
||||
@@ -19,8 +19,12 @@ public class PartParser {
|
||||
String partText;
|
||||
|
||||
try {
|
||||
partText = new String(body.getPart(i).getData(),
|
||||
CharacterSets.getMimeName(body.getPart(i).getCharset()));
|
||||
String characterSet = CharacterSets.getMimeName(body.getPart(i).getCharset());
|
||||
|
||||
if (characterSet.equals(CharacterSets.MIMENAME_ANY_CHARSET))
|
||||
characterSet = CharacterSets.MIMENAME_ISO_8859_1;
|
||||
|
||||
partText = new String(body.getPart(i).getData(), characterSet);
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Log.w("PartParser", e);
|
||||
partText = "Unsupported Encoding!";
|
||||
|
||||
Reference in New Issue
Block a user