diff --git a/NearbyShare/Connection/InboundNearbyConnection.swift b/NearbyShare/Connection/InboundNearbyConnection.swift index dd3c832..9008348 100644 --- a/NearbyShare/Connection/InboundNearbyConnection.swift +++ b/NearbyShare/Connection/InboundNearbyConnection.swift @@ -5,7 +5,6 @@ // Created by Grishka on 08.04.2023. // -import AppKit import CommonCrypto import CryptoKit import Foundation @@ -14,6 +13,12 @@ import System import BigInt import SwiftECC +#if os(macOS) +import AppKit +#else +import UIKit +#endif + class InboundNearbyConnection: NearbyConnection { private var filesToBeReceived: [Int64: InternalFileInfo] = [:] @@ -52,7 +57,7 @@ class InboundNearbyConnection: NearbyConnection { override func processReceivedFrame(frameData: Data) { if currentState != .receivingFiles { - log("[InboundNearbyConnection] Received frame in state \(currentState)...") + log("[InboundNearbyConnection \(self.id)] Received frame in state \(currentState)...") } do { @@ -77,7 +82,7 @@ class InboundNearbyConnection: NearbyConnection { do { smsg = try Securemessage_SecureMessage(serializedBytes: frameData) } catch { - log("[InboundNearbyConnection] Error deserializing secure message (probably due to packet filter)") + log("[InboundNearbyConnection \(self.id)] Error deserializing secure message (probably due to packet filter)") lastError = NearbyError.packetFilterError protocolError() } @@ -88,7 +93,7 @@ class InboundNearbyConnection: NearbyConnection { } } catch { lastError = error - log("[InboundNearbyConnection] Error receiving frame: \(error) in state \(currentState).") + log("[InboundNearbyConnection \(self.id)] Error receiving frame: \(error) in state \(currentState).") protocolError() } } @@ -96,7 +101,9 @@ class InboundNearbyConnection: NearbyConnection { override func processTransferSetupFrame(_ frame: Sharing_Nearby_Frame) throws { if frame.hasV1 && frame.v1.hasType, case .cancel = frame.v1.type { - log("[InboundNearbyConnection] Transfer canceled") + self.lastError = NearbyError.canceled(reason: .userCanceled) + self.cancelled = true + log("[InboundNearbyConnection \(self.id)] Transfer canceled") try sendDisconnectionAndDisconnect() return } @@ -108,7 +115,15 @@ class InboundNearbyConnection: NearbyConnection { case .receivedPairedKeyResult: try processIntroductionFrame(frame) default: - log("[InboundNearbyConnection] Unexpected connection state in processTransferSetupFrame: \(currentState)") + if frame.hasV1, frame.v1.hasType, frame.v1.type == .progressUpdate { + // ignore progress updates + return + } + if frame.hasV1, frame.v1.hasType, frame.v1.type == .response, case .accept = frame.v1.connectionResponse.status { + // ignore accept response frame, it is inferred since the other device set up the connection + return + } + log("[InboundNearbyConnection \(self.id)] Unexpected connection state in processTransferSetupFrame: \(currentState)") log(frame.debugDescription) } } @@ -140,7 +155,7 @@ class InboundNearbyConnection: NearbyConnection { // only for logging self.bytesTransferred += Int64(frame.payloadChunk.body.count) } catch { - log("[InboundNearbyConnection] Error occurred during writing file: \(error.localizedDescription)") + log("[InboundNearbyConnection \(self.id)] Error occurred during writing file: \(error.localizedDescription)") throw NearbyError.protocolError(error.localizedDescription) } @@ -148,13 +163,15 @@ class InboundNearbyConnection: NearbyConnection { else if (frame.payloadChunk.flags & 1) == 1 { try fileInfo.fileHandle?.close() filesToBeReceived[id]!.fileHandle = nil + #if os(macOS) fileInfo.progress?.unpublish() + #endif SaveFilesManager.shared.registerFileFinishedDownloading(fileInfo.destinationURL) filesToBeReceived.removeValue(forKey: id) if filesToBeReceived.isEmpty { - log("[InboundNearbyConnection] All files received, sending disconnection frame and disconnecting.") + log("[InboundNearbyConnection \(self.id)] All files received, sending disconnection frame and disconnecting.") try sendDisconnectionAndDisconnect() } } @@ -166,19 +183,31 @@ class InboundNearbyConnection: NearbyConnection { if let urlStr = String(data: payload, encoding: .utf8) { if isPlainTextTransfer { - // paste to clipboard + #if os(macOS) + // macOS clipboard let pasteboard = NSPasteboard.general pasteboard.clearContents() pasteboard.setString(urlStr, forType: .string) NearbyConnectionManager.shared.mainAppDelegate?.showCopiedToClipboardAlert() - } - else if let url = URL(string: urlStr) { + + #elseif os(iOS) + // iOS clipboard + UIPasteboard.general.string = urlStr + + // Optionally show an alert (requires a way to present it) + // For example, post a notification or use a delegate to show a toast or alert + #endif + } else if let url = URL(string: urlStr) { + #if os(macOS) NSWorkspace.shared.open(url) + #elseif os(iOS) + UIApplication.shared.open(url, options: [:], completionHandler: nil) + #endif } } - log("[InboundNearbyConnection] Received text payload. Disconnecting...") + log("[InboundNearbyConnection \(self.id)] Received text payload. Disconnecting...") try sendDisconnectionAndDisconnect() return true } @@ -188,11 +217,13 @@ class InboundNearbyConnection: NearbyConnection { fileInfo.progress?.completedUnitCount = filesToBeReceived[id]!.bytesTransferred try fileInfo.fileHandle?.close() filesToBeReceived[id]!.fileHandle = nil + #if os(macOS) fileInfo.progress?.unpublish() + #endif filesToBeReceived.removeValue(forKey: id) SaveFilesManager.shared.registerFileFinishedDownloading(fileInfo.destinationURL) - log("[InboundNearbyConnection] Received file payload. Disconnecting...") + log("[InboundNearbyConnection \(self.id)] Received file payload. Disconnecting...") try sendDisconnectionAndDisconnect() return true } @@ -227,7 +258,7 @@ class InboundNearbyConnection: NearbyConnection { guard msg.hasMessageType, msg.hasMessageData else { throw NearbyError.requiredFieldMissing("clientInit ukey2message.type|data") } guard case .clientInit = msg.messageType else { sendUkey2Alert(type: .badMessageType) - log("[InboundNearbyConnection] Unsupported message type: \(msg.messageType)") + log("[InboundNearbyConnection \(self.id)] Unsupported message type: \(msg.messageType)") throw NearbyError.ukey2 } let clientInit: Securegcm_Ukey2ClientInit @@ -235,17 +266,17 @@ class InboundNearbyConnection: NearbyConnection { clientInit = try Securegcm_Ukey2ClientInit(serializedBytes: msg.messageData) } catch { sendUkey2Alert(type: .badMessageData) - log("[InboundNearbyConnection] Failed to parse clientInit: \(error)") + log("[InboundNearbyConnection \(self.id)] Failed to parse clientInit: \(error)") throw NearbyError.ukey2 } guard clientInit.version == 1 else { sendUkey2Alert(type: .badVersion) - log("[InboundNearbyConnection] Unsupported clientInit version: \(clientInit.version)") + log("[InboundNearbyConnection \(self.id)] Unsupported clientInit version: \(clientInit.version)") throw NearbyError.ukey2 } guard clientInit.random.count == 32 else { sendUkey2Alert(type: .badRandom) - log("[InboundNearbyConnection] Unsupported clientInit random: \(clientInit.random.count)") + log("[InboundNearbyConnection \(self.id)] Unsupported clientInit random: \(clientInit.random.count)") throw NearbyError.ukey2 } var found = false @@ -258,12 +289,12 @@ class InboundNearbyConnection: NearbyConnection { } guard found else { sendUkey2Alert(type: .badHandshakeCipher) - log("[InboundNearbyConnection] Unsupported clientInit handshakeCipher: \(clientInit.cipherCommitments)") + log("[InboundNearbyConnection \(self.id)] Unsupported clientInit handshakeCipher: \(clientInit.cipherCommitments)") throw NearbyError.ukey2 } guard clientInit.nextProtocol == "AES_256_CBC-HMAC_SHA256" else { sendUkey2Alert(type: .badNextProtocol) - log("[InboundNearbyConnection] Unsupported clientInit nextProtocol: \(clientInit.nextProtocol)") + log("[InboundNearbyConnection \(self.id)] Unsupported clientInit nextProtocol: \(clientInit.nextProtocol)") throw NearbyError.ukey2 } @@ -297,14 +328,14 @@ class InboundNearbyConnection: NearbyConnection { private func processUkey2ClientFinish(_ msg: Securegcm_Ukey2Message, raw: Data) throws { guard msg.hasMessageType, msg.hasMessageData else { throw NearbyError.requiredFieldMissing("clientFinish ukey2message.type|data") } guard case .clientFinish = msg.messageType else { - log("[InboundNearbyConnection] Unexpected message type \(msg.messageType)") + log("[InboundNearbyConnection \(self.id)] Unexpected message type \(msg.messageType)") throw NearbyError.ukey2 } var sha = SHA512() sha.update(data: raw) guard cipherCommitment == Data(sha.finalize()) else { - log("[InboundNearbyConnection] Invalid cipherCommitment in clientFinish") + log("[InboundNearbyConnection \(self.id)] Invalid cipherCommitment in clientFinish") throw NearbyError.ukey2 } @@ -345,7 +376,7 @@ class InboundNearbyConnection: NearbyConnection { try sendTransferSetupFrame(pairedEncryption) currentState = .sentConnectionResponse } else { - log("[InboundNearbyConnection] Unhandled offline frame plaintext: \(frame)") + log("[InboundNearbyConnection \(self.id)] Unhandled offline frame plaintext: \(frame)") } } @@ -436,7 +467,7 @@ class InboundNearbyConnection: NearbyConnection { func rejectDueToUnsupportedFileType(_ frame: Sharing_Nearby_Frame) { - log("[InboundNearbyConnection] Rejecting transfer due to unsupported file type. Frame is \(frame.debugDescription)") + log("[InboundNearbyConnection \(self.id)] Rejecting transfer due to unsupported file type. Frame is \(frame.debugDescription)") NearbyConnectionManager.shared.mainAppDelegate?.showUnsupportedFileAlert(for: remoteDeviceInfo) rejectTransfer(with: .unsupportedAttachmentType) @@ -456,7 +487,7 @@ class InboundNearbyConnection: NearbyConnection { private func acceptTransfer(storeInTemp: Bool) { if currentState == .disconnected { - log("[InboundNearbyConnection] Detected timeout, not accepting transfer") + log("[InboundNearbyConnection \(self.id)] Detected timeout, not accepting transfer") return } @@ -477,9 +508,13 @@ class InboundNearbyConnection: NearbyConnection { progress.totalUnitCount = file.meta.size progress.kind = .file progress.isPausable = false + #if os(macOS) progress.publish() + #endif filesToBeReceived[id]!.progress = progress filesToBeReceived[id]!.created = true + + log("[InboundNearbyConnection \(self.id)] Accepted file with size \(file.meta.size)") } var frame = Sharing_Nearby_Frame() @@ -487,6 +522,7 @@ class InboundNearbyConnection: NearbyConnection { frame.v1.type = .response frame.v1.connectionResponse.status = .accept currentState = .receivingFiles + isTransferring = true try sendTransferSetupFrame(frame) } catch { lastError = error @@ -499,7 +535,7 @@ class InboundNearbyConnection: NearbyConnection { self.wasRejected = true - log("[InboundNearbyConnection] Rejecting transfer because of \( reason)") + log("[InboundNearbyConnection \(self.id)] Rejecting transfer because of \( reason)") var frame = Sharing_Nearby_Frame() frame.version = .v1 @@ -509,7 +545,7 @@ class InboundNearbyConnection: NearbyConnection { try sendTransferSetupFrame(frame) try sendDisconnectionAndDisconnect() } catch { - log("[InboundNearbyConnection] Error \(error)") + log("[InboundNearbyConnection \(self.id)] Error \(error)") protocolError() } } @@ -518,9 +554,11 @@ class InboundNearbyConnection: NearbyConnection { private func deletePartiallyReceivedFiles() { for (_, file) in filesToBeReceived { + #if os(macOS) if let progress = file.progress { progress.unpublish() } + #endif guard file.created else { continue } do { diff --git a/NearbyShare/Connection/NearbyConnection.swift b/NearbyShare/Connection/NearbyConnection.swift index 3eeb9d6..c3c257b 100644 --- a/NearbyShare/Connection/NearbyConnection.swift +++ b/NearbyShare/Connection/NearbyConnection.swift @@ -10,7 +10,6 @@ import CryptoKit import Foundation import Network import System - import BigInt import SwiftECC @@ -26,12 +25,19 @@ class NearbyConnection { var encryptionDone: Bool = false var lastError: Error? var bytesTransferred: Int64 = 0 + var cancelled: Bool = false + var isTransferring: Bool = false { + didSet { + log("[NearbyConnection \(self.id)] Now transferring. Setting up data transfer inactivity timer.") + startDataTransferTimer(previousBytesTransferred: bytesTransferred) + } + } private var payloadBuffers: [Int64: NSMutableData] = [:] private var connectionClosed: Bool = false private var inactivityTimer: DispatchSourceTimer? - private let timeoutInterval: TimeInterval = 50 + private let timeoutInterval: TimeInterval = 30 // UKEY2-related state var publicKey: ECPublicKey? @@ -59,6 +65,9 @@ class NearbyConnection { func start() { + + log("[NearbyConnection \(self.id)] Starting connection.") + connection.stateUpdateHandler = { state in if !self.connectionClosed { @@ -69,12 +78,10 @@ class NearbyConnection { // If connection reset by peer, it could still be a valid file transfer that has not been processed yet. => Wait if err == .posix(.ECONNRESET) { - NearbyConnection.dispatchQueue.asyncAfter(deadline: .now() + 0.5) { - - // If already closed, ignore the error, as file transfer has been processed - if !self.connectionClosed { - recordErrorAndDisconnect(err: err) - } + + log("[NearbyConnection \(self.id)] Network connection reset error detected.") + self.connectionClosedByPeer { + recordErrorAndDisconnect(err: err) } } else { @@ -83,7 +90,7 @@ class NearbyConnection { } } else { - log("[NearbyConnection] Connection already closed, ignoring state update: \(state)") + log("[NearbyConnection \(self.id)] Connection already closed, ignoring state update: \(state)") } } @@ -91,16 +98,16 @@ class NearbyConnection { func recordErrorAndDisconnect(err: NWError) { self.lastError = err - log("[NearbyConnection] Connection Error: \(err)") + log("[NearbyConnection \(self.id)] Connection Error: \(err)") // If the error is a connection reset, it could be due to firewall issues. if err == .posix(.ENOTCONN) { - ConnectionFailureTracker.shared.recordFailure { - NearbyConnectionManager.shared.mainAppDelegate?.showFirewallAlert() - } + log("[NearbyConnection \(self.id)] Network not connected error detected (firewall likely).") + self.lastError = NearbyError.firewallError } if err == .posix(.ENETDOWN) { + log("[NearbyConnection \(self.id)] Network down error detected.") self.lastError = NearbyError.protocolError("Error.NetworkDown".localized()) } @@ -109,11 +116,22 @@ class NearbyConnection { } + func connectionClosedByPeer(onError: @escaping () -> Void) { + NearbyConnection.dispatchQueue.asyncAfter(deadline: .now() + 0.5) { + + // If already closed, ignore the error, as file transfer has been processed + if !self.connectionClosed { + onError() + } + } + } + + func connectionReady() {} func protocolError() { - log("[NearbyConnection] Protocol error: \(String(describing: lastError))") + log("[NearbyConnection \(self.id)] Protocol error: \(String(describing: lastError))") disconnect() } @@ -149,17 +167,21 @@ class NearbyConnection { return } if isComplete { - log("[NearbyConnection] Connection closed by peer during receiveFrameAsync") - self.lastError = NearbyError.protocolError("Error.ClosedByPeer".localized()) - self.disconnect() + log("[NearbyConnection \(self.id)] Connection closed by peer during receiveFrameAsync()") + self.connectionClosedByPeer { + self.lastError = NearbyError.protocolError("Error.ClosedByPeer".localized()) + self.disconnect() + } return } if !(error == nil) { + log("[NearbyConnection \(self.id)] Error during receiveFrameAsync(): \(String(describing: error))") self.lastError = error self.protocolError() return } guard let content = content else { + log("[NearbyConnection \(self.id)] Received nil content during receiveFrameAsync(). IsComplete: \(isComplete)") assertionFailure() return } @@ -170,29 +192,42 @@ class NearbyConnection { return } - self.startInactivityTimer() + self.startAndResetHeartbeatTimer() self.receiveFrameAsync(length: frameLength) } } private func receiveFrameAsync(length: UInt32) { - connection.receive(minimumIncompleteLength: Int(length), maximumLength: Int(length)) { content, _, isComplete, _ in + connection.receive(minimumIncompleteLength: Int(length), maximumLength: Int(length)) { [self] content, _, isComplete, _ in if self.connectionClosed { return } if isComplete { - log("[NearbyConnection] Connection closed by peer during receiveFrameAsync") - self.lastError = NearbyError.protocolError("Error.ClosedByPeer".localized()) - self.disconnect() + log("[NearbyConnection \(self.id)] Connection closed by peer during receiveFrameAsync(length:)") + + if let content = content, !content.isEmpty { + log("[NearbyConnection \(self.id)] Connection closed by peer during receiveFrameAsync(length:), but trying to process the frame anyway. Frame length: \(content.count)") + self.processReceivedFrame(frameData: content) + } + else { + log("[NearbyConnection \(self.id)] Connection closed by peer during receiveFrameAsync(length:), but no content received anymore (\(String(describing: content))).") + } + + self.connectionClosedByPeer { + self.lastError = NearbyError.protocolError("Error.ClosedByPeer".localized()) + self.disconnect() + } + return } guard let content = content else { + log("[NearbyConnection \(self.id)] Received nil content during receiveFrameAsync(length:). IsComplete: \(isComplete)") self.protocolError() return } - self.startInactivityTimer() + self.startAndResetHeartbeatTimer() self.processReceivedFrame(frameData: content) self.receiveFrameAsync() } @@ -263,7 +298,7 @@ class NearbyConnection { func sendTransferSetupFrame(_ frame: Sharing_Nearby_Frame) throws { - log("[NearbyConnection] Sending transfer setup frame.") + log("[NearbyConnection \(self.id)] Sending transfer setup frame.") try sendBytesPayload(data: frame.serializedData(), id: Int64.random(in: Int64.min ... Int64.max)) } @@ -299,7 +334,7 @@ class NearbyConnection { guard smsg.hasSignature, smsg.hasHeaderAndBody else { throw NearbyError.requiredFieldMissing("secureMessage.signature|headerAndBody") } let hmac = Data(HMAC.authenticationCode(for: smsg.headerAndBody, using: recvHmacKey!)) - guard hmac == smsg.signature else { throw NearbyError.protocolError("hmac!=signature: Expected \(hmac), got \(smsg.signature)") } + guard hmac == smsg.signature else { throw NearbyError.protocolError("Error.Signature".localized()) } let headerAndBody = try Securemessage_HeaderAndBody(serializedBytes: smsg.headerAndBody) var decryptedData = Data(count: headerAndBody.body.count) @@ -338,8 +373,14 @@ class NearbyConnection { guard header.hasType, header.hasID else { throw NearbyError.requiredFieldMissing("payloadHeader.type|id") } guard payloadTransfer.hasPayloadChunk, chunk.hasOffset, chunk.hasFlags else { - log("[NearbyConnection] Payload transfer chunk is missing offset or flags, likely canceled.") - throw NearbyError.canceled(reason: .userCanceled) + + if payloadTransfer.controlMessage.event == .payloadCanceled { + log("[NearbyConnection \(self.id)] Cancel control frame received.") + throw NearbyError.canceled(reason: .userCanceled) + } + + log("[NearbyConnection \(self.id)] Payload transfer chunk is missing offset or flags. Frame is \(payloadTransfer.debugDescription)") + throw NearbyError.requiredFieldMissing("payloadChunk.offset|flags") } if case .bytes = header.type { @@ -383,11 +424,16 @@ class NearbyConnection { } else if offlineFrame.hasV1, offlineFrame.v1.hasType, case .keepAlive = offlineFrame.v1.type { - log("[NearbyConnection] Sent keep-alive, \(self.bytesTransferred) bytes sent") + log("[NearbyConnection \(self.id)] Sent keep-alive, \(self.bytesTransferred) bytes sent") sendKeepAlive(ack: true) } else { - log("[NearbyConnection] Unhandled offline frame encrypted: \(offlineFrame)") + if offlineFrame.hasV1, offlineFrame.v1.hasType, offlineFrame.v1.type == .bandwidthUpgradeRetry { + // only supporting WiFi for now, ignore upgrade request to other mediums + return + } + + log("[NearbyConnection \(self.id)] Unhandled offline frame encrypted: \(offlineFrame)") } } @@ -491,7 +537,7 @@ class NearbyConnection { func disconnect() { - log("[NearbyConnection] Disconnecting from connection.") + log("[NearbyConnection \(self.id)] Disconnecting from connection.") connection.stateUpdateHandler = nil inactivityTimer?.cancel() @@ -513,7 +559,7 @@ class NearbyConnection { try sendFrameAsync(offlineFrame.serializedData()) } - log("[NearbyConnection] Sent disconnection frame during sendDisconnectionAndDisconnect") + log("[NearbyConnection \(self.id)] Sent disconnection frame during sendDisconnectionAndDisconnect") disconnect() } @@ -526,7 +572,7 @@ class NearbyConnection { msg.messageData = try! alert.serializedData() sendFrameAsync(try! msg.serializedData()) - log("[NearbyConnection] Sent UKEY2 alert: \(type)") + log("[NearbyConnection \(self.id)] Sent UKEY2 alert: \(type)") disconnect() } @@ -544,12 +590,12 @@ class NearbyConnection { try sendFrameAsync(offlineFrame.serializedData()) } } catch { - log("[NearbyConnection] Error sending KEEP_ALIVE: \(error)") + log("[NearbyConnection \(self.id)] Error sending KEEP_ALIVE: \(error)") } } - func startInactivityTimer() { + func startAndResetHeartbeatTimer() { // Cancel previous timer if any inactivityTimer?.cancel() @@ -561,7 +607,7 @@ class NearbyConnection { guard let self = self else { return } if !self.connectionClosed { - log("[NearbyConnection] Connection timeout: No message received in \(self.timeoutInterval) seconds") + log("[NearbyConnection \(self.id)] Connection timeout: No message received in \(self.timeoutInterval) seconds") self.lastError = NearbyError.canceled(reason: .timedOut) self.disconnect() } @@ -571,6 +617,25 @@ class NearbyConnection { } + func startDataTransferTimer(previousBytesTransferred: Int64) { + NearbyConnection.dispatchQueue.asyncAfter(deadline: .now() + timeoutInterval) { + + if previousBytesTransferred < self.bytesTransferred { + // everything good, transferred more than last check, schedule next check + self.startDataTransferTimer(previousBytesTransferred: self.bytesTransferred) + } + else { + // connection stale, need to abort + if !self.connectionClosed { + log("[NearbyConnection \(self.id)] Connection timeout: No more data received in \(self.timeoutInterval) seconds") + self.lastError = NearbyError.canceled(reason: .timedOut) + self.disconnect() + } + } + } + } + + // -- MARK: - Internal Data Model struct InternalFileInfo { diff --git a/NearbyShare/Connection/NearbyConnectionManager.swift b/NearbyShare/Connection/NearbyConnectionManager.swift index c1f29ee..0011235 100644 --- a/NearbyShare/Connection/NearbyConnectionManager.swift +++ b/NearbyShare/Connection/NearbyConnectionManager.swift @@ -9,6 +9,9 @@ import Foundation import Network import System +#if os(iOS) +import UIKit +#endif public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearbyConnectionDelegate, OutboundNearbyConnectionDelegate { @@ -90,20 +93,29 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb ] let name = Data(nameBytes).urlSafeBase64EncodedString() - let endpointInfo = EndpointInfo(name: Host.current().localizedName!, deviceType: .computer) - let port = Int32(tcpListener.port!.rawValue) mdnsServices = serviceTypes.map { serviceType in let service = NetService(domain: "", type: serviceType, name: name, port: port) service.delegate = self service.setTXTRecord(NetService.data(fromTXTRecord: [ - "n": endpointInfo.serialize().urlSafeBase64EncodedString().data(using: .utf8)!, + "n": getEndpointInfo().serialize().urlSafeBase64EncodedString().data(using: .utf8)!, ])) service.publish() return service } } + + + func getEndpointInfo() -> EndpointInfo { + #if os(macOS) + let endpointInfo = EndpointInfo(name: Host.current().localizedName!, deviceType: .computer) + #else + let endpointInfo = EndpointInfo(name: UIDevice.current.name, deviceType: .phone) + #endif + + return endpointInfo + } func obtainUserConsent(for transfer: TransferMetadata, from device: RemoteDeviceInfo, connection _: InboundNearbyConnection) { @@ -123,7 +135,7 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb public func submitUserConsent(transferID: String, accept: Bool, storeInTemp: Bool = false) { guard let conn = incomingConnections[transferID] else { return } - log("[NearbyConnectionManager] Submitting user consent for transfer, accepted: \(accept), store in temp: \(storeInTemp)") + log("[NearbyConnectionManager] Submitting user consent for transfer \(transferID), accepted: \(accept), store in temp: \(storeInTemp)") conn.submitUserConsent(accepted: accept, storeInTemp: storeInTemp) } diff --git a/NearbyShare/Connection/OutboundNearbyConnection.swift b/NearbyShare/Connection/OutboundNearbyConnection.swift index 7c83375..da57535 100644 --- a/NearbyShare/Connection/OutboundNearbyConnection.swift +++ b/NearbyShare/Connection/OutboundNearbyConnection.swift @@ -24,7 +24,6 @@ class OutboundNearbyConnection: NearbyConnection { private var currentTransfer: OutgoingFileTransfer? private var totalBytesToSend: Int64 = 0 private var totalBytesSent: Int64 = 0 - private var cancelled: Bool = false private var textPayloadID: Int64 = 0 public var delegate: OutboundNearbyConnectionDelegate? @@ -102,7 +101,7 @@ class OutboundNearbyConnection: NearbyConnection { override func processReceivedFrame(frameData: Data) { if currentState != .sendingFiles { - log("[OutboundNearbyConnection] Received frame in state \(currentState)...") + log("[OutboundNearbyConnection \(self.id)] Received frame in state \(currentState)...") } do { @@ -119,7 +118,7 @@ class OutboundNearbyConnection: NearbyConnection { } } catch { - log("[OutboundNearbyConnection] Error occured while processing frame with data \(frameData.hex): \(error)") + log("[OutboundNearbyConnection \(self.id)] Error occured while processing frame with data \(frameData.hex): \(error)") if case NearbyError.ukey2 = error { // do nothing @@ -136,10 +135,11 @@ class OutboundNearbyConnection: NearbyConnection { override func processTransferSetupFrame(_ frame: Sharing_Nearby_Frame) throws { if frame.hasV1 && frame.v1.hasType, case .cancel = frame.v1.type { - - log("[OutboundNearbyConnection] Transfer canceled") + self.cancelled = true + self.lastError = NearbyError.canceled(reason: .userCanceled) + log("[OutboundNearbyConnection \(self.id)] Transfer canceled") try sendDisconnectionAndDisconnect() - delegate?.outboundConnection(connection: self, failedWithError: NearbyError.canceled(reason: .userCanceled)) + delegate?.outboundConnection(connection: self, failedWithError: self.lastError!) return } @@ -153,7 +153,7 @@ class OutboundNearbyConnection: NearbyConnection { case .sendingFiles: break default: - assertionFailure("[OutboundNearbyConnection] Unexpected state \(currentState)") + assertionFailure("[OutboundNearbyConnection \(self.id)] Unexpected state \(currentState)") } } @@ -165,14 +165,16 @@ class OutboundNearbyConnection: NearbyConnection { private func sendConnectionRequest() throws { + + let endpointInfo = NearbyConnectionManager.shared.getEndpointInfo() + var frame = Location_Nearby_Connections_OfflineFrame() frame.version = .v1 frame.v1 = Location_Nearby_Connections_V1Frame() frame.v1.type = .connectionRequest frame.v1.connectionRequest = Location_Nearby_Connections_ConnectionRequestFrame() frame.v1.connectionRequest.endpointID = String(bytes: NearbyConnectionManager.shared.endpointID, encoding: .ascii)! - frame.v1.connectionRequest.endpointName = Host.current().localizedName! - let endpointInfo = EndpointInfo(name: Host.current().localizedName!, deviceType: .computer) + frame.v1.connectionRequest.endpointName = endpointInfo.name frame.v1.connectionRequest.endpointInfo = endpointInfo.serialize() frame.v1.connectionRequest.mediums = [.wifiLan] try sendFrameAsync(frame.serializedData()) @@ -222,23 +224,23 @@ class OutboundNearbyConnection: NearbyConnection { ukeyServerInitMsgData = raw guard frame.messageType == .serverInit else { sendUkey2Alert(type: .badMessageType) - log("[OutboundNearbyConnection] Invalid message type: \(frame.messageType)") + log("[OutboundNearbyConnection \(self.id)] Invalid message type: \(frame.messageType)") throw NearbyError.ukey2 } let serverInit = try Securegcm_Ukey2ServerInit(serializedBytes: frame.messageData) guard serverInit.version == 1 else { sendUkey2Alert(type: .badVersion) - log("[OutboundNearbyConnection] Invalid version: \(serverInit.version)") + log("[OutboundNearbyConnection \(self.id)] Invalid version: \(serverInit.version)") throw NearbyError.ukey2 } guard serverInit.random.count == 32 else { sendUkey2Alert(type: .badRandom) - log("[OutboundNearbyConnection] Invalid random: \(serverInit.random.count)") + log("[OutboundNearbyConnection \(self.id)] Invalid random: \(serverInit.random.count)") throw NearbyError.ukey2 } guard serverInit.handshakeCipher == .p256Sha512 else { sendUkey2Alert(type: .badHandshakeCipher) - log("[OutboundNearbyConnection] Invalid handshake cipher: \(serverInit.handshakeCipher)") + log("[OutboundNearbyConnection \(self.id)] Invalid handshake cipher: \(serverInit.handshakeCipher)") throw NearbyError.ukey2 } @@ -338,7 +340,7 @@ class OutboundNearbyConnection: NearbyConnection { } else if meta.mimeType.starts(with: "audio/") { meta.type = .audio } else if url.pathExtension.lowercased() == "apk" { - meta.type = .app + meta.type = .androidApp } else { meta.type = .unknown } @@ -346,9 +348,10 @@ class OutboundNearbyConnection: NearbyConnection { try queue.append(OutgoingFileTransfer(url: url, payloadID: meta.payloadID, handle: FileHandle(forReadingFrom: url), totalBytes: meta.size, currentOffset: 0)) introduction.v1.introduction.fileMetadata.append(meta) totalBytesToSend += meta.size + + log("[OutboundNearbyConnection \(self.id)] Sending file with \(meta.size) bytes") } } - log("[OutboundNearbyConnection] Sent introduction: \(introduction)") try sendTransferSetupFrame(introduction) currentState = .sentIntroduction @@ -360,6 +363,7 @@ class OutboundNearbyConnection: NearbyConnection { switch frame.v1.connectionResponse.status { case .accept: currentState = .sendingFiles + isTransferring = true delegate?.outboundConnectionTransferAccepted(connection: self) if let textToSend = textToSend { @@ -412,7 +416,7 @@ class OutboundNearbyConnection: NearbyConnection { try currentTransfer?.handle?.close() } if queue.isEmpty { - log("[OutboundNearbyConnection] Disconnecting because all files have been transferred") + log("[OutboundNearbyConnection \(self.id)] Disconnecting because all files have been transferred") try sendDisconnectionAndDisconnect() delegate?.outboundConnectionTransferFinished(connection: self) return @@ -455,7 +459,7 @@ class OutboundNearbyConnection: NearbyConnection { // only for logging self.bytesTransferred += Int64(fileBuffer.count) - startInactivityTimer() + startAndResetHeartbeatTimer() delegate?.outboundConnection(connection: self, transferProgress: Double(totalBytesSent) / Double(totalBytesToSend)) if currentTransfer!.currentOffset == currentTransfer!.totalBytes { @@ -475,7 +479,7 @@ class OutboundNearbyConnection: NearbyConnection { wrapper.v1.type = .payloadTransfer wrapper.v1.payloadTransfer = transfer try encryptAndSendOfflineFrame(wrapper) - log("[OutboundNearbyConnection] Sent EOF, current transfer: \(String(describing: currentTransfer))") + log("[OutboundNearbyConnection \(self.id)] Sent EOF, current transfer: \(String(describing: currentTransfer))") } } diff --git a/NearbyShare/Connection/DataModel.swift b/NearbyShare/Model/DataModel.swift similarity index 98% rename from NearbyShare/Connection/DataModel.swift rename to NearbyShare/Model/DataModel.swift index 1d0927f..0f2c977 100644 --- a/NearbyShare/Connection/DataModel.swift +++ b/NearbyShare/Model/DataModel.swift @@ -27,7 +27,6 @@ protocol OutboundNearbyConnectionDelegate { public protocol MainAppDelegate { func obtainUserConsent(for transfer: TransferMetadata, from device: RemoteDeviceInfo) func incomingTransfer(id: String, didFinishWith error: Error?) - func showFirewallAlert() func showCopiedToClipboardAlert() func showUnsupportedFileAlert(for: RemoteDeviceInfo?) } @@ -44,7 +43,7 @@ public protocol ShareExtensionDelegate: AnyObject { } -public struct RemoteDeviceInfo { +public struct RemoteDeviceInfo: Identifiable, Equatable { public let name: String public let type: DeviceType public var id: String? @@ -164,6 +163,7 @@ public enum NearbyError: Error { case requiredFieldMissing(_ message: String) case ukey2 case packetFilterError + case firewallError case inputOutput case canceled(reason: CancellationReason) diff --git a/NearbyShare/Protobuf/device_to_device_messages.pb.swift b/NearbyShare/Model/Protobuf/device_to_device_messages.pb.swift similarity index 100% rename from NearbyShare/Protobuf/device_to_device_messages.pb.swift rename to NearbyShare/Model/Protobuf/device_to_device_messages.pb.swift diff --git a/NearbyShare/Protobuf/offline_wire_formats.pb.swift b/NearbyShare/Model/Protobuf/offline_wire_formats.pb.swift similarity index 63% rename from NearbyShare/Protobuf/offline_wire_formats.pb.swift rename to NearbyShare/Model/Protobuf/offline_wire_formats.pb.swift index 7524b1c..2d5c0a0 100644 --- a/NearbyShare/Protobuf/offline_wire_formats.pb.swift +++ b/NearbyShare/Model/Protobuf/offline_wire_formats.pb.swift @@ -34,6 +34,43 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP typealias Version = _2 } +enum Location_Nearby_Connections_EndpointType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownEndpoint // = 0 + case connectionsEndpoint // = 1 + case presenceEndpoint // = 2 + + init() { + self = .unknownEndpoint + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownEndpoint + case 1: self = .connectionsEndpoint + case 2: self = .presenceEndpoint + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownEndpoint: return 0 + case .connectionsEndpoint: return 1 + case .presenceEndpoint: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Connections_EndpointType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + struct Location_Nearby_Connections_OfflineFrame { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -179,6 +216,51 @@ struct Location_Nearby_Connections_V1Frame { /// Clears the value of `pairedKeyEncryption`. Subsequent reads from it will return its default value. mutating func clearPairedKeyEncryption() {_uniqueStorage()._pairedKeyEncryption = nil} + var authenticationMessage: Location_Nearby_Connections_AuthenticationMessageFrame { + get {return _storage._authenticationMessage ?? Location_Nearby_Connections_AuthenticationMessageFrame()} + set {_uniqueStorage()._authenticationMessage = newValue} + } + /// Returns true if `authenticationMessage` has been explicitly set. + var hasAuthenticationMessage: Bool {return _storage._authenticationMessage != nil} + /// Clears the value of `authenticationMessage`. Subsequent reads from it will return its default value. + mutating func clearAuthenticationMessage() {_uniqueStorage()._authenticationMessage = nil} + + var authenticationResult: Location_Nearby_Connections_AuthenticationResultFrame { + get {return _storage._authenticationResult ?? Location_Nearby_Connections_AuthenticationResultFrame()} + set {_uniqueStorage()._authenticationResult = newValue} + } + /// Returns true if `authenticationResult` has been explicitly set. + var hasAuthenticationResult: Bool {return _storage._authenticationResult != nil} + /// Clears the value of `authenticationResult`. Subsequent reads from it will return its default value. + mutating func clearAuthenticationResult() {_uniqueStorage()._authenticationResult = nil} + + var autoResume: Location_Nearby_Connections_AutoResumeFrame { + get {return _storage._autoResume ?? Location_Nearby_Connections_AutoResumeFrame()} + set {_uniqueStorage()._autoResume = newValue} + } + /// Returns true if `autoResume` has been explicitly set. + var hasAutoResume: Bool {return _storage._autoResume != nil} + /// Clears the value of `autoResume`. Subsequent reads from it will return its default value. + mutating func clearAutoResume() {_uniqueStorage()._autoResume = nil} + + var autoReconnect: Location_Nearby_Connections_AutoReconnectFrame { + get {return _storage._autoReconnect ?? Location_Nearby_Connections_AutoReconnectFrame()} + set {_uniqueStorage()._autoReconnect = newValue} + } + /// Returns true if `autoReconnect` has been explicitly set. + var hasAutoReconnect: Bool {return _storage._autoReconnect != nil} + /// Clears the value of `autoReconnect`. Subsequent reads from it will return its default value. + mutating func clearAutoReconnect() {_uniqueStorage()._autoReconnect = nil} + + var bandwidthUpgradeRetry: Location_Nearby_Connections_BandwidthUpgradeRetryFrame { + get {return _storage._bandwidthUpgradeRetry ?? Location_Nearby_Connections_BandwidthUpgradeRetryFrame()} + set {_uniqueStorage()._bandwidthUpgradeRetry = newValue} + } + /// Returns true if `bandwidthUpgradeRetry` has been explicitly set. + var hasBandwidthUpgradeRetry: Bool {return _storage._bandwidthUpgradeRetry != nil} + /// Clears the value of `bandwidthUpgradeRetry`. Subsequent reads from it will return its default value. + mutating func clearBandwidthUpgradeRetry() {_uniqueStorage()._bandwidthUpgradeRetry = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() enum FrameType: SwiftProtobuf.Enum { @@ -191,6 +273,11 @@ struct Location_Nearby_Connections_V1Frame { case keepAlive // = 5 case disconnection // = 6 case pairedKeyEncryption // = 7 + case authenticationMessage // = 8 + case authenticationResult // = 9 + case autoResume // = 10 + case autoReconnect // = 11 + case bandwidthUpgradeRetry // = 12 init() { self = .unknownFrameType @@ -206,6 +293,11 @@ struct Location_Nearby_Connections_V1Frame { case 5: self = .keepAlive case 6: self = .disconnection case 7: self = .pairedKeyEncryption + case 8: self = .authenticationMessage + case 9: self = .authenticationResult + case 10: self = .autoResume + case 11: self = .autoReconnect + case 12: self = .bandwidthUpgradeRetry default: return nil } } @@ -220,6 +312,11 @@ struct Location_Nearby_Connections_V1Frame { case .keepAlive: return 5 case .disconnection: return 6 case .pairedKeyEncryption: return 7 + case .authenticationMessage: return 8 + case .authenticationResult: return 9 + case .autoResume: return 10 + case .autoReconnect: return 11 + case .bandwidthUpgradeRetry: return 12 } } @@ -346,8 +443,73 @@ struct Location_Nearby_Connections_ConnectionRequestFrame { /// Clears the value of `deviceInfo`. Subsequent reads from it will return its default value. mutating func clearDeviceInfo() {_uniqueStorage()._deviceInfo = nil} + /// Represents the {@link Device} that invokes the request. + var device: OneOf_Device? { + get {return _storage._device} + set {_uniqueStorage()._device = newValue} + } + + var connectionsDevice: Location_Nearby_Connections_ConnectionsDevice { + get { + if case .connectionsDevice(let v)? = _storage._device {return v} + return Location_Nearby_Connections_ConnectionsDevice() + } + set {_uniqueStorage()._device = .connectionsDevice(newValue)} + } + + var presenceDevice: Location_Nearby_Connections_PresenceDevice { + get { + if case .presenceDevice(let v)? = _storage._device {return v} + return Location_Nearby_Connections_PresenceDevice() + } + set {_uniqueStorage()._device = .presenceDevice(newValue)} + } + + var connectionMode: Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode { + get {return _storage._connectionMode ?? .legacy} + set {_uniqueStorage()._connectionMode = newValue} + } + /// Returns true if `connectionMode` has been explicitly set. + var hasConnectionMode: Bool {return _storage._connectionMode != nil} + /// Clears the value of `connectionMode`. Subsequent reads from it will return its default value. + mutating func clearConnectionMode() {_uniqueStorage()._connectionMode = nil} + + var locationHint: Location_Nearby_Connections_LocationHint { + get {return _storage._locationHint ?? Location_Nearby_Connections_LocationHint()} + set {_uniqueStorage()._locationHint = newValue} + } + /// Returns true if `locationHint` has been explicitly set. + var hasLocationHint: Bool {return _storage._locationHint != nil} + /// Clears the value of `locationHint`. Subsequent reads from it will return its default value. + mutating func clearLocationHint() {_uniqueStorage()._locationHint = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() + /// Represents the {@link Device} that invokes the request. + enum OneOf_Device: Equatable { + case connectionsDevice(Location_Nearby_Connections_ConnectionsDevice) + case presenceDevice(Location_Nearby_Connections_PresenceDevice) + + #if !swift(>=4.1) + static func ==(lhs: Location_Nearby_Connections_ConnectionRequestFrame.OneOf_Device, rhs: Location_Nearby_Connections_ConnectionRequestFrame.OneOf_Device) -> Bool { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch (lhs, rhs) { + case (.connectionsDevice, .connectionsDevice): return { + guard case .connectionsDevice(let l) = lhs, case .connectionsDevice(let r) = rhs else { preconditionFailure() } + return l == r + }() + case (.presenceDevice, .presenceDevice): return { + guard case .presenceDevice(let l) = lhs, case .presenceDevice(let r) = rhs else { preconditionFailure() } + return l == r + }() + default: return false + } + } + #endif + } + /// Should always match cs/symbol:location.nearby.proto.connections.Medium /// LINT.IfChange enum Medium: SwiftProtobuf.Enum { @@ -364,6 +526,8 @@ struct Location_Nearby_Connections_ConnectionRequestFrame { case webRtc // = 9 case bleL2Cap // = 10 case usb // = 11 + case webRtcNonCellular // = 12 + case awdl // = 13 init() { self = .unknownMedium @@ -383,6 +547,8 @@ struct Location_Nearby_Connections_ConnectionRequestFrame { case 9: self = .webRtc case 10: self = .bleL2Cap case 11: self = .usb + case 12: self = .webRtcNonCellular + case 13: self = .awdl default: return nil } } @@ -401,6 +567,35 @@ struct Location_Nearby_Connections_ConnectionRequestFrame { case .webRtc: return 9 case .bleL2Cap: return 10 case .usb: return 11 + case .webRtcNonCellular: return 12 + case .awdl: return 13 + } + } + + } + + /// LINT.IfChange + enum ConnectionMode: SwiftProtobuf.Enum { + typealias RawValue = Int + case legacy // = 0 + case instant // = 1 + + init() { + self = .legacy + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .legacy + case 1: self = .instant + default: return nil + } + } + + var rawValue: Int { + switch self { + case .legacy: return 0 + case .instant: return 1 } } @@ -417,6 +612,10 @@ extension Location_Nearby_Connections_ConnectionRequestFrame.Medium: CaseIterabl // Support synthesized by the compiler. } +extension Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode: CaseIterable { + // Support synthesized by the compiler. +} + #endif // swift(>=4.2) /// This doesn't need to send back endpoint_id and endpoint_name (like @@ -490,6 +689,33 @@ struct Location_Nearby_Connections_ConnectionResponseFrame { /// Clears the value of `nearbyConnectionsVersion`. Subsequent reads from it will return its default value. mutating func clearNearbyConnectionsVersion() {self._nearbyConnectionsVersion = nil} + var safeToDisconnectVersion: Int32 { + get {return _safeToDisconnectVersion ?? 0} + set {_safeToDisconnectVersion = newValue} + } + /// Returns true if `safeToDisconnectVersion` has been explicitly set. + var hasSafeToDisconnectVersion: Bool {return self._safeToDisconnectVersion != nil} + /// Clears the value of `safeToDisconnectVersion`. Subsequent reads from it will return its default value. + mutating func clearSafeToDisconnectVersion() {self._safeToDisconnectVersion = nil} + + var locationHint: Location_Nearby_Connections_LocationHint { + get {return _locationHint ?? Location_Nearby_Connections_LocationHint()} + set {_locationHint = newValue} + } + /// Returns true if `locationHint` has been explicitly set. + var hasLocationHint: Bool {return self._locationHint != nil} + /// Clears the value of `locationHint`. Subsequent reads from it will return its default value. + mutating func clearLocationHint() {self._locationHint = nil} + + var keepAliveTimeoutMillis: Int32 { + get {return _keepAliveTimeoutMillis ?? 0} + set {_keepAliveTimeoutMillis = newValue} + } + /// Returns true if `keepAliveTimeoutMillis` has been explicitly set. + var hasKeepAliveTimeoutMillis: Bool {return self._keepAliveTimeoutMillis != nil} + /// Clears the value of `keepAliveTimeoutMillis`. Subsequent reads from it will return its default value. + mutating func clearKeepAliveTimeoutMillis() {self._keepAliveTimeoutMillis = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() /// Used to replace the status integer parameter with a meaningful enum item. @@ -533,6 +759,9 @@ struct Location_Nearby_Connections_ConnectionResponseFrame { fileprivate var _osInfo: Location_Nearby_Connections_OsInfo? = nil fileprivate var _multiplexSocketBitmask: Int32? = nil fileprivate var _nearbyConnectionsVersion: Int32? = nil + fileprivate var _safeToDisconnectVersion: Int32? = nil + fileprivate var _locationHint: Location_Nearby_Connections_LocationHint? = nil + fileprivate var _keepAliveTimeoutMillis: Int32? = nil } #if swift(>=4.2) @@ -592,6 +821,7 @@ struct Location_Nearby_Connections_PayloadTransferFrame { case unknownPacketType // = 0 case data // = 1 case control // = 2 + case payloadAck // = 3 init() { self = .unknownPacketType @@ -602,6 +832,7 @@ struct Location_Nearby_Connections_PayloadTransferFrame { case 0: self = .unknownPacketType case 1: self = .data case 2: self = .control + case 3: self = .payloadAck default: return nil } } @@ -611,6 +842,7 @@ struct Location_Nearby_Connections_PayloadTransferFrame { case .unknownPacketType: return 0 case .data: return 1 case .control: return 2 + case .payloadAck: return 3 } } @@ -675,6 +907,16 @@ struct Location_Nearby_Connections_PayloadTransferFrame { /// Clears the value of `parentFolder`. Subsequent reads from it will return its default value. mutating func clearParentFolder() {self._parentFolder = nil} + /// Time since the epoch in milliseconds. + var lastModifiedTimestampMillis: Int64 { + get {return _lastModifiedTimestampMillis ?? 0} + set {_lastModifiedTimestampMillis = newValue} + } + /// Returns true if `lastModifiedTimestampMillis` has been explicitly set. + var hasLastModifiedTimestampMillis: Bool {return self._lastModifiedTimestampMillis != nil} + /// Clears the value of `lastModifiedTimestampMillis`. Subsequent reads from it will return its default value. + mutating func clearLastModifiedTimestampMillis() {self._lastModifiedTimestampMillis = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() enum PayloadType: SwiftProtobuf.Enum { @@ -717,6 +959,7 @@ struct Location_Nearby_Connections_PayloadTransferFrame { fileprivate var _isSensitive: Bool? = nil fileprivate var _fileName: String? = nil fileprivate var _parentFolder: String? = nil + fileprivate var _lastModifiedTimestampMillis: Int64? = nil } /// Accompanies DATA packets. @@ -752,6 +995,15 @@ struct Location_Nearby_Connections_PayloadTransferFrame { /// Clears the value of `body`. Subsequent reads from it will return its default value. mutating func clearBody() {self._body = nil} + var index: Int32 { + get {return _index ?? 0} + set {_index = newValue} + } + /// Returns true if `index` has been explicitly set. + var hasIndex: Bool {return self._index != nil} + /// Clears the value of `index`. Subsequent reads from it will return its default value. + mutating func clearIndex() {self._index = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() enum Flags: SwiftProtobuf.Enum { @@ -782,6 +1034,7 @@ struct Location_Nearby_Connections_PayloadTransferFrame { fileprivate var _flags: Int32? = nil fileprivate var _offset: Int64? = nil fileprivate var _body: Data? = nil + fileprivate var _index: Int32? = nil } /// Accompanies CONTROL packets. @@ -815,6 +1068,8 @@ struct Location_Nearby_Connections_PayloadTransferFrame { case unknownEventType // = 0 case payloadError // = 1 case payloadCanceled // = 2 + + /// Use PacketType.PAYLOAD_ACK instead case payloadReceivedAck // = 3 init() { @@ -918,6 +1173,15 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { /// Clears the value of `clientIntroductionAck`. Subsequent reads from it will return its default value. mutating func clearClientIntroductionAck() {self._clientIntroductionAck = nil} + var safeToClosePriorChannel: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel { + get {return _safeToClosePriorChannel ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel()} + set {_safeToClosePriorChannel = newValue} + } + /// Returns true if `safeToClosePriorChannel` has been explicitly set. + var hasSafeToClosePriorChannel: Bool {return self._safeToClosePriorChannel != nil} + /// Clears the value of `safeToClosePriorChannel`. Subsequent reads from it will return its default value. + mutating func clearSafeToClosePriorChannel() {self._safeToClosePriorChannel = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() enum EventType: SwiftProtobuf.Enum { @@ -930,6 +1194,10 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { case upgradeFailure // = 5 case clientIntroductionAck // = 6 + /// The event type that requires the remote device to send the available + /// upgrade path. + case upgradePathRequest // = 7 + init() { self = .unknownEventType } @@ -943,6 +1211,7 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { case 4: self = .clientIntroduction case 5: self = .upgradeFailure case 6: self = .clientIntroductionAck + case 7: self = .upgradePathRequest default: return nil } } @@ -956,6 +1225,7 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { case .clientIntroduction: return 4 case .upgradeFailure: return 5 case .clientIntroductionAck: return 6 + case .upgradePathRequest: return 7 } } @@ -1031,6 +1301,15 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { /// Clears the value of `webRtcCredentials`. Subsequent reads from it will return its default value. mutating func clearWebRtcCredentials() {_uniqueStorage()._webRtcCredentials = nil} + var awdlCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials { + get {return _storage._awdlCredentials ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials()} + set {_uniqueStorage()._awdlCredentials = newValue} + } + /// Returns true if `awdlCredentials` has been explicitly set. + var hasAwdlCredentials: Bool {return _storage._awdlCredentials != nil} + /// Clears the value of `awdlCredentials`. Subsequent reads from it will return its default value. + mutating func clearAwdlCredentials() {_uniqueStorage()._awdlCredentials = nil} + /// Disable Encryption for this upgrade medium to improve throughput. var supportsDisablingEncryption: Bool { get {return _storage._supportsDisablingEncryption ?? false} @@ -1051,6 +1330,15 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { /// Clears the value of `supportsClientIntroductionAck`. Subsequent reads from it will return its default value. mutating func clearSupportsClientIntroductionAck() {_uniqueStorage()._supportsClientIntroductionAck = nil} + var upgradePathRequest: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest { + get {return _storage._upgradePathRequest ?? Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest()} + set {_uniqueStorage()._upgradePathRequest = newValue} + } + /// Returns true if `upgradePathRequest` has been explicitly set. + var hasUpgradePathRequest: Bool {return _storage._upgradePathRequest != nil} + /// Clears the value of `upgradePathRequest`. Subsequent reads from it will return its default value. + mutating func clearUpgradePathRequest() {_uniqueStorage()._upgradePathRequest = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() /// Should always match cs/symbol:location.nearby.proto.connections.Medium @@ -1069,6 +1357,8 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { /// 10 is reserved. case usb // = 11 + case webRtcNonCellular // = 12 + case awdl // = 13 init() { self = .unknownMedium @@ -1087,6 +1377,8 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { case 8: self = .wifiDirect case 9: self = .webRtc case 11: self = .usb + case 12: self = .webRtcNonCellular + case 13: self = .awdl default: return nil } } @@ -1104,6 +1396,8 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { case .wifiDirect: return 8 case .webRtc: return 9 case .usb: return 11 + case .webRtcNonCellular: return 12 + case .awdl: return 13 } } @@ -1329,6 +1623,18 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { /// Clears the value of `gateway`. Subsequent reads from it will return its default value. mutating func clearGateway() {self._gateway = nil} + /// IPv6 link-local address, network order (128bits). + /// The GO should listen on both IPv4 and IPv6 addresses. + /// https://en.wikipedia.org/wiki/Link-local_address#IPv6 + var ipV6Address: Data { + get {return _ipV6Address ?? Data()} + set {_ipV6Address = newValue} + } + /// Returns true if `ipV6Address` has been explicitly set. + var hasIpV6Address: Bool {return self._ipV6Address != nil} + /// Clears the value of `ipV6Address`. Subsequent reads from it will return its default value. + mutating func clearIpV6Address() {self._ipV6Address = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -1338,6 +1644,7 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { fileprivate var _port: Int32? = nil fileprivate var _frequency: Int32? = nil fileprivate var _gateway: String? = nil + fileprivate var _ipV6Address: Data? = nil } /// Accompanies Medium.WEB_RTC @@ -1372,11 +1679,99 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { fileprivate var _locationHint: Location_Nearby_Connections_LocationHint? = nil } + /// Accompanies Medium.AWDL. + struct AwdlCredentials { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var serviceName: String { + get {return _serviceName ?? String()} + set {_serviceName = newValue} + } + /// Returns true if `serviceName` has been explicitly set. + var hasServiceName: Bool {return self._serviceName != nil} + /// Clears the value of `serviceName`. Subsequent reads from it will return its default value. + mutating func clearServiceName() {self._serviceName = nil} + + var serviceType: String { + get {return _serviceType ?? String()} + set {_serviceType = newValue} + } + /// Returns true if `serviceType` has been explicitly set. + var hasServiceType: Bool {return self._serviceType != nil} + /// Clears the value of `serviceType`. Subsequent reads from it will return its default value. + mutating func clearServiceType() {self._serviceType = nil} + + var password: String { + get {return _password ?? String()} + set {_password = newValue} + } + /// Returns true if `password` has been explicitly set. + var hasPassword: Bool {return self._password != nil} + /// Clears the value of `password`. Subsequent reads from it will return its default value. + mutating func clearPassword() {self._password = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _serviceName: String? = nil + fileprivate var _serviceType: String? = nil + fileprivate var _password: String? = nil + } + + struct UpgradePathRequest { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Supported mediums on the advertiser device. + var mediums: [Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.Medium] = [] + + var mediumMetaData: Location_Nearby_Connections_MediumMetadata { + get {return _mediumMetaData ?? Location_Nearby_Connections_MediumMetadata()} + set {_mediumMetaData = newValue} + } + /// Returns true if `mediumMetaData` has been explicitly set. + var hasMediumMetaData: Bool {return self._mediumMetaData != nil} + /// Clears the value of `mediumMetaData`. Subsequent reads from it will return its default value. + mutating func clearMediumMetaData() {self._mediumMetaData = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _mediumMetaData: Location_Nearby_Connections_MediumMetadata? = nil + } + init() {} fileprivate var _storage = _StorageClass.defaultInstance } + /// Accompanies SAFE_TO_CLOSE_PRIOR_CHANNEL events. + struct SafeToClosePriorChannel { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var staFrequency: Int32 { + get {return _staFrequency ?? 0} + set {_staFrequency = newValue} + } + /// Returns true if `staFrequency` has been explicitly set. + var hasStaFrequency: Bool {return self._staFrequency != nil} + /// Clears the value of `staFrequency`. Subsequent reads from it will return its default value. + mutating func clearStaFrequency() {self._staFrequency = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _staFrequency: Int32? = nil + } + /// Accompanies CLIENT_INTRODUCTION events. struct ClientIntroduction { // SwiftProtobuf.Message conformance is added in an extension below. See the @@ -1401,12 +1796,22 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { /// Clears the value of `supportsDisablingEncryption`. Subsequent reads from it will return its default value. mutating func clearSupportsDisablingEncryption() {self._supportsDisablingEncryption = nil} + var lastEndpointID: String { + get {return _lastEndpointID ?? String()} + set {_lastEndpointID = newValue} + } + /// Returns true if `lastEndpointID` has been explicitly set. + var hasLastEndpointID: Bool {return self._lastEndpointID != nil} + /// Clears the value of `lastEndpointID`. Subsequent reads from it will return its default value. + mutating func clearLastEndpointID() {self._lastEndpointID = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _endpointID: String? = nil fileprivate var _supportsDisablingEncryption: Bool? = nil + fileprivate var _lastEndpointID: String? = nil } /// Accompanies CLIENT_INTRODUCTION_ACK events. @@ -1426,6 +1831,7 @@ struct Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame { fileprivate var _upgradePathInfo: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo? = nil fileprivate var _clientIntroduction: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction? = nil fileprivate var _clientIntroductionAck: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroductionAck? = nil + fileprivate var _safeToClosePriorChannel: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel? = nil } #if swift(>=4.2) @@ -1440,6 +1846,104 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa #endif // swift(>=4.2) +struct Location_Nearby_Connections_BandwidthUpgradeRetryFrame { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The mediums this device supports upgrading to. This list should be filtered + /// by both the strategy and this device's individual limitations. + var supportedMedium: [Location_Nearby_Connections_BandwidthUpgradeRetryFrame.Medium] = [] + + /// If true, expect the remote endpoint to send back the latest + /// supported_medium. + var isRequest: Bool { + get {return _isRequest ?? false} + set {_isRequest = newValue} + } + /// Returns true if `isRequest` has been explicitly set. + var hasIsRequest: Bool {return self._isRequest != nil} + /// Clears the value of `isRequest`. Subsequent reads from it will return its default value. + mutating func clearIsRequest() {self._isRequest = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// Should always match cs/symbol:location.nearby.proto.connections.Medium + /// LINT.IfChange + enum Medium: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownMedium // = 0 + + /// 1 is reserved. + case bluetooth // = 2 + case wifiHotspot // = 3 + case ble // = 4 + case wifiLan // = 5 + case wifiAware // = 6 + case nfc // = 7 + case wifiDirect // = 8 + case webRtc // = 9 + case bleL2Cap // = 10 + case usb // = 11 + case webRtcNonCellular // = 12 + case awdl // = 13 + + init() { + self = .unknownMedium + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownMedium + case 2: self = .bluetooth + case 3: self = .wifiHotspot + case 4: self = .ble + case 5: self = .wifiLan + case 6: self = .wifiAware + case 7: self = .nfc + case 8: self = .wifiDirect + case 9: self = .webRtc + case 10: self = .bleL2Cap + case 11: self = .usb + case 12: self = .webRtcNonCellular + case 13: self = .awdl + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownMedium: return 0 + case .bluetooth: return 2 + case .wifiHotspot: return 3 + case .ble: return 4 + case .wifiLan: return 5 + case .wifiAware: return 6 + case .nfc: return 7 + case .wifiDirect: return 8 + case .webRtc: return 9 + case .bleL2Cap: return 10 + case .usb: return 11 + case .webRtcNonCellular: return 12 + case .awdl: return 13 + } + } + + } + + init() {} + + fileprivate var _isRequest: Bool? = nil +} + +#if swift(>=4.2) + +extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame.Medium: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + struct Location_Nearby_Connections_KeepAliveFrame { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1455,11 +1959,22 @@ struct Location_Nearby_Connections_KeepAliveFrame { /// Clears the value of `ack`. Subsequent reads from it will return its default value. mutating func clearAck() {self._ack = nil} + /// The sequence number + var seqNum: UInt32 { + get {return _seqNum ?? 0} + set {_seqNum = newValue} + } + /// Returns true if `seqNum` has been explicitly set. + var hasSeqNum: Bool {return self._seqNum != nil} + /// Clears the value of `seqNum`. Subsequent reads from it will return its default value. + mutating func clearSeqNum() {self._seqNum = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} fileprivate var _ack: Bool? = nil + fileprivate var _seqNum: UInt32? = nil } /// Informs the remote side to immediately severe the socket connection. @@ -1524,6 +2039,221 @@ struct Location_Nearby_Connections_PairedKeyEncryptionFrame { fileprivate var _signedData: Data? = nil } +/// Nearby Connections authentication frame, contains the bytes format of a +/// DeviceProvider's authentication message. +struct Location_Nearby_Connections_AuthenticationMessageFrame { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// An auth message generated by DeviceProvider. + /// To be sent to the remote device for verification during connection setups. + var authMessage: Data { + get {return _authMessage ?? Data()} + set {_authMessage = newValue} + } + /// Returns true if `authMessage` has been explicitly set. + var hasAuthMessage: Bool {return self._authMessage != nil} + /// Clears the value of `authMessage`. Subsequent reads from it will return its default value. + mutating func clearAuthMessage() {self._authMessage = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _authMessage: Data? = nil +} + +/// Nearby Connections authentication result frame. +struct Location_Nearby_Connections_AuthenticationResultFrame { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The authentication result. Non null if this frame is used to exchange + /// authentication result. + var result: Int32 { + get {return _result ?? 0} + set {_result = newValue} + } + /// Returns true if `result` has been explicitly set. + var hasResult: Bool {return self._result != nil} + /// Clears the value of `result`. Subsequent reads from it will return its default value. + mutating func clearResult() {self._result = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _result: Int32? = nil +} + +struct Location_Nearby_Connections_AutoResumeFrame { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var eventType: Location_Nearby_Connections_AutoResumeFrame.EventType { + get {return _eventType ?? .unknownAutoResumeEventType} + set {_eventType = newValue} + } + /// Returns true if `eventType` has been explicitly set. + var hasEventType: Bool {return self._eventType != nil} + /// Clears the value of `eventType`. Subsequent reads from it will return its default value. + mutating func clearEventType() {self._eventType = nil} + + var pendingPayloadID: Int64 { + get {return _pendingPayloadID ?? 0} + set {_pendingPayloadID = newValue} + } + /// Returns true if `pendingPayloadID` has been explicitly set. + var hasPendingPayloadID: Bool {return self._pendingPayloadID != nil} + /// Clears the value of `pendingPayloadID`. Subsequent reads from it will return its default value. + mutating func clearPendingPayloadID() {self._pendingPayloadID = nil} + + var nextPayloadChunkIndex: Int32 { + get {return _nextPayloadChunkIndex ?? 0} + set {_nextPayloadChunkIndex = newValue} + } + /// Returns true if `nextPayloadChunkIndex` has been explicitly set. + var hasNextPayloadChunkIndex: Bool {return self._nextPayloadChunkIndex != nil} + /// Clears the value of `nextPayloadChunkIndex`. Subsequent reads from it will return its default value. + mutating func clearNextPayloadChunkIndex() {self._nextPayloadChunkIndex = nil} + + var version: Int32 { + get {return _version ?? 0} + set {_version = newValue} + } + /// Returns true if `version` has been explicitly set. + var hasVersion: Bool {return self._version != nil} + /// Clears the value of `version`. Subsequent reads from it will return its default value. + mutating func clearVersion() {self._version = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum EventType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownAutoResumeEventType // = 0 + case payloadResumeTransferStart // = 1 + case payloadResumeTransferAck // = 2 + + init() { + self = .unknownAutoResumeEventType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownAutoResumeEventType + case 1: self = .payloadResumeTransferStart + case 2: self = .payloadResumeTransferAck + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownAutoResumeEventType: return 0 + case .payloadResumeTransferStart: return 1 + case .payloadResumeTransferAck: return 2 + } + } + + } + + init() {} + + fileprivate var _eventType: Location_Nearby_Connections_AutoResumeFrame.EventType? = nil + fileprivate var _pendingPayloadID: Int64? = nil + fileprivate var _nextPayloadChunkIndex: Int32? = nil + fileprivate var _version: Int32? = nil +} + +#if swift(>=4.2) + +extension Location_Nearby_Connections_AutoResumeFrame.EventType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +struct Location_Nearby_Connections_AutoReconnectFrame { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var endpointID: String { + get {return _endpointID ?? String()} + set {_endpointID = newValue} + } + /// Returns true if `endpointID` has been explicitly set. + var hasEndpointID: Bool {return self._endpointID != nil} + /// Clears the value of `endpointID`. Subsequent reads from it will return its default value. + mutating func clearEndpointID() {self._endpointID = nil} + + var eventType: Location_Nearby_Connections_AutoReconnectFrame.EventType { + get {return _eventType ?? .unknownEventType} + set {_eventType = newValue} + } + /// Returns true if `eventType` has been explicitly set. + var hasEventType: Bool {return self._eventType != nil} + /// Clears the value of `eventType`. Subsequent reads from it will return its default value. + mutating func clearEventType() {self._eventType = nil} + + var lastEndpointID: String { + get {return _lastEndpointID ?? String()} + set {_lastEndpointID = newValue} + } + /// Returns true if `lastEndpointID` has been explicitly set. + var hasLastEndpointID: Bool {return self._lastEndpointID != nil} + /// Clears the value of `lastEndpointID`. Subsequent reads from it will return its default value. + mutating func clearLastEndpointID() {self._lastEndpointID = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum EventType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownEventType // = 0 + case clientIntroduction // = 1 + case clientIntroductionAck // = 2 + + init() { + self = .unknownEventType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownEventType + case 1: self = .clientIntroduction + case 2: self = .clientIntroductionAck + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownEventType: return 0 + case .clientIntroduction: return 1 + case .clientIntroductionAck: return 2 + } + } + + } + + init() {} + + fileprivate var _endpointID: String? = nil + fileprivate var _eventType: Location_Nearby_Connections_AutoReconnectFrame.EventType? = nil + fileprivate var _lastEndpointID: String? = nil +} + +#if swift(>=4.2) + +extension Location_Nearby_Connections_AutoReconnectFrame.EventType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + struct Location_Nearby_Connections_MediumMetadata { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -1531,131 +2261,131 @@ struct Location_Nearby_Connections_MediumMetadata { /// True if local device supports 5GHz. var supports5Ghz: Bool { - get {return _supports5Ghz ?? false} - set {_supports5Ghz = newValue} + get {return _storage._supports5Ghz ?? false} + set {_uniqueStorage()._supports5Ghz = newValue} } /// Returns true if `supports5Ghz` has been explicitly set. - var hasSupports5Ghz: Bool {return self._supports5Ghz != nil} + var hasSupports5Ghz: Bool {return _storage._supports5Ghz != nil} /// Clears the value of `supports5Ghz`. Subsequent reads from it will return its default value. - mutating func clearSupports5Ghz() {self._supports5Ghz = nil} + mutating func clearSupports5Ghz() {_uniqueStorage()._supports5Ghz = nil} /// WiFi LAN BSSID, in the form of a six-byte MAC address: XX:XX:XX:XX:XX:XX var bssid: String { - get {return _bssid ?? String()} - set {_bssid = newValue} + get {return _storage._bssid ?? String()} + set {_uniqueStorage()._bssid = newValue} } /// Returns true if `bssid` has been explicitly set. - var hasBssid: Bool {return self._bssid != nil} + var hasBssid: Bool {return _storage._bssid != nil} /// Clears the value of `bssid`. Subsequent reads from it will return its default value. - mutating func clearBssid() {self._bssid = nil} + mutating func clearBssid() {_uniqueStorage()._bssid = nil} /// IP address, in network byte order: the highest order byte of the address is /// in byte[0]. var ipAddress: Data { - get {return _ipAddress ?? Data()} - set {_ipAddress = newValue} + get {return _storage._ipAddress ?? Data()} + set {_uniqueStorage()._ipAddress = newValue} } /// Returns true if `ipAddress` has been explicitly set. - var hasIpAddress: Bool {return self._ipAddress != nil} + var hasIpAddress: Bool {return _storage._ipAddress != nil} /// Clears the value of `ipAddress`. Subsequent reads from it will return its default value. - mutating func clearIpAddress() {self._ipAddress = nil} + mutating func clearIpAddress() {_uniqueStorage()._ipAddress = nil} /// True if local device supports 6GHz. var supports6Ghz: Bool { - get {return _supports6Ghz ?? false} - set {_supports6Ghz = newValue} + get {return _storage._supports6Ghz ?? false} + set {_uniqueStorage()._supports6Ghz = newValue} } /// Returns true if `supports6Ghz` has been explicitly set. - var hasSupports6Ghz: Bool {return self._supports6Ghz != nil} + var hasSupports6Ghz: Bool {return _storage._supports6Ghz != nil} /// Clears the value of `supports6Ghz`. Subsequent reads from it will return its default value. - mutating func clearSupports6Ghz() {self._supports6Ghz = nil} + mutating func clearSupports6Ghz() {_uniqueStorage()._supports6Ghz = nil} /// True if local device has mobile radio. var mobileRadio: Bool { - get {return _mobileRadio ?? false} - set {_mobileRadio = newValue} + get {return _storage._mobileRadio ?? false} + set {_uniqueStorage()._mobileRadio = newValue} } /// Returns true if `mobileRadio` has been explicitly set. - var hasMobileRadio: Bool {return self._mobileRadio != nil} + var hasMobileRadio: Bool {return _storage._mobileRadio != nil} /// Clears the value of `mobileRadio`. Subsequent reads from it will return its default value. - mutating func clearMobileRadio() {self._mobileRadio = nil} + mutating func clearMobileRadio() {_uniqueStorage()._mobileRadio = nil} /// The frequency of the WiFi LAN AP(in MHz). Or -1 is not associated with an /// AP over WiFi, -2 represents the active network uses an Ethernet transport. var apFrequency: Int32 { - get {return _apFrequency ?? -1} - set {_apFrequency = newValue} + get {return _storage._apFrequency ?? -1} + set {_uniqueStorage()._apFrequency = newValue} } /// Returns true if `apFrequency` has been explicitly set. - var hasApFrequency: Bool {return self._apFrequency != nil} + var hasApFrequency: Bool {return _storage._apFrequency != nil} /// Clears the value of `apFrequency`. Subsequent reads from it will return its default value. - mutating func clearApFrequency() {self._apFrequency = nil} + mutating func clearApFrequency() {_uniqueStorage()._apFrequency = nil} /// Available channels on the local device. var availableChannels: Location_Nearby_Connections_AvailableChannels { - get {return _availableChannels ?? Location_Nearby_Connections_AvailableChannels()} - set {_availableChannels = newValue} + get {return _storage._availableChannels ?? Location_Nearby_Connections_AvailableChannels()} + set {_uniqueStorage()._availableChannels = newValue} } /// Returns true if `availableChannels` has been explicitly set. - var hasAvailableChannels: Bool {return self._availableChannels != nil} + var hasAvailableChannels: Bool {return _storage._availableChannels != nil} /// Clears the value of `availableChannels`. Subsequent reads from it will return its default value. - mutating func clearAvailableChannels() {self._availableChannels = nil} + mutating func clearAvailableChannels() {_uniqueStorage()._availableChannels = nil} /// Usable WiFi Direct client channels on the local device. var wifiDirectCliUsableChannels: Location_Nearby_Connections_WifiDirectCliUsableChannels { - get {return _wifiDirectCliUsableChannels ?? Location_Nearby_Connections_WifiDirectCliUsableChannels()} - set {_wifiDirectCliUsableChannels = newValue} + get {return _storage._wifiDirectCliUsableChannels ?? Location_Nearby_Connections_WifiDirectCliUsableChannels()} + set {_uniqueStorage()._wifiDirectCliUsableChannels = newValue} } /// Returns true if `wifiDirectCliUsableChannels` has been explicitly set. - var hasWifiDirectCliUsableChannels: Bool {return self._wifiDirectCliUsableChannels != nil} + var hasWifiDirectCliUsableChannels: Bool {return _storage._wifiDirectCliUsableChannels != nil} /// Clears the value of `wifiDirectCliUsableChannels`. Subsequent reads from it will return its default value. - mutating func clearWifiDirectCliUsableChannels() {self._wifiDirectCliUsableChannels = nil} + mutating func clearWifiDirectCliUsableChannels() {_uniqueStorage()._wifiDirectCliUsableChannels = nil} /// Usable WiFi LAN channels on the local device. var wifiLanUsableChannels: Location_Nearby_Connections_WifiLanUsableChannels { - get {return _wifiLanUsableChannels ?? Location_Nearby_Connections_WifiLanUsableChannels()} - set {_wifiLanUsableChannels = newValue} + get {return _storage._wifiLanUsableChannels ?? Location_Nearby_Connections_WifiLanUsableChannels()} + set {_uniqueStorage()._wifiLanUsableChannels = newValue} } /// Returns true if `wifiLanUsableChannels` has been explicitly set. - var hasWifiLanUsableChannels: Bool {return self._wifiLanUsableChannels != nil} + var hasWifiLanUsableChannels: Bool {return _storage._wifiLanUsableChannels != nil} /// Clears the value of `wifiLanUsableChannels`. Subsequent reads from it will return its default value. - mutating func clearWifiLanUsableChannels() {self._wifiLanUsableChannels = nil} + mutating func clearWifiLanUsableChannels() {_uniqueStorage()._wifiLanUsableChannels = nil} /// Usable WiFi Aware channels on the local device. var wifiAwareUsableChannels: Location_Nearby_Connections_WifiAwareUsableChannels { - get {return _wifiAwareUsableChannels ?? Location_Nearby_Connections_WifiAwareUsableChannels()} - set {_wifiAwareUsableChannels = newValue} + get {return _storage._wifiAwareUsableChannels ?? Location_Nearby_Connections_WifiAwareUsableChannels()} + set {_uniqueStorage()._wifiAwareUsableChannels = newValue} } /// Returns true if `wifiAwareUsableChannels` has been explicitly set. - var hasWifiAwareUsableChannels: Bool {return self._wifiAwareUsableChannels != nil} + var hasWifiAwareUsableChannels: Bool {return _storage._wifiAwareUsableChannels != nil} /// Clears the value of `wifiAwareUsableChannels`. Subsequent reads from it will return its default value. - mutating func clearWifiAwareUsableChannels() {self._wifiAwareUsableChannels = nil} + mutating func clearWifiAwareUsableChannels() {_uniqueStorage()._wifiAwareUsableChannels = nil} /// Usable WiFi Hotspot STA channels on the local device. var wifiHotspotStaUsableChannels: Location_Nearby_Connections_WifiHotspotStaUsableChannels { - get {return _wifiHotspotStaUsableChannels ?? Location_Nearby_Connections_WifiHotspotStaUsableChannels()} - set {_wifiHotspotStaUsableChannels = newValue} + get {return _storage._wifiHotspotStaUsableChannels ?? Location_Nearby_Connections_WifiHotspotStaUsableChannels()} + set {_uniqueStorage()._wifiHotspotStaUsableChannels = newValue} } /// Returns true if `wifiHotspotStaUsableChannels` has been explicitly set. - var hasWifiHotspotStaUsableChannels: Bool {return self._wifiHotspotStaUsableChannels != nil} + var hasWifiHotspotStaUsableChannels: Bool {return _storage._wifiHotspotStaUsableChannels != nil} /// Clears the value of `wifiHotspotStaUsableChannels`. Subsequent reads from it will return its default value. - mutating func clearWifiHotspotStaUsableChannels() {self._wifiHotspotStaUsableChannels = nil} + mutating func clearWifiHotspotStaUsableChannels() {_uniqueStorage()._wifiHotspotStaUsableChannels = nil} + + /// The supported medium roles. + var mediumRole: Location_Nearby_Connections_MediumRole { + get {return _storage._mediumRole ?? Location_Nearby_Connections_MediumRole()} + set {_uniqueStorage()._mediumRole = newValue} + } + /// Returns true if `mediumRole` has been explicitly set. + var hasMediumRole: Bool {return _storage._mediumRole != nil} + /// Clears the value of `mediumRole`. Subsequent reads from it will return its default value. + mutating func clearMediumRole() {_uniqueStorage()._mediumRole = nil} var unknownFields = SwiftProtobuf.UnknownStorage() init() {} - fileprivate var _supports5Ghz: Bool? = nil - fileprivate var _bssid: String? = nil - fileprivate var _ipAddress: Data? = nil - fileprivate var _supports6Ghz: Bool? = nil - fileprivate var _mobileRadio: Bool? = nil - fileprivate var _apFrequency: Int32? = nil - fileprivate var _availableChannels: Location_Nearby_Connections_AvailableChannels? = nil - fileprivate var _wifiDirectCliUsableChannels: Location_Nearby_Connections_WifiDirectCliUsableChannels? = nil - fileprivate var _wifiLanUsableChannels: Location_Nearby_Connections_WifiLanUsableChannels? = nil - fileprivate var _wifiAwareUsableChannels: Location_Nearby_Connections_WifiAwareUsableChannels? = nil - fileprivate var _wifiHotspotStaUsableChannels: Location_Nearby_Connections_WifiHotspotStaUsableChannels? = nil + fileprivate var _storage = _StorageClass.defaultInstance } /// Available channels on the local device. @@ -1723,6 +2453,98 @@ struct Location_Nearby_Connections_WifiHotspotStaUsableChannels { init() {} } +/// The medium roles. +struct Location_Nearby_Connections_MediumRole { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var supportWifiDirectGroupOwner: Bool { + get {return _supportWifiDirectGroupOwner ?? false} + set {_supportWifiDirectGroupOwner = newValue} + } + /// Returns true if `supportWifiDirectGroupOwner` has been explicitly set. + var hasSupportWifiDirectGroupOwner: Bool {return self._supportWifiDirectGroupOwner != nil} + /// Clears the value of `supportWifiDirectGroupOwner`. Subsequent reads from it will return its default value. + mutating func clearSupportWifiDirectGroupOwner() {self._supportWifiDirectGroupOwner = nil} + + var supportWifiDirectGroupClient: Bool { + get {return _supportWifiDirectGroupClient ?? false} + set {_supportWifiDirectGroupClient = newValue} + } + /// Returns true if `supportWifiDirectGroupClient` has been explicitly set. + var hasSupportWifiDirectGroupClient: Bool {return self._supportWifiDirectGroupClient != nil} + /// Clears the value of `supportWifiDirectGroupClient`. Subsequent reads from it will return its default value. + mutating func clearSupportWifiDirectGroupClient() {self._supportWifiDirectGroupClient = nil} + + var supportWifiHotspotHost: Bool { + get {return _supportWifiHotspotHost ?? false} + set {_supportWifiHotspotHost = newValue} + } + /// Returns true if `supportWifiHotspotHost` has been explicitly set. + var hasSupportWifiHotspotHost: Bool {return self._supportWifiHotspotHost != nil} + /// Clears the value of `supportWifiHotspotHost`. Subsequent reads from it will return its default value. + mutating func clearSupportWifiHotspotHost() {self._supportWifiHotspotHost = nil} + + var supportWifiHotspotClient: Bool { + get {return _supportWifiHotspotClient ?? false} + set {_supportWifiHotspotClient = newValue} + } + /// Returns true if `supportWifiHotspotClient` has been explicitly set. + var hasSupportWifiHotspotClient: Bool {return self._supportWifiHotspotClient != nil} + /// Clears the value of `supportWifiHotspotClient`. Subsequent reads from it will return its default value. + mutating func clearSupportWifiHotspotClient() {self._supportWifiHotspotClient = nil} + + var supportWifiAwarePublisher: Bool { + get {return _supportWifiAwarePublisher ?? false} + set {_supportWifiAwarePublisher = newValue} + } + /// Returns true if `supportWifiAwarePublisher` has been explicitly set. + var hasSupportWifiAwarePublisher: Bool {return self._supportWifiAwarePublisher != nil} + /// Clears the value of `supportWifiAwarePublisher`. Subsequent reads from it will return its default value. + mutating func clearSupportWifiAwarePublisher() {self._supportWifiAwarePublisher = nil} + + var supportWifiAwareSubscriber: Bool { + get {return _supportWifiAwareSubscriber ?? false} + set {_supportWifiAwareSubscriber = newValue} + } + /// Returns true if `supportWifiAwareSubscriber` has been explicitly set. + var hasSupportWifiAwareSubscriber: Bool {return self._supportWifiAwareSubscriber != nil} + /// Clears the value of `supportWifiAwareSubscriber`. Subsequent reads from it will return its default value. + mutating func clearSupportWifiAwareSubscriber() {self._supportWifiAwareSubscriber = nil} + + var supportAwdlPublisher: Bool { + get {return _supportAwdlPublisher ?? false} + set {_supportAwdlPublisher = newValue} + } + /// Returns true if `supportAwdlPublisher` has been explicitly set. + var hasSupportAwdlPublisher: Bool {return self._supportAwdlPublisher != nil} + /// Clears the value of `supportAwdlPublisher`. Subsequent reads from it will return its default value. + mutating func clearSupportAwdlPublisher() {self._supportAwdlPublisher = nil} + + var supportAwdlSubscriber: Bool { + get {return _supportAwdlSubscriber ?? false} + set {_supportAwdlSubscriber = newValue} + } + /// Returns true if `supportAwdlSubscriber` has been explicitly set. + var hasSupportAwdlSubscriber: Bool {return self._supportAwdlSubscriber != nil} + /// Clears the value of `supportAwdlSubscriber`. Subsequent reads from it will return its default value. + mutating func clearSupportAwdlSubscriber() {self._supportAwdlSubscriber = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _supportWifiDirectGroupOwner: Bool? = nil + fileprivate var _supportWifiDirectGroupClient: Bool? = nil + fileprivate var _supportWifiHotspotHost: Bool? = nil + fileprivate var _supportWifiHotspotClient: Bool? = nil + fileprivate var _supportWifiAwarePublisher: Bool? = nil + fileprivate var _supportWifiAwareSubscriber: Bool? = nil + fileprivate var _supportAwdlPublisher: Bool? = nil + fileprivate var _supportAwdlSubscriber: Bool? = nil +} + /// LocationHint is used to specify a location as well as format. struct Location_Nearby_Connections_LocationHint { // SwiftProtobuf.Message conformance is added in an extension below. See the @@ -1881,13 +2703,205 @@ extension Location_Nearby_Connections_OsInfo.OsType: CaseIterable { #endif // swift(>=4.2) +struct Location_Nearby_Connections_ConnectionsDevice { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var endpointID: String { + get {return _endpointID ?? String()} + set {_endpointID = newValue} + } + /// Returns true if `endpointID` has been explicitly set. + var hasEndpointID: Bool {return self._endpointID != nil} + /// Clears the value of `endpointID`. Subsequent reads from it will return its default value. + mutating func clearEndpointID() {self._endpointID = nil} + + var endpointType: Location_Nearby_Connections_EndpointType { + get {return _endpointType ?? .unknownEndpoint} + set {_endpointType = newValue} + } + /// Returns true if `endpointType` has been explicitly set. + var hasEndpointType: Bool {return self._endpointType != nil} + /// Clears the value of `endpointType`. Subsequent reads from it will return its default value. + mutating func clearEndpointType() {self._endpointType = nil} + + /// Data Elements. + var connectivityInfoList: Data { + get {return _connectivityInfoList ?? Data()} + set {_connectivityInfoList = newValue} + } + /// Returns true if `connectivityInfoList` has been explicitly set. + var hasConnectivityInfoList: Bool {return self._connectivityInfoList != nil} + /// Clears the value of `connectivityInfoList`. Subsequent reads from it will return its default value. + mutating func clearConnectivityInfoList() {self._connectivityInfoList = nil} + + var endpointInfo: Data { + get {return _endpointInfo ?? Data()} + set {_endpointInfo = newValue} + } + /// Returns true if `endpointInfo` has been explicitly set. + var hasEndpointInfo: Bool {return self._endpointInfo != nil} + /// Clears the value of `endpointInfo`. Subsequent reads from it will return its default value. + mutating func clearEndpointInfo() {self._endpointInfo = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _endpointID: String? = nil + fileprivate var _endpointType: Location_Nearby_Connections_EndpointType? = nil + fileprivate var _connectivityInfoList: Data? = nil + fileprivate var _endpointInfo: Data? = nil +} + +struct Location_Nearby_Connections_PresenceDevice { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var endpointID: String { + get {return _endpointID ?? String()} + set {_endpointID = newValue} + } + /// Returns true if `endpointID` has been explicitly set. + var hasEndpointID: Bool {return self._endpointID != nil} + /// Clears the value of `endpointID`. Subsequent reads from it will return its default value. + mutating func clearEndpointID() {self._endpointID = nil} + + var endpointType: Location_Nearby_Connections_EndpointType { + get {return _endpointType ?? .unknownEndpoint} + set {_endpointType = newValue} + } + /// Returns true if `endpointType` has been explicitly set. + var hasEndpointType: Bool {return self._endpointType != nil} + /// Clears the value of `endpointType`. Subsequent reads from it will return its default value. + mutating func clearEndpointType() {self._endpointType = nil} + + /// Data Elements. + var connectivityInfoList: Data { + get {return _connectivityInfoList ?? Data()} + set {_connectivityInfoList = newValue} + } + /// Returns true if `connectivityInfoList` has been explicitly set. + var hasConnectivityInfoList: Bool {return self._connectivityInfoList != nil} + /// Clears the value of `connectivityInfoList`. Subsequent reads from it will return its default value. + mutating func clearConnectivityInfoList() {self._connectivityInfoList = nil} + + var deviceID: Int64 { + get {return _deviceID ?? 0} + set {_deviceID = newValue} + } + /// Returns true if `deviceID` has been explicitly set. + var hasDeviceID: Bool {return self._deviceID != nil} + /// Clears the value of `deviceID`. Subsequent reads from it will return its default value. + mutating func clearDeviceID() {self._deviceID = nil} + + var deviceName: String { + get {return _deviceName ?? String()} + set {_deviceName = newValue} + } + /// Returns true if `deviceName` has been explicitly set. + var hasDeviceName: Bool {return self._deviceName != nil} + /// Clears the value of `deviceName`. Subsequent reads from it will return its default value. + mutating func clearDeviceName() {self._deviceName = nil} + + var deviceType: Location_Nearby_Connections_PresenceDevice.DeviceType { + get {return _deviceType ?? .unknown} + set {_deviceType = newValue} + } + /// Returns true if `deviceType` has been explicitly set. + var hasDeviceType: Bool {return self._deviceType != nil} + /// Clears the value of `deviceType`. Subsequent reads from it will return its default value. + mutating func clearDeviceType() {self._deviceType = nil} + + var deviceImageURL: String { + get {return _deviceImageURL ?? String()} + set {_deviceImageURL = newValue} + } + /// Returns true if `deviceImageURL` has been explicitly set. + var hasDeviceImageURL: Bool {return self._deviceImageURL != nil} + /// Clears the value of `deviceImageURL`. Subsequent reads from it will return its default value. + mutating func clearDeviceImageURL() {self._deviceImageURL = nil} + + var discoveryMedium: [Location_Nearby_Connections_ConnectionRequestFrame.Medium] = [] + + var actions: [Int32] = [] + + var identityType: [Int64] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + enum DeviceType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case phone // = 1 + case tablet // = 2 + case display // = 3 + case laptop // = 4 + case tv // = 5 + case watch // = 6 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .phone + case 2: self = .tablet + case 3: self = .display + case 4: self = .laptop + case 5: self = .tv + case 6: self = .watch + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .phone: return 1 + case .tablet: return 2 + case .display: return 3 + case .laptop: return 4 + case .tv: return 5 + case .watch: return 6 + } + } + + } + + init() {} + + fileprivate var _endpointID: String? = nil + fileprivate var _endpointType: Location_Nearby_Connections_EndpointType? = nil + fileprivate var _connectivityInfoList: Data? = nil + fileprivate var _deviceID: Int64? = nil + fileprivate var _deviceName: String? = nil + fileprivate var _deviceType: Location_Nearby_Connections_PresenceDevice.DeviceType? = nil + fileprivate var _deviceImageURL: String? = nil +} + +#if swift(>=4.2) + +extension Location_Nearby_Connections_PresenceDevice.DeviceType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + #if swift(>=5.5) && canImport(_Concurrency) +extension Location_Nearby_Connections_EndpointType: @unchecked Sendable {} extension Location_Nearby_Connections_OfflineFrame: @unchecked Sendable {} extension Location_Nearby_Connections_OfflineFrame.Version: @unchecked Sendable {} extension Location_Nearby_Connections_V1Frame: @unchecked Sendable {} extension Location_Nearby_Connections_V1Frame.FrameType: @unchecked Sendable {} extension Location_Nearby_Connections_ConnectionRequestFrame: @unchecked Sendable {} +extension Location_Nearby_Connections_ConnectionRequestFrame.OneOf_Device: @unchecked Sendable {} extension Location_Nearby_Connections_ConnectionRequestFrame.Medium: @unchecked Sendable {} +extension Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode: @unchecked Sendable {} extension Location_Nearby_Connections_ConnectionResponseFrame: @unchecked Sendable {} extension Location_Nearby_Connections_ConnectionResponseFrame.ResponseStatus: @unchecked Sendable {} extension Location_Nearby_Connections_PayloadTransferFrame: @unchecked Sendable {} @@ -1908,28 +2922,51 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiAwareCredentials: @unchecked Sendable {} extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiDirectCredentials: @unchecked Sendable {} extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WebRtcCredentials: @unchecked Sendable {} +extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials: @unchecked Sendable {} +extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest: @unchecked Sendable {} +extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel: @unchecked Sendable {} extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction: @unchecked Sendable {} extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroductionAck: @unchecked Sendable {} +extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame: @unchecked Sendable {} +extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame.Medium: @unchecked Sendable {} extension Location_Nearby_Connections_KeepAliveFrame: @unchecked Sendable {} extension Location_Nearby_Connections_DisconnectionFrame: @unchecked Sendable {} extension Location_Nearby_Connections_PairedKeyEncryptionFrame: @unchecked Sendable {} +extension Location_Nearby_Connections_AuthenticationMessageFrame: @unchecked Sendable {} +extension Location_Nearby_Connections_AuthenticationResultFrame: @unchecked Sendable {} +extension Location_Nearby_Connections_AutoResumeFrame: @unchecked Sendable {} +extension Location_Nearby_Connections_AutoResumeFrame.EventType: @unchecked Sendable {} +extension Location_Nearby_Connections_AutoReconnectFrame: @unchecked Sendable {} +extension Location_Nearby_Connections_AutoReconnectFrame.EventType: @unchecked Sendable {} extension Location_Nearby_Connections_MediumMetadata: @unchecked Sendable {} extension Location_Nearby_Connections_AvailableChannels: @unchecked Sendable {} extension Location_Nearby_Connections_WifiDirectCliUsableChannels: @unchecked Sendable {} extension Location_Nearby_Connections_WifiLanUsableChannels: @unchecked Sendable {} extension Location_Nearby_Connections_WifiAwareUsableChannels: @unchecked Sendable {} extension Location_Nearby_Connections_WifiHotspotStaUsableChannels: @unchecked Sendable {} +extension Location_Nearby_Connections_MediumRole: @unchecked Sendable {} extension Location_Nearby_Connections_LocationHint: @unchecked Sendable {} extension Location_Nearby_Connections_LocationStandard: @unchecked Sendable {} extension Location_Nearby_Connections_LocationStandard.Format: @unchecked Sendable {} extension Location_Nearby_Connections_OsInfo: @unchecked Sendable {} extension Location_Nearby_Connections_OsInfo.OsType: @unchecked Sendable {} +extension Location_Nearby_Connections_ConnectionsDevice: @unchecked Sendable {} +extension Location_Nearby_Connections_PresenceDevice: @unchecked Sendable {} +extension Location_Nearby_Connections_PresenceDevice.DeviceType: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) // MARK: - Code below here is support for the SwiftProtobuf runtime. fileprivate let _protobuf_package = "location.nearby.connections" +extension Location_Nearby_Connections_EndpointType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_ENDPOINT"), + 1: .same(proto: "CONNECTIONS_ENDPOINT"), + 2: .same(proto: "PRESENCE_ENDPOINT"), + ] +} + extension Location_Nearby_Connections_OfflineFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".OfflineFrame" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -1990,6 +3027,11 @@ extension Location_Nearby_Connections_V1Frame: SwiftProtobuf.Message, SwiftProto 6: .standard(proto: "keep_alive"), 7: .same(proto: "disconnection"), 8: .standard(proto: "paired_key_encryption"), + 9: .standard(proto: "authentication_message"), + 10: .standard(proto: "authentication_result"), + 11: .standard(proto: "auto_resume"), + 12: .standard(proto: "auto_reconnect"), + 13: .standard(proto: "bandwidth_upgrade_retry"), ] fileprivate class _StorageClass { @@ -2001,6 +3043,11 @@ extension Location_Nearby_Connections_V1Frame: SwiftProtobuf.Message, SwiftProto var _keepAlive: Location_Nearby_Connections_KeepAliveFrame? = nil var _disconnection: Location_Nearby_Connections_DisconnectionFrame? = nil var _pairedKeyEncryption: Location_Nearby_Connections_PairedKeyEncryptionFrame? = nil + var _authenticationMessage: Location_Nearby_Connections_AuthenticationMessageFrame? = nil + var _authenticationResult: Location_Nearby_Connections_AuthenticationResultFrame? = nil + var _autoResume: Location_Nearby_Connections_AutoResumeFrame? = nil + var _autoReconnect: Location_Nearby_Connections_AutoReconnectFrame? = nil + var _bandwidthUpgradeRetry: Location_Nearby_Connections_BandwidthUpgradeRetryFrame? = nil static let defaultInstance = _StorageClass() @@ -2015,6 +3062,11 @@ extension Location_Nearby_Connections_V1Frame: SwiftProtobuf.Message, SwiftProto _keepAlive = source._keepAlive _disconnection = source._disconnection _pairedKeyEncryption = source._pairedKeyEncryption + _authenticationMessage = source._authenticationMessage + _authenticationResult = source._authenticationResult + _autoResume = source._autoResume + _autoReconnect = source._autoReconnect + _bandwidthUpgradeRetry = source._bandwidthUpgradeRetry } } @@ -2041,6 +3093,11 @@ extension Location_Nearby_Connections_V1Frame: SwiftProtobuf.Message, SwiftProto case 6: try { try decoder.decodeSingularMessageField(value: &_storage._keepAlive) }() case 7: try { try decoder.decodeSingularMessageField(value: &_storage._disconnection) }() case 8: try { try decoder.decodeSingularMessageField(value: &_storage._pairedKeyEncryption) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._authenticationMessage) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._authenticationResult) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._autoResume) }() + case 12: try { try decoder.decodeSingularMessageField(value: &_storage._autoReconnect) }() + case 13: try { try decoder.decodeSingularMessageField(value: &_storage._bandwidthUpgradeRetry) }() default: break } } @@ -2077,6 +3134,21 @@ extension Location_Nearby_Connections_V1Frame: SwiftProtobuf.Message, SwiftProto try { if let v = _storage._pairedKeyEncryption { try visitor.visitSingularMessageField(value: v, fieldNumber: 8) } }() + try { if let v = _storage._authenticationMessage { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._authenticationResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._autoResume { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._autoReconnect { + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + } }() + try { if let v = _storage._bandwidthUpgradeRetry { + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + } }() } try unknownFields.traverse(visitor: &visitor) } @@ -2094,6 +3166,11 @@ extension Location_Nearby_Connections_V1Frame: SwiftProtobuf.Message, SwiftProto if _storage._keepAlive != rhs_storage._keepAlive {return false} if _storage._disconnection != rhs_storage._disconnection {return false} if _storage._pairedKeyEncryption != rhs_storage._pairedKeyEncryption {return false} + if _storage._authenticationMessage != rhs_storage._authenticationMessage {return false} + if _storage._authenticationResult != rhs_storage._authenticationResult {return false} + if _storage._autoResume != rhs_storage._autoResume {return false} + if _storage._autoReconnect != rhs_storage._autoReconnect {return false} + if _storage._bandwidthUpgradeRetry != rhs_storage._bandwidthUpgradeRetry {return false} return true } if !storagesAreEqual {return false} @@ -2113,6 +3190,11 @@ extension Location_Nearby_Connections_V1Frame.FrameType: SwiftProtobuf._ProtoNam 5: .same(proto: "KEEP_ALIVE"), 6: .same(proto: "DISCONNECTION"), 7: .same(proto: "PAIRED_KEY_ENCRYPTION"), + 8: .same(proto: "AUTHENTICATION_MESSAGE"), + 9: .same(proto: "AUTHENTICATION_RESULT"), + 10: .same(proto: "AUTO_RESUME"), + 11: .same(proto: "AUTO_RECONNECT"), + 12: .same(proto: "BANDWIDTH_UPGRADE_RETRY"), ] } @@ -2130,6 +3212,10 @@ extension Location_Nearby_Connections_ConnectionRequestFrame: SwiftProtobuf.Mess 9: .standard(proto: "keep_alive_timeout_millis"), 10: .standard(proto: "device_type"), 11: .standard(proto: "device_info"), + 12: .standard(proto: "connections_device"), + 13: .standard(proto: "presence_device"), + 14: .standard(proto: "connection_mode"), + 15: .standard(proto: "location_hint"), ] fileprivate class _StorageClass { @@ -2144,6 +3230,9 @@ extension Location_Nearby_Connections_ConnectionRequestFrame: SwiftProtobuf.Mess var _keepAliveTimeoutMillis: Int32? = nil var _deviceType: Int32? = nil var _deviceInfo: Data? = nil + var _device: Location_Nearby_Connections_ConnectionRequestFrame.OneOf_Device? + var _connectionMode: Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode? = nil + var _locationHint: Location_Nearby_Connections_LocationHint? = nil static let defaultInstance = _StorageClass() @@ -2161,6 +3250,9 @@ extension Location_Nearby_Connections_ConnectionRequestFrame: SwiftProtobuf.Mess _keepAliveTimeoutMillis = source._keepAliveTimeoutMillis _deviceType = source._deviceType _deviceInfo = source._deviceInfo + _device = source._device + _connectionMode = source._connectionMode + _locationHint = source._locationHint } } @@ -2190,6 +3282,34 @@ extension Location_Nearby_Connections_ConnectionRequestFrame: SwiftProtobuf.Mess case 9: try { try decoder.decodeSingularInt32Field(value: &_storage._keepAliveTimeoutMillis) }() case 10: try { try decoder.decodeSingularInt32Field(value: &_storage._deviceType) }() case 11: try { try decoder.decodeSingularBytesField(value: &_storage._deviceInfo) }() + case 12: try { + var v: Location_Nearby_Connections_ConnectionsDevice? + var hadOneofValue = false + if let current = _storage._device { + hadOneofValue = true + if case .connectionsDevice(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._device = .connectionsDevice(v) + } + }() + case 13: try { + var v: Location_Nearby_Connections_PresenceDevice? + var hadOneofValue = false + if let current = _storage._device { + hadOneofValue = true + if case .presenceDevice(let m) = current {v = m} + } + try decoder.decodeSingularMessageField(value: &v) + if let v = v { + if hadOneofValue {try decoder.handleConflictingOneOf()} + _storage._device = .presenceDevice(v) + } + }() + case 14: try { try decoder.decodeSingularEnumField(value: &_storage._connectionMode) }() + case 15: try { try decoder.decodeSingularMessageField(value: &_storage._locationHint) }() default: break } } @@ -2235,6 +3355,23 @@ extension Location_Nearby_Connections_ConnectionRequestFrame: SwiftProtobuf.Mess try { if let v = _storage._deviceInfo { try visitor.visitSingularBytesField(value: v, fieldNumber: 11) } }() + switch _storage._device { + case .connectionsDevice?: try { + guard case .connectionsDevice(let v)? = _storage._device else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + }() + case .presenceDevice?: try { + guard case .presenceDevice(let v)? = _storage._device else { preconditionFailure() } + try visitor.visitSingularMessageField(value: v, fieldNumber: 13) + }() + case nil: break + } + try { if let v = _storage._connectionMode { + try visitor.visitSingularEnumField(value: v, fieldNumber: 14) + } }() + try { if let v = _storage._locationHint { + try visitor.visitSingularMessageField(value: v, fieldNumber: 15) + } }() } try unknownFields.traverse(visitor: &visitor) } @@ -2255,6 +3392,9 @@ extension Location_Nearby_Connections_ConnectionRequestFrame: SwiftProtobuf.Mess if _storage._keepAliveTimeoutMillis != rhs_storage._keepAliveTimeoutMillis {return false} if _storage._deviceType != rhs_storage._deviceType {return false} if _storage._deviceInfo != rhs_storage._deviceInfo {return false} + if _storage._device != rhs_storage._device {return false} + if _storage._connectionMode != rhs_storage._connectionMode {return false} + if _storage._locationHint != rhs_storage._locationHint {return false} return true } if !storagesAreEqual {return false} @@ -2278,6 +3418,15 @@ extension Location_Nearby_Connections_ConnectionRequestFrame.Medium: SwiftProtob 9: .same(proto: "WEB_RTC"), 10: .same(proto: "BLE_L2CAP"), 11: .same(proto: "USB"), + 12: .same(proto: "WEB_RTC_NON_CELLULAR"), + 13: .same(proto: "AWDL"), + ] +} + +extension Location_Nearby_Connections_ConnectionRequestFrame.ConnectionMode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "LEGACY"), + 1: .same(proto: "INSTANT"), ] } @@ -2290,6 +3439,9 @@ extension Location_Nearby_Connections_ConnectionResponseFrame: SwiftProtobuf.Mes 4: .standard(proto: "os_info"), 5: .standard(proto: "multiplex_socket_bitmask"), 6: .standard(proto: "nearby_connections_version"), + 7: .standard(proto: "safe_to_disconnect_version"), + 8: .standard(proto: "location_hint"), + 9: .standard(proto: "keep_alive_timeout_millis"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -2304,6 +3456,9 @@ extension Location_Nearby_Connections_ConnectionResponseFrame: SwiftProtobuf.Mes case 4: try { try decoder.decodeSingularMessageField(value: &self._osInfo) }() case 5: try { try decoder.decodeSingularInt32Field(value: &self._multiplexSocketBitmask) }() case 6: try { try decoder.decodeSingularInt32Field(value: &self._nearbyConnectionsVersion) }() + case 7: try { try decoder.decodeSingularInt32Field(value: &self._safeToDisconnectVersion) }() + case 8: try { try decoder.decodeSingularMessageField(value: &self._locationHint) }() + case 9: try { try decoder.decodeSingularInt32Field(value: &self._keepAliveTimeoutMillis) }() default: break } } @@ -2332,6 +3487,15 @@ extension Location_Nearby_Connections_ConnectionResponseFrame: SwiftProtobuf.Mes try { if let v = self._nearbyConnectionsVersion { try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) } }() + try { if let v = self._safeToDisconnectVersion { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 7) + } }() + try { if let v = self._locationHint { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + try { if let v = self._keepAliveTimeoutMillis { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 9) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -2342,6 +3506,9 @@ extension Location_Nearby_Connections_ConnectionResponseFrame: SwiftProtobuf.Mes if lhs._osInfo != rhs._osInfo {return false} if lhs._multiplexSocketBitmask != rhs._multiplexSocketBitmask {return false} if lhs._nearbyConnectionsVersion != rhs._nearbyConnectionsVersion {return false} + if lhs._safeToDisconnectVersion != rhs._safeToDisconnectVersion {return false} + if lhs._locationHint != rhs._locationHint {return false} + if lhs._keepAliveTimeoutMillis != rhs._keepAliveTimeoutMillis {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2414,6 +3581,7 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PacketType: SwiftProt 0: .same(proto: "UNKNOWN_PACKET_TYPE"), 1: .same(proto: "DATA"), 2: .same(proto: "CONTROL"), + 3: .same(proto: "PAYLOAD_ACK"), ] } @@ -2426,6 +3594,7 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader: SwiftP 4: .standard(proto: "is_sensitive"), 5: .standard(proto: "file_name"), 6: .standard(proto: "parent_folder"), + 7: .standard(proto: "last_modified_timestamp_millis"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -2440,6 +3609,7 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader: SwiftP case 4: try { try decoder.decodeSingularBoolField(value: &self._isSensitive) }() case 5: try { try decoder.decodeSingularStringField(value: &self._fileName) }() case 6: try { try decoder.decodeSingularStringField(value: &self._parentFolder) }() + case 7: try { try decoder.decodeSingularInt64Field(value: &self._lastModifiedTimestampMillis) }() default: break } } @@ -2468,6 +3638,9 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader: SwiftP try { if let v = self._parentFolder { try visitor.visitSingularStringField(value: v, fieldNumber: 6) } }() + try { if let v = self._lastModifiedTimestampMillis { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 7) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -2478,6 +3651,7 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadHeader: SwiftP if lhs._isSensitive != rhs._isSensitive {return false} if lhs._fileName != rhs._fileName {return false} if lhs._parentFolder != rhs._parentFolder {return false} + if lhs._lastModifiedTimestampMillis != rhs._lastModifiedTimestampMillis {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2498,6 +3672,7 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk: SwiftPr 1: .same(proto: "flags"), 2: .same(proto: "offset"), 3: .same(proto: "body"), + 4: .same(proto: "index"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -2509,6 +3684,7 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk: SwiftPr case 1: try { try decoder.decodeSingularInt32Field(value: &self._flags) }() case 2: try { try decoder.decodeSingularInt64Field(value: &self._offset) }() case 3: try { try decoder.decodeSingularBytesField(value: &self._body) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self._index) }() default: break } } @@ -2528,6 +3704,9 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk: SwiftPr try { if let v = self._body { try visitor.visitSingularBytesField(value: v, fieldNumber: 3) } }() + try { if let v = self._index { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -2535,6 +3714,7 @@ extension Location_Nearby_Connections_PayloadTransferFrame.PayloadChunk: SwiftPr if lhs._flags != rhs._flags {return false} if lhs._offset != rhs._offset {return false} if lhs._body != rhs._body {return false} + if lhs._index != rhs._index {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2604,6 +3784,7 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: SwiftPro 2: .standard(proto: "upgrade_path_info"), 3: .standard(proto: "client_introduction"), 4: .standard(proto: "client_introduction_ack"), + 5: .standard(proto: "safe_to_close_prior_channel"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -2616,6 +3797,7 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: SwiftPro case 2: try { try decoder.decodeSingularMessageField(value: &self._upgradePathInfo) }() case 3: try { try decoder.decodeSingularMessageField(value: &self._clientIntroduction) }() case 4: try { try decoder.decodeSingularMessageField(value: &self._clientIntroductionAck) }() + case 5: try { try decoder.decodeSingularMessageField(value: &self._safeToClosePriorChannel) }() default: break } } @@ -2638,6 +3820,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: SwiftPro try { if let v = self._clientIntroductionAck { try visitor.visitSingularMessageField(value: v, fieldNumber: 4) } }() + try { if let v = self._safeToClosePriorChannel { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -2646,6 +3831,7 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame: SwiftPro if lhs._upgradePathInfo != rhs._upgradePathInfo {return false} if lhs._clientIntroduction != rhs._clientIntroduction {return false} if lhs._clientIntroductionAck != rhs._clientIntroductionAck {return false} + if lhs._safeToClosePriorChannel != rhs._safeToClosePriorChannel {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -2660,6 +3846,7 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.EventType 4: .same(proto: "CLIENT_INTRODUCTION"), 5: .same(proto: "UPGRADE_FAILURE"), 6: .same(proto: "CLIENT_INTRODUCTION_ACK"), + 7: .same(proto: "UPGRADE_PATH_REQUEST"), ] } @@ -2673,8 +3860,10 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa 5: .standard(proto: "wifi_aware_credentials"), 6: .standard(proto: "wifi_direct_credentials"), 8: .standard(proto: "web_rtc_credentials"), + 11: .standard(proto: "awdl_credentials"), 7: .standard(proto: "supports_disabling_encryption"), 9: .standard(proto: "supports_client_introduction_ack"), + 10: .standard(proto: "upgrade_path_request"), ] fileprivate class _StorageClass { @@ -2685,8 +3874,10 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa var _wifiAwareCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiAwareCredentials? = nil var _wifiDirectCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WifiDirectCredentials? = nil var _webRtcCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.WebRtcCredentials? = nil + var _awdlCredentials: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials? = nil var _supportsDisablingEncryption: Bool? = nil var _supportsClientIntroductionAck: Bool? = nil + var _upgradePathRequest: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest? = nil static let defaultInstance = _StorageClass() @@ -2700,8 +3891,10 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa _wifiAwareCredentials = source._wifiAwareCredentials _wifiDirectCredentials = source._wifiDirectCredentials _webRtcCredentials = source._webRtcCredentials + _awdlCredentials = source._awdlCredentials _supportsDisablingEncryption = source._supportsDisablingEncryption _supportsClientIntroductionAck = source._supportsClientIntroductionAck + _upgradePathRequest = source._upgradePathRequest } } @@ -2729,6 +3922,8 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa case 7: try { try decoder.decodeSingularBoolField(value: &_storage._supportsDisablingEncryption) }() case 8: try { try decoder.decodeSingularMessageField(value: &_storage._webRtcCredentials) }() case 9: try { try decoder.decodeSingularBoolField(value: &_storage._supportsClientIntroductionAck) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._upgradePathRequest) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._awdlCredentials) }() default: break } } @@ -2768,6 +3963,12 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa try { if let v = _storage._supportsClientIntroductionAck { try visitor.visitSingularBoolField(value: v, fieldNumber: 9) } }() + try { if let v = _storage._upgradePathRequest { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._awdlCredentials { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() } try unknownFields.traverse(visitor: &visitor) } @@ -2784,8 +3985,10 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa if _storage._wifiAwareCredentials != rhs_storage._wifiAwareCredentials {return false} if _storage._wifiDirectCredentials != rhs_storage._wifiDirectCredentials {return false} if _storage._webRtcCredentials != rhs_storage._webRtcCredentials {return false} + if _storage._awdlCredentials != rhs_storage._awdlCredentials {return false} if _storage._supportsDisablingEncryption != rhs_storage._supportsDisablingEncryption {return false} if _storage._supportsClientIntroductionAck != rhs_storage._supportsClientIntroductionAck {return false} + if _storage._upgradePathRequest != rhs_storage._upgradePathRequest {return false} return true } if !storagesAreEqual {return false} @@ -2808,6 +4011,8 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa 8: .same(proto: "WIFI_DIRECT"), 9: .same(proto: "WEB_RTC"), 11: .same(proto: "USB"), + 12: .same(proto: "WEB_RTC_NON_CELLULAR"), + 13: .same(proto: "AWDL"), ] } @@ -3011,6 +4216,7 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa 3: .same(proto: "port"), 4: .same(proto: "frequency"), 5: .same(proto: "gateway"), + 6: .standard(proto: "ip_v6_address"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -3024,6 +4230,7 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa case 3: try { try decoder.decodeSingularInt32Field(value: &self._port) }() case 4: try { try decoder.decodeSingularInt32Field(value: &self._frequency) }() case 5: try { try decoder.decodeSingularStringField(value: &self._gateway) }() + case 6: try { try decoder.decodeSingularBytesField(value: &self._ipV6Address) }() default: break } } @@ -3049,6 +4256,9 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa try { if let v = self._gateway { try visitor.visitSingularStringField(value: v, fieldNumber: 5) } }() + try { if let v = self._ipV6Address { + try visitor.visitSingularBytesField(value: v, fieldNumber: 6) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -3058,6 +4268,7 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa if lhs._port != rhs._port {return false} if lhs._frequency != rhs._frequency {return false} if lhs._gateway != rhs._gateway {return false} + if lhs._ipV6Address != rhs._ipV6Address {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3105,11 +4316,138 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePa } } +extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".AwdlCredentials" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "service_name"), + 2: .standard(proto: "service_type"), + 3: .same(proto: "password"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._serviceName) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._serviceType) }() + case 3: try { try decoder.decodeSingularStringField(value: &self._password) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._serviceName { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._serviceType { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._password { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials, rhs: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.AwdlCredentials) -> Bool { + if lhs._serviceName != rhs._serviceName {return false} + if lhs._serviceType != rhs._serviceType {return false} + if lhs._password != rhs._password {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.protoMessageName + ".UpgradePathRequest" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "mediums"), + 2: .standard(proto: "medium_meta_data"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedEnumField(value: &self.mediums) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._mediumMetaData) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.mediums.isEmpty { + try visitor.visitPackedEnumField(value: self.mediums, fieldNumber: 1) + } + try { if let v = self._mediumMetaData { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest, rhs: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.UpgradePathInfo.UpgradePathRequest) -> Bool { + if lhs.mediums != rhs.mediums {return false} + if lhs._mediumMetaData != rhs._mediumMetaData {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.protoMessageName + ".SafeToClosePriorChannel" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "sta_frequency"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._staFrequency) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._staFrequency { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel, rhs: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.SafeToClosePriorChannel) -> Bool { + if lhs._staFrequency != rhs._staFrequency {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.protoMessageName + ".ClientIntroduction" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "endpoint_id"), 2: .standard(proto: "supports_disabling_encryption"), + 3: .standard(proto: "last_endpoint_id"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -3120,6 +4458,7 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientInt switch fieldNumber { case 1: try { try decoder.decodeSingularStringField(value: &self._endpointID) }() case 2: try { try decoder.decodeSingularBoolField(value: &self._supportsDisablingEncryption) }() + case 3: try { try decoder.decodeSingularStringField(value: &self._lastEndpointID) }() default: break } } @@ -3136,12 +4475,16 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientInt try { if let v = self._supportsDisablingEncryption { try visitor.visitSingularBoolField(value: v, fieldNumber: 2) } }() + try { if let v = self._lastEndpointID { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction, rhs: Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientIntroduction) -> Bool { if lhs._endpointID != rhs._endpointID {return false} if lhs._supportsDisablingEncryption != rhs._supportsDisablingEncryption {return false} + if lhs._lastEndpointID != rhs._lastEndpointID {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3166,10 +4509,71 @@ extension Location_Nearby_Connections_BandwidthUpgradeNegotiationFrame.ClientInt } } +extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".BandwidthUpgradeRetryFrame" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "supported_medium"), + 2: .standard(proto: "is_request"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedEnumField(value: &self.supportedMedium) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self._isRequest) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + if !self.supportedMedium.isEmpty { + try visitor.visitRepeatedEnumField(value: self.supportedMedium, fieldNumber: 1) + } + try { if let v = self._isRequest { + try visitor.visitSingularBoolField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_BandwidthUpgradeRetryFrame, rhs: Location_Nearby_Connections_BandwidthUpgradeRetryFrame) -> Bool { + if lhs.supportedMedium != rhs.supportedMedium {return false} + if lhs._isRequest != rhs._isRequest {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_BandwidthUpgradeRetryFrame.Medium: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_MEDIUM"), + 2: .same(proto: "BLUETOOTH"), + 3: .same(proto: "WIFI_HOTSPOT"), + 4: .same(proto: "BLE"), + 5: .same(proto: "WIFI_LAN"), + 6: .same(proto: "WIFI_AWARE"), + 7: .same(proto: "NFC"), + 8: .same(proto: "WIFI_DIRECT"), + 9: .same(proto: "WEB_RTC"), + 10: .same(proto: "BLE_L2CAP"), + 11: .same(proto: "USB"), + 12: .same(proto: "WEB_RTC_NON_CELLULAR"), + 13: .same(proto: "AWDL"), + ] +} + extension Location_Nearby_Connections_KeepAliveFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".KeepAliveFrame" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "ack"), + 2: .standard(proto: "seq_num"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -3179,6 +4583,7 @@ extension Location_Nearby_Connections_KeepAliveFrame: SwiftProtobuf.Message, Swi // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularBoolField(value: &self._ack) }() + case 2: try { try decoder.decodeSingularUInt32Field(value: &self._seqNum) }() default: break } } @@ -3192,11 +4597,15 @@ extension Location_Nearby_Connections_KeepAliveFrame: SwiftProtobuf.Message, Swi try { if let v = self._ack { try visitor.visitSingularBoolField(value: v, fieldNumber: 1) } }() + try { if let v = self._seqNum { + try visitor.visitSingularUInt32Field(value: v, fieldNumber: 2) + } }() try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Location_Nearby_Connections_KeepAliveFrame, rhs: Location_Nearby_Connections_KeepAliveFrame) -> Bool { if lhs._ack != rhs._ack {return false} + if lhs._seqNum != rhs._seqNum {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3280,6 +4689,196 @@ extension Location_Nearby_Connections_PairedKeyEncryptionFrame: SwiftProtobuf.Me } } +extension Location_Nearby_Connections_AuthenticationMessageFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AuthenticationMessageFrame" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "auth_message"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self._authMessage) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._authMessage { + try visitor.visitSingularBytesField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_AuthenticationMessageFrame, rhs: Location_Nearby_Connections_AuthenticationMessageFrame) -> Bool { + if lhs._authMessage != rhs._authMessage {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_AuthenticationResultFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AuthenticationResultFrame" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "result"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt32Field(value: &self._result) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._result { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_AuthenticationResultFrame, rhs: Location_Nearby_Connections_AuthenticationResultFrame) -> Bool { + if lhs._result != rhs._result {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_AutoResumeFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AutoResumeFrame" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "event_type"), + 2: .standard(proto: "pending_payload_id"), + 3: .standard(proto: "next_payload_chunk_index"), + 4: .same(proto: "version"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self._eventType) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self._pendingPayloadID) }() + case 3: try { try decoder.decodeSingularInt32Field(value: &self._nextPayloadChunkIndex) }() + case 4: try { try decoder.decodeSingularInt32Field(value: &self._version) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._eventType { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + try { if let v = self._pendingPayloadID { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._nextPayloadChunkIndex { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._version { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_AutoResumeFrame, rhs: Location_Nearby_Connections_AutoResumeFrame) -> Bool { + if lhs._eventType != rhs._eventType {return false} + if lhs._pendingPayloadID != rhs._pendingPayloadID {return false} + if lhs._nextPayloadChunkIndex != rhs._nextPayloadChunkIndex {return false} + if lhs._version != rhs._version {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_AutoResumeFrame.EventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_AUTO_RESUME_EVENT_TYPE"), + 1: .same(proto: "PAYLOAD_RESUME_TRANSFER_START"), + 2: .same(proto: "PAYLOAD_RESUME_TRANSFER_ACK"), + ] +} + +extension Location_Nearby_Connections_AutoReconnectFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AutoReconnectFrame" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "endpoint_id"), + 2: .standard(proto: "event_type"), + 3: .standard(proto: "last_endpoint_id"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._endpointID) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self._eventType) }() + case 3: try { try decoder.decodeSingularStringField(value: &self._lastEndpointID) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._endpointID { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._eventType { + try visitor.visitSingularEnumField(value: v, fieldNumber: 2) + } }() + try { if let v = self._lastEndpointID { + try visitor.visitSingularStringField(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_AutoReconnectFrame, rhs: Location_Nearby_Connections_AutoReconnectFrame) -> Bool { + if lhs._endpointID != rhs._endpointID {return false} + if lhs._eventType != rhs._eventType {return false} + if lhs._lastEndpointID != rhs._lastEndpointID {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_AutoReconnectFrame.EventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_EVENT_TYPE"), + 1: .same(proto: "CLIENT_INTRODUCTION"), + 2: .same(proto: "CLIENT_INTRODUCTION_ACK"), + ] +} + extension Location_Nearby_Connections_MediumMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".MediumMetadata" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -3294,83 +4893,143 @@ extension Location_Nearby_Connections_MediumMetadata: SwiftProtobuf.Message, Swi 9: .standard(proto: "wifi_lan_usable_channels"), 10: .standard(proto: "wifi_aware_usable_channels"), 11: .standard(proto: "wifi_hotspot_sta_usable_channels"), + 12: .standard(proto: "medium_role"), ] + fileprivate class _StorageClass { + var _supports5Ghz: Bool? = nil + var _bssid: String? = nil + var _ipAddress: Data? = nil + var _supports6Ghz: Bool? = nil + var _mobileRadio: Bool? = nil + var _apFrequency: Int32? = nil + var _availableChannels: Location_Nearby_Connections_AvailableChannels? = nil + var _wifiDirectCliUsableChannels: Location_Nearby_Connections_WifiDirectCliUsableChannels? = nil + var _wifiLanUsableChannels: Location_Nearby_Connections_WifiLanUsableChannels? = nil + var _wifiAwareUsableChannels: Location_Nearby_Connections_WifiAwareUsableChannels? = nil + var _wifiHotspotStaUsableChannels: Location_Nearby_Connections_WifiHotspotStaUsableChannels? = nil + var _mediumRole: Location_Nearby_Connections_MediumRole? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _supports5Ghz = source._supports5Ghz + _bssid = source._bssid + _ipAddress = source._ipAddress + _supports6Ghz = source._supports6Ghz + _mobileRadio = source._mobileRadio + _apFrequency = source._apFrequency + _availableChannels = source._availableChannels + _wifiDirectCliUsableChannels = source._wifiDirectCliUsableChannels + _wifiLanUsableChannels = source._wifiLanUsableChannels + _wifiAwareUsableChannels = source._wifiAwareUsableChannels + _wifiHotspotStaUsableChannels = source._wifiHotspotStaUsableChannels + _mediumRole = source._mediumRole + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularBoolField(value: &self._supports5Ghz) }() - case 2: try { try decoder.decodeSingularStringField(value: &self._bssid) }() - case 3: try { try decoder.decodeSingularBytesField(value: &self._ipAddress) }() - case 4: try { try decoder.decodeSingularBoolField(value: &self._supports6Ghz) }() - case 5: try { try decoder.decodeSingularBoolField(value: &self._mobileRadio) }() - case 6: try { try decoder.decodeSingularInt32Field(value: &self._apFrequency) }() - case 7: try { try decoder.decodeSingularMessageField(value: &self._availableChannels) }() - case 8: try { try decoder.decodeSingularMessageField(value: &self._wifiDirectCliUsableChannels) }() - case 9: try { try decoder.decodeSingularMessageField(value: &self._wifiLanUsableChannels) }() - case 10: try { try decoder.decodeSingularMessageField(value: &self._wifiAwareUsableChannels) }() - case 11: try { try decoder.decodeSingularMessageField(value: &self._wifiHotspotStaUsableChannels) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &_storage._supports5Ghz) }() + case 2: try { try decoder.decodeSingularStringField(value: &_storage._bssid) }() + case 3: try { try decoder.decodeSingularBytesField(value: &_storage._ipAddress) }() + case 4: try { try decoder.decodeSingularBoolField(value: &_storage._supports6Ghz) }() + case 5: try { try decoder.decodeSingularBoolField(value: &_storage._mobileRadio) }() + case 6: try { try decoder.decodeSingularInt32Field(value: &_storage._apFrequency) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._availableChannels) }() + case 8: try { try decoder.decodeSingularMessageField(value: &_storage._wifiDirectCliUsableChannels) }() + case 9: try { try decoder.decodeSingularMessageField(value: &_storage._wifiLanUsableChannels) }() + case 10: try { try decoder.decodeSingularMessageField(value: &_storage._wifiAwareUsableChannels) }() + case 11: try { try decoder.decodeSingularMessageField(value: &_storage._wifiHotspotStaUsableChannels) }() + case 12: try { try decoder.decodeSingularMessageField(value: &_storage._mediumRole) }() + default: break + } } } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._supports5Ghz { - try visitor.visitSingularBoolField(value: v, fieldNumber: 1) - } }() - try { if let v = self._bssid { - try visitor.visitSingularStringField(value: v, fieldNumber: 2) - } }() - try { if let v = self._ipAddress { - try visitor.visitSingularBytesField(value: v, fieldNumber: 3) - } }() - try { if let v = self._supports6Ghz { - try visitor.visitSingularBoolField(value: v, fieldNumber: 4) - } }() - try { if let v = self._mobileRadio { - try visitor.visitSingularBoolField(value: v, fieldNumber: 5) - } }() - try { if let v = self._apFrequency { - try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) - } }() - try { if let v = self._availableChannels { - try visitor.visitSingularMessageField(value: v, fieldNumber: 7) - } }() - try { if let v = self._wifiDirectCliUsableChannels { - try visitor.visitSingularMessageField(value: v, fieldNumber: 8) - } }() - try { if let v = self._wifiLanUsableChannels { - try visitor.visitSingularMessageField(value: v, fieldNumber: 9) - } }() - try { if let v = self._wifiAwareUsableChannels { - try visitor.visitSingularMessageField(value: v, fieldNumber: 10) - } }() - try { if let v = self._wifiHotspotStaUsableChannels { - try visitor.visitSingularMessageField(value: v, fieldNumber: 11) - } }() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._supports5Ghz { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._bssid { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._ipAddress { + try visitor.visitSingularBytesField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._supports6Ghz { + try visitor.visitSingularBoolField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._mobileRadio { + try visitor.visitSingularBoolField(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._apFrequency { + try visitor.visitSingularInt32Field(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._availableChannels { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + try { if let v = _storage._wifiDirectCliUsableChannels { + try visitor.visitSingularMessageField(value: v, fieldNumber: 8) + } }() + try { if let v = _storage._wifiLanUsableChannels { + try visitor.visitSingularMessageField(value: v, fieldNumber: 9) + } }() + try { if let v = _storage._wifiAwareUsableChannels { + try visitor.visitSingularMessageField(value: v, fieldNumber: 10) + } }() + try { if let v = _storage._wifiHotspotStaUsableChannels { + try visitor.visitSingularMessageField(value: v, fieldNumber: 11) + } }() + try { if let v = _storage._mediumRole { + try visitor.visitSingularMessageField(value: v, fieldNumber: 12) + } }() + } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Location_Nearby_Connections_MediumMetadata, rhs: Location_Nearby_Connections_MediumMetadata) -> Bool { - if lhs._supports5Ghz != rhs._supports5Ghz {return false} - if lhs._bssid != rhs._bssid {return false} - if lhs._ipAddress != rhs._ipAddress {return false} - if lhs._supports6Ghz != rhs._supports6Ghz {return false} - if lhs._mobileRadio != rhs._mobileRadio {return false} - if lhs._apFrequency != rhs._apFrequency {return false} - if lhs._availableChannels != rhs._availableChannels {return false} - if lhs._wifiDirectCliUsableChannels != rhs._wifiDirectCliUsableChannels {return false} - if lhs._wifiLanUsableChannels != rhs._wifiLanUsableChannels {return false} - if lhs._wifiAwareUsableChannels != rhs._wifiAwareUsableChannels {return false} - if lhs._wifiHotspotStaUsableChannels != rhs._wifiHotspotStaUsableChannels {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._supports5Ghz != rhs_storage._supports5Ghz {return false} + if _storage._bssid != rhs_storage._bssid {return false} + if _storage._ipAddress != rhs_storage._ipAddress {return false} + if _storage._supports6Ghz != rhs_storage._supports6Ghz {return false} + if _storage._mobileRadio != rhs_storage._mobileRadio {return false} + if _storage._apFrequency != rhs_storage._apFrequency {return false} + if _storage._availableChannels != rhs_storage._availableChannels {return false} + if _storage._wifiDirectCliUsableChannels != rhs_storage._wifiDirectCliUsableChannels {return false} + if _storage._wifiLanUsableChannels != rhs_storage._wifiLanUsableChannels {return false} + if _storage._wifiAwareUsableChannels != rhs_storage._wifiAwareUsableChannels {return false} + if _storage._wifiHotspotStaUsableChannels != rhs_storage._wifiHotspotStaUsableChannels {return false} + if _storage._mediumRole != rhs_storage._mediumRole {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -3536,6 +5195,84 @@ extension Location_Nearby_Connections_WifiHotspotStaUsableChannels: SwiftProtobu } } +extension Location_Nearby_Connections_MediumRole: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".MediumRole" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "support_wifi_direct_group_owner"), + 2: .standard(proto: "support_wifi_direct_group_client"), + 3: .standard(proto: "support_wifi_hotspot_host"), + 4: .standard(proto: "support_wifi_hotspot_client"), + 5: .standard(proto: "support_wifi_aware_publisher"), + 6: .standard(proto: "support_wifi_aware_subscriber"), + 7: .standard(proto: "support_awdl_publisher"), + 8: .standard(proto: "support_awdl_subscriber"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBoolField(value: &self._supportWifiDirectGroupOwner) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self._supportWifiDirectGroupClient) }() + case 3: try { try decoder.decodeSingularBoolField(value: &self._supportWifiHotspotHost) }() + case 4: try { try decoder.decodeSingularBoolField(value: &self._supportWifiHotspotClient) }() + case 5: try { try decoder.decodeSingularBoolField(value: &self._supportWifiAwarePublisher) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self._supportWifiAwareSubscriber) }() + case 7: try { try decoder.decodeSingularBoolField(value: &self._supportAwdlPublisher) }() + case 8: try { try decoder.decodeSingularBoolField(value: &self._supportAwdlSubscriber) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._supportWifiDirectGroupOwner { + try visitor.visitSingularBoolField(value: v, fieldNumber: 1) + } }() + try { if let v = self._supportWifiDirectGroupClient { + try visitor.visitSingularBoolField(value: v, fieldNumber: 2) + } }() + try { if let v = self._supportWifiHotspotHost { + try visitor.visitSingularBoolField(value: v, fieldNumber: 3) + } }() + try { if let v = self._supportWifiHotspotClient { + try visitor.visitSingularBoolField(value: v, fieldNumber: 4) + } }() + try { if let v = self._supportWifiAwarePublisher { + try visitor.visitSingularBoolField(value: v, fieldNumber: 5) + } }() + try { if let v = self._supportWifiAwareSubscriber { + try visitor.visitSingularBoolField(value: v, fieldNumber: 6) + } }() + try { if let v = self._supportAwdlPublisher { + try visitor.visitSingularBoolField(value: v, fieldNumber: 7) + } }() + try { if let v = self._supportAwdlSubscriber { + try visitor.visitSingularBoolField(value: v, fieldNumber: 8) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_MediumRole, rhs: Location_Nearby_Connections_MediumRole) -> Bool { + if lhs._supportWifiDirectGroupOwner != rhs._supportWifiDirectGroupOwner {return false} + if lhs._supportWifiDirectGroupClient != rhs._supportWifiDirectGroupClient {return false} + if lhs._supportWifiHotspotHost != rhs._supportWifiHotspotHost {return false} + if lhs._supportWifiHotspotClient != rhs._supportWifiHotspotClient {return false} + if lhs._supportWifiAwarePublisher != rhs._supportWifiAwarePublisher {return false} + if lhs._supportWifiAwareSubscriber != rhs._supportWifiAwareSubscriber {return false} + if lhs._supportAwdlPublisher != rhs._supportAwdlPublisher {return false} + if lhs._supportAwdlSubscriber != rhs._supportAwdlSubscriber {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Location_Nearby_Connections_LocationHint: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".LocationHint" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -3651,3 +5388,159 @@ extension Location_Nearby_Connections_OsInfo.OsType: SwiftProtobuf._ProtoNamePro 100: .same(proto: "LINUX"), ] } + +extension Location_Nearby_Connections_ConnectionsDevice: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ConnectionsDevice" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "endpoint_id"), + 2: .standard(proto: "endpoint_type"), + 3: .standard(proto: "connectivity_info_list"), + 4: .standard(proto: "endpoint_info"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._endpointID) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self._endpointType) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self._connectivityInfoList) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self._endpointInfo) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._endpointID { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._endpointType { + try visitor.visitSingularEnumField(value: v, fieldNumber: 2) + } }() + try { if let v = self._connectivityInfoList { + try visitor.visitSingularBytesField(value: v, fieldNumber: 3) + } }() + try { if let v = self._endpointInfo { + try visitor.visitSingularBytesField(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_ConnectionsDevice, rhs: Location_Nearby_Connections_ConnectionsDevice) -> Bool { + if lhs._endpointID != rhs._endpointID {return false} + if lhs._endpointType != rhs._endpointType {return false} + if lhs._connectivityInfoList != rhs._connectivityInfoList {return false} + if lhs._endpointInfo != rhs._endpointInfo {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_PresenceDevice: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PresenceDevice" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "endpoint_id"), + 2: .standard(proto: "endpoint_type"), + 3: .standard(proto: "connectivity_info_list"), + 4: .standard(proto: "device_id"), + 5: .standard(proto: "device_name"), + 6: .standard(proto: "device_type"), + 7: .standard(proto: "device_image_url"), + 8: .standard(proto: "discovery_medium"), + 9: .same(proto: "actions"), + 10: .standard(proto: "identity_type"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._endpointID) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self._endpointType) }() + case 3: try { try decoder.decodeSingularBytesField(value: &self._connectivityInfoList) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self._deviceID) }() + case 5: try { try decoder.decodeSingularStringField(value: &self._deviceName) }() + case 6: try { try decoder.decodeSingularEnumField(value: &self._deviceType) }() + case 7: try { try decoder.decodeSingularStringField(value: &self._deviceImageURL) }() + case 8: try { try decoder.decodeRepeatedEnumField(value: &self.discoveryMedium) }() + case 9: try { try decoder.decodeRepeatedInt32Field(value: &self.actions) }() + case 10: try { try decoder.decodeRepeatedInt64Field(value: &self.identityType) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._endpointID { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._endpointType { + try visitor.visitSingularEnumField(value: v, fieldNumber: 2) + } }() + try { if let v = self._connectivityInfoList { + try visitor.visitSingularBytesField(value: v, fieldNumber: 3) + } }() + try { if let v = self._deviceID { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 4) + } }() + try { if let v = self._deviceName { + try visitor.visitSingularStringField(value: v, fieldNumber: 5) + } }() + try { if let v = self._deviceType { + try visitor.visitSingularEnumField(value: v, fieldNumber: 6) + } }() + try { if let v = self._deviceImageURL { + try visitor.visitSingularStringField(value: v, fieldNumber: 7) + } }() + if !self.discoveryMedium.isEmpty { + try visitor.visitPackedEnumField(value: self.discoveryMedium, fieldNumber: 8) + } + if !self.actions.isEmpty { + try visitor.visitPackedInt32Field(value: self.actions, fieldNumber: 9) + } + if !self.identityType.isEmpty { + try visitor.visitPackedInt64Field(value: self.identityType, fieldNumber: 10) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Location_Nearby_Connections_PresenceDevice, rhs: Location_Nearby_Connections_PresenceDevice) -> Bool { + if lhs._endpointID != rhs._endpointID {return false} + if lhs._endpointType != rhs._endpointType {return false} + if lhs._connectivityInfoList != rhs._connectivityInfoList {return false} + if lhs._deviceID != rhs._deviceID {return false} + if lhs._deviceName != rhs._deviceName {return false} + if lhs._deviceType != rhs._deviceType {return false} + if lhs._deviceImageURL != rhs._deviceImageURL {return false} + if lhs.discoveryMedium != rhs.discoveryMedium {return false} + if lhs.actions != rhs.actions {return false} + if lhs.identityType != rhs.identityType {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Location_Nearby_Connections_PresenceDevice.DeviceType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN"), + 1: .same(proto: "PHONE"), + 2: .same(proto: "TABLET"), + 3: .same(proto: "DISPLAY"), + 4: .same(proto: "LAPTOP"), + 5: .same(proto: "TV"), + 6: .same(proto: "WATCH"), + ] +} diff --git a/NearbyShare/Protobuf/securegcm.pb.swift b/NearbyShare/Model/Protobuf/securegcm.pb.swift similarity index 100% rename from NearbyShare/Protobuf/securegcm.pb.swift rename to NearbyShare/Model/Protobuf/securegcm.pb.swift diff --git a/NearbyShare/Protobuf/securemessage.pb.swift b/NearbyShare/Model/Protobuf/securemessage.pb.swift similarity index 100% rename from NearbyShare/Protobuf/securemessage.pb.swift rename to NearbyShare/Model/Protobuf/securemessage.pb.swift diff --git a/NearbyShare/Model/Protobuf/sharing_enums.pb.swift b/NearbyShare/Model/Protobuf/sharing_enums.pb.swift new file mode 100644 index 0000000..3c891db --- /dev/null +++ b/NearbyShare/Model/Protobuf/sharing_enums.pb.swift @@ -0,0 +1,3468 @@ +// DO NOT EDIT. +// swift-format-ignore-file +// +// Generated by the Swift generator plugin for the protocol buffer compiler. +// Source: sharing_enums.proto +// +// For information on using the generated types, please see the documentation: +// https://github.com/apple/swift-protobuf/ + +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +import Foundation +import SwiftProtobuf + +// If the compiler emits an error on this type, it is because this file +// was generated by a version of the `protoc` Swift plug-in that is +// incompatible with the version of SwiftProtobuf to which you are linking. +// Please ensure that you are building against the same version of the API +// that was used to generate this file. +fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck { + struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {} + typealias Version = _2 +} + +/// We use event based logging (an event object can be constructed and logged +/// immediately when they occur). To obtain session based information (e.g. +/// durations, counting incoming introductions), we use flowId (sender/receiver) +/// in NearbyClearcutLogger (for android, or clearcut_event_logger as the +/// equivalence for Windows) for all events (may exclude settings), and +/// session_id for a pair of events (start and end of a session). +/// Next id: 74 +enum Location_Nearby_Proto_Sharing_EventType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownEventType // = 0 + + /// When new users accept agreements (like grant permission to contacts for + /// CONTACT_ONLY visibility) and are enrolled into Nearby Sharing. This event + /// is used to count number of new users. + case acceptAgreements // = 1 + + /// User enables/disables nearby sharing from setting or tile service. + case enableNearbySharing // = 2 + + /// User sets visibility preference from setting. + case setVisibility // = 3 + + /// Describe attachments immediately when Nearby Sharing is opened by another + /// app which is used to generate/attach attachments to be shared with other + /// devices. + case describeAttachments // = 4 + + /// Start of a scanning phase at sender. + case scanForShareTargetsStart // = 5 + + /// End of the scanning phase at sender. + case scanForShareTargetsEnd // = 6 + + /// Receiver advertises itself for presence (a pseudo session). + case advertiseDevicePresenceStart // = 7 + + /// End of the advertising phase at receiver. + case advertiseDevicePresenceEnd // = 8 + + /// Sender sends a fast initialization to receiver. + case sendFastInitialization // = 9 + + /// Receiver receives the fast initialization. + case receiveFastInitialization // = 10 + + /// Sender discovers a share target. + case discoverShareTarget // = 11 + + /// Sender sends introduction (before attachments being sent). + case sendIntroduction // = 12 + + /// Receiver receives introduction. + case receiveIntroduction // = 13 + + /// Receiver responds to introduction (before attachments being sent). + /// Actions: Accept, Reject, or (for some reason) Fail. + case respondToIntroduction // = 14 + + /// Start of the sending attachments phase at sender. + case sendAttachmentsStart // = 15 + + /// End of sending attachments phase at sender. + case sendAttachmentsEnd // = 16 + + /// Start of the receiving attachments phase at receiver. + case receiveAttachmentsStart // = 17 + + /// End of receiving attachments phase at receiver. + case receiveAttachmentsEnd // = 18 + + /// Sender cancels sending attachments. + case cancelSendingAttachments // = 19 + + /// Receiver cancels receiving attachments. + case cancelReceivingAttachments // = 20 + + /// Receiver opens received attachments. + case openReceivedAttachments // = 21 + + /// User opens the setup activity. + case launchSetupActivity // = 22 + + /// User adds a contact. + case addContact // = 23 + + /// User removes a contact. + case removeContact // = 24 + + /// Local devices all Fast Share server. + case fastShareServerResponse // = 25 + + /// The start of a sending session. + case sendStart // = 26 + + /// Receiver accepts a fast initialization. + case acceptFastInitialization // = 27 + + /// Set data usage preference. + case setDataUsage // = 28 + + /// Receiver dismisses a fast initialization + case dismissFastInitialization // = 29 + + /// Cancel connection. + case cancelConnection // = 30 + + /// User starts a chimera activity (e.g. ConsentsChimeraActivity, + /// DeviceVisibilityChimeraActivity...) + case launchActivity // = 31 + + /// Receiver dismisses a privacy notification. + case dismissPrivacyNotification // = 32 + + /// Receiver taps a privacy notification. + case tapPrivacyNotification // = 33 + + /// Receiver taps a help page. + case tapHelp // = 34 + + /// Receiver taps a feedback. + case tapFeedback // = 35 + + /// Receiver adds quick settings tile. + case addQuickSettingsTile // = 36 + + /// Receiver removes quick settings tile. + case removeQuickSettingsTile // = 37 + + /// Receiver phone consent clicked. + case launchPhoneConsent // = 38 + + /// Devices show a phone consent banner in Nearby Share Settings + case displayPhoneConsent // = 54 + + /// Receiver taps quick settings tile. + case tapQuickSettingsTile // = 39 + + /// Receiver Installation of APKs status. + case installApk // = 40 + + /// Receiver verification of APKs status. + case verifyApk // = 41 + + /// User starts a consent. + case launchConsent // = 42 + + /// After receiving payloads, Nearby Share still needs to transfer the payloads + /// to correct attachment formats and move files attachments from temporary + /// directory to final destination. + case processReceivedAttachmentsEnd // = 43 + + /// Toggle Show Notification setting item in Nearby Share setting. + case toggleShowNotification // = 44 + + /// Set device name + case setDeviceName // = 45 + + /// users dropped off opt-in page. + case declineAgreements // = 46 + + /// Request setting permissions (Wifi/BT/location/airplane mode). + case requestSettingPermissions // = 47 + + /// Set up a connection with the remote device. + case establishConnection // = 48 + + /// Track device states in Nearby Share setting. + case deviceSettings // = 49 + + /// Receiver auto dismisses a fast initialization notification. + case autoDismissFastInitialization // = 50 + + /// App Crash event. + /// Used only for Windows App now. + case appCrash // = 51 + + /// Sender taps the Send button in quick settings + case tapQuickSettingsFileShare // = 52 + + /// Devices show a privacy notification + case displayPrivacyNotification // = 53 + + /// Preference usage event (e.g. load/save preferences, etc). + /// Used only for Windows App now. + case preferencesUsage // = 55 + + /// Default opt in + case defaultOptIn // = 56 + + /// The result of the setup wizard flow + case setupWizard // = 57 + + /// Sender taps a QR code + case tapQrCode // = 58 + + /// QR code link shown + case qrCodeLinkShown // = 59 + + /// Sender failed to parse endpoint id. + case parsingFailedEndpointID // = 60 + + /// The device is discovered by fast initialization + case fastInitDiscoverDevice // = 61 + + /// Send desktop notification. + case sendDesktopNotification // = 62 + + /// User sets account preference + case setAccount // = 63 + + /// Decrypt certificate failure + case decryptCertificateFailure // = 64 + + /// Show allow permission auto access UI + case showAllowPermissionAutoAccess // = 65 + + /// UI events for transferring files with desktop applications. It includes + /// event types such as DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE. + case sendDesktopTransferEvent // = 66 + + /// Show accept button on Quick Share receive UI + case waitingForAccept // = 67 + + /// High quality event setup + case highQualityMediumSetup // = 68 + + /// RPC call status + case rpcCallStatus // = 69 + + /// A QR code sharing session has started + case startQrCodeSession // = 70 + + /// A QR code URL has been opened in a web client/browser instead of in a + /// native Quick Share app. + case qrCodeOpenedInWebClient // = 71 + + /// A HaTS survey session id has been joined with Quick Share flow id. + case hatsJointEvent // = 72 + + /// Previews received. + case receivePreviews // = 73 + + init() { + self = .unknownEventType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownEventType + case 1: self = .acceptAgreements + case 2: self = .enableNearbySharing + case 3: self = .setVisibility + case 4: self = .describeAttachments + case 5: self = .scanForShareTargetsStart + case 6: self = .scanForShareTargetsEnd + case 7: self = .advertiseDevicePresenceStart + case 8: self = .advertiseDevicePresenceEnd + case 9: self = .sendFastInitialization + case 10: self = .receiveFastInitialization + case 11: self = .discoverShareTarget + case 12: self = .sendIntroduction + case 13: self = .receiveIntroduction + case 14: self = .respondToIntroduction + case 15: self = .sendAttachmentsStart + case 16: self = .sendAttachmentsEnd + case 17: self = .receiveAttachmentsStart + case 18: self = .receiveAttachmentsEnd + case 19: self = .cancelSendingAttachments + case 20: self = .cancelReceivingAttachments + case 21: self = .openReceivedAttachments + case 22: self = .launchSetupActivity + case 23: self = .addContact + case 24: self = .removeContact + case 25: self = .fastShareServerResponse + case 26: self = .sendStart + case 27: self = .acceptFastInitialization + case 28: self = .setDataUsage + case 29: self = .dismissFastInitialization + case 30: self = .cancelConnection + case 31: self = .launchActivity + case 32: self = .dismissPrivacyNotification + case 33: self = .tapPrivacyNotification + case 34: self = .tapHelp + case 35: self = .tapFeedback + case 36: self = .addQuickSettingsTile + case 37: self = .removeQuickSettingsTile + case 38: self = .launchPhoneConsent + case 39: self = .tapQuickSettingsTile + case 40: self = .installApk + case 41: self = .verifyApk + case 42: self = .launchConsent + case 43: self = .processReceivedAttachmentsEnd + case 44: self = .toggleShowNotification + case 45: self = .setDeviceName + case 46: self = .declineAgreements + case 47: self = .requestSettingPermissions + case 48: self = .establishConnection + case 49: self = .deviceSettings + case 50: self = .autoDismissFastInitialization + case 51: self = .appCrash + case 52: self = .tapQuickSettingsFileShare + case 53: self = .displayPrivacyNotification + case 54: self = .displayPhoneConsent + case 55: self = .preferencesUsage + case 56: self = .defaultOptIn + case 57: self = .setupWizard + case 58: self = .tapQrCode + case 59: self = .qrCodeLinkShown + case 60: self = .parsingFailedEndpointID + case 61: self = .fastInitDiscoverDevice + case 62: self = .sendDesktopNotification + case 63: self = .setAccount + case 64: self = .decryptCertificateFailure + case 65: self = .showAllowPermissionAutoAccess + case 66: self = .sendDesktopTransferEvent + case 67: self = .waitingForAccept + case 68: self = .highQualityMediumSetup + case 69: self = .rpcCallStatus + case 70: self = .startQrCodeSession + case 71: self = .qrCodeOpenedInWebClient + case 72: self = .hatsJointEvent + case 73: self = .receivePreviews + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownEventType: return 0 + case .acceptAgreements: return 1 + case .enableNearbySharing: return 2 + case .setVisibility: return 3 + case .describeAttachments: return 4 + case .scanForShareTargetsStart: return 5 + case .scanForShareTargetsEnd: return 6 + case .advertiseDevicePresenceStart: return 7 + case .advertiseDevicePresenceEnd: return 8 + case .sendFastInitialization: return 9 + case .receiveFastInitialization: return 10 + case .discoverShareTarget: return 11 + case .sendIntroduction: return 12 + case .receiveIntroduction: return 13 + case .respondToIntroduction: return 14 + case .sendAttachmentsStart: return 15 + case .sendAttachmentsEnd: return 16 + case .receiveAttachmentsStart: return 17 + case .receiveAttachmentsEnd: return 18 + case .cancelSendingAttachments: return 19 + case .cancelReceivingAttachments: return 20 + case .openReceivedAttachments: return 21 + case .launchSetupActivity: return 22 + case .addContact: return 23 + case .removeContact: return 24 + case .fastShareServerResponse: return 25 + case .sendStart: return 26 + case .acceptFastInitialization: return 27 + case .setDataUsage: return 28 + case .dismissFastInitialization: return 29 + case .cancelConnection: return 30 + case .launchActivity: return 31 + case .dismissPrivacyNotification: return 32 + case .tapPrivacyNotification: return 33 + case .tapHelp: return 34 + case .tapFeedback: return 35 + case .addQuickSettingsTile: return 36 + case .removeQuickSettingsTile: return 37 + case .launchPhoneConsent: return 38 + case .tapQuickSettingsTile: return 39 + case .installApk: return 40 + case .verifyApk: return 41 + case .launchConsent: return 42 + case .processReceivedAttachmentsEnd: return 43 + case .toggleShowNotification: return 44 + case .setDeviceName: return 45 + case .declineAgreements: return 46 + case .requestSettingPermissions: return 47 + case .establishConnection: return 48 + case .deviceSettings: return 49 + case .autoDismissFastInitialization: return 50 + case .appCrash: return 51 + case .tapQuickSettingsFileShare: return 52 + case .displayPrivacyNotification: return 53 + case .displayPhoneConsent: return 54 + case .preferencesUsage: return 55 + case .defaultOptIn: return 56 + case .setupWizard: return 57 + case .tapQrCode: return 58 + case .qrCodeLinkShown: return 59 + case .parsingFailedEndpointID: return 60 + case .fastInitDiscoverDevice: return 61 + case .sendDesktopNotification: return 62 + case .setAccount: return 63 + case .decryptCertificateFailure: return 64 + case .showAllowPermissionAutoAccess: return 65 + case .sendDesktopTransferEvent: return 66 + case .waitingForAccept: return 67 + case .highQualityMediumSetup: return 68 + case .rpcCallStatus: return 69 + case .startQrCodeSession: return 70 + case .qrCodeOpenedInWebClient: return 71 + case .hatsJointEvent: return 72 + case .receivePreviews: return 73 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_EventType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// Event category to differentiate whether this comes from sender or receiver, +/// whether this is for communication flow, or for settings. +enum Location_Nearby_Proto_Sharing_EventCategory: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownEventCategory // = 0 + case sendingEvent // = 1 + case receivingEvent // = 2 + case settingsEvent // = 3 + case rpcEvent // = 4 + + init() { + self = .unknownEventCategory + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownEventCategory + case 1: self = .sendingEvent + case 2: self = .receivingEvent + case 3: self = .settingsEvent + case 4: self = .rpcEvent + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownEventCategory: return 0 + case .sendingEvent: return 1 + case .receivingEvent: return 2 + case .settingsEvent: return 3 + case .rpcEvent: return 4 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_EventCategory: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// Status of nearby sharing. +enum Location_Nearby_Proto_Sharing_NearbySharingStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownNearbySharingStatus // = 0 + case on // = 1 + case off // = 2 + + init() { + self = .unknownNearbySharingStatus + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownNearbySharingStatus + case 1: self = .on + case 2: self = .off + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownNearbySharingStatus: return 0 + case .on: return 1 + case .off: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_NearbySharingStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_Visibility: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownVisibility // = 0 + case contactsOnly // = 1 + case everyone // = 2 + case selectedContactsOnly // = 3 + case hidden // = 4 + case selfShare // = 5 + + init() { + self = .unknownVisibility + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownVisibility + case 1: self = .contactsOnly + case 2: self = .everyone + case 3: self = .selectedContactsOnly + case 4: self = .hidden + case 5: self = .selfShare + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownVisibility: return 0 + case .contactsOnly: return 1 + case .everyone: return 2 + case .selectedContactsOnly: return 3 + case .hidden: return 4 + case .selfShare: return 5 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_Visibility: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_DataUsage: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownDataUsage // = 0 + case online // = 1 + case wifiOnly // = 2 + case offline // = 3 + + init() { + self = .unknownDataUsage + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownDataUsage + case 1: self = .online + case 2: self = .wifiOnly + case 3: self = .offline + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownDataUsage: return 0 + case .online: return 1 + case .wifiOnly: return 2 + case .offline: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_DataUsage: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The status of establishing a connection. Used by ESTABLISH_CONNECTION. +enum Location_Nearby_Proto_Sharing_EstablishConnectionStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case connectionStatusUnknown // = 0 + case connectionStatusSuccess // = 1 + case connectionStatusFailure // = 2 + case connectionStatusCancellation // = 3 + case connectionStatusMediaUnavailableAttachment // = 4 + case connectionStatusFailedPairedKeyhandshake // = 5 + case connectionStatusFailedWriteIntroduction // = 6 + case connectionStatusFailedNullConnection // = 7 + case connectionStatusFailedNoTransferUpdateCallback // = 8 + case connectionStatusLostConnectivity // = 9 + + /// TODO: b/341782941 - : Annote this status when it's confirmed by Nearby + /// Connections team. + case connectionStatusInvalidAdvertisement // = 10 + + init() { + self = .connectionStatusUnknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .connectionStatusUnknown + case 1: self = .connectionStatusSuccess + case 2: self = .connectionStatusFailure + case 3: self = .connectionStatusCancellation + case 4: self = .connectionStatusMediaUnavailableAttachment + case 5: self = .connectionStatusFailedPairedKeyhandshake + case 6: self = .connectionStatusFailedWriteIntroduction + case 7: self = .connectionStatusFailedNullConnection + case 8: self = .connectionStatusFailedNoTransferUpdateCallback + case 9: self = .connectionStatusLostConnectivity + case 10: self = .connectionStatusInvalidAdvertisement + default: return nil + } + } + + var rawValue: Int { + switch self { + case .connectionStatusUnknown: return 0 + case .connectionStatusSuccess: return 1 + case .connectionStatusFailure: return 2 + case .connectionStatusCancellation: return 3 + case .connectionStatusMediaUnavailableAttachment: return 4 + case .connectionStatusFailedPairedKeyhandshake: return 5 + case .connectionStatusFailedWriteIntroduction: return 6 + case .connectionStatusFailedNullConnection: return 7 + case .connectionStatusFailedNoTransferUpdateCallback: return 8 + case .connectionStatusLostConnectivity: return 9 + case .connectionStatusInvalidAdvertisement: return 10 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_EstablishConnectionStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The status of sending and receiving attachments. Used by SEND_ATTACHMENTS. +enum Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownAttachmentTransmissionStatus // = 0 + case completeAttachmentTransmissionStatus // = 1 + case canceledAttachmentTransmissionStatus // = 2 + case failedAttachmentTransmissionStatus // = 3 + case rejectedAttachment // = 4 + case timedOutAttachment // = 5 + case awaitingRemoteAcceptanceFailedAttachment // = 6 + case notEnoughSpaceAttachment // = 7 + case failedNoTransferUpdateCallback // = 8 + case mediaUnavailableAttachment // = 9 + case unsupportedAttachmentTypeAttachment // = 10 + case noAttachmentFound // = 11 + case failedNoShareTargetEndpoint // = 12 + case failedPairedKeyhandshake // = 13 + case failedNullConnection // = 14 + case failedNoPayload // = 15 + case failedWriteIntroduction // = 16 + + /// The remote response is either missing or has an unknown type. + case failedUnknownRemoteResponse // = 17 + + /// Breakdowns of FAILED_NULL_CONNECTION (Desktop side) + case failedNullConnectionInitOutgoing // = 18 + case failedNullConnectionDisconnected // = 19 + + /// Breakdowns of FAILED_NULL_CONNECTION (android side) + /// Connection failed due to Wifi is disconnected or Bluetooth setting is off + /// or user turn on airplane mode. + case failedNullConnectionLostConnectivity // = 20 + + /// Unexpected connection failure. + case failedNullConnectionFailure // = 21 + case rejectedAttachmentTransmissionStatus // = 22 + case timedOutAttachmentTransmissionStatus // = 23 + case notEnoughSpaceAttachmentTransmissionStatus // = 24 + case unsupportedAttachmentTypeAttachmentTransmissionStatus // = 25 + case failedUnknownRemoteResponseTransmissionStatus // = 26 + + /// Connection failed due to Wifi is disconnected or Bluetooth setting is off + /// or user turn on airplane mode. + case noResponseFrameConnectionClosedLostConnectivityTransmissionStatus // = 27 + + /// Unexpected connection failure due to no response frame. + case noResponseFrameConnectionClosedTransmissionStatus // = 28 + + /// Connection failed due to Wifi is disconnected or Bluetooth setting is off + /// or user turn on airplane mode. + case lostConnectivityTransmissionStatus // = 29 + + /// Connection failed due to the medium is not allowed. + case failedDisallowedMedium // = 30 + + init() { + self = .unknownAttachmentTransmissionStatus + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownAttachmentTransmissionStatus + case 1: self = .completeAttachmentTransmissionStatus + case 2: self = .canceledAttachmentTransmissionStatus + case 3: self = .failedAttachmentTransmissionStatus + case 4: self = .rejectedAttachment + case 5: self = .timedOutAttachment + case 6: self = .awaitingRemoteAcceptanceFailedAttachment + case 7: self = .notEnoughSpaceAttachment + case 8: self = .failedNoTransferUpdateCallback + case 9: self = .mediaUnavailableAttachment + case 10: self = .unsupportedAttachmentTypeAttachment + case 11: self = .noAttachmentFound + case 12: self = .failedNoShareTargetEndpoint + case 13: self = .failedPairedKeyhandshake + case 14: self = .failedNullConnection + case 15: self = .failedNoPayload + case 16: self = .failedWriteIntroduction + case 17: self = .failedUnknownRemoteResponse + case 18: self = .failedNullConnectionInitOutgoing + case 19: self = .failedNullConnectionDisconnected + case 20: self = .failedNullConnectionLostConnectivity + case 21: self = .failedNullConnectionFailure + case 22: self = .rejectedAttachmentTransmissionStatus + case 23: self = .timedOutAttachmentTransmissionStatus + case 24: self = .notEnoughSpaceAttachmentTransmissionStatus + case 25: self = .unsupportedAttachmentTypeAttachmentTransmissionStatus + case 26: self = .failedUnknownRemoteResponseTransmissionStatus + case 27: self = .noResponseFrameConnectionClosedLostConnectivityTransmissionStatus + case 28: self = .noResponseFrameConnectionClosedTransmissionStatus + case 29: self = .lostConnectivityTransmissionStatus + case 30: self = .failedDisallowedMedium + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownAttachmentTransmissionStatus: return 0 + case .completeAttachmentTransmissionStatus: return 1 + case .canceledAttachmentTransmissionStatus: return 2 + case .failedAttachmentTransmissionStatus: return 3 + case .rejectedAttachment: return 4 + case .timedOutAttachment: return 5 + case .awaitingRemoteAcceptanceFailedAttachment: return 6 + case .notEnoughSpaceAttachment: return 7 + case .failedNoTransferUpdateCallback: return 8 + case .mediaUnavailableAttachment: return 9 + case .unsupportedAttachmentTypeAttachment: return 10 + case .noAttachmentFound: return 11 + case .failedNoShareTargetEndpoint: return 12 + case .failedPairedKeyhandshake: return 13 + case .failedNullConnection: return 14 + case .failedNoPayload: return 15 + case .failedWriteIntroduction: return 16 + case .failedUnknownRemoteResponse: return 17 + case .failedNullConnectionInitOutgoing: return 18 + case .failedNullConnectionDisconnected: return 19 + case .failedNullConnectionLostConnectivity: return 20 + case .failedNullConnectionFailure: return 21 + case .rejectedAttachmentTransmissionStatus: return 22 + case .timedOutAttachmentTransmissionStatus: return 23 + case .notEnoughSpaceAttachmentTransmissionStatus: return 24 + case .unsupportedAttachmentTypeAttachmentTransmissionStatus: return 25 + case .failedUnknownRemoteResponseTransmissionStatus: return 26 + case .noResponseFrameConnectionClosedLostConnectivityTransmissionStatus: return 27 + case .noResponseFrameConnectionClosedTransmissionStatus: return 28 + case .lostConnectivityTransmissionStatus: return 29 + case .failedDisallowedMedium: return 30 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// Generic result status of NearbyConnections API calls. +enum Location_Nearby_Proto_Sharing_ConnectionLayerStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + + /// No status is available + case unknown // = 0 + + /// The operation was successful. + case success // = 1 + + /// The operation failed, without any more information. + case error // = 2 + + /// The app called an API method out of order (i.e. another method is expected + /// to be called first). + case outOfOrderApiCall // = 3 + + /// The app already has active operations (advertising, discovering, or + /// connected to other devices) with another Strategy. Stop these operations on + /// the current Strategy before trying to advertise or discover with a new + /// Strategy. + case alreadyHaveActiveStrategy // = 4 + + /// The app is already advertising; call StopAdvertising() before trying to + /// advertise again. + case alreadyAdvertising // = 5 + + /// The app is already discovering; call StopDiscovery() before trying to + /// discover again. + case alreadyDiscovering // = 6 + + /// NC is already listening for incoming connections from remote endpoints. + case alreadyListening // = 7 + + /// An attempt to read from/write to a connected remote endpoint failed. If + /// this occurs repeatedly, consider invoking DisconnectFromEndpoint(). + case endPointIoError // = 8 + + /// An attempt to interact with a remote endpoint failed because it's unknown + /// to us -- it's either an endpoint that was never discovered, or an endpoint + /// that never connected to us (both of which are indicative of bad input from + /// the client app). + case endPointUnknown // = 9 + + /// The remote endpoint rejected the connection request. + case connectionRejected // = 10 + + /// The app is already connected to the specified endpoint. Multiple + /// connections to a remote endpoint cannot be maintained simultaneously. + case alreadyConnectedToEndPoint // = 11 + + /// The remote endpoint is not connected; messages cannot be sent to it. + case notConnectedToEndPoint // = 12 + + /// There was an error trying to use the device's Bluetooth capabilities. + case bluetoothError // = 13 + + /// There was an error trying to use the device's Bluetooth Low Energy + /// capabilities. + case bleError // = 14 + + /// There was an error trying to use the device's Wi-Fi capabilities. + case wifiLanError // = 15 + + /// An attempt to interact with an in-flight Payload failed because it's + /// unknown to us. + case payloadUnknown // = 16 + + /// The connection was reset + case reset // = 17 + + /// The connection timed out + case timeout // = 18 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .success + case 2: self = .error + case 3: self = .outOfOrderApiCall + case 4: self = .alreadyHaveActiveStrategy + case 5: self = .alreadyAdvertising + case 6: self = .alreadyDiscovering + case 7: self = .alreadyListening + case 8: self = .endPointIoError + case 9: self = .endPointUnknown + case 10: self = .connectionRejected + case 11: self = .alreadyConnectedToEndPoint + case 12: self = .notConnectedToEndPoint + case 13: self = .bluetoothError + case 14: self = .bleError + case 15: self = .wifiLanError + case 16: self = .payloadUnknown + case 17: self = .reset + case 18: self = .timeout + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .success: return 1 + case .error: return 2 + case .outOfOrderApiCall: return 3 + case .alreadyHaveActiveStrategy: return 4 + case .alreadyAdvertising: return 5 + case .alreadyDiscovering: return 6 + case .alreadyListening: return 7 + case .endPointIoError: return 8 + case .endPointUnknown: return 9 + case .connectionRejected: return 10 + case .alreadyConnectedToEndPoint: return 11 + case .notConnectedToEndPoint: return 12 + case .bluetoothError: return 13 + case .bleError: return 14 + case .wifiLanError: return 15 + case .payloadUnknown: return 16 + case .reset: return 17 + case .timeout: return 18 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ConnectionLayerStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The status of processing attachments after receiver received payloads +/// successfully. +enum Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case processingStatusUnknown // = 0 + case processingStatusCompleteProcessingAttachments // = 1 + case processingStatusFailedMovingFiles // = 2 + case processingStatusFailedReceivingApk // = 3 + case processingStatusFailedReceivingText // = 4 + case processingStatusFailedReceivingWifiCredentials // = 5 + + init() { + self = .processingStatusUnknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .processingStatusUnknown + case 1: self = .processingStatusCompleteProcessingAttachments + case 2: self = .processingStatusFailedMovingFiles + case 3: self = .processingStatusFailedReceivingApk + case 4: self = .processingStatusFailedReceivingText + case 5: self = .processingStatusFailedReceivingWifiCredentials + default: return nil + } + } + + var rawValue: Int { + switch self { + case .processingStatusUnknown: return 0 + case .processingStatusCompleteProcessingAttachments: return 1 + case .processingStatusFailedMovingFiles: return 2 + case .processingStatusFailedReceivingApk: return 3 + case .processingStatusFailedReceivingText: return 4 + case .processingStatusFailedReceivingWifiCredentials: return 5 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The status of advertising and discovering sessions. Used by +/// SCAN_FOR_SHARE_TARGETS and ADVERTISE_DEVICE_PRESENCE. +enum Location_Nearby_Proto_Sharing_SessionStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownSessionStatus // = 0 + case succeededSessionStatus // = 1 + + /// TODO: b/341782941 - FAILED_SESSION_STATUS occurs when the status of + /// advertising or discovering sessions is not successful. It can be + /// due to STATUS_INTERNAL_ERROR, STATUS_INTERRUPTION, STATUS_CANCELLED. + /// More session statuses should be logged to determine the status. + case failedSessionStatus // = 2 + + init() { + self = .unknownSessionStatus + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownSessionStatus + case 1: self = .succeededSessionStatus + case 2: self = .failedSessionStatus + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownSessionStatus: return 0 + case .succeededSessionStatus: return 1 + case .failedSessionStatus: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_SessionStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// User's response to introductions. +enum Location_Nearby_Proto_Sharing_ResponseToIntroduction: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownResponseToIntroduction // = 0 + case acceptIntroduction // = 1 + case rejectIntroduction // = 2 + case failIntroduction // = 3 + + init() { + self = .unknownResponseToIntroduction + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownResponseToIntroduction + case 1: self = .acceptIntroduction + case 2: self = .rejectIntroduction + case 3: self = .failIntroduction + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownResponseToIntroduction: return 0 + case .acceptIntroduction: return 1 + case .rejectIntroduction: return 2 + case .failIntroduction: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ResponseToIntroduction: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// TODO(fdi): may eventually include desktop, etc. +/// The type of a remote device. +enum Location_Nearby_Proto_Sharing_DeviceType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownDeviceType // = 0 + case phone // = 1 + case tablet // = 2 + case laptop // = 3 + case car // = 4 + case foldable // = 5 + case xr // = 6 + + init() { + self = .unknownDeviceType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownDeviceType + case 1: self = .phone + case 2: self = .tablet + case 3: self = .laptop + case 4: self = .car + case 5: self = .foldable + case 6: self = .xr + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownDeviceType: return 0 + case .phone: return 1 + case .tablet: return 2 + case .laptop: return 3 + case .car: return 4 + case .foldable: return 5 + case .xr: return 6 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_DeviceType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// TODO(fdi): may eventually include windows, iOS, etc. +/// The OS type of a remote device. +enum Location_Nearby_Proto_Sharing_OSType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownOsType // = 0 + case android // = 1 + case chromeOs // = 2 + case ios // = 3 + case windows // = 4 + case macos // = 5 + + init() { + self = .unknownOsType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownOsType + case 1: self = .android + case 2: self = .chromeOs + case 3: self = .ios + case 4: self = .windows + case 5: self = .macos + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownOsType: return 0 + case .android: return 1 + case .chromeOs: return 2 + case .ios: return 3 + case .windows: return 4 + case .macos: return 5 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_OSType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// Relationship of remote device to sender device. +enum Location_Nearby_Proto_Sharing_DeviceRelationship: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownDeviceRelationship // = 0 + + /// The remote device belongs to the same owner as sender device. + case isSelf // = 1 + + /// The remote device is a contact of sender. + case isContact // = 2 + + /// The remote device is a stranger. + case isStranger // = 3 + + init() { + self = .unknownDeviceRelationship + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownDeviceRelationship + case 1: self = .isSelf + case 2: self = .isContact + case 3: self = .isStranger + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownDeviceRelationship: return 0 + case .isSelf: return 1 + case .isContact: return 2 + case .isStranger: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_DeviceRelationship: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The device sources of the clearcut log. +enum Location_Nearby_Proto_Sharing_LogSource: SwiftProtobuf.Enum { + typealias RawValue = Int + case unspecifiedSource // = 0 + + /// Represents the devices in Nearby labs. + case labDevices // = 1 + + /// Represents the devices tested by Nearby engs, in the long term can include + /// any devices with newest feature flags. + case internalDevices // = 2 + + /// Represents the devices testing our in-development features before they're + /// released to the greater public. + case betaTesterDevices // = 3 + + /// Represents the OEM partners (like Samsung) that we're working with to + /// verify functionality on their devices. + case oemDevices // = 4 + + /// Represents the device for debugging. + case debugDevices // = 5 + + /// Represents the device for Nearby Module Food. + case nearbyModuleFoodDevices // = 6 + + /// Represents the device for BeTo Team Food. + case betoDogfoodDevices // = 7 + + /// Represents the device for Nearby dog Food. + case nearbyDogfoodDevices // = 8 + + /// Represents the device for Nearby Team Food. + case nearbyTeamfoodDevices // = 9 + + init() { + self = .unspecifiedSource + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unspecifiedSource + case 1: self = .labDevices + case 2: self = .internalDevices + case 3: self = .betaTesterDevices + case 4: self = .oemDevices + case 5: self = .debugDevices + case 6: self = .nearbyModuleFoodDevices + case 7: self = .betoDogfoodDevices + case 8: self = .nearbyDogfoodDevices + case 9: self = .nearbyTeamfoodDevices + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unspecifiedSource: return 0 + case .labDevices: return 1 + case .internalDevices: return 2 + case .betaTesterDevices: return 3 + case .oemDevices: return 4 + case .debugDevices: return 5 + case .nearbyModuleFoodDevices: return 6 + case .betoDogfoodDevices: return 7 + case .nearbyDogfoodDevices: return 8 + case .nearbyTeamfoodDevices: return 9 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_LogSource: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The Fast Share server action name. +enum Location_Nearby_Proto_Sharing_ServerActionName: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownServerAction // = 0 + case uploadCertificates // = 1 + case downloadCertificates // = 2 + case checkReachability // = 3 + case uploadContacts // = 4 + case updateDeviceName // = 5 + case uploadSenderCertificates // = 6 + case downloadSenderCertificates // = 7 + case uploadContactsAndCertificates // = 8 + case listReachablePhoneNumbers // = 9 + case listMyDevices // = 10 + case listContactPeople // = 11 + + /// used for analytics logger to record action name. + case downloadCertificatesInfo // = 12 + + init() { + self = .unknownServerAction + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownServerAction + case 1: self = .uploadCertificates + case 2: self = .downloadCertificates + case 3: self = .checkReachability + case 4: self = .uploadContacts + case 5: self = .updateDeviceName + case 6: self = .uploadSenderCertificates + case 7: self = .downloadSenderCertificates + case 8: self = .uploadContactsAndCertificates + case 9: self = .listReachablePhoneNumbers + case 10: self = .listMyDevices + case 11: self = .listContactPeople + case 12: self = .downloadCertificatesInfo + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownServerAction: return 0 + case .uploadCertificates: return 1 + case .downloadCertificates: return 2 + case .checkReachability: return 3 + case .uploadContacts: return 4 + case .updateDeviceName: return 5 + case .uploadSenderCertificates: return 6 + case .downloadSenderCertificates: return 7 + case .uploadContactsAndCertificates: return 8 + case .listReachablePhoneNumbers: return 9 + case .listMyDevices: return 10 + case .listContactPeople: return 11 + case .downloadCertificatesInfo: return 12 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ServerActionName: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The Fast Share server response state. +enum Location_Nearby_Proto_Sharing_ServerResponseState: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownServerResponseState // = 0 + case serverResponseSuccess // = 1 + case serverResponseUnknownFailure // = 2 + + /// For StatusException. + case serverResponseStatusOtherFailure // = 3 + case serverResponseStatusDeadlineExceeded // = 4 + case serverResponseStatusPermissionDenied // = 5 + case serverResponseStatusUnavailable // = 6 + case serverResponseStatusUnauthenticated // = 7 + case serverResponseStatusInvalidArgument // = 9 + + /// For GoogleAuthException. + case serverResponseGoogleAuthFailure // = 8 + + /// For Internet connect status. + case serverResponseNotConnectedToInternet // = 10 + + init() { + self = .unknownServerResponseState + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownServerResponseState + case 1: self = .serverResponseSuccess + case 2: self = .serverResponseUnknownFailure + case 3: self = .serverResponseStatusOtherFailure + case 4: self = .serverResponseStatusDeadlineExceeded + case 5: self = .serverResponseStatusPermissionDenied + case 6: self = .serverResponseStatusUnavailable + case 7: self = .serverResponseStatusUnauthenticated + case 8: self = .serverResponseGoogleAuthFailure + case 9: self = .serverResponseStatusInvalidArgument + case 10: self = .serverResponseNotConnectedToInternet + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownServerResponseState: return 0 + case .serverResponseSuccess: return 1 + case .serverResponseUnknownFailure: return 2 + case .serverResponseStatusOtherFailure: return 3 + case .serverResponseStatusDeadlineExceeded: return 4 + case .serverResponseStatusPermissionDenied: return 5 + case .serverResponseStatusUnavailable: return 6 + case .serverResponseStatusUnauthenticated: return 7 + case .serverResponseGoogleAuthFailure: return 8 + case .serverResponseStatusInvalidArgument: return 9 + case .serverResponseNotConnectedToInternet: return 10 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ServerResponseState: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The purpose of requesting the server request. +enum Location_Nearby_Proto_Sharing_SyncPurpose: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + + /// When NearbySharingChimeraService#sync() is called. + case onDemandSync // = 1 + + /// Requested by chime notification. + case chimeNotification // = 2 + + /// For reqular daily sync. + case dailySync // = 3 + + /// Wen a device opts into Nearby Share. + case optInFirstSync // = 4 + + /// Requested when Nearby Share automatically enables a device that shares + /// a single account that has already opted in on another device. + case checkDefaultOptIn // = 5 + + /// When a device enables Nearby Share. + case nearbyShareEnabled // = 6 + + /// When a device is in fast init advertising. + case syncAtFastInit // = 7 + + /// When device start discovery. + case syncAtDiscovery // = 8 + + /// When device tries to load valid private certificate. + case syncAtLoadPrivateCertificate // = 9 + + /// When device start advertiseement. + case syncAtAdvertisement // = 10 + + /// When device contacts list changes. + case contactListChange // = 11 + + /// When showing the C11 banner in Neary Share setting. + case showC11NView // = 12 + + /// For regular check contact reachability. + case regularCheckContactReachability // = 13 + + /// When selected contacts list changes in visibility setting. + case visibilitySelectedContactChange // = 14 + + /// When switching account. + case accountChange // = 15 + + /// When regenerate certificates + case regenerateCertificates // = 16 + + /// When Device Contacts consent changes + case deviceContactsConsentChange // = 17 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .onDemandSync + case 2: self = .chimeNotification + case 3: self = .dailySync + case 4: self = .optInFirstSync + case 5: self = .checkDefaultOptIn + case 6: self = .nearbyShareEnabled + case 7: self = .syncAtFastInit + case 8: self = .syncAtDiscovery + case 9: self = .syncAtLoadPrivateCertificate + case 10: self = .syncAtAdvertisement + case 11: self = .contactListChange + case 12: self = .showC11NView + case 13: self = .regularCheckContactReachability + case 14: self = .visibilitySelectedContactChange + case 15: self = .accountChange + case 16: self = .regenerateCertificates + case 17: self = .deviceContactsConsentChange + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .onDemandSync: return 1 + case .chimeNotification: return 2 + case .dailySync: return 3 + case .optInFirstSync: return 4 + case .checkDefaultOptIn: return 5 + case .nearbyShareEnabled: return 6 + case .syncAtFastInit: return 7 + case .syncAtDiscovery: return 8 + case .syncAtLoadPrivateCertificate: return 9 + case .syncAtAdvertisement: return 10 + case .contactListChange: return 11 + case .showC11NView: return 12 + case .regularCheckContactReachability: return 13 + case .visibilitySelectedContactChange: return 14 + case .accountChange: return 15 + case .regenerateCertificates: return 16 + case .deviceContactsConsentChange: return 17 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_SyncPurpose: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The device role to trigger the server request. +enum Location_Nearby_Proto_Sharing_ClientRole: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case sender // = 1 + case receiver // = 2 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .sender + case 2: self = .receiver + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .sender: return 1 + case .receiver: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ClientRole: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The type of Nearby Sharing scanning. +enum Location_Nearby_Proto_Sharing_ScanType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownScanType // = 0 + case foregroundScan // = 1 + case foregroundRetryScan // = 2 + case directShareScan // = 3 + case backgroundScan // = 4 + + init() { + self = .unknownScanType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownScanType + case 1: self = .foregroundScan + case 2: self = .foregroundRetryScan + case 3: self = .directShareScan + case 4: self = .backgroundScan + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownScanType: return 0 + case .foregroundScan: return 1 + case .foregroundRetryScan: return 2 + case .directShareScan: return 3 + case .backgroundScan: return 4 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ScanType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The type of parsing endpoint id failed type. +enum Location_Nearby_Proto_Sharing_ParsingFailedType: SwiftProtobuf.Enum { + typealias RawValue = Int + case failedUnknownType // = 0 + + /// NULL advertisement is returned due to sender failing to parse advertisement + /// from endpointInfo byte stream from receiver advertisement. + case failedParseAdvertisement // = 1 + + /// NULL shareTarget is returned due to sender failing to create shareTarget + /// from a valid parsed advertisement stemming from issues in certificates, QR + /// code tokens or device names. + case failedConvertShareTarget // = 2 + + init() { + self = .failedUnknownType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .failedUnknownType + case 1: self = .failedParseAdvertisement + case 2: self = .failedConvertShareTarget + default: return nil + } + } + + var rawValue: Int { + switch self { + case .failedUnknownType: return 0 + case .failedParseAdvertisement: return 1 + case .failedConvertShareTarget: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ParsingFailedType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The Nearby Sharing advertising mode. +enum Location_Nearby_Proto_Sharing_AdvertisingMode: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownAdvertisingMode // = 0 + case screenOffAdvertisingMode // = 1 + case backgroundAdvertisingMode // = 2 + case midgroundAdvertisingMode // = 3 + case foregroundAdvertisingMode // = 4 + case suspendedAdvertisingMode // = 5 + + init() { + self = .unknownAdvertisingMode + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownAdvertisingMode + case 1: self = .screenOffAdvertisingMode + case 2: self = .backgroundAdvertisingMode + case 3: self = .midgroundAdvertisingMode + case 4: self = .foregroundAdvertisingMode + case 5: self = .suspendedAdvertisingMode + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownAdvertisingMode: return 0 + case .screenOffAdvertisingMode: return 1 + case .backgroundAdvertisingMode: return 2 + case .midgroundAdvertisingMode: return 3 + case .foregroundAdvertisingMode: return 4 + case .suspendedAdvertisingMode: return 5 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_AdvertisingMode: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The Nearby Sharing discovery mode. +enum Location_Nearby_Proto_Sharing_DiscoveryMode: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownDiscoveryMode // = 0 + case screenOffDiscoveryMode // = 1 + case backgroundDiscoveryMode // = 2 + case midgroundDiscoveryMode // = 3 + case foregroundDiscoveryMode // = 4 + case suspendedDiscoveryMode // = 5 + + init() { + self = .unknownDiscoveryMode + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownDiscoveryMode + case 1: self = .screenOffDiscoveryMode + case 2: self = .backgroundDiscoveryMode + case 3: self = .midgroundDiscoveryMode + case 4: self = .foregroundDiscoveryMode + case 5: self = .suspendedDiscoveryMode + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownDiscoveryMode: return 0 + case .screenOffDiscoveryMode: return 1 + case .backgroundDiscoveryMode: return 2 + case .midgroundDiscoveryMode: return 3 + case .foregroundDiscoveryMode: return 4 + case .suspendedDiscoveryMode: return 5 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_DiscoveryMode: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The class name of chimera activity. +enum Location_Nearby_Proto_Sharing_ActivityName: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownActivity // = 0 + case shareSheetActivity // = 1 + case settingsActivity // = 2 + case receiveSurfaceActivity // = 3 + case setupActivity // = 4 + case deviceVisibilityActivity // = 5 + case consentsActivity // = 6 + case setDeviceNameDialog // = 7 + case setDataUsageDialog // = 8 + case quickSettingsActivity // = 9 + case remoteCopyShareSheetActivity // = 10 + case setupWizardActivity // = 11 + case settingsReviewActivity // = 12 + + init() { + self = .unknownActivity + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownActivity + case 1: self = .shareSheetActivity + case 2: self = .settingsActivity + case 3: self = .receiveSurfaceActivity + case 4: self = .setupActivity + case 5: self = .deviceVisibilityActivity + case 6: self = .consentsActivity + case 7: self = .setDeviceNameDialog + case 8: self = .setDataUsageDialog + case 9: self = .quickSettingsActivity + case 10: self = .remoteCopyShareSheetActivity + case 11: self = .setupWizardActivity + case 12: self = .settingsReviewActivity + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownActivity: return 0 + case .shareSheetActivity: return 1 + case .settingsActivity: return 2 + case .receiveSurfaceActivity: return 3 + case .setupActivity: return 4 + case .deviceVisibilityActivity: return 5 + case .consentsActivity: return 6 + case .setDeviceNameDialog: return 7 + case .setDataUsageDialog: return 8 + case .quickSettingsActivity: return 9 + case .remoteCopyShareSheetActivity: return 10 + case .setupWizardActivity: return 11 + case .settingsReviewActivity: return 12 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ActivityName: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The type of consent page user launches. +enum Location_Nearby_Proto_Sharing_ConsentType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + + /// launch Constellation consent page. + case c11N // = 1 + + /// launch device contact consent page. + case deviceContact // = 2 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .c11N + case 2: self = .deviceContact + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .c11N: return 1 + case .deviceContact: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ConsentType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case consentUnknownAcceptStatus // = 0 + case consentAccepted // = 1 + case consentDeclined // = 2 + + /// unable to enable consent. + case consentUnableToEnable // = 3 + + init() { + self = .consentUnknownAcceptStatus + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .consentUnknownAcceptStatus + case 1: self = .consentAccepted + case 2: self = .consentDeclined + case 3: self = .consentUnableToEnable + default: return nil + } + } + + var rawValue: Int { + switch self { + case .consentUnknownAcceptStatus: return 0 + case .consentAccepted: return 1 + case .consentDeclined: return 2 + case .consentUnableToEnable: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_ApkSource: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownApkSource // = 0 + case apkFromSdCard // = 1 + case installedApp // = 2 + + init() { + self = .unknownApkSource + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownApkSource + case 1: self = .apkFromSdCard + case 2: self = .installedApp + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownApkSource: return 0 + case .apkFromSdCard: return 1 + case .installedApp: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ApkSource: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The Installation status of APK. +enum Location_Nearby_Proto_Sharing_InstallAPKStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownInstallApkStatus // = 0 + case failInstallation // = 1 + case successInstallation // = 2 + + init() { + self = .unknownInstallApkStatus + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownInstallApkStatus + case 1: self = .failInstallation + case 2: self = .successInstallation + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownInstallApkStatus: return 0 + case .failInstallation: return 1 + case .successInstallation: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_InstallAPKStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The verification status of APK. +enum Location_Nearby_Proto_Sharing_VerifyAPKStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownVerifyApkStatus // = 0 + case notInstallable // = 1 + case installable // = 2 + case alreadyInstalled // = 3 + + init() { + self = .unknownVerifyApkStatus + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownVerifyApkStatus + case 1: self = .notInstallable + case 2: self = .installable + case 3: self = .alreadyInstalled + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownVerifyApkStatus: return 0 + case .notInstallable: return 1 + case .installable: return 2 + case .alreadyInstalled: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_VerifyAPKStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_ShowNotificationStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknownShowNotificationStatus // = 0 + case show // = 1 + case notShow // = 2 + + init() { + self = .unknownShowNotificationStatus + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknownShowNotificationStatus + case 1: self = .show + case 2: self = .notShow + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknownShowNotificationStatus: return 0 + case .show: return 1 + case .notShow: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ShowNotificationStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_PermissionRequestResult: SwiftProtobuf.Enum { + typealias RawValue = Int + case permissionUnknownRequestResult // = 0 + case permissionGranted // = 1 + case permissionRejected // = 2 + case permissionUnableToGrant // = 3 + + init() { + self = .permissionUnknownRequestResult + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .permissionUnknownRequestResult + case 1: self = .permissionGranted + case 2: self = .permissionRejected + case 3: self = .permissionUnableToGrant + default: return nil + } + } + + var rawValue: Int { + switch self { + case .permissionUnknownRequestResult: return 0 + case .permissionGranted: return 1 + case .permissionRejected: return 2 + case .permissionUnableToGrant: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_PermissionRequestResult: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_PermissionRequestType: SwiftProtobuf.Enum { + typealias RawValue = Int + case permissionUnknownType // = 0 + case permissionAirplaneModeOff // = 1 + case permissionWifi // = 2 + case permissionBluetooth // = 3 + case permissionLocation // = 4 + case permissionWifiHotspot // = 5 + + init() { + self = .permissionUnknownType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .permissionUnknownType + case 1: self = .permissionAirplaneModeOff + case 2: self = .permissionWifi + case 3: self = .permissionBluetooth + case 4: self = .permissionLocation + case 5: self = .permissionWifiHotspot + default: return nil + } + } + + var rawValue: Int { + switch self { + case .permissionUnknownType: return 0 + case .permissionAirplaneModeOff: return 1 + case .permissionWifi: return 2 + case .permissionBluetooth: return 3 + case .permissionLocation: return 4 + case .permissionWifiHotspot: return 5 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_PermissionRequestType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_SharingUseCase: SwiftProtobuf.Enum { + typealias RawValue = Int + case useCaseUnknown // = 0 + case useCaseNearbyShare // = 1 + case useCaseRemoteCopyPaste // = 2 + case useCaseWifiCredential // = 3 + case useCaseAppShare // = 4 + case useCaseQuickSettingFileShare // = 5 + case useCaseSetupWizard // = 6 + + /// Deprecated. QR code is an addition to existing use cases rather than being + /// a separate use case. + case useCaseNearbyShareWithQrCode // = 7 + + /// The user was redirected from Bluetooth sharing UI to Nearby Share + case useCaseRedirectedFromBluetoothShare // = 8 + + init() { + self = .useCaseUnknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .useCaseUnknown + case 1: self = .useCaseNearbyShare + case 2: self = .useCaseRemoteCopyPaste + case 3: self = .useCaseWifiCredential + case 4: self = .useCaseAppShare + case 5: self = .useCaseQuickSettingFileShare + case 6: self = .useCaseSetupWizard + case 7: self = .useCaseNearbyShareWithQrCode + case 8: self = .useCaseRedirectedFromBluetoothShare + default: return nil + } + } + + var rawValue: Int { + switch self { + case .useCaseUnknown: return 0 + case .useCaseNearbyShare: return 1 + case .useCaseRemoteCopyPaste: return 2 + case .useCaseWifiCredential: return 3 + case .useCaseAppShare: return 4 + case .useCaseQuickSettingFileShare: return 5 + case .useCaseSetupWizard: return 6 + case .useCaseNearbyShareWithQrCode: return 7 + case .useCaseRedirectedFromBluetoothShare: return 8 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_SharingUseCase: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// Used only for Windows App now. +enum Location_Nearby_Proto_Sharing_AppCrashReason: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_AppCrashReason: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// Thes source where the attachemnt comes from. It can be an action, app name, +/// etc. The first 6 source types are being used as FileSenderType in Nearby +/// Share Windows app. +enum Location_Nearby_Proto_Sharing_AttachmentSourceType: SwiftProtobuf.Enum { + typealias RawValue = Int + case attachmentSourceUnknown // = 0 + case attachmentSourceContextMenu // = 1 + case attachmentSourceDragAndDrop // = 2 + case attachmentSourceSelectFilesButton // = 3 + case attachmentSourcePaste // = 4 + case attachmentSourceSelectFoldersButton // = 5 + case attachmentSourceShareActivation // = 6 + + init() { + self = .attachmentSourceUnknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .attachmentSourceUnknown + case 1: self = .attachmentSourceContextMenu + case 2: self = .attachmentSourceDragAndDrop + case 3: self = .attachmentSourceSelectFilesButton + case 4: self = .attachmentSourcePaste + case 5: self = .attachmentSourceSelectFoldersButton + case 6: self = .attachmentSourceShareActivation + default: return nil + } + } + + var rawValue: Int { + switch self { + case .attachmentSourceUnknown: return 0 + case .attachmentSourceContextMenu: return 1 + case .attachmentSourceDragAndDrop: return 2 + case .attachmentSourceSelectFilesButton: return 3 + case .attachmentSourcePaste: return 4 + case .attachmentSourceSelectFoldersButton: return 5 + case .attachmentSourceShareActivation: return 6 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_AttachmentSourceType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The action to interact with preferences. +/// Used only for Windows App now. +enum Location_Nearby_Proto_Sharing_PreferencesAction: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case noAction // = 1 + + /// Primary actions/functions towards preferences + case loadPreferences // = 2 + case savePreferencess // = 3 + case attemptLoad // = 4 + case restoreFromBackup // = 5 + + /// Other actions within the 4 actions above + case createPreferencesPath // = 6 + case makePreferencesBackupFile // = 7 + case checkIfPreferencesPathExists // = 8 + case checkIfPreferencesInputStreamStatus // = 9 + case checkIfPreferencesFileIsCorrupted // = 10 + case checkIfPreferencesBackupFileExists // = 11 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .noAction + case 2: self = .loadPreferences + case 3: self = .savePreferencess + case 4: self = .attemptLoad + case 5: self = .restoreFromBackup + case 6: self = .createPreferencesPath + case 7: self = .makePreferencesBackupFile + case 8: self = .checkIfPreferencesPathExists + case 9: self = .checkIfPreferencesInputStreamStatus + case 10: self = .checkIfPreferencesFileIsCorrupted + case 11: self = .checkIfPreferencesBackupFileExists + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .noAction: return 1 + case .loadPreferences: return 2 + case .savePreferencess: return 3 + case .attemptLoad: return 4 + case .restoreFromBackup: return 5 + case .createPreferencesPath: return 6 + case .makePreferencesBackupFile: return 7 + case .checkIfPreferencesPathExists: return 8 + case .checkIfPreferencesInputStreamStatus: return 9 + case .checkIfPreferencesFileIsCorrupted: return 10 + case .checkIfPreferencesBackupFileExists: return 11 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_PreferencesAction: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// The status of the action to interact with preferences. +/// Used only for Windows App now. +enum Location_Nearby_Proto_Sharing_PreferencesActionStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case success // = 1 + case fail // = 2 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .success + case 2: self = .fail + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .success: return 1 + case .fail: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_PreferencesActionStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +///* The distance of the found nearby fast init advertisement. +enum Location_Nearby_Proto_Sharing_FastInitState: SwiftProtobuf.Enum { + typealias RawValue = Int + case fastInitUnknownState // = 0 + + /// A device was found in close proximity. + /// distance < fast_init_distance_close_centimeters(50 cm) + case fastInitCloseState // = 1 + + /// A device was found in far proximity. + /// distance < fast_init_distance_close_centimeters(10 m) + case fastInitFarState // = 2 + + /// No devices have been found nearby. The default state. + case fastInitLostState // = 3 + + init() { + self = .fastInitUnknownState + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .fastInitUnknownState + case 1: self = .fastInitCloseState + case 2: self = .fastInitFarState + case 3: self = .fastInitLostState + default: return nil + } + } + + var rawValue: Int { + switch self { + case .fastInitUnknownState: return 0 + case .fastInitCloseState: return 1 + case .fastInitFarState: return 2 + case .fastInitLostState: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_FastInitState: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +///* The type of FastInit advertisement. +enum Location_Nearby_Proto_Sharing_FastInitType: SwiftProtobuf.Enum { + typealias RawValue = Int + case fastInitUnknownType // = 0 + + /// Show HUN to notify the user. + case fastInitNotifyType // = 1 + + /// Not notify the user. + case fastInitSilentType // = 2 + + init() { + self = .fastInitUnknownType + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .fastInitUnknownType + case 1: self = .fastInitNotifyType + case 2: self = .fastInitSilentType + default: return nil + } + } + + var rawValue: Int { + switch self { + case .fastInitUnknownType: return 0 + case .fastInitNotifyType: return 1 + case .fastInitSilentType: return 2 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_FastInitType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +///* The type of desktop notification event. +enum Location_Nearby_Proto_Sharing_DesktopNotification: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case connecting // = 1 + case progress // = 2 + case accept // = 3 + case received // = 4 + case error // = 5 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .connecting + case 2: self = .progress + case 3: self = .accept + case 4: self = .received + case 5: self = .error + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .connecting: return 1 + case .progress: return 2 + case .accept: return 3 + case .received: return 4 + case .error: return 5 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_DesktopNotification: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_DesktopTransferEventType: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + + /// Receive attachments. + case desktopTransferEventReceiveTypeAccept // = 1 + case desktopTransferEventReceiveTypeProgress // = 2 + case desktopTransferEventReceiveTypeReceived // = 3 + case desktopTransferEventReceiveTypeError // = 4 + + /// Send attachments. + case desktopTransferEventSendTypeStart // = 5 + case desktopTransferEventSendTypeSelectADevice // = 6 + case desktopTransferEventSendTypeProgress // = 7 + case desktopTransferEventSendTypeSent // = 8 + case desktopTransferEventSendTypeError // = 9 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .desktopTransferEventReceiveTypeAccept + case 2: self = .desktopTransferEventReceiveTypeProgress + case 3: self = .desktopTransferEventReceiveTypeReceived + case 4: self = .desktopTransferEventReceiveTypeError + case 5: self = .desktopTransferEventSendTypeStart + case 6: self = .desktopTransferEventSendTypeSelectADevice + case 7: self = .desktopTransferEventSendTypeProgress + case 8: self = .desktopTransferEventSendTypeSent + case 9: self = .desktopTransferEventSendTypeError + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .desktopTransferEventReceiveTypeAccept: return 1 + case .desktopTransferEventReceiveTypeProgress: return 2 + case .desktopTransferEventReceiveTypeReceived: return 3 + case .desktopTransferEventReceiveTypeError: return 4 + case .desktopTransferEventSendTypeStart: return 5 + case .desktopTransferEventSendTypeSelectADevice: return 6 + case .desktopTransferEventSendTypeProgress: return 7 + case .desktopTransferEventSendTypeSent: return 8 + case .desktopTransferEventSendTypeError: return 9 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_DesktopTransferEventType: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case decryptCertUnknownFailure // = 0 + case decryptCertNoSuchAlgorithmFailure // = 1 + case decryptCertNoSuchPaddingFailure // = 2 + case decryptCertInvalidKeyFailure // = 3 + case decryptCertInvalidAlgorithmParameterFailure // = 4 + case decryptCertIllegalBlockSizeFailure // = 5 + case decryptCertBadPaddingFailure // = 6 + + init() { + self = .decryptCertUnknownFailure + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .decryptCertUnknownFailure + case 1: self = .decryptCertNoSuchAlgorithmFailure + case 2: self = .decryptCertNoSuchPaddingFailure + case 3: self = .decryptCertInvalidKeyFailure + case 4: self = .decryptCertInvalidAlgorithmParameterFailure + case 5: self = .decryptCertIllegalBlockSizeFailure + case 6: self = .decryptCertBadPaddingFailure + default: return nil + } + } + + var rawValue: Int { + switch self { + case .decryptCertUnknownFailure: return 0 + case .decryptCertNoSuchAlgorithmFailure: return 1 + case .decryptCertNoSuchPaddingFailure: return 2 + case .decryptCertInvalidKeyFailure: return 3 + case .decryptCertInvalidAlgorithmParameterFailure: return 4 + case .decryptCertIllegalBlockSizeFailure: return 5 + case .decryptCertBadPaddingFailure: return 6 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// Refer to go/qs-contacts-consent-2024 for the detail. +enum Location_Nearby_Proto_Sharing_ContactAccess: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case noContactUploaded // = 1 + case onlyUploadGoogleContact // = 2 + case uploadContactForDeviceContactConsent // = 3 + case uploadContactForQuickShareConsent // = 4 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .noContactUploaded + case 2: self = .onlyUploadGoogleContact + case 3: self = .uploadContactForDeviceContactConsent + case 4: self = .uploadContactForQuickShareConsent + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .noContactUploaded: return 1 + case .onlyUploadGoogleContact: return 2 + case .uploadContactForDeviceContactConsent: return 3 + case .uploadContactForQuickShareConsent: return 4 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ContactAccess: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// Refer to go/qs-contacts-consent-2024 for the detail. +enum Location_Nearby_Proto_Sharing_IdentityVerification: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case noPhoneNumberVerified // = 1 + case phoneNumberVerifiedNotLinkedToGaia // = 2 + case phoneNumberVerifiedLinkedToQsGaia // = 3 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .noPhoneNumberVerified + case 2: self = .phoneNumberVerifiedNotLinkedToGaia + case 3: self = .phoneNumberVerifiedLinkedToQsGaia + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .noPhoneNumberVerified: return 1 + case .phoneNumberVerifiedNotLinkedToGaia: return 2 + case .phoneNumberVerifiedLinkedToQsGaia: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_IdentityVerification: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +enum Location_Nearby_Proto_Sharing_ButtonStatus: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case clickAccept // = 1 + case clickReject // = 2 + case ignore // = 3 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .clickAccept + case 2: self = .clickReject + case 3: self = .ignore + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .clickAccept: return 1 + case .clickReject: return 2 + case .ignore: return 3 + } + } + +} + +#if swift(>=4.2) + +extension Location_Nearby_Proto_Sharing_ButtonStatus: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +#if swift(>=5.5) && canImport(_Concurrency) +extension Location_Nearby_Proto_Sharing_EventType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_EventCategory: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_NearbySharingStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_Visibility: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_DataUsage: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_EstablishConnectionStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ConnectionLayerStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_SessionStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ResponseToIntroduction: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_DeviceType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_OSType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_DeviceRelationship: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_LogSource: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ServerActionName: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ServerResponseState: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_SyncPurpose: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ClientRole: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ScanType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ParsingFailedType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_AdvertisingMode: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_DiscoveryMode: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ActivityName: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ConsentType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ApkSource: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_InstallAPKStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_VerifyAPKStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ShowNotificationStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_PermissionRequestResult: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_PermissionRequestType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_SharingUseCase: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_AppCrashReason: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_AttachmentSourceType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_PreferencesAction: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_PreferencesActionStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_FastInitState: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_FastInitType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_DesktopNotification: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_DesktopTransferEventType: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ContactAccess: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_IdentityVerification: @unchecked Sendable {} +extension Location_Nearby_Proto_Sharing_ButtonStatus: @unchecked Sendable {} +#endif // swift(>=5.5) && canImport(_Concurrency) + +// MARK: - Code below here is support for the SwiftProtobuf runtime. + +extension Location_Nearby_Proto_Sharing_EventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_EVENT_TYPE"), + 1: .same(proto: "ACCEPT_AGREEMENTS"), + 2: .same(proto: "ENABLE_NEARBY_SHARING"), + 3: .same(proto: "SET_VISIBILITY"), + 4: .same(proto: "DESCRIBE_ATTACHMENTS"), + 5: .same(proto: "SCAN_FOR_SHARE_TARGETS_START"), + 6: .same(proto: "SCAN_FOR_SHARE_TARGETS_END"), + 7: .same(proto: "ADVERTISE_DEVICE_PRESENCE_START"), + 8: .same(proto: "ADVERTISE_DEVICE_PRESENCE_END"), + 9: .same(proto: "SEND_FAST_INITIALIZATION"), + 10: .same(proto: "RECEIVE_FAST_INITIALIZATION"), + 11: .same(proto: "DISCOVER_SHARE_TARGET"), + 12: .same(proto: "SEND_INTRODUCTION"), + 13: .same(proto: "RECEIVE_INTRODUCTION"), + 14: .same(proto: "RESPOND_TO_INTRODUCTION"), + 15: .same(proto: "SEND_ATTACHMENTS_START"), + 16: .same(proto: "SEND_ATTACHMENTS_END"), + 17: .same(proto: "RECEIVE_ATTACHMENTS_START"), + 18: .same(proto: "RECEIVE_ATTACHMENTS_END"), + 19: .same(proto: "CANCEL_SENDING_ATTACHMENTS"), + 20: .same(proto: "CANCEL_RECEIVING_ATTACHMENTS"), + 21: .same(proto: "OPEN_RECEIVED_ATTACHMENTS"), + 22: .same(proto: "LAUNCH_SETUP_ACTIVITY"), + 23: .same(proto: "ADD_CONTACT"), + 24: .same(proto: "REMOVE_CONTACT"), + 25: .same(proto: "FAST_SHARE_SERVER_RESPONSE"), + 26: .same(proto: "SEND_START"), + 27: .same(proto: "ACCEPT_FAST_INITIALIZATION"), + 28: .same(proto: "SET_DATA_USAGE"), + 29: .same(proto: "DISMISS_FAST_INITIALIZATION"), + 30: .same(proto: "CANCEL_CONNECTION"), + 31: .same(proto: "LAUNCH_ACTIVITY"), + 32: .same(proto: "DISMISS_PRIVACY_NOTIFICATION"), + 33: .same(proto: "TAP_PRIVACY_NOTIFICATION"), + 34: .same(proto: "TAP_HELP"), + 35: .same(proto: "TAP_FEEDBACK"), + 36: .same(proto: "ADD_QUICK_SETTINGS_TILE"), + 37: .same(proto: "REMOVE_QUICK_SETTINGS_TILE"), + 38: .same(proto: "LAUNCH_PHONE_CONSENT"), + 39: .same(proto: "TAP_QUICK_SETTINGS_TILE"), + 40: .same(proto: "INSTALL_APK"), + 41: .same(proto: "VERIFY_APK"), + 42: .same(proto: "LAUNCH_CONSENT"), + 43: .same(proto: "PROCESS_RECEIVED_ATTACHMENTS_END"), + 44: .same(proto: "TOGGLE_SHOW_NOTIFICATION"), + 45: .same(proto: "SET_DEVICE_NAME"), + 46: .same(proto: "DECLINE_AGREEMENTS"), + 47: .same(proto: "REQUEST_SETTING_PERMISSIONS"), + 48: .same(proto: "ESTABLISH_CONNECTION"), + 49: .same(proto: "DEVICE_SETTINGS"), + 50: .same(proto: "AUTO_DISMISS_FAST_INITIALIZATION"), + 51: .same(proto: "APP_CRASH"), + 52: .same(proto: "TAP_QUICK_SETTINGS_FILE_SHARE"), + 53: .same(proto: "DISPLAY_PRIVACY_NOTIFICATION"), + 54: .same(proto: "DISPLAY_PHONE_CONSENT"), + 55: .same(proto: "PREFERENCES_USAGE"), + 56: .same(proto: "DEFAULT_OPT_IN"), + 57: .same(proto: "SETUP_WIZARD"), + 58: .same(proto: "TAP_QR_CODE"), + 59: .same(proto: "QR_CODE_LINK_SHOWN"), + 60: .same(proto: "PARSING_FAILED_ENDPOINT_ID"), + 61: .same(proto: "FAST_INIT_DISCOVER_DEVICE"), + 62: .same(proto: "SEND_DESKTOP_NOTIFICATION"), + 63: .same(proto: "SET_ACCOUNT"), + 64: .same(proto: "DECRYPT_CERTIFICATE_FAILURE"), + 65: .same(proto: "SHOW_ALLOW_PERMISSION_AUTO_ACCESS"), + 66: .same(proto: "SEND_DESKTOP_TRANSFER_EVENT"), + 67: .same(proto: "WAITING_FOR_ACCEPT"), + 68: .same(proto: "HIGH_QUALITY_MEDIUM_SETUP"), + 69: .same(proto: "RPC_CALL_STATUS"), + 70: .same(proto: "START_QR_CODE_SESSION"), + 71: .same(proto: "QR_CODE_OPENED_IN_WEB_CLIENT"), + 72: .same(proto: "HATS_JOINT_EVENT"), + 73: .same(proto: "RECEIVE_PREVIEWS"), + ] +} + +extension Location_Nearby_Proto_Sharing_EventCategory: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_EVENT_CATEGORY"), + 1: .same(proto: "SENDING_EVENT"), + 2: .same(proto: "RECEIVING_EVENT"), + 3: .same(proto: "SETTINGS_EVENT"), + 4: .same(proto: "RPC_EVENT"), + ] +} + +extension Location_Nearby_Proto_Sharing_NearbySharingStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_NEARBY_SHARING_STATUS"), + 1: .same(proto: "ON"), + 2: .same(proto: "OFF"), + ] +} + +extension Location_Nearby_Proto_Sharing_Visibility: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_VISIBILITY"), + 1: .same(proto: "CONTACTS_ONLY"), + 2: .same(proto: "EVERYONE"), + 3: .same(proto: "SELECTED_CONTACTS_ONLY"), + 4: .same(proto: "HIDDEN"), + 5: .same(proto: "SELF_SHARE"), + ] +} + +extension Location_Nearby_Proto_Sharing_DataUsage: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_DATA_USAGE"), + 1: .same(proto: "ONLINE"), + 2: .same(proto: "WIFI_ONLY"), + 3: .same(proto: "OFFLINE"), + ] +} + +extension Location_Nearby_Proto_Sharing_EstablishConnectionStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CONNECTION_STATUS_UNKNOWN"), + 1: .same(proto: "CONNECTION_STATUS_SUCCESS"), + 2: .same(proto: "CONNECTION_STATUS_FAILURE"), + 3: .same(proto: "CONNECTION_STATUS_CANCELLATION"), + 4: .same(proto: "CONNECTION_STATUS_MEDIA_UNAVAILABLE_ATTACHMENT"), + 5: .same(proto: "CONNECTION_STATUS_FAILED_PAIRED_KEYHANDSHAKE"), + 6: .same(proto: "CONNECTION_STATUS_FAILED_WRITE_INTRODUCTION"), + 7: .same(proto: "CONNECTION_STATUS_FAILED_NULL_CONNECTION"), + 8: .same(proto: "CONNECTION_STATUS_FAILED_NO_TRANSFER_UPDATE_CALLBACK"), + 9: .same(proto: "CONNECTION_STATUS_LOST_CONNECTIVITY"), + 10: .same(proto: "CONNECTION_STATUS_INVALID_ADVERTISEMENT"), + ] +} + +extension Location_Nearby_Proto_Sharing_AttachmentTransmissionStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_ATTACHMENT_TRANSMISSION_STATUS"), + 1: .same(proto: "COMPLETE_ATTACHMENT_TRANSMISSION_STATUS"), + 2: .same(proto: "CANCELED_ATTACHMENT_TRANSMISSION_STATUS"), + 3: .same(proto: "FAILED_ATTACHMENT_TRANSMISSION_STATUS"), + 4: .same(proto: "REJECTED_ATTACHMENT"), + 5: .same(proto: "TIMED_OUT_ATTACHMENT"), + 6: .same(proto: "AWAITING_REMOTE_ACCEPTANCE_FAILED_ATTACHMENT"), + 7: .same(proto: "NOT_ENOUGH_SPACE_ATTACHMENT"), + 8: .same(proto: "FAILED_NO_TRANSFER_UPDATE_CALLBACK"), + 9: .same(proto: "MEDIA_UNAVAILABLE_ATTACHMENT"), + 10: .same(proto: "UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT"), + 11: .same(proto: "NO_ATTACHMENT_FOUND"), + 12: .same(proto: "FAILED_NO_SHARE_TARGET_ENDPOINT"), + 13: .same(proto: "FAILED_PAIRED_KEYHANDSHAKE"), + 14: .same(proto: "FAILED_NULL_CONNECTION"), + 15: .same(proto: "FAILED_NO_PAYLOAD"), + 16: .same(proto: "FAILED_WRITE_INTRODUCTION"), + 17: .same(proto: "FAILED_UNKNOWN_REMOTE_RESPONSE"), + 18: .same(proto: "FAILED_NULL_CONNECTION_INIT_OUTGOING"), + 19: .same(proto: "FAILED_NULL_CONNECTION_DISCONNECTED"), + 20: .same(proto: "FAILED_NULL_CONNECTION_LOST_CONNECTIVITY"), + 21: .same(proto: "FAILED_NULL_CONNECTION_FAILURE"), + 22: .same(proto: "REJECTED_ATTACHMENT_TRANSMISSION_STATUS"), + 23: .same(proto: "TIMED_OUT_ATTACHMENT_TRANSMISSION_STATUS"), + 24: .same(proto: "NOT_ENOUGH_SPACE_ATTACHMENT_TRANSMISSION_STATUS"), + 25: .same(proto: "UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT_TRANSMISSION_STATUS"), + 26: .same(proto: "FAILED_UNKNOWN_REMOTE_RESPONSE_TRANSMISSION_STATUS"), + 27: .same(proto: "NO_RESPONSE_FRAME_CONNECTION_CLOSED_LOST_CONNECTIVITY_TRANSMISSION_STATUS"), + 28: .same(proto: "NO_RESPONSE_FRAME_CONNECTION_CLOSED_TRANSMISSION_STATUS"), + 29: .same(proto: "LOST_CONNECTIVITY_TRANSMISSION_STATUS"), + 30: .same(proto: "FAILED_DISALLOWED_MEDIUM"), + ] +} + +extension Location_Nearby_Proto_Sharing_ConnectionLayerStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CONNECTION_LAYER_STATUS_UNKNOWN"), + 1: .same(proto: "CONNECTION_LAYER_STATUS_SUCCESS"), + 2: .same(proto: "CONNECTION_LAYER_STATUS_ERROR"), + 3: .same(proto: "CONNECTION_LAYER_STATUS_OUT_OF_ORDER_API_CALL"), + 4: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_HAVE_ACTIVE_STRATEGY"), + 5: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_ADVERTISING"), + 6: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_DISCOVERING"), + 7: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_LISTENING"), + 8: .same(proto: "CONNECTION_LAYER_STATUS_END_POINT_IO_ERROR"), + 9: .same(proto: "CONNECTION_LAYER_STATUS_END_POINT_UNKNOWN"), + 10: .same(proto: "CONNECTION_LAYER_STATUS_CONNECTION_REJECTED"), + 11: .same(proto: "CONNECTION_LAYER_STATUS_ALREADY_CONNECTED_TO_END_POINT"), + 12: .same(proto: "CONNECTION_LAYER_STATUS_NOT_CONNECTED_TO_END_POINT"), + 13: .same(proto: "CONNECTION_LAYER_STATUS_BLUETOOTH_ERROR"), + 14: .same(proto: "CONNECTION_LAYER_STATUS_BLE_ERROR"), + 15: .same(proto: "CONNECTION_LAYER_STATUS_WIFI_LAN_ERROR"), + 16: .same(proto: "CONNECTION_LAYER_STATUS_PAYLOAD_UNKNOWN"), + 17: .same(proto: "CONNECTION_LAYER_STATUS_RESET"), + 18: .same(proto: "CONNECTION_LAYER_STATUS_TIMEOUT"), + ] +} + +extension Location_Nearby_Proto_Sharing_ProcessReceivedAttachmentsStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "PROCESSING_STATUS_UNKNOWN"), + 1: .same(proto: "PROCESSING_STATUS_COMPLETE_PROCESSING_ATTACHMENTS"), + 2: .same(proto: "PROCESSING_STATUS_FAILED_MOVING_FILES"), + 3: .same(proto: "PROCESSING_STATUS_FAILED_RECEIVING_APK"), + 4: .same(proto: "PROCESSING_STATUS_FAILED_RECEIVING_TEXT"), + 5: .same(proto: "PROCESSING_STATUS_FAILED_RECEIVING_WIFI_CREDENTIALS"), + ] +} + +extension Location_Nearby_Proto_Sharing_SessionStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_SESSION_STATUS"), + 1: .same(proto: "SUCCEEDED_SESSION_STATUS"), + 2: .same(proto: "FAILED_SESSION_STATUS"), + ] +} + +extension Location_Nearby_Proto_Sharing_ResponseToIntroduction: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_RESPONSE_TO_INTRODUCTION"), + 1: .same(proto: "ACCEPT_INTRODUCTION"), + 2: .same(proto: "REJECT_INTRODUCTION"), + 3: .same(proto: "FAIL_INTRODUCTION"), + ] +} + +extension Location_Nearby_Proto_Sharing_DeviceType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_DEVICE_TYPE"), + 1: .same(proto: "PHONE"), + 2: .same(proto: "TABLET"), + 3: .same(proto: "LAPTOP"), + 4: .same(proto: "CAR"), + 5: .same(proto: "FOLDABLE"), + 6: .same(proto: "XR"), + ] +} + +extension Location_Nearby_Proto_Sharing_OSType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_OS_TYPE"), + 1: .same(proto: "ANDROID"), + 2: .same(proto: "CHROME_OS"), + 3: .same(proto: "IOS"), + 4: .same(proto: "WINDOWS"), + 5: .same(proto: "MACOS"), + ] +} + +extension Location_Nearby_Proto_Sharing_DeviceRelationship: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_DEVICE_RELATIONSHIP"), + 1: .same(proto: "IS_SELF"), + 2: .same(proto: "IS_CONTACT"), + 3: .same(proto: "IS_STRANGER"), + ] +} + +extension Location_Nearby_Proto_Sharing_LogSource: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNSPECIFIED_SOURCE"), + 1: .same(proto: "LAB_DEVICES"), + 2: .same(proto: "INTERNAL_DEVICES"), + 3: .same(proto: "BETA_TESTER_DEVICES"), + 4: .same(proto: "OEM_DEVICES"), + 5: .same(proto: "DEBUG_DEVICES"), + 6: .same(proto: "NEARBY_MODULE_FOOD_DEVICES"), + 7: .same(proto: "BETO_DOGFOOD_DEVICES"), + 8: .same(proto: "NEARBY_DOGFOOD_DEVICES"), + 9: .same(proto: "NEARBY_TEAMFOOD_DEVICES"), + ] +} + +extension Location_Nearby_Proto_Sharing_ServerActionName: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_SERVER_ACTION"), + 1: .same(proto: "UPLOAD_CERTIFICATES"), + 2: .same(proto: "DOWNLOAD_CERTIFICATES"), + 3: .same(proto: "CHECK_REACHABILITY"), + 4: .same(proto: "UPLOAD_CONTACTS"), + 5: .same(proto: "UPDATE_DEVICE_NAME"), + 6: .same(proto: "UPLOAD_SENDER_CERTIFICATES"), + 7: .same(proto: "DOWNLOAD_SENDER_CERTIFICATES"), + 8: .same(proto: "UPLOAD_CONTACTS_AND_CERTIFICATES"), + 9: .same(proto: "LIST_REACHABLE_PHONE_NUMBERS"), + 10: .same(proto: "LIST_MY_DEVICES"), + 11: .same(proto: "LIST_CONTACT_PEOPLE"), + 12: .same(proto: "DOWNLOAD_CERTIFICATES_INFO"), + ] +} + +extension Location_Nearby_Proto_Sharing_ServerResponseState: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_SERVER_RESPONSE_STATE"), + 1: .same(proto: "SERVER_RESPONSE_SUCCESS"), + 2: .same(proto: "SERVER_RESPONSE_UNKNOWN_FAILURE"), + 3: .same(proto: "SERVER_RESPONSE_STATUS_OTHER_FAILURE"), + 4: .same(proto: "SERVER_RESPONSE_STATUS_DEADLINE_EXCEEDED"), + 5: .same(proto: "SERVER_RESPONSE_STATUS_PERMISSION_DENIED"), + 6: .same(proto: "SERVER_RESPONSE_STATUS_UNAVAILABLE"), + 7: .same(proto: "SERVER_RESPONSE_STATUS_UNAUTHENTICATED"), + 8: .same(proto: "SERVER_RESPONSE_GOOGLE_AUTH_FAILURE"), + 9: .same(proto: "SERVER_RESPONSE_STATUS_INVALID_ARGUMENT"), + 10: .same(proto: "SERVER_RESPONSE_NOT_CONNECTED_TO_INTERNET"), + ] +} + +extension Location_Nearby_Proto_Sharing_SyncPurpose: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "SYNC_PURPOSE_UNKNOWN"), + 1: .same(proto: "SYNC_PURPOSE_ON_DEMAND_SYNC"), + 2: .same(proto: "SYNC_PURPOSE_CHIME_NOTIFICATION"), + 3: .same(proto: "SYNC_PURPOSE_DAILY_SYNC"), + 4: .same(proto: "SYNC_PURPOSE_OPT_IN_FIRST_SYNC"), + 5: .same(proto: "SYNC_PURPOSE_CHECK_DEFAULT_OPT_IN"), + 6: .same(proto: "SYNC_PURPOSE_NEARBY_SHARE_ENABLED"), + 7: .same(proto: "SYNC_PURPOSE_SYNC_AT_FAST_INIT"), + 8: .same(proto: "SYNC_PURPOSE_SYNC_AT_DISCOVERY"), + 9: .same(proto: "SYNC_PURPOSE_SYNC_AT_LOAD_PRIVATE_CERTIFICATE"), + 10: .same(proto: "SYNC_PURPOSE_SYNC_AT_ADVERTISEMENT"), + 11: .same(proto: "SYNC_PURPOSE_CONTACT_LIST_CHANGE"), + 12: .same(proto: "SYNC_PURPOSE_SHOW_C11N_VIEW"), + 13: .same(proto: "SYNC_PURPOSE_REGULAR_CHECK_CONTACT_REACHABILITY"), + 14: .same(proto: "SYNC_PURPOSE_VISIBILITY_SELECTED_CONTACT_CHANGE"), + 15: .same(proto: "SYNC_PURPOSE_ACCOUNT_CHANGE"), + 16: .same(proto: "SYNC_PURPOSE_REGENERATE_CERTIFICATES"), + 17: .same(proto: "SYNC_PURPOSE_DEVICE_CONTACTS_CONSENT_CHANGE"), + ] +} + +extension Location_Nearby_Proto_Sharing_ClientRole: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CLIENT_ROLE_UNKNOWN"), + 1: .same(proto: "CLIENT_ROLE_SENDER"), + 2: .same(proto: "CLIENT_ROLE_RECEIVER"), + ] +} + +extension Location_Nearby_Proto_Sharing_ScanType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_SCAN_TYPE"), + 1: .same(proto: "FOREGROUND_SCAN"), + 2: .same(proto: "FOREGROUND_RETRY_SCAN"), + 3: .same(proto: "DIRECT_SHARE_SCAN"), + 4: .same(proto: "BACKGROUND_SCAN"), + ] +} + +extension Location_Nearby_Proto_Sharing_ParsingFailedType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FAILED_UNKNOWN_TYPE"), + 1: .same(proto: "FAILED_PARSE_ADVERTISEMENT"), + 2: .same(proto: "FAILED_CONVERT_SHARE_TARGET"), + ] +} + +extension Location_Nearby_Proto_Sharing_AdvertisingMode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_ADVERTISING_MODE"), + 1: .same(proto: "SCREEN_OFF_ADVERTISING_MODE"), + 2: .same(proto: "BACKGROUND_ADVERTISING_MODE"), + 3: .same(proto: "MIDGROUND_ADVERTISING_MODE"), + 4: .same(proto: "FOREGROUND_ADVERTISING_MODE"), + 5: .same(proto: "SUSPENDED_ADVERTISING_MODE"), + ] +} + +extension Location_Nearby_Proto_Sharing_DiscoveryMode: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_DISCOVERY_MODE"), + 1: .same(proto: "SCREEN_OFF_DISCOVERY_MODE"), + 2: .same(proto: "BACKGROUND_DISCOVERY_MODE"), + 3: .same(proto: "MIDGROUND_DISCOVERY_MODE"), + 4: .same(proto: "FOREGROUND_DISCOVERY_MODE"), + 5: .same(proto: "SUSPENDED_DISCOVERY_MODE"), + ] +} + +extension Location_Nearby_Proto_Sharing_ActivityName: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_ACTIVITY"), + 1: .same(proto: "SHARE_SHEET_ACTIVITY"), + 2: .same(proto: "SETTINGS_ACTIVITY"), + 3: .same(proto: "RECEIVE_SURFACE_ACTIVITY"), + 4: .same(proto: "SETUP_ACTIVITY"), + 5: .same(proto: "DEVICE_VISIBILITY_ACTIVITY"), + 6: .same(proto: "CONSENTS_ACTIVITY"), + 7: .same(proto: "SET_DEVICE_NAME_DIALOG"), + 8: .same(proto: "SET_DATA_USAGE_DIALOG"), + 9: .same(proto: "QUICK_SETTINGS_ACTIVITY"), + 10: .same(proto: "REMOTE_COPY_SHARE_SHEET_ACTIVITY"), + 11: .same(proto: "SETUP_WIZARD_ACTIVITY"), + 12: .same(proto: "SETTINGS_REVIEW_ACTIVITY"), + ] +} + +extension Location_Nearby_Proto_Sharing_ConsentType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CONSENT_TYPE_UNKNOWN"), + 1: .same(proto: "CONSENT_TYPE_C11N"), + 2: .same(proto: "CONSENT_TYPE_DEVICE_CONTACT"), + ] +} + +extension Location_Nearby_Proto_Sharing_ConsentAcceptanceStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CONSENT_UNKNOWN_ACCEPT_STATUS"), + 1: .same(proto: "CONSENT_ACCEPTED"), + 2: .same(proto: "CONSENT_DECLINED"), + 3: .same(proto: "CONSENT_UNABLE_TO_ENABLE"), + ] +} + +extension Location_Nearby_Proto_Sharing_ApkSource: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_APK_SOURCE"), + 1: .same(proto: "APK_FROM_SD_CARD"), + 2: .same(proto: "INSTALLED_APP"), + ] +} + +extension Location_Nearby_Proto_Sharing_InstallAPKStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_INSTALL_APK_STATUS"), + 1: .same(proto: "FAIL_INSTALLATION"), + 2: .same(proto: "SUCCESS_INSTALLATION"), + ] +} + +extension Location_Nearby_Proto_Sharing_VerifyAPKStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_VERIFY_APK_STATUS"), + 1: .same(proto: "NOT_INSTALLABLE"), + 2: .same(proto: "INSTALLABLE"), + 3: .same(proto: "ALREADY_INSTALLED"), + ] +} + +extension Location_Nearby_Proto_Sharing_ShowNotificationStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN_SHOW_NOTIFICATION_STATUS"), + 1: .same(proto: "SHOW"), + 2: .same(proto: "NOT_SHOW"), + ] +} + +extension Location_Nearby_Proto_Sharing_PermissionRequestResult: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "PERMISSION_UNKNOWN_REQUEST_RESULT"), + 1: .same(proto: "PERMISSION_GRANTED"), + 2: .same(proto: "PERMISSION_REJECTED"), + 3: .same(proto: "PERMISSION_UNABLE_TO_GRANT"), + ] +} + +extension Location_Nearby_Proto_Sharing_PermissionRequestType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "PERMISSION_UNKNOWN_TYPE"), + 1: .same(proto: "PERMISSION_AIRPLANE_MODE_OFF"), + 2: .same(proto: "PERMISSION_WIFI"), + 3: .same(proto: "PERMISSION_BLUETOOTH"), + 4: .same(proto: "PERMISSION_LOCATION"), + 5: .same(proto: "PERMISSION_WIFI_HOTSPOT"), + ] +} + +extension Location_Nearby_Proto_Sharing_SharingUseCase: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "USE_CASE_UNKNOWN"), + 1: .same(proto: "USE_CASE_NEARBY_SHARE"), + 2: .same(proto: "USE_CASE_REMOTE_COPY_PASTE"), + 3: .same(proto: "USE_CASE_WIFI_CREDENTIAL"), + 4: .same(proto: "USE_CASE_APP_SHARE"), + 5: .same(proto: "USE_CASE_QUICK_SETTING_FILE_SHARE"), + 6: .same(proto: "USE_CASE_SETUP_WIZARD"), + 7: .same(proto: "USE_CASE_NEARBY_SHARE_WITH_QR_CODE"), + 8: .same(proto: "USE_CASE_REDIRECTED_FROM_BLUETOOTH_SHARE"), + ] +} + +extension Location_Nearby_Proto_Sharing_AppCrashReason: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "APP_CRASH_REASON_UNKNOWN"), + ] +} + +extension Location_Nearby_Proto_Sharing_AttachmentSourceType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "ATTACHMENT_SOURCE_UNKNOWN"), + 1: .same(proto: "ATTACHMENT_SOURCE_CONTEXT_MENU"), + 2: .same(proto: "ATTACHMENT_SOURCE_DRAG_AND_DROP"), + 3: .same(proto: "ATTACHMENT_SOURCE_SELECT_FILES_BUTTON"), + 4: .same(proto: "ATTACHMENT_SOURCE_PASTE"), + 5: .same(proto: "ATTACHMENT_SOURCE_SELECT_FOLDERS_BUTTON"), + 6: .same(proto: "ATTACHMENT_SOURCE_SHARE_ACTIVATION"), + ] +} + +extension Location_Nearby_Proto_Sharing_PreferencesAction: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "PREFERENCES_ACTION_UNKNOWN"), + 1: .same(proto: "PREFERENCES_ACTION_NO_ACTION"), + 2: .same(proto: "PREFERENCES_ACTION_LOAD_PREFERENCES"), + 3: .same(proto: "PREFERENCES_ACTION_SAVE_PREFERENCESS"), + 4: .same(proto: "PREFERENCES_ACTION_ATTEMPT_LOAD"), + 5: .same(proto: "PREFERENCES_ACTION_RESTORE_FROM_BACKUP"), + 6: .same(proto: "PREFERENCES_ACTION_CREATE_PREFERENCES_PATH"), + 7: .same(proto: "PREFERENCES_ACTION_MAKE_PREFERENCES_BACKUP_FILE"), + 8: .same(proto: "PREFERENCES_ACTION_CHECK_IF_PREFERENCES_PATH_EXISTS"), + 9: .same(proto: "PREFERENCES_ACTION_CHECK_IF_PREFERENCES_INPUT_STREAM_STATUS"), + 10: .same(proto: "PREFERENCES_ACTION_CHECK_IF_PREFERENCES_FILE_IS_CORRUPTED"), + 11: .same(proto: "PREFERENCES_ACTION_CHECK_IF_PREFERENCES_BACKUP_FILE_EXISTS"), + ] +} + +extension Location_Nearby_Proto_Sharing_PreferencesActionStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "PREFERENCES_ACTION_STATUS_UNKNOWN"), + 1: .same(proto: "PREFERENCES_ACTION_STATUS_SUCCESS"), + 2: .same(proto: "PREFERENCES_ACTION_STATUS_FAIL"), + ] +} + +extension Location_Nearby_Proto_Sharing_FastInitState: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FAST_INIT_UNKNOWN_STATE"), + 1: .same(proto: "FAST_INIT_CLOSE_STATE"), + 2: .same(proto: "FAST_INIT_FAR_STATE"), + 3: .same(proto: "FAST_INIT_LOST_STATE"), + ] +} + +extension Location_Nearby_Proto_Sharing_FastInitType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "FAST_INIT_UNKNOWN_TYPE"), + 1: .same(proto: "FAST_INIT_NOTIFY_TYPE"), + 2: .same(proto: "FAST_INIT_SILENT_TYPE"), + ] +} + +extension Location_Nearby_Proto_Sharing_DesktopNotification: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "DESKTOP_NOTIFICATION_UNKNOWN"), + 1: .same(proto: "DESKTOP_NOTIFICATION_CONNECTING"), + 2: .same(proto: "DESKTOP_NOTIFICATION_PROGRESS"), + 3: .same(proto: "DESKTOP_NOTIFICATION_ACCEPT"), + 4: .same(proto: "DESKTOP_NOTIFICATION_RECEIVED"), + 5: .same(proto: "DESKTOP_NOTIFICATION_ERROR"), + ] +} + +extension Location_Nearby_Proto_Sharing_DesktopTransferEventType: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "DESKTOP_TRANSFER_EVENT_TYPE_UNKNOWN"), + 1: .same(proto: "DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ACCEPT"), + 2: .same(proto: "DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_PROGRESS"), + 3: .same(proto: "DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_RECEIVED"), + 4: .same(proto: "DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ERROR"), + 5: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_START"), + 6: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE"), + 7: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_PROGRESS"), + 8: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_SENT"), + 9: .same(proto: "DESKTOP_TRANSFER_EVENT_SEND_TYPE_ERROR"), + ] +} + +extension Location_Nearby_Proto_Sharing_DecryptCertificateFailureStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "DECRYPT_CERT_UNKNOWN_FAILURE"), + 1: .same(proto: "DECRYPT_CERT_NO_SUCH_ALGORITHM_FAILURE"), + 2: .same(proto: "DECRYPT_CERT_NO_SUCH_PADDING_FAILURE"), + 3: .same(proto: "DECRYPT_CERT_INVALID_KEY_FAILURE"), + 4: .same(proto: "DECRYPT_CERT_INVALID_ALGORITHM_PARAMETER_FAILURE"), + 5: .same(proto: "DECRYPT_CERT_ILLEGAL_BLOCK_SIZE_FAILURE"), + 6: .same(proto: "DECRYPT_CERT_BAD_PADDING_FAILURE"), + ] +} + +extension Location_Nearby_Proto_Sharing_ContactAccess: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "CONTACT_ACCESS_UNKNOWN"), + 1: .same(proto: "CONTACT_ACCESS_NO_CONTACT_UPLOADED"), + 2: .same(proto: "CONTACT_ACCESS_ONLY_UPLOAD_GOOGLE_CONTACT"), + 3: .same(proto: "CONTACT_ACCESS_UPLOAD_CONTACT_FOR_DEVICE_CONTACT_CONSENT"), + 4: .same(proto: "CONTACT_ACCESS_UPLOAD_CONTACT_FOR_QUICK_SHARE_CONSENT"), + ] +} + +extension Location_Nearby_Proto_Sharing_IdentityVerification: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "IDENTITY_VERIFICATION_UNKNOWN"), + 1: .same(proto: "IDENTITY_VERIFICATION_NO_PHONE_NUMBER_VERIFIED"), + 2: .same(proto: "IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_NOT_LINKED_TO_GAIA"), + 3: .same(proto: "IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_LINKED_TO_QS_GAIA"), + ] +} + +extension Location_Nearby_Proto_Sharing_ButtonStatus: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "BUTTON_STATUS_UNKNOWN"), + 1: .same(proto: "BUTTON_STATUS_CLICK_ACCEPT"), + 2: .same(proto: "BUTTON_STATUS_CLICK_REJECT"), + 3: .same(proto: "BUTTON_STATUS_IGNORE"), + ] +} diff --git a/NearbyShare/Protobuf/ukey.pb.swift b/NearbyShare/Model/Protobuf/ukey.pb.swift similarity index 100% rename from NearbyShare/Protobuf/ukey.pb.swift rename to NearbyShare/Model/Protobuf/ukey.pb.swift diff --git a/NearbyShare/Protobuf/wire_format.pb.swift b/NearbyShare/Model/Protobuf/wire_format.pb.swift similarity index 55% rename from NearbyShare/Protobuf/wire_format.pb.swift rename to NearbyShare/Model/Protobuf/wire_format.pb.swift index d8c5bd0..a99c16f 100644 --- a/NearbyShare/Protobuf/wire_format.pb.swift +++ b/NearbyShare/Model/Protobuf/wire_format.pb.swift @@ -7,12 +7,19 @@ // For information on using the generated types, please see the documentation: // https://github.com/apple/swift-protobuf/ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Brought from: //depot/google3/location/nearby/sharing/proto/wire_format.proto -// At CL 317565061 +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. import Foundation import SwiftProtobuf @@ -28,7 +35,7 @@ fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAP } /// File metadata. Does not include the actual bytes of the file. -/// NEXT_ID=6 +/// NEXT_ID=10 struct Sharing_Nearby_FileMetadata { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -97,6 +104,37 @@ struct Sharing_Nearby_FileMetadata { /// Clears the value of `id`. Subsequent reads from it will return its default value. mutating func clearID() {self._id = nil} + /// The parent folder. + var parentFolder: String { + get {return _parentFolder ?? String()} + set {_parentFolder = newValue} + } + /// Returns true if `parentFolder` has been explicitly set. + var hasParentFolder: Bool {return self._parentFolder != nil} + /// Clears the value of `parentFolder`. Subsequent reads from it will return its default value. + mutating func clearParentFolder() {self._parentFolder = nil} + + /// A stable identifier for the attachment. Used for receiver to identify same + /// attachment from different transfers. + var attachmentHash: Int64 { + get {return _attachmentHash ?? 0} + set {_attachmentHash = newValue} + } + /// Returns true if `attachmentHash` has been explicitly set. + var hasAttachmentHash: Bool {return self._attachmentHash != nil} + /// Clears the value of `attachmentHash`. Subsequent reads from it will return its default value. + mutating func clearAttachmentHash() {self._attachmentHash = nil} + + /// True, if image in file attachment is sensitive + var isSensitiveContent: Bool { + get {return _isSensitiveContent ?? false} + set {_isSensitiveContent = newValue} + } + /// Returns true if `isSensitiveContent` has been explicitly set. + var hasIsSensitiveContent: Bool {return self._isSensitiveContent != nil} + /// Clears the value of `isSensitiveContent`. Subsequent reads from it will return its default value. + mutating func clearIsSensitiveContent() {self._isSensitiveContent = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() enum TypeEnum: SwiftProtobuf.Enum { @@ -104,8 +142,10 @@ struct Sharing_Nearby_FileMetadata { case unknown // = 0 case image // = 1 case video // = 2 - case app // = 3 + case androidApp // = 3 case audio // = 4 + case document // = 5 + case contactCard // = 6 init() { self = .unknown @@ -116,8 +156,10 @@ struct Sharing_Nearby_FileMetadata { case 0: self = .unknown case 1: self = .image case 2: self = .video - case 3: self = .app + case 3: self = .androidApp case 4: self = .audio + case 5: self = .document + case 6: self = .contactCard default: return nil } } @@ -127,8 +169,10 @@ struct Sharing_Nearby_FileMetadata { case .unknown: return 0 case .image: return 1 case .video: return 2 - case .app: return 3 + case .androidApp: return 3 case .audio: return 4 + case .document: return 5 + case .contactCard: return 6 } } @@ -142,6 +186,9 @@ struct Sharing_Nearby_FileMetadata { fileprivate var _size: Int64? = nil fileprivate var _mimeType: String? = nil fileprivate var _id: Int64? = nil + fileprivate var _parentFolder: String? = nil + fileprivate var _attachmentHash: Int64? = nil + fileprivate var _isSensitiveContent: Bool? = nil } #if swift(>=4.2) @@ -152,7 +199,7 @@ extension Sharing_Nearby_FileMetadata.TypeEnum: CaseIterable { #endif // swift(>=4.2) -/// NEXT_ID=5 +/// NEXT_ID=8 struct Sharing_Nearby_TextMetadata { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -209,6 +256,16 @@ struct Sharing_Nearby_TextMetadata { /// Clears the value of `id`. Subsequent reads from it will return its default value. mutating func clearID() {self._id = nil} + /// True if text is sensitive, e.g. password + var isSensitiveText: Bool { + get {return _isSensitiveText ?? false} + set {_isSensitiveText = newValue} + } + /// Returns true if `isSensitiveText` has been explicitly set. + var hasIsSensitiveText: Bool {return self._isSensitiveText != nil} + /// Clears the value of `isSensitiveText`. Subsequent reads from it will return its default value. + mutating func clearIsSensitiveText() {self._isSensitiveText = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() enum TypeEnum: SwiftProtobuf.Enum { @@ -259,6 +316,7 @@ struct Sharing_Nearby_TextMetadata { fileprivate var _payloadID: Int64? = nil fileprivate var _size: Int64? = nil fileprivate var _id: Int64? = nil + fileprivate var _isSensitiveText: Bool? = nil } #if swift(>=4.2) @@ -269,7 +327,7 @@ extension Sharing_Nearby_TextMetadata.TypeEnum: CaseIterable { #endif // swift(>=4.2) -/// NEXT_ID=5 +/// NEXT_ID=6 struct Sharing_Nearby_WifiCredentialsMetadata { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -324,6 +382,7 @@ struct Sharing_Nearby_WifiCredentialsMetadata { case `open` // = 1 case wpaPsk // = 2 case wep // = 3 + case sae // = 4 init() { self = .unknownSecurityType @@ -335,6 +394,7 @@ struct Sharing_Nearby_WifiCredentialsMetadata { case 1: self = .open case 2: self = .wpaPsk case 3: self = .wep + case 4: self = .sae default: return nil } } @@ -345,6 +405,7 @@ struct Sharing_Nearby_WifiCredentialsMetadata { case .open: return 1 case .wpaPsk: return 2 case .wep: return 3 + case .sae: return 4 } } @@ -366,6 +427,131 @@ extension Sharing_Nearby_WifiCredentialsMetadata.SecurityType: CaseIterable { #endif // swift(>=4.2) +/// NEXT_ID=8 +struct Sharing_Nearby_AppMetadata { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The app name. This will be sent in introduction. + var appName: String { + get {return _appName ?? String()} + set {_appName = newValue} + } + /// Returns true if `appName` has been explicitly set. + var hasAppName: Bool {return self._appName != nil} + /// Clears the value of `appName`. Subsequent reads from it will return its default value. + mutating func clearAppName() {self._appName = nil} + + /// The size of the all split of apks. + var size: Int64 { + get {return _size ?? 0} + set {_size = newValue} + } + /// Returns true if `size` has been explicitly set. + var hasSize: Bool {return self._size != nil} + /// Clears the value of `size`. Subsequent reads from it will return its default value. + mutating func clearSize() {self._size = nil} + + /// The File payload id that will be sent as a follow up containing the + /// apk paths. + var payloadID: [Int64] = [] + + /// A uuid for the attachment. Should be unique across all attachments. + var id: Int64 { + get {return _id ?? 0} + set {_id = newValue} + } + /// Returns true if `id` has been explicitly set. + var hasID: Bool {return self._id != nil} + /// Clears the value of `id`. Subsequent reads from it will return its default value. + mutating func clearID() {self._id = nil} + + /// The name of apk file. This will be sent in introduction. + var fileName: [String] = [] + + /// The size of apk file. This will be sent in introduction. + var fileSize: [Int64] = [] + + /// The package name. This will be sent in introduction. + var packageName: String { + get {return _packageName ?? String()} + set {_packageName = newValue} + } + /// Returns true if `packageName` has been explicitly set. + var hasPackageName: Bool {return self._packageName != nil} + /// Clears the value of `packageName`. Subsequent reads from it will return its default value. + mutating func clearPackageName() {self._packageName = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _appName: String? = nil + fileprivate var _size: Int64? = nil + fileprivate var _id: Int64? = nil + fileprivate var _packageName: String? = nil +} + +/// NEXT_ID=5 +struct Sharing_Nearby_StreamMetadata { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// A human readable description for the stream. + var description_p: String { + get {return _description_p ?? String()} + set {_description_p = newValue} + } + /// Returns true if `description_p` has been explicitly set. + var hasDescription_p: Bool {return self._description_p != nil} + /// Clears the value of `description_p`. Subsequent reads from it will return its default value. + mutating func clearDescription_p() {self._description_p = nil} + + /// The package name of the sending application. + var packageName: String { + get {return _packageName ?? String()} + set {_packageName = newValue} + } + /// Returns true if `packageName` has been explicitly set. + var hasPackageName: Bool {return self._packageName != nil} + /// Clears the value of `packageName`. Subsequent reads from it will return its default value. + mutating func clearPackageName() {self._packageName = nil} + + /// The payload id that will be send as a followup containing the + /// ParcelFileDescriptor. + var payloadID: Int64 { + get {return _payloadID ?? 0} + set {_payloadID = newValue} + } + /// Returns true if `payloadID` has been explicitly set. + var hasPayloadID: Bool {return self._payloadID != nil} + /// Clears the value of `payloadID`. Subsequent reads from it will return its default value. + mutating func clearPayloadID() {self._payloadID = nil} + + /// The human-readable name of the package that should be displayed as + /// attribution if no other information is available (i.e. the package is not + /// installed locally yet). + var attributedAppName: String { + get {return _attributedAppName ?? String()} + set {_attributedAppName = newValue} + } + /// Returns true if `attributedAppName` has been explicitly set. + var hasAttributedAppName: Bool {return self._attributedAppName != nil} + /// Clears the value of `attributedAppName`. Subsequent reads from it will return its default value. + mutating func clearAttributedAppName() {self._attributedAppName = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _description_p: String? = nil + fileprivate var _packageName: String? = nil + fileprivate var _payloadID: Int64? = nil + fileprivate var _attributedAppName: String? = nil +} + /// A frame used when sending messages over the wire. /// NEXT_ID=3 struct Sharing_Nearby_Frame { @@ -435,66 +621,75 @@ extension Sharing_Nearby_Frame.Version: CaseIterable { #endif // swift(>=4.2) -/// NEXT_ID=7 +/// NEXT_ID=8 struct Sharing_Nearby_V1Frame { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for // methods supported on all messages. var type: Sharing_Nearby_V1Frame.FrameType { - get {return _type ?? .unknownFrameType} - set {_type = newValue} + get {return _storage._type ?? .unknownFrameType} + set {_uniqueStorage()._type = newValue} } /// Returns true if `type` has been explicitly set. - var hasType: Bool {return self._type != nil} + var hasType: Bool {return _storage._type != nil} /// Clears the value of `type`. Subsequent reads from it will return its default value. - mutating func clearType() {self._type = nil} + mutating func clearType() {_uniqueStorage()._type = nil} - /// Exactly one of the following fields will be set. + /// At most one of the following fields will be set. var introduction: Sharing_Nearby_IntroductionFrame { - get {return _introduction ?? Sharing_Nearby_IntroductionFrame()} - set {_introduction = newValue} + get {return _storage._introduction ?? Sharing_Nearby_IntroductionFrame()} + set {_uniqueStorage()._introduction = newValue} } /// Returns true if `introduction` has been explicitly set. - var hasIntroduction: Bool {return self._introduction != nil} + var hasIntroduction: Bool {return _storage._introduction != nil} /// Clears the value of `introduction`. Subsequent reads from it will return its default value. - mutating func clearIntroduction() {self._introduction = nil} + mutating func clearIntroduction() {_uniqueStorage()._introduction = nil} var connectionResponse: Sharing_Nearby_ConnectionResponseFrame { - get {return _connectionResponse ?? Sharing_Nearby_ConnectionResponseFrame()} - set {_connectionResponse = newValue} + get {return _storage._connectionResponse ?? Sharing_Nearby_ConnectionResponseFrame()} + set {_uniqueStorage()._connectionResponse = newValue} } /// Returns true if `connectionResponse` has been explicitly set. - var hasConnectionResponse: Bool {return self._connectionResponse != nil} + var hasConnectionResponse: Bool {return _storage._connectionResponse != nil} /// Clears the value of `connectionResponse`. Subsequent reads from it will return its default value. - mutating func clearConnectionResponse() {self._connectionResponse = nil} + mutating func clearConnectionResponse() {_uniqueStorage()._connectionResponse = nil} var pairedKeyEncryption: Sharing_Nearby_PairedKeyEncryptionFrame { - get {return _pairedKeyEncryption ?? Sharing_Nearby_PairedKeyEncryptionFrame()} - set {_pairedKeyEncryption = newValue} + get {return _storage._pairedKeyEncryption ?? Sharing_Nearby_PairedKeyEncryptionFrame()} + set {_uniqueStorage()._pairedKeyEncryption = newValue} } /// Returns true if `pairedKeyEncryption` has been explicitly set. - var hasPairedKeyEncryption: Bool {return self._pairedKeyEncryption != nil} + var hasPairedKeyEncryption: Bool {return _storage._pairedKeyEncryption != nil} /// Clears the value of `pairedKeyEncryption`. Subsequent reads from it will return its default value. - mutating func clearPairedKeyEncryption() {self._pairedKeyEncryption = nil} + mutating func clearPairedKeyEncryption() {_uniqueStorage()._pairedKeyEncryption = nil} var pairedKeyResult: Sharing_Nearby_PairedKeyResultFrame { - get {return _pairedKeyResult ?? Sharing_Nearby_PairedKeyResultFrame()} - set {_pairedKeyResult = newValue} + get {return _storage._pairedKeyResult ?? Sharing_Nearby_PairedKeyResultFrame()} + set {_uniqueStorage()._pairedKeyResult = newValue} } /// Returns true if `pairedKeyResult` has been explicitly set. - var hasPairedKeyResult: Bool {return self._pairedKeyResult != nil} + var hasPairedKeyResult: Bool {return _storage._pairedKeyResult != nil} /// Clears the value of `pairedKeyResult`. Subsequent reads from it will return its default value. - mutating func clearPairedKeyResult() {self._pairedKeyResult = nil} + mutating func clearPairedKeyResult() {_uniqueStorage()._pairedKeyResult = nil} var certificateInfo: Sharing_Nearby_CertificateInfoFrame { - get {return _certificateInfo ?? Sharing_Nearby_CertificateInfoFrame()} - set {_certificateInfo = newValue} + get {return _storage._certificateInfo ?? Sharing_Nearby_CertificateInfoFrame()} + set {_uniqueStorage()._certificateInfo = newValue} } /// Returns true if `certificateInfo` has been explicitly set. - var hasCertificateInfo: Bool {return self._certificateInfo != nil} + var hasCertificateInfo: Bool {return _storage._certificateInfo != nil} /// Clears the value of `certificateInfo`. Subsequent reads from it will return its default value. - mutating func clearCertificateInfo() {self._certificateInfo = nil} + mutating func clearCertificateInfo() {_uniqueStorage()._certificateInfo = nil} + + var progressUpdate: Sharing_Nearby_ProgressUpdateFrame { + get {return _storage._progressUpdate ?? Sharing_Nearby_ProgressUpdateFrame()} + set {_uniqueStorage()._progressUpdate = newValue} + } + /// Returns true if `progressUpdate` has been explicitly set. + var hasProgressUpdate: Bool {return _storage._progressUpdate != nil} + /// Clears the value of `progressUpdate`. Subsequent reads from it will return its default value. + mutating func clearProgressUpdate() {_uniqueStorage()._progressUpdate = nil} var unknownFields = SwiftProtobuf.UnknownStorage() @@ -505,9 +700,14 @@ struct Sharing_Nearby_V1Frame { case response // = 2 case pairedKeyEncryption // = 3 case pairedKeyResult // = 4 + + /// No longer used. case certificateInfo // = 5 case cancel // = 6 + /// No longer used. + case progressUpdate // = 7 + init() { self = .unknownFrameType } @@ -521,6 +721,7 @@ struct Sharing_Nearby_V1Frame { case 4: self = .pairedKeyResult case 5: self = .certificateInfo case 6: self = .cancel + case 7: self = .progressUpdate default: return nil } } @@ -534,6 +735,7 @@ struct Sharing_Nearby_V1Frame { case .pairedKeyResult: return 4 case .certificateInfo: return 5 case .cancel: return 6 + case .progressUpdate: return 7 } } @@ -541,12 +743,7 @@ struct Sharing_Nearby_V1Frame { init() {} - fileprivate var _type: Sharing_Nearby_V1Frame.FrameType? = nil - fileprivate var _introduction: Sharing_Nearby_IntroductionFrame? = nil - fileprivate var _connectionResponse: Sharing_Nearby_ConnectionResponseFrame? = nil - fileprivate var _pairedKeyEncryption: Sharing_Nearby_PairedKeyEncryptionFrame? = nil - fileprivate var _pairedKeyResult: Sharing_Nearby_PairedKeyResultFrame? = nil - fileprivate var _certificateInfo: Sharing_Nearby_CertificateInfoFrame? = nil + fileprivate var _storage = _StorageClass.defaultInstance } #if swift(>=4.2) @@ -559,7 +756,7 @@ extension Sharing_Nearby_V1Frame.FrameType: CaseIterable { /// An introduction packet sent by the sending side. Contains a list of files /// they'd like to share. -/// NEXT_ID=4 +/// NEXT_ID=10 struct Sharing_Nearby_IntroductionFrame { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -581,16 +778,114 @@ struct Sharing_Nearby_IntroductionFrame { var wifiCredentialsMetadata: [Sharing_Nearby_WifiCredentialsMetadata] = [] + var appMetadata: [Sharing_Nearby_AppMetadata] = [] + + var startTransfer: Bool { + get {return _startTransfer ?? false} + set {_startTransfer = newValue} + } + /// Returns true if `startTransfer` has been explicitly set. + var hasStartTransfer: Bool {return self._startTransfer != nil} + /// Clears the value of `startTransfer`. Subsequent reads from it will return its default value. + mutating func clearStartTransfer() {self._startTransfer = nil} + + var streamMetadata: [Sharing_Nearby_StreamMetadata] = [] + + var useCase: Sharing_Nearby_IntroductionFrame.SharingUseCase { + get {return _useCase ?? .unknown} + set {_useCase = newValue} + } + /// Returns true if `useCase` has been explicitly set. + var hasUseCase: Bool {return self._useCase != nil} + /// Clears the value of `useCase`. Subsequent reads from it will return its default value. + mutating func clearUseCase() {self._useCase = nil} + + var previewPayloadIds: [Int64] = [] + var unknownFields = SwiftProtobuf.UnknownStorage() + enum SharingUseCase: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + case nearbyShare // = 1 + case remoteCopy // = 2 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .nearbyShare + case 2: self = .remoteCopy + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .nearbyShare: return 1 + case .remoteCopy: return 2 + } + } + + } + init() {} fileprivate var _requiredPackage: String? = nil + fileprivate var _startTransfer: Bool? = nil + fileprivate var _useCase: Sharing_Nearby_IntroductionFrame.SharingUseCase? = nil +} + +#if swift(>=4.2) + +extension Sharing_Nearby_IntroductionFrame.SharingUseCase: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// A progress update packet sent by the sending side. Contains transfer progress +/// value. NEXT_ID=3 +struct Sharing_Nearby_ProgressUpdateFrame { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var progress: Float { + get {return _progress ?? 0} + set {_progress = newValue} + } + /// Returns true if `progress` has been explicitly set. + var hasProgress: Bool {return self._progress != nil} + /// Clears the value of `progress`. Subsequent reads from it will return its default value. + mutating func clearProgress() {self._progress = nil} + + /// True, if the receiver should start bandwidth upgrade and receiving the + /// payloads. + var startTransfer: Bool { + get {return _startTransfer ?? false} + set {_startTransfer = newValue} + } + /// Returns true if `startTransfer` has been explicitly set. + var hasStartTransfer: Bool {return self._startTransfer != nil} + /// Clears the value of `startTransfer`. Subsequent reads from it will return its default value. + mutating func clearStartTransfer() {self._startTransfer = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _progress: Float? = nil + fileprivate var _startTransfer: Bool? = nil } /// A response packet sent by the receiving side. Accepts or rejects the list of /// files. -/// NEXT_ID=2 +/// NEXT_ID=4 struct Sharing_Nearby_ConnectionResponseFrame { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -606,6 +901,13 @@ struct Sharing_Nearby_ConnectionResponseFrame { /// Clears the value of `status`. Subsequent reads from it will return its default value. mutating func clearStatus() {self._status = nil} + /// Key is attachment hash, value is the details of attachment. + var attachmentDetails: Dictionary = [:] + + /// In the case of a stream attachments, the other side of the pipe. + /// Both sender and receiver should validate matching counts. + var streamMetadata: [Sharing_Nearby_StreamMetadata] = [] + var unknownFields = SwiftProtobuf.UnknownStorage() enum Status: SwiftProtobuf.Enum { @@ -659,8 +961,185 @@ extension Sharing_Nearby_ConnectionResponseFrame.Status: CaseIterable { #endif // swift(>=4.2) -/// A paired key encryption packet sent between devices, contains signed data. +/// Attachment details that sent in ConnectionResponseFrame. /// NEXT_ID=3 +struct Sharing_Nearby_AttachmentDetails { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The attachment family type. + var type: Sharing_Nearby_AttachmentDetails.TypeEnum { + get {return _type ?? .unknown} + set {_type = newValue} + } + /// Returns true if `type` has been explicitly set. + var hasType: Bool {return self._type != nil} + /// Clears the value of `type`. Subsequent reads from it will return its default value. + mutating func clearType() {self._type = nil} + + /// This field is only for FILE type. + var fileAttachmentDetails: Sharing_Nearby_FileAttachmentDetails { + get {return _fileAttachmentDetails ?? Sharing_Nearby_FileAttachmentDetails()} + set {_fileAttachmentDetails = newValue} + } + /// Returns true if `fileAttachmentDetails` has been explicitly set. + var hasFileAttachmentDetails: Bool {return self._fileAttachmentDetails != nil} + /// Clears the value of `fileAttachmentDetails`. Subsequent reads from it will return its default value. + mutating func clearFileAttachmentDetails() {self._fileAttachmentDetails = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + /// LINT.IfChange + enum TypeEnum: SwiftProtobuf.Enum { + typealias RawValue = Int + case unknown // = 0 + + /// Represents FileAttachment. + case file // = 1 + + /// Represents TextAttachment. + case text // = 2 + + /// Represents WifiCredentialsAttachment. + case wifiCredentials // = 3 + + /// Represents AppAttachment. + case app // = 4 + + /// Represents StreamAttachment. + case stream // = 5 + + init() { + self = .unknown + } + + init?(rawValue: Int) { + switch rawValue { + case 0: self = .unknown + case 1: self = .file + case 2: self = .text + case 3: self = .wifiCredentials + case 4: self = .app + case 5: self = .stream + default: return nil + } + } + + var rawValue: Int { + switch self { + case .unknown: return 0 + case .file: return 1 + case .text: return 2 + case .wifiCredentials: return 3 + case .app: return 4 + case .stream: return 5 + } + } + + } + + init() {} + + fileprivate var _type: Sharing_Nearby_AttachmentDetails.TypeEnum? = nil + fileprivate var _fileAttachmentDetails: Sharing_Nearby_FileAttachmentDetails? = nil +} + +#if swift(>=4.2) + +extension Sharing_Nearby_AttachmentDetails.TypeEnum: CaseIterable { + // Support synthesized by the compiler. +} + +#endif // swift(>=4.2) + +/// File attachment details included in ConnectionResponseFrame. +/// NEXT_ID=3 +struct Sharing_Nearby_FileAttachmentDetails { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Existing local file size on receiver side. + var receiverExistingFileSize: Int64 { + get {return _receiverExistingFileSize ?? 0} + set {_receiverExistingFileSize = newValue} + } + /// Returns true if `receiverExistingFileSize` has been explicitly set. + var hasReceiverExistingFileSize: Bool {return self._receiverExistingFileSize != nil} + /// Clears the value of `receiverExistingFileSize`. Subsequent reads from it will return its default value. + mutating func clearReceiverExistingFileSize() {self._receiverExistingFileSize = nil} + + /// The key is attachment hash, a stable identifier for the attachment. + /// Value is list of payload details transferred for the attachment. + var attachmentHashPayloads: Dictionary = [:] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _receiverExistingFileSize: Int64? = nil +} + +/// NEXT_ID=2 +struct Sharing_Nearby_PayloadsDetails { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// The list should be sorted by creation timestamp. + var payloadDetails: [Sharing_Nearby_PayloadDetails] = [] + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} +} + +/// Metadata of a payload file created by Nearby Connections. +/// NEXT_ID=4 +struct Sharing_Nearby_PayloadDetails { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + var id: Int64 { + get {return _id ?? 0} + set {_id = newValue} + } + /// Returns true if `id` has been explicitly set. + var hasID: Bool {return self._id != nil} + /// Clears the value of `id`. Subsequent reads from it will return its default value. + mutating func clearID() {self._id = nil} + + var creationTimestampMillis: Int64 { + get {return _creationTimestampMillis ?? 0} + set {_creationTimestampMillis = newValue} + } + /// Returns true if `creationTimestampMillis` has been explicitly set. + var hasCreationTimestampMillis: Bool {return self._creationTimestampMillis != nil} + /// Clears the value of `creationTimestampMillis`. Subsequent reads from it will return its default value. + mutating func clearCreationTimestampMillis() {self._creationTimestampMillis = nil} + + var size: Int64 { + get {return _size ?? 0} + set {_size = newValue} + } + /// Returns true if `size` has been explicitly set. + var hasSize: Bool {return self._size != nil} + /// Clears the value of `size`. Subsequent reads from it will return its default value. + mutating func clearSize() {self._size = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _id: Int64? = nil + fileprivate var _creationTimestampMillis: Int64? = nil + fileprivate var _size: Int64? = nil +} + +/// A paired key encryption packet sent between devices, contains signed data. +/// NEXT_ID=5 struct Sharing_Nearby_PairedKeyEncryptionFrame { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -696,6 +1175,20 @@ struct Sharing_Nearby_PairedKeyEncryptionFrame { /// Clears the value of `optionalSignedData`. Subsequent reads from it will return its default value. mutating func clearOptionalSignedData() {self._optionalSignedData = nil} + /// An optional QR code handshake data in a byte array format. + /// For incoming connection contains a signature of the UKEY2 + /// token, created with the sender's private key. + /// For outgoing connection contains an HKDF of the connection token and of the + /// UKEY2 token + var qrCodeHandshakeData: Data { + get {return _qrCodeHandshakeData ?? Data()} + set {_qrCodeHandshakeData = newValue} + } + /// Returns true if `qrCodeHandshakeData` has been explicitly set. + var hasQrCodeHandshakeData: Bool {return self._qrCodeHandshakeData != nil} + /// Clears the value of `qrCodeHandshakeData`. Subsequent reads from it will return its default value. + mutating func clearQrCodeHandshakeData() {self._qrCodeHandshakeData = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() init() {} @@ -703,10 +1196,11 @@ struct Sharing_Nearby_PairedKeyEncryptionFrame { fileprivate var _signedData: Data? = nil fileprivate var _secretIDHash: Data? = nil fileprivate var _optionalSignedData: Data? = nil + fileprivate var _qrCodeHandshakeData: Data? = nil } /// A paired key verification result packet sent between devices. -/// NEXT_ID=2 +/// NEXT_ID=3 struct Sharing_Nearby_PairedKeyResultFrame { // SwiftProtobuf.Message conformance is added in an extension below. See the // `Message` and `Message+*Additions` files in the SwiftProtobuf library for @@ -722,6 +1216,16 @@ struct Sharing_Nearby_PairedKeyResultFrame { /// Clears the value of `status`. Subsequent reads from it will return its default value. mutating func clearStatus() {self._status = nil} + /// OS type. + var osType: Location_Nearby_Proto_Sharing_OSType { + get {return _osType ?? .unknownOsType} + set {_osType = newValue} + } + /// Returns true if `osType` has been explicitly set. + var hasOsType: Bool {return self._osType != nil} + /// Clears the value of `osType`. Subsequent reads from it will return its default value. + mutating func clearOsType() {self._osType = nil} + var unknownFields = SwiftProtobuf.UnknownStorage() enum Status: SwiftProtobuf.Enum { @@ -759,6 +1263,7 @@ struct Sharing_Nearby_PairedKeyResultFrame { init() {} fileprivate var _status: Sharing_Nearby_PairedKeyResultFrame.Status? = nil + fileprivate var _osType: Location_Nearby_Proto_Sharing_OSType? = nil } #if swift(>=4.2) @@ -914,6 +1419,29 @@ struct Sharing_Nearby_WifiCredentials { fileprivate var _hiddenSsid: Bool? = nil } +/// NEXT_ID=2 +struct Sharing_Nearby_StreamDetails { + // SwiftProtobuf.Message conformance is added in an extension below. See the + // `Message` and `Message+*Additions` files in the SwiftProtobuf library for + // methods supported on all messages. + + /// Serialized ParcelFileDescriptor for input stream (for the receiver). + var inputStreamParcelFileDescriptorBytes: Data { + get {return _inputStreamParcelFileDescriptorBytes ?? Data()} + set {_inputStreamParcelFileDescriptorBytes = newValue} + } + /// Returns true if `inputStreamParcelFileDescriptorBytes` has been explicitly set. + var hasInputStreamParcelFileDescriptorBytes: Bool {return self._inputStreamParcelFileDescriptorBytes != nil} + /// Clears the value of `inputStreamParcelFileDescriptorBytes`. Subsequent reads from it will return its default value. + mutating func clearInputStreamParcelFileDescriptorBytes() {self._inputStreamParcelFileDescriptorBytes = nil} + + var unknownFields = SwiftProtobuf.UnknownStorage() + + init() {} + + fileprivate var _inputStreamParcelFileDescriptorBytes: Data? = nil +} + #if swift(>=5.5) && canImport(_Concurrency) extension Sharing_Nearby_FileMetadata: @unchecked Sendable {} extension Sharing_Nearby_FileMetadata.TypeEnum: @unchecked Sendable {} @@ -921,19 +1449,29 @@ extension Sharing_Nearby_TextMetadata: @unchecked Sendable {} extension Sharing_Nearby_TextMetadata.TypeEnum: @unchecked Sendable {} extension Sharing_Nearby_WifiCredentialsMetadata: @unchecked Sendable {} extension Sharing_Nearby_WifiCredentialsMetadata.SecurityType: @unchecked Sendable {} +extension Sharing_Nearby_AppMetadata: @unchecked Sendable {} +extension Sharing_Nearby_StreamMetadata: @unchecked Sendable {} extension Sharing_Nearby_Frame: @unchecked Sendable {} extension Sharing_Nearby_Frame.Version: @unchecked Sendable {} extension Sharing_Nearby_V1Frame: @unchecked Sendable {} extension Sharing_Nearby_V1Frame.FrameType: @unchecked Sendable {} extension Sharing_Nearby_IntroductionFrame: @unchecked Sendable {} +extension Sharing_Nearby_IntroductionFrame.SharingUseCase: @unchecked Sendable {} +extension Sharing_Nearby_ProgressUpdateFrame: @unchecked Sendable {} extension Sharing_Nearby_ConnectionResponseFrame: @unchecked Sendable {} extension Sharing_Nearby_ConnectionResponseFrame.Status: @unchecked Sendable {} +extension Sharing_Nearby_AttachmentDetails: @unchecked Sendable {} +extension Sharing_Nearby_AttachmentDetails.TypeEnum: @unchecked Sendable {} +extension Sharing_Nearby_FileAttachmentDetails: @unchecked Sendable {} +extension Sharing_Nearby_PayloadsDetails: @unchecked Sendable {} +extension Sharing_Nearby_PayloadDetails: @unchecked Sendable {} extension Sharing_Nearby_PairedKeyEncryptionFrame: @unchecked Sendable {} extension Sharing_Nearby_PairedKeyResultFrame: @unchecked Sendable {} extension Sharing_Nearby_PairedKeyResultFrame.Status: @unchecked Sendable {} extension Sharing_Nearby_CertificateInfoFrame: @unchecked Sendable {} extension Sharing_Nearby_PublicCertificate: @unchecked Sendable {} extension Sharing_Nearby_WifiCredentials: @unchecked Sendable {} +extension Sharing_Nearby_StreamDetails: @unchecked Sendable {} #endif // swift(>=5.5) && canImport(_Concurrency) // MARK: - Code below here is support for the SwiftProtobuf runtime. @@ -949,6 +1487,9 @@ extension Sharing_Nearby_FileMetadata: SwiftProtobuf.Message, SwiftProtobuf._Mes 4: .same(proto: "size"), 5: .standard(proto: "mime_type"), 6: .same(proto: "id"), + 7: .standard(proto: "parent_folder"), + 8: .standard(proto: "attachment_hash"), + 9: .standard(proto: "is_sensitive_content"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -963,6 +1504,9 @@ extension Sharing_Nearby_FileMetadata: SwiftProtobuf.Message, SwiftProtobuf._Mes case 4: try { try decoder.decodeSingularInt64Field(value: &self._size) }() case 5: try { try decoder.decodeSingularStringField(value: &self._mimeType) }() case 6: try { try decoder.decodeSingularInt64Field(value: &self._id) }() + case 7: try { try decoder.decodeSingularStringField(value: &self._parentFolder) }() + case 8: try { try decoder.decodeSingularInt64Field(value: &self._attachmentHash) }() + case 9: try { try decoder.decodeSingularBoolField(value: &self._isSensitiveContent) }() default: break } } @@ -991,6 +1535,15 @@ extension Sharing_Nearby_FileMetadata: SwiftProtobuf.Message, SwiftProtobuf._Mes try { if let v = self._id { try visitor.visitSingularInt64Field(value: v, fieldNumber: 6) } }() + try { if let v = self._parentFolder { + try visitor.visitSingularStringField(value: v, fieldNumber: 7) + } }() + try { if let v = self._attachmentHash { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 8) + } }() + try { if let v = self._isSensitiveContent { + try visitor.visitSingularBoolField(value: v, fieldNumber: 9) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -1001,6 +1554,9 @@ extension Sharing_Nearby_FileMetadata: SwiftProtobuf.Message, SwiftProtobuf._Mes if lhs._size != rhs._size {return false} if lhs._mimeType != rhs._mimeType {return false} if lhs._id != rhs._id {return false} + if lhs._parentFolder != rhs._parentFolder {return false} + if lhs._attachmentHash != rhs._attachmentHash {return false} + if lhs._isSensitiveContent != rhs._isSensitiveContent {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -1011,8 +1567,10 @@ extension Sharing_Nearby_FileMetadata.TypeEnum: SwiftProtobuf._ProtoNameProvidin 0: .same(proto: "UNKNOWN"), 1: .same(proto: "IMAGE"), 2: .same(proto: "VIDEO"), - 3: .same(proto: "APP"), + 3: .same(proto: "ANDROID_APP"), 4: .same(proto: "AUDIO"), + 5: .same(proto: "DOCUMENT"), + 6: .same(proto: "CONTACT_CARD"), ] } @@ -1024,6 +1582,7 @@ extension Sharing_Nearby_TextMetadata: SwiftProtobuf.Message, SwiftProtobuf._Mes 4: .standard(proto: "payload_id"), 5: .same(proto: "size"), 6: .same(proto: "id"), + 7: .standard(proto: "is_sensitive_text"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1037,6 +1596,7 @@ extension Sharing_Nearby_TextMetadata: SwiftProtobuf.Message, SwiftProtobuf._Mes case 4: try { try decoder.decodeSingularInt64Field(value: &self._payloadID) }() case 5: try { try decoder.decodeSingularInt64Field(value: &self._size) }() case 6: try { try decoder.decodeSingularInt64Field(value: &self._id) }() + case 7: try { try decoder.decodeSingularBoolField(value: &self._isSensitiveText) }() default: break } } @@ -1062,6 +1622,9 @@ extension Sharing_Nearby_TextMetadata: SwiftProtobuf.Message, SwiftProtobuf._Mes try { if let v = self._id { try visitor.visitSingularInt64Field(value: v, fieldNumber: 6) } }() + try { if let v = self._isSensitiveText { + try visitor.visitSingularBoolField(value: v, fieldNumber: 7) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -1071,6 +1634,7 @@ extension Sharing_Nearby_TextMetadata: SwiftProtobuf.Message, SwiftProtobuf._Mes if lhs._payloadID != rhs._payloadID {return false} if lhs._size != rhs._size {return false} if lhs._id != rhs._id {return false} + if lhs._isSensitiveText != rhs._isSensitiveText {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -1146,9 +1710,136 @@ extension Sharing_Nearby_WifiCredentialsMetadata.SecurityType: SwiftProtobuf._Pr 1: .same(proto: "OPEN"), 2: .same(proto: "WPA_PSK"), 3: .same(proto: "WEP"), + 4: .same(proto: "SAE"), ] } +extension Sharing_Nearby_AppMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AppMetadata" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "app_name"), + 2: .same(proto: "size"), + 3: .standard(proto: "payload_id"), + 4: .same(proto: "id"), + 5: .standard(proto: "file_name"), + 6: .standard(proto: "file_size"), + 7: .standard(proto: "package_name"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._appName) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self._size) }() + case 3: try { try decoder.decodeRepeatedInt64Field(value: &self.payloadID) }() + case 4: try { try decoder.decodeSingularInt64Field(value: &self._id) }() + case 5: try { try decoder.decodeRepeatedStringField(value: &self.fileName) }() + case 6: try { try decoder.decodeRepeatedInt64Field(value: &self.fileSize) }() + case 7: try { try decoder.decodeSingularStringField(value: &self._packageName) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._appName { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._size { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + if !self.payloadID.isEmpty { + try visitor.visitPackedInt64Field(value: self.payloadID, fieldNumber: 3) + } + try { if let v = self._id { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 4) + } }() + if !self.fileName.isEmpty { + try visitor.visitRepeatedStringField(value: self.fileName, fieldNumber: 5) + } + if !self.fileSize.isEmpty { + try visitor.visitPackedInt64Field(value: self.fileSize, fieldNumber: 6) + } + try { if let v = self._packageName { + try visitor.visitSingularStringField(value: v, fieldNumber: 7) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Sharing_Nearby_AppMetadata, rhs: Sharing_Nearby_AppMetadata) -> Bool { + if lhs._appName != rhs._appName {return false} + if lhs._size != rhs._size {return false} + if lhs.payloadID != rhs.payloadID {return false} + if lhs._id != rhs._id {return false} + if lhs.fileName != rhs.fileName {return false} + if lhs.fileSize != rhs.fileSize {return false} + if lhs._packageName != rhs._packageName {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Sharing_Nearby_StreamMetadata: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".StreamMetadata" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "description"), + 2: .standard(proto: "package_name"), + 3: .standard(proto: "payload_id"), + 4: .standard(proto: "attributed_app_name"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularStringField(value: &self._description_p) }() + case 2: try { try decoder.decodeSingularStringField(value: &self._packageName) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self._payloadID) }() + case 4: try { try decoder.decodeSingularStringField(value: &self._attributedAppName) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._description_p { + try visitor.visitSingularStringField(value: v, fieldNumber: 1) + } }() + try { if let v = self._packageName { + try visitor.visitSingularStringField(value: v, fieldNumber: 2) + } }() + try { if let v = self._payloadID { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 3) + } }() + try { if let v = self._attributedAppName { + try visitor.visitSingularStringField(value: v, fieldNumber: 4) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Sharing_Nearby_StreamMetadata, rhs: Sharing_Nearby_StreamMetadata) -> Bool { + if lhs._description_p != rhs._description_p {return false} + if lhs._packageName != rhs._packageName {return false} + if lhs._payloadID != rhs._payloadID {return false} + if lhs._attributedAppName != rhs._attributedAppName {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Sharing_Nearby_Frame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".Frame" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ @@ -1207,58 +1898,108 @@ extension Sharing_Nearby_V1Frame: SwiftProtobuf.Message, SwiftProtobuf._MessageI 4: .standard(proto: "paired_key_encryption"), 5: .standard(proto: "paired_key_result"), 6: .standard(proto: "certificate_info"), + 7: .standard(proto: "progress_update"), ] + fileprivate class _StorageClass { + var _type: Sharing_Nearby_V1Frame.FrameType? = nil + var _introduction: Sharing_Nearby_IntroductionFrame? = nil + var _connectionResponse: Sharing_Nearby_ConnectionResponseFrame? = nil + var _pairedKeyEncryption: Sharing_Nearby_PairedKeyEncryptionFrame? = nil + var _pairedKeyResult: Sharing_Nearby_PairedKeyResultFrame? = nil + var _certificateInfo: Sharing_Nearby_CertificateInfoFrame? = nil + var _progressUpdate: Sharing_Nearby_ProgressUpdateFrame? = nil + + static let defaultInstance = _StorageClass() + + private init() {} + + init(copying source: _StorageClass) { + _type = source._type + _introduction = source._introduction + _connectionResponse = source._connectionResponse + _pairedKeyEncryption = source._pairedKeyEncryption + _pairedKeyResult = source._pairedKeyResult + _certificateInfo = source._certificateInfo + _progressUpdate = source._progressUpdate + } + } + + fileprivate mutating func _uniqueStorage() -> _StorageClass { + if !isKnownUniquelyReferenced(&_storage) { + _storage = _StorageClass(copying: _storage) + } + return _storage + } + mutating func decodeMessage(decoder: inout D) throws { - while let fieldNumber = try decoder.nextFieldNumber() { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every case branch when no optimizations are - // enabled. https://github.com/apple/swift-protobuf/issues/1034 - switch fieldNumber { - case 1: try { try decoder.decodeSingularEnumField(value: &self._type) }() - case 2: try { try decoder.decodeSingularMessageField(value: &self._introduction) }() - case 3: try { try decoder.decodeSingularMessageField(value: &self._connectionResponse) }() - case 4: try { try decoder.decodeSingularMessageField(value: &self._pairedKeyEncryption) }() - case 5: try { try decoder.decodeSingularMessageField(value: &self._pairedKeyResult) }() - case 6: try { try decoder.decodeSingularMessageField(value: &self._certificateInfo) }() - default: break + _ = _uniqueStorage() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &_storage._type) }() + case 2: try { try decoder.decodeSingularMessageField(value: &_storage._introduction) }() + case 3: try { try decoder.decodeSingularMessageField(value: &_storage._connectionResponse) }() + case 4: try { try decoder.decodeSingularMessageField(value: &_storage._pairedKeyEncryption) }() + case 5: try { try decoder.decodeSingularMessageField(value: &_storage._pairedKeyResult) }() + case 6: try { try decoder.decodeSingularMessageField(value: &_storage._certificateInfo) }() + case 7: try { try decoder.decodeSingularMessageField(value: &_storage._progressUpdate) }() + default: break + } } } } func traverse(visitor: inout V) throws { - // The use of inline closures is to circumvent an issue where the compiler - // allocates stack space for every if/case branch local when no optimizations - // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and - // https://github.com/apple/swift-protobuf/issues/1182 - try { if let v = self._type { - try visitor.visitSingularEnumField(value: v, fieldNumber: 1) - } }() - try { if let v = self._introduction { - try visitor.visitSingularMessageField(value: v, fieldNumber: 2) - } }() - try { if let v = self._connectionResponse { - try visitor.visitSingularMessageField(value: v, fieldNumber: 3) - } }() - try { if let v = self._pairedKeyEncryption { - try visitor.visitSingularMessageField(value: v, fieldNumber: 4) - } }() - try { if let v = self._pairedKeyResult { - try visitor.visitSingularMessageField(value: v, fieldNumber: 5) - } }() - try { if let v = self._certificateInfo { - try visitor.visitSingularMessageField(value: v, fieldNumber: 6) - } }() + try withExtendedLifetime(_storage) { (_storage: _StorageClass) in + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = _storage._type { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + try { if let v = _storage._introduction { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try { if let v = _storage._connectionResponse { + try visitor.visitSingularMessageField(value: v, fieldNumber: 3) + } }() + try { if let v = _storage._pairedKeyEncryption { + try visitor.visitSingularMessageField(value: v, fieldNumber: 4) + } }() + try { if let v = _storage._pairedKeyResult { + try visitor.visitSingularMessageField(value: v, fieldNumber: 5) + } }() + try { if let v = _storage._certificateInfo { + try visitor.visitSingularMessageField(value: v, fieldNumber: 6) + } }() + try { if let v = _storage._progressUpdate { + try visitor.visitSingularMessageField(value: v, fieldNumber: 7) + } }() + } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Sharing_Nearby_V1Frame, rhs: Sharing_Nearby_V1Frame) -> Bool { - if lhs._type != rhs._type {return false} - if lhs._introduction != rhs._introduction {return false} - if lhs._connectionResponse != rhs._connectionResponse {return false} - if lhs._pairedKeyEncryption != rhs._pairedKeyEncryption {return false} - if lhs._pairedKeyResult != rhs._pairedKeyResult {return false} - if lhs._certificateInfo != rhs._certificateInfo {return false} + if lhs._storage !== rhs._storage { + let storagesAreEqual: Bool = withExtendedLifetime((lhs._storage, rhs._storage)) { (_args: (_StorageClass, _StorageClass)) in + let _storage = _args.0 + let rhs_storage = _args.1 + if _storage._type != rhs_storage._type {return false} + if _storage._introduction != rhs_storage._introduction {return false} + if _storage._connectionResponse != rhs_storage._connectionResponse {return false} + if _storage._pairedKeyEncryption != rhs_storage._pairedKeyEncryption {return false} + if _storage._pairedKeyResult != rhs_storage._pairedKeyResult {return false} + if _storage._certificateInfo != rhs_storage._certificateInfo {return false} + if _storage._progressUpdate != rhs_storage._progressUpdate {return false} + return true + } + if !storagesAreEqual {return false} + } if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -1273,6 +2014,7 @@ extension Sharing_Nearby_V1Frame.FrameType: SwiftProtobuf._ProtoNameProviding { 4: .same(proto: "PAIRED_KEY_RESULT"), 5: .same(proto: "CERTIFICATE_INFO"), 6: .same(proto: "CANCEL"), + 7: .same(proto: "PROGRESS_UPDATE"), ] } @@ -1283,6 +2025,11 @@ extension Sharing_Nearby_IntroductionFrame: SwiftProtobuf.Message, SwiftProtobuf 2: .standard(proto: "text_metadata"), 3: .standard(proto: "required_package"), 4: .standard(proto: "wifi_credentials_metadata"), + 5: .standard(proto: "app_metadata"), + 6: .standard(proto: "start_transfer"), + 7: .standard(proto: "stream_metadata"), + 8: .standard(proto: "use_case"), + 9: .standard(proto: "preview_payload_ids"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1295,6 +2042,11 @@ extension Sharing_Nearby_IntroductionFrame: SwiftProtobuf.Message, SwiftProtobuf case 2: try { try decoder.decodeRepeatedMessageField(value: &self.textMetadata) }() case 3: try { try decoder.decodeSingularStringField(value: &self._requiredPackage) }() case 4: try { try decoder.decodeRepeatedMessageField(value: &self.wifiCredentialsMetadata) }() + case 5: try { try decoder.decodeRepeatedMessageField(value: &self.appMetadata) }() + case 6: try { try decoder.decodeSingularBoolField(value: &self._startTransfer) }() + case 7: try { try decoder.decodeRepeatedMessageField(value: &self.streamMetadata) }() + case 8: try { try decoder.decodeSingularEnumField(value: &self._useCase) }() + case 9: try { try decoder.decodeRepeatedInt64Field(value: &self.previewPayloadIds) }() default: break } } @@ -1317,6 +2069,21 @@ extension Sharing_Nearby_IntroductionFrame: SwiftProtobuf.Message, SwiftProtobuf if !self.wifiCredentialsMetadata.isEmpty { try visitor.visitRepeatedMessageField(value: self.wifiCredentialsMetadata, fieldNumber: 4) } + if !self.appMetadata.isEmpty { + try visitor.visitRepeatedMessageField(value: self.appMetadata, fieldNumber: 5) + } + try { if let v = self._startTransfer { + try visitor.visitSingularBoolField(value: v, fieldNumber: 6) + } }() + if !self.streamMetadata.isEmpty { + try visitor.visitRepeatedMessageField(value: self.streamMetadata, fieldNumber: 7) + } + try { if let v = self._useCase { + try visitor.visitSingularEnumField(value: v, fieldNumber: 8) + } }() + if !self.previewPayloadIds.isEmpty { + try visitor.visitRepeatedInt64Field(value: self.previewPayloadIds, fieldNumber: 9) + } try unknownFields.traverse(visitor: &visitor) } @@ -1325,6 +2092,61 @@ extension Sharing_Nearby_IntroductionFrame: SwiftProtobuf.Message, SwiftProtobuf if lhs.textMetadata != rhs.textMetadata {return false} if lhs._requiredPackage != rhs._requiredPackage {return false} if lhs.wifiCredentialsMetadata != rhs.wifiCredentialsMetadata {return false} + if lhs.appMetadata != rhs.appMetadata {return false} + if lhs._startTransfer != rhs._startTransfer {return false} + if lhs.streamMetadata != rhs.streamMetadata {return false} + if lhs._useCase != rhs._useCase {return false} + if lhs.previewPayloadIds != rhs.previewPayloadIds {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Sharing_Nearby_IntroductionFrame.SharingUseCase: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN"), + 1: .same(proto: "NEARBY_SHARE"), + 2: .same(proto: "REMOTE_COPY"), + ] +} + +extension Sharing_Nearby_ProgressUpdateFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".ProgressUpdateFrame" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "progress"), + 2: .standard(proto: "start_transfer"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularFloatField(value: &self._progress) }() + case 2: try { try decoder.decodeSingularBoolField(value: &self._startTransfer) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._progress { + try visitor.visitSingularFloatField(value: v, fieldNumber: 1) + } }() + try { if let v = self._startTransfer { + try visitor.visitSingularBoolField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Sharing_Nearby_ProgressUpdateFrame, rhs: Sharing_Nearby_ProgressUpdateFrame) -> Bool { + if lhs._progress != rhs._progress {return false} + if lhs._startTransfer != rhs._startTransfer {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -1334,6 +2156,8 @@ extension Sharing_Nearby_ConnectionResponseFrame: SwiftProtobuf.Message, SwiftPr static let protoMessageName: String = _protobuf_package + ".ConnectionResponseFrame" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "status"), + 2: .standard(proto: "attachment_details"), + 3: .standard(proto: "stream_metadata"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1343,6 +2167,8 @@ extension Sharing_Nearby_ConnectionResponseFrame: SwiftProtobuf.Message, SwiftPr // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularEnumField(value: &self._status) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.attachmentDetails) }() + case 3: try { try decoder.decodeRepeatedMessageField(value: &self.streamMetadata) }() default: break } } @@ -1356,11 +2182,19 @@ extension Sharing_Nearby_ConnectionResponseFrame: SwiftProtobuf.Message, SwiftPr try { if let v = self._status { try visitor.visitSingularEnumField(value: v, fieldNumber: 1) } }() + if !self.attachmentDetails.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.attachmentDetails, fieldNumber: 2) + } + if !self.streamMetadata.isEmpty { + try visitor.visitRepeatedMessageField(value: self.streamMetadata, fieldNumber: 3) + } try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Sharing_Nearby_ConnectionResponseFrame, rhs: Sharing_Nearby_ConnectionResponseFrame) -> Bool { if lhs._status != rhs._status {return false} + if lhs.attachmentDetails != rhs.attachmentDetails {return false} + if lhs.streamMetadata != rhs.streamMetadata {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -1377,12 +2211,188 @@ extension Sharing_Nearby_ConnectionResponseFrame.Status: SwiftProtobuf._ProtoNam ] } +extension Sharing_Nearby_AttachmentDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".AttachmentDetails" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "type"), + 2: .standard(proto: "file_attachment_details"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularEnumField(value: &self._type) }() + case 2: try { try decoder.decodeSingularMessageField(value: &self._fileAttachmentDetails) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._type { + try visitor.visitSingularEnumField(value: v, fieldNumber: 1) + } }() + try { if let v = self._fileAttachmentDetails { + try visitor.visitSingularMessageField(value: v, fieldNumber: 2) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Sharing_Nearby_AttachmentDetails, rhs: Sharing_Nearby_AttachmentDetails) -> Bool { + if lhs._type != rhs._type {return false} + if lhs._fileAttachmentDetails != rhs._fileAttachmentDetails {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Sharing_Nearby_AttachmentDetails.TypeEnum: SwiftProtobuf._ProtoNameProviding { + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 0: .same(proto: "UNKNOWN"), + 1: .same(proto: "FILE"), + 2: .same(proto: "TEXT"), + 3: .same(proto: "WIFI_CREDENTIALS"), + 4: .same(proto: "APP"), + 5: .same(proto: "STREAM"), + ] +} + +extension Sharing_Nearby_FileAttachmentDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".FileAttachmentDetails" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "receiver_existing_file_size"), + 2: .standard(proto: "attachment_hash_payloads"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self._receiverExistingFileSize) }() + case 2: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: &self.attachmentHashPayloads) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._receiverExistingFileSize { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1) + } }() + if !self.attachmentHashPayloads.isEmpty { + try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap.self, value: self.attachmentHashPayloads, fieldNumber: 2) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Sharing_Nearby_FileAttachmentDetails, rhs: Sharing_Nearby_FileAttachmentDetails) -> Bool { + if lhs._receiverExistingFileSize != rhs._receiverExistingFileSize {return false} + if lhs.attachmentHashPayloads != rhs.attachmentHashPayloads {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Sharing_Nearby_PayloadsDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PayloadsDetails" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "payload_details"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeRepeatedMessageField(value: &self.payloadDetails) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + if !self.payloadDetails.isEmpty { + try visitor.visitRepeatedMessageField(value: self.payloadDetails, fieldNumber: 1) + } + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Sharing_Nearby_PayloadsDetails, rhs: Sharing_Nearby_PayloadsDetails) -> Bool { + if lhs.payloadDetails != rhs.payloadDetails {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + +extension Sharing_Nearby_PayloadDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".PayloadDetails" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .same(proto: "id"), + 2: .standard(proto: "creation_timestamp_millis"), + 3: .same(proto: "size"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularInt64Field(value: &self._id) }() + case 2: try { try decoder.decodeSingularInt64Field(value: &self._creationTimestampMillis) }() + case 3: try { try decoder.decodeSingularInt64Field(value: &self._size) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._id { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 1) + } }() + try { if let v = self._creationTimestampMillis { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 2) + } }() + try { if let v = self._size { + try visitor.visitSingularInt64Field(value: v, fieldNumber: 3) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Sharing_Nearby_PayloadDetails, rhs: Sharing_Nearby_PayloadDetails) -> Bool { + if lhs._id != rhs._id {return false} + if lhs._creationTimestampMillis != rhs._creationTimestampMillis {return false} + if lhs._size != rhs._size {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} + extension Sharing_Nearby_PairedKeyEncryptionFrame: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { static let protoMessageName: String = _protobuf_package + ".PairedKeyEncryptionFrame" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .standard(proto: "signed_data"), 2: .standard(proto: "secret_id_hash"), 3: .standard(proto: "optional_signed_data"), + 4: .standard(proto: "qr_code_handshake_data"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1394,6 +2404,7 @@ extension Sharing_Nearby_PairedKeyEncryptionFrame: SwiftProtobuf.Message, SwiftP case 1: try { try decoder.decodeSingularBytesField(value: &self._signedData) }() case 2: try { try decoder.decodeSingularBytesField(value: &self._secretIDHash) }() case 3: try { try decoder.decodeSingularBytesField(value: &self._optionalSignedData) }() + case 4: try { try decoder.decodeSingularBytesField(value: &self._qrCodeHandshakeData) }() default: break } } @@ -1413,6 +2424,9 @@ extension Sharing_Nearby_PairedKeyEncryptionFrame: SwiftProtobuf.Message, SwiftP try { if let v = self._optionalSignedData { try visitor.visitSingularBytesField(value: v, fieldNumber: 3) } }() + try { if let v = self._qrCodeHandshakeData { + try visitor.visitSingularBytesField(value: v, fieldNumber: 4) + } }() try unknownFields.traverse(visitor: &visitor) } @@ -1420,6 +2434,7 @@ extension Sharing_Nearby_PairedKeyEncryptionFrame: SwiftProtobuf.Message, SwiftP if lhs._signedData != rhs._signedData {return false} if lhs._secretIDHash != rhs._secretIDHash {return false} if lhs._optionalSignedData != rhs._optionalSignedData {return false} + if lhs._qrCodeHandshakeData != rhs._qrCodeHandshakeData {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -1429,6 +2444,7 @@ extension Sharing_Nearby_PairedKeyResultFrame: SwiftProtobuf.Message, SwiftProto static let protoMessageName: String = _protobuf_package + ".PairedKeyResultFrame" static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ 1: .same(proto: "status"), + 2: .standard(proto: "os_type"), ] mutating func decodeMessage(decoder: inout D) throws { @@ -1438,6 +2454,7 @@ extension Sharing_Nearby_PairedKeyResultFrame: SwiftProtobuf.Message, SwiftProto // enabled. https://github.com/apple/swift-protobuf/issues/1034 switch fieldNumber { case 1: try { try decoder.decodeSingularEnumField(value: &self._status) }() + case 2: try { try decoder.decodeSingularEnumField(value: &self._osType) }() default: break } } @@ -1451,11 +2468,15 @@ extension Sharing_Nearby_PairedKeyResultFrame: SwiftProtobuf.Message, SwiftProto try { if let v = self._status { try visitor.visitSingularEnumField(value: v, fieldNumber: 1) } }() + try { if let v = self._osType { + try visitor.visitSingularEnumField(value: v, fieldNumber: 2) + } }() try unknownFields.traverse(visitor: &visitor) } static func ==(lhs: Sharing_Nearby_PairedKeyResultFrame, rhs: Sharing_Nearby_PairedKeyResultFrame) -> Bool { if lhs._status != rhs._status {return false} + if lhs._osType != rhs._osType {return false} if lhs.unknownFields != rhs.unknownFields {return false} return true } @@ -1615,3 +2636,39 @@ extension Sharing_Nearby_WifiCredentials: SwiftProtobuf.Message, SwiftProtobuf._ return true } } + +extension Sharing_Nearby_StreamDetails: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding { + static let protoMessageName: String = _protobuf_package + ".StreamDetails" + static let _protobuf_nameMap: SwiftProtobuf._NameMap = [ + 1: .standard(proto: "input_stream_parcel_file_descriptor_bytes"), + ] + + mutating func decodeMessage(decoder: inout D) throws { + while let fieldNumber = try decoder.nextFieldNumber() { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every case branch when no optimizations are + // enabled. https://github.com/apple/swift-protobuf/issues/1034 + switch fieldNumber { + case 1: try { try decoder.decodeSingularBytesField(value: &self._inputStreamParcelFileDescriptorBytes) }() + default: break + } + } + } + + func traverse(visitor: inout V) throws { + // The use of inline closures is to circumvent an issue where the compiler + // allocates stack space for every if/case branch local when no optimizations + // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and + // https://github.com/apple/swift-protobuf/issues/1182 + try { if let v = self._inputStreamParcelFileDescriptorBytes { + try visitor.visitSingularBytesField(value: v, fieldNumber: 1) + } }() + try unknownFields.traverse(visitor: &visitor) + } + + static func ==(lhs: Sharing_Nearby_StreamDetails, rhs: Sharing_Nearby_StreamDetails) -> Bool { + if lhs._inputStreamParcelFileDescriptorBytes != rhs._inputStreamParcelFileDescriptorBytes {return false} + if lhs.unknownFields != rhs.unknownFields {return false} + return true + } +} diff --git a/NearbyShare/ProtobufSource/device_to_device_messages.proto b/NearbyShare/Model/ProtobufSource/device_to_device_messages.proto similarity index 100% rename from NearbyShare/ProtobufSource/device_to_device_messages.proto rename to NearbyShare/Model/ProtobufSource/device_to_device_messages.proto diff --git a/NearbyShare/ProtobufSource/offline_wire_formats.proto b/NearbyShare/Model/ProtobufSource/offline_wire_formats.proto similarity index 65% rename from NearbyShare/ProtobufSource/offline_wire_formats.proto rename to NearbyShare/Model/ProtobufSource/offline_wire_formats.proto index c112004..afd0ed7 100644 --- a/NearbyShare/ProtobufSource/offline_wire_formats.proto +++ b/NearbyShare/Model/ProtobufSource/offline_wire_formats.proto @@ -16,6 +16,8 @@ syntax = "proto2"; package location.nearby.connections; +// import "storage/datapol/annotations/proto/semantic_annotations.proto"; + option optimize_for = LITE_RUNTIME; option java_outer_classname = "OfflineWireFormatsProto"; option java_package = "com.google.location.nearby.connections.proto"; @@ -43,6 +45,11 @@ message V1Frame { KEEP_ALIVE = 5; DISCONNECTION = 6; PAIRED_KEY_ENCRYPTION = 7; + AUTHENTICATION_MESSAGE = 8; + AUTHENTICATION_RESULT = 9; + AUTO_RESUME = 10; + AUTO_RECONNECT = 11; + BANDWIDTH_UPGRADE_RETRY = 12; } optional FrameType type = 1; @@ -54,6 +61,11 @@ message V1Frame { optional KeepAliveFrame keep_alive = 6; optional DisconnectionFrame disconnection = 7; optional PairedKeyEncryptionFrame paired_key_encryption = 8; + optional AuthenticationMessageFrame authentication_message = 9; + optional AuthenticationResultFrame authentication_result = 10; + optional AutoResumeFrame auto_resume = 11; + optional AutoReconnectFrame auto_reconnect = 12; + optional BandwidthUpgradeRetryFrame bandwidth_upgrade_retry = 13; } message ConnectionRequestFrame { @@ -72,6 +84,15 @@ message ConnectionRequestFrame { WEB_RTC = 9; BLE_L2CAP = 10; USB = 11; + WEB_RTC_NON_CELLULAR = 12; + AWDL = 13; + } + // LINT.ThenChange(//depot/google3/third_party/nearby/proto/connections_enums.proto) + + // LINT.IfChange + enum ConnectionMode { + LEGACY = 0; + INSTANT = 1; } // LINT.ThenChange(//depot/google3/third_party/nearby/proto/connections_enums.proto) @@ -91,9 +112,16 @@ message ConnectionRequestFrame { optional int32 keep_alive_interval_millis = 8; optional int32 keep_alive_timeout_millis = 9; // The type of {@link Device} object. - optional int32 device_type = 10 [default = 0]; + optional int32 device_type = 10 [default = 0, deprecated = true]; // The bytes of serialized {@link Device} object. - optional bytes device_info = 11; + optional bytes device_info = 11 [deprecated = true]; + // Represents the {@link Device} that invokes the request. + oneof Device { + ConnectionsDevice connections_device = 12; + PresenceDevice presence_device = 13; + } + optional ConnectionMode connection_mode = 14; + optional LocationHint location_hint = 15; } message ConnectionResponseFrame { @@ -125,7 +153,10 @@ message ConnectionResponseFrame { // means bt supports multiplex while 0x00 means not. Refer to ClientProxy.java // for the bit usages. optional int32 multiplex_socket_bitmask = 5; - optional int32 nearby_connections_version = 6; + optional int32 nearby_connections_version = 6 [deprecated = true]; + optional int32 safe_to_disconnect_version = 7; + optional LocationHint location_hint = 8; + optional int32 keep_alive_timeout_millis = 9; } message PayloadTransferFrame { @@ -133,6 +164,7 @@ message PayloadTransferFrame { UNKNOWN_PACKET_TYPE = 0; DATA = 1; CONTROL = 2; + PAYLOAD_ACK = 3; } message PayloadHeader { @@ -148,6 +180,8 @@ message PayloadTransferFrame { optional bool is_sensitive = 4; optional string file_name = 5; optional string parent_folder = 6; + // Time since the epoch in milliseconds. + optional int64 last_modified_timestamp_millis = 7; } // Accompanies DATA packets. @@ -158,6 +192,7 @@ message PayloadTransferFrame { optional int32 flags = 1; optional int64 offset = 2; optional bytes body = 3; + optional int32 index = 4; } // Accompanies CONTROL packets. @@ -166,7 +201,8 @@ message PayloadTransferFrame { UNKNOWN_EVENT_TYPE = 0; PAYLOAD_ERROR = 1; PAYLOAD_CANCELED = 2; - PAYLOAD_RECEIVED_ACK = 3; + // Use PacketType.PAYLOAD_ACK instead + PAYLOAD_RECEIVED_ACK = 3 [deprecated = true]; } optional EventType event = 1; @@ -190,6 +226,9 @@ message BandwidthUpgradeNegotiationFrame { CLIENT_INTRODUCTION = 4; UPGRADE_FAILURE = 5; CLIENT_INTRODUCTION_ACK = 6; + // The event type that requires the remote device to send the available + // upgrade path. + UPGRADE_PATH_REQUEST = 7; } // Accompanies UPGRADE_PATH_AVAILABLE and UPGRADE_FAILURE events. @@ -208,12 +247,15 @@ message BandwidthUpgradeNegotiationFrame { WEB_RTC = 9; // 10 is reserved. USB = 11; + WEB_RTC_NON_CELLULAR = 12; + AWDL = 13; } // Accompanies Medium.WIFI_HOTSPOT. message WifiHotspotCredentials { optional string ssid = 1; - optional string password = 2; + optional string password = 2 + /* type = ST_ACCOUNT_CREDENTIAL */; optional int32 port = 3; optional string gateway = 4 [default = "0.0.0.0"]; // This field can be a band or frequency @@ -236,16 +278,22 @@ message BandwidthUpgradeNegotiationFrame { message WifiAwareCredentials { optional string service_id = 1; optional bytes service_info = 2; - optional string password = 3; + optional string password = 3 + /* type = ST_ACCOUNT_CREDENTIAL */; } // Accompanies Medium.WIFI_DIRECT. message WifiDirectCredentials { optional string ssid = 1; - optional string password = 2; + optional string password = 2 + /* type = ST_ACCOUNT_CREDENTIAL */; optional int32 port = 3; optional int32 frequency = 4; optional string gateway = 5 [default = "0.0.0.0"]; + // IPv6 link-local address, network order (128bits). + // The GO should listen on both IPv4 and IPv6 addresses. + // https://en.wikipedia.org/wiki/Link-local_address#IPv6 + optional bytes ip_v6_address = 6; } // Accompanies Medium.WEB_RTC @@ -254,6 +302,20 @@ message BandwidthUpgradeNegotiationFrame { optional LocationHint location_hint = 2; } + // Accompanies Medium.AWDL. + message AwdlCredentials { + optional string service_name = 1; + optional string service_type = 2; + optional string password = 3 + /* type = ST_ACCOUNT_CREDENTIAL */; + } + + message UpgradePathRequest { + // Supported mediums on the advertiser device. + repeated Medium mediums = 1 [packed = true]; + optional MediumMetadata medium_meta_data = 2; + } + optional Medium medium = 1; // Exactly one of the following fields will be set. @@ -263,18 +325,27 @@ message BandwidthUpgradeNegotiationFrame { optional WifiAwareCredentials wifi_aware_credentials = 5; optional WifiDirectCredentials wifi_direct_credentials = 6; optional WebRtcCredentials web_rtc_credentials = 8; + optional AwdlCredentials awdl_credentials = 11; // Disable Encryption for this upgrade medium to improve throughput. optional bool supports_disabling_encryption = 7; // An ack will be sent after the CLIENT_INTRODUCTION frame. optional bool supports_client_introduction_ack = 9; + + optional UpgradePathRequest upgrade_path_request = 10; + } + + // Accompanies SAFE_TO_CLOSE_PRIOR_CHANNEL events. + message SafeToClosePriorChannel { + optional int32 sta_frequency = 1; } // Accompanies CLIENT_INTRODUCTION events. message ClientIntroduction { optional string endpoint_id = 1; optional bool supports_disabling_encryption = 2; + optional string last_endpoint_id = 3; } // Accompanies CLIENT_INTRODUCTION_ACK events. @@ -286,11 +357,44 @@ message BandwidthUpgradeNegotiationFrame { optional UpgradePathInfo upgrade_path_info = 2; optional ClientIntroduction client_introduction = 3; optional ClientIntroductionAck client_introduction_ack = 4; + optional SafeToClosePriorChannel safe_to_close_prior_channel = 5; +} + +message BandwidthUpgradeRetryFrame { + // Should always match cs/symbol:location.nearby.proto.connections.Medium + // LINT.IfChange + enum Medium { + UNKNOWN_MEDIUM = 0; + // 1 is reserved. + BLUETOOTH = 2; + WIFI_HOTSPOT = 3; + BLE = 4; + WIFI_LAN = 5; + WIFI_AWARE = 6; + NFC = 7; + WIFI_DIRECT = 8; + WEB_RTC = 9; + BLE_L2CAP = 10; + USB = 11; + WEB_RTC_NON_CELLULAR = 12; + AWDL = 13; + } + // LINT.ThenChange(//depot/google3/third_party/nearby/proto/connections_enums.proto) + + // The mediums this device supports upgrading to. This list should be filtered + // by both the strategy and this device's individual limitations. + repeated Medium supported_medium = 1; + + // If true, expect the remote endpoint to send back the latest + // supported_medium. + optional bool is_request = 2; } message KeepAliveFrame { // And ack will be sent after receiving KEEP_ALIVE frame. optional bool ack = 1; + // The sequence number + optional uint32 seq_num = 2; } // Informs the remote side to immediately severe the socket connection. @@ -313,6 +417,45 @@ message PairedKeyEncryptionFrame { optional bytes signed_data = 1; } +// Nearby Connections authentication frame, contains the bytes format of a +// DeviceProvider's authentication message. +message AuthenticationMessageFrame { + // An auth message generated by DeviceProvider. + // To be sent to the remote device for verification during connection setups. + optional bytes auth_message = 1; +} + +// Nearby Connections authentication result frame. +message AuthenticationResultFrame { + // The authentication result. Non null if this frame is used to exchange + // authentication result. + optional int32 result = 1; +} + +message AutoResumeFrame { + enum EventType { + UNKNOWN_AUTO_RESUME_EVENT_TYPE = 0; + PAYLOAD_RESUME_TRANSFER_START = 1; + PAYLOAD_RESUME_TRANSFER_ACK = 2; + } + + optional EventType event_type = 1; + optional int64 pending_payload_id = 2; + optional int32 next_payload_chunk_index = 3; + optional int32 version = 4; +} + +message AutoReconnectFrame { + enum EventType { + UNKNOWN_EVENT_TYPE = 0; + CLIENT_INTRODUCTION = 1; + CLIENT_INTRODUCTION_ACK = 2; + } + optional string endpoint_id = 1; + optional EventType event_type = 2; + optional string last_endpoint_id = 3; +} + message MediumMetadata { // True if local device supports 5GHz. optional bool supports_5_ghz = 1; @@ -338,6 +481,8 @@ message MediumMetadata { optional WifiAwareUsableChannels wifi_aware_usable_channels = 10; // Usable WiFi Hotspot STA channels on the local device. optional WifiHotspotStaUsableChannels wifi_hotspot_sta_usable_channels = 11; + // The supported medium roles. + optional MediumRole medium_role = 12; } // Available channels on the local device. @@ -365,6 +510,18 @@ message WifiHotspotStaUsableChannels { repeated int32 channels = 1 [packed = true]; } +// The medium roles. +message MediumRole { + optional bool support_wifi_direct_group_owner = 1; + optional bool support_wifi_direct_group_client = 2; + optional bool support_wifi_hotspot_host = 3; + optional bool support_wifi_hotspot_client = 4; + optional bool support_wifi_aware_publisher = 5; + optional bool support_wifi_aware_subscriber = 6; + optional bool support_awdl_publisher = 7; + optional bool support_awdl_subscriber = 8; +} + // LocationHint is used to specify a location as well as format. message LocationHint { // Location is the location, provided in the format specified by format. @@ -401,3 +558,39 @@ message OsInfo { optional OsType type = 1; } + +enum EndpointType { + UNKNOWN_ENDPOINT = 0; + CONNECTIONS_ENDPOINT = 1; + PRESENCE_ENDPOINT = 2; +} + +message ConnectionsDevice { + optional string endpoint_id = 1; + optional EndpointType endpoint_type = 2; + optional bytes connectivity_info_list = 3; // Data Elements. + optional bytes endpoint_info = 4; +} + +message PresenceDevice { + enum DeviceType { + UNKNOWN = 0; + PHONE = 1; + TABLET = 2; + DISPLAY = 3; + LAPTOP = 4; + TV = 5; + WATCH = 6; + } + + optional string endpoint_id = 1; + optional EndpointType endpoint_type = 2; + optional bytes connectivity_info_list = 3; // Data Elements. + optional int64 device_id = 4; + optional string device_name = 5; + optional DeviceType device_type = 6; + optional string device_image_url = 7; + repeated ConnectionRequestFrame.Medium discovery_medium = 8 [packed = true]; + repeated int32 actions = 9 [packed = true]; + repeated int64 identity_type = 10 [packed = true]; +} diff --git a/NearbyShare/ProtobufSource/securegcm.proto b/NearbyShare/Model/ProtobufSource/securegcm.proto similarity index 100% rename from NearbyShare/ProtobufSource/securegcm.proto rename to NearbyShare/Model/ProtobufSource/securegcm.proto diff --git a/NearbyShare/ProtobufSource/securemessage.proto b/NearbyShare/Model/ProtobufSource/securemessage.proto similarity index 100% rename from NearbyShare/ProtobufSource/securemessage.proto rename to NearbyShare/Model/ProtobufSource/securemessage.proto diff --git a/NearbyShare/Model/ProtobufSource/sharing_enums.proto b/NearbyShare/Model/ProtobufSource/sharing_enums.proto new file mode 100644 index 0000000..e0e227c --- /dev/null +++ b/NearbyShare/Model/ProtobufSource/sharing_enums.proto @@ -0,0 +1,962 @@ +// Copyright 2020 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto2"; + +package location.nearby.proto.sharing; + +// import "logs/proto/logs_annotations/logs_annotations.proto"; +// import "logs/proto/wireless/beto/beto_enums.proto"; +// import "logs/proto/wireless/beto/log_dimension_annotations.proto"; + +// option (logs_proto.file_not_used_for_logging_except_enums) = true; +option optimize_for = LITE_RUNTIME; +option java_package = "com.google.location.nearby.proto"; +option java_outer_classname = "SharingEnums"; +option objc_class_prefix = "GNSHP"; + +// We use event based logging (an event object can be constructed and logged +// immediately when they occur). To obtain session based information (e.g. +// durations, counting incoming introductions), we use flowId (sender/receiver) +// in NearbyClearcutLogger (for android, or clearcut_event_logger as the +// equivalence for Windows) for all events (may exclude settings), and +// session_id for a pair of events (start and end of a session). +// Next id: 74 +enum EventType { + UNKNOWN_EVENT_TYPE = 0; + + // LINT.IfChange(EventType) + + // When new users accept agreements (like grant permission to contacts for + // CONTACT_ONLY visibility) and are enrolled into Nearby Sharing. This event + // is used to count number of new users. + ACCEPT_AGREEMENTS = 1; + + // User enables/disables nearby sharing from setting or tile service. + ENABLE_NEARBY_SHARING = 2; + + // User sets visibility preference from setting. + SET_VISIBILITY = 3; + + // Describe attachments immediately when Nearby Sharing is opened by another + // app which is used to generate/attach attachments to be shared with other + // devices. + DESCRIBE_ATTACHMENTS = 4 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Start of a scanning phase at sender. + SCAN_FOR_SHARE_TARGETS_START = 5 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_DISCOVER_START )*/ + /*]]*/; + + // End of the scanning phase at sender. + SCAN_FOR_SHARE_TARGETS_END = 6 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_DISCOVER_END )*/ + /*]]*/; + + // Receiver advertises itself for presence (a pseudo session). + ADVERTISE_DEVICE_PRESENCE_START = 7 /*[[*/ + /*( device_role = DEVICE_ROLE_REMOTE, )*/ + /*( stage = STAGE_QS_ADVERTISE_START )*/ + /*]]*/; + + // End of the advertising phase at receiver. + ADVERTISE_DEVICE_PRESENCE_END = 8 /*[[*/ + /*( device_role = DEVICE_ROLE_REMOTE, )*/ + /*( stage = STAGE_QS_ADVERTISE_END )*/ + /*]]*/; + + // Sender sends a fast initialization to receiver. + SEND_FAST_INITIALIZATION = 9 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Receiver receives the fast initialization. + RECEIVE_FAST_INITIALIZATION = 10 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Sender discovers a share target. + DISCOVER_SHARE_TARGET = 11 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_DISCOVERED )*/ + /*]]*/; + + // Sender sends introduction (before attachments being sent). + SEND_INTRODUCTION = 12 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Receiver receives introduction. + RECEIVE_INTRODUCTION = 13 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Receiver responds to introduction (before attachments being sent). + // Actions: Accept, Reject, or (for some reason) Fail. + RESPOND_TO_INTRODUCTION = 14 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Start of the sending attachments phase at sender. + SEND_ATTACHMENTS_START = 15 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_TRANSFER_START )*/ + /*]]*/; + + // End of sending attachments phase at sender. + SEND_ATTACHMENTS_END = 16 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_TRANSFER_END )*/ + /*]]*/; + + // Start of the receiving attachments phase at receiver. + RECEIVE_ATTACHMENTS_START = 17 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // End of receiving attachments phase at receiver. + RECEIVE_ATTACHMENTS_END = 18 /*[[*/ + /*( device_role = DEVICE_ROLE_REMOTE, )*/ + /*( stage = STAGE_QS_TRANSFER_END )*/ + /*]]*/; + + // Sender cancels sending attachments. + CANCEL_SENDING_ATTACHMENTS = 19 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Receiver cancels receiving attachments. + CANCEL_RECEIVING_ATTACHMENTS = 20 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Receiver opens received attachments. + OPEN_RECEIVED_ATTACHMENTS = 21 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // User opens the setup activity. + LAUNCH_SETUP_ACTIVITY = 22 [deprecated = true]; + + // User adds a contact. + ADD_CONTACT = 23; + + // User removes a contact. + REMOVE_CONTACT = 24; + + // Local devices all Fast Share server. + FAST_SHARE_SERVER_RESPONSE = 25; + + // The start of a sending session. + SEND_START = 26 /*[[*/ + /*( device_role = DEVICE_ROLE_INITIATOR, )*/ + /*( stage = STAGE_QS_CONNECT_START )*/ + /*]]*/; + + // Receiver accepts a fast initialization. + ACCEPT_FAST_INITIALIZATION = 27 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Set data usage preference. + SET_DATA_USAGE = 28; + + // Receiver dismisses a fast initialization + DISMISS_FAST_INITIALIZATION = 29 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Cancel connection. + CANCEL_CONNECTION = 30 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // User starts a chimera activity (e.g. ConsentsChimeraActivity, + // DeviceVisibilityChimeraActivity...) + LAUNCH_ACTIVITY = 31; + + // Receiver dismisses a privacy notification. + DISMISS_PRIVACY_NOTIFICATION = 32; + + // Receiver taps a privacy notification. + TAP_PRIVACY_NOTIFICATION = 33; + + // Receiver taps a help page. + TAP_HELP = 34; + + // Receiver taps a feedback. + TAP_FEEDBACK = 35; + + // Receiver adds quick settings tile. + ADD_QUICK_SETTINGS_TILE = 36; + + // Receiver removes quick settings tile. + REMOVE_QUICK_SETTINGS_TILE = 37; + + // Receiver phone consent clicked. + LAUNCH_PHONE_CONSENT = 38; + + // Devices show a phone consent banner in Nearby Share Settings + DISPLAY_PHONE_CONSENT = 54; + + // Receiver taps quick settings tile. + TAP_QUICK_SETTINGS_TILE = 39; + + // Receiver Installation of APKs status. + INSTALL_APK = 40 /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Receiver verification of APKs status. + VERIFY_APK = 41 /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // User starts a consent. + LAUNCH_CONSENT = 42; + + // After receiving payloads, Nearby Share still needs to transfer the payloads + // to correct attachment formats and move files attachments from temporary + // directory to final destination. + PROCESS_RECEIVED_ATTACHMENTS_END = 43 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Toggle Show Notification setting item in Nearby Share setting. + TOGGLE_SHOW_NOTIFICATION = 44; + + // Set device name + SET_DEVICE_NAME = 45; + + // users dropped off opt-in page. + DECLINE_AGREEMENTS = 46; + + // Request setting permissions (Wifi/BT/location/airplane mode). + REQUEST_SETTING_PERMISSIONS = 47; + + // Set up a connection with the remote device. + ESTABLISH_CONNECTION = 48 /*[ stage = STAGE_QS_CONNECT_END ]*/; + + // Track device states in Nearby Share setting. + DEVICE_SETTINGS = 49; + + // Receiver auto dismisses a fast initialization notification. + AUTO_DISMISS_FAST_INITIALIZATION = 50 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // App Crash event. + // Used only for Windows App now. + APP_CRASH = 51; + + // Sender taps the Send button in quick settings + TAP_QUICK_SETTINGS_FILE_SHARE = 52 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Devices show a privacy notification + DISPLAY_PRIVACY_NOTIFICATION = 53; + + // Preference usage event (e.g. load/save preferences, etc). + // Used only for Windows App now. + PREFERENCES_USAGE = 55; + + // Default opt in + DEFAULT_OPT_IN = 56; + + // The result of the setup wizard flow + SETUP_WIZARD = 57; + + // Sender taps a QR code + TAP_QR_CODE = 58 /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // QR code link shown + QR_CODE_LINK_SHOWN = 59 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // Sender failed to parse endpoint id. + PARSING_FAILED_ENDPOINT_ID = 60 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // The device is discovered by fast initialization + FAST_INIT_DISCOVER_DEVICE = 61 + /*[ device_role = DEVICE_ROLE_REMOTE ]*/; + + // Send desktop notification. + SEND_DESKTOP_NOTIFICATION = 62; + + // User sets account preference + SET_ACCOUNT = 63; + + // Decrypt certificate failure + DECRYPT_CERTIFICATE_FAILURE = 64; + + // Show allow permission auto access UI + SHOW_ALLOW_PERMISSION_AUTO_ACCESS = 65 + /*[ device_role = DEVICE_ROLE_INITIATOR ]*/; + + // UI events for transferring files with desktop applications. It includes + // event types such as DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE. + SEND_DESKTOP_TRANSFER_EVENT = 66; + + // Show accept button on Quick Share receive UI + WAITING_FOR_ACCEPT = 67; + + // High quality event setup + HIGH_QUALITY_MEDIUM_SETUP = 68; + + // RPC call status + RPC_CALL_STATUS = 69; + + // A QR code sharing session has started + START_QR_CODE_SESSION = 70; + + // A QR code URL has been opened in a web client/browser instead of in a + // native Quick Share app. + QR_CODE_OPENED_IN_WEB_CLIENT = 71; + + // A HaTS survey session id has been joined with Quick Share flow id. + HATS_JOINT_EVENT = 72; + + // Previews received. + RECEIVE_PREVIEWS = 73; + + // LINT.ThenChange(//depot/google3/location/nearby/proto/nearby_event_codes.proto:SharingEventCode) +} + +// Event category to differentiate whether this comes from sender or receiver, +// whether this is for communication flow, or for settings. +enum EventCategory { + UNKNOWN_EVENT_CATEGORY = 0; + SENDING_EVENT = 1; + RECEIVING_EVENT = 2; + SETTINGS_EVENT = 3; + RPC_EVENT = 4; +} + +// Status of nearby sharing. +enum NearbySharingStatus { + UNKNOWN_NEARBY_SHARING_STATUS = 0; + + ON = 1; + OFF = 2; +} + +enum Visibility { + UNKNOWN_VISIBILITY = 0; + + CONTACTS_ONLY = 1; + EVERYONE = 2; + SELECTED_CONTACTS_ONLY = 3 [deprecated = true]; + HIDDEN = 4; + SELF_SHARE = 5; +} + +enum DataUsage { + UNKNOWN_DATA_USAGE = 0; + + ONLINE = 1; + WIFI_ONLY = 2; + OFFLINE = 3; +} + +// The status of establishing a connection. Used by ESTABLISH_CONNECTION. +enum EstablishConnectionStatus { + CONNECTION_STATUS_UNKNOWN = 0; + + CONNECTION_STATUS_SUCCESS = 1 + /*[ status_bucket = STATUS_SUCCESSFUL ]*/; + CONNECTION_STATUS_FAILURE = 2 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_CANCELLATION = 3 + /*[ status_bucket = STATUS_CANCELLED ]*/; + CONNECTION_STATUS_MEDIA_UNAVAILABLE_ATTACHMENT = 4 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_FAILED_PAIRED_KEYHANDSHAKE = 5 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_FAILED_WRITE_INTRODUCTION = 6 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_FAILED_NULL_CONNECTION = 7 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_FAILED_NO_TRANSFER_UPDATE_CALLBACK = 8 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + CONNECTION_STATUS_LOST_CONNECTIVITY = 9 + /*[ status_bucket = STATUS_INTERRUPTION ]*/; + // TODO: b/341782941 - : Annote this status when it's confirmed by Nearby + // Connections team. + CONNECTION_STATUS_INVALID_ADVERTISEMENT = 10; +} + +// The status of sending and receiving attachments. Used by SEND_ATTACHMENTS. +enum AttachmentTransmissionStatus { + UNKNOWN_ATTACHMENT_TRANSMISSION_STATUS = 0; + COMPLETE_ATTACHMENT_TRANSMISSION_STATUS = 1 + /*[ status_bucket = STATUS_SUCCESSFUL ]*/; + CANCELED_ATTACHMENT_TRANSMISSION_STATUS = 2 + /*[ status_bucket = STATUS_CANCELLED ]*/; + FAILED_ATTACHMENT_TRANSMISSION_STATUS = 3 + /*[ status_bucket = STATUS_INTERNAL_ERROR ]*/; + REJECTED_ATTACHMENT = 4 [deprecated = true]; + TIMED_OUT_ATTACHMENT = 5 [deprecated = true]; + AWAITING_REMOTE_ACCEPTANCE_FAILED_ATTACHMENT = 6 [deprecated = true]; + NOT_ENOUGH_SPACE_ATTACHMENT = 7 [deprecated = true]; + FAILED_NO_TRANSFER_UPDATE_CALLBACK = 8 [deprecated = true]; + MEDIA_UNAVAILABLE_ATTACHMENT = 9 [deprecated = true]; + UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT = 10 [deprecated = true]; + NO_ATTACHMENT_FOUND = 11 [deprecated = true]; + FAILED_NO_SHARE_TARGET_ENDPOINT = 12 [deprecated = true]; + FAILED_PAIRED_KEYHANDSHAKE = 13 [deprecated = true]; + FAILED_NULL_CONNECTION = 14 [deprecated = true]; + FAILED_NO_PAYLOAD = 15 [deprecated = true]; + FAILED_WRITE_INTRODUCTION = 16 [deprecated = true]; + + // The remote response is either missing or has an unknown type. + FAILED_UNKNOWN_REMOTE_RESPONSE = 17 [deprecated = true]; + + // Breakdowns of FAILED_NULL_CONNECTION (Desktop side) + FAILED_NULL_CONNECTION_INIT_OUTGOING = 18; + FAILED_NULL_CONNECTION_DISCONNECTED = 19; + + // Breakdowns of FAILED_NULL_CONNECTION (android side) + // Connection failed due to Wifi is disconnected or Bluetooth setting is off + // or user turn on airplane mode. + FAILED_NULL_CONNECTION_LOST_CONNECTIVITY = 20 [deprecated = true]; + // Unexpected connection failure. + FAILED_NULL_CONNECTION_FAILURE = 21 [deprecated = true]; + + REJECTED_ATTACHMENT_TRANSMISSION_STATUS = 22; + TIMED_OUT_ATTACHMENT_TRANSMISSION_STATUS = 23; + NOT_ENOUGH_SPACE_ATTACHMENT_TRANSMISSION_STATUS = 24 + /*[ status_bucket = STATUS_INTERRUPTION ]*/; + UNSUPPORTED_ATTACHMENT_TYPE_ATTACHMENT_TRANSMISSION_STATUS = 25; + FAILED_UNKNOWN_REMOTE_RESPONSE_TRANSMISSION_STATUS = 26; + // Connection failed due to Wifi is disconnected or Bluetooth setting is off + // or user turn on airplane mode. + NO_RESPONSE_FRAME_CONNECTION_CLOSED_LOST_CONNECTIVITY_TRANSMISSION_STATUS = 27 + [deprecated = true]; + // Unexpected connection failure due to no response frame. + NO_RESPONSE_FRAME_CONNECTION_CLOSED_TRANSMISSION_STATUS = 28; + // Connection failed due to Wifi is disconnected or Bluetooth setting is off + // or user turn on airplane mode. + LOST_CONNECTIVITY_TRANSMISSION_STATUS = 29 + /*[ status_bucket = STATUS_INTERRUPTION ]*/; + // Connection failed due to the medium is not allowed. + FAILED_DISALLOWED_MEDIUM = 30; +} + +// Generic result status of NearbyConnections API calls. +enum ConnectionLayerStatus { + // No status is available + CONNECTION_LAYER_STATUS_UNKNOWN = 0; + // The operation was successful. + CONNECTION_LAYER_STATUS_SUCCESS = 1; + // The operation failed, without any more information. + CONNECTION_LAYER_STATUS_ERROR = 2; + // The app called an API method out of order (i.e. another method is expected + // to be called first). + CONNECTION_LAYER_STATUS_OUT_OF_ORDER_API_CALL = 3; + // The app already has active operations (advertising, discovering, or + // connected to other devices) with another Strategy. Stop these operations on + // the current Strategy before trying to advertise or discover with a new + // Strategy. + CONNECTION_LAYER_STATUS_ALREADY_HAVE_ACTIVE_STRATEGY = 4; + // The app is already advertising; call StopAdvertising() before trying to + // advertise again. + CONNECTION_LAYER_STATUS_ALREADY_ADVERTISING = 5; + // The app is already discovering; call StopDiscovery() before trying to + // discover again. + CONNECTION_LAYER_STATUS_ALREADY_DISCOVERING = 6; + // NC is already listening for incoming connections from remote endpoints. + CONNECTION_LAYER_STATUS_ALREADY_LISTENING = 7; + // An attempt to read from/write to a connected remote endpoint failed. If + // this occurs repeatedly, consider invoking DisconnectFromEndpoint(). + CONNECTION_LAYER_STATUS_END_POINT_IO_ERROR = 8; + // An attempt to interact with a remote endpoint failed because it's unknown + // to us -- it's either an endpoint that was never discovered, or an endpoint + // that never connected to us (both of which are indicative of bad input from + // the client app). + CONNECTION_LAYER_STATUS_END_POINT_UNKNOWN = 9; + // The remote endpoint rejected the connection request. + CONNECTION_LAYER_STATUS_CONNECTION_REJECTED = 10; + // The app is already connected to the specified endpoint. Multiple + // connections to a remote endpoint cannot be maintained simultaneously. + CONNECTION_LAYER_STATUS_ALREADY_CONNECTED_TO_END_POINT = 11; + // The remote endpoint is not connected; messages cannot be sent to it. + CONNECTION_LAYER_STATUS_NOT_CONNECTED_TO_END_POINT = 12; + // There was an error trying to use the device's Bluetooth capabilities. + CONNECTION_LAYER_STATUS_BLUETOOTH_ERROR = 13; + // There was an error trying to use the device's Bluetooth Low Energy + // capabilities. + CONNECTION_LAYER_STATUS_BLE_ERROR = 14; + // There was an error trying to use the device's Wi-Fi capabilities. + CONNECTION_LAYER_STATUS_WIFI_LAN_ERROR = 15; + // An attempt to interact with an in-flight Payload failed because it's + // unknown to us. + CONNECTION_LAYER_STATUS_PAYLOAD_UNKNOWN = 16; + // The connection was reset + CONNECTION_LAYER_STATUS_RESET = 17; + // The connection timed out + CONNECTION_LAYER_STATUS_TIMEOUT = 18; +} + +// The status of processing attachments after receiver received payloads +// successfully. +enum ProcessReceivedAttachmentsStatus { + PROCESSING_STATUS_UNKNOWN = 0; + + PROCESSING_STATUS_COMPLETE_PROCESSING_ATTACHMENTS = 1; + PROCESSING_STATUS_FAILED_MOVING_FILES = 2; + PROCESSING_STATUS_FAILED_RECEIVING_APK = 3; + PROCESSING_STATUS_FAILED_RECEIVING_TEXT = 4; + PROCESSING_STATUS_FAILED_RECEIVING_WIFI_CREDENTIALS = 5; +} + +// The status of advertising and discovering sessions. Used by +// SCAN_FOR_SHARE_TARGETS and ADVERTISE_DEVICE_PRESENCE. +enum SessionStatus { + UNKNOWN_SESSION_STATUS = 0; + SUCCEEDED_SESSION_STATUS = 1 + /*[ status_bucket = STATUS_SUCCESSFUL ]*/; + + // TODO: b/341782941 - FAILED_SESSION_STATUS occurs when the status of + // advertising or discovering sessions is not successful. It can be + // due to STATUS_INTERNAL_ERROR, STATUS_INTERRUPTION, STATUS_CANCELLED. + // More session statuses should be logged to determine the status. + FAILED_SESSION_STATUS = 2; +} + +// User's response to introductions. +enum ResponseToIntroduction { + UNKNOWN_RESPONSE_TO_INTRODUCTION = 0; + + ACCEPT_INTRODUCTION = 1; + REJECT_INTRODUCTION = 2; + FAIL_INTRODUCTION = 3; +} + +// TODO(fdi): may eventually include desktop, etc. +// The type of a remote device. +enum DeviceType { + UNKNOWN_DEVICE_TYPE = 0; + + PHONE = 1; + TABLET = 2; + LAPTOP = 3; + CAR = 4; + FOLDABLE = 5; + XR = 6; +} + +// TODO(fdi): may eventually include windows, iOS, etc. +// The OS type of a remote device. +enum OSType { + UNKNOWN_OS_TYPE = 0; + + ANDROID = 1; + CHROME_OS = 2; + IOS = 3; + WINDOWS = 4; + MACOS = 5; +} + +// Relationship of remote device to sender device. +enum DeviceRelationship { + UNKNOWN_DEVICE_RELATIONSHIP = 0; + + // The remote device belongs to the same owner as sender device. + IS_SELF = 1; + // The remote device is a contact of sender. + IS_CONTACT = 2; + // The remote device is a stranger. + IS_STRANGER = 3; +} + +// The device sources of the clearcut log. +enum LogSource { + UNSPECIFIED_SOURCE = 0; + + // Represents the devices in Nearby labs. + LAB_DEVICES = 1; + // Represents the devices tested by Nearby engs, in the long term can include + // any devices with newest feature flags. + INTERNAL_DEVICES = 2; + // Represents the devices testing our in-development features before they're + // released to the greater public. + BETA_TESTER_DEVICES = 3; + // Represents the OEM partners (like Samsung) that we're working with to + // verify functionality on their devices. + OEM_DEVICES = 4; + // Represents the device for debugging. + DEBUG_DEVICES = 5; + // Represents the device for Nearby Module Food. + NEARBY_MODULE_FOOD_DEVICES = 6; + // Represents the device for BeTo Team Food. + BETO_DOGFOOD_DEVICES = 7; + // Represents the device for Nearby dog Food. + NEARBY_DOGFOOD_DEVICES = 8; + // Represents the device for Nearby Team Food. + NEARBY_TEAMFOOD_DEVICES = 9; +} + +// The Fast Share server action name. +enum ServerActionName { + UNKNOWN_SERVER_ACTION = 0; + + UPLOAD_CERTIFICATES = 1; + DOWNLOAD_CERTIFICATES = 2; + CHECK_REACHABILITY = 3; + UPLOAD_CONTACTS = 4; + UPDATE_DEVICE_NAME = 5; + UPLOAD_SENDER_CERTIFICATES = 6; + DOWNLOAD_SENDER_CERTIFICATES = 7; + UPLOAD_CONTACTS_AND_CERTIFICATES = 8; + LIST_REACHABLE_PHONE_NUMBERS = 9; + LIST_MY_DEVICES = 10; + LIST_CONTACT_PEOPLE = 11; + + // used for analytics logger to record action name. + DOWNLOAD_CERTIFICATES_INFO = 12; +} + +// The Fast Share server response state. +enum ServerResponseState { + UNKNOWN_SERVER_RESPONSE_STATE = 0; + + SERVER_RESPONSE_SUCCESS = 1; + SERVER_RESPONSE_UNKNOWN_FAILURE = 2; + + // For StatusException. + SERVER_RESPONSE_STATUS_OTHER_FAILURE = 3; + SERVER_RESPONSE_STATUS_DEADLINE_EXCEEDED = 4; + SERVER_RESPONSE_STATUS_PERMISSION_DENIED = 5; + SERVER_RESPONSE_STATUS_UNAVAILABLE = 6; + SERVER_RESPONSE_STATUS_UNAUTHENTICATED = 7; + SERVER_RESPONSE_STATUS_INVALID_ARGUMENT = 9; + + // For GoogleAuthException. + SERVER_RESPONSE_GOOGLE_AUTH_FAILURE = 8; + + // For Internet connect status. + SERVER_RESPONSE_NOT_CONNECTED_TO_INTERNET = 10; +} + +// The purpose of requesting the server request. +enum SyncPurpose { + SYNC_PURPOSE_UNKNOWN = 0; + // When NearbySharingChimeraService#sync() is called. + SYNC_PURPOSE_ON_DEMAND_SYNC = 1; + // Requested by chime notification. + SYNC_PURPOSE_CHIME_NOTIFICATION = 2; + // For reqular daily sync. + SYNC_PURPOSE_DAILY_SYNC = 3; + // Wen a device opts into Nearby Share. + SYNC_PURPOSE_OPT_IN_FIRST_SYNC = 4; + // Requested when Nearby Share automatically enables a device that shares + // a single account that has already opted in on another device. + SYNC_PURPOSE_CHECK_DEFAULT_OPT_IN = 5; + // When a device enables Nearby Share. + SYNC_PURPOSE_NEARBY_SHARE_ENABLED = 6; + // When a device is in fast init advertising. + SYNC_PURPOSE_SYNC_AT_FAST_INIT = 7; + // When device start discovery. + SYNC_PURPOSE_SYNC_AT_DISCOVERY = 8; + // When device tries to load valid private certificate. + SYNC_PURPOSE_SYNC_AT_LOAD_PRIVATE_CERTIFICATE = 9; + // When device start advertiseement. + SYNC_PURPOSE_SYNC_AT_ADVERTISEMENT = 10; + // When device contacts list changes. + SYNC_PURPOSE_CONTACT_LIST_CHANGE = 11; + // When showing the C11 banner in Neary Share setting. + SYNC_PURPOSE_SHOW_C11N_VIEW = 12; + // For regular check contact reachability. + SYNC_PURPOSE_REGULAR_CHECK_CONTACT_REACHABILITY = 13; + // When selected contacts list changes in visibility setting. + SYNC_PURPOSE_VISIBILITY_SELECTED_CONTACT_CHANGE = 14; + // When switching account. + SYNC_PURPOSE_ACCOUNT_CHANGE = 15; + // When regenerate certificates + SYNC_PURPOSE_REGENERATE_CERTIFICATES = 16; + // When Device Contacts consent changes + SYNC_PURPOSE_DEVICE_CONTACTS_CONSENT_CHANGE = 17; +} + +// The device role to trigger the server request. +enum ClientRole { + CLIENT_ROLE_UNKNOWN = 0; + CLIENT_ROLE_SENDER = 1; + CLIENT_ROLE_RECEIVER = 2; +} + +// The type of Nearby Sharing scanning. +enum ScanType { + UNKNOWN_SCAN_TYPE = 0; + FOREGROUND_SCAN = 1; + FOREGROUND_RETRY_SCAN = 2; + DIRECT_SHARE_SCAN = 3; + BACKGROUND_SCAN = 4; +} + +// The type of parsing endpoint id failed type. +enum ParsingFailedType { + FAILED_UNKNOWN_TYPE = 0; + // NULL advertisement is returned due to sender failing to parse advertisement + // from endpointInfo byte stream from receiver advertisement. + FAILED_PARSE_ADVERTISEMENT = 1; + // NULL shareTarget is returned due to sender failing to create shareTarget + // from a valid parsed advertisement stemming from issues in certificates, QR + // code tokens or device names. + FAILED_CONVERT_SHARE_TARGET = 2; +} + +// The Nearby Sharing advertising mode. +enum AdvertisingMode { + UNKNOWN_ADVERTISING_MODE = 0; + SCREEN_OFF_ADVERTISING_MODE = 1; + BACKGROUND_ADVERTISING_MODE = 2; + MIDGROUND_ADVERTISING_MODE = 3; + FOREGROUND_ADVERTISING_MODE = 4; + SUSPENDED_ADVERTISING_MODE = 5; +} + +// The Nearby Sharing discovery mode. +enum DiscoveryMode { + UNKNOWN_DISCOVERY_MODE = 0; + SCREEN_OFF_DISCOVERY_MODE = 1; + BACKGROUND_DISCOVERY_MODE = 2; + MIDGROUND_DISCOVERY_MODE = 3; + FOREGROUND_DISCOVERY_MODE = 4; + SUSPENDED_DISCOVERY_MODE = 5; +} + +// The class name of chimera activity. +enum ActivityName { + UNKNOWN_ACTIVITY = 0; + + SHARE_SHEET_ACTIVITY = 1; + SETTINGS_ACTIVITY = 2; + RECEIVE_SURFACE_ACTIVITY = 3; + SETUP_ACTIVITY = 4; + DEVICE_VISIBILITY_ACTIVITY = 5; + CONSENTS_ACTIVITY = 6; + SET_DEVICE_NAME_DIALOG = 7; + SET_DATA_USAGE_DIALOG = 8; + QUICK_SETTINGS_ACTIVITY = 9; + REMOTE_COPY_SHARE_SHEET_ACTIVITY = 10; + SETUP_WIZARD_ACTIVITY = 11; + SETTINGS_REVIEW_ACTIVITY = 12; +} + +// The type of consent page user launches. +enum ConsentType { + CONSENT_TYPE_UNKNOWN = 0; + + // launch Constellation consent page. + CONSENT_TYPE_C11N = 1; + // launch device contact consent page. + CONSENT_TYPE_DEVICE_CONTACT = 2; +} + +enum ConsentAcceptanceStatus { + CONSENT_UNKNOWN_ACCEPT_STATUS = 0; + + CONSENT_ACCEPTED = 1; + CONSENT_DECLINED = 2; + // unable to enable consent. + CONSENT_UNABLE_TO_ENABLE = 3; +} + +enum ApkSource { + UNKNOWN_APK_SOURCE = 0; + + APK_FROM_SD_CARD = 1; + INSTALLED_APP = 2; +} + +// The Installation status of APK. +enum InstallAPKStatus { + UNKNOWN_INSTALL_APK_STATUS = 0; + + FAIL_INSTALLATION = 1; + SUCCESS_INSTALLATION = 2; +} + +// The verification status of APK. +enum VerifyAPKStatus { + UNKNOWN_VERIFY_APK_STATUS = 0; + + NOT_INSTALLABLE = 1; + INSTALLABLE = 2; + ALREADY_INSTALLED = 3; +} + +enum ShowNotificationStatus { + UNKNOWN_SHOW_NOTIFICATION_STATUS = 0; + + SHOW = 1; + NOT_SHOW = 2; +} + +enum PermissionRequestResult { + PERMISSION_UNKNOWN_REQUEST_RESULT = 0; + + PERMISSION_GRANTED = 1; + PERMISSION_REJECTED = 2; + PERMISSION_UNABLE_TO_GRANT = 3; +} + +enum PermissionRequestType { + PERMISSION_UNKNOWN_TYPE = 0; + + PERMISSION_AIRPLANE_MODE_OFF = 1; + PERMISSION_WIFI = 2; + PERMISSION_BLUETOOTH = 3; + PERMISSION_LOCATION = 4; + PERMISSION_WIFI_HOTSPOT = 5; +} + +enum SharingUseCase { + USE_CASE_UNKNOWN = 0; + + USE_CASE_NEARBY_SHARE = 1; + USE_CASE_REMOTE_COPY_PASTE = 2; + USE_CASE_WIFI_CREDENTIAL = 3; + USE_CASE_APP_SHARE = 4; + USE_CASE_QUICK_SETTING_FILE_SHARE = 5; + USE_CASE_SETUP_WIZARD = 6; + // Deprecated. QR code is an addition to existing use cases rather than being + // a separate use case. + USE_CASE_NEARBY_SHARE_WITH_QR_CODE = 7 [deprecated = true]; + // The user was redirected from Bluetooth sharing UI to Nearby Share + USE_CASE_REDIRECTED_FROM_BLUETOOTH_SHARE = 8; +} + +// Used only for Windows App now. +enum AppCrashReason { + APP_CRASH_REASON_UNKNOWN = 0; +} + +// Thes source where the attachemnt comes from. It can be an action, app name, +// etc. The first 6 source types are being used as FileSenderType in Nearby +// Share Windows app. +enum AttachmentSourceType { + ATTACHMENT_SOURCE_UNKNOWN = 0; + ATTACHMENT_SOURCE_CONTEXT_MENU = 1; + ATTACHMENT_SOURCE_DRAG_AND_DROP = 2; + ATTACHMENT_SOURCE_SELECT_FILES_BUTTON = 3; + ATTACHMENT_SOURCE_PASTE = 4; + ATTACHMENT_SOURCE_SELECT_FOLDERS_BUTTON = 5; + ATTACHMENT_SOURCE_SHARE_ACTIVATION = 6; +} + +// The action to interact with preferences. +// Used only for Windows App now. +enum PreferencesAction { + PREFERENCES_ACTION_UNKNOWN = 0; + PREFERENCES_ACTION_NO_ACTION = 1; + + // Primary actions/functions towards preferences + PREFERENCES_ACTION_LOAD_PREFERENCES = 2; + PREFERENCES_ACTION_SAVE_PREFERENCESS = 3; + PREFERENCES_ACTION_ATTEMPT_LOAD = 4; + PREFERENCES_ACTION_RESTORE_FROM_BACKUP = 5; + + // Other actions within the 4 actions above + PREFERENCES_ACTION_CREATE_PREFERENCES_PATH = 6; + PREFERENCES_ACTION_MAKE_PREFERENCES_BACKUP_FILE = 7; + PREFERENCES_ACTION_CHECK_IF_PREFERENCES_PATH_EXISTS = 8; + PREFERENCES_ACTION_CHECK_IF_PREFERENCES_INPUT_STREAM_STATUS = 9; + PREFERENCES_ACTION_CHECK_IF_PREFERENCES_FILE_IS_CORRUPTED = 10; + PREFERENCES_ACTION_CHECK_IF_PREFERENCES_BACKUP_FILE_EXISTS = 11; +} + +// The status of the action to interact with preferences. +// Used only for Windows App now. +enum PreferencesActionStatus { + PREFERENCES_ACTION_STATUS_UNKNOWN = 0; + PREFERENCES_ACTION_STATUS_SUCCESS = 1; + PREFERENCES_ACTION_STATUS_FAIL = 2; +} + +/** The distance of the found nearby fast init advertisement. */ +enum FastInitState { + FAST_INIT_UNKNOWN_STATE = 0; + // A device was found in close proximity. + // distance < fast_init_distance_close_centimeters(50 cm) + FAST_INIT_CLOSE_STATE = 1; + // A device was found in far proximity. + // distance < fast_init_distance_close_centimeters(10 m) + FAST_INIT_FAR_STATE = 2; + // No devices have been found nearby. The default state. + FAST_INIT_LOST_STATE = 3; +} + +/** The type of FastInit advertisement. */ +enum FastInitType { + FAST_INIT_UNKNOWN_TYPE = 0; + // Show HUN to notify the user. + FAST_INIT_NOTIFY_TYPE = 1; + // Not notify the user. + FAST_INIT_SILENT_TYPE = 2; +} + +// LINT.IfChange +/** The type of desktop notification event. */ +enum DesktopNotification { + DESKTOP_NOTIFICATION_UNKNOWN = 0; + DESKTOP_NOTIFICATION_CONNECTING = 1; + DESKTOP_NOTIFICATION_PROGRESS = 2; + DESKTOP_NOTIFICATION_ACCEPT = 3; + DESKTOP_NOTIFICATION_RECEIVED = 4; + DESKTOP_NOTIFICATION_ERROR = 5; +} + +enum DesktopTransferEventType { + DESKTOP_TRANSFER_EVENT_TYPE_UNKNOWN = 0; + + // Receive attachments. + DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ACCEPT = 1; + DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_PROGRESS = 2; + DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_RECEIVED = 3; + DESKTOP_TRANSFER_EVENT_RECEIVE_TYPE_ERROR = 4; + + // Send attachments. + DESKTOP_TRANSFER_EVENT_SEND_TYPE_START = 5; + DESKTOP_TRANSFER_EVENT_SEND_TYPE_SELECT_A_DEVICE = 6; + DESKTOP_TRANSFER_EVENT_SEND_TYPE_PROGRESS = 7; + DESKTOP_TRANSFER_EVENT_SEND_TYPE_SENT = 8; + DESKTOP_TRANSFER_EVENT_SEND_TYPE_ERROR = 9; +} + +enum DecryptCertificateFailureStatus { + DECRYPT_CERT_UNKNOWN_FAILURE = 0; + DECRYPT_CERT_NO_SUCH_ALGORITHM_FAILURE = 1; + DECRYPT_CERT_NO_SUCH_PADDING_FAILURE = 2; + DECRYPT_CERT_INVALID_KEY_FAILURE = 3; + DECRYPT_CERT_INVALID_ALGORITHM_PARAMETER_FAILURE = 4; + DECRYPT_CERT_ILLEGAL_BLOCK_SIZE_FAILURE = 5; + DECRYPT_CERT_BAD_PADDING_FAILURE = 6; +} + +// Refer to go/qs-contacts-consent-2024 for the detail. +enum ContactAccess { + CONTACT_ACCESS_UNKNOWN = 0; + + CONTACT_ACCESS_NO_CONTACT_UPLOADED = 1; + CONTACT_ACCESS_ONLY_UPLOAD_GOOGLE_CONTACT = 2; + CONTACT_ACCESS_UPLOAD_CONTACT_FOR_DEVICE_CONTACT_CONSENT = 3; + CONTACT_ACCESS_UPLOAD_CONTACT_FOR_QUICK_SHARE_CONSENT = 4; +} + +// Refer to go/qs-contacts-consent-2024 for the detail. +enum IdentityVerification { + IDENTITY_VERIFICATION_UNKNOWN = 0; + + IDENTITY_VERIFICATION_NO_PHONE_NUMBER_VERIFIED = 1; + IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_NOT_LINKED_TO_GAIA = 2; + IDENTITY_VERIFICATION_PHONE_NUMBER_VERIFIED_LINKED_TO_QS_GAIA = 3; +} + +enum ButtonStatus { + BUTTON_STATUS_UNKNOWN = 0; + BUTTON_STATUS_CLICK_ACCEPT = 1; + BUTTON_STATUS_CLICK_REJECT = 2; + BUTTON_STATUS_IGNORE = 3; +} +// LINT.ThenChange( +// //depot/google3/location/nearby/cpp/sharing/clients/dart/platform/lib/types/models.dart +// ) diff --git a/NearbyShare/ProtobufSource/ukey.proto b/NearbyShare/Model/ProtobufSource/ukey.proto similarity index 100% rename from NearbyShare/ProtobufSource/ukey.proto rename to NearbyShare/Model/ProtobufSource/ukey.proto diff --git a/NearbyShare/ProtobufSource/wire_format.proto b/NearbyShare/Model/ProtobufSource/wire_format.proto similarity index 50% rename from NearbyShare/ProtobufSource/wire_format.proto rename to NearbyShare/Model/ProtobufSource/wire_format.proto index 6853e22..82510d3 100644 --- a/NearbyShare/ProtobufSource/wire_format.proto +++ b/NearbyShare/Model/ProtobufSource/wire_format.proto @@ -1,26 +1,41 @@ -// Copyright 2020 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Brought from: //depot/google3/location/nearby/sharing/proto/wire_format.proto -// At CL 317565061 +// Copyright 2023 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. syntax = "proto2"; +//package nearby.sharing.service.proto; package sharing.nearby; -// Required in Chrome. +// import "storage/datapol/annotations/proto/semantic_annotations.proto"; +import "sharing_enums.proto"; + +option java_package = "com.google.android.gms.nearby.sharing"; +option java_outer_classname = "Protocol"; +option objc_class_prefix = "GNSHP"; option optimize_for = LITE_RUNTIME; // File metadata. Does not include the actual bytes of the file. -// NEXT_ID=6 +// NEXT_ID=10 message FileMetadata { enum Type { UNKNOWN = 0; IMAGE = 1; VIDEO = 2; - APP = 3; + ANDROID_APP = 3; AUDIO = 4; + DOCUMENT = 5; + CONTACT_CARD = 6; } // The human readable name of this file (eg. 'Cookbook.pdf'). @@ -43,9 +58,19 @@ message FileMetadata { // A uuid for the attachment. Should be unique across all attachments. optional int64 id = 6; + + // The parent folder. + optional string parent_folder = 7; + + // A stable identifier for the attachment. Used for receiver to identify same + // attachment from different transfers. + optional int64 attachment_hash = 8; + + // True, if image in file attachment is sensitive + optional bool is_sensitive_content = 9; } -// NEXT_ID=5 +// NEXT_ID=8 message TextMetadata { enum Type { UNKNOWN = 0; @@ -73,15 +98,19 @@ message TextMetadata { // A uuid for the attachment. Should be unique across all attachments. optional int64 id = 6; + + // True if text is sensitive, e.g. password + optional bool is_sensitive_text = 7; } -// NEXT_ID=5 +// NEXT_ID=6 message WifiCredentialsMetadata { enum SecurityType { UNKNOWN_SECURITY_TYPE = 0; OPEN = 1; WPA_PSK = 2; WEP = 3; + SAE = 4; } // The Wifi network name. This will be sent in introduction. @@ -98,6 +127,49 @@ message WifiCredentialsMetadata { optional int64 id = 5; } +// NEXT_ID=8 +message AppMetadata { + // The app name. This will be sent in introduction. + optional string app_name = 1; + + // The size of the all split of apks. + optional int64 size = 2; + + // The File payload id that will be sent as a follow up containing the + // apk paths. + repeated int64 payload_id = 3 [packed = true]; + + // A uuid for the attachment. Should be unique across all attachments. + optional int64 id = 4; + + // The name of apk file. This will be sent in introduction. + repeated string file_name = 5; + + // The size of apk file. This will be sent in introduction. + repeated int64 file_size = 6 [packed = true]; + + // The package name. This will be sent in introduction. + optional string package_name = 7; +} + +// NEXT_ID=5 +message StreamMetadata { + // A human readable description for the stream. + optional string description = 1; + + // The package name of the sending application. + optional string package_name = 2; + + // The payload id that will be send as a followup containing the + // ParcelFileDescriptor. + optional int64 payload_id = 3; + + // The human-readable name of the package that should be displayed as + // attribution if no other information is available (i.e. the package is not + // installed locally yet). + optional string attributed_app_name = 4; +} + // A frame used when sending messages over the wire. // NEXT_ID=3 message Frame { @@ -112,7 +184,7 @@ message Frame { optional V1Frame v1 = 2; } -// NEXT_ID=7 +// NEXT_ID=8 message V1Frame { enum FrameType { UNKNOWN_FRAME_TYPE = 0; @@ -120,34 +192,59 @@ message V1Frame { RESPONSE = 2; PAIRED_KEY_ENCRYPTION = 3; PAIRED_KEY_RESULT = 4; + // No longer used. CERTIFICATE_INFO = 5; CANCEL = 6; + // No longer used. + PROGRESS_UPDATE = 7; } optional FrameType type = 1; - // Exactly one of the following fields will be set. + // At most one of the following fields will be set. optional IntroductionFrame introduction = 2; optional ConnectionResponseFrame connection_response = 3; optional PairedKeyEncryptionFrame paired_key_encryption = 4; optional PairedKeyResultFrame paired_key_result = 5; - optional CertificateInfoFrame certificate_info = 6; + optional CertificateInfoFrame certificate_info = 6 [deprecated = true]; + optional ProgressUpdateFrame progress_update = 7 [deprecated = true]; } // An introduction packet sent by the sending side. Contains a list of files // they'd like to share. -// NEXT_ID=4 +// NEXT_ID=10 message IntroductionFrame { + enum SharingUseCase { + UNKNOWN = 0; + NEARBY_SHARE = 1; + REMOTE_COPY = 2; + } + repeated FileMetadata file_metadata = 1; repeated TextMetadata text_metadata = 2; // The required app package to open the content. May be null. optional string required_package = 3; repeated WifiCredentialsMetadata wifi_credentials_metadata = 4; + repeated AppMetadata app_metadata = 5; + optional bool start_transfer = 6; + repeated StreamMetadata stream_metadata = 7; + optional SharingUseCase use_case = 8; + repeated int64 preview_payload_ids = 9; +} + +// A progress update packet sent by the sending side. Contains transfer progress +// value. NEXT_ID=3 +message ProgressUpdateFrame { + optional float progress = 1; + + // True, if the receiver should start bandwidth upgrade and receiving the + // payloads. + optional bool start_transfer = 2; } // A response packet sent by the receiving side. Accepts or rejects the list of // files. -// NEXT_ID=2 +// NEXT_ID=4 message ConnectionResponseFrame { enum Status { UNKNOWN = 0; @@ -160,10 +257,68 @@ message ConnectionResponseFrame { // The receiving side's response. optional Status status = 1; + + // Key is attachment hash, value is the details of attachment. + map attachment_details = 2; + + // In the case of a stream attachments, the other side of the pipe. + // Both sender and receiver should validate matching counts. + repeated StreamMetadata stream_metadata = 3; +} + +// Attachment details that sent in ConnectionResponseFrame. +// NEXT_ID=3 +message AttachmentDetails { + // LINT.IfChange + enum Type { + UNKNOWN = 0; + // Represents FileAttachment. + FILE = 1; + // Represents TextAttachment. + TEXT = 2; + // Represents WifiCredentialsAttachment. + WIFI_CREDENTIALS = 3; + // Represents AppAttachment. + APP = 4; + // Represents StreamAttachment. + STREAM = 5; + } + // LINT.ThenChange(//depot/google3/java/com/google/android/gmscore/integ/client/nearby/src/com/google/android/gms/nearby/sharing/Attachment.java) + + // The attachment family type. + optional Type type = 1; + + // This field is only for FILE type. + optional FileAttachmentDetails file_attachment_details = 2; +} + +// File attachment details included in ConnectionResponseFrame. +// NEXT_ID=3 +message FileAttachmentDetails { + // Existing local file size on receiver side. + optional int64 receiver_existing_file_size = 1; + + // The key is attachment hash, a stable identifier for the attachment. + // Value is list of payload details transferred for the attachment. + map attachment_hash_payloads = 2; +} + +// NEXT_ID=2 +message PayloadsDetails { + // The list should be sorted by creation timestamp. + repeated PayloadDetails payload_details = 1; +} + +// Metadata of a payload file created by Nearby Connections. +// NEXT_ID=4 +message PayloadDetails { + optional int64 id = 1; + optional int64 creation_timestamp_millis = 2; + optional int64 size = 3; } // A paired key encryption packet sent between devices, contains signed data. -// NEXT_ID=3 +// NEXT_ID=5 message PairedKeyEncryptionFrame { // The encrypted data in byte array format. optional bytes signed_data = 1; @@ -173,10 +328,17 @@ message PairedKeyEncryptionFrame { // An optional encrypted data in byte array format. optional bytes optional_signed_data = 3; + + // An optional QR code handshake data in a byte array format. + // For incoming connection contains a signature of the UKEY2 + // token, created with the sender's private key. + // For outgoing connection contains an HKDF of the connection token and of the + // UKEY2 token + optional bytes qr_code_handshake_data = 4; } // A paired key verification result packet sent between devices. -// NEXT_ID=2 +// NEXT_ID=3 message PairedKeyResultFrame { enum Status { UNKNOWN = 0; @@ -187,6 +349,9 @@ message PairedKeyResultFrame { // The verification result. optional Status status = 1; + + // OS type. + optional location.nearby.proto.sharing.OSType os_type = 2; } // A package containing certificate info to be shared to remote device offline. @@ -229,8 +394,15 @@ message PublicCertificate { // NEXT_ID=3 message WifiCredentials { // Wi-Fi password. - optional string password = 1; + optional string password = 1 + /* type = ST_ACCOUNT_CREDENTIAL */; // True if the network is a hidden network that is not broadcasting its SSID. // Default is false. optional bool hidden_ssid = 2 [default = false]; -} \ No newline at end of file +} + +// NEXT_ID=2 +message StreamDetails { + // Serialized ParcelFileDescriptor for input stream (for the receiver). + optional bytes input_stream_parcel_file_descriptor_bytes = 1; +} diff --git a/NearbyShare/Util/ConnectionFailureTracker.swift b/NearbyShare/Util/ConnectionFailureTracker.swift deleted file mode 100644 index d728a21..0000000 --- a/NearbyShare/Util/ConnectionFailureTracker.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// ConnectionFailureTracker.swift -// QuickDrop -// -// Created by Leon Böttger on 15.05.25. -// - -import Foundation - -class ConnectionFailureTracker { - static let shared = ConnectionFailureTracker() - - private var failureTimestamps: [Date] = [] - private var lastAlertShownAt: Date? - - private let queue = DispatchQueue(label: "ConnectionFailureTrackerQueue") - - private init() {} - - func recordFailure(onTrigger: @escaping () -> Void) { - queue.async { - let now = Date() - - // Remove old timestamps older than 10 seconds - self.failureTimestamps = self.failureTimestamps.filter { now.timeIntervalSince($0) < 10 } - self.failureTimestamps.append(now) - - // Check if alert can be shown - let canShowAlert = self.failureTimestamps.count >= 2 && - (self.lastAlertShownAt == nil || now.timeIntervalSince(self.lastAlertShownAt!) >= 60) - - if canShowAlert { - self.lastAlertShownAt = now - self.failureTimestamps.removeAll() - DispatchQueue.main.async { - onTrigger() - } - } - } - } -} diff --git a/QuickDrop/Util/Localized.swift b/NearbyShare/Util/Localized.swift similarity index 100% rename from QuickDrop/Util/Localized.swift rename to NearbyShare/Util/Localized.swift diff --git a/NearbyShare/Util/SaveFilesManager.swift b/NearbyShare/Util/SaveFilesManager.swift index 73b3e71..f6239b3 100644 --- a/NearbyShare/Util/SaveFilesManager.swift +++ b/NearbyShare/Util/SaveFilesManager.swift @@ -6,8 +6,10 @@ // import Foundation -import AppKit import ImageIO +#if os(macOS) +import AppKit +#endif public class SaveFilesManager { @@ -88,11 +90,15 @@ public class SaveFilesManager { progress.totalUnitCount = 10 progress.kind = .file progress.isPausable = false + #if os(macOS) progress.publish() + #endif DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { progress.completedUnitCount = 10 + #if os(macOS) progress.unpublish() + #endif } try fileManager.removeItem(at: file) @@ -110,10 +116,12 @@ public class SaveFilesManager { if !filesFinishedDownloadingSinceLastRun.isEmpty && !isFileTransferRestricted() { + #if os(macOS) if UserDefaults.standard.bool(forKey: UserDefaultsKeys.openFinderAfterReceiving.rawValue) { log("Opening \(filesFinishedDownloadingSinceLastRun.count) file(s) in Finder.") NSWorkspace.shared.activateFileViewerSelecting(filesFinishedDownloadingSinceLastRun) } + #endif // Clear the list of finished files filesFinishedDownloadingSinceLastRun.removeAll() @@ -143,6 +151,8 @@ public class SaveFilesManager { if let bookmarkData = UserDefaults.standard.data(forKey: UserDefaultsKeys.saveFolderBookmark.rawValue) { var isStale = false + // Not supported on iOS + #if os(macOS) do { let url = try URL(resolvingBookmarkData: bookmarkData, options: .withSecurityScope, relativeTo: nil, bookmarkDataIsStale: &isStale) @@ -160,6 +170,7 @@ public class SaveFilesManager { } catch { log("Failed to resolve bookmark: \(error), using default downloads folder.") } + #endif } do { diff --git a/NearbyShare/Util/SleepManager.swift b/NearbyShare/Util/SleepManager.swift index 01da003..ac026a2 100644 --- a/NearbyShare/Util/SleepManager.swift +++ b/NearbyShare/Util/SleepManager.swift @@ -6,12 +6,23 @@ // import Foundation + +#if os(macOS) import IOKit import IOKit.pwr_mgt +#elseif os(iOS) +import UIKit +#endif class SleepManager { public static let shared = SleepManager() + + #if os(macOS) private var assertionID: IOPMAssertionID = 0 + #else + private var assertionID: Int = 0 + #endif + private var timer: Timer? private init() { @@ -24,27 +35,35 @@ class SleepManager { } private func disableSleep() { - if assertionID != 0 { - return - } + + if assertionID != 0 { return } log("[SleepManager] Enabling Wakelock") + #if os(macOS) IOPMAssertionCreateWithName( kIOPMAssertionTypePreventUserIdleDisplaySleep as CFString, IOPMAssertionLevel(kIOPMAssertionLevelOn), "QuickDrop Data Transfer" as CFString, &assertionID ) + #elseif os(iOS) + UIApplication.shared.isIdleTimerDisabled = true + assertionID = 1 + #endif } private func enableSleep() { - if assertionID == 0 { - return - } + if assertionID == 0 { return } log("[SleepManager] Disabling Wakelock") + + #if os(macOS) IOPMAssertionRelease(assertionID) + #elseif os(iOS) + UIApplication.shared.isIdleTimerDisabled = false + #endif + assertionID = 0 } diff --git a/PROTOCOL.md b/PROTOCOL.md deleted file mode 100644 index 851bf3d..0000000 --- a/PROTOCOL.md +++ /dev/null @@ -1,210 +0,0 @@ -# Google's Nearby Share protocol - -This document describes the Nearby Share protocol as understood by me (@grishka) from Chromium sources (that are way too convoluted) and decompiled Google Services Framework apk (that, despite being a decompilation of obfuscated code, is still more helpful than Chromium sources). - -The protocol is peer-to-peer, end-to-end encrypted. Overall, it appears like it was mostly designed to run over an unreliable medium like UDP, but I've only observed it over TCP. - -Only the WiFi LAN protocol is described here because that's what I reverse engineered, but the data running over other mediums (Bluetooth, WiFi Direct, ...) is most probably largely the same. - -If you want to build your own Nearby Share *thing*, you will need: - -1. An implementation of multicast DNS (most modern OSes have it built-in) -2. A cryptography library that is capable of ECDSA key exchange, AES-CBC, HMAC, and SHA256. OpenSSL will do but is definitely an overkill. -3. A Protobuf library -4. [These Protobuf files](/NearDrop/ProtobufSource) I collected from the Chromium sources so you don't have to - -It is also very helpful to read logcat on your Android device if you're having any trouble. The logging of the Android implementation of Nearby Share is very verbose. - -### Device roles - -Since a file transfer is unidirectional, the peers are assigned roles: - -* The receiving side is the **server**. It listens on a TCP port and advertises an MDNS service. -* The sending side is the **client**. It discovers the MDNS service and connects to the server's TCP port. - -### How devices find each other - -To become visible in the sheet on Android devices, a *server* advertises an MDNS service. The **domain** is empty. The **type** is `_FC9F5ED42C8A._tcp.`. The **port** is an arbitrary TCP port on which the server accepts incoming connections. - -The **name** is the following 10 bytes encoded in URL-safe base64: - -* `0x23`, Google calls this "PCP" but I have no idea what it is -* 4-byte **endpoint ID** -* 3-byte **service ID**: `0xFC, 0x9F, 0x5E` -* 2 zero bytes that serve an unknown purpose - -The **endpoint ID** is 4 random alphanumeric characters. It identifies devices to each other. Android uses it in its logs quite extensively. - -The service also needs to have a TXT record with key `n` and the value of the following encoded in URL-safe base64 ("endpoint info"): - -* 1 byte: bit field - * 3 bits: version, set to 0 - * 1 bit: visibility, 0 = visible - * 3 bits: device type. Android uses this to pick an icon. 0 = unknown, 1 = phone, 2 = tablet, 3 = laptop - * 1 bit: reserved, set to 0 -* 16 bytes of unknown purpose. I set them to random. -* User-visible device name in UTF-8, prefixed with 1-byte length. - -Android does not advertise the MDNS service all the time regardless of the visibility setting. It waits for a BLE advertisement with the following parameters: - -* Service UUID = `fe 2c` -* Service data = `fc 12 8e 01 42 00 00 00 00 00 00 00 00 00 [10 random bytes]` - -This can't be sent from macOS because there's no API I could find that would allow setting the service data. As far as I can tell, the Android side is hardcoded to look for that prefix in the service data so there really is no way to make it work on macOS. Android sends these BLE advertisements periodically while searching for Nearby Share targets; these are also what makes the "device nearby is sharing" notification pop up. - -The service ID (FC9F...) comes from SHA256("NearbySharing") = `fc9f5ed42c8a5e9e94684076ef3bf938a809c60ad354992b0435aebbdc58b97b`. - -### High-level diagram - -```mermaid -sequenceDiagram - Client-->>Server: (Connects to advertised TCP port) - Client->>Server: Connection request - Client->>Server: UKEY2 ClientInit - Server->>Client: UKEY2 ServerInit - Client->>Server: UKEY2 ClientFinish - Server->>Client: Connection response - Client->>Server: Connection response - Note over Server, Client: All following packets are encrypted - Server->>Client: Paired key encryption - Client->>Server: Paired key encryption - Server->>Client: Paired key result - Client->>Server: Paired key result - Client->>Server: Introduction (transfer metadata) - Note over Server: Asks the user - Server->>Client: Response (accept/reject) - Client->>Server: File chunks - Client-->>Server: - Client-->>Server: - Client->>Server: Disconnection - Client-->Server: (Close TCP connection) -``` - -From the Google point of view, the "Nearby connections" part is a separate universal transport layer, over which the "Share" runs. This may explain some bizarre arrangements where you have protobuf inside protobuf inside encrypted protobuf inside protobuf. - -### Frame/packet/message types - -There are three types of packets that can appear directly ~~on the wire~~ in the air: - -1. **Offline frames.** These are the basic uint of the nearby protocol. They are used to control the connection. -2. **UKEY2 messages.** These are used for the encryption key exchange (UKEY2 is Google's bespoke algorithm for that). -3. **Secure messages.** These are used exclusively after the initial negotiation and carry other packets inside them in the encrypted form. - -Keep the protobuf files open to follow along. - -### TCP framing - -Each protobuf message sent over the TCP connection is prefixed with 4-byte big-endian (MSB first) length. - -### Initial handshake & key exchange - -(described from the server/recipient point of view) - -After the client connects to the server, it sends two packets: a "connection request" and a "UKEY2 client init". - -#### Connection request - -This is a subtype of "offline frame". -The client wants to connect to the server and tells it about itself. The only field of interest here is `endpointInfo`. It contains the device type and name. It has the same format as the `n` TXT record described above, just without the base64 encoding. - -#### UKEY2 client init - -This is a subtype of "UKEY2 message". Google's UKEY2 reference implementation [is open source](https://github.com/google/ukey2) and comes with documentation. Please refer to that repo for details on the key exchange. -This is the initial step of the key exchange for end-to-end encryption. Upon receiving this, the server generates a ECDSA key pair and sends its public key in a "server init". The server also needs to remember the raw serialized client init message for the final key derivation step. The outgoing server init message is also needed for the next step. The bytes include the entire protobuf message but do not include the int32 length prefix. - -After receiving the server init, the client completes the key derivation and sends a "client finish", containing its public key. - -#### UKEY2 client finish - -This is where the server completes the key derivation. This step is described in detail [in the Google readme](https://github.com/google/ukey2#deriving-the-authentication-string-and-the-next-protocol-secret). - -The result of the key exchange is two values: the authentication string and the next protocol secret. - -The **next protocol secret** is further processed to obtain the two 32-byte AES and two 32-byte HMAC keys used for encryption and authentication of further communications ([relevant Chromium code](https://source.chromium.org/chromium/chromium/src/+/main:third_party/securemessage/src/cpp/src/securemessage/crypto_ops.cc) and [this as well](https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:third_party/ukey2/src/src/main/cpp/src/securegcm/d2d_crypto_ops.cc)): - -Derive two 32-byte "device to device" keys using HKDF-SHA256: - -* **D2D client key**, using the **next protocol secret** for input key material, `82AA55A0D397F88346CA1CEE8D3909B95F13FA7DEB1D4AB38376B8256DA85510` for salt, and the string `client` for info -* **D2D server key**, using the same parameters, except **info** is `server` - -Next, derive the four keys you will use for the actual encryption. All four use the same value of salt, which is `SHA256("SecureMessage")`, or `BF9D2A53C63616D75DB0A7165B91C1EF73E537F2427405FA23610A4BE657642E`. These keys are from the server POV; if you're the client, they need to be swapped around (decrypt/receive shoud use the server key and vice versa). - -* **Decrypt key**: IKM = D2D client key, info = `ENC:2` -* **Receive HMAC key**: IKM = D2D client key, info = `SIG:1` -* **Encrypt key**: IKM = D2D server key, info = `ENC:2` -* **Send HMAC key**: IKM = D2D server key, info = `SIG:1` - -The key exchange is now complete. - -The **authentication string** is used for out-of-band key verification. Nearby Share doesn't use the algorithm specified by UKEY2. Instead, a 4-digit PIN code is generated using [this algorithm](https://source.chromium.org/chromium/chromium/src/+/main:chrome/browser/nearby_sharing/nearby_sharing_service_impl.cc;l=215-230;drc=9468ba955b5794fdfaa7301fce4fb70940830c88). - -#### Connection response - -After the key exchange is complete, the server and client send each other one last plaintext message: a connection response. It's a subtype of offline frame saying that the other party has accepted the connection. All the following communication is encrypted and wrapped in the payload layer. - -### The encryption layer - -The message type on the wire is always the "secure message". A secure message has two fields: header and body, and the signature. - -Header and body is a serialized `HeaderAndBody` message. Inside, there are two fields, that are (what a surprise!) header and body. The body contains the encrypted payload. The header contains the encryption scheme (must be set to `AES256_CBC`), the signature scheme (must be set to `HMAC_SHA256`), the IV (initialization vector) for AES-CBC consisting of 16 random bytes, and the public metadata. Public metadata is needed because the protocol is extensible af. It contains two fields with constant values: version that is always 1 and type that is always `DEVICE_TO_DEVICE_MESSAGE`. - -The signature is a HMAC-SHA256 of the header-and-body fields using one of the keys derived above. - -The body inside header-and-body is encrypted using AES-CBC with PKCS7 padding. After decryption it should be a valid device to device message (see securegcm.proto). If it isn't, you did something wrong. Go back and debug your key exchange code. Cryptography is messy, don't worry, no one gets it right on the first try ¯\\\_(ツ)\_/¯ - -The device to device message contains a sequence number and a message. The message is always a serialized offline frame. The sequence number is 1 for the first message, and is incremented with each message. Client and server have their own independent sequence numbers. - -### The payload layer - -![yo dawg, I heard you like protobuf...](/images/YoDawg.jpg) - -This layer allows the transfer of arbitrarily large payloads in chunks. Payloads come in two types: bytes and files. All negotiation uses bytes payloads with protobuf messages inside. The file payloads are used for actual files. - -Payload transfer frames are wrapped into offline frames of type `PAYLOAD_TRANSFER`. These are then encrypted as described above. Meaning of the important payload transfer frame fields is as follows: - -* **header**: the metadata - * **id**: the payload identifier within the connection. Allows transferring multiple payloads in parallel. You use it to keep track of multiple transfers, associate buffers and files to it, etc. - * **type**: either `BYTES` or `FILE` - * **totalSize**: self-explanatory -* **chunk**: the data itself - * **offset**: the offset at which this chunk needs to be written into the buffer or file - * **flags**: if `LAST_CHUNK` (bit 0) is set, the transfer is complete and this is the last chunk - * **body**: the data bytes themselves - -Android does this thing where it sends 2 payload transfer frames in succession for each negotiation message: the first contains the entire message, the second contains 0 bytes but has the `LAST_CHUNK` flag set. I replicated this behavior in NearDrop. - -### The "paired key encryption", whatever that is - -The client and the server send each other a "paired key encryption" frame, wrapped into the payload layer. *Presumably*, this is used for all the visibility-restriction phone number stuff. Also presumably getting the data contained within involves talking to Google servers. I set `secretIDHash` to 6 random bytes and `signedData` to 72 random bytes in the ones I send. It works fine. - -After that, the client and the server send each other a "paired key result" frame. Both have `status` set to `UNABLE`. Whatever. - -These and following protobuf messages are specific to Nearby Share and [are defined here](/NearDrop/ProtobufSource/wire_format.proto). - -### The transfer metadata aka introduction - -After the successful exchange of the meaningless paired key encryption frames, the client sends an "introduction" frame to the server. This contains the list of files that the client is about to send to the server. The fields should be self-explanatory. The `payload_id` will be used in the payload layer for transferring that particluar file. - -At this point, Android shows that the connection was successful and displays the PIN code. The server would prompt the user to accept the transfer. - -### The file transfer - -#### Accepting the transfer - -To accept the transfer, the server sends a "response" frame with `status` set to `ACCEPT`. The client will then start sending file chunks over the payload layer. You did it 🎉 - -#### Rejecting the transfer - -Do the same but set `status` to `REJECT`. There are also other status codes, like `NOT_ENOUGH_SPACE`, that result in Android showing a different error. - -### Keep-alive frames - -Android sends offline frames of type `KEEP_ALIVE` every 10 seconds and expects the server to do the same. If you don't, it will terminate the connection after a while thinking your app crashed or something. This especially comes into play when sending large files. No, TCP's built-in acknowledgements are not enough. There are so many abstraction layers that whoever came up with this forgot about them. - -### The "mediums" - -Nearby Connections, the underlying layer of Nearby Share, supports running over different "mediums" as Google calls them. Wi-Fi LAN is one of them. Bluetooth, BLE, Wi-Fi Direct, to name a few, are others. - -The server is in charge of choosing the medium. The client specifies its supported mediums in its "connection request" packet. The server then intersects that with its own set of supported mediums. After the transfer is accepted, the server may ask the client for a "bandwidth upgrade" by sending a corresponding packet with its chosen medium and authentication credentials, if any. - -It is still not clear how the actual medium switch occurs. diff --git a/QuickDrop.xcodeproj/project.pbxproj b/QuickDrop.xcodeproj/project.pbxproj index 19ca9bf..1fad6cc 100644 --- a/QuickDrop.xcodeproj/project.pbxproj +++ b/QuickDrop.xcodeproj/project.pbxproj @@ -3,49 +3,85 @@ archiveVersion = 1; classes = { }; - objectVersion = 60; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ 691F53BB2ABB70840089FD92 /* DeviceListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691F53B92ABB70840089FD92 /* DeviceListCell.swift */; }; 691F53BC2ABB70840089FD92 /* DeviceListCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 691F53BA2ABB70840089FD92 /* DeviceListCell.xib */; }; - 691F53BE2ABF03820089FD92 /* OutboundNearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691F53BD2ABF03820089FD92 /* OutboundNearbyConnection.swift */; }; 699DEBA62AB0573200115D22 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 699DEBA52AB0573200115D22 /* ShareViewController.swift */; }; 699DEBA92AB0573200115D22 /* ShareViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 699DEBA72AB0573200115D22 /* ShareViewController.xib */; }; 699DEBAE2AB0573200115D22 /* QuickDropShareExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 699DEBA12AB0573200115D22 /* QuickDropShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 69D2C32F29E7898C00EC7E30 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 69D2C32E29E7898C00EC7E30 /* MainMenu.xib */; }; 69DA9A1229E0BF5100A442DA /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A1129E0BF5100A442DA /* AppDelegate.swift */; }; 69DA9A1429E0BF5200A442DA /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 69DA9A1329E0BF5200A442DA /* Assets.xcassets */; }; - 69DCF48A2AB70E8C00CBE2CC /* wire_format.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2929E18CB500A442DA /* wire_format.pb.swift */; }; - 69DCF48B2AB70E8C00CBE2CC /* ukey.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2829E18CB500A442DA /* ukey.pb.swift */; }; - 69DCF48C2AB70E8C00CBE2CC /* device_to_device_messages.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2A29E18CB500A442DA /* device_to_device_messages.pb.swift */; }; - 69DCF48D2AB70E8C00CBE2CC /* offline_wire_formats.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2B29E18CB500A442DA /* offline_wire_formats.pb.swift */; }; - 69DCF48E2AB70E8C00CBE2CC /* securegcm.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2C29E18CB500A442DA /* securegcm.pb.swift */; }; - 69DCF48F2AB70E8C00CBE2CC /* securemessage.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2D29E18CB500A442DA /* securemessage.pb.swift */; }; - 69DCF4902AB70E9700CBE2CC /* InboundNearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2229E17F0400A442DA /* InboundNearbyConnection.swift */; }; - 69DCF4912AB70E9700CBE2CC /* NearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 698DFAE529E2F91A0064F247 /* NearbyConnection.swift */; }; - 69DCF4922AB70E9700CBE2CC /* NearbyConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A1E29E0C0B300A442DA /* NearbyConnectionManager.swift */; }; - 69DCF4942AB8BF7B00CBE2CC /* libNearbyShare.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DCF4812AB70D0600CBE2CC /* libNearbyShare.dylib */; }; - 69DCF4952AB8BF7B00CBE2CC /* libNearbyShare.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 69DCF4812AB70D0600CBE2CC /* libNearbyShare.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 69DCF49A2AB8C58500CBE2CC /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = 69DCF4992AB8C58500CBE2CC /* SwiftProtobuf */; }; - 69DCF49C2AB8C58500CBE2CC /* SwiftECC in Frameworks */ = {isa = PBXBuildFile; productRef = 69DCF49B2AB8C58500CBE2CC /* SwiftECC */; }; - 69DCF49D2AB8C9A500CBE2CC /* libNearbyShare.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 69DCF4812AB70D0600CBE2CC /* libNearbyShare.dylib */; }; - 69DCF49E2AB8C9A500CBE2CC /* libNearbyShare.dylib in Embed Libraries */ = {isa = PBXBuildFile; fileRef = 69DCF4812AB70D0600CBE2CC /* libNearbyShare.dylib */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - EB2B41E42DC63ACC0070FC39 /* SleepManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB2B41E32DC63AC80070FC39 /* SleepManager.swift */; }; - EB2F9BFB2DA04B69004010A2 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB2F9BFA2DA04B67004010A2 /* Helpers.swift */; }; EB2F9BFE2DA05F48004010A2 /* BezelNotification in Frameworks */ = {isa = PBXBuildFile; productRef = EB2F9BFD2DA05F48004010A2 /* BezelNotification */; }; EB3643602D73A2A2009CDFF8 /* AudioManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB36435F2D73A29F009CDFF8 /* AudioManager.swift */; }; EB5C36932E34EBBD0052EFD7 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = EB5C36922E34EBBD0052EFD7 /* Localizable.xcstrings */; }; EB5C36942E34EBBD0052EFD7 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = EB5C36922E34EBBD0052EFD7 /* Localizable.xcstrings */; }; EB5C36E42E34EC0E0052EFD7 /* License.txt in Resources */ = {isa = PBXBuildFile; fileRef = EB5C36E32E34EC0E0052EFD7 /* License.txt */; }; EB5C36E52E34EC0E0052EFD7 /* License.txt in Resources */ = {isa = PBXBuildFile; fileRef = EB5C36E32E34EC0E0052EFD7 /* License.txt */; }; - EB5C36E72E3544FF0052EFD7 /* SaveFilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C36E62E3544FB0052EFD7 /* SaveFilesManager.swift */; }; - EB5C36E92E3546120052EFD7 /* DataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C36E82E3546100052EFD7 /* DataModel.swift */; }; - EB6E743E2DD5C77700331466 /* ConnectionFailureTracker.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB6E743D2DD5C76F00331466 /* ConnectionFailureTracker.swift */; }; + EB5C37B82E377A6F0052EFD7 /* SleepManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB2B41E32DC63AC80070FC39 /* SleepManager.swift */; }; + EB5C37B92E377A6F0052EFD7 /* SaveFilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C36E62E3544FB0052EFD7 /* SaveFilesManager.swift */; }; + EB5C37BA2E377A6F0052EFD7 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB2F9BFA2DA04B67004010A2 /* Helpers.swift */; }; + EB5C37BC2E377A700052EFD7 /* SleepManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB2B41E32DC63AC80070FC39 /* SleepManager.swift */; }; + EB5C37BD2E377A700052EFD7 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB2F9BFA2DA04B67004010A2 /* Helpers.swift */; }; + EB5C37BE2E377A700052EFD7 /* SaveFilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C36E62E3544FB0052EFD7 /* SaveFilesManager.swift */; }; + EB5C37BF2E377A780052EFD7 /* ukey.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2829E18CB500A442DA /* ukey.pb.swift */; }; + EB5C37C02E377A780052EFD7 /* securemessage.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2D29E18CB500A442DA /* securemessage.pb.swift */; }; + EB5C37C12E377A780052EFD7 /* offline_wire_formats.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2B29E18CB500A442DA /* offline_wire_formats.pb.swift */; }; + EB5C37C22E377A780052EFD7 /* device_to_device_messages.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2A29E18CB500A442DA /* device_to_device_messages.pb.swift */; }; + EB5C37C32E377A780052EFD7 /* wire_format.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2929E18CB500A442DA /* wire_format.pb.swift */; }; + EB5C37C42E377A780052EFD7 /* securegcm.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2C29E18CB500A442DA /* securegcm.pb.swift */; }; + EB5C37C52E377A780052EFD7 /* securemessage.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2D29E18CB500A442DA /* securemessage.pb.swift */; }; + EB5C37C62E377A780052EFD7 /* securegcm.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2C29E18CB500A442DA /* securegcm.pb.swift */; }; + EB5C37C72E377A780052EFD7 /* wire_format.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2929E18CB500A442DA /* wire_format.pb.swift */; }; + EB5C37C82E377A780052EFD7 /* ukey.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2829E18CB500A442DA /* ukey.pb.swift */; }; + EB5C37C92E377A780052EFD7 /* device_to_device_messages.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2A29E18CB500A442DA /* device_to_device_messages.pb.swift */; }; + EB5C37CA2E377A780052EFD7 /* offline_wire_formats.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2B29E18CB500A442DA /* offline_wire_formats.pb.swift */; }; + EB5C37CB2E377A7F0052EFD7 /* NearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 698DFAE529E2F91A0064F247 /* NearbyConnection.swift */; }; + EB5C37CC2E377A7F0052EFD7 /* DataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C36E82E3546100052EFD7 /* DataModel.swift */; }; + EB5C37CD2E377A7F0052EFD7 /* OutboundNearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691F53BD2ABF03820089FD92 /* OutboundNearbyConnection.swift */; }; + EB5C37CE2E377A7F0052EFD7 /* InboundNearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2229E17F0400A442DA /* InboundNearbyConnection.swift */; }; + EB5C37CF2E377A7F0052EFD7 /* NearbyConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A1E29E0C0B300A442DA /* NearbyConnectionManager.swift */; }; + EB5C37D02E377A7F0052EFD7 /* OutboundNearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691F53BD2ABF03820089FD92 /* OutboundNearbyConnection.swift */; }; + EB5C37D12E377A7F0052EFD7 /* DataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C36E82E3546100052EFD7 /* DataModel.swift */; }; + EB5C37D22E377A7F0052EFD7 /* NearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 698DFAE529E2F91A0064F247 /* NearbyConnection.swift */; }; + EB5C37D32E377A7F0052EFD7 /* InboundNearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2229E17F0400A442DA /* InboundNearbyConnection.swift */; }; + EB5C37D42E377A7F0052EFD7 /* NearbyConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A1E29E0C0B300A442DA /* NearbyConnectionManager.swift */; }; + EB5C37D62E377ACF0052EFD7 /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = EB5C37D52E377ACF0052EFD7 /* SwiftProtobuf */; }; + EB5C37D82E377ACF0052EFD7 /* SwiftECC in Frameworks */ = {isa = PBXBuildFile; productRef = EB5C37D72E377ACF0052EFD7 /* SwiftECC */; }; + EB5C37DA2E377AD60052EFD7 /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = EB5C37D92E377AD60052EFD7 /* SwiftProtobuf */; }; + EB5C37DC2E377AD60052EFD7 /* SwiftECC in Frameworks */ = {isa = PBXBuildFile; productRef = EB5C37DB2E377AD60052EFD7 /* SwiftECC */; }; + EB5C37EE2E377C3F0052EFD7 /* SwiftProtobuf in Frameworks */ = {isa = PBXBuildFile; productRef = EB5C37ED2E377C3F0052EFD7 /* SwiftProtobuf */; }; + EB5C37F02E377C3F0052EFD7 /* SwiftECC in Frameworks */ = {isa = PBXBuildFile; productRef = EB5C37EF2E377C3F0052EFD7 /* SwiftECC */; }; + EB5C37F12E377CE70052EFD7 /* ukey.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2829E18CB500A442DA /* ukey.pb.swift */; }; + EB5C37F22E377CE70052EFD7 /* NearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 698DFAE529E2F91A0064F247 /* NearbyConnection.swift */; }; + EB5C37F32E377CE70052EFD7 /* SaveFilesManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C36E62E3544FB0052EFD7 /* SaveFilesManager.swift */; }; + EB5C37F42E377CE70052EFD7 /* NearbyConnectionManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A1E29E0C0B300A442DA /* NearbyConnectionManager.swift */; }; + EB5C37F52E377CE70052EFD7 /* securemessage.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2D29E18CB500A442DA /* securemessage.pb.swift */; }; + EB5C37F62E377CE70052EFD7 /* device_to_device_messages.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2A29E18CB500A442DA /* device_to_device_messages.pb.swift */; }; + EB5C37F82E377CE70052EFD7 /* SleepManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB2B41E32DC63AC80070FC39 /* SleepManager.swift */; }; + EB5C37F92E377CE70052EFD7 /* securegcm.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2C29E18CB500A442DA /* securegcm.pb.swift */; }; + EB5C37FA2E377CE70052EFD7 /* Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB2F9BFA2DA04B67004010A2 /* Helpers.swift */; }; + EB5C37FB2E377CE70052EFD7 /* InboundNearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2229E17F0400A442DA /* InboundNearbyConnection.swift */; }; + EB5C37FC2E377CE70052EFD7 /* OutboundNearbyConnection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 691F53BD2ABF03820089FD92 /* OutboundNearbyConnection.swift */; }; + EB5C37FD2E377CE70052EFD7 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */; }; + EB5C37FE2E377CE70052EFD7 /* offline_wire_formats.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2B29E18CB500A442DA /* offline_wire_formats.pb.swift */; }; + EB5C37FF2E377CE70052EFD7 /* wire_format.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 69DA9A2929E18CB500A442DA /* wire_format.pb.swift */; }; + EB5C38002E377CE70052EFD7 /* DataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C36E82E3546100052EFD7 /* DataModel.swift */; }; + EB5C38012E377DE60052EFD7 /* Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96ED8E2D7F8103004B3FF1 /* Localized.swift */; }; + EB5C38392E38C1F60052EFD7 /* justMaybe.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = EB5C38382E38C1F60052EFD7 /* justMaybe.mp3 */; }; + EB5C383A2E38C1F60052EFD7 /* justMaybe.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = EB5C38382E38C1F60052EFD7 /* justMaybe.mp3 */; }; + EB5C383B2E38C1F60052EFD7 /* justMaybe.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = EB5C38382E38C1F60052EFD7 /* justMaybe.mp3 */; }; + EB5C383C2E38C2D90052EFD7 /* AudioManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB36435F2D73A29F009CDFF8 /* AudioManager.swift */; }; + EB5C383D2E38C2D90052EFD7 /* AudioManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB36435F2D73A29F009CDFF8 /* AudioManager.swift */; }; + EB5C383F2E38C49D0052EFD7 /* LaunchAtLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C383E2E38C49D0052EFD7 /* LaunchAtLogin.swift */; }; + EB5C38402E38C49D0052EFD7 /* LaunchAtLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C383E2E38C49D0052EFD7 /* LaunchAtLogin.swift */; }; + EB5C38412E38C49D0052EFD7 /* LaunchAtLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB5C383E2E38C49D0052EFD7 /* LaunchAtLogin.swift */; }; EB6F62D72D91F4AF00534EC2 /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB6F62D62D91F4AC00534EC2 /* SettingsView.swift */; }; EB7CD1452D6FB0C300CB0CB5 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */; }; EB7CD1462D6FB0E800CB0CB5 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */; }; - EB7CD1472D6FB0E800CB0CB5 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */; }; EB7F54122D78E96000989564 /* TutorialView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7F54112D78E95C00989564 /* TutorialView.swift */; }; EB7F54142D78E9E700989564 /* LicenseWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB7F54132D78E9E400989564 /* LicenseWindow.swift */; }; EB96ED8B2D7F7CF7004B3FF1 /* SmallSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96ED8A2D7F7CF4004B3FF1 /* SmallSheetView.swift */; }; @@ -53,7 +89,9 @@ EB96ED8D2D7F7EA3004B3FF1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 69DA9A1329E0BF5200A442DA /* Assets.xcassets */; }; EB96ED8F2D7F8105004B3FF1 /* Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96ED8E2D7F8103004B3FF1 /* Localized.swift */; }; EB96ED902D7F8114004B3FF1 /* Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96ED8E2D7F8103004B3FF1 /* Localized.swift */; }; - EBC05C592E32C22200EECC18 /* Localized.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB96ED8E2D7F8103004B3FF1 /* Localized.swift */; }; + EB9925802E45D53E00357055 /* sharing_enums.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB99257F2E45D53E00357055 /* sharing_enums.pb.swift */; }; + EB9925812E45D53E00357055 /* sharing_enums.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB99257F2E45D53E00357055 /* sharing_enums.pb.swift */; }; + EB9925822E45D53E00357055 /* sharing_enums.pb.swift in Sources */ = {isa = PBXBuildFile; fileRef = EB99257F2E45D53E00357055 /* sharing_enums.pb.swift */; }; EBC05C5B2E33937200EECC18 /* ErrorAlertHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC05C5A2E33936C00EECC18 /* ErrorAlertHandler.swift */; }; EBC05C5C2E3394EF00EECC18 /* ErrorAlertHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC05C5A2E33936C00EECC18 /* ErrorAlertHandler.swift */; }; EBC05C712E33B57D00EECC18 /* Converter.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC05C6D2E33B57D00EECC18 /* Converter.swift */; }; @@ -85,20 +123,6 @@ remoteGlobalIDString = 699DEBA02AB0573200115D22; remoteInfo = ShareExtension; }; - 69DCF4962AB8BF7B00CBE2CC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 69DA9A0629E0BF5100A442DA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 69DCF4802AB70D0600CBE2CC; - remoteInfo = NearbyShare; - }; - 69DCF49F2AB8C9A500CBE2CC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 69DA9A0629E0BF5100A442DA /* Project object */; - proxyType = 1; - remoteGlobalIDString = 69DCF4802AB70D0600CBE2CC; - remoteInfo = NearbyShare; - }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -129,7 +153,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 69DCF4952AB8BF7B00CBE2CC /* libNearbyShare.dylib in Embed Libraries */, ); name = "Embed Libraries"; runOnlyForDeploymentPostprocessing = 0; @@ -140,7 +163,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - 69DCF49E2AB8C9A500CBE2CC /* libNearbyShare.dylib in Embed Libraries */, ); name = "Embed Libraries"; runOnlyForDeploymentPostprocessing = 0; @@ -172,28 +194,24 @@ 69DA9A2B29E18CB500A442DA /* offline_wire_formats.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = offline_wire_formats.pb.swift; sourceTree = ""; }; 69DA9A2C29E18CB500A442DA /* securegcm.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = securegcm.pb.swift; sourceTree = ""; }; 69DA9A2D29E18CB500A442DA /* securemessage.pb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = securemessage.pb.swift; sourceTree = ""; }; - 69DCF4812AB70D0600CBE2CC /* libNearbyShare.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = libNearbyShare.dylib; sourceTree = BUILT_PRODUCTS_DIR; }; EB2B41E32DC63AC80070FC39 /* SleepManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SleepManager.swift; sourceTree = ""; }; EB2F9BFA2DA04B67004010A2 /* Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helpers.swift; sourceTree = ""; }; EB36435F2D73A29F009CDFF8 /* AudioManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioManager.swift; sourceTree = ""; }; - EB3B73F32DC8FF3A00369951 /* device_to_device_messages.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = device_to_device_messages.proto; sourceTree = ""; }; - EB3B73F42DC8FF3A00369951 /* offline_wire_formats.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = offline_wire_formats.proto; sourceTree = ""; }; - EB3B73F52DC8FF3A00369951 /* securegcm.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = securegcm.proto; sourceTree = ""; }; - EB3B73F62DC8FF3A00369951 /* securemessage.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = securemessage.proto; sourceTree = ""; }; - EB3B73F72DC8FF3A00369951 /* ukey.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = ukey.proto; sourceTree = ""; }; - EB3B73F82DC8FF3A00369951 /* wire_format.proto */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.protobuf; path = wire_format.proto; sourceTree = ""; }; EB5C36922E34EBBD0052EFD7 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; EB5C36952E34EBBD0052EFD7 /* mul */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; name = mul; path = mul.lproj/ShareViewController.xcstrings; sourceTree = ""; }; EB5C36E32E34EC0E0052EFD7 /* License.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = License.txt; sourceTree = ""; }; EB5C36E62E3544FB0052EFD7 /* SaveFilesManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SaveFilesManager.swift; sourceTree = ""; }; EB5C36E82E3546100052EFD7 /* DataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DataModel.swift; sourceTree = ""; }; - EB6E743D2DD5C76F00331466 /* ConnectionFailureTracker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionFailureTracker.swift; sourceTree = ""; }; + EB5C37E22E377C2E0052EFD7 /* QuickDropiOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuickDropiOS.app; sourceTree = BUILT_PRODUCTS_DIR; }; + EB5C38382E38C1F60052EFD7 /* justMaybe.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = justMaybe.mp3; sourceTree = ""; }; + EB5C383E2E38C49D0052EFD7 /* LaunchAtLogin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LaunchAtLogin.swift; sourceTree = ""; }; EB6F62D62D91F4AC00534EC2 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = ""; }; EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = ""; }; EB7F54112D78E95C00989564 /* TutorialView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TutorialView.swift; sourceTree = ""; }; EB7F54132D78E9E400989564 /* LicenseWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LicenseWindow.swift; sourceTree = ""; }; EB96ED8A2D7F7CF4004B3FF1 /* SmallSheetView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmallSheetView.swift; sourceTree = ""; }; EB96ED8E2D7F8103004B3FF1 /* Localized.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Localized.swift; sourceTree = ""; }; + EB99257F2E45D53E00357055 /* sharing_enums.pb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = sharing_enums.pb.swift; sourceTree = ""; }; EBC05C5A2E33936C00EECC18 /* ErrorAlertHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorAlertHandler.swift; sourceTree = ""; }; EBC05C6D2E33B57D00EECC18 /* Converter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Converter.swift; sourceTree = ""; }; EBC05C6E2E33B57D00EECC18 /* Helper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Helper.swift; sourceTree = ""; }; @@ -210,12 +228,17 @@ EBD2A2162D2860BE00BCB8E2 /* WelcomeScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeScreen.swift; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedRootGroup section */ + EB5C37E32E377C2E0052EFD7 /* QuickDropiOS */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = QuickDropiOS; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ 699DEB9E2AB0573200115D22 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 69DCF49D2AB8C9A500CBE2CC /* libNearbyShare.dylib in Frameworks */, + EB5C37D82E377ACF0052EFD7 /* SwiftECC in Frameworks */, + EB5C37D62E377ACF0052EFD7 /* SwiftProtobuf in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -224,16 +247,17 @@ buildActionMask = 2147483647; files = ( EB2F9BFE2DA05F48004010A2 /* BezelNotification in Frameworks */, - 69DCF4942AB8BF7B00CBE2CC /* libNearbyShare.dylib in Frameworks */, + EB5C37DC2E377AD60052EFD7 /* SwiftECC in Frameworks */, + EB5C37DA2E377AD60052EFD7 /* SwiftProtobuf in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; - 69DCF47F2AB70D0600CBE2CC /* Frameworks */ = { + EB5C37DF2E377C2E0052EFD7 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 69DCF49C2AB8C58500CBE2CC /* SwiftECC in Frameworks */, - 69DCF49A2AB8C58500CBE2CC /* SwiftProtobuf in Frameworks */, + EB5C37F02E377C3F0052EFD7 /* SwiftECC in Frameworks */, + EB5C37EE2E377C3F0052EFD7 /* SwiftProtobuf in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -267,6 +291,7 @@ 69DA9A1029E0BF5100A442DA /* QuickDrop */, 699DEBA22AB0573200115D22 /* ShareExtension */, 69DCF4822AB70D0600CBE2CC /* NearbyShare */, + EB5C37E32E377C2E0052EFD7 /* QuickDropiOS */, 698DFAEC29E353220064F247 /* Frameworks */, 69DA9A0F29E0BF5100A442DA /* Products */, EBC05C8B2E33B59E00EECC18 /* Resources */, @@ -278,7 +303,7 @@ children = ( 69DA9A0E29E0BF5100A442DA /* QuickDrop.app */, 699DEBA12AB0573200115D22 /* QuickDropShareExtension.appex */, - 69DCF4812AB70D0600CBE2CC /* libNearbyShare.dylib */, + EB5C37E22E377C2E0052EFD7 /* QuickDropiOS.app */, ); name = Products; sourceTree = ""; @@ -305,6 +330,7 @@ 69DA9A2929E18CB500A442DA /* wire_format.pb.swift */, 69DA9A2A29E18CB500A442DA /* device_to_device_messages.pb.swift */, 69DA9A2B29E18CB500A442DA /* offline_wire_formats.pb.swift */, + EB99257F2E45D53E00357055 /* sharing_enums.pb.swift */, 69DA9A2C29E18CB500A442DA /* securegcm.pb.swift */, 69DA9A2D29E18CB500A442DA /* securemessage.pb.swift */, ); @@ -314,35 +340,21 @@ 69DCF4822AB70D0600CBE2CC /* NearbyShare */ = { isa = PBXGroup; children = ( + EB5C37DD2E377B430052EFD7 /* Model */, EB5C371C2E3669010052EFD7 /* Util */, - EB3B73F92DC8FF3A00369951 /* ProtobufSource */, - 69DA9A2729E18CB500A442DA /* Protobuf */, EB5C371D2E3669150052EFD7 /* Connection */, ); path = NearbyShare; sourceTree = ""; }; - EB3B73F92DC8FF3A00369951 /* ProtobufSource */ = { - isa = PBXGroup; - children = ( - EB3B73F32DC8FF3A00369951 /* device_to_device_messages.proto */, - EB3B73F42DC8FF3A00369951 /* offline_wire_formats.proto */, - EB3B73F52DC8FF3A00369951 /* securegcm.proto */, - EB3B73F62DC8FF3A00369951 /* securemessage.proto */, - EB3B73F72DC8FF3A00369951 /* ukey.proto */, - EB3B73F82DC8FF3A00369951 /* wire_format.proto */, - ); - path = ProtobufSource; - sourceTree = ""; - }; EB5C371C2E3669010052EFD7 /* Util */ = { isa = PBXGroup; children = ( + EB96ED8E2D7F8103004B3FF1 /* Localized.swift */, EB2B41E32DC63AC80070FC39 /* SleepManager.swift */, EB7CD1442D6FB0C100CB0CB5 /* Logger.swift */, EB5C36E62E3544FB0052EFD7 /* SaveFilesManager.swift */, EB2F9BFA2DA04B67004010A2 /* Helpers.swift */, - EB6E743D2DD5C76F00331466 /* ConnectionFailureTracker.swift */, ); path = Util; sourceTree = ""; @@ -352,7 +364,6 @@ children = ( 69DA9A1E29E0C0B300A442DA /* NearbyConnectionManager.swift */, 69DA9A2229E17F0400A442DA /* InboundNearbyConnection.swift */, - EB5C36E82E3546100052EFD7 /* DataModel.swift */, 691F53BD2ABF03820089FD92 /* OutboundNearbyConnection.swift */, 698DFAE529E2F91A0064F247 /* NearbyConnection.swift */, ); @@ -378,6 +389,15 @@ path = Util; sourceTree = ""; }; + EB5C37DD2E377B430052EFD7 /* Model */ = { + isa = PBXGroup; + children = ( + 69DA9A2729E18CB500A442DA /* Protobuf */, + EB5C36E82E3546100052EFD7 /* DataModel.swift */, + ); + path = Model; + sourceTree = ""; + }; EBC05C6A2E33B55100EECC18 /* View */ = { isa = PBXGroup; children = ( @@ -394,9 +414,9 @@ EBC05C6B2E33B57100EECC18 /* Util */ = { isa = PBXGroup; children = ( + EB5C383E2E38C49D0052EFD7 /* LaunchAtLogin.swift */, EB36435F2D73A29F009CDFF8 /* AudioManager.swift */, EBC05C5A2E33936C00EECC18 /* ErrorAlertHandler.swift */, - EB96ED8E2D7F8103004B3FF1 /* Localized.swift */, ); path = Util; sourceTree = ""; @@ -436,6 +456,7 @@ isa = PBXGroup; children = ( EB5C36E32E34EC0E0052EFD7 /* License.txt */, + EB5C38382E38C1F60052EFD7 /* justMaybe.mp3 */, EBC05C8A2E33B59E00EECC18 /* timeIsNow.mp3 */, ); path = Resources; @@ -443,16 +464,6 @@ }; /* End PBXGroup section */ -/* Begin PBXHeadersBuildPhase section */ - 69DCF47D2AB70D0600CBE2CC /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - /* Begin PBXNativeTarget section */ 699DEBA02AB0573200115D22 /* QuickDropShareExtension */ = { isa = PBXNativeTarget; @@ -466,7 +477,6 @@ buildRules = ( ); dependencies = ( - 69DCF4A02AB8C9A500CBE2CC /* PBXTargetDependency */, ); name = QuickDropShareExtension; productName = ShareExtension; @@ -488,36 +498,40 @@ ); dependencies = ( 699DEBAD2AB0573200115D22 /* PBXTargetDependency */, - 69DCF4972AB8BF7B00CBE2CC /* PBXTargetDependency */, ); name = QuickDrop; packageProductDependencies = ( EB2F9BFD2DA05F48004010A2 /* BezelNotification */, + EB5C37D92E377AD60052EFD7 /* SwiftProtobuf */, + EB5C37DB2E377AD60052EFD7 /* SwiftECC */, ); productName = NearDrop; productReference = 69DA9A0E29E0BF5100A442DA /* QuickDrop.app */; productType = "com.apple.product-type.application"; }; - 69DCF4802AB70D0600CBE2CC /* NearbyShare */ = { + EB5C37E12E377C2E0052EFD7 /* QuickDropiOS */ = { isa = PBXNativeTarget; - buildConfigurationList = 69DCF4892AB70D0600CBE2CC /* Build configuration list for PBXNativeTarget "NearbyShare" */; + buildConfigurationList = EB5C37EA2E377C310052EFD7 /* Build configuration list for PBXNativeTarget "QuickDropiOS" */; buildPhases = ( - 69DCF47D2AB70D0600CBE2CC /* Headers */, - 69DCF47E2AB70D0600CBE2CC /* Sources */, - 69DCF47F2AB70D0600CBE2CC /* Frameworks */, + EB5C37DE2E377C2E0052EFD7 /* Sources */, + EB5C37DF2E377C2E0052EFD7 /* Frameworks */, + EB5C37E02E377C2E0052EFD7 /* Resources */, ); buildRules = ( ); dependencies = ( ); - name = NearbyShare; - packageProductDependencies = ( - 69DCF4992AB8C58500CBE2CC /* SwiftProtobuf */, - 69DCF49B2AB8C58500CBE2CC /* SwiftECC */, + fileSystemSynchronizedGroups = ( + EB5C37E32E377C2E0052EFD7 /* QuickDropiOS */, ); - productName = NearbyShare; - productReference = 69DCF4812AB70D0600CBE2CC /* libNearbyShare.dylib */; - productType = "com.apple.product-type.library.dynamic"; + name = QuickDropiOS; + packageProductDependencies = ( + EB5C37ED2E377C3F0052EFD7 /* SwiftProtobuf */, + EB5C37EF2E377C3F0052EFD7 /* SwiftECC */, + ); + productName = QuickDropiOS; + productReference = EB5C37E22E377C2E0052EFD7 /* QuickDropiOS.app */; + productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -526,8 +540,8 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1430; - LastUpgradeCheck = 1620; + LastSwiftUpdateCheck = 1640; + LastUpgradeCheck = 1640; TargetAttributes = { 699DEBA02AB0573200115D22 = { CreatedOnToolsVersion = 14.3.1; @@ -536,8 +550,8 @@ CreatedOnToolsVersion = 14.3; LastSwiftMigration = 1430; }; - 69DCF4802AB70D0600CBE2CC = { - CreatedOnToolsVersion = 14.3.1; + EB5C37E12E377C2E0052EFD7 = { + CreatedOnToolsVersion = 16.4; }; }; }; @@ -577,7 +591,7 @@ targets = ( 69DA9A0D29E0BF5100A442DA /* QuickDrop */, 699DEBA02AB0573200115D22 /* QuickDropShareExtension */, - 69DCF4802AB70D0600CBE2CC /* NearbyShare */, + EB5C37E12E377C2E0052EFD7 /* QuickDropiOS */, ); }; /* End PBXProject section */ @@ -592,6 +606,7 @@ 691F53BC2ABB70840089FD92 /* DeviceListCell.xib in Resources */, 699DEBA92AB0573200115D22 /* ShareViewController.xib in Resources */, EB96ED8D2D7F7EA3004B3FF1 /* Assets.xcassets in Resources */, + EB5C383A2E38C1F60052EFD7 /* justMaybe.mp3 in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -604,6 +619,15 @@ EB5C36932E34EBBD0052EFD7 /* Localizable.xcstrings in Resources */, EBC05C8C2E33B59E00EECC18 /* timeIsNow.mp3 in Resources */, 69D2C32F29E7898C00EC7E30 /* MainMenu.xib in Resources */, + EB5C38392E38C1F60052EFD7 /* justMaybe.mp3 in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + EB5C37E02E377C2E0052EFD7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + EB5C383B2E38C1F60052EFD7 /* justMaybe.mp3 in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -623,10 +647,27 @@ EB96ED8B2D7F7CF7004B3FF1 /* SmallSheetView.swift in Sources */, EBCC27F92D80C9F90079C478 /* Zip.swift in Sources */, EB7CD1462D6FB0E800CB0CB5 /* Logger.swift in Sources */, + EB5C37C52E377A780052EFD7 /* securemessage.pb.swift in Sources */, + EB5C37C62E377A780052EFD7 /* securegcm.pb.swift in Sources */, + EB5C37C72E377A780052EFD7 /* wire_format.pb.swift in Sources */, + EB5C37C82E377A780052EFD7 /* ukey.pb.swift in Sources */, + EB5C37C92E377A780052EFD7 /* device_to_device_messages.pb.swift in Sources */, + EB5C383C2E38C2D90052EFD7 /* AudioManager.swift in Sources */, + EB5C37CA2E377A780052EFD7 /* offline_wire_formats.pb.swift in Sources */, EBC05C5C2E3394EF00EECC18 /* ErrorAlertHandler.swift in Sources */, EBC05C7B2E33B58100EECC18 /* ActiveNetworkInterface.swift in Sources */, EBC05C7C2E33B58100EECC18 /* ApIsolationTester.swift in Sources */, 691F53BB2ABB70840089FD92 /* DeviceListCell.swift in Sources */, + EB5C383F2E38C49D0052EFD7 /* LaunchAtLogin.swift in Sources */, + EB5C37BC2E377A700052EFD7 /* SleepManager.swift in Sources */, + EB5C37D02E377A7F0052EFD7 /* OutboundNearbyConnection.swift in Sources */, + EB5C37D12E377A7F0052EFD7 /* DataModel.swift in Sources */, + EB5C37D22E377A7F0052EFD7 /* NearbyConnection.swift in Sources */, + EB5C37D32E377A7F0052EFD7 /* InboundNearbyConnection.swift in Sources */, + EB5C37D42E377A7F0052EFD7 /* NearbyConnectionManager.swift in Sources */, + EB5C37BD2E377A700052EFD7 /* Helpers.swift in Sources */, + EB5C37BE2E377A700052EFD7 /* SaveFilesManager.swift in Sources */, + EB9925822E45D53E00357055 /* sharing_enums.pb.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -636,11 +677,26 @@ files = ( EBD2A2172D2860C100BCB8E2 /* WelcomeScreen.swift in Sources */, EB3643602D73A2A2009CDFF8 /* AudioManager.swift in Sources */, + EB5C38412E38C49D0052EFD7 /* LaunchAtLogin.swift in Sources */, + EB5C37B82E377A6F0052EFD7 /* SleepManager.swift in Sources */, + EB5C37B92E377A6F0052EFD7 /* SaveFilesManager.swift in Sources */, + EB5C37BA2E377A6F0052EFD7 /* Helpers.swift in Sources */, EBC05C5B2E33937200EECC18 /* ErrorAlertHandler.swift in Sources */, EBC05C712E33B57D00EECC18 /* Converter.swift in Sources */, EBC05C722E33B57D00EECC18 /* Helper.swift in Sources */, EBC05C732E33B57D00EECC18 /* PlusView.swift in Sources */, + EB5C37BF2E377A780052EFD7 /* ukey.pb.swift in Sources */, + EB5C37C02E377A780052EFD7 /* securemessage.pb.swift in Sources */, + EB5C37C12E377A780052EFD7 /* offline_wire_formats.pb.swift in Sources */, + EB5C37C22E377A780052EFD7 /* device_to_device_messages.pb.swift in Sources */, + EB5C37C32E377A780052EFD7 /* wire_format.pb.swift in Sources */, + EB5C37C42E377A780052EFD7 /* securegcm.pb.swift in Sources */, EBC05C782E33B58100EECC18 /* ActiveNetworkInterface.swift in Sources */, + EB5C37CB2E377A7F0052EFD7 /* NearbyConnection.swift in Sources */, + EB5C37CC2E377A7F0052EFD7 /* DataModel.swift in Sources */, + EB5C37CD2E377A7F0052EFD7 /* OutboundNearbyConnection.swift in Sources */, + EB5C37CE2E377A7F0052EFD7 /* InboundNearbyConnection.swift in Sources */, + EB5C37CF2E377A7F0052EFD7 /* NearbyConnectionManager.swift in Sources */, EBC05C792E33B58100EECC18 /* ApIsolation6Tester.swift in Sources */, EBC05C7A2E33B58100EECC18 /* ApIsolationTester.swift in Sources */, EB96ED8C2D7F7E7B004B3FF1 /* SmallSheetView.swift in Sources */, @@ -648,6 +704,7 @@ 69DA9A1229E0BF5100A442DA /* AppDelegate.swift in Sources */, EB6F62D72D91F4AF00534EC2 /* SettingsView.swift in Sources */, EB7F54122D78E96000989564 /* TutorialView.swift in Sources */, + EB9925812E45D53E00357055 /* sharing_enums.pb.swift in Sources */, EB96ED8F2D7F8105004B3FF1 /* Localized.swift in Sources */, EB7CD1452D6FB0C300CB0CB5 /* Logger.swift in Sources */, EBC05C822E33B58300EECC18 /* ApIsolationIssueView.swift in Sources */, @@ -657,27 +714,29 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - 69DCF47E2AB70D0600CBE2CC /* Sources */ = { + EB5C37DE2E377C2E0052EFD7 /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 69DCF48D2AB70E8C00CBE2CC /* offline_wire_formats.pb.swift in Sources */, - EBC05C592E32C22200EECC18 /* Localized.swift in Sources */, - EB2F9BFB2DA04B69004010A2 /* Helpers.swift in Sources */, - 69DCF48F2AB70E8C00CBE2CC /* securemessage.pb.swift in Sources */, - 69DCF4912AB70E9700CBE2CC /* NearbyConnection.swift in Sources */, - EB6E743E2DD5C77700331466 /* ConnectionFailureTracker.swift in Sources */, - 69DCF4922AB70E9700CBE2CC /* NearbyConnectionManager.swift in Sources */, - 69DCF48E2AB70E8C00CBE2CC /* securegcm.pb.swift in Sources */, - 691F53BE2ABF03820089FD92 /* OutboundNearbyConnection.swift in Sources */, - 69DCF48C2AB70E8C00CBE2CC /* device_to_device_messages.pb.swift in Sources */, - EB7CD1472D6FB0E800CB0CB5 /* Logger.swift in Sources */, - 69DCF4902AB70E9700CBE2CC /* InboundNearbyConnection.swift in Sources */, - 69DCF48B2AB70E8C00CBE2CC /* ukey.pb.swift in Sources */, - EB2B41E42DC63ACC0070FC39 /* SleepManager.swift in Sources */, - EB5C36E92E3546120052EFD7 /* DataModel.swift in Sources */, - EB5C36E72E3544FF0052EFD7 /* SaveFilesManager.swift in Sources */, - 69DCF48A2AB70E8C00CBE2CC /* wire_format.pb.swift in Sources */, + EB5C37F12E377CE70052EFD7 /* ukey.pb.swift in Sources */, + EB5C37F22E377CE70052EFD7 /* NearbyConnection.swift in Sources */, + EB5C37F32E377CE70052EFD7 /* SaveFilesManager.swift in Sources */, + EB5C37F42E377CE70052EFD7 /* NearbyConnectionManager.swift in Sources */, + EB5C37F52E377CE70052EFD7 /* securemessage.pb.swift in Sources */, + EB5C37F62E377CE70052EFD7 /* device_to_device_messages.pb.swift in Sources */, + EB5C37F82E377CE70052EFD7 /* SleepManager.swift in Sources */, + EB5C38012E377DE60052EFD7 /* Localized.swift in Sources */, + EB5C37F92E377CE70052EFD7 /* securegcm.pb.swift in Sources */, + EB5C37FA2E377CE70052EFD7 /* Helpers.swift in Sources */, + EB5C37FB2E377CE70052EFD7 /* InboundNearbyConnection.swift in Sources */, + EB9925802E45D53E00357055 /* sharing_enums.pb.swift in Sources */, + EB5C37FC2E377CE70052EFD7 /* OutboundNearbyConnection.swift in Sources */, + EB5C37FD2E377CE70052EFD7 /* Logger.swift in Sources */, + EB5C37FE2E377CE70052EFD7 /* offline_wire_formats.pb.swift in Sources */, + EB5C383D2E38C2D90052EFD7 /* AudioManager.swift in Sources */, + EB5C38402E38C49D0052EFD7 /* LaunchAtLogin.swift in Sources */, + EB5C37FF2E377CE70052EFD7 /* wire_format.pb.swift in Sources */, + EB5C38002E377CE70052EFD7 /* DataModel.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -689,16 +748,6 @@ target = 699DEBA02AB0573200115D22 /* QuickDropShareExtension */; targetProxy = 699DEBAC2AB0573200115D22 /* PBXContainerItemProxy */; }; - 69DCF4972AB8BF7B00CBE2CC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 69DCF4802AB70D0600CBE2CC /* NearbyShare */; - targetProxy = 69DCF4962AB8BF7B00CBE2CC /* PBXContainerItemProxy */; - }; - 69DCF4A02AB8C9A500CBE2CC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 69DCF4802AB70D0600CBE2CC /* NearbyShare */; - targetProxy = 69DCF49F2AB8C9A500CBE2CC /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -724,7 +773,6 @@ COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "${SHARED_BUILD}"; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = 92SDAWLN76; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ShareExtension/Info.plist; @@ -757,7 +805,6 @@ COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "${SHARED_BUILD}"; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = 92SDAWLN76; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = ShareExtension/Info.plist; @@ -817,6 +864,7 @@ COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 92SDAWLN76; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -840,8 +888,8 @@ MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; - SHARED_BUILD = 56; - SHARED_VERSION = 1.11; + SHARED_BUILD = 61; + SHARED_VERSION = 1.12.2; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -885,6 +933,7 @@ COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 92SDAWLN76; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES; @@ -901,8 +950,8 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; - SHARED_BUILD = 56; - SHARED_VERSION = 1.11; + SHARED_BUILD = 61; + SHARED_VERSION = 1.12.2; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -922,7 +971,6 @@ COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "${SHARED_BUILD}"; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = 92SDAWLN76; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = QuickDrop/Info.plist; @@ -963,7 +1011,6 @@ COMBINE_HIDPI_IMAGES = YES; CURRENT_PROJECT_VERSION = "${SHARED_BUILD}"; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = 92SDAWLN76; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = QuickDrop/Info.plist; @@ -990,37 +1037,75 @@ }; name = Release; }; - 69DCF4872AB70D0600CBE2CC /* Debug */ = { + EB5C37EB2E377C310052EFD7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = QuickDropiOS/QuickDropiOS.entitlements; CODE_SIGN_STYLE = Automatic; - DEAD_CODE_STRIPPING = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks"; - EXECUTABLE_PREFIX = lib; - LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; + CURRENT_PROJECT_VERSION = 1; + ENABLE_PREVIEWS = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MACOSX_DEPLOYMENT_TARGET = 11.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop; PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - 69DCF4882AB70D0600CBE2CC /* Release */ = { + EB5C37EC2E377C310052EFD7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = QuickDropiOS/QuickDropiOS.entitlements; CODE_SIGN_STYLE = Automatic; - DEAD_CODE_STRIPPING = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@executable_path/../Frameworks"; - EXECUTABLE_PREFIX = lib; - LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; + CURRENT_PROJECT_VERSION = 1; + ENABLE_PREVIEWS = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.5; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MACOSX_DEPLOYMENT_TARGET = 11.0; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop; PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; + SUPPORTS_MACCATALYST = NO; + SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; }; name = Release; }; @@ -1054,11 +1139,11 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 69DCF4892AB70D0600CBE2CC /* Build configuration list for PBXNativeTarget "NearbyShare" */ = { + EB5C37EA2E377C310052EFD7 /* Build configuration list for PBXNativeTarget "QuickDropiOS" */ = { isa = XCConfigurationList; buildConfigurations = ( - 69DCF4872AB70D0600CBE2CC /* Debug */, - 69DCF4882AB70D0600CBE2CC /* Release */, + EB5C37EB2E377C310052EFD7 /* Debug */, + EB5C37EC2E377C310052EFD7 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -1093,21 +1178,41 @@ /* End XCRemoteSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ - 69DCF4992AB8C58500CBE2CC /* SwiftProtobuf */ = { - isa = XCSwiftPackageProductDependency; - package = 69DA9A2429E189EF00A442DA /* XCRemoteSwiftPackageReference "swift-protobuf" */; - productName = SwiftProtobuf; - }; - 69DCF49B2AB8C58500CBE2CC /* SwiftECC */ = { - isa = XCSwiftPackageProductDependency; - package = 69DA9A3429E1994C00A442DA /* XCRemoteSwiftPackageReference "SwiftECC" */; - productName = SwiftECC; - }; EB2F9BFD2DA05F48004010A2 /* BezelNotification */ = { isa = XCSwiftPackageProductDependency; package = EB2F9BFC2DA05F48004010A2 /* XCRemoteSwiftPackageReference "BezelNotification" */; productName = BezelNotification; }; + EB5C37D52E377ACF0052EFD7 /* SwiftProtobuf */ = { + isa = XCSwiftPackageProductDependency; + package = 69DA9A2429E189EF00A442DA /* XCRemoteSwiftPackageReference "swift-protobuf" */; + productName = SwiftProtobuf; + }; + EB5C37D72E377ACF0052EFD7 /* SwiftECC */ = { + isa = XCSwiftPackageProductDependency; + package = 69DA9A3429E1994C00A442DA /* XCRemoteSwiftPackageReference "SwiftECC" */; + productName = SwiftECC; + }; + EB5C37D92E377AD60052EFD7 /* SwiftProtobuf */ = { + isa = XCSwiftPackageProductDependency; + package = 69DA9A2429E189EF00A442DA /* XCRemoteSwiftPackageReference "swift-protobuf" */; + productName = SwiftProtobuf; + }; + EB5C37DB2E377AD60052EFD7 /* SwiftECC */ = { + isa = XCSwiftPackageProductDependency; + package = 69DA9A3429E1994C00A442DA /* XCRemoteSwiftPackageReference "SwiftECC" */; + productName = SwiftECC; + }; + EB5C37ED2E377C3F0052EFD7 /* SwiftProtobuf */ = { + isa = XCSwiftPackageProductDependency; + package = 69DA9A2429E189EF00A442DA /* XCRemoteSwiftPackageReference "swift-protobuf" */; + productName = SwiftProtobuf; + }; + EB5C37EF2E377C3F0052EFD7 /* SwiftECC */ = { + isa = XCSwiftPackageProductDependency; + package = 69DA9A3429E1994C00A442DA /* XCRemoteSwiftPackageReference "SwiftECC" */; + productName = SwiftECC; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = 69DA9A0629E0BF5100A442DA /* Project object */; diff --git a/QuickDrop.xcodeproj/xcshareddata/xcschemes/QuickDrop.xcscheme b/QuickDrop.xcodeproj/xcshareddata/xcschemes/QuickDrop.xcscheme index 10ab85a..6e539b4 100644 --- a/QuickDrop.xcodeproj/xcshareddata/xcschemes/QuickDrop.xcscheme +++ b/QuickDrop.xcodeproj/xcshareddata/xcschemes/QuickDrop.xcscheme @@ -1,6 +1,6 @@ (https://sindresorhus.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + */ + +#if os(macOS) || targetEnvironment(macCatalyst) +import SwiftUI +import ServiceManagement +import os.log + +@available(macOS 13.0, *) +public enum LaunchAtLogin { + fileprivate static let observable = Observable() + + /** + Toggle “launch at login” for your app or check whether it's enabled. + */ + public static var isEnabled: Bool { + get { SMAppService.mainApp.status == .enabled } + set { + observable.objectWillChange.send() + + do { + if newValue { + if SMAppService.mainApp.status == .enabled { + try? SMAppService.mainApp.unregister() + } + + try SMAppService.mainApp.register() + } else { + try SMAppService.mainApp.unregister() + } + } catch { + log("Failed to \(newValue ? "enable" : "disable") launch at login: \(error.localizedDescription)") + } + } + } + + /** + Whether the app was launched at login. + + - Important: This property must only be checked in `NSApplicationDelegate#applicationDidFinishLaunching`. + */ + public static var wasLaunchedAtLogin: Bool { + let event = NSAppleEventManager.shared().currentAppleEvent + return event?.eventID == kAEOpenApplication + && event?.paramDescriptor(forKeyword: keyAEPropData)?.enumCodeValue == keyAELaunchedAsLogInItem + } +} + + +@available(macOS 13.0, *) +extension LaunchAtLogin { + final class Observable: ObservableObject { + var isEnabled: Bool { + get { LaunchAtLogin.isEnabled } + set { + LaunchAtLogin.isEnabled = newValue + } + } + } +} + + +@available(macOS 13.0, *) +extension LaunchAtLogin { + /** + This package comes with a `LaunchAtLogin.Toggle` view which is like the built-in `Toggle` but with a predefined binding and label. Clicking the view toggles “launch at login” for your app. + + ``` + struct ContentView: View { + var body: some View { + LaunchAtLogin.Toggle() + } + } + ``` + + The default label is `"Launch at login"`, but it can be overridden for localization and other needs: + + ``` + struct ContentView: View { + var body: some View { + LaunchAtLogin.Toggle { + Text("Launch at login") + } + } + } + ``` + */ + public struct Toggle: View { + @ObservedObject private var launchAtLogin = LaunchAtLogin.observable + private let label: Label + + /** + Creates a toggle that displays a custom label. + + - Parameters: + - label: A view that describes the purpose of the toggle. + */ + public init(@ViewBuilder label: () -> Label) { + self.label = label() + } + + public var body: some View { + SwiftUI.Toggle(isOn: $launchAtLogin.isEnabled) { label } + } + } +} + + +@available(macOS 13.0, *) +extension LaunchAtLogin.Toggle { + /** + Creates a toggle that generates its label from a localized string key. + + This initializer creates a ``Text`` view on your behalf with the provided `titleKey`. + + - Parameters: + - titleKey: The key for the toggle's localized title, that describes the purpose of the toggle. + */ + public init(_ titleKey: LocalizedStringKey) { + label = Text(titleKey) + } + + /** + Creates a toggle that generates its label from a string. + + This initializer creates a `Text` view on your behalf with the provided `title`. + + - Parameters: + - title: A string that describes the purpose of the toggle. + */ + public init(_ title: some StringProtocol) { + label = Text(title) + } + + /** + Creates a toggle with the default title of `Launch at login`. + */ + public init() { + self.init("Launch at login") + } +} +#endif diff --git a/QuickDrop/View/IssueViews/ApIsolationIssueView.swift b/QuickDrop/View/IssueViews/ApIsolationIssueView.swift index b123621..619e15b 100644 --- a/QuickDrop/View/IssueViews/ApIsolationIssueView.swift +++ b/QuickDrop/View/IssueViews/ApIsolationIssueView.swift @@ -62,6 +62,7 @@ func openRouterSettingsPage() async { guard let routerIP else { DispatchQueue.main.async { + AudioManager.playErrorSound() let alert = NSAlert() alert.alertStyle = .critical diff --git a/QuickDrop/View/SettingsView.swift b/QuickDrop/View/SettingsView.swift index 8e6bade..86471a6 100644 --- a/QuickDrop/View/SettingsView.swift +++ b/QuickDrop/View/SettingsView.swift @@ -7,7 +7,6 @@ import SwiftUI import AppKit -import NearbyShare struct SettingsView: View { @@ -46,6 +45,21 @@ struct SettingsView: View { Toggle("OpenFinderAfterReceiving", isOn: $openFinderAfterReceiving) .padding(.top, 5) + Text("OpenFinderAfterReceivingFooter") + .font(.footnote) + .padding(.top, 5) + + + if #available(macOS 13.0, *) { + + Divider() + .padding(.vertical, 10) + + LaunchAtLogin.Toggle { + Text("LaunchAtLogin") + } + .padding(.top, 5) + } } } } diff --git a/QuickDrop/View/TutorialView.swift b/QuickDrop/View/TutorialView.swift index 2494dd1..5c728d0 100644 --- a/QuickDrop/View/TutorialView.swift +++ b/QuickDrop/View/TutorialView.swift @@ -6,7 +6,6 @@ // import SwiftUI -import NearbyShare struct TutorialView: View { @@ -87,7 +86,7 @@ struct LargeAppIconView: View { Image("AppIconHighRes") .resizable() .frame(width: 150, height: 150) - .padding(.top, 50) + .padding(.top, 40) Text(title.localized()) .font(.largeTitle) diff --git a/QuickDrop/View/WelcomeScreen.swift b/QuickDrop/View/WelcomeScreen.swift index 0dd95aa..e0fd570 100644 --- a/QuickDrop/View/WelcomeScreen.swift +++ b/QuickDrop/View/WelcomeScreen.swift @@ -6,7 +6,6 @@ // import SwiftUI -import NearbyShare import UniformTypeIdentifiers struct WelcomeScreen: View { diff --git a/QuickDropiOS/Assets.xcassets/AccentColor.colorset/Contents.json b/QuickDropiOS/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/QuickDropiOS/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QuickDropiOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/QuickDropiOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/QuickDropiOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QuickDropiOS/Assets.xcassets/Contents.json b/QuickDropiOS/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/QuickDropiOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/QuickDropiOS/ContentView.swift b/QuickDropiOS/ContentView.swift new file mode 100644 index 0000000..387dbce --- /dev/null +++ b/QuickDropiOS/ContentView.swift @@ -0,0 +1,64 @@ +// +// ContentView.swift +// QuickDropiOS +// +// Created by Leon Böttger on 28.07.25. +// + +import SwiftUI + +struct ContentView: View { + var body: some View { + DeviceListView() + } +} + +struct DeviceListView: View { + @StateObject var model = ShareViewModel() + + var body: some View { + VStack { + Text("Available Devices") + .font(.title) + .padding() + + if model.foundDevices.isEmpty { + Text("Searching for devices...") + .italic() + .padding() + } else { + List(model.foundDevices) { device in + HStack { + Image(systemName: "smartphone") + .resizable() + .frame(width: 30, height: 30) + Text(device.name.isEmpty ? "Android" : device.name) + Spacer() + + if model.selectedDevice == device { + ProgressView() + .progressViewStyle(CircularProgressViewStyle()) + } + } + .contentShape(Rectangle()) // Make entire row tappable + .onTapGesture { + model.selectDevice(device: device) + } + .background(model.selectedDevice == device ? Color.blue.opacity(0.2) : Color.clear) + } + .listStyle(PlainListStyle()) + } + } + .frame(minWidth: 300, minHeight: 400) + } +} + +struct DeviceListView_Previews: PreviewProvider { + static var previews: some View { + DeviceListView() + } +} + +#Preview { + ContentView() +} diff --git a/QuickDropiOS/Model.swift b/QuickDropiOS/Model.swift new file mode 100644 index 0000000..7081d46 --- /dev/null +++ b/QuickDropiOS/Model.swift @@ -0,0 +1,75 @@ +// +// Model.swift +// QuickDrop +// +// Created by Leon Böttger on 28.07.25. +// + +import SwiftUI + +class ShareViewModel: ObservableObject, ShareExtensionDelegate { + + @Published var foundDevices: [RemoteDeviceInfo] = [] + @Published var selectedDevice: RemoteDeviceInfo? + @Published var lastError: Error? + + @Published var progressState: String? = nil + @Published var progressValue: Double? = nil + + private var urls: [URL] = [] + private var textToSend: String? = nil + //private var errorAlertHandler = ErrorAlertHandler.shared + + private var connectionEstablished = false + private var timeoutDispatchWorkItem: DispatchWorkItem? = nil + + init() { + NearbyConnectionManager.shared.startDeviceDiscovery() + } + + func addDevice(device: RemoteDeviceInfo) { + withAnimation { + foundDevices.append(device) + } + } + + func removeDevice(id: String) { + withAnimation { + foundDevices.removeAll { $0.id == id } + } + } + + func connectionWasEstablished(pinCode: String) { + connectionEstablished = true + progressState = String(format: "PinCode".localized(), arguments: [pinCode]) + progressValue = 0 + } + + func connectionFailed(with error: any Error) { + progressValue = nil + lastError = error + + //ErrorAlertHandler.shared.showErrorAlert(for: chosenDevice?.name ?? "", error: error) + } + + func transferAccepted() { + progressState = "Sending".localized() + } + + func transferProgress(progress: Double) { + progressValue = progress + } + + func transferFinished() { + progressState = "TransferFinished".localized() + } + + func selectDevice(device: RemoteDeviceInfo) { + NearbyConnectionManager.shared.stopDeviceDiscovery() + + progressValue = 0 + progressState = "Connecting".localized() + selectedDevice = device + NearbyConnectionManager.shared.startOutgoingTransfer(deviceID: device.id!, delegate: self, urls: urls, textToSend: textToSend) + } +} diff --git a/QuickDropiOS/QuickDropiOS.entitlements b/QuickDropiOS/QuickDropiOS.entitlements new file mode 100644 index 0000000..ec706aa --- /dev/null +++ b/QuickDropiOS/QuickDropiOS.entitlements @@ -0,0 +1,8 @@ + + + + + com.apple.developer.networking.multicast + + + diff --git a/QuickDropiOS/QuickDropiOSApp.swift b/QuickDropiOS/QuickDropiOSApp.swift new file mode 100644 index 0000000..c035f67 --- /dev/null +++ b/QuickDropiOS/QuickDropiOSApp.swift @@ -0,0 +1,17 @@ +// +// QuickDropiOSApp.swift +// QuickDropiOS +// +// Created by Leon Böttger on 28.07.25. +// + +import SwiftUI + +@main +struct QuickDropiOSApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} diff --git a/Resources/License.txt b/Resources/License.txt index ee719f7..f6f5a6b 100644 --- a/Resources/License.txt +++ b/Resources/License.txt @@ -255,6 +255,186 @@ OR OTHERWISE, ARISING FROM, OUT OF, OR IN CONNECTION WITH THE PRODUCT OR THE USE OR OTHER DEALINGS IN OR WITH THE PRODUCT. +Nearby +https://github.com/google/nearby + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + ukey2 https://github.com/google/ukey2 Copyright 2023 Google @@ -320,6 +500,7 @@ The disclaimer of warranties and limitation of liability provided above shall be [...] + All sounds are copyrighted material of https://notificationsounds.com Terms of use: https://notificationsounds.com/terms-of-use @@ -327,5 +508,6 @@ Terms of use: https://notificationsounds.com/terms-of-use Sound files: https://notificationsounds.com/notification-sounds/time-is-now-585 +https://notificationsounds.com/notification-sounds/just-maybe-577 Modifications to sound files: Volume and length, no previous modifications. diff --git a/Resources/justMaybe.mp3 b/Resources/justMaybe.mp3 new file mode 100644 index 0000000..198753f Binary files /dev/null and b/Resources/justMaybe.mp3 differ diff --git a/ShareExtension/ShareViewController.swift b/ShareExtension/ShareViewController.swift index a5fce8f..5553a68 100644 --- a/ShareExtension/ShareViewController.swift +++ b/ShareExtension/ShareViewController.swift @@ -7,7 +7,6 @@ import Cocoa import Foundation -import NearbyShare import SwiftUI class ShareViewController: NSViewController, ShareExtensionDelegate { @@ -204,6 +203,7 @@ class ShareViewController: NSViewController, ShareExtensionDelegate { DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { log("Canceling share request because URL \(url) is a directory") + AudioManager.playErrorSound() let alert = NSAlert() alert.alertStyle = .critical @@ -331,6 +331,7 @@ class ShareViewController: NSViewController, ShareExtensionDelegate { let timeoutAlert = DispatchWorkItem { if !self.connectionEstablished { + AudioManager.playErrorSound() let alert = NSAlert() alert.alertStyle = .critical