mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-17 08:25:46 +00:00
Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5def8ba78d | ||
|
|
42da687602 | ||
|
|
e64c067636 | ||
|
|
c89fbabbf3 | ||
|
|
778b8b490c | ||
|
|
bade52d748 | ||
|
|
abc322b075 | ||
|
|
9a31c5961a | ||
|
|
f536e45378 | ||
|
|
18961e6369 | ||
|
|
1505ec8c35 | ||
|
|
d41efdbd1c | ||
|
|
156cb4034e | ||
|
|
d2e188ee62 |
@@ -2,8 +2,8 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="org.thoughtcrime.securesms"
|
||||
android:versionCode="87"
|
||||
android:versionName="2.3.3">
|
||||
android:versionCode="90"
|
||||
android:versionName="2.4.2">
|
||||
|
||||
<permission android:name="org.thoughtcrime.securesms.ACCESS_SECRETS"
|
||||
android:label="Access to TextSecure Secrets"
|
||||
@@ -90,6 +90,10 @@
|
||||
android:windowSoftInputMode="stateUnchanged"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".ConfirmIdentityActivity"
|
||||
android:theme="@style/TextSecure.Light.Dialog"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
<activity android:name=".MmsPreferencesActivity"
|
||||
android:configChanges="touchscreen|keyboard|keyboardHidden|orientation|screenLayout|screenSize"/>
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ public class ContactsCursorLoader extends CursorLoader {
|
||||
|
||||
@Override
|
||||
public Cursor loadInBackground() {
|
||||
ContactsDatabase.destroyInstance();
|
||||
db = ContactsDatabase.getInstance(context);
|
||||
return db.query(filter, pushOnly);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import org.thoughtcrime.securesms.protocol.WirePrefix;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFactory;
|
||||
import org.thoughtcrime.securesms.recipients.RecipientFormattingException;
|
||||
import org.thoughtcrime.securesms.recipients.Recipients;
|
||||
import org.thoughtcrime.securesms.transport.UndeliverableMessageException;
|
||||
import org.thoughtcrime.securesms.util.Util;
|
||||
import org.whispersystems.libaxolotl.DuplicateMessageException;
|
||||
import org.whispersystems.libaxolotl.InvalidMessageException;
|
||||
@@ -84,7 +85,7 @@ public class MmsCipher {
|
||||
}
|
||||
|
||||
public SendReq encrypt(Context context, SendReq message)
|
||||
throws NoSessionException, RecipientFormattingException
|
||||
throws NoSessionException, RecipientFormattingException, UndeliverableMessageException
|
||||
{
|
||||
EncodedStringValue[] encodedRecipient = message.getTo();
|
||||
String recipientString = encodedRecipient[0].getString();
|
||||
@@ -92,6 +93,10 @@ public class MmsCipher {
|
||||
long recipientId = recipients.getPrimaryRecipient().getRecipientId();
|
||||
byte[] pduBytes = new PduComposer(context, message).make();
|
||||
|
||||
if (pduBytes == null) {
|
||||
throw new UndeliverableMessageException("PDU composition failed, null payload");
|
||||
}
|
||||
|
||||
if (!axolotlStore.containsSession(recipientId, PushAddress.DEFAULT_DEVICE_ID)) {
|
||||
throw new NoSessionException("No session for: " + recipientId);
|
||||
}
|
||||
|
||||
@@ -149,6 +149,8 @@ public class MmsSendJob extends SendJob {
|
||||
String number = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getLine1Number();
|
||||
boolean upgradedSecure = false;
|
||||
|
||||
prepareMessageMedia(masterSecret, message, MediaConstraints.MMS_CONSTRAINTS, true);
|
||||
|
||||
if (MmsDatabase.Types.isSecureType(message.getDatabaseMessageBox())) {
|
||||
message = getEncryptedMessage(masterSecret, message);
|
||||
upgradedSecure = true;
|
||||
@@ -158,10 +160,14 @@ public class MmsSendJob extends SendJob {
|
||||
message.setFrom(new EncodedStringValue(number));
|
||||
}
|
||||
|
||||
prepareMessageMedia(masterSecret, message, MediaConstraints.MMS_CONSTRAINTS, true);
|
||||
|
||||
try {
|
||||
OutgoingMmsConnection connection = new OutgoingMmsConnection(context, radio.getApnInformation(), new PduComposer(context, message).make());
|
||||
byte[] pdu = new PduComposer(context, message).make();
|
||||
|
||||
if (pdu == null) {
|
||||
throw new UndeliverableMessageException("PDU composition failed, null payload");
|
||||
}
|
||||
|
||||
OutgoingMmsConnection connection = new OutgoingMmsConnection(context, radio.getApnInformation(), pdu);
|
||||
SendConf conf = connection.send(usingMmsRadio, useProxy);
|
||||
|
||||
if (conf == null) {
|
||||
@@ -179,7 +185,7 @@ public class MmsSendJob extends SendJob {
|
||||
}
|
||||
|
||||
private SendReq getEncryptedMessage(MasterSecret masterSecret, SendReq pdu)
|
||||
throws InsecureFallbackApprovalException
|
||||
throws InsecureFallbackApprovalException, UndeliverableMessageException
|
||||
{
|
||||
try {
|
||||
MmsCipher cipher = new MmsCipher(new TextSecureAxolotlStore(context, masterSecret));
|
||||
|
||||
@@ -66,7 +66,7 @@ public abstract class SendJob extends MasterSecretJob {
|
||||
resizedData = resizePart(masterSecret, constraints, part);
|
||||
}
|
||||
|
||||
if (toMemory) {
|
||||
if (toMemory && part.getDataUri() != null) {
|
||||
part.setData(resizedData != null ? resizedData : MediaUtil.getPartData(context, masterSecret, part));
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,14 @@ public class PartAuthority {
|
||||
PartDatabase partDatabase = DatabaseFactory.getPartDatabase(context);
|
||||
int match = uriMatcher.match(uri);
|
||||
|
||||
switch (match) {
|
||||
try {
|
||||
switch (match) {
|
||||
case PART_ROW: return partDatabase.getPartStream(masterSecret, ContentUris.parseId(uri));
|
||||
case THUMB_ROW: return partDatabase.getThumbnailStream(masterSecret, ContentUris.parseId(uri));
|
||||
default: return context.getContentResolver().openInputStream(uri);
|
||||
}
|
||||
} catch (SecurityException se) {
|
||||
throw new IOException(se);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -24,7 +24,11 @@ public class PartParser {
|
||||
if (characterSet.equals(CharacterSets.MIMENAME_ANY_CHARSET))
|
||||
characterSet = CharacterSets.MIMENAME_ISO_8859_1;
|
||||
|
||||
partText = new String(body.getPart(i).getData(), characterSet);
|
||||
if (body.getPart(i).getData() != null) {
|
||||
partText = new String(body.getPart(i).getData(), characterSet);
|
||||
} else {
|
||||
partText = "";
|
||||
}
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
Log.w("PartParser", e);
|
||||
partText = "Unsupported Encoding!";
|
||||
|
||||
@@ -92,9 +92,7 @@ public class MediaUtil {
|
||||
}
|
||||
|
||||
public InputStream toDataStream() {
|
||||
InputStream jpegStream = BitmapUtil.toCompressedJpeg(bitmap);
|
||||
bitmap.recycle();
|
||||
return jpegStream;
|
||||
return BitmapUtil.toCompressedJpeg(bitmap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user