diff --git a/App/client-ios.xcodeproj/project.pbxproj b/App/client-ios.xcodeproj/project.pbxproj index df25d8568ed39b8a2eac0b9e49346bf9065e5e6d..5a37a1fdc96d3f08bc3a58a1292fcdc22f9f402d 100644 --- a/App/client-ios.xcodeproj/project.pbxproj +++ b/App/client-ios.xcodeproj/project.pbxproj @@ -448,7 +448,7 @@ CODE_SIGN_ENTITLEMENTS = "client-ios/Resources/client-ios.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 283; + CURRENT_PROJECT_VERSION = 288; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = S6JDM2WW29; ENABLE_BITCODE = NO; @@ -487,7 +487,7 @@ CODE_SIGN_ENTITLEMENTS = "client-ios/Resources/client-ios.entitlements"; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 283; + CURRENT_PROJECT_VERSION = 288; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_TEAM = S6JDM2WW29; ENABLE_BITCODE = NO; @@ -522,7 +522,7 @@ CODE_SIGN_ENTITLEMENTS = NotificationExtension/NotificationExtension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 283; + CURRENT_PROJECT_VERSION = 288; DEVELOPMENT_TEAM = S6JDM2WW29; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -553,7 +553,7 @@ CODE_SIGN_ENTITLEMENTS = NotificationExtension/NotificationExtension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 283; + CURRENT_PROJECT_VERSION = 288; DEVELOPMENT_TEAM = S6JDM2WW29; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( diff --git a/App/client-ios/Resources/Info.plist b/App/client-ios/Resources/Info.plist index ee4d813d2e0ccc94a932d66a36070d80705cab5b..d8cb845b40392068f453251c9c0aa72cd00979db 100644 --- a/App/client-ios/Resources/Info.plist +++ b/App/client-ios/Resources/Info.plist @@ -105,6 +105,6 @@ <key>UIViewControllerBasedStatusBarAppearance</key> <true/> <key>isReportingOptional</key> - <true/> + <false/> </dict> </plist> diff --git a/Sources/App/AppDelegate.swift b/Sources/App/AppDelegate.swift index 365a58740c054b5b86d90819a943fd1e9c6e67d0..9b7e38445e805bcea087ffe8c3e22a8c7c078f3d 100644 --- a/Sources/App/AppDelegate.swift +++ b/Sources/App/AppDelegate.swift @@ -15,7 +15,6 @@ import XXClient import XXMessengerClient import CloudFiles -import CloudFilesDrive import CloudFilesDropbox public class AppDelegate: UIResponder, UIApplicationDelegate { @@ -64,7 +63,6 @@ public class AppDelegate: UIResponder, UIApplicationDelegate { PushRouter.live(navigationController: navController) ) - restoreIfPossible() return true } diff --git a/Sources/BackupFeature/Service/BackupService.swift b/Sources/BackupFeature/Service/BackupService.swift index 72cbe7fee7b3fb7cc1c6381f62720e11c394770f..1599a423406940914a6423d4f4030bcfad45f82d 100644 --- a/Sources/BackupFeature/Service/BackupService.swift +++ b/Sources/BackupFeature/Service/BackupService.swift @@ -26,6 +26,8 @@ public final class BackupService { @Dependency var messenger: Messenger @Dependency var networkManager: NetworkMonitoring + @KeyObject(.email, defaultValue: nil) var email: String? + @KeyObject(.phone, defaultValue: nil) var phone: String? @KeyObject(.username, defaultValue: nil) var username: String? @KeyObject(.backupSettings, defaultValue: nil) var storedSettings: Data? @@ -76,7 +78,11 @@ extension BackupService { public func initializeBackup(passphrase: String) { try! messenger.startBackup( password: passphrase, - params: .init(username: username!) + params: .init( + username: username!, + email: email, + phone: phone + ) ) } diff --git a/Sources/InputField/Validator.swift b/Sources/InputField/Validator.swift index 042916f36061b3b111e3d49cd1deb9e6079c2ed3..b649bd5df0e51e8e0361f12570794236c4374848 100644 --- a/Sources/InputField/Validator.swift +++ b/Sources/InputField/Validator.swift @@ -58,7 +58,7 @@ public extension Validator where T == String { return .failure("") } - let regex = try? NSRegularExpression(pattern: "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d!@#$%^&*]{8,}$") + let regex = try? NSRegularExpression(pattern: "^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d\\W_]{8,}$") guard let regex = regex, regex.firstMatch(in: passphrase, options: [], range: passphrase.fullRange()) != nil else { return .failure("") diff --git a/Sources/RestoreFeature/ViewModels/RestoreListViewModel.swift b/Sources/RestoreFeature/ViewModels/RestoreListViewModel.swift index f9b252fa459fb1f38ff8b7e5c3167588442f0dfe..ec247ddcc0e005ca089e42343459fa73288f8eec 100644 --- a/Sources/RestoreFeature/ViewModels/RestoreListViewModel.swift +++ b/Sources/RestoreFeature/ViewModels/RestoreListViewModel.swift @@ -96,6 +96,7 @@ final class RestoreListViewModel { guard let manager = managers[provider] else { return } + hudSubject.send(.on) do { try manager.fetch { [weak self] in guard let self else { return } @@ -108,6 +109,7 @@ final class RestoreListViewModel { provider: provider, metadata: metadata )) + self.hudSubject.send(.none) case .failure(let error): self.hudSubject.send(.error(.init(with: error))) } diff --git a/Sources/RestoreFeature/ViewModels/RestoreViewModel.swift b/Sources/RestoreFeature/ViewModels/RestoreViewModel.swift index bda1797a4f2d800de73290ce4238bb53d675da31..390c756dcfbe161ea056c8fde95f962eda37dadc 100644 --- a/Sources/RestoreFeature/ViewModels/RestoreViewModel.swift +++ b/Sources/RestoreFeature/ViewModels/RestoreViewModel.swift @@ -127,6 +127,21 @@ final class RestoreViewModel { onProgress: { print(">>> \($0)") } ) + try self.database.saveContact(.init( + id: self.messenger.e2e.get()!.getContact().getId(), + marshaled: self.messenger.e2e.get()!.getContact().data, + username: self.username!, + email: self.email, + phone: self.phone, + nickname: nil, + photo: nil, + authStatus: .friend, + isRecent: false, + isBlocked: false, + isBanned: false, + createdAt: Date() + )) + print(">>> Calling multilookup") let multilookup = try self.messenger.lookupContacts(ids: result.restoredContacts) @@ -147,8 +162,12 @@ final class RestoreViewModel { isBanned: false, createdAt: Date() )) + + let _ = try! self.messenger.e2e.get()!.resetAuthenticatedChannel(partner: $0) } + try self.messenger.start() + multilookup.errors.forEach { print(">>> Error: \($0.localizedDescription)") } diff --git a/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved b/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved index 3bca0daa0ddbe040fcc9e4f097dbcc15e01def8b..b1975fc1c84bad46fd59eaa07c5716d0682d0931 100644 --- a/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/client-ios.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -99,15 +99,6 @@ "version" : "1.3.0" } }, - { - "identity" : "fileprovider", - "kind" : "remoteSourceControl", - "location" : "https://github.com/amosavian/FileProvider.git", - "state" : { - "revision" : "abf68a62541a4193c8d106367ddb3648e8ab693f", - "version" : "0.26.0" - } - }, { "identity" : "firebase-ios-sdk", "kind" : "remoteSourceControl",