Introduce Wire for proto codegen.

This commit is contained in:
Greyson Parrelli
2023-02-02 10:10:00 -05:00
committed by Nicholas Tinsley
parent 72449fd73e
commit a91a13cead
11 changed files with 215 additions and 31 deletions

View File

@@ -5,7 +5,7 @@ import org.hamcrest.Matchers.`is`
import org.junit.Test
import org.thoughtcrime.securesms.crypto.IdentityKeyUtil
import org.thoughtcrime.securesms.database.loaders.DeviceListLoader
import org.thoughtcrime.securesms.devicelist.DeviceNameProtos
import org.thoughtcrime.securesms.devicelist.protos.DeviceName
import java.nio.charset.Charset
class DeviceNameCipherTest {
@@ -17,7 +17,7 @@ class DeviceNameCipherTest {
val encryptedDeviceName = DeviceNameCipher.encryptDeviceName(deviceName.toByteArray(Charset.forName("UTF-8")), identityKeyPair)
val plaintext = DeviceListLoader.decryptName(DeviceNameProtos.DeviceName.parseFrom(encryptedDeviceName), identityKeyPair)
val plaintext = DeviceListLoader.decryptName(DeviceName.ADAPTER.decode(encryptedDeviceName), identityKeyPair)
assertThat(String(plaintext, Charset.forName("UTF-8")), `is`(deviceName))
}