diff --git a/CHANGES.md b/CHANGES.md index ad8f78f28..9847a3710 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,11 @@ +## Changes in 0.27.8 (2024-05-29) + +🙌 Improvements + +- When sorting room list alphabetically, sort it case-insensitive. ([#1851](https://github.com/matrix-org/matrix-ios-sdk/pull/1851)) +- Crypto: Update crypto SDK to 0.4.1 ([#1853](https://github.com/matrix-org/matrix-ios-sdk/pull/1853)) + + ## Changes in 0.27.7 (2024-05-01) No significant changes. diff --git a/MatrixSDK.podspec b/MatrixSDK.podspec index fadc44551..1fa91a163 100644 --- a/MatrixSDK.podspec +++ b/MatrixSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "MatrixSDK" - s.version = "0.27.7" + s.version = "0.27.8" s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)" s.description = <<-DESC @@ -45,7 +45,7 @@ Pod::Spec.new do |s| ss.dependency 'OLMKit', '~> 3.2.5' ss.dependency 'Realm', '10.27.0' ss.dependency 'libbase58', '~> 0.1.4' - ss.dependency 'MatrixSDKCrypto', '0.3.13', :configurations => ["DEBUG", "RELEASE"], :inhibit_warnings => true + ss.dependency 'MatrixSDKCrypto', '0.4.2', :configurations => ["DEBUG", "RELEASE"], :inhibit_warnings => true end s.subspec 'JingleCallStack' do |ss| diff --git a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift index 39545956d..624afbeee 100644 --- a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift +++ b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift @@ -227,12 +227,13 @@ actor MXRoomEventDecryption: MXRoomEventDecrypting { ]) return trackedDecryptionResult(for: event, error: error) - case .MissingRoomKey(let message): + case .MissingRoomKey(let message, let withheldCode): if undecryptedEvents[sessionId] == nil { log.error("Failed to decrypt event(s) due to missing room keys", context: [ "session_id": sessionId, "message": message, "error": error, + "withheldCode": withheldCode ?? "N/A", "details": "further errors for the same key will be supressed", ]) } diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift index 370cf71af..effbd238b 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift @@ -116,6 +116,10 @@ class MXCryptoMachine { } } + func invalidateCache() async { + await machine.clearCryptoCache() + } + // MARK: - Private private static func createMachine(userId: String, deviceId: String, log: MXNamedLog) throws -> OlmMachine { @@ -591,9 +595,14 @@ extension MXCryptoMachine: MXCryptoCrossSigning { func bootstrapCrossSigning(authParams: [AnyHashable: Any]) async throws { let result = try machine.bootstrapCrossSigning() + // If this is called before the device keys have been uploaded there will be a + // request to upload them, do that first. + if let optionalKeyRequest = result.uploadKeysRequest { + try await handleRequest(optionalKeyRequest) + } let _ = try await [ requests.uploadSigningKeys(request: result.uploadSigningKeysRequest, authParams: authParams), - requests.uploadSignatures(request: result.signatureRequest) + requests.uploadSignatures(request: result.uploadSignatureRequest) ] } @@ -833,7 +842,7 @@ extension MXCryptoMachine: MXCryptoBackup { guard let message = MXCryptoTools.canonicalJSONString(forJSON: object) else { throw Error.cannotSerialize } - return machine.sign(message: message) + return try machine.sign(message: message) } func backupRoomKeys() async throws { diff --git a/MatrixSDK/Crypto/Dehydration/DehydrationService.swift b/MatrixSDK/Crypto/Dehydration/DehydrationService.swift index 6f4ccb9c7..43770fb06 100644 --- a/MatrixSDK/Crypto/Dehydration/DehydrationService.swift +++ b/MatrixSDK/Crypto/Dehydration/DehydrationService.swift @@ -68,7 +68,7 @@ public class DehydrationService: NSObject { // Convert it back to Data let pickleKeyData = MXBase64Tools.data(fromBase64: base64PickleKey) - let rehydrationResult = await rehydrateDevice(pickleKeyData: [UInt8](pickleKeyData)) + let rehydrationResult = await rehydrateDevice(pickleKeyData: pickleKeyData) switch rehydrationResult { case .success((let deviceId, let rehydratedDevice)): // Fetch and process the to device events available on the dehydrated device @@ -86,14 +86,15 @@ public class DehydrationService: NSObject { } // Finally, create a new dehydrated device with the same pickle key - try await dehydrateDevice(pickleKeyData: [UInt8](pickleKeyData)) + try await dehydrateDevice(pickleKeyData: pickleKeyData) } else { // Otherwise, generate a new dehydration pickle key, store it and dehydrate a device // Generate a new dehydration pickle key - var pickleKeyData = [UInt8](repeating: 0, count: 32) - _ = SecRandomCopyBytes(kSecRandomDefault, 32, &pickleKeyData) + var pickleKeyRaw = [UInt8](repeating: 0, count: 32) + _ = SecRandomCopyBytes(kSecRandomDefault, 32, &pickleKeyRaw) + let pickleKeyData = Data(bytes: pickleKeyRaw, count: 32) // Convert it to unpadded base 64 - let base64PickleKey = MXBase64Tools.unpaddedBase64(from: Data(bytes: pickleKeyData, count: 32)) + let base64PickleKey = MXBase64Tools.unpaddedBase64(from: pickleKeyData) // Store it on the backend try await storeSecret(base64PickleKey, secretId: secretId, secretStorageKeys: [secretStorageKeyId: privateKeyData]) @@ -131,10 +132,10 @@ public class DehydrationService: NSObject { // MARK: - Device dehydration - private func dehydrateDevice(pickleKeyData: [UInt8]) async throws { - let dehydratedDevice = dehydratedDevices.create() + private func dehydrateDevice(pickleKeyData: Data) async throws { + let dehydratedDevice = try dehydratedDevices.create() - let requestDetails = try dehydratedDevice.keysForUpload(deviceDisplayName: deviceDisplayName, pickleKey: [UInt8](pickleKeyData)) + let requestDetails = try dehydratedDevice.keysForUpload(deviceDisplayName: deviceDisplayName, pickleKey: pickleKeyData) let parameters = MXDehydratedDeviceCreationParameters() parameters.body = requestDetails.body @@ -150,7 +151,7 @@ public class DehydrationService: NSObject { } } - private func rehydrateDevice(pickleKeyData: [UInt8]) async -> Result<(deviceId: String, rehydratedDevice: RehydratedDeviceProtocol), DehydrationServiceError> { + private func rehydrateDevice(pickleKeyData: Data) async -> Result<(deviceId: String, rehydratedDevice: RehydratedDeviceProtocol), DehydrationServiceError> { await withCheckedContinuation { continuation in self.restClient.retrieveDehydratedDevice { [weak self] dehydratedDevice in guard let self else { return } @@ -163,7 +164,7 @@ public class DehydrationService: NSObject { } do { - let rehydratedDevice = try self.dehydratedDevices.rehydrate(pickleKey: [UInt8](pickleKeyData), deviceId: dehydratedDevice.deviceId, deviceData: deviceDataJSON) + let rehydratedDevice = try self.dehydratedDevices.rehydrate(pickleKey: pickleKeyData, deviceId: dehydratedDevice.deviceId, deviceData: deviceDataJSON) continuation.resume(returning: .success((dehydratedDevice.deviceId, rehydratedDevice))) } catch { continuation.resume(returning: .failure(DehydrationServiceError.failedRehydration(error))) diff --git a/MatrixSDK/Crypto/MXCrypto.h b/MatrixSDK/Crypto/MXCrypto.h index 348edddd0..4b7f1f311 100644 --- a/MatrixSDK/Crypto/MXCrypto.h +++ b/MatrixSDK/Crypto/MXCrypto.h @@ -378,6 +378,8 @@ extern NSString *const MXDeviceListDidUpdateUsersDevicesNotification; */ - (void)setBlacklistUnverifiedDevicesInRoom:(NSString *)roomId blacklist:(BOOL)blacklist; +- (void) invalidateCache:(void (^)(void))done; + @end NS_ASSUME_NONNULL_END diff --git a/MatrixSDK/Crypto/MXCryptoV2.swift b/MatrixSDK/Crypto/MXCryptoV2.swift index adea4ac92..b7fdef4e9 100644 --- a/MatrixSDK/Crypto/MXCryptoV2.swift +++ b/MatrixSDK/Crypto/MXCryptoV2.swift @@ -20,6 +20,7 @@ import MatrixSDKCrypto /// An implementation of `MXCrypto` which uses [matrix-rust-sdk](https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto) /// under the hood. class MXCryptoV2: NSObject, MXCrypto { + enum Error: Swift.Error { case cannotUnsetTrust case backupNotEnabled @@ -720,4 +721,13 @@ class MXCryptoV2: NSObject, MXCrypto { return dict[info.userId] = info } } -} + + func invalidateCache(_ done: @escaping () -> Void) { + Task { + log.debug("Invalidating Olm Machine crypto store cache.") + await machine.invalidateCache() + await MainActor.run { + done() + } + } + }} diff --git a/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift b/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift index 741ea8ed5..f06a64ef8 100644 --- a/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift +++ b/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift @@ -54,7 +54,7 @@ struct MXCryptoMigrationStore { account: try pickledAccount(pickleKey: pickleKey), sessions: [], // Sessions are extracted in batches separately inboundGroupSessions: [], // Group sessions are extracted in batches separately - pickleKey: [UInt8](pickleKey), + pickleKey: pickleKey, backupVersion: legacyStore.backupVersion, backupRecoveryKey: backupRecoveryKey(), crossSigning: crossSigning(), @@ -194,7 +194,7 @@ private extension PickledAccount { private extension PickledSession { init(session: MXOlmSession, pickleKey: Data) throws { let pickle = try session.session.serializeData(withKey: pickleKey) - let time = "\(Int(session.lastReceivedMessageTs))" + let time = UInt64(session.lastReceivedMessageTs) self.init( pickle: pickle, diff --git a/MatrixSDK/Data/RoomList/Common/MXRoomListDataSortable.swift b/MatrixSDK/Data/RoomList/Common/MXRoomListDataSortable.swift index 2aced9df0..2535e4300 100644 --- a/MatrixSDK/Data/RoomList/Common/MXRoomListDataSortable.swift +++ b/MatrixSDK/Data/RoomList/Common/MXRoomListDataSortable.swift @@ -52,7 +52,7 @@ extension MXRoomListDataSortable { // } if sortOptions.alphabetical { - result.append(NSSortDescriptor(keyPath: \MXRoomSummaryProtocol.displayName, ascending: true)) + result.append(NSSortDescriptor(key: "displayName", ascending: true, selector: #selector(NSString.localizedStandardCompare(_:)))) } if sortOptions.invitesFirst { diff --git a/MatrixSDK/Data/RoomList/CoreData/MXCoreDataRoomListDataFetcher.swift b/MatrixSDK/Data/RoomList/CoreData/MXCoreDataRoomListDataFetcher.swift index e6220956a..86e5ca850 100644 --- a/MatrixSDK/Data/RoomList/CoreData/MXCoreDataRoomListDataFetcher.swift +++ b/MatrixSDK/Data/RoomList/CoreData/MXCoreDataRoomListDataFetcher.swift @@ -250,7 +250,7 @@ extension MXCoreDataRoomListDataFetcher: MXRoomListDataSortable { var result: [NSSortDescriptor] = [] if sortOptions.alphabetical { - result.append(NSSortDescriptor(keyPath: \MXRoomSummaryMO.s_displayName, ascending: true)) + result.append(NSSortDescriptor(key: "s_displayName", ascending: true, selector: #selector(NSString.localizedStandardCompare(_:)))) } if sortOptions.invitesFirst { diff --git a/MatrixSDK/MXSession.m b/MatrixSDK/MXSession.m index 7f4ae3d2e..728825386 100644 --- a/MatrixSDK/MXSession.m +++ b/MatrixSDK/MXSession.m @@ -1150,9 +1150,18 @@ - (void)pause - (void)resume:(void (^)(void))resumeDone { - [self handleBackgroundSyncCacheIfRequiredWithCompletion:^{ - [self _resume:resumeDone]; - }]; + // The app has resumed there might have been a NSE run that have invalidated the cache + if (self.crypto) { + [self.crypto invalidateCache:^{ + [self handleBackgroundSyncCacheIfRequiredWithCompletion:^{ + [self _resume:resumeDone]; + }]; + }]; + } else { + [self handleBackgroundSyncCacheIfRequiredWithCompletion:^{ + [self _resume:resumeDone]; + }]; + } } - (void)_resume:(void (^)(void))resumeDone diff --git a/MatrixSDK/MatrixSDKVersion.m b/MatrixSDK/MatrixSDKVersion.m index 5a4d405a6..705e2e1b0 100644 --- a/MatrixSDK/MatrixSDKVersion.m +++ b/MatrixSDK/MatrixSDKVersion.m @@ -16,4 +16,4 @@ #import -NSString *const MatrixSDKVersion = @"0.27.7"; +NSString *const MatrixSDKVersion = @"0.27.8"; diff --git a/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift b/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift index 29ba42e3b..1f3801519 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift @@ -41,7 +41,8 @@ extension Device { isBlocked: isBlocked, locallyTrusted: locallyTrusted, crossSigningTrusted: crossSigningTrusted, - firstTimeSeenTs: 0 + firstTimeSeenTs: 0, + dehydrated: false ) } } diff --git a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift index 171d3b6ba..4b95ebf8e 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift @@ -143,7 +143,8 @@ class CryptoCrossSigningStub: CryptoIdentityStub, MXCryptoCrossSigning { locallyTrusted: device.locallyTrusted, // Modify cross signing trusted crossSigningTrusted: true, - firstTimeSeenTs: 0 + firstTimeSeenTs: 0, + dehydrated: false ) } diff --git a/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift b/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift index 1197fc26f..462895baa 100644 --- a/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift +++ b/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift @@ -141,8 +141,8 @@ class MXCryptoMigrationStoreUnitTests: XCTestCase { XCTAssertEqual(sessions[0].pickle, pickle) XCTAssertEqual(sessions[0].senderKey, "XYZ") XCTAssertFalse(sessions[0].createdUsingFallbackKey) - XCTAssertEqual(sessions[0].creationTime, "123") - XCTAssertEqual(sessions[0].lastUseTime, "123") + XCTAssertEqual(sessions[0].creationTime, 123) + XCTAssertEqual(sessions[0].lastUseTime, 123) } func test_extractsMultipleSessionsInBatches() throws { @@ -235,7 +235,7 @@ class MXCryptoMigrationStoreUnitTests: XCTestCase { func test_extractsPickeKey() throws { let pickleKey = "some key".data(using: .ascii)! let key = try extractData(pickleKey: pickleKey).pickleKey - XCTAssertEqual(key, [UInt8](pickleKey)) + XCTAssertEqual(key, pickleKey) } func test_extractsCrossSigning() throws { diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift index 15fe3df82..d263d29ea 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift @@ -18,7 +18,7 @@ import Foundation import MatrixSDKCrypto -struct QrCodeStub: QrCodeProtocol { +class QrCodeStub: QrCodeProtocol { private let _otherUserId: String private let _otherDeviceId: String private let _flowId: String diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift index ed81168ef..b08a96070 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift @@ -18,7 +18,7 @@ import Foundation import MatrixSDKCrypto -struct SasStub: SasProtocol { +class SasStub: SasProtocol { private let _otherUserId: String private let _otherDeviceId: String diff --git a/Podfile b/Podfile index f48b15351..c2b1b2bc0 100644 --- a/Podfile +++ b/Podfile @@ -16,10 +16,10 @@ abstract_target 'MatrixSDK' do pod 'Realm', '10.27.0' pod 'libbase58', '~> 0.1.4' - pod 'MatrixSDKCrypto', "0.3.13", :inhibit_warnings => true + pod 'MatrixSDKCrypto', '0.4.2', :inhibit_warnings => true target 'MatrixSDK-iOS' do - platform :ios, '11.0' + platform :ios, '13.0' target 'MatrixSDKTests-iOS' do inherit! :search_paths @@ -28,7 +28,7 @@ abstract_target 'MatrixSDK' do end target 'MatrixSDK-macOS' do - platform :osx, '10.10' + platform :osx, '10.15' target 'MatrixSDKTests-macOS' do inherit! :search_paths @@ -40,7 +40,7 @@ end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0' + config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0' end end end diff --git a/Podfile.lock b/Podfile.lock index 4c4796639..2ad77539d 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -14,9 +14,9 @@ PODS: - AFNetworking/Serialization (4.0.1) - AFNetworking/UIKit (4.0.1): - AFNetworking/NSURLSession - - GZIP (1.3.0) + - GZIP (1.3.2) - libbase58 (0.1.4) - - MatrixSDKCrypto (0.3.13) + - MatrixSDKCrypto (0.4.2) - OHHTTPStubs (9.1.0): - OHHTTPStubs/Default (= 9.1.0) - OHHTTPStubs/Core (9.1.0) @@ -44,7 +44,7 @@ DEPENDENCIES: - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - - MatrixSDKCrypto (= 0.3.13) + - MatrixSDKCrypto (= 0.4.2) - OHHTTPStubs (~> 9.1.0) - OLMKit (~> 3.2.5) - Realm (= 10.27.0) @@ -63,14 +63,14 @@ SPEC REPOS: SPEC CHECKSUMS: AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58 - GZIP: 416858efbe66b41b206895ac6dfd5493200d95b3 + GZIP: 3c0abf794bfce8c7cb34ea05a1837752416c8868 libbase58: 7c040313537b8c44b6e2d15586af8e21f7354efd - MatrixSDKCrypto: bf08b72f2cd015d8749420a2b8b92fc0536bedf4 + MatrixSDKCrypto: 736069ee0a5ec12852ab3498bf2242acecc443fc OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 OLMKit: da115f16582e47626616874e20f7bb92222c7a51 Realm: 9ca328bd7e700cc19703799785e37f77d1a130f2 SwiftyBeaver: 84069991dd5dca07d7069100985badaca7f0ce82 -PODFILE CHECKSUM: 1bf28f5a19566c567d265232f60ee19a3ae86ed3 +PODFILE CHECKSUM: 37ab0de0200808bcd3335a637e31736df60fc62e COCOAPODS: 1.14.3 diff --git a/build.sh b/build.sh index 466349014..05ee25313 100755 --- a/build.sh +++ b/build.sh @@ -8,8 +8,8 @@ pod install if [ $1 == 'xcframework' ] # optionally supports additional arguments for CFBundleShortVersionString and CFBundleVersion then # archive the framework for iOS, macOS, Catalyst and the Simulator - xcodebuild archive -workspace MatrixSDK.xcworkspace -scheme MatrixSDK-iOS -destination "generic/platform=iOS" -archivePath build/MatrixSDK-iOS SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES IPHONEOS_DEPLOYMENT_TARGET=11.0 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS=NO MARKETING_VERSION=$2 CURRENT_PROJECT_VERSION=$3 - xcodebuild archive -workspace MatrixSDK.xcworkspace -scheme MatrixSDK-iOS -destination "generic/platform=iOS Simulator" -archivePath build/MatrixSDK-iOSSimulator SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES IPHONEOS_DEPLOYMENT_TARGET=11.0 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS=NO MARKETING_VERSION=$2 CURRENT_PROJECT_VERSION=$3 + xcodebuild archive -workspace MatrixSDK.xcworkspace -scheme MatrixSDK-iOS -destination "generic/platform=iOS" -archivePath build/MatrixSDK-iOS SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES IPHONEOS_DEPLOYMENT_TARGET=13.0 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS=NO MARKETING_VERSION=$2 CURRENT_PROJECT_VERSION=$3 + xcodebuild archive -workspace MatrixSDK.xcworkspace -scheme MatrixSDK-iOS -destination "generic/platform=iOS Simulator" -archivePath build/MatrixSDK-iOSSimulator SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES IPHONEOS_DEPLOYMENT_TARGET=13.0 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS=NO MARKETING_VERSION=$2 CURRENT_PROJECT_VERSION=$3 xcodebuild archive -workspace MatrixSDK.xcworkspace -scheme MatrixSDK-macOS -destination "generic/platform=macOS" -archivePath build/MatrixSDK-macOS SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES MACOSX_DEPLOYMENT_TARGET=10.10 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS=NO MARKETING_VERSION=$2 CURRENT_PROJECT_VERSION=$3 xcodebuild archive -workspace MatrixSDK.xcworkspace -scheme MatrixSDK-iOS -destination "generic/platform=macOS,variant=Mac Catalyst" -archivePath ./build/MatrixSDK-MacCatalyst SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES IPHONEOS_DEPLOYMENT_TARGET=13.0 GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS=NO MARKETING_VERSION=$2 CURRENT_PROJECT_VERSION=$3