From 2b1b5e92442af95ff24c6b82bddc3bd172afd4e5 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Thu, 26 Jan 2023 20:02:31 +0000 Subject: [PATCH 01/10] Generate crypto store key --- Riot/Assets/en.lproj/Vector.strings | 6 ++-- .../MatrixSDKCrypto+LocalizedError.swift | 31 +++++++++++++++++++ Riot/Generated/Strings.swift | 6 ++-- .../EncryptionKeyManager.swift | 12 +++++++ .../Modules/Settings/SettingsViewController.m | 2 +- changelog.d/pr-7310.change | 1 + 6 files changed, 51 insertions(+), 7 deletions(-) create mode 100644 Riot/Categories/MatrixSDKCrypto+LocalizedError.swift create mode 100644 changelog.d/pr-7310.change diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 5d7ac9e4a3..2c555f6fcb 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -804,9 +804,9 @@ Tap the + to start adding people."; "settings_labs_enable_new_app_layout" = "New Application Layout"; "settings_labs_enable_wysiwyg_composer" = "Try out the rich text editor"; "settings_labs_enable_voice_broadcast" = "Voice broadcast"; -"settings_labs_enable_crypto_sdk" = "Enable new rust-based Crypto SDK"; -"settings_labs_confirm_crypto_sdk" = "This action cannot be undone"; -"settings_labs_disable_crypto_sdk" = "Crypto SDK is enabled. To disable please reinstall the app"; +"settings_labs_enable_crypto_sdk" = "End-to-end encryption 2.0"; +"settings_labs_confirm_crypto_sdk" = "This option will enable a new, faster and more reliable engine for end-to-end encryption written in Rust. Once enabled, you will need to log out to disable it. Do you wish to proceed?"; +"settings_labs_disable_crypto_sdk" = "End-to-end encryption 2.0 (log out to disable)"; "settings_version" = "Version %@"; "settings_olm_version" = "Olm Version %@"; diff --git a/Riot/Categories/MatrixSDKCrypto+LocalizedError.swift b/Riot/Categories/MatrixSDKCrypto+LocalizedError.swift new file mode 100644 index 0000000000..d802d54ff5 --- /dev/null +++ b/Riot/Categories/MatrixSDKCrypto+LocalizedError.swift @@ -0,0 +1,31 @@ +// +// Copyright 2023 New Vector Ltd +// +// 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 +// +// http://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 + +#if DEBUG + +import MatrixSDKCrypto + +extension CryptoStoreError: LocalizedError { + public var errorDescription: String? { + // We dont really care about the type of error here when showing to the user. + // Details about the error are tracked independently + return VectorL10n.e2eNeedLogInAgain + } +} + +#endif diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index d42977875d..5df732af13 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -7583,7 +7583,7 @@ public class VectorL10n: NSObject { public static var settingsLabs: String { return VectorL10n.tr("Vector", "settings_labs") } - /// This action cannot be undone + /// This option will enable a new, faster and more reliable engine for end-to-end encryption written in Rust. Once enabled, you will need to log out to disable it. Do you wish to proceed? public static var settingsLabsConfirmCryptoSdk: String { return VectorL10n.tr("Vector", "settings_labs_confirm_crypto_sdk") } @@ -7591,7 +7591,7 @@ public class VectorL10n: NSObject { public static var settingsLabsCreateConferenceWithJitsi: String { return VectorL10n.tr("Vector", "settings_labs_create_conference_with_jitsi") } - /// Crypto SDK is enabled. To disable please reinstall the app + /// End-to-end encryption 2.0 (log out to disable) public static var settingsLabsDisableCryptoSdk: String { return VectorL10n.tr("Vector", "settings_labs_disable_crypto_sdk") } @@ -7607,7 +7607,7 @@ public class VectorL10n: NSObject { public static var settingsLabsEnableAutoReportDecryptionErrors: String { return VectorL10n.tr("Vector", "settings_labs_enable_auto_report_decryption_errors") } - /// Enable new rust-based Crypto SDK + /// End-to-end encryption 2.0 public static var settingsLabsEnableCryptoSdk: String { return VectorL10n.tr("Vector", "settings_labs_enable_crypto_sdk") } diff --git a/Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift b/Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift index 5085e9efb1..484a638321 100644 --- a/Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift +++ b/Riot/Managers/EncryptionKeyManager/EncryptionKeyManager.swift @@ -31,6 +31,7 @@ class EncryptionKeyManager: NSObject, MXKeyProviderDelegate { private static let cryptoOlmPickleKey: KeyValueStoreKey = "cryptoOlmPickleKey" private static let roomLastMessageIv: KeyValueStoreKey = "roomLastMessageIv" private static let roomLastMessageAesKey: KeyValueStoreKey = "roomLastMessageAesKey" + private static let cryptoSDKStoreKey: KeyValueStoreKey = "cryptoSDKStoreKey" private let keychainStore: KeyValueStore = KeychainStore(withKeychain: Keychain(service: keychainService, accessGroup: BuildSettings.keychainAccessGroup)) @@ -47,6 +48,7 @@ class EncryptionKeyManager: NSObject, MXKeyProviderDelegate { generateKeyIfNotExists(forKey: EncryptionKeyManager.cryptoOlmPickleKey, size: 32) generateIvIfNotExists(forKey: EncryptionKeyManager.roomLastMessageIv) generateAesKeyIfNotExists(forKey: EncryptionKeyManager.roomLastMessageAesKey) + generateKeyIfNotExists(forKey: EncryptionKeyManager.cryptoSDKStoreKey, size: 32) assert(keychainStore.containsObject(forKey: EncryptionKeyManager.contactsIv), "[EncryptionKeyManager] initKeys: Failed to generate IV for acount") assert(keychainStore.containsObject(forKey: EncryptionKeyManager.contactsAesKey), "[EncryptionKeyManager] initKeys: Failed to generate AES Key for acount") @@ -55,6 +57,7 @@ class EncryptionKeyManager: NSObject, MXKeyProviderDelegate { assert(keychainStore.containsObject(forKey: EncryptionKeyManager.cryptoOlmPickleKey), "[EncryptionKeyManager] initKeys: Failed to generate Key for olm pickle key") assert(keychainStore.containsObject(forKey: EncryptionKeyManager.roomLastMessageIv), "[EncryptionKeyManager] initKeys: Failed to generate IV for room last message") assert(keychainStore.containsObject(forKey: EncryptionKeyManager.roomLastMessageAesKey), "[EncryptionKeyManager] initKeys: Failed to generate AES Key for room last message encryption") + assert(keychainStore.containsObject(forKey: EncryptionKeyManager.cryptoSDKStoreKey), "[EncryptionKeyManager] initKeys: Failed to generate Key for crypto sdk store") } // MARK: - MXKeyProviderDelegate @@ -64,6 +67,7 @@ class EncryptionKeyManager: NSObject, MXKeyProviderDelegate { || dataType == MXKAccountManagerDataType || dataType == MXCryptoOlmPickleKeyDataType || dataType == MXRoomLastMessageDataType + || dataType == MXCryptoSDKStoreKeyDataType } func hasKeyForData(ofType dataType: String) -> Bool { @@ -77,7 +81,10 @@ class EncryptionKeyManager: NSObject, MXKeyProviderDelegate { case MXRoomLastMessageDataType: return keychainStore.containsObject(forKey: EncryptionKeyManager.roomLastMessageIv) && keychainStore.containsObject(forKey: EncryptionKeyManager.roomLastMessageAesKey) + case MXCryptoSDKStoreKeyDataType: + return keychainStore.containsObject(forKey: EncryptionKeyManager.cryptoSDKStoreKey) default: + MXLog.warning("[EncryptionKeyManager] hasKeyForData: No key for \(dataType)") return false } } @@ -103,7 +110,12 @@ class EncryptionKeyManager: NSObject, MXKeyProviderDelegate { let aesKey = try? keychainStore.data(forKey: EncryptionKeyManager.roomLastMessageAesKey) { return MXAesKeyData(iv: ivKey, key: aesKey) } + case MXCryptoSDKStoreKeyDataType: + if let key = try? keychainStore.data(forKey: EncryptionKeyManager.cryptoSDKStoreKey) { + return MXRawDataKey(key: key) + } default: + MXLog.failure("[EncryptionKeyManager] keyDataForData: Attempting to get data for unknown type", dataType) return nil } return nil diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 90533cfd13..fc10edf0e8 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -3386,7 +3386,7 @@ - (void)toggleEnableCryptoSDKFeature:(UISwitch *)sender MXWeakify(self); [currentAlert dismissViewControllerAnimated:NO completion:nil]; - UIAlertController *confirmationAlert = [UIAlertController alertControllerWithTitle:nil + UIAlertController *confirmationAlert = [UIAlertController alertControllerWithTitle:VectorL10n.settingsLabsEnableCryptoSdk message:VectorL10n.settingsLabsConfirmCryptoSdk preferredStyle:UIAlertControllerStyleAlert]; diff --git a/changelog.d/pr-7310.change b/changelog.d/pr-7310.change new file mode 100644 index 0000000000..4ba5e9ee10 --- /dev/null +++ b/changelog.d/pr-7310.change @@ -0,0 +1 @@ +CryptoV2: Generate Crypto SDK store key From 972c7fc4cba5f2d32c66e8d29350634758482881 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Mon, 30 Jan 2023 14:45:07 +0000 Subject: [PATCH 02/10] Display backup import progress --- Riot/Assets/en.lproj/Vector.strings | 1 + Riot/Generated/Strings.swift | 4 +++ ...verFromPrivateKeyViewController.storyboard | 26 ++++++++++++------- ...pRecoverFromPrivateKeyViewController.swift | 10 ++++--- ...BackupRecoverFromPrivateKeyViewModel.swift | 15 ++++++++++- ...BackupRecoverFromPrivateKeyViewState.swift | 2 +- changelog.d/pr-7319.change | 1 + 7 files changed, 45 insertions(+), 14 deletions(-) create mode 100644 changelog.d/pr-7319.change diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 2c555f6fcb..4d56129eb9 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -1469,6 +1469,7 @@ Tap the + to start adding people."; // Recover from private key "key_backup_recover_from_private_key_info" = "Restoring backup…"; +"key_backup_recover_from_private_key_progress" = "%@%% Complete"; // Recover from passphrase diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 5df732af13..47f6a77ae5 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -2755,6 +2755,10 @@ public class VectorL10n: NSObject { public static var keyBackupRecoverFromPrivateKeyInfo: String { return VectorL10n.tr("Vector", "key_backup_recover_from_private_key_info") } + /// %@%% Complete + public static func keyBackupRecoverFromPrivateKeyProgress(_ p1: String) -> String { + return VectorL10n.tr("Vector", "key_backup_recover_from_private_key_progress", p1) + } /// Use your Security Key to unlock your secure message history public static var keyBackupRecoverFromRecoveryKeyInfo: String { return VectorL10n.tr("Vector", "key_backup_recover_from_recovery_key_info") diff --git a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewController.storyboard b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewController.storyboard index 1c8ba341c8..42e99205e5 100644 --- a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewController.storyboard +++ b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewController.storyboard @@ -1,25 +1,23 @@ - - - - + + - + - + - + - + @@ -40,15 +38,24 @@ + + + + @@ -72,6 +79,7 @@ + @@ -79,10 +87,10 @@ - + diff --git a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewController.swift b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewController.swift index 1aaf96e62f..a02fed2014 100644 --- a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewController.swift +++ b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewController.swift @@ -29,6 +29,7 @@ final class KeyBackupRecoverFromPrivateKeyViewController: UIViewController { @IBOutlet private weak var shieldImageView: UIImageView! @IBOutlet private weak var informationLabel: UILabel! + @IBOutlet private weak var progressLabel: UILabel! // MARK: Private @@ -118,8 +119,8 @@ final class KeyBackupRecoverFromPrivateKeyViewController: UIViewController { private func render(viewState: KeyBackupRecoverFromPrivateKeyViewState) { switch viewState { - case .loading: - self.renderLoading() + case .loading(let progress): + self.renderLoading(progress: progress) case .loaded: self.renderLoaded() case .error(let error): @@ -127,8 +128,11 @@ final class KeyBackupRecoverFromPrivateKeyViewController: UIViewController { } } - private func renderLoading() { + private func renderLoading(progress: Double) { self.activityPresenter.presentActivityIndicator(on: self.view, animated: true) + + let percent = Int(round(progress * 100)) + self.progressLabel.text = VectorL10n.keyBackupRecoverFromPrivateKeyProgress("\(percent)") } private func renderLoaded() { diff --git a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewModel.swift b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewModel.swift index cef1d7c0cc..04fb48850f 100644 --- a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewModel.swift +++ b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewModel.swift @@ -27,6 +27,7 @@ final class KeyBackupRecoverFromPrivateKeyViewModel: KeyBackupRecoverFromPrivate private let keyBackup: MXKeyBackup private var currentHTTPOperation: MXHTTPOperation? private let keyBackupVersion: MXKeyBackupVersion + private var progressUpdateTimer: Timer? // MARK: Public @@ -56,7 +57,14 @@ final class KeyBackupRecoverFromPrivateKeyViewModel: KeyBackupRecoverFromPrivate private func recoverWithPrivateKey() { - self.update(viewState: .loading) + self.update(viewState: .loading(0)) + + // Update loading progress every second until no longer loading + progressUpdateTimer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { [weak self] _ in + if let progress = self?.keyBackup.importProgress { + self?.update(viewState: .loading(progress.fractionCompleted)) + } + } self.currentHTTPOperation = keyBackup.restore(usingPrivateKeyKeyBackup: keyBackupVersion, room: nil, session: nil, success: { [weak self] (_, _) in guard let self = self else { @@ -91,6 +99,11 @@ final class KeyBackupRecoverFromPrivateKeyViewModel: KeyBackupRecoverFromPrivate } private func update(viewState: KeyBackupRecoverFromPrivateKeyViewState) { + if case .loading = viewState {} else { + progressUpdateTimer?.invalidate() + progressUpdateTimer = nil + } + self.viewDelegate?.keyBackupRecoverFromPrivateKeyViewModel(self, didUpdateViewState: viewState) } } diff --git a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewState.swift b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewState.swift index bdd4178534..b4ef05fb94 100644 --- a/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewState.swift +++ b/Riot/Modules/KeyBackup/Recover/PrivateKey/KeyBackupRecoverFromPrivateKeyViewState.swift @@ -20,7 +20,7 @@ import Foundation /// KeyBackupRecoverFromPrivateKeyViewController view state enum KeyBackupRecoverFromPrivateKeyViewState { - case loading + case loading(Double) case loaded case error(Error) } diff --git a/changelog.d/pr-7319.change b/changelog.d/pr-7319.change new file mode 100644 index 0000000000..187b315b5a --- /dev/null +++ b/changelog.d/pr-7319.change @@ -0,0 +1 @@ +Backup: Display backup import progress From 4ae6061e013294a8453fa83b55c52d3b35593de6 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Tue, 31 Jan 2023 13:07:16 +0000 Subject: [PATCH 03/10] Reset Crypto SDK on logout --- Config/AppConfiguration.swift | 3 + Config/CommonConfiguration.swift | 6 -- Config/CryptoSDKConfiguration.swift | 55 +++++++++++++++++++ Riot/Modules/Application/LegacyAppDelegate.m | 5 ++ .../Modules/Settings/SettingsViewController.m | 3 +- changelog.d/pr-7323.change | 1 + 6 files changed, 65 insertions(+), 8 deletions(-) create mode 100644 Config/CryptoSDKConfiguration.swift create mode 100644 changelog.d/pr-7323.change diff --git a/Config/AppConfiguration.swift b/Config/AppConfiguration.swift index 70b1d78d5e..fe83fba1f6 100644 --- a/Config/AppConfiguration.swift +++ b/Config/AppConfiguration.swift @@ -24,6 +24,9 @@ class AppConfiguration: CommonConfiguration { override func setupSettings() { super.setupSettings() setupAppSettings() +#if DEBUG + CryptoSDKConfiguration.shared.setup() +#endif } private func setupAppSettings() { diff --git a/Config/CommonConfiguration.swift b/Config/CommonConfiguration.swift index f3172a7109..fee3796ff1 100644 --- a/Config/CommonConfiguration.swift +++ b/Config/CommonConfiguration.swift @@ -91,12 +91,6 @@ class CommonConfiguration: NSObject, Configurable { MXKeyProvider.sharedInstance().delegate = EncryptionKeyManager.shared sdkOptions.enableNewClientInformationFeature = RiotSettings.shared.enableClientInformationFeature - - #if DEBUG - if sdkOptions.isCryptoSDKAvailable { - sdkOptions.enableCryptoSDK = RiotSettings.shared.enableCryptoSDK - } - #endif } private func makeASCIIUserAgent() -> String? { diff --git a/Config/CryptoSDKConfiguration.swift b/Config/CryptoSDKConfiguration.swift new file mode 100644 index 0000000000..6edde78710 --- /dev/null +++ b/Config/CryptoSDKConfiguration.swift @@ -0,0 +1,55 @@ +// +// Copyright 2023 New Vector Ltd +// +// 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 +// +// http://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 + +#if DEBUG + +/// Configuration for enabling / disabling Matrix Crypto SDK +@objcMembers class CryptoSDKConfiguration: NSObject { + static let shared = CryptoSDKConfiguration() + + func setup() { + guard MXSDKOptions.sharedInstance().isCryptoSDKAvailable else { + return + } + + let isEnabled = RiotSettings.shared.enableCryptoSDK + MXSDKOptions.sharedInstance().enableCryptoSDK = isEnabled + + MXLog.debug("[CryptoSDKConfiguration] setup: Crypto SDK is \(isEnabled ? "enabled" : "disabled")") + } + + func enable() { + guard MXSDKOptions.sharedInstance().isCryptoSDKAvailable else { + return + } + + RiotSettings.shared.enableCryptoSDK = true + MXSDKOptions.sharedInstance().enableCryptoSDK = true + + MXLog.debug("[CryptoSDKConfiguration] enabling Crypto SDK") + } + + func disable() { + RiotSettings.shared.enableCryptoSDK = false + MXSDKOptions.sharedInstance().enableCryptoSDK = false + + MXLog.debug("[CryptoSDKConfiguration] disabling Crypto SDK") + } +} + +#endif diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 7bf51dd463..1fb151e204 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -2183,6 +2183,11 @@ - (void)logoutSendingRequestServer:(BOOL)sendLogoutServerRequest // Clear cache [self clearCache]; + // Reset Crypto SDK configuration (labs flag for which crypto module to use) +#if DEBUG + [CryptoSDKConfiguration.shared disable]; +#endif + // Reset key backup banner preferences [SecureBackupBannerPreferences.shared reset]; diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index fc10edf0e8..5cf6e933b6 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -3400,8 +3400,7 @@ - (void)toggleEnableCryptoSDKFeature:(UISwitch *)sender [confirmationAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n continue] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { MXStrongifyAndReturnIfNil(self); - RiotSettings.shared.enableCryptoSDK = isEnabled; - MXSDKOptions.sharedInstance.enableCryptoSDK = isEnabled; + [CryptoSDKConfiguration.shared enable]; [[AppDelegate theDelegate] reloadMatrixSessions:YES]; }]]; diff --git a/changelog.d/pr-7323.change b/changelog.d/pr-7323.change new file mode 100644 index 0000000000..308cf28136 --- /dev/null +++ b/changelog.d/pr-7323.change @@ -0,0 +1 @@ +CryptoV2: Reset Crypto SDK on logout From 8184832c40c39973e3d090c644f089b3fa716770 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Wed, 1 Feb 2023 11:49:16 +0000 Subject: [PATCH 04/10] Fix crypto v2 config --- Config/AppConfiguration.swift | 3 --- Config/CommonConfiguration.swift | 10 ++++++++++ Config/CryptoSDKConfiguration.swift | 11 ----------- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/Config/AppConfiguration.swift b/Config/AppConfiguration.swift index fe83fba1f6..70b1d78d5e 100644 --- a/Config/AppConfiguration.swift +++ b/Config/AppConfiguration.swift @@ -24,9 +24,6 @@ class AppConfiguration: CommonConfiguration { override func setupSettings() { super.setupSettings() setupAppSettings() -#if DEBUG - CryptoSDKConfiguration.shared.setup() -#endif } private func setupAppSettings() { diff --git a/Config/CommonConfiguration.swift b/Config/CommonConfiguration.swift index fee3796ff1..b98195e6de 100644 --- a/Config/CommonConfiguration.swift +++ b/Config/CommonConfiguration.swift @@ -91,6 +91,16 @@ class CommonConfiguration: NSObject, Configurable { MXKeyProvider.sharedInstance().delegate = EncryptionKeyManager.shared sdkOptions.enableNewClientInformationFeature = RiotSettings.shared.enableClientInformationFeature + + #if DEBUG + if sdkOptions.isCryptoSDKAvailable { + let isEnabled = RiotSettings.shared.enableCryptoSDK + MXLog.debug("[CryptoSDKConfiguration] Crypto SDK is \(isEnabled ? "enabled" : "disabled")") + sdkOptions.enableCryptoSDK = isEnabled + } else { + MXLog.debug("[CryptoSDKConfiguration] Crypto SDK is not available)") + } + #endif } private func makeASCIIUserAgent() -> String? { diff --git a/Config/CryptoSDKConfiguration.swift b/Config/CryptoSDKConfiguration.swift index 6edde78710..935988ba9e 100644 --- a/Config/CryptoSDKConfiguration.swift +++ b/Config/CryptoSDKConfiguration.swift @@ -22,17 +22,6 @@ import Foundation @objcMembers class CryptoSDKConfiguration: NSObject { static let shared = CryptoSDKConfiguration() - func setup() { - guard MXSDKOptions.sharedInstance().isCryptoSDKAvailable else { - return - } - - let isEnabled = RiotSettings.shared.enableCryptoSDK - MXSDKOptions.sharedInstance().enableCryptoSDK = isEnabled - - MXLog.debug("[CryptoSDKConfiguration] setup: Crypto SDK is \(isEnabled ? "enabled" : "disabled")") - } - func enable() { guard MXSDKOptions.sharedInstance().isCryptoSDKAvailable else { return From 60386f09702ab09cf51c5b421d7e37678c45ec65 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Thu, 2 Feb 2023 10:03:33 +0000 Subject: [PATCH 05/10] Refresh notification service on crypto change --- RiotNSE/NotificationService.swift | 18 +++++++++++++++++- changelog.d/pr-7332.change | 1 + 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 changelog.d/pr-7332.change diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index f9779641f5..aca8928442 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -41,6 +41,9 @@ class NotificationService: UNNotificationServiceExtension { private var ongoingVoIPPushRequests: [String: Bool] = [:] private var userAccount: MXKAccount? + #if DEBUG + private var isCryptoSDKEnabled = false + #endif /// Best attempt contents. Will be updated incrementally, if something fails during the process, this best attempt content will be showed as notification. Keys are eventId's private var bestAttemptContents: [String: UNMutableNotificationContent] = [:] @@ -195,7 +198,7 @@ class NotificationService: UNNotificationServiceExtension { self.userAccount = MXKAccountManager.shared()?.activeAccounts.first if let userAccount = userAccount { Self.backgroundServiceInitQueue.sync { - if NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials { + if hasChangedCryptoSDK() || NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials { MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: BEFORE") self.logMemory() NotificationService.backgroundSyncService = MXBackgroundSyncService(withCredentials: userAccount.mxCredentials, persistTokenDataHandler: { persistTokenDataHandler in @@ -214,6 +217,19 @@ class NotificationService: UNNotificationServiceExtension { } } + /// Determine whether we have switched from using crypto v1 to v2 or vice versa which will require + /// rebuilding `MXBackgroundSyncService` + private func hasChangedCryptoSDK() -> Bool { + #if DEBUG + if isCryptoSDKEnabled != RiotSettings.shared.enableCryptoSDK { + isCryptoSDKEnabled = RiotSettings.shared.enableCryptoSDK + return true + } + #endif + + return false + } + /// Attempts to preprocess payload and attach room display name to the best attempt content /// - Parameters: /// - eventId: Event identifier to mutate best attempt content diff --git a/changelog.d/pr-7332.change b/changelog.d/pr-7332.change new file mode 100644 index 0000000000..94a5bdc891 --- /dev/null +++ b/changelog.d/pr-7332.change @@ -0,0 +1 @@ +CryptoV2: Refresh notification service on crypto change From e328147e9b26fd96b5852f816752e93f164a34c6 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Mon, 31 Oct 2022 12:23:52 +0000 Subject: [PATCH 06/10] Enable Crypto SDK for production --- Config/CommonConfiguration.swift | 3 +-- Config/CryptoSDKConfiguration.swift | 6 ++---- .../MatrixSDKCrypto+LocalizedError.swift | 5 ----- Riot/Managers/Settings/RiotSettings.swift | 2 -- Riot/Modules/Application/LegacyAppDelegate.m | 2 -- .../Home/AllChats/AllChatsViewController.swift | 10 ++++++---- Riot/Modules/Settings/SettingsViewController.m | 6 ------ RiotNSE/NotificationService.swift | 14 +++++--------- changelog.d/pr-7333.change | 1 + 9 files changed, 15 insertions(+), 34 deletions(-) create mode 100644 changelog.d/pr-7333.change diff --git a/Config/CommonConfiguration.swift b/Config/CommonConfiguration.swift index b98195e6de..a8b420b201 100644 --- a/Config/CommonConfiguration.swift +++ b/Config/CommonConfiguration.swift @@ -92,15 +92,14 @@ class CommonConfiguration: NSObject, Configurable { sdkOptions.enableNewClientInformationFeature = RiotSettings.shared.enableClientInformationFeature - #if DEBUG if sdkOptions.isCryptoSDKAvailable { let isEnabled = RiotSettings.shared.enableCryptoSDK MXLog.debug("[CryptoSDKConfiguration] Crypto SDK is \(isEnabled ? "enabled" : "disabled")") sdkOptions.enableCryptoSDK = isEnabled + sdkOptions.enableStartupProgress = isEnabled } else { MXLog.debug("[CryptoSDKConfiguration] Crypto SDK is not available)") } - #endif } private func makeASCIIUserAgent() -> String? { diff --git a/Config/CryptoSDKConfiguration.swift b/Config/CryptoSDKConfiguration.swift index 935988ba9e..3c922e5473 100644 --- a/Config/CryptoSDKConfiguration.swift +++ b/Config/CryptoSDKConfiguration.swift @@ -16,8 +16,6 @@ import Foundation -#if DEBUG - /// Configuration for enabling / disabling Matrix Crypto SDK @objcMembers class CryptoSDKConfiguration: NSObject { static let shared = CryptoSDKConfiguration() @@ -29,6 +27,7 @@ import Foundation RiotSettings.shared.enableCryptoSDK = true MXSDKOptions.sharedInstance().enableCryptoSDK = true + MXSDKOptions.sharedInstance().enableStartupProgress = true MXLog.debug("[CryptoSDKConfiguration] enabling Crypto SDK") } @@ -36,9 +35,8 @@ import Foundation func disable() { RiotSettings.shared.enableCryptoSDK = false MXSDKOptions.sharedInstance().enableCryptoSDK = false + MXSDKOptions.sharedInstance().enableStartupProgress = false MXLog.debug("[CryptoSDKConfiguration] disabling Crypto SDK") } } - -#endif diff --git a/Riot/Categories/MatrixSDKCrypto+LocalizedError.swift b/Riot/Categories/MatrixSDKCrypto+LocalizedError.swift index d802d54ff5..4b314a0c18 100644 --- a/Riot/Categories/MatrixSDKCrypto+LocalizedError.swift +++ b/Riot/Categories/MatrixSDKCrypto+LocalizedError.swift @@ -15,9 +15,6 @@ // import Foundation - -#if DEBUG - import MatrixSDKCrypto extension CryptoStoreError: LocalizedError { @@ -27,5 +24,3 @@ extension CryptoStoreError: LocalizedError { return VectorL10n.e2eNeedLogInAgain } } - -#endif diff --git a/Riot/Managers/Settings/RiotSettings.swift b/Riot/Managers/Settings/RiotSettings.swift index d9e64a1af2..260a0aca78 100644 --- a/Riot/Managers/Settings/RiotSettings.swift +++ b/Riot/Managers/Settings/RiotSettings.swift @@ -192,11 +192,9 @@ final class RiotSettings: NSObject { @UserDefault(key: "enableVoiceBroadcast", defaultValue: false, storage: defaults) var enableVoiceBroadcast - #if DEBUG /// Flag indicating if we are using rust-based `MatrixCryptoSDK` instead of `MatrixSDK`'s internal crypto module @UserDefault(key: "enableCryptoSDK", defaultValue: false, storage: defaults) var enableCryptoSDK - #endif // MARK: Calls diff --git a/Riot/Modules/Application/LegacyAppDelegate.m b/Riot/Modules/Application/LegacyAppDelegate.m index 1fb151e204..302ba990e4 100644 --- a/Riot/Modules/Application/LegacyAppDelegate.m +++ b/Riot/Modules/Application/LegacyAppDelegate.m @@ -2184,9 +2184,7 @@ - (void)logoutSendingRequestServer:(BOOL)sendLogoutServerRequest [self clearCache]; // Reset Crypto SDK configuration (labs flag for which crypto module to use) -#if DEBUG [CryptoSDKConfiguration.shared disable]; -#endif // Reset key backup banner preferences [SecureBackupBannerPreferences.shared reset]; diff --git a/Riot/Modules/Home/AllChats/AllChatsViewController.swift b/Riot/Modules/Home/AllChats/AllChatsViewController.swift index 4b7ff566c9..3e689a42ed 100644 --- a/Riot/Modules/Home/AllChats/AllChatsViewController.swift +++ b/Riot/Modules/Home/AllChats/AllChatsViewController.swift @@ -885,10 +885,12 @@ extension AllChatsViewController: SplitViewMasterViewControllerProtocol { return } - let devices = mainSession.crypto.devices(forUser: mainSession.myUserId).values - let userHasOneUnverifiedDevice = devices.contains(where: {!$0.trustLevel.isCrossSigningVerified}) - if userHasOneUnverifiedDevice { - presentReviewUnverifiedSessionsAlert(with: session) + if let userId = mainSession.myUserId, let crypto = mainSession.crypto { + let devices = crypto.devices(forUser: userId).values + let userHasOneUnverifiedDevice = devices.contains(where: {!$0.trustLevel.isCrossSigningVerified}) + if userHasOneUnverifiedDevice { + presentReviewUnverifiedSessionsAlert(with: session) + } } } diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 5cf6e933b6..93fffc9e85 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -588,12 +588,10 @@ - (void)updateSections if (BuildSettings.settingsScreenShowLabSettings) { Section *sectionLabs = [Section sectionWithTag:SECTION_TAG_LABS]; - #if DEBUG if (MXSDKOptions.sharedInstance.isCryptoSDKAvailable) { [sectionLabs addRowWithTag:LABS_ENABLE_CRYPTO_SDK]; } - #endif [sectionLabs addRowWithTag:LABS_ENABLE_RINGING_FOR_GROUP_CALLS_INDEX]; [sectionLabs addRowWithTag:LABS_ENABLE_THREADS_INDEX]; @@ -2593,7 +2591,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N } else { - #if DEBUG if (row == LABS_ENABLE_CRYPTO_SDK) { MXKTableViewCellWithLabelAndSwitch *labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; @@ -2606,7 +2603,6 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N cell = labelAndSwitchCell; } - #endif } } else if (section == SECTION_TAG_SECURITY) @@ -3379,7 +3375,6 @@ - (void)toggleEnableVoiceBroadcastFeature:(UISwitch *)sender RiotSettings.shared.enableVoiceBroadcast = sender.isOn; } -#if DEBUG - (void)toggleEnableCryptoSDKFeature:(UISwitch *)sender { BOOL isEnabled = sender.isOn; @@ -3407,7 +3402,6 @@ - (void)toggleEnableCryptoSDKFeature:(UISwitch *)sender [self presentViewController:confirmationAlert animated:YES completion:nil]; currentAlert = confirmationAlert; } -#endif - (void)togglePinRoomsWithMissedNotif:(UISwitch *)sender { diff --git a/RiotNSE/NotificationService.swift b/RiotNSE/NotificationService.swift index aca8928442..6560290ab1 100644 --- a/RiotNSE/NotificationService.swift +++ b/RiotNSE/NotificationService.swift @@ -41,9 +41,7 @@ class NotificationService: UNNotificationServiceExtension { private var ongoingVoIPPushRequests: [String: Bool] = [:] private var userAccount: MXKAccount? - #if DEBUG private var isCryptoSDKEnabled = false - #endif /// Best attempt contents. Will be updated incrementally, if something fails during the process, this best attempt content will be showed as notification. Keys are eventId's private var bestAttemptContents: [String: UNMutableNotificationContent] = [:] @@ -201,6 +199,7 @@ class NotificationService: UNNotificationServiceExtension { if hasChangedCryptoSDK() || NotificationService.backgroundSyncService?.credentials != userAccount.mxCredentials { MXLog.debug("[NotificationService] setup: MXBackgroundSyncService init: BEFORE") self.logMemory() + NotificationService.backgroundSyncService = MXBackgroundSyncService(withCredentials: userAccount.mxCredentials, persistTokenDataHandler: { persistTokenDataHandler in MXKAccountManager.shared().readAndWriteCredentials(persistTokenDataHandler) }, unauthenticatedHandler: { error, softLogout, refreshTokenAuth, completion in @@ -220,14 +219,11 @@ class NotificationService: UNNotificationServiceExtension { /// Determine whether we have switched from using crypto v1 to v2 or vice versa which will require /// rebuilding `MXBackgroundSyncService` private func hasChangedCryptoSDK() -> Bool { - #if DEBUG - if isCryptoSDKEnabled != RiotSettings.shared.enableCryptoSDK { - isCryptoSDKEnabled = RiotSettings.shared.enableCryptoSDK - return true + guard isCryptoSDKEnabled != RiotSettings.shared.enableCryptoSDK else { + return false } - #endif - - return false + isCryptoSDKEnabled = RiotSettings.shared.enableCryptoSDK + return true } /// Attempts to preprocess payload and attach room display name to the best attempt content diff --git a/changelog.d/pr-7333.change b/changelog.d/pr-7333.change new file mode 100644 index 0000000000..fbf81e8735 --- /dev/null +++ b/changelog.d/pr-7333.change @@ -0,0 +1 @@ +CryptoV2: Enable Crypto SDK for production From 4eb018106c8eca65b23637c4ed778a697541c8f6 Mon Sep 17 00:00:00 2001 From: Andy Uhnak Date: Thu, 2 Feb 2023 14:31:36 +0000 Subject: [PATCH 07/10] Track crypto sdk being enabled --- Config/CommonConfiguration.swift | 4 ++-- Riot/Assets/en.lproj/Vector.strings | 6 +++--- Riot/Generated/Strings.swift | 6 +++--- Riot/Modules/Analytics/Analytics.swift | 16 ++++++++++++++++ Riot/Modules/Settings/SettingsViewController.m | 11 +++++------ 5 files changed, 29 insertions(+), 14 deletions(-) diff --git a/Config/CommonConfiguration.swift b/Config/CommonConfiguration.swift index a8b420b201..35001b1e48 100644 --- a/Config/CommonConfiguration.swift +++ b/Config/CommonConfiguration.swift @@ -94,11 +94,11 @@ class CommonConfiguration: NSObject, Configurable { if sdkOptions.isCryptoSDKAvailable { let isEnabled = RiotSettings.shared.enableCryptoSDK - MXLog.debug("[CryptoSDKConfiguration] Crypto SDK is \(isEnabled ? "enabled" : "disabled")") + MXLog.debug("[CommonConfiguration] Crypto SDK is \(isEnabled ? "enabled" : "disabled")") sdkOptions.enableCryptoSDK = isEnabled sdkOptions.enableStartupProgress = isEnabled } else { - MXLog.debug("[CryptoSDKConfiguration] Crypto SDK is not available)") + MXLog.debug("[CommonConfiguration] Crypto SDK is not available)") } } diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 4d56129eb9..3b2871460d 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -804,9 +804,9 @@ Tap the + to start adding people."; "settings_labs_enable_new_app_layout" = "New Application Layout"; "settings_labs_enable_wysiwyg_composer" = "Try out the rich text editor"; "settings_labs_enable_voice_broadcast" = "Voice broadcast"; -"settings_labs_enable_crypto_sdk" = "End-to-end encryption 2.0"; -"settings_labs_confirm_crypto_sdk" = "This option will enable a new, faster and more reliable engine for end-to-end encryption written in Rust. Once enabled, you will need to log out to disable it. Do you wish to proceed?"; -"settings_labs_disable_crypto_sdk" = "End-to-end encryption 2.0 (log out to disable)"; +"settings_labs_enable_crypto_sdk" = "Rust end-to-end encryption"; +"settings_labs_confirm_crypto_sdk" = "Please be advised that as this feature is still in its experimental stage, it may not function as expected and could potentially have unintended consequences. To revert the feature, simply log out and log back in. Use at your own discretion and with caution."; +"settings_labs_disable_crypto_sdk" = "Rust end-to-end encryption (log out to disable)"; "settings_version" = "Version %@"; "settings_olm_version" = "Olm Version %@"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 47f6a77ae5..8c676d6666 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -7587,7 +7587,7 @@ public class VectorL10n: NSObject { public static var settingsLabs: String { return VectorL10n.tr("Vector", "settings_labs") } - /// This option will enable a new, faster and more reliable engine for end-to-end encryption written in Rust. Once enabled, you will need to log out to disable it. Do you wish to proceed? + /// Please be advised that as this feature is still in its experimental stage, it may not function as expected and could potentially have unintended consequences. To revert the feature, simply log out and log back in. Use at your own discretion and with caution. public static var settingsLabsConfirmCryptoSdk: String { return VectorL10n.tr("Vector", "settings_labs_confirm_crypto_sdk") } @@ -7595,7 +7595,7 @@ public class VectorL10n: NSObject { public static var settingsLabsCreateConferenceWithJitsi: String { return VectorL10n.tr("Vector", "settings_labs_create_conference_with_jitsi") } - /// End-to-end encryption 2.0 (log out to disable) + /// Rust end-to-end encryption (log out to disable) public static var settingsLabsDisableCryptoSdk: String { return VectorL10n.tr("Vector", "settings_labs_disable_crypto_sdk") } @@ -7611,7 +7611,7 @@ public class VectorL10n: NSObject { public static var settingsLabsEnableAutoReportDecryptionErrors: String { return VectorL10n.tr("Vector", "settings_labs_enable_auto_report_decryption_errors") } - /// End-to-end encryption 2.0 + /// Rust end-to-end encryption public static var settingsLabsEnableCryptoSdk: String { return VectorL10n.tr("Vector", "settings_labs_enable_crypto_sdk") } diff --git a/Riot/Modules/Analytics/Analytics.swift b/Riot/Modules/Analytics/Analytics.swift index b608c862e1..60e1560b9b 100644 --- a/Riot/Modules/Analytics/Analytics.swift +++ b/Riot/Modules/Analytics/Analytics.swift @@ -324,6 +324,11 @@ extension Analytics { viewRoomTrigger = .unknown capture(event: event) } + + func trackCryptoSDKEnabled() { + let event = AnalyticsEvent.CryptoSDKEnabled() + capture(event: event) + } } // MARK: - MXAnalyticsDelegate @@ -393,3 +398,14 @@ extension Analytics: MXAnalyticsDelegate { monitoringClient.trackNonFatalIssue(issue, details: details) } } + +/// iOS-specific analytics event triggered when users select the Crypto SDK labs option +/// +/// Due to this event being iOS only, and temporary during gradual rollout of Crypto SDK, +/// this event is not added into the shared analytics schema +extension AnalyticsEvent { + struct CryptoSDKEnabled: AnalyticsEventProtocol { + let eventName = "CryptoSDKEnabled" + let properties: [String: Any] = [:] + } +} diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index 93fffc9e85..ea8b57b228 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -2599,7 +2599,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N labelAndSwitchCell.mxkSwitch.on = isEnabled; [labelAndSwitchCell.mxkSwitch setEnabled:!isEnabled]; labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleEnableCryptoSDKFeature:) forControlEvents:UIControlEventTouchUpInside]; + [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(enableCryptoSDKFeature:) forControlEvents:UIControlEventTouchUpInside]; cell = labelAndSwitchCell; } @@ -3375,16 +3375,14 @@ - (void)toggleEnableVoiceBroadcastFeature:(UISwitch *)sender RiotSettings.shared.enableVoiceBroadcast = sender.isOn; } -- (void)toggleEnableCryptoSDKFeature:(UISwitch *)sender +- (void)enableCryptoSDKFeature:(UISwitch *)sender { - BOOL isEnabled = sender.isOn; - MXWeakify(self); - [currentAlert dismissViewControllerAnimated:NO completion:nil]; UIAlertController *confirmationAlert = [UIAlertController alertControllerWithTitle:VectorL10n.settingsLabsEnableCryptoSdk message:VectorL10n.settingsLabsConfirmCryptoSdk preferredStyle:UIAlertControllerStyleAlert]; + MXWeakify(self); [confirmationAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n cancel] style:UIAlertActionStyleCancel handler:^(UIAlertAction * action) { MXStrongifyAndReturnIfNil(self); self->currentAlert = nil; @@ -3393,9 +3391,10 @@ - (void)toggleEnableCryptoSDKFeature:(UISwitch *)sender }]]; [confirmationAlert addAction:[UIAlertAction actionWithTitle:[VectorL10n continue] style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) { - MXStrongifyAndReturnIfNil(self); [CryptoSDKConfiguration.shared enable]; + [Analytics.shared trackCryptoSDKEnabled]; + [[AppDelegate theDelegate] reloadMatrixSessions:YES]; }]]; From 8205be1ef7525bbb4dd10cf1b51d137bd79994b8 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 2 Feb 2023 18:05:50 +0000 Subject: [PATCH 08/10] changelog.d: Upgrade MatrixSDK version ([v0.25.0](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.25.0)). --- Config/AppVersion.xcconfig | 4 ++-- Podfile | 2 +- changelog.d/x-nolink-0.change | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 changelog.d/x-nolink-0.change diff --git a/Config/AppVersion.xcconfig b/Config/AppVersion.xcconfig index 210603b235..d203e4e632 100644 --- a/Config/AppVersion.xcconfig +++ b/Config/AppVersion.xcconfig @@ -15,5 +15,5 @@ // // Version -MARKETING_VERSION = 1.9.17 -CURRENT_PROJECT_VERSION = 1.9.17 +MARKETING_VERSION = 1.10.0 +CURRENT_PROJECT_VERSION = 1.10.0 diff --git a/Podfile b/Podfile index 35ba935b2a..376ec852a1 100644 --- a/Podfile +++ b/Podfile @@ -16,7 +16,7 @@ use_frameworks! # - `{ :specHash => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for MatrixSDK repo. Used by Fastfile during CI # # Warning: our internal tooling depends on the name of this variable name, so be sure not to change it -$matrixSDKVersion = '= 0.24.8' +$matrixSDKVersion = '= 0.25.0' # $matrixSDKVersion = :local # $matrixSDKVersion = { :branch => 'develop'} # $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } } diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change new file mode 100644 index 0000000000..497d15527a --- /dev/null +++ b/changelog.d/x-nolink-0.change @@ -0,0 +1 @@ +Upgrade MatrixSDK version ([v0.25.0](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.25.0)). \ No newline at end of file From 4e807ab80fea865b836eafb5efa1c77112430d03 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 2 Feb 2023 18:05:51 +0000 Subject: [PATCH 09/10] version++ --- CHANGES.md | 12 ++++++++++++ changelog.d/pr-7310.change | 1 - changelog.d/pr-7319.change | 1 - changelog.d/pr-7323.change | 1 - changelog.d/pr-7332.change | 1 - changelog.d/pr-7333.change | 1 - changelog.d/x-nolink-0.change | 1 - 7 files changed, 12 insertions(+), 6 deletions(-) delete mode 100644 changelog.d/pr-7310.change delete mode 100644 changelog.d/pr-7319.change delete mode 100644 changelog.d/pr-7323.change delete mode 100644 changelog.d/pr-7332.change delete mode 100644 changelog.d/pr-7333.change delete mode 100644 changelog.d/x-nolink-0.change diff --git a/CHANGES.md b/CHANGES.md index 3484fcf48f..c24df14b8f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,15 @@ +## Changes in 1.10.0 (2023-02-02) + +🙌 Improvements + +- CryptoV2: Generate Crypto SDK store key ([#7310](https://github.com/vector-im/element-ios/pull/7310)) +- Backup: Display backup import progress ([#7319](https://github.com/vector-im/element-ios/pull/7319)) +- CryptoV2: Reset Crypto SDK on logout ([#7323](https://github.com/vector-im/element-ios/pull/7323)) +- CryptoV2: Refresh notification service on crypto change ([#7332](https://github.com/vector-im/element-ios/pull/7332)) +- CryptoV2: Enable Crypto SDK for production ([#7333](https://github.com/vector-im/element-ios/pull/7333)) +- Upgrade MatrixSDK version ([v0.25.0](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.25.0)). + + ## Changes in 1.9.17 (2023-01-26) 🙌 Improvements diff --git a/changelog.d/pr-7310.change b/changelog.d/pr-7310.change deleted file mode 100644 index 4ba5e9ee10..0000000000 --- a/changelog.d/pr-7310.change +++ /dev/null @@ -1 +0,0 @@ -CryptoV2: Generate Crypto SDK store key diff --git a/changelog.d/pr-7319.change b/changelog.d/pr-7319.change deleted file mode 100644 index 187b315b5a..0000000000 --- a/changelog.d/pr-7319.change +++ /dev/null @@ -1 +0,0 @@ -Backup: Display backup import progress diff --git a/changelog.d/pr-7323.change b/changelog.d/pr-7323.change deleted file mode 100644 index 308cf28136..0000000000 --- a/changelog.d/pr-7323.change +++ /dev/null @@ -1 +0,0 @@ -CryptoV2: Reset Crypto SDK on logout diff --git a/changelog.d/pr-7332.change b/changelog.d/pr-7332.change deleted file mode 100644 index 94a5bdc891..0000000000 --- a/changelog.d/pr-7332.change +++ /dev/null @@ -1 +0,0 @@ -CryptoV2: Refresh notification service on crypto change diff --git a/changelog.d/pr-7333.change b/changelog.d/pr-7333.change deleted file mode 100644 index fbf81e8735..0000000000 --- a/changelog.d/pr-7333.change +++ /dev/null @@ -1 +0,0 @@ -CryptoV2: Enable Crypto SDK for production diff --git a/changelog.d/x-nolink-0.change b/changelog.d/x-nolink-0.change deleted file mode 100644 index 497d15527a..0000000000 --- a/changelog.d/x-nolink-0.change +++ /dev/null @@ -1 +0,0 @@ -Upgrade MatrixSDK version ([v0.25.0](https://github.com/matrix-org/matrix-ios-sdk/releases/tag/v0.25.0)). \ No newline at end of file From 1237142d9912040e954e0ab387d56cc460fce917 Mon Sep 17 00:00:00 2001 From: Doug Date: Thu, 2 Feb 2023 19:20:46 +0000 Subject: [PATCH 10/10] finish version++ --- Podfile.lock | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 24b937005f..a8c7f04f83 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -55,22 +55,20 @@ PODS: - LoggerAPI (1.9.200): - Logging (~> 1.1) - Logging (1.4.0) - - MatrixSDK (0.24.8): - - MatrixSDK/Core (= 0.24.8) - - MatrixSDK/Core (0.24.8): + - MatrixSDK (0.25.0): + - MatrixSDK/Core (= 0.25.0) + - MatrixSDK/Core (0.25.0): - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - - MatrixSDK/CryptoSDK + - MatrixSDKCrypto (= 0.2.0) - OLMKit (~> 3.2.5) - Realm (= 10.27.0) - SwiftyBeaver (= 1.9.5) - - MatrixSDK/CryptoSDK (0.24.8): - - MatrixSDKCrypto (= 0.1.8) - - MatrixSDK/JingleCallStack (0.24.8): + - MatrixSDK/JingleCallStack (0.25.0): - JitsiMeetSDK (= 5.0.2) - MatrixSDK/Core - - MatrixSDKCrypto (0.1.8) + - MatrixSDKCrypto (0.2.0) - OLMKit (3.2.12): - OLMKit/olmc (= 3.2.12) - OLMKit/olmcpp (= 3.2.12) @@ -122,8 +120,8 @@ DEPENDENCIES: - KeychainAccess (~> 4.2.2) - KTCenterFlowLayout (~> 1.3.1) - libPhoneNumber-iOS (~> 0.9.13) - - MatrixSDK (= 0.24.8) - - MatrixSDK/JingleCallStack (= 0.24.8) + - MatrixSDK (= 0.25.0) + - MatrixSDK/JingleCallStack (= 0.25.0) - OLMKit - PostHog (~> 1.4.4) - ReadMoreTextView (~> 3.0.1) @@ -220,8 +218,8 @@ SPEC CHECKSUMS: libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75 LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d Logging: beeb016c9c80cf77042d62e83495816847ef108b - MatrixSDK: cf1c1b2a9742f7f4fad21e94bd94cd8f13c47369 - MatrixSDKCrypto: 862d9b4dbb6861da030943f5a18c39258ed7345b + MatrixSDK: a9d05e760434eff941bbb35164cffb01b3f94b63 + MatrixSDKCrypto: e1ef22aae76b5a6f030ace21a47be83864f4ff44 OLMKit: da115f16582e47626616874e20f7bb92222c7a51 PostHog: 4b6321b521569092d4ef3a02238d9435dbaeb99f ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d @@ -241,6 +239,6 @@ SPEC CHECKSUMS: zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb -PODFILE CHECKSUM: 079b57b800c666ad864e1f059ae69e150a98a4f0 +PODFILE CHECKSUM: 916221b3e9512715d5e1e1e310a0aa0552e1f0f1 COCOAPODS: 1.11.3