|
|
@ -24,13 +24,13 @@ import android.util.Pair;
|
|
|
|
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.crypto.AsymmetricMasterCipher;
|
|
|
|
import org.thoughtcrime.securesms.crypto.AsymmetricMasterCipher;
|
|
|
|
import org.thoughtcrime.securesms.crypto.AsymmetricMasterSecret;
|
|
|
|
import org.thoughtcrime.securesms.crypto.AsymmetricMasterSecret;
|
|
|
|
import org.whispersystems.textsecure.crypto.InvalidMessageException;
|
|
|
|
|
|
|
|
import org.whispersystems.textsecure.crypto.MasterCipher;
|
|
|
|
|
|
|
|
import org.whispersystems.textsecure.crypto.MasterSecret;
|
|
|
|
|
|
|
|
import org.thoughtcrime.securesms.database.model.DisplayRecord;
|
|
|
|
import org.thoughtcrime.securesms.database.model.DisplayRecord;
|
|
|
|
import org.thoughtcrime.securesms.sms.IncomingTextMessage;
|
|
|
|
import org.thoughtcrime.securesms.sms.IncomingTextMessage;
|
|
|
|
import org.thoughtcrime.securesms.sms.OutgoingTextMessage;
|
|
|
|
import org.thoughtcrime.securesms.sms.OutgoingTextMessage;
|
|
|
|
import org.thoughtcrime.securesms.util.LRUCache;
|
|
|
|
import org.thoughtcrime.securesms.util.LRUCache;
|
|
|
|
|
|
|
|
import org.whispersystems.textsecure.crypto.InvalidMessageException;
|
|
|
|
|
|
|
|
import org.whispersystems.textsecure.crypto.MasterCipher;
|
|
|
|
|
|
|
|
import org.whispersystems.textsecure.crypto.MasterSecret;
|
|
|
|
|
|
|
|
|
|
|
|
import java.lang.ref.SoftReference;
|
|
|
|
import java.lang.ref.SoftReference;
|
|
|
|
import java.util.Collections;
|
|
|
|
import java.util.Collections;
|
|
|
@ -145,6 +145,10 @@ public class EncryptingSmsDatabase extends SmsDatabase {
|
|
|
|
long type = cursor.getLong(cursor.getColumnIndexOrThrow(SmsDatabase.TYPE));
|
|
|
|
long type = cursor.getLong(cursor.getColumnIndexOrThrow(SmsDatabase.TYPE));
|
|
|
|
String ciphertext = cursor.getString(cursor.getColumnIndexOrThrow(SmsDatabase.BODY));
|
|
|
|
String ciphertext = cursor.getString(cursor.getColumnIndexOrThrow(SmsDatabase.BODY));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ciphertext == null) {
|
|
|
|
|
|
|
|
return new DisplayRecord.Body("", true);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (SmsDatabase.Types.isSymmetricEncryption(type)) {
|
|
|
|
if (SmsDatabase.Types.isSymmetricEncryption(type)) {
|
|
|
|
String plaintext = plaintextCache.get(ciphertext);
|
|
|
|
String plaintext = plaintextCache.get(ciphertext);
|
|
|
|