mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-07-25 15:34:49 +01:00
Remove USE_STRING_ID build config.
This commit is contained in:
committed by
jeffrey-signal
parent
eafba156ba
commit
73c3d141e3
-1
@@ -191,7 +191,6 @@ public class ApplicationDependencyProvider implements AppDependencies.Provider {
|
||||
RemoteConfig.maxIncrementalMacsPerEnvelope(),
|
||||
RemoteConfig::useMessageSendRestFallback,
|
||||
RemoteConfig.useBinaryId(),
|
||||
BuildConfig.USE_STRING_ID,
|
||||
new PreKeyRepository(
|
||||
keysApi,
|
||||
protocolStore.aci(),
|
||||
|
||||
@@ -13,7 +13,6 @@ import androidx.annotation.Nullable;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.signal.libsignal.protocol.IdentityKey;
|
||||
import org.signal.libsignal.zkgroup.profiles.ProfileKey;
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.conversation.colors.ChatColorsMapper;
|
||||
import org.thoughtcrime.securesms.crypto.ProfileKeyUtil;
|
||||
import org.thoughtcrime.securesms.database.RecipientTable;
|
||||
@@ -151,7 +150,7 @@ public class MultiDeviceContactUpdateJob extends BaseJob {
|
||||
|
||||
Uri updateUri = null;
|
||||
try {
|
||||
DeviceContactsOutputStream out = new DeviceContactsOutputStream(writeDetails.outputStream, RemoteConfig.useBinaryId(), BuildConfig.USE_STRING_ID);
|
||||
DeviceContactsOutputStream out = new DeviceContactsOutputStream(writeDetails.outputStream, RemoteConfig.useBinaryId());
|
||||
Recipient recipient = Recipient.resolved(recipientId);
|
||||
|
||||
if (recipient.getRegistered() == RecipientTable.RegisteredState.NOT_REGISTERED) {
|
||||
@@ -216,7 +215,7 @@ public class MultiDeviceContactUpdateJob extends BaseJob {
|
||||
|
||||
Uri updateUri = null;
|
||||
try {
|
||||
DeviceContactsOutputStream out = new DeviceContactsOutputStream(writeDetails.outputStream, RemoteConfig.useBinaryId(), BuildConfig.USE_STRING_ID);
|
||||
DeviceContactsOutputStream out = new DeviceContactsOutputStream(writeDetails.outputStream, RemoteConfig.useBinaryId());
|
||||
List<Recipient> recipients = SignalDatabase.recipients().getRecipientsForMultiDeviceSync();
|
||||
Map<RecipientId, Integer> inboxPositions = SignalDatabase.threads().getInboxPositions();
|
||||
Set<RecipientId> archived = SignalDatabase.threads().getArchivedRecipients();
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.signal.core.util.Base64
|
||||
import org.signal.core.util.UuidUtil
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.signal.core.util.orNull
|
||||
import org.thoughtcrime.securesms.BuildConfig
|
||||
import org.thoughtcrime.securesms.attachments.DatabaseAttachment
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase
|
||||
import org.thoughtcrime.securesms.database.ThreadTable
|
||||
@@ -378,16 +377,8 @@ class MultiDeviceDeleteSyncJob private constructor(
|
||||
private fun Recipient.toDeleteSyncConversationId(): ConversationIdentifier? {
|
||||
return when {
|
||||
isGroup -> ConversationIdentifier(threadGroupId = requireGroupId().decodedId.toByteString())
|
||||
hasAci -> if (BuildConfig.USE_STRING_ID) {
|
||||
ConversationIdentifier(threadServiceId = requireAci().toString())
|
||||
} else {
|
||||
ConversationIdentifier(threadServiceIdBinary = requireAci().toByteString())
|
||||
}
|
||||
hasPni -> if (BuildConfig.USE_STRING_ID) {
|
||||
ConversationIdentifier(threadServiceId = requirePni().toString())
|
||||
} else {
|
||||
ConversationIdentifier(threadServiceIdBinary = requirePni().toByteString())
|
||||
}
|
||||
hasAci -> ConversationIdentifier(threadServiceIdBinary = requireAci().toByteString())
|
||||
hasPni -> ConversationIdentifier(threadServiceIdBinary = requirePni().toByteString())
|
||||
hasE164 -> ConversationIdentifier(threadE164 = requireE164())
|
||||
else -> null
|
||||
}
|
||||
@@ -395,11 +386,7 @@ class MultiDeviceDeleteSyncJob private constructor(
|
||||
|
||||
private fun DeleteSyncJobData.AddressableMessage.toDeleteSyncMessage(): AddressableMessage? {
|
||||
val author: Recipient = Recipient.resolved(RecipientId.from(authorRecipientId))
|
||||
val authorServiceId = if (BuildConfig.USE_STRING_ID) {
|
||||
author.aci.orNull()?.toString() ?: author.pni.orNull()?.toString()
|
||||
} else {
|
||||
author.aci.orNull()?.toByteString() ?: author.pni.orNull()?.toByteString()
|
||||
}
|
||||
val authorServiceId: ByteString? = author.aci.orNull()?.toByteString() ?: author.pni.orNull()?.toByteString()
|
||||
|
||||
val authorE164: String? = if (authorServiceId == null) {
|
||||
author.e164.orNull()
|
||||
@@ -411,19 +398,11 @@ class MultiDeviceDeleteSyncJob private constructor(
|
||||
Log.w(TAG, "Unable to send sync message without serviceId or e164 recipient: ${author.id}")
|
||||
null
|
||||
} else {
|
||||
if (BuildConfig.USE_STRING_ID) {
|
||||
AddressableMessage(
|
||||
authorServiceId = authorServiceId as String?,
|
||||
authorE164 = authorE164,
|
||||
sentTimestamp = sentTimestamp
|
||||
)
|
||||
} else {
|
||||
AddressableMessage(
|
||||
authorServiceIdBinary = authorServiceId as ByteString?,
|
||||
authorE164 = authorE164,
|
||||
sentTimestamp = sentTimestamp
|
||||
)
|
||||
}
|
||||
AddressableMessage(
|
||||
authorServiceIdBinary = authorServiceId,
|
||||
authorE164 = authorE164,
|
||||
sentTimestamp = sentTimestamp
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -7,7 +7,6 @@ import androidx.annotation.Nullable;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.signal.libsignal.zkgroup.profiles.ProfileKey;
|
||||
import org.signal.network.service.CdnService;
|
||||
import org.thoughtcrime.securesms.BuildConfig;
|
||||
import org.thoughtcrime.securesms.crypto.ProfileKeyUtil;
|
||||
import org.thoughtcrime.securesms.dependencies.AppDependencies;
|
||||
import org.thoughtcrime.securesms.jobmanager.Job;
|
||||
@@ -79,7 +78,7 @@ public class MultiDeviceProfileKeyUpdateJob extends BaseJob {
|
||||
}
|
||||
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
DeviceContactsOutputStream out = new DeviceContactsOutputStream(baos, RemoteConfig.useBinaryId(), BuildConfig.USE_STRING_ID);
|
||||
DeviceContactsOutputStream out = new DeviceContactsOutputStream(baos, RemoteConfig.useBinaryId());
|
||||
|
||||
out.write(new DeviceContact(Optional.ofNullable(SignalStore.account().getAci()),
|
||||
Optional.ofNullable(SignalStore.account().getE164()),
|
||||
|
||||
@@ -39,7 +39,6 @@ import org.signal.libsignal.protocol.message.CiphertextMessage
|
||||
import org.signal.libsignal.protocol.message.DecryptionErrorMessage
|
||||
import org.signal.libsignal.protocol.message.SenderKeyDistributionMessage
|
||||
import org.signal.libsignal.zkgroup.groups.GroupMasterKey
|
||||
import org.thoughtcrime.securesms.BuildConfig
|
||||
import org.thoughtcrime.securesms.R
|
||||
import org.thoughtcrime.securesms.crypto.ReentrantSessionLock
|
||||
import org.thoughtcrime.securesms.crypto.SealedSenderAccessUtil
|
||||
@@ -162,7 +161,6 @@ object MessageDecryptor {
|
||||
|
||||
val envelope = if (cipherResult?.metadata?.sourceServiceId != null) {
|
||||
envelope.newBuilder()
|
||||
.sourceServiceId(if (BuildConfig.USE_STRING_ID) cipherResult.metadata.sourceServiceId.toString() else null)
|
||||
.sourceServiceIdBinary(if (RemoteConfig.useBinaryId) cipherResult.metadata.sourceServiceId.toByteString() else null)
|
||||
.sourceDeviceId(cipherResult.metadata.sourceDeviceId)
|
||||
.build()
|
||||
|
||||
@@ -9,7 +9,6 @@ import org.signal.core.util.isNullOrEmpty
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.signal.libsignal.zkgroup.InvalidInputException
|
||||
import org.signal.libsignal.zkgroup.groups.GroupMasterKey
|
||||
import org.thoughtcrime.securesms.BuildConfig
|
||||
import org.thoughtcrime.securesms.components.settings.app.chats.folders.ChatFolderRecord
|
||||
import org.thoughtcrime.securesms.components.settings.app.usernamelinks.UsernameQrCodeColorScheme
|
||||
import org.thoughtcrime.securesms.conversation.colors.AvatarColor
|
||||
@@ -139,7 +138,7 @@ object StorageSyncModels {
|
||||
RecipientType.INDIVIDUAL -> {
|
||||
AccountRecord.PinnedConversation(
|
||||
contact = AccountRecord.PinnedConversation.Contact(
|
||||
serviceId = settings.serviceId?.toString().takeIf { BuildConfig.USE_STRING_ID } ?: "",
|
||||
serviceId = "",
|
||||
e164 = settings.e164 ?: "",
|
||||
serviceIdBinary = settings.serviceId?.toByteString().takeIf { RemoteConfig.useBinaryId } ?: ByteString.EMPTY
|
||||
)
|
||||
@@ -194,9 +193,9 @@ object StorageSyncModels {
|
||||
}
|
||||
|
||||
return SignalContactRecord.newBuilder(recipient.syncExtras.storageProto).apply {
|
||||
aci = recipient.aci?.toString().takeIf { BuildConfig.USE_STRING_ID } ?: ""
|
||||
aci = ""
|
||||
e164 = recipient.e164 ?: ""
|
||||
pni = recipient.pni?.toStringWithoutPrefix().takeIf { BuildConfig.USE_STRING_ID } ?: ""
|
||||
pni = ""
|
||||
profileKey = recipient.profileKey?.toByteString() ?: ByteString.EMPTY
|
||||
givenName = recipient.signalProfileName.givenName
|
||||
familyName = recipient.signalProfileName.familyName
|
||||
@@ -304,14 +303,7 @@ object StorageSyncModels {
|
||||
return SignalStoryDistributionListRecord.newBuilder(recipient.syncExtras.storageProto).apply {
|
||||
identifier = UuidUtil.toByteArray(record.distributionId.asUuid()).toByteString()
|
||||
name = record.name
|
||||
recipientServiceIds = if (BuildConfig.USE_STRING_ID) {
|
||||
record.getMembersToSync()
|
||||
.map { Recipient.resolved(it) }
|
||||
.filter { it.hasServiceId }
|
||||
.map { it.requireServiceId().toString() }
|
||||
} else {
|
||||
emptyList()
|
||||
}
|
||||
recipientServiceIds = emptyList()
|
||||
recipientServiceIdsBinary = if (RemoteConfig.useBinaryId) {
|
||||
record.getMembersToSync()
|
||||
.map { Recipient.resolved(it) }
|
||||
@@ -521,7 +513,7 @@ object StorageSyncModels {
|
||||
RecipientType.INDIVIDUAL -> {
|
||||
RemoteRecipient(
|
||||
contact = RemoteRecipient.Contact(
|
||||
serviceId = recipient.serviceId?.toString().takeIf { BuildConfig.USE_STRING_ID } ?: "",
|
||||
serviceId = "",
|
||||
e164 = recipient.e164 ?: "",
|
||||
serviceIdBinary = recipient.serviceId?.toByteString().takeIf { RemoteConfig.useBinaryId } ?: ByteString.EMPTY
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user