mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-23 04:28:35 +00:00
Sync the MediaRootBackupKey during linking.
This commit is contained in:
@@ -156,7 +156,8 @@ object LinkDeviceRepository {
|
|||||||
profileKey = ProfileKeyUtil.getSelfProfileKey(),
|
profileKey = ProfileKeyUtil.getSelfProfileKey(),
|
||||||
masterKey = SignalStore.svr.masterKey,
|
masterKey = SignalStore.svr.masterKey,
|
||||||
code = verificationCodeResult.verificationCode,
|
code = verificationCodeResult.verificationCode,
|
||||||
ephemeralMessageBackupKey = ephemeralMessageBackupKey
|
ephemeralMessageBackupKey = ephemeralMessageBackupKey,
|
||||||
|
mediaRootBackupKey = SignalStore.backup.mediaRootBackupKey
|
||||||
)
|
)
|
||||||
|
|
||||||
return when (deviceLinkResult) {
|
return when (deviceLinkResult) {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import org.signal.libsignal.protocol.IdentityKeyPair
|
|||||||
import org.signal.libsignal.protocol.ecc.ECPublicKey
|
import org.signal.libsignal.protocol.ecc.ECPublicKey
|
||||||
import org.signal.libsignal.zkgroup.profiles.ProfileKey
|
import org.signal.libsignal.zkgroup.profiles.ProfileKey
|
||||||
import org.whispersystems.signalservice.api.NetworkResult
|
import org.whispersystems.signalservice.api.NetworkResult
|
||||||
|
import org.whispersystems.signalservice.api.backup.MediaRootBackupKey
|
||||||
import org.whispersystems.signalservice.api.backup.MessageBackupKey
|
import org.whispersystems.signalservice.api.backup.MessageBackupKey
|
||||||
import org.whispersystems.signalservice.api.kbs.MasterKey
|
import org.whispersystems.signalservice.api.kbs.MasterKey
|
||||||
import org.whispersystems.signalservice.api.push.ServiceId.ACI
|
import org.whispersystems.signalservice.api.push.ServiceId.ACI
|
||||||
@@ -62,6 +63,7 @@ class LinkDeviceApi(private val pushServiceSocket: PushServiceSocket) {
|
|||||||
pniIdentityKeyPair: IdentityKeyPair,
|
pniIdentityKeyPair: IdentityKeyPair,
|
||||||
profileKey: ProfileKey,
|
profileKey: ProfileKey,
|
||||||
masterKey: MasterKey,
|
masterKey: MasterKey,
|
||||||
|
mediaRootBackupKey: MediaRootBackupKey,
|
||||||
code: String,
|
code: String,
|
||||||
ephemeralMessageBackupKey: MessageBackupKey?
|
ephemeralMessageBackupKey: MessageBackupKey?
|
||||||
): NetworkResult<Unit> {
|
): NetworkResult<Unit> {
|
||||||
@@ -79,6 +81,7 @@ class LinkDeviceApi(private val pushServiceSocket: PushServiceSocket) {
|
|||||||
provisioningCode = code,
|
provisioningCode = code,
|
||||||
provisioningVersion = ProvisioningVersion.CURRENT.value,
|
provisioningVersion = ProvisioningVersion.CURRENT.value,
|
||||||
masterKey = masterKey.serialize().toByteString(),
|
masterKey = masterKey.serialize().toByteString(),
|
||||||
|
mediaRootBackupKey = mediaRootBackupKey.value.toByteString(),
|
||||||
ephemeralBackupKey = ephemeralMessageBackupKey?.value?.toByteString()
|
ephemeralBackupKey = ephemeralMessageBackupKey?.value?.toByteString()
|
||||||
)
|
)
|
||||||
val ciphertext = cipher.encrypt(message)
|
val ciphertext = cipher.encrypt(message)
|
||||||
|
|||||||
Reference in New Issue
Block a user