Compare commits

...

14 Commits

Author SHA1 Message Date
Moxie Marlinspike
5def8ba78d Bump version to 2.4.2
// FREEBIE
2015-01-14 13:51:53 -08:00
Jake McGinty
42da687602 Revert "add theme to import/export activity"
This reverts commit e64c067636.
2015-01-14 10:23:10 -10:00
Calvin Hu
e64c067636 add theme to import/export activity 2015-01-14 10:03:02 -10:00
Calvin Hu
c89fbabbf3 refresh contacts database on new db query 2015-01-13 15:16:30 -10:00
Moxie Marlinspike
778b8b490c Merge pull request #2346 from mcginty/thumbnail-early-recycle
fix early recycling of thumbnail
2015-01-13 16:21:15 -08:00
Jake McGinty
bade52d748 fix early recycling of thumbnail
// FREEBIE
2015-01-13 14:17:03 -10:00
Moxie Marlinspike
abc322b075 Bump version to 2.4.1
// FREEBIE
2015-01-13 16:01:58 -08:00
Moxie Marlinspike
9a31c5961a Merge pull request #2341 from mcginty/mms-recv-null-text
don't fail on null received text parts
2015-01-13 12:35:22 -08:00
Jake McGinty
f536e45378 don't fail on null received text parts
Fixes #2340
// FREEBIE
2015-01-13 10:15:18 -10:00
Moxie Marlinspike
18961e6369 Merge pull request #2339 from mcginty/content-security-exception
catch content security exception
2015-01-13 12:02:24 -08:00
Jake McGinty
1505ec8c35 catch ContentProvider SecurityExceptions to avoid crashes
// FREEBIE
2015-01-13 10:00:19 -10:00
Jake McGinty
d41efdbd1c prepareMessageMedia before we encrypt
and fail more nicely when pdu composition fails

// FREEBIE

Closes #2338
2015-01-13 11:59:03 -08:00
Jake McGinty
156cb4034e don't copy data when no dataUri
Fixes #2336
// FREEBIE
2015-01-13 11:57:46 -08:00
Moxie Marlinspike
d2e188ee62 Bump version to 2.4.0
// FREEBIE
2015-01-13 11:54:36 -08:00
8 changed files with 35 additions and 13 deletions

View File

@@ -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"/>

View File

@@ -41,6 +41,7 @@ public class ContactsCursorLoader extends CursorLoader {
@Override
public Cursor loadInBackground() {
ContactsDatabase.destroyInstance();
db = ContactsDatabase.getInstance(context);
return db.query(filter, pushOnly);
}

View File

@@ -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);
}

View File

@@ -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));

View File

@@ -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));
}

View File

@@ -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);
}
}

View File

@@ -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!";

View File

@@ -92,9 +92,7 @@ public class MediaUtil {
}
public InputStream toDataStream() {
InputStream jpegStream = BitmapUtil.toCompressedJpeg(bitmap);
bitmap.recycle();
return jpegStream;
return BitmapUtil.toCompressedJpeg(bitmap);
}
}
}