Move protobuf/ into Protos/

This commit is contained in:
Max Radermacher
2025-09-15 15:45:28 -05:00
committed by GitHub
parent a689aa21d6
commit d6c47a1198
24 changed files with 97 additions and 141 deletions

View File

@@ -2,7 +2,7 @@ excluded:
- Pods
- ThirdParty
- SignalServiceKit/Protos/Generated
- SignalServiceKit/protobuf/Backups
- SignalServiceKit/Protos/Backups
# SwiftLint has trouble with these files. See <https://github.com/realm/SwiftLint/issues/3988>.
- Signal/Emoji/Emoji+SkinTones.swift
- Signal/Emoji/EmojiWithSkinTones+String.swift

View File

@@ -2643,7 +2643,6 @@
D962346B2C0E937500DAF6CB /* InterleavingCompositeCursor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D931080A2B338CE5006A034E /* InterleavingCompositeCursor.swift */; };
D962346D2C0E957800DAF6CB /* DeleteForMeMostRecentAddressableMessageCursor.swift in Sources */ = {isa = PBXBuildFile; fileRef = D962346C2C0E957800DAF6CB /* DeleteForMeMostRecentAddressableMessageCursor.swift */; };
D96234702C0E99DE00DAF6CB /* DeleteForMeMostRecentAddressableMessageCursorTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D962346F2C0E99DE00DAF6CB /* DeleteForMeMostRecentAddressableMessageCursorTest.swift */; };
D96269D92C58407400152314 /* README.md in Resources */ = {isa = PBXBuildFile; fileRef = D96269D82C58407400152314 /* README.md */; };
D962FC432E149ECF004DB623 /* BackupSettingsAttachmentDownloadTrackerTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = D962FC422E149EC7004DB623 /* BackupSettingsAttachmentDownloadTrackerTest.swift */; };
D9680CF32DBB0B2D005DD5BE /* ChooseBackupPlanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9680CF22DBB0B28005DD5BE /* ChooseBackupPlanViewController.swift */; };
D9683D792D485BD300F423F4 /* chat_item_direct_story_reply_with_edits_07.binproto in Resources */ = {isa = PBXBuildFile; fileRef = D9683D6B2D485BD300F423F4 /* chat_item_direct_story_reply_with_edits_07.binproto */; };
@@ -5701,7 +5700,7 @@
C154CB932E0C6607009F878C /* RegistrationCoordinatorBackupErrorPresenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegistrationCoordinatorBackupErrorPresenter.swift; sourceTree = "<group>"; };
C15837EE29A592BA00176927 /* UsernameValidationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UsernameValidationManager.swift; sourceTree = "<group>"; };
C15C31142D9B3F7F0071E54C /* RegistrationChoiceButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegistrationChoiceButton.swift; sourceTree = "<group>"; };
C15EE0902D5D53420070838C /* Registration.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = Registration.proto; path = SignalServiceKit/protobuf/Registration.proto; sourceTree = SOURCE_ROOT; };
C15EE0902D5D53420070838C /* Registration.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = Registration.proto; sourceTree = "<group>"; };
C15EE0922D5D5AC00070838C /* Registration.pb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Registration.pb.swift; sourceTree = "<group>"; };
C1661A192C3D939300AB887F /* ArchivedPaymentHistoryItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchivedPaymentHistoryItem.swift; sourceTree = "<group>"; };
C1661A1B2C3D93AE00AB887F /* TSPaymentModelHistoryItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TSPaymentModelHistoryItem.swift; sourceTree = "<group>"; };
@@ -6764,16 +6763,16 @@
D9CD40612A155C4800545803 /* TSInfoMessage+PersistableGroupUpdateItemTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TSInfoMessage+PersistableGroupUpdateItemTest.swift"; sourceTree = "<group>"; };
D9D1A6EA2DD69CFE00050A85 /* DonationReceiptCredentialRedemptionJobFinderTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DonationReceiptCredentialRedemptionJobFinderTest.swift; sourceTree = "<group>"; };
D9D321692A8AC9B0004FC110 /* OutgoingGroupCallUpdateMessageTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutgoingGroupCallUpdateMessageTest.swift; sourceTree = "<group>"; };
D9D3217B2A8FEA9B004FC110 /* Groups.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = Groups.proto; path = SignalServiceKit/protobuf/Groups.proto; sourceTree = SOURCE_ROOT; };
D9D3217C2A8FEA9B004FC110 /* DeviceTransfer.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = DeviceTransfer.proto; path = SignalServiceKit/protobuf/DeviceTransfer.proto; sourceTree = SOURCE_ROOT; };
D9D3217D2A8FEA9C004FC110 /* Fingerprint.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = Fingerprint.proto; path = SignalServiceKit/protobuf/Fingerprint.proto; sourceTree = SOURCE_ROOT; };
D9D3217E2A8FEA9C004FC110 /* SessionRecord.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = SessionRecord.proto; path = SignalServiceKit/protobuf/SessionRecord.proto; sourceTree = SOURCE_ROOT; };
D9D3217F2A8FEA9C004FC110 /* SignalIOS.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = SignalIOS.proto; path = SignalServiceKit/protobuf/SignalIOS.proto; sourceTree = SOURCE_ROOT; };
D9D321802A8FEA9C004FC110 /* StorageService.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = StorageService.proto; path = SignalServiceKit/protobuf/StorageService.proto; sourceTree = SOURCE_ROOT; };
D9D321812A8FEA9C004FC110 /* SignalService.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = SignalService.proto; path = SignalServiceKit/protobuf/SignalService.proto; sourceTree = SOURCE_ROOT; };
D9D321822A8FEA9C004FC110 /* Provisioning.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = Provisioning.proto; path = SignalServiceKit/protobuf/Provisioning.proto; sourceTree = SOURCE_ROOT; };
D9D321842A8FEA9D004FC110 /* svr2.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = svr2.proto; path = SignalServiceKit/protobuf/svr2.proto; sourceTree = SOURCE_ROOT; };
D9D321852A8FEA9D004FC110 /* WebSocketResources.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; name = WebSocketResources.proto; path = SignalServiceKit/protobuf/WebSocketResources.proto; sourceTree = SOURCE_ROOT; };
D9D3217B2A8FEA9B004FC110 /* Groups.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = Groups.proto; sourceTree = "<group>"; };
D9D3217C2A8FEA9B004FC110 /* DeviceTransfer.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = DeviceTransfer.proto; sourceTree = "<group>"; };
D9D3217D2A8FEA9C004FC110 /* Fingerprint.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = Fingerprint.proto; sourceTree = "<group>"; };
D9D3217E2A8FEA9C004FC110 /* SessionRecord.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = SessionRecord.proto; sourceTree = "<group>"; };
D9D3217F2A8FEA9C004FC110 /* SignalIOS.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = SignalIOS.proto; sourceTree = "<group>"; };
D9D321802A8FEA9C004FC110 /* StorageService.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = StorageService.proto; sourceTree = "<group>"; };
D9D321812A8FEA9C004FC110 /* SignalService.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = SignalService.proto; sourceTree = "<group>"; };
D9D321822A8FEA9C004FC110 /* Provisioning.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = Provisioning.proto; sourceTree = "<group>"; };
D9D321842A8FEA9D004FC110 /* svr2.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = svr2.proto; sourceTree = "<group>"; };
D9D321852A8FEA9D004FC110 /* WebSocketResources.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = WebSocketResources.proto; sourceTree = "<group>"; };
D9DB37EE2B7180DD007B16C8 /* CallRecordAssociatedInteraction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallRecordAssociatedInteraction.swift; sourceTree = "<group>"; };
D9DB37F22B71B037007B16C8 /* OutgoingCallLogEventSyncMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OutgoingCallLogEventSyncMessage.swift; sourceTree = "<group>"; };
D9DB37F82B72A770007B16C8 /* CallRecordDeleteAllJobQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CallRecordDeleteAllJobQueue.swift; sourceTree = "<group>"; };
@@ -12303,7 +12302,7 @@
D96269D82C58407400152314 /* README.md */,
);
name = Backups;
path = SignalServiceKit/protobuf/Backups;
path = SignalServiceKit/Protos/Backups;
sourceTree = SOURCE_ROOT;
};
D91A39E62AE2F42000F57A61 /* Subscriptions */ = {
@@ -12879,7 +12878,7 @@
D9D321842A8FEA9D004FC110 /* svr2.proto */,
D9D321852A8FEA9D004FC110 /* WebSocketResources.proto */,
);
name = Specifications;
path = Specifications;
sourceTree = "<group>";
};
D9DCFDAC2A3BB22800C73C0B /* QRCodes */ = {
@@ -15200,7 +15199,6 @@
F9B0DC5C28948656004E07B7 /* GTSR3.crt in Resources */,
F9B0DC5F28948656004E07B7 /* GTSR4.crt in Resources */,
F9B0DC5328948656004E07B7 /* isrgrootx1.crt in Resources */,
D96269D92C58407400152314 /* README.md in Resources */,
F9B0DC4F28948656004E07B7 /* schema.sql in Resources */,
F9B0DC5928948656004E07B7 /* signal-messenger.cer in Resources */,
);

View File

@@ -0,0 +1,7 @@
# Backup protos
## `Swift-Protobuf`
We use [`Swift-Protobuf`](https://github.com/apple/swift-protobuf) to generate Swift code for working with `Backup.proto`, much like we do for all our other proto definitions.
However, unlike (most of) the other protos, we do not use the "wrapper" code generated by `$REPO_ROOT/Scripts/protos/ProtoWrappers.py` to wrap the `Swift-Protobuf`-generated code for Backups because `ProtoWrappers.py` is incompatible with some of the syntactic structures we use in `Backup.proto`.

View File

@@ -0,0 +1,58 @@
#
# Copyright 2023 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
#
# See README.md in Specifications for prerequisite setup.
PROTOC=protoc --proto_path=Specifications
WRAPPER_SCRIPT=../../Scripts/protos/ProtoWrappers.py --proto-dir=Specifications --verbose
all: registration_protos signal_service_protos provisioning_protos fingerprint_protos websocket_protos signal_ios_protos storage_service_protos groups_protos device_transfer_protos session_record_protos svr_protos mobilecoin_protos backup_protos
signal_service_protos: Specifications/SignalService.proto
$(PROTOC) --swift_out=Generated SignalService.proto
$(WRAPPER_SCRIPT) --dst-dir=Generated --wrapper-prefix=SSKProto --proto-prefix=SignalServiceProtos --proto-file=SignalService.proto
provisioning_protos: Specifications/Provisioning.proto
$(PROTOC) --swift_out=Generated Provisioning.proto
$(WRAPPER_SCRIPT) --dst-dir=Generated --wrapper-prefix=ProvisioningProto --proto-prefix=ProvisioningProtos --proto-file=Provisioning.proto
fingerprint_protos: Specifications/Fingerprint.proto
$(PROTOC) --swift_out=Generated Fingerprint.proto
$(WRAPPER_SCRIPT) --dst-dir=Generated --wrapper-prefix=FingerprintProto --proto-prefix=FingerprintProtos --proto-file=Fingerprint.proto
websocket_protos: Specifications/WebSocketResources.proto
$(PROTOC) --swift_out=Generated WebSocketResources.proto
$(WRAPPER_SCRIPT) --dst-dir=Generated --wrapper-prefix=WebSocketProto --proto-prefix=WebSocketProtos --proto-file=WebSocketResources.proto
signal_ios_protos: Specifications/SignalIOS.proto
$(PROTOC) --swift_out=Generated SignalIOS.proto
$(WRAPPER_SCRIPT) --dst-dir=Generated --wrapper-prefix=SignalIOSProto --proto-prefix=IOSProtos --proto-file=SignalIOS.proto
storage_service_protos: Specifications/StorageService.proto
$(PROTOC) --swift_out=Generated StorageService.proto
$(WRAPPER_SCRIPT) --dst-dir=Generated --wrapper-prefix=StorageServiceProto --proto-prefix=StorageServiceProtos --proto-file=StorageService.proto
groups_protos: Specifications/Groups.proto
$(PROTOC) --swift_out=Generated Groups.proto
$(WRAPPER_SCRIPT) --dst-dir=Generated --wrapper-prefix=GroupsProto --proto-prefix=GroupsProtos --proto-file=Groups.proto
device_transfer_protos: Specifications/DeviceTransfer.proto
$(PROTOC) --swift_out=Generated DeviceTransfer.proto
$(WRAPPER_SCRIPT) --dst-dir=Generated --wrapper-prefix=DeviceTransferProto --proto-prefix=DeviceTransferProtos --proto-file=DeviceTransfer.proto
session_record_protos: Specifications/SessionRecord.proto
$(PROTOC) --swift_out=Generated SessionRecord.proto
svr_protos: Specifications/svr2.proto
$(PROTOC) --swift_out=Generated svr2.proto
mobilecoin_protos: Specifications/MobileCoinExternal.proto
$(PROTOC) --swift_out=Generated MobileCoinExternal.proto
registration_protos: Specifications/Registration.proto
$(PROTOC) --swift_out=Generated Registration.proto
backup_protos: Backups/Backup.proto
$(PROTOC) --swift_out=Backups --proto_path=Backups --swift_opt=Visibility=public --swift_opt=UseAccessLevelOnImports=true Backup.proto

View File

@@ -0,0 +1,18 @@
# SignalServiceKit Protobufs
These protobuf definitions are the same as/compatible with Signal-Android and
Signal-Desktop, though modified slightly to match iOS conventions.
## Prerequisites
Install Apple's `swift-protobuf` (*not* the similarly named `protobuf-swift`)
brew install swift-protobuf
This should install an up-to-date protobuf package as a dependency.
## Compiling Protos
cd SignalServiceKit/Protos
make

View File

@@ -1,7 +0,0 @@
# Backup protos
## `Swift-Protobuf`
We use [`Swift-Protobuf`](https://github.com/apple/swift-protobuf) to generate Swift code for working with `Backup.proto`, much like we do for all our other proto definitions.
However, unlike the other protos, we do not use the "wrapper" code generated by `$REPO_ROOT/Scripts/protos/ProtoWrappers.py` to wrap the `Swift-Protobuf`-generated code for Backups, because `ProtoWrappers.py` is incompatible with some of the syntactic structures we use in `Backup.proto`.

View File

@@ -1,17 +0,0 @@
#!/usr/bin/env bash
REPO_ROOT=$(git rev-parse --show-toplevel)
BACKUP_PROTO_DIR="$REPO_ROOT/SignalServiceKit/protobuf/Backups"
BACKUP_PROTO_FILE="$BACKUP_PROTO_DIR/Backup.proto"
BACKUP_SWIFT_FILE="$BACKUP_PROTO_DIR/Backup.pb.swift"
echo "Generating Backup.pb.swift file with protoc and Swift-Protobuf..."
protoc \
--proto_path="$BACKUP_PROTO_DIR" \
--swift_out="$BACKUP_PROTO_DIR" \
--swift_opt=Visibility=public \
--swift_opt=UseAccessLevelOnImports=true \
"$BACKUP_PROTO_FILE"
"$REPO_ROOT"/Scripts/lint/lint-license-headers --fix "$BACKUP_PROTO_FILE"

View File

@@ -1,79 +0,0 @@
#
# Copyright 2023 Signal Messenger, LLC
# SPDX-License-Identifier: AGPL-3.0-only
#
# See README.md in this dir for prerequisite setup.
PROTOC=protoc \
--proto_path='./'
WRAPPER_SCRIPT=../../Scripts/protos/ProtoWrappers.py \
--proto-dir='./' --verbose
all: registration_protos signal_service_protos provisioning_protos fingerprint_protos websocket_protos signal_ios_protos storage_service_protos groups_protos device_transfer_protos session_record_protos svr_protos mobilecoin_protos
signal_service_protos: SignalService.proto
$(PROTOC) --swift_out=../Protos/Generated \
SignalService.proto
$(WRAPPER_SCRIPT) --dst-dir=../Protos/Generated \
--wrapper-prefix=SSKProto --proto-prefix=SignalServiceProtos --proto-file=SignalService.proto
provisioning_protos: Provisioning.proto
$(PROTOC) --swift_out=../Protos/Generated \
Provisioning.proto
$(WRAPPER_SCRIPT) --dst-dir=../Protos/Generated \
--wrapper-prefix=ProvisioningProto --proto-prefix=ProvisioningProtos --proto-file=Provisioning.proto
fingerprint_protos: Fingerprint.proto
$(PROTOC) --swift_out=../Protos/Generated \
Fingerprint.proto
$(WRAPPER_SCRIPT) --dst-dir=../Protos/Generated \
--wrapper-prefix=FingerprintProto --proto-prefix=FingerprintProtos --proto-file=Fingerprint.proto
websocket_protos: WebSocketResources.proto
$(PROTOC) --swift_out=../Protos/Generated \
WebSocketResources.proto
$(WRAPPER_SCRIPT) --dst-dir=../Protos/Generated \
--wrapper-prefix=WebSocketProto --proto-prefix=WebSocketProtos --proto-file=WebSocketResources.proto
signal_ios_protos: SignalIOS.proto
$(PROTOC) --swift_out=../Protos/Generated \
SignalIOS.proto
$(WRAPPER_SCRIPT) --dst-dir=../Protos/Generated \
--wrapper-prefix=SignalIOSProto --proto-prefix=IOSProtos --proto-file=SignalIOS.proto
storage_service_protos: StorageService.proto
$(PROTOC) --swift_out=../Protos/Generated \
StorageService.proto
$(WRAPPER_SCRIPT) --dst-dir=../Protos/Generated \
--wrapper-prefix=StorageServiceProto --proto-prefix=StorageServiceProtos --proto-file=StorageService.proto
# TODO: Copy schema from zkgroup repository.
# TODO: Insert the following lines into the schema:
#
# // iOS - package name determines class prefix
# package GroupsProtos;
#
groups_protos: Groups.proto
$(PROTOC) --swift_out=../Protos/Generated \
Groups.proto
$(WRAPPER_SCRIPT) --dst-dir=../Protos/Generated \
--wrapper-prefix=GroupsProto --proto-prefix=GroupsProtos --proto-file=Groups.proto
device_transfer_protos: DeviceTransfer.proto
$(PROTOC) --swift_out=../Protos/Generated \
DeviceTransfer.proto
$(WRAPPER_SCRIPT) --dst-dir=../Protos/Generated \
--wrapper-prefix=DeviceTransferProto --proto-prefix=DeviceTransferProtos --proto-file=DeviceTransfer.proto
session_record_protos: SessionRecord.proto
$(PROTOC) --swift_out=../Protos/Generated SessionRecord.proto
svr_protos: svr2.proto
$(PROTOC) --swift_out=../Protos/Generated svr2.proto
mobilecoin_protos: MobileCoinExternal.proto
$(PROTOC) --swift_out=../Protos/Generated MobileCoinExternal.proto
registration_protos: Registration.proto
$(PROTOC) --swift_out=../Protos/Generated Registration.proto

View File

@@ -1,22 +0,0 @@
# SignalServiceKit Protobufs
These protobuf definitions are copied from Signal-Android, but modified
to match some iOS conventions.
## Prerequisites
Install Apple's `swift-protobuf` (*not* the similarly named `protobuf-swift`)
brew install swift-protobuf
This should install an up to date protobuf package as a dependency. Note that
since we use the legacy proto2 format, we need to specify this in our .proto
files.
syntax = "proto2";
## Building Protobuf
cd ~/src/WhisperSystems/SignalServiceKit/protobuf
make