mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-26 14:09:58 +00:00
Add read support for binary service ids.
This commit is contained in:
committed by
jeffrey-signal
parent
bf4aa9cae9
commit
f16405fabf
@@ -27,6 +27,7 @@ import org.whispersystems.signalservice.api.crypto.UnidentifiedAccess
|
||||
import org.whispersystems.signalservice.api.push.DistributionId
|
||||
import org.whispersystems.signalservice.api.push.ServiceId.ACI
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress
|
||||
import org.whispersystems.signalservice.api.util.toByteArray
|
||||
import org.whispersystems.signalservice.internal.push.Content
|
||||
import org.whispersystems.signalservice.internal.push.DataMessage
|
||||
import org.whispersystems.signalservice.internal.push.Envelope
|
||||
@@ -98,6 +99,7 @@ class SignalClient {
|
||||
)
|
||||
|
||||
val encryptedContent: ByteArray = Base64.decode(outgoingPushMessage.content)
|
||||
val serviceGuid = UUID.randomUUID()
|
||||
|
||||
return Envelope(
|
||||
sourceServiceId = aci.toString(),
|
||||
@@ -105,10 +107,13 @@ class SignalClient {
|
||||
destinationServiceId = to.aci.toString(),
|
||||
timestamp = sentTimestamp,
|
||||
serverTimestamp = sentTimestamp,
|
||||
serverGuid = UUID.randomUUID().toString(),
|
||||
serverGuid = serviceGuid.toString(),
|
||||
type = Envelope.Type.fromValue(outgoingPushMessage.type),
|
||||
urgent = true,
|
||||
content = encryptedContent.toByteString()
|
||||
content = encryptedContent.toByteString(),
|
||||
sourceServiceIdBinary = aci.toByteString(),
|
||||
destinationServiceIdBinary = to.aci.toByteString(),
|
||||
serverGuidBinary = serviceGuid.toByteArray().toByteString()
|
||||
)
|
||||
}
|
||||
|
||||
@@ -129,6 +134,7 @@ class SignalClient {
|
||||
)
|
||||
|
||||
val encryptedContent: ByteArray = Base64.decode(outgoingPushMessage.content)
|
||||
val serverGuid = UUID.randomUUID()
|
||||
|
||||
return Envelope(
|
||||
sourceServiceId = aci.toString(),
|
||||
@@ -136,10 +142,13 @@ class SignalClient {
|
||||
destinationServiceId = to.aci.toString(),
|
||||
timestamp = sentTimestamp,
|
||||
serverTimestamp = sentTimestamp,
|
||||
serverGuid = UUID.randomUUID().toString(),
|
||||
serverGuid = serverGuid.toString(),
|
||||
type = Envelope.Type.fromValue(outgoingPushMessage.type),
|
||||
urgent = true,
|
||||
content = encryptedContent.toByteString()
|
||||
content = encryptedContent.toByteString(),
|
||||
sourceServiceIdBinary = aci.toByteString(),
|
||||
destinationServiceIdBinary = to.aci.toByteString(),
|
||||
serverGuidBinary = serverGuid.toByteArray().toByteString()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user