mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-23 18:15:22 +00:00
Send "unidentified sender" messages as plain text.
This commit is contained in:
parent
63d1e7087a
commit
ea0c3c8a36
@ -135,7 +135,7 @@ public class PushGroupSendJob extends PushSendJob implements InjectableType {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPushSend()
|
public void onPushSend()
|
||||||
throws IOException, MmsException, NoSuchMessageException, RetryLaterException
|
throws IOException, MmsException, NoSuchMessageException, RetryLaterException
|
||||||
{
|
{
|
||||||
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
|
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
|
||||||
OutgoingMediaMessage message = database.getOutgoingMessage(messageId);
|
OutgoingMediaMessage message = database.getOutgoingMessage(messageId);
|
||||||
|
@ -23,13 +23,20 @@ class LokiServiceCipher(
|
|||||||
|
|
||||||
override fun decrypt(envelope: SignalServiceEnvelope, ciphertext: ByteArray): Plaintext {
|
override fun decrypt(envelope: SignalServiceEnvelope, ciphertext: ByteArray): Plaintext {
|
||||||
// return if (envelope.isFallbackMessage) decryptFallbackMessage(envelope, ciphertext) else super.decrypt(envelope, ciphertext)
|
// return if (envelope.isFallbackMessage) decryptFallbackMessage(envelope, ciphertext) else super.decrypt(envelope, ciphertext)
|
||||||
// return decryptFallbackMessage(envelope, ciphertext);
|
|
||||||
|
|
||||||
//AC: Messages come unencrypted (for refactoring time being).
|
return when {
|
||||||
val transportDetails = PushTransportDetails(FallbackSessionCipher.sessionVersion)
|
envelope.isUnidentifiedSender -> {
|
||||||
val unpaddedMessageBody = transportDetails.getStrippedPaddingMessageBody(ciphertext)
|
//AC: Messages come unencrypted (for refactoring time being).
|
||||||
val metadata = Metadata(envelope.source, envelope.sourceDevice, envelope.timestamp, false)
|
val transportDetails = PushTransportDetails(FallbackSessionCipher.sessionVersion)
|
||||||
return Plaintext(metadata, unpaddedMessageBody)
|
val unpaddedMessageBody = transportDetails.getStrippedPaddingMessageBody(ciphertext)
|
||||||
|
val metadata = Metadata(envelope.source, envelope.sourceDevice, envelope.timestamp, false)
|
||||||
|
return Plaintext(metadata, unpaddedMessageBody)
|
||||||
|
}
|
||||||
|
envelope.isFallbackMessage ->
|
||||||
|
decryptFallbackMessage(envelope, ciphertext)
|
||||||
|
else ->
|
||||||
|
super.decrypt(envelope, ciphertext)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun decryptFallbackMessage(envelope: SignalServiceEnvelope, ciphertext: ByteArray): Plaintext {
|
private fun decryptFallbackMessage(envelope: SignalServiceEnvelope, ciphertext: ByteArray): Plaintext {
|
||||||
|
Loading…
Reference in New Issue
Block a user