diff --git a/AGENTS.md b/AGENTS.md
index 288248ea6e..2b84c6420b 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -28,7 +28,7 @@ Other platforms like Android are irrelevant for this project.
| `iOSClient` | Main iOS client source code. | — |
| `iOSClient/Utility/Passcode` | Shared SwiftUI passcode UI and authentication model for the app and Share Extension; the mandatory app lock uses a dedicated window per scene. | Preserve existing credentials, lockout rules and app/extension reset behavior. |
| `iOSClient/Supporting Files` | Translation files synced with Transifex (see `iOSClient/.tx/config`). | Only add new strings to `en.lproj` (`Localizable.strings`, plurals in `Localizable.stringsdict`); never edit the other `*.lproj` dirs — Transifex overwrites them. |
-| `Brand` | Branding layer: `NCBrand.swift` (app constants, colors), `Database.swift` (Realm database name and schema version), Info.plists and entitlements for all targets, launch screen and intro screens. | Bump `databaseSchemaVersion` in `Brand/Database.swift` when changing Realm models. |
+| `Brand` | Branding layer: `NCBrand.swift` (app constants, colors), `Database.swift` (Realm database name and schema version), Info.plists and entitlements for all targets, and the launch screen. | Bump `databaseSchemaVersion` in `Brand/Database.swift` when changing Realm models. |
| `File Provider Extension` | Contains business logic for the iOS File Provider extension. | — |
| `File Provider Extension UI` | Contains UI logic for the iOS File Provider extension. | — |
| `Share` | Contains the active Share extension entry point, launched through `NSExtensionPrincipalClass`, plus input preparation, session storage and recent upload destinations. | — |
diff --git a/Brand/Custom.xcassets/intro1.imageset/Contents.json b/Brand/Custom.xcassets/intro1.imageset/Contents.json
deleted file mode 100644
index 9b5a868724..0000000000
--- a/Brand/Custom.xcassets/intro1.imageset/Contents.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "images" : [
- {
- "filename" : "intro1.svg",
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
diff --git a/Brand/Custom.xcassets/intro1.imageset/intro1.svg b/Brand/Custom.xcassets/intro1.imageset/intro1.svg
deleted file mode 100644
index 076f295e4d..0000000000
--- a/Brand/Custom.xcassets/intro1.imageset/intro1.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/Brand/Custom.xcassets/intro2.imageset/Contents.json b/Brand/Custom.xcassets/intro2.imageset/Contents.json
deleted file mode 100644
index b56c247bbc..0000000000
--- a/Brand/Custom.xcassets/intro2.imageset/Contents.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "images" : [
- {
- "filename" : "intro2.png",
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
diff --git a/Brand/Custom.xcassets/intro2.imageset/intro2.png b/Brand/Custom.xcassets/intro2.imageset/intro2.png
deleted file mode 100644
index 6cf5f76ae7..0000000000
Binary files a/Brand/Custom.xcassets/intro2.imageset/intro2.png and /dev/null differ
diff --git a/Brand/Custom.xcassets/intro3.imageset/Contents.json b/Brand/Custom.xcassets/intro3.imageset/Contents.json
deleted file mode 100644
index 973ded86a5..0000000000
--- a/Brand/Custom.xcassets/intro3.imageset/Contents.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "images" : [
- {
- "filename" : "intro3.png",
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
diff --git a/Brand/Custom.xcassets/intro3.imageset/intro3.png b/Brand/Custom.xcassets/intro3.imageset/intro3.png
deleted file mode 100644
index 0c6e078c99..0000000000
Binary files a/Brand/Custom.xcassets/intro3.imageset/intro3.png and /dev/null differ
diff --git a/Brand/Custom.xcassets/intro4.imageset/Contents.json b/Brand/Custom.xcassets/intro4.imageset/Contents.json
deleted file mode 100644
index ea407c2d00..0000000000
--- a/Brand/Custom.xcassets/intro4.imageset/Contents.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "images" : [
- {
- "filename" : "intro4.png",
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- }
-}
diff --git a/Brand/Custom.xcassets/intro4.imageset/intro4.png b/Brand/Custom.xcassets/intro4.imageset/intro4.png
deleted file mode 100644
index 30a81f0b26..0000000000
Binary files a/Brand/Custom.xcassets/intro4.imageset/intro4.png and /dev/null differ
diff --git a/Brand/Intro/NCIntro.storyboard b/Brand/Intro/NCIntro.storyboard
deleted file mode 100644
index 8fbfcb94de..0000000000
--- a/Brand/Intro/NCIntro.storyboard
+++ /dev/null
@@ -1,137 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Brand/Intro/NCIntroCollectionViewCell.swift b/Brand/Intro/NCIntroCollectionViewCell.swift
deleted file mode 100644
index 600d6029aa..0000000000
--- a/Brand/Intro/NCIntroCollectionViewCell.swift
+++ /dev/null
@@ -1,14 +0,0 @@
-// SPDX-FileCopyrightText: Nextcloud GmbH
-// SPDX-FileCopyrightText: 2019 Marino Faggiana
-// SPDX-FileCopyrightText: 2019 Philippe Weidmann
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-import UIKit
-
-class NCIntroCollectionViewCell: UICollectionViewCell {
-
- @IBOutlet weak var titleLabel: UILabel!
- @IBOutlet weak var imageView: UIImageView!
-
- var indexPath = IndexPath()
-}
diff --git a/Brand/Intro/NCIntroCollectionViewCell.xib b/Brand/Intro/NCIntroCollectionViewCell.xib
deleted file mode 100644
index 7eed66d3ba..0000000000
--- a/Brand/Intro/NCIntroCollectionViewCell.xib
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/Brand/Intro/NCIntroViewController.swift b/Brand/Intro/NCIntroViewController.swift
deleted file mode 100644
index 7b5a63cdc8..0000000000
--- a/Brand/Intro/NCIntroViewController.swift
+++ /dev/null
@@ -1,186 +0,0 @@
-// SPDX-FileCopyrightText: Nextcloud GmbH
-// SPDX-FileCopyrightText: 2019 Marino Faggiana
-// SPDX-FileCopyrightText: 2019 Philippe Weidmann
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-import UIKit
-
-class NCIntroViewController: UIViewController, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
- @IBOutlet weak var buttonLogin: UIButton!
- @IBOutlet weak var buttonSignUp: UIButton!
- @IBOutlet weak var buttonHost: UIButton!
- @IBOutlet weak var introCollectionView: UICollectionView!
- @IBOutlet weak var pageControl: UIPageControl!
-
- weak var delegate: NCIntroViewController?
- // Controller
- var controller: NCMainTabBarController?
-
- private let appDelegate = (UIApplication.shared.delegate as? AppDelegate)!
- private let titles = [NSLocalizedString("_intro_1_title_", comment: ""), NSLocalizedString("_intro_2_title_", comment: ""), NSLocalizedString("_intro_3_title_", comment: ""), NSLocalizedString("_intro_4_title_", comment: "")]
- private let images = [UIImage(named: "intro1"), UIImage(named: "intro2"), UIImage(named: "intro3"), UIImage(named: "intro4")]
- private var timer: Timer?
- private var textColor: UIColor = .white
- private var textColorOpponent: UIColor = .black
- private var activeLoginProvider: NCLoginProvider?
-
- // MARK: - View Life Cycle
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- let isTooLight = NCBrandColor.shared.customer.isTooLight()
- let isTooDark = NCBrandColor.shared.customer.isTooDark()
-
- if isTooLight {
- textColor = .black
- textColorOpponent = .white
- } else if isTooDark {
- textColor = .white
- textColorOpponent = .black
- } else {
- textColor = .white
- textColorOpponent = .black
- }
-
- let navBarAppearance = UINavigationBarAppearance()
- navBarAppearance.configureWithTransparentBackground()
- navBarAppearance.shadowColor = .clear
- navBarAppearance.shadowImage = UIImage()
- self.navigationController?.navigationBar.standardAppearance = navBarAppearance
- self.navigationController?.view.backgroundColor = NCBrandColor.shared.customer
- self.navigationController?.navigationBar.tintColor = textColor
-
- if !NCManageDatabase.shared.getAllTableAccount().isEmpty {
- let navigationItemCancel = UIBarButtonItem(image: UIImage(systemName: "xmark"), style: .plain, target: self, action: #selector(actionCancel(_:)))
- navigationItemCancel.tintColor = textColor
- navigationItem.rightBarButtonItem = navigationItemCancel
- }
-
- pageControl.currentPageIndicatorTintColor = textColor
- pageControl.pageIndicatorTintColor = .lightGray
-
- buttonLogin.layer.cornerRadius = 8
- buttonLogin.setTitleColor(NCBrandColor.shared.customer, for: .normal)
- buttonLogin.backgroundColor = textColor
- buttonLogin.setTitle(NSLocalizedString("_log_in_", comment: ""), for: .normal)
-
- buttonSignUp.layer.cornerRadius = 8
- buttonSignUp.setTitleColor(textColor, for: .normal)
- buttonSignUp.backgroundColor = textColor.withAlphaComponent(0.2)
- buttonSignUp.titleLabel?.adjustsFontSizeToFitWidth = true
- buttonSignUp.setTitle(NSLocalizedString("_sign_up_", comment: ""), for: .normal)
-
- buttonHost.layer.cornerRadius = 20
- buttonHost.setTitle(NSLocalizedString("_host_your_own_server_", comment: ""), for: .normal)
- buttonHost.setTitleColor(textColor.withAlphaComponent(0.5), for: .normal)
-
- introCollectionView.register(UINib(nibName: "NCIntroCollectionViewCell", bundle: nil), forCellWithReuseIdentifier: "introCell")
- introCollectionView.dataSource = self
- introCollectionView.delegate = self
- introCollectionView.backgroundColor = NCBrandColor.shared.customer
- pageControl.numberOfPages = self.titles.count
-
- view.backgroundColor = NCBrandColor.shared.customer
-
- self.timer = Timer.scheduledTimer(timeInterval: 4, target: self, selector: (#selector(self.autoScroll(_:))), userInfo: nil, repeats: true)
- }
-
- override var preferredStatusBarStyle: UIStatusBarStyle {
- if traitCollection.userInterfaceStyle == .light {
- return .lightContent
- } else {
- return .darkContent
- }
- }
-
- override func viewWillDisappear(_ animated: Bool) {
- super.viewWillDisappear(animated)
-
- timer?.invalidate()
- timer = nil
- }
-
- override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
- super.viewWillTransition(to: size, with: coordinator)
-
- coordinator.animate(alongsideTransition: nil) { _ in
- self.pageControl?.currentPage = 0
- self.introCollectionView?.collectionViewLayout.invalidateLayout()
- }
- }
-
- @objc func autoScroll(_ sender: Any?) {
- if pageControl.currentPage + 1 >= titles.count {
- pageControl.currentPage = 0
- } else {
- pageControl.currentPage += 1
- }
- introCollectionView.scrollToItem(at: IndexPath(row: pageControl.currentPage, section: 0), at: .centeredHorizontally, animated: true)
- }
-
- func collectionView(_ collectionView: UICollectionView, targetContentOffsetForProposedContentOffset proposedContentOffset: CGPoint) -> CGPoint {
- return CGPoint.zero
- }
-
- func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
- return titles.count
- }
-
- func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
- let cell = (collectionView.dequeueReusableCell(withReuseIdentifier: "introCell", for: indexPath) as? NCIntroCollectionViewCell)!
- cell.backgroundColor = NCBrandColor.shared.customer
- cell.indexPath = indexPath
- cell.titleLabel.textColor = textColor
- cell.titleLabel.text = titles[indexPath.row]
- cell.imageView.image = images[indexPath.row]
- return cell
- }
-
- func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
- return collectionView.bounds.size
- }
-
- func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
- timer = Timer.scheduledTimer(timeInterval: 4, target: self, selector: (#selector(autoScroll(_:))), userInfo: nil, repeats: true)
- pageControl.currentPage = Int(scrollView.contentOffset.x) / Int(scrollView.frame.width)
- }
-
- func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
- timer?.invalidate()
- timer = nil
- }
-
- // MARK: - Action
-
- @objc func actionCancel(_ sender: Any?) {
- dismiss(animated: true) { }
- }
-
- @IBAction func login(_ sender: Any) {
- if let viewController = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin {
- viewController.controller = self.controller
- self.navigationController?.pushViewController(viewController, animated: true)
- }
- }
-
- @IBAction func signupWithProvider(_ sender: Any) {
- let loginProvider = NCLoginProvider()
- loginProvider.controller = self.controller
- loginProvider.initialURLString = NCBrandOptions.shared.linkloginPreferredProviders
- loginProvider.presentingViewController = self
- loginProvider.startAuthentication()
- self.activeLoginProvider = loginProvider
- }
-
- @IBAction func host(_ sender: Any) {
- guard let url = URL(string: NCBrandOptions.shared.linkLoginHost) else { return }
- UIApplication.shared.open(url)
- }
-}
-
-extension UINavigationController {
- open override var childForStatusBarStyle: UIViewController? {
- return topViewController?.childForStatusBarStyle ?? topViewController
- }
-}
diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj
index 028cb85077..3cd942a24e 100644
--- a/Nextcloud.xcodeproj/project.pbxproj
+++ b/Nextcloud.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ 1FBDC9311538242613612B94 /* NCAccountSetupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B5E8728DE9ABBD5BDD3B447 /* NCAccountSetupModel.swift */; };
22BA14432CF44BDBA2E6C291 /* NCDocumentEditorSupportTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4B74B947E07444CC9CFE0A6C /* NCDocumentEditorSupportTests.swift */; };
2C1D5D7623E2DE3300334ABB /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; };
2C1D5D7923E2DE9100334ABB /* NCBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */; };
@@ -15,6 +16,7 @@
2EF7D3FD0885CE182717578E /* NKError+UserFriendlyMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79DFE0BDF3898A66910E67CA /* NKError+UserFriendlyMessage.swift */; };
370D26AF248A3D7A00121797 /* NCCellMain.swift in Sources */ = {isa = PBXBuildFile; fileRef = 370D26AE248A3D7A00121797 /* NCCellMain.swift */; };
63563FE53573412998852DD3 /* NCAlbumsPersistenceTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 439616AAA50F4360A761E5EF /* NCAlbumsPersistenceTests.swift */; };
+ 729609D38218F8A21700723C /* NCLoginAppConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCCD8BFC693B6BB556D97C47 /* NCLoginAppConfigTests.swift */; };
7670DABED44E4D56AD99E6DC /* NCPasscodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F902B24E44354B6D9F329F12 /* NCPasscodeView.swift */; };
822D68B06B101563A759AD59 /* NKError+UserFriendlyMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79DFE0BDF3898A66910E67CA /* NKError+UserFriendlyMessage.swift */; };
87768C6AB8E040219DF85898 /* NCPasscodeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 131F8E2F43AD414E9DB53019 /* NCPasscodeModel.swift */; };
@@ -149,26 +151,30 @@
AFCE353527E4ED5900FEA6C2 /* DateFormatter+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353427E4ED5900FEA6C2 /* DateFormatter+Extension.swift */; };
AFCE353727E4ED7B00FEA6C2 /* NCShareCells.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353627E4ED7B00FEA6C2 /* NCShareCells.swift */; };
AFCE353927E5DE0500FEA6C2 /* Shareable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AFCE353827E5DE0400FEA6C2 /* Shareable.swift */; };
+ B5E6D3241C08B33DD08B09FE /* NCLoginAppConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F79FDB4AA1ACCC1AD414CDD /* NCLoginAppConfig.swift */; };
B601AA012F10000100C0D3E5 /* NCLogFilesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B601AA002F10000100C0D3E5 /* NCLogFilesView.swift */; };
BAF64949B487A080A98F83F2 /* NKErrorUserFriendlyMessageTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 320C20803A58DAF7575440A8 /* NKErrorUserFriendlyMessageTests.swift */; };
+ BB6422A1935553376638E7BF /* NCAccountSetupModelTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E8E39D2FC977AA9ACE6A0F05 /* NCAccountSetupModelTests.swift */; };
BFA11D182026111900000002 /* NCFoldSeparator.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFA11D182026111900000001 /* NCFoldSeparator.swift */; };
C0DEA070306D000100000005 /* NCLocalDatabase+AutoUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DEA070306D000100000004 /* NCLocalDatabase+AutoUpload.swift */; };
C0DEA070306D000100000006 /* NCLocalDatabase+AutoUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DEA070306D000100000004 /* NCLocalDatabase+AutoUpload.swift */; };
C0DEA070306D000100000008 /* NCAutoUploadAssetTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DEA070306D000100000007 /* NCAutoUploadAssetTests.swift */; };
C0DECA022F65000100C0D001 /* NCCameraRollTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DECA012F65000100C0D001 /* NCCameraRollTests.swift */; };
C0DEDA7E30C1000100A00002 /* NCAutoUploadDateTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0DEDA7E30C1000100A00001 /* NCAutoUploadDateTests.swift */; };
+ C32F0D5074355BA3F35E7FCE /* NCAccountSetupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C4A84566BEF80733CC99BA52 /* NCAccountSetupView.swift */; };
+ C7724CB38D2A7B4B98CA1AFA /* NCLoginServerErrorClassifierTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE2A4CC67E2712B70FCFC090 /* NCLoginServerErrorClassifierTests.swift */; };
4463A0C1300D000100A00004 /* NCAutoUploadKnownFilesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4463A0C1300D000100A00003 /* NCAutoUploadKnownFilesTests.swift */; };
4437B0C1300D000100A00002 /* NCBackupExclusionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4437B0C1300D000100A00001 /* NCBackupExclusionTests.swift */; };
CB3666201AF7550816B5CD6A /* NCContextMenuComment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8932E90EC4278026D86CCCC9 /* NCContextMenuComment.swift */; };
D56DFFE5D5014F66A7C9FED0 /* PasscodeUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = BC6C501EF1104A6A8569D9C1 /* PasscodeUITests.swift */; };
D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */; };
+ DE4831E27DECD1D32A381E00 /* NCLoginServerErrorClassifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4E0AE8A484BEB1B166E78D2A /* NCLoginServerErrorClassifier.swift */; };
EB511D22564B7B9A605E70AE /* NCErrorContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE0CD9A00D74B01055F238E9 /* NCErrorContext.swift */; };
F0A1B2C430B5000100D4E5F6 /* NCMediaViewerFloatingTitleViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A1B2C330B5000100D4E5F6 /* NCMediaViewerFloatingTitleViewTests.swift */; };
F0A1B2C630B6000100D4E5F6 /* NCImageZoomViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F0A1B2C530B6000100D4E5F6 /* NCImageZoomViewTests.swift */; };
F31165022F9674A1009A1E37 /* AppIcon.icon in Resources */ = {isa = PBXBuildFile; fileRef = F31165012F9674A1009A1E37 /* AppIcon.icon */; };
F317C82E2E844C5300761AEA /* ClientIntegrationUIViewer.swift in Sources */ = {isa = PBXBuildFile; fileRef = F317C82D2E844C5300761AEA /* ClientIntegrationUIViewer.swift */; };
F321DA8A2B71205A00DDA0E6 /* NCTrashSelectTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F321DA892B71205A00DDA0E6 /* NCTrashSelectTabBar.swift */; };
- F32FADA92D1176E3007035E2 /* UIButton+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F32FADA82D1176DE007035E2 /* UIButton+Extension.swift */; };
F3374A812D64AB9F002A38F9 /* StatusInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3374A802D64AB9E002A38F9 /* StatusInfo.swift */; };
F3374A842D64AC31002A38F9 /* AssistantLabelStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3374A832D64AC2C002A38F9 /* AssistantLabelStyle.swift */; };
F3374A942D674454002A38F9 /* AssistantUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3374A932D674454002A38F9 /* AssistantUITests.swift */; };
@@ -198,7 +204,6 @@
F372087D2BAB4C0F006B5430 /* TestConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = F37208742BAB4AB0006B5430 /* TestConstants.swift */; };
F372087E2BAB4C0F006B5430 /* TestConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = F37208742BAB4AB0006B5430 /* TestConstants.swift */; };
F37208812BAB5979006B5430 /* TestConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = F37208742BAB4AB0006B5430 /* TestConstants.swift */; };
- F37208A42BAB63EE006B5430 /* QRCodeReader in Frameworks */ = {isa = PBXBuildFile; productRef = F37208A32BAB63EE006B5430 /* QRCodeReader */; };
F37208A62BAB63EE006B5430 /* SwiftRichString in Frameworks */ = {isa = PBXBuildFile; productRef = F37208A52BAB63EE006B5430 /* SwiftRichString */; };
F37208AA2BAB63EE006B5430 /* MarkdownKit in Frameworks */ = {isa = PBXBuildFile; productRef = F37208A92BAB63EE006B5430 /* MarkdownKit */; };
F37208B22BAB63EF006B5430 /* DropDown in Frameworks */ = {isa = PBXBuildFile; productRef = F37208B12BAB63EF006B5430 /* DropDown */; };
@@ -256,8 +261,6 @@
F702F2D025EE5B5C008F8E80 /* NCGlobal.swift in Sources */ = {isa = PBXBuildFile; fileRef = F702F2CE25EE5B5C008F8E80 /* NCGlobal.swift */; };
F702F2D125EE5B5C008F8E80 /* NCGlobal.swift in Sources */ = {isa = PBXBuildFile; fileRef = F702F2CE25EE5B5C008F8E80 /* NCGlobal.swift */; };
F702F2D225EE5B5C008F8E80 /* NCGlobal.swift in Sources */ = {isa = PBXBuildFile; fileRef = F702F2CE25EE5B5C008F8E80 /* NCGlobal.swift */; };
- F702F2F125EE5CDB008F8E80 /* NCLogin.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F702F2F025EE5CDA008F8E80 /* NCLogin.storyboard */; };
- F702F2F725EE5CED008F8E80 /* NCLogin.swift in Sources */ = {isa = PBXBuildFile; fileRef = F702F2F625EE5CEC008F8E80 /* NCLogin.swift */; };
F702F30125EE5D2C008F8E80 /* NYMnemonic.m in Sources */ = {isa = PBXBuildFile; fileRef = F702F2FD25EE5D2C008F8E80 /* NYMnemonic.m */; };
F702F30225EE5D2C008F8E80 /* english.txt in Resources */ = {isa = PBXBuildFile; fileRef = F702F2FF25EE5D2C008F8E80 /* english.txt */; };
F702F30825EE5D47008F8E80 /* NCPopupViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F702F30725EE5D47008F8E80 /* NCPopupViewController.swift */; };
@@ -363,7 +366,6 @@
F72AD71128C24BBB006CB92D /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F72AD71028C24BBB006CB92D /* NextcloudKit */; };
F72AD71328C24BCC006CB92D /* NextcloudKit in Frameworks */ = {isa = PBXBuildFile; productRef = F72AD71228C24BCC006CB92D /* NextcloudKit */; };
F72CA0572F5048C3002E2F06 /* UIApplication+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CA0562F5048C3002E2F06 /* UIApplication+Extension.swift */; };
- F72CA05C2F5051DB002E2F06 /* AlertActionBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CA05B2F5051DB002E2F06 /* AlertActionBannerView.swift */; };
F72CD63A25C19EBF00F46F9A /* NCAutoUpload.swift in Sources */ = {isa = PBXBuildFile; fileRef = F72CD63925C19EBF00F46F9A /* NCAutoUpload.swift */; };
4463A0C1300D000100A00002 /* NCAutoUploadKnownFiles.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4463A0C1300D000100A00001 /* NCAutoUploadKnownFiles.swift */; };
F72D1007210B6882009C96B7 /* NCPushNotificationEncryption.m in Sources */ = {isa = PBXBuildFile; fileRef = F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */; };
@@ -429,7 +431,6 @@
F74230F32C79B57200CA1ACA /* NCNetworking+Task.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74230F22C79B57200CA1ACA /* NCNetworking+Task.swift */; };
F7434B3820E2400600417916 /* NCBrand.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */; };
F743C89E2E5B25A1000173A9 /* UIScene+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F743C89D2E5B2595000173A9 /* UIScene+Extension.swift */; };
- F745B253222D88AE00346520 /* NCLoginQRCode.swift in Sources */ = {isa = PBXBuildFile; fileRef = F745B252222D88AE00346520 /* NCLoginQRCode.swift */; };
F746EC52273906C40052598D /* NCViewCertificateDetails.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7BC287D26663F6C004D46C5 /* NCViewCertificateDetails.storyboard */; };
F746EC53273906C50052598D /* NCViewCertificateDetails.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7BC287D26663F6C004D46C5 /* NCViewCertificateDetails.storyboard */; };
F747EB0D2C4AC1FF00F959A8 /* NCCollectionViewCommon+CollectionViewDelegateFlowLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = F747EB0C2C4AC1FF00F959A8 /* NCCollectionViewCommon+CollectionViewDelegateFlowLayout.swift */; };
@@ -589,10 +590,6 @@
F760DE0B2AE66ED80027D78A /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F760DE0A2AE66ED80027D78A /* KeychainAccess */; };
F760DE0D2AE66EDF0027D78A /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F760DE0C2AE66EDF0027D78A /* KeychainAccess */; };
F760DE0F2AE66EE60027D78A /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F760DE0E2AE66EE60027D78A /* KeychainAccess */; };
- F761856A29E98543006EB3B0 /* NCIntro.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F761856629E98543006EB3B0 /* NCIntro.storyboard */; };
- F761856B29E98543006EB3B0 /* NCIntroViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F761856729E98543006EB3B0 /* NCIntroViewController.swift */; };
- F761856C29E98543006EB3B0 /* NCIntroCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F761856829E98543006EB3B0 /* NCIntroCollectionViewCell.swift */; };
- F761856D29E98543006EB3B0 /* NCIntroCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F761856929E98543006EB3B0 /* NCIntroCollectionViewCell.xib */; };
F76340ED2EBDE74C0056F538 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76340EB2EBDE7420056F538 /* NCManageDatabase.swift */; };
F76340EE2EBDE74C0056F538 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76340EB2EBDE7420056F538 /* NCManageDatabase.swift */; };
F76340F42EBDE9760056F538 /* NCManageDatabaseCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76340F32EBDE9740056F538 /* NCManageDatabaseCore.swift */; };
@@ -878,7 +875,6 @@
F7A8D74428F1827B008BBE1C /* ThreadSafeDictionary.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7245923289BB50B00474787 /* ThreadSafeDictionary.swift */; };
F7AC1CB028AB94490032D99F /* Array+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AC1CAF28AB94490032D99F /* Array+Extension.swift */; };
F7AC934A296193050002BC0F /* Reasons to use Nextcloud.pdf in Resources */ = {isa = PBXBuildFile; fileRef = F7AC9349296193050002BC0F /* Reasons to use Nextcloud.pdf */; };
- F7AE00F5230D5F9E007ACF8A /* NCLoginProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AE00F4230D5F9E007ACF8A /* NCLoginProvider.swift */; };
F7AE00F8230E81CB007ACF8A /* NCBrowserWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7AE00F7230E81CB007ACF8A /* NCBrowserWeb.swift */; };
F7AE00FA230E81EB007ACF8A /* NCBrowserWeb.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7AE00F9230E81EB007ACF8A /* NCBrowserWeb.storyboard */; };
F7B398422A6A91D5007538D6 /* NCSectionFirstHeader.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7B398412A6A91D5007538D6 /* NCSectionFirstHeader.xib */; };
@@ -1044,7 +1040,6 @@
F7E98C1627E0D0FC001F9F19 /* NCManageDatabase+Video.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E98C1527E0D0FC001F9F19 /* NCManageDatabase+Video.swift */; };
F7E98C1727E0D0FC001F9F19 /* NCManageDatabase+Video.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E98C1527E0D0FC001F9F19 /* NCManageDatabase+Video.swift */; };
F7E98C1927E0D0FC001F9F19 /* NCManageDatabase+Video.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7E98C1527E0D0FC001F9F19 /* NCManageDatabase+Video.swift */; };
- F7ED547C25EEA65400956C55 /* QRCodeReader in Frameworks */ = {isa = PBXBuildFile; productRef = F7ED547B25EEA65400956C55 /* QRCodeReader */; };
F7EDE509262DA9D600414FE6 /* NCSelectCommandViewSelect.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7EDE508262DA9D600414FE6 /* NCSelectCommandViewSelect.xib */; };
F7EDE514262DC2CD00414FE6 /* NCSelectCommandViewSelect+CreateFolder.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7EDE513262DC2CD00414FE6 /* NCSelectCommandViewSelect+CreateFolder.xib */; };
F7EDE51B262DD0C400414FE6 /* NCSelectCommandViewCopyMove.xib in Resources */ = {isa = PBXBuildFile; fileRef = F7EDE51A262DD0C400414FE6 /* NCSelectCommandViewCopyMove.xib */; };
@@ -1066,9 +1061,7 @@
F7FA80012C0F4F3B0072FC60 /* NCUploadAssetsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FA7FFF2C0F4F3B0072FC60 /* NCUploadAssetsView.swift */; };
F7FAFD3A28BFA948000777FE /* NCContextMenuNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FAFD3928BFA947000777FE /* NCContextMenuNotification.swift */; };
F7FDFF692E437E55000D7688 /* NCAccountRequest.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7FDFF512E437E55000D7688 /* NCAccountRequest.storyboard */; };
- F7FDFF6A2E437E55000D7688 /* NCShareAccounts.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F7FDFF532E437E55000D7688 /* NCShareAccounts.storyboard */; };
F7FDFF6B2E437E55000D7688 /* NCAccountRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FDFF522E437E55000D7688 /* NCAccountRequest.swift */; };
- F7FDFF6C2E437E55000D7688 /* NCShareAccounts.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FDFF542E437E55000D7688 /* NCShareAccounts.swift */; };
F7FDFF6D2E437E55000D7688 /* NCAccountSettingsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FDFF562E437E55000D7688 /* NCAccountSettingsModel.swift */; };
F7FDFF6E2E437E55000D7688 /* NCAccountSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FDFF572E437E55000D7688 /* NCAccountSettingsView.swift */; };
F7FDFF6F2E437E55000D7688 /* NCAccount.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7FDFF592E437E55000D7688 /* NCAccount.swift */; };
@@ -1298,7 +1291,10 @@
320C20803A58DAF7575440A8 /* NKErrorUserFriendlyMessageTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NKErrorUserFriendlyMessageTests.swift; sourceTree = ""; };
370D26AE248A3D7A00121797 /* NCCellMain.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCellMain.swift; sourceTree = ""; };
439616AAA50F4360A761E5EF /* NCAlbumsPersistenceTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAlbumsPersistenceTests.swift; sourceTree = ""; };
+ 4B5E8728DE9ABBD5BDD3B447 /* NCAccountSetupModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAccountSetupModel.swift; sourceTree = ""; };
4B74B947E07444CC9CFE0A6C /* NCDocumentEditorSupportTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCDocumentEditorSupportTests.swift; sourceTree = ""; };
+ 4E0AE8A484BEB1B166E78D2A /* NCLoginServerErrorClassifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLoginServerErrorClassifier.swift; sourceTree = ""; };
+ 5F79FDB4AA1ACCC1AD414CDD /* NCLoginAppConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLoginAppConfig.swift; sourceTree = ""; };
79DFE0BDF3898A66910E67CA /* NKError+UserFriendlyMessage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NKError+UserFriendlyMessage.swift"; sourceTree = ""; };
8932E90EC4278026D86CCCC9 /* NCContextMenuComment.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCContextMenuComment.swift; sourceTree = ""; };
A0C0DE0130E0000100C0D001 /* NCPasscodeWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCPasscodeWindow.swift; sourceTree = ""; };
@@ -1465,16 +1461,19 @@
C0DEA070306D000100000007 /* NCAutoUploadAssetTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUploadAssetTests.swift; sourceTree = ""; };
C0DECA012F65000100C0D001 /* NCCameraRollTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCameraRollTests.swift; sourceTree = ""; };
C0DEDA7E30C1000100A00001 /* NCAutoUploadDateTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUploadDateTests.swift; sourceTree = ""; };
+ C4A84566BEF80733CC99BA52 /* NCAccountSetupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAccountSetupView.swift; sourceTree = ""; };
4463A0C1300D000100A00003 /* NCAutoUploadKnownFilesTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUploadKnownFilesTests.swift; sourceTree = ""; };
4437B0C1300D000100A00001 /* NCBackupExclusionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCBackupExclusionTests.swift; sourceTree = ""; };
CE0CD9A00D74B01055F238E9 /* NCErrorContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCErrorContext.swift; sourceTree = ""; };
+ CE2A4CC67E2712B70FCFC090 /* NCLoginServerErrorClassifierTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLoginServerErrorClassifierTests.swift; sourceTree = ""; };
D5B6AA7727200C7200D49C24 /* NCActivityTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCActivityTableViewCell.swift; sourceTree = ""; };
+ DCCD8BFC693B6BB556D97C47 /* NCLoginAppConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLoginAppConfigTests.swift; sourceTree = ""; };
+ E8E39D2FC977AA9ACE6A0F05 /* NCAccountSetupModelTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAccountSetupModelTests.swift; sourceTree = ""; };
F0A1B2C330B5000100D4E5F6 /* NCMediaViewerFloatingTitleViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCMediaViewerFloatingTitleViewTests.swift; sourceTree = ""; };
F0A1B2C530B6000100D4E5F6 /* NCImageZoomViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCImageZoomViewTests.swift; sourceTree = ""; };
F31165012F9674A1009A1E37 /* AppIcon.icon */ = {isa = PBXFileReference; lastKnownFileType = folder.iconcomposer.icon; path = AppIcon.icon; sourceTree = ""; };
F317C82D2E844C5300761AEA /* ClientIntegrationUIViewer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClientIntegrationUIViewer.swift; sourceTree = ""; };
F321DA892B71205A00DDA0E6 /* NCTrashSelectTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTrashSelectTabBar.swift; sourceTree = ""; };
- F32FADA82D1176DE007035E2 /* UIButton+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIButton+Extension.swift"; sourceTree = ""; };
F3374A802D64AB9E002A38F9 /* StatusInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusInfo.swift; sourceTree = ""; };
F3374A832D64AC2C002A38F9 /* AssistantLabelStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssistantLabelStyle.swift; sourceTree = ""; };
F3374A932D674454002A38F9 /* AssistantUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AssistantUITests.swift; sourceTree = ""; };
@@ -1520,8 +1519,6 @@
F700510422DF6A89003A3356 /* NCShare.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShare.swift; sourceTree = ""; };
F702F2CC25EE5B4F008F8E80 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
F702F2CE25EE5B5C008F8E80 /* NCGlobal.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCGlobal.swift; sourceTree = ""; };
- F702F2F025EE5CDA008F8E80 /* NCLogin.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCLogin.storyboard; sourceTree = ""; };
- F702F2F625EE5CEC008F8E80 /* NCLogin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCLogin.swift; sourceTree = ""; };
F702F2FD25EE5D2C008F8E80 /* NYMnemonic.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NYMnemonic.m; sourceTree = ""; };
F702F2FF25EE5D2C008F8E80 /* english.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = english.txt; sourceTree = ""; };
F702F30025EE5D2C008F8E80 /* NYMnemonic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NYMnemonic.h; sourceTree = ""; };
@@ -1585,7 +1582,6 @@
F72944F42A8424F800246839 /* NCEndToEndMetadataV1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCEndToEndMetadataV1.swift; sourceTree = ""; };
F72A17D728B221E300F3F159 /* DashboardWidgetView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DashboardWidgetView.swift; sourceTree = ""; };
F72CA0562F5048C3002E2F06 /* UIApplication+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIApplication+Extension.swift"; sourceTree = ""; };
- F72CA05B2F5051DB002E2F06 /* AlertActionBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlertActionBannerView.swift; sourceTree = ""; };
F72CD63925C19EBF00F46F9A /* NCAutoUpload.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUpload.swift; sourceTree = ""; };
4463A0C1300D000100A00001 /* NCAutoUploadKnownFiles.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAutoUploadKnownFiles.swift; sourceTree = ""; };
F72D1005210B6882009C96B7 /* NCPushNotificationEncryption.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCPushNotificationEncryption.m; sourceTree = ""; };
@@ -1626,7 +1622,6 @@
F741C2232B6B9FD600E849BB /* NCMediaSelectTabBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCMediaSelectTabBar.swift; sourceTree = ""; };
F74230F22C79B57200CA1ACA /* NCNetworking+Task.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCNetworking+Task.swift"; sourceTree = ""; };
F743C89D2E5B2595000173A9 /* UIScene+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIScene+Extension.swift"; sourceTree = ""; };
- F745B252222D88AE00346520 /* NCLoginQRCode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLoginQRCode.swift; sourceTree = ""; };
F747EB0C2C4AC1FF00F959A8 /* NCCollectionViewCommon+CollectionViewDelegateFlowLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCCollectionViewCommon+CollectionViewDelegateFlowLayout.swift"; sourceTree = ""; };
F749B649297B0CBB00087535 /* NCManageDatabase+Share.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+Share.swift"; sourceTree = ""; };
F749B650297B0F2400087535 /* NCManageDatabase+Avatar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+Avatar.swift"; sourceTree = ""; };
@@ -1739,10 +1734,6 @@
F75E197430484B77008ACFDC /* BackgroundUploadExtension+LivePhoto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "BackgroundUploadExtension+LivePhoto.swift"; sourceTree = ""; };
F760A4852FE959EB001B212E /* NCTransferCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTransferCoordinator.swift; sourceTree = ""; };
F760A4892FE95D04001B212E /* NCTransferDelegateDispatcher.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCTransferDelegateDispatcher.swift; sourceTree = ""; };
- F761856629E98543006EB3B0 /* NCIntro.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCIntro.storyboard; sourceTree = ""; };
- F761856729E98543006EB3B0 /* NCIntroViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCIntroViewController.swift; sourceTree = ""; };
- F761856829E98543006EB3B0 /* NCIntroCollectionViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCIntroCollectionViewCell.swift; sourceTree = ""; };
- F761856929E98543006EB3B0 /* NCIntroCollectionViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = NCIntroCollectionViewCell.xib; sourceTree = ""; };
F76340EB2EBDE7420056F538 /* NCManageDatabase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCManageDatabase.swift; sourceTree = ""; };
F76340F32EBDE9740056F538 /* NCManageDatabaseCore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCManageDatabaseCore.swift; sourceTree = ""; };
F76340FB2EBDF64A0056F538 /* NCManageDatabase+Tag.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCManageDatabase+Tag.swift"; sourceTree = ""; };
@@ -1950,7 +1941,6 @@
F7AA41E127C7CF8100494705 /* es-MX */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-MX"; path = "es-MX.lproj/InfoPlist.strings"; sourceTree = ""; };
F7AC1CAF28AB94490032D99F /* Array+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Array+Extension.swift"; sourceTree = ""; };
F7AC9349296193050002BC0F /* Reasons to use Nextcloud.pdf */ = {isa = PBXFileReference; lastKnownFileType = image.pdf; path = "Reasons to use Nextcloud.pdf"; sourceTree = SOURCE_ROOT; };
- F7AE00F4230D5F9E007ACF8A /* NCLoginProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCLoginProvider.swift; sourceTree = ""; };
F7AE00F7230E81CB007ACF8A /* NCBrowserWeb.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCBrowserWeb.swift; sourceTree = ""; };
F7AE00F9230E81EB007ACF8A /* NCBrowserWeb.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCBrowserWeb.storyboard; sourceTree = ""; };
F7B1A7761EBB3C8000BFB6D1 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = ""; };
@@ -2099,8 +2089,6 @@
F7FB188030401D0D00EB0AE6 /* BackgroundUploadExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.extensionkit-extension"; includeInIndex = 0; path = BackgroundUploadExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
F7FDFF512E437E55000D7688 /* NCAccountRequest.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCAccountRequest.storyboard; sourceTree = ""; };
F7FDFF522E437E55000D7688 /* NCAccountRequest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAccountRequest.swift; sourceTree = ""; };
- F7FDFF532E437E55000D7688 /* NCShareAccounts.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = NCShareAccounts.storyboard; sourceTree = ""; };
- F7FDFF542E437E55000D7688 /* NCShareAccounts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCShareAccounts.swift; sourceTree = ""; };
F7FDFF562E437E55000D7688 /* NCAccountSettingsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAccountSettingsModel.swift; sourceTree = ""; };
F7FDFF572E437E55000D7688 /* NCAccountSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAccountSettingsView.swift; sourceTree = ""; };
F7FDFF592E437E55000D7688 /* NCAccount.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCAccount.swift; sourceTree = ""; };
@@ -2146,7 +2134,6 @@
F37208BA2BAB63EF006B5430 /* TLPhotoPicker in Frameworks */,
F37208AA2BAB63EE006B5430 /* MarkdownKit in Frameworks */,
F37208C02BAB63F0006B5430 /* Mantis in Frameworks */,
- F37208A42BAB63EE006B5430 /* QRCodeReader in Frameworks */,
F37208B22BAB63EF006B5430 /* DropDown in Frameworks */,
F37208BC2BAB63EF006B5430 /* OpenSSL in Frameworks */,
F37208B82BAB63EF006B5430 /* NextcloudKit in Frameworks */,
@@ -2214,7 +2201,6 @@
files = (
F7D4BF542CA2ED9D00A5E746 /* VLCKitSPM in Frameworks */,
F7D56B1A2972405500FA46C4 /* Mantis in Frameworks */,
- F7ED547C25EEA65400956C55 /* QRCodeReader in Frameworks */,
F788ECC7263AAAFA00ADC67F /* MarkdownKit in Frameworks */,
F3374AF02D78B01B002A38F9 /* BitCollections in Frameworks */,
F77BC3EB293E5268005F2B08 /* Swifter in Frameworks */,
@@ -2324,6 +2310,9 @@
AA52EB442D42AC500089C348 /* NextcloudUnitTests */ = {
isa = PBXGroup;
children = (
+ E8E39D2FC977AA9ACE6A0F05 /* NCAccountSetupModelTests.swift */,
+ DCCD8BFC693B6BB556D97C47 /* NCLoginAppConfigTests.swift */,
+ CE2A4CC67E2712B70FCFC090 /* NCLoginServerErrorClassifierTests.swift */,
AC13ADAF2026101300000001 /* NCMediaAdaptiveLayoutViewTests.swift */,
C0DEDA7E30C1000100A00001 /* NCAutoUploadDateTests.swift */,
4463A0C1300D000100A00003 /* NCAutoUploadKnownFilesTests.swift */,
@@ -2598,7 +2587,6 @@
F70557BC2ED44F1800135623 /* Lucid Banner */ = {
isa = PBXGroup;
children = (
- F72CA05B2F5051DB002E2F06 /* AlertActionBannerView.swift */,
F74B91E42F51D4100050813D /* InfoBannerView.swift */,
F7DF7B3E2F1A2EE400514020 /* WarningBannerView.swift */,
F74B91E72F51D4510050813D /* ErrorBannerView.swift */,
@@ -3148,17 +3136,6 @@
path = Actors;
sourceTree = "";
};
- F761856529E98543006EB3B0 /* Intro */ = {
- isa = PBXGroup;
- children = (
- F761856629E98543006EB3B0 /* NCIntro.storyboard */,
- F761856729E98543006EB3B0 /* NCIntroViewController.swift */,
- F761856829E98543006EB3B0 /* NCIntroCollectionViewCell.swift */,
- F761856929E98543006EB3B0 /* NCIntroCollectionViewCell.xib */,
- );
- path = Intro;
- sourceTree = "";
- };
F765F72E25237E3F00391DBE /* Recent */ = {
isa = PBXGroup;
children = (
@@ -3458,7 +3435,6 @@
AF1A9B6327D0CA1E00F17A9E /* UIAlertController+Extension.swift */,
F72CA0562F5048C3002E2F06 /* UIApplication+Extension.swift */,
AF7E504D27A2D8FF00B5E4AF /* UIBarButton+Extension.swift */,
- F32FADA82D1176DE007035E2 /* UIButton+Extension.swift */,
F70CEF5523E9C7E50007035B /* UIColor+Extension.swift */,
F79B645F26CA661600838ACA /* UIControl+Extension.swift */,
F7CB77632F5843D700DE649A /* UIFont+Extension.swift */,
@@ -3587,10 +3563,10 @@
F7BFFA621A24D7300044ED85 /* Login */ = {
isa = PBXGroup;
children = (
- F702F2F025EE5CDA008F8E80 /* NCLogin.storyboard */,
- F702F2F625EE5CEC008F8E80 /* NCLogin.swift */,
- F745B252222D88AE00346520 /* NCLoginQRCode.swift */,
- F7AE00F4230D5F9E007ACF8A /* NCLoginProvider.swift */,
+ 4B5E8728DE9ABBD5BDD3B447 /* NCAccountSetupModel.swift */,
+ C4A84566BEF80733CC99BA52 /* NCAccountSetupView.swift */,
+ 5F79FDB4AA1ACCC1AD414CDD /* NCLoginAppConfig.swift */,
+ 4E0AE8A484BEB1B166E78D2A /* NCLoginServerErrorClassifier.swift */,
F7BC287D26663F6C004D46C5 /* NCViewCertificateDetails.storyboard */,
F7BC287F26663F85004D46C5 /* NCViewCertificateDetails.swift */,
);
@@ -3645,7 +3621,6 @@
F7C1CDD91E6DFC6F005D92BE /* Brand */ = {
isa = PBXGroup;
children = (
- F761856529E98543006EB3B0 /* Intro */,
F700222B1EC479840080073F /* Custom.xcassets */,
F7362A1E220C853A005101B5 /* LaunchScreen.storyboard */,
F78E2D6429AF02DB0024D4F3 /* Database.swift */,
@@ -3910,8 +3885,6 @@
children = (
F7FDFF512E437E55000D7688 /* NCAccountRequest.storyboard */,
F7FDFF522E437E55000D7688 /* NCAccountRequest.swift */,
- F7FDFF532E437E55000D7688 /* NCShareAccounts.storyboard */,
- F7FDFF542E437E55000D7688 /* NCShareAccounts.swift */,
);
path = "Account Request";
sourceTree = "";
@@ -4003,7 +3976,6 @@
packageProductDependencies = (
F3391B152B4C52F6001C0C4B /* FirebaseDatabase */,
F3F0419E2B9F7E7900D5155F /* RealmSwift */,
- F37208A32BAB63EE006B5430 /* QRCodeReader */,
F37208A52BAB63EE006B5430 /* SwiftRichString */,
F37208A92BAB63EE006B5430 /* MarkdownKit */,
F37208B12BAB63EF006B5430 /* DropDown */,
@@ -4167,7 +4139,6 @@
);
name = Nextcloud;
packageProductDependencies = (
- F7ED547B25EEA65400956C55 /* QRCodeReader */,
F72DA9B325F53E4E00B87DB1 /* SwiftRichString */,
F788ECC6263AAAFA00ADC67F /* MarkdownKit */,
F70B86742642CE3B00ED5349 /* FirebaseCrashlytics */,
@@ -4395,7 +4366,6 @@
);
mainGroup = F7F67B9F1A24D27800EE80DA;
packageReferences = (
- F7ED547A25EEA65400956C55 /* XCRemoteSwiftPackageReference "QRCodeReader" */,
F72DA9B225F53E4E00B87DB1 /* XCRemoteSwiftPackageReference "SwiftRichString" */,
F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */,
F70B86732642CE3B00ED5349 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */,
@@ -4518,13 +4488,11 @@
F7362A1F220C853A005101B5 /* LaunchScreen.storyboard in Resources */,
F77444F622281649000D5EB0 /* NCMediaCell.xib in Resources */,
F78ACD4421903CF20088454D /* NCListCell.xib in Resources */,
- F761856D29E98543006EB3B0 /* NCIntroCollectionViewCell.xib in Resources */,
F78ACD4621903D010088454D /* NCGridCell.xib in Resources */,
F72685E727C78E490019EF5E /* InfoPlist.strings in Resources */,
F769453C22E9CFFF000A798A /* NCShareUserCell.xib in Resources */,
F76D3CF52428D0C1005DFA87 /* NCViewerPDF.storyboard in Resources */,
F700222C1EC479840080073F /* Custom.xcassets in Resources */,
- F702F2F125EE5CDB008F8E80 /* NCLogin.storyboard in Resources */,
F723985C253C95CE00257F49 /* NCViewerRichdocuments.storyboard in Resources */,
F758B45A212C564000515F55 /* NCScan.storyboard in Resources */,
F765F73225237E3F00391DBE /* NCRecent.storyboard in Resources */,
@@ -4556,7 +4524,6 @@
F700510122DF63AC003A3356 /* NCShare.storyboard in Resources */,
F787704F22E7019900F287A9 /* NCShareLinkCell.xib in Resources */,
F7AC934A296193050002BC0F /* Reasons to use Nextcloud.pdf in Resources */,
- F761856A29E98543006EB3B0 /* NCIntro.storyboard in Resources */,
F719D9E0288D37A300762E33 /* NCColorPicker.storyboard in Resources */,
AA517B802D660EFE00F8D37C /* Localizable.stringsdict in Resources */,
F704B5E72430C06700632F5F /* NCCreateFormUploadConflictCell.xib in Resources */,
@@ -4573,7 +4540,6 @@
F7D1612023CF19E30039EBBF /* NCViewerRichWorkspace.storyboard in Resources */,
F77B0F631D118A16002130FE /* Localizable.strings in Resources */,
F7FDFF692E437E55000D7688 /* NCAccountRequest.storyboard in Resources */,
- F7FDFF6A2E437E55000D7688 /* NCShareAccounts.storyboard in Resources */,
F774264A22EB4D0000B23912 /* NCSearchUserDropDownCell.xib in Resources */,
F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */,
F73CB3B222E072A000AD728E /* NCShareHeaderView.xib in Resources */,
@@ -4722,6 +4688,9 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ BB6422A1935553376638E7BF /* NCAccountSetupModelTests.swift in Sources */,
+ 729609D38218F8A21700723C /* NCLoginAppConfigTests.swift in Sources */,
+ C7724CB38D2A7B4B98CA1AFA /* NCLoginServerErrorClassifierTests.swift in Sources */,
AB1028260000000000090120 /* NCShareRecentFoldersStore.swift in Sources */,
AB1028260000000000090121 /* NCShareRecentFoldersStoreTests.swift in Sources */,
BAF64949B487A080A98F83F2 /* NKErrorUserFriendlyMessageTests.swift in Sources */,
@@ -5050,6 +5019,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
+ 1FBDC9311538242613612B94 /* NCAccountSetupModel.swift in Sources */,
+ C32F0D5074355BA3F35E7FCE /* NCAccountSetupView.swift in Sources */,
+ B5E6D3241C08B33DD08B09FE /* NCLoginAppConfig.swift in Sources */,
+ DE4831E27DECD1D32A381E00 /* NCLoginServerErrorClassifier.swift in Sources */,
AB1028260000000000090110 /* NCShareRecentFoldersStore.swift in Sources */,
AB1028260000000000080000 /* NCShareViewModel+Accounts.swift in Sources */,
AB1028260000000000080001 /* NCShareViewModel+Folders.swift in Sources */,
@@ -5085,7 +5058,6 @@
F76340FC2EBDF64D0056F538 /* NCManageDatabase+Tag.swift in Sources */,
F733598125C1C188002ABA72 /* NCAskAuthorization.swift in Sources */,
370D26AF248A3D7A00121797 /* NCCellMain.swift in Sources */,
- F32FADA92D1176E3007035E2 /* UIButton+Extension.swift in Sources */,
F7DF7B3F2F1A2EF900514020 /* WarningBannerView.swift in Sources */,
F768822C2C0DD1E7001CF441 /* NCPreferences.swift in Sources */,
A1E2EE010000000000000007 /* NCEndToEndKeySet.swift in Sources */,
@@ -5100,7 +5072,6 @@
F7D890752BD25C570050B8A6 /* NCCollectionViewCommon+DragDrop.swift in Sources */,
F7BD0A042C4689E9003A4A6D /* NCMedia+MediaLayout.swift in Sources */,
F718E25A2DF2D5D1004038AF /* NCBackgroundLocationUploadManager.swift in Sources */,
- F761856B29E98543006EB3B0 /* NCIntroViewController.swift in Sources */,
F7743A142C33F13A0034F670 /* NCCollectionViewCommon+CollectionViewDataSource.swift in Sources */,
F321DA8A2B71205A00DDA0E6 /* NCTrashSelectTabBar.swift in Sources */,
F702F2CD25EE5B4F008F8E80 /* AppDelegate.swift in Sources */,
@@ -5273,11 +5244,9 @@
F73EF7BF2B02250B0087E6E9 /* NCManageDatabase+GPS.swift in Sources */,
F39A1EE22D0AF8A400DAD522 /* Albums.swift in Sources */,
F71F6D072B6A6A5E00F1EB15 /* ThreadSafeArray.swift in Sources */,
- F761856C29E98543006EB3B0 /* NCIntroCollectionViewCell.swift in Sources */,
F75DD765290ABB25002EB562 /* Intent.intentdefinition in Sources */,
F7D4BF012CA1831900A5E746 /* NCCollectionViewCommonPinchGesture.swift in Sources */,
F74B6D952A7E239A00F03C5F /* NCManageDatabase+Chunk.swift in Sources */,
- F702F2F725EE5CED008F8E80 /* NCLogin.swift in Sources */,
F75D90212D2BE26F003E740B /* NCRecommendationsCell.swift in Sources */,
F7E98C1627E0D0FC001F9F19 /* NCManageDatabase+Video.swift in Sources */,
F76882222C0DD1E7001CF441 /* NCCapabilitiesView.swift in Sources */,
@@ -5412,7 +5381,6 @@
F74C0436253F1CDC009762AB /* NCShares.swift in Sources */,
F79699E72E689F68000EC82A /* NCMediaNavigationController.swift in Sources */,
F7AC1CB028AB94490032D99F /* Array+Extension.swift in Sources */,
- F7AE00F5230D5F9E007ACF8A /* NCLoginProvider.swift in Sources */,
F707C26521A2DC5200F6181E /* NCStoreReview.swift in Sources */,
F7814E972F3B5F170074DA3A /* NCSVGRenderer.swift in Sources */,
F7CF06802E0FF3990063AD04 /* NCAppStateManager.swift in Sources */,
@@ -5427,14 +5395,11 @@
F7CADEFD2EA159210057849E /* NCMetadataUploadTranfersSuccess.swift in Sources */,
F343A4B32A1E01FF00DDA874 /* PHAsset+Extension.swift in Sources */,
F7C30DFA291BCF790017149B /* NCNetworkingE2EECreateFolder.swift in Sources */,
- F72CA05C2F5051DB002E2F06 /* AlertActionBannerView.swift in Sources */,
F76995F42F9A4AC400291FA7 /* NCCollectionViewCommon+UIEditMenuInteractionDelegate.swift in Sources */,
F722133B2D40EF9D002F7438 /* NCFilesNavigationController.swift in Sources */,
F7BC288026663F85004D46C5 /* NCViewCertificateDetails.swift in Sources */,
D5B6AA7827200C7200D49C24 /* NCActivityTableViewCell.swift in Sources */,
- F745B253222D88AE00346520 /* NCLoginQRCode.swift in Sources */,
F7FDFF6B2E437E55000D7688 /* NCAccountRequest.swift in Sources */,
- F7FDFF6C2E437E55000D7688 /* NCShareAccounts.swift in Sources */,
F7FDFF6D2E437E55000D7688 /* NCAccountSettingsModel.swift in Sources */,
F7FDFF6E2E437E55000D7688 /* NCAccountSettingsView.swift in Sources */,
F7FDFF6F2E437E55000D7688 /* NCAccount.swift in Sources */,
@@ -7119,8 +7084,8 @@
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/nextcloud/NextcloudKit";
requirement = {
- branch = main;
- kind = branch;
+ kind = exactVersion;
+ version = 7.7.0;
};
};
F788ECC5263AAAF900ADC67F /* XCRemoteSwiftPackageReference "MarkdownKit" */ = {
@@ -7155,14 +7120,6 @@
version = 1.0.0;
};
};
- F7ED547A25EEA65400956C55 /* XCRemoteSwiftPackageReference "QRCodeReader" */ = {
- isa = XCRemoteSwiftPackageReference;
- repositoryURL = "https://github.com/yannickl/QRCodeReader.swift";
- requirement = {
- kind = upToNextMajorVersion;
- minimumVersion = 10.1.1;
- };
- };
F7F623B32A5EF4D30022D3D4 /* XCRemoteSwiftPackageReference "GzipSwift" */ = {
isa = XCRemoteSwiftPackageReference;
repositoryURL = "https://github.com/1024jp/GzipSwift";
@@ -7209,11 +7166,6 @@
package = F70B86732642CE3B00ED5349 /* XCRemoteSwiftPackageReference "firebase-ios-sdk" */;
productName = FirebaseDatabase;
};
- F37208A32BAB63EE006B5430 /* QRCodeReader */ = {
- isa = XCSwiftPackageProductDependency;
- package = F7ED547A25EEA65400956C55 /* XCRemoteSwiftPackageReference "QRCodeReader" */;
- productName = QRCodeReader;
- };
F37208A52BAB63EE006B5430 /* SwiftRichString */ = {
isa = XCSwiftPackageProductDependency;
package = F72DA9B225F53E4E00B87DB1 /* XCRemoteSwiftPackageReference "SwiftRichString" */;
@@ -7519,11 +7471,6 @@
package = F7D56B182972405400FA46C4 /* XCRemoteSwiftPackageReference "Mantis" */;
productName = Mantis;
};
- F7ED547B25EEA65400956C55 /* QRCodeReader */ = {
- isa = XCSwiftPackageProductDependency;
- package = F7ED547A25EEA65400956C55 /* XCRemoteSwiftPackageReference "QRCodeReader" */;
- productName = QRCodeReader;
- };
F7F623B42A5EF4D30022D3D4 /* Gzip */ = {
isa = XCSwiftPackageProductDependency;
package = F7F623B32A5EF4D30022D3D4 /* XCRemoteSwiftPackageReference "GzipSwift" */;
diff --git a/Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
index c8eb6704f0..d68df51ca5 100644
--- a/Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
+++ b/Nextcloud.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved
@@ -1,5 +1,5 @@
{
- "originHash" : "5236b0018852b3d5fa374f118d9825d5acd8f4ce80430d339706d09182995ba2",
+ "originHash" : "19cee9bce0527e84fb4b83b6cc3fd1f2677d81935be8a72347c0a85660fdc201",
"pins" : [
{
"identity" : "abseil-cpp-binary",
@@ -204,8 +204,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/nextcloud/NextcloudKit",
"state" : {
- "branch" : "main",
- "revision" : "5302228493cc4e62dfce9457beab58737b558495"
+ "revision" : "5898f5d7ea4148c3679959826cf23ed07d430fb1",
+ "version" : "7.7.0"
}
},
{
@@ -235,15 +235,6 @@
"version" : "2.4.1"
}
},
- {
- "identity" : "qrcodereader.swift",
- "kind" : "remoteSourceControl",
- "location" : "https://github.com/yannickl/QRCodeReader.swift",
- "state" : {
- "revision" : "5020b5a47199d8ba80c83a4b4fafd70e9dc9dc7f",
- "version" : "10.1.1"
- }
- },
{
"identity" : "realm-core",
"kind" : "remoteSourceControl",
diff --git a/Tests/NextcloudUITests/BaseUIXCTestCase.swift b/Tests/NextcloudUITests/BaseUIXCTestCase.swift
index d718cb5d71..96f9c26ce0 100644
--- a/Tests/NextcloudUITests/BaseUIXCTestCase.swift
+++ b/Tests/NextcloudUITests/BaseUIXCTestCase.swift
@@ -61,24 +61,26 @@ class BaseUIXCTestCase: XCTestCase {
/// Sign in through the browser by default, or let the app provision a test account on the login screen.
func logIn(usingAppConfig: Bool = false) async throws {
- let login = app.buttons["login"]
+ let continueOnboarding = app.buttons["continueOnboarding"]
+ let serverAddress = app.textFields["serverAddress"].firstMatch
let deadline = Date().addingTimeInterval(30)
// Startup can restore the main interface after the first accessibility snapshot.
- // Wait for either destination instead of assuming that the login screen will appear.
+ // Wait for any destination; the onboarding only shows until it was continued once.
repeat {
if app.buttons["openSidebar"].exists || app.buttons["accountSwitcher"].exists {
return
}
- if login.exists && login.isHittable {
+ if (continueOnboarding.exists && continueOnboarding.isHittable) || serverAddress.exists {
break
}
try await Task.sleep(for: .milliseconds(250))
} while Date() < deadline
- guard login.exists else {
+ if continueOnboarding.exists {
+ continueOnboarding.tap()
+ } else if !serverAddress.exists {
attachAuthenticationDiagnostics()
- throw UITestError.waitForExistence(login)
+ throw UITestError.waitForExistence(serverAddress)
}
- login.tap()
if !usingAppConfig {
try await authenticateInBrowser()
}
diff --git a/Tests/NextcloudUITests/PasscodeUITests.swift b/Tests/NextcloudUITests/PasscodeUITests.swift
index f752c9a4af..6f31260c7f 100644
--- a/Tests/NextcloudUITests/PasscodeUITests.swift
+++ b/Tests/NextcloudUITests/PasscodeUITests.swift
@@ -289,7 +289,8 @@ final class PasscodeUITests: BaseUIXCTestCase {
// Relaunch without setup flags so they cannot hide an incomplete reset.
app.launchArguments = languageArguments
app.launch()
- XCTAssertTrue(app.buttons["login"].waitForExistence(timeout: TestConstants.controlExistenceTimeout))
+ XCTAssertTrue(app.textFields["serverAddress"].firstMatch.waitForExistence(timeout: TestConstants.controlExistenceTimeout)
+ || app.buttons["continueOnboarding"].exists)
XCTAssertFalse(title.exists, "The app reset must remove the stored passcode.")
}
diff --git a/Tests/NextcloudUnitTests/NCAccountSetupModelTests.swift b/Tests/NextcloudUnitTests/NCAccountSetupModelTests.swift
new file mode 100644
index 0000000000..b5a9f5a2f9
--- /dev/null
+++ b/Tests/NextcloudUnitTests/NCAccountSetupModelTests.swift
@@ -0,0 +1,84 @@
+// SPDX-FileCopyrightText: Nextcloud GmbH
+// SPDX-FileCopyrightText: 2026 Milen Pivchev
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import Foundation
+import NextcloudKit
+import NextcloudKitUI
+import Testing
+@testable import Nextcloud
+
+@MainActor
+@Suite("Account setup prompts")
+struct NCAccountSetupModelTests {
+ private let serverURL = URL(string: "https://cloud.example.com/")!
+ private let untrustedCertificate = NKError(errorCode: NSURLErrorServerCertificateUntrusted)
+
+ private func waitUntil(_ condition: @MainActor () -> Bool) async throws {
+ let deadline = ContinuousClock.now + .seconds(5)
+
+ while condition() == false {
+ guard ContinuousClock.now < deadline else {
+ Issue.record("Timed out waiting for the condition.")
+ return
+ }
+
+ try await Task.sleep(for: .milliseconds(20))
+ }
+ }
+
+ @Test("Declining the certificate prompt cancels the login")
+ func decliningCancels() async throws {
+ let model = NCAccountSetupModel(controller: nil)
+ let recovery = Task { await model.recover(from: untrustedCertificate, serverURL: serverURL) }
+
+ try await waitUntil { model.isPresentingCertificatePrompt }
+
+ #expect(model.certificateHost == "cloud.example.com")
+
+ model.answer(false)
+
+ guard case .cancel = await recovery.value else {
+ Issue.record("The login must be cancelled.")
+ return
+ }
+
+ #expect(model.isPresentingCertificatePrompt == false)
+ }
+
+ @Test("Closing the certificate details asks again")
+ func certificateDetailsAskAgain() async throws {
+ let model = NCAccountSetupModel(controller: nil)
+ let recovery = Task { await model.recover(from: untrustedCertificate, serverURL: serverURL) }
+
+ try await waitUntil { model.isPresentingCertificatePrompt }
+
+ // The alert closes itself when one of its buttons is tapped.
+ model.isPresentingCertificatePrompt = false
+ model.presentCertificateDetails()
+ model.certificateDetailsDidClose()
+
+ #expect(model.isPresentingCertificateDetails == false)
+ #expect(model.isPresentingCertificatePrompt)
+
+ model.answer(false)
+ _ = await recovery.value
+
+ model.certificateDetailsDidClose()
+
+ #expect(model.isPresentingCertificatePrompt == false)
+ }
+
+ @Test("Errors https can't avoid are shown")
+ func otherErrorsAreShown() async {
+ let model = NCAccountSetupModel(controller: nil)
+
+ guard case .presentError = await model.recover(from: NKError(errorCode: NSURLErrorNotConnectedToInternet), serverURL: serverURL) else {
+ Issue.record("The error must be shown.")
+ return
+ }
+
+ #expect(model.isPresentingCertificatePrompt == false)
+ #expect(model.isPresentingInsecureConnectionPrompt == false)
+ }
+}
diff --git a/Tests/NextcloudUnitTests/NCLoginAppConfigTests.swift b/Tests/NextcloudUnitTests/NCLoginAppConfigTests.swift
new file mode 100644
index 0000000000..6f0e114bd7
--- /dev/null
+++ b/Tests/NextcloudUnitTests/NCLoginAppConfigTests.swift
@@ -0,0 +1,69 @@
+// SPDX-FileCopyrightText: Nextcloud GmbH
+// SPDX-FileCopyrightText: 2026 Milen Pivchev
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import Testing
+@testable import Nextcloud
+
+@Suite("Login managed configuration")
+struct NCLoginAppConfigTests {
+ private let server = "https://cloud.example.com"
+
+ private func action(_ managed: [String: Any]?, useAppConfig: Bool = true, disableMultiaccount: Bool = false, accountCount: Int = 0) -> NCLoginAppConfig.Action? {
+ NCLoginAppConfig.action(managed: managed, useAppConfig: useAppConfig, disableMultiaccount: disableMultiaccount, accountCount: accountCount)
+ }
+
+ @Test("Nothing without a managed configuration or server")
+ func noAction() {
+ #expect(action(nil) == nil)
+ #expect(action([:]) == nil)
+ #expect(action(["serverUrl": ""]) == nil)
+ #expect(action(["username": "jane", "apppassword": "secret"]) == nil)
+ }
+
+ @Test("Server alone prefills the address")
+ func prefill() {
+ #expect(action(["serverUrl": server]) == .prefill(serverURL: server))
+ }
+
+ @Test("Server, user and app password create the account")
+ func createAccount() {
+ let managed = ["serverUrl": server, "username": "jane", "apppassword": "secret", "password": "plain"]
+
+ #expect(action(managed) == .createAccount(serverURL: server, user: "jane", appPassword: "secret"))
+ }
+
+ @Test("Server, user and password request an app password")
+ func requestAppPassword() {
+ let managed = ["serverUrl": server, "username": "jane", "password": "plain"]
+
+ #expect(action(managed) == .requestAppPassword(serverURL: server, user: "jane", password: "plain"))
+ }
+
+ @Test("Surrounding whitespace is trimmed except from the password")
+ func trimming() {
+ #expect(action(["serverUrl": " \(server)\n"]) == .prefill(serverURL: server))
+ #expect(action(["serverUrl": server, "username": " jane ", "apppassword": "secret\n"]) == .createAccount(serverURL: server, user: "jane", appPassword: "secret"))
+ #expect(action(["serverUrl": server, "username": "jane", "password": " pass "]) == .requestAppPassword(serverURL: server, user: "jane", password: " pass "))
+ #expect(action(["serverUrl": " "]) == nil)
+ }
+
+ @Test("Template placeholder values are ignored")
+ func placeholders() {
+ let managed = ["serverUrl": server, "username": "Username", "password": "password", "apppassword": "AppPassword"]
+
+ #expect(action(managed) == .prefill(serverURL: server))
+ }
+
+ @Test("Ignored unless the brand enables the managed configuration")
+ func disabled() {
+ #expect(action(["serverUrl": server], useAppConfig: false) == nil)
+ }
+
+ @Test("A single-account brand only uses it for the first account")
+ func singleAccount() {
+ #expect(action(["serverUrl": server], disableMultiaccount: true, accountCount: 1) == nil)
+ #expect(action(["serverUrl": server], disableMultiaccount: true, accountCount: 0) == .prefill(serverURL: server))
+ #expect(action(["serverUrl": server], disableMultiaccount: false, accountCount: 1) == .prefill(serverURL: server))
+ }
+}
diff --git a/Tests/NextcloudUnitTests/NCLoginServerErrorClassifierTests.swift b/Tests/NextcloudUnitTests/NCLoginServerErrorClassifierTests.swift
new file mode 100644
index 0000000000..4e5e32c745
--- /dev/null
+++ b/Tests/NextcloudUnitTests/NCLoginServerErrorClassifierTests.swift
@@ -0,0 +1,44 @@
+// SPDX-FileCopyrightText: Nextcloud GmbH
+// SPDX-FileCopyrightText: 2026 Milen Pivchev
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import Foundation
+import NextcloudKit
+import Testing
+@testable import Nextcloud
+
+@Suite("Login server error classification")
+struct NCLoginServerErrorClassifierTests {
+ private let httpsURL = URL(string: "https://cloud.example.com:8443/nextcloud/")!
+
+ @Test("Certificate errors ask to trust the certificate", arguments: [
+ NSURLErrorServerCertificateUntrusted,
+ NSURLErrorServerCertificateHasBadDate,
+ NSURLErrorServerCertificateHasUnknownRoot,
+ NSURLErrorServerCertificateNotYetValid
+ ])
+ func untrustedCertificate(errorCode: Int) {
+ let resolution = NCLoginServerErrorClassifier.classify(NKError(errorCode: errorCode), serverURL: httpsURL)
+
+ #expect(resolution == .untrustedCertificate(host: "cloud.example.com"))
+ }
+
+ @Test("Other https failures offer http with the same port and path", arguments: [NSURLErrorCannotConnectToHost, NSURLErrorSecureConnectionFailed, 404])
+ func insecureFallback(errorCode: Int) {
+ let resolution = NCLoginServerErrorClassifier.classify(NKError(errorCode: errorCode), serverURL: httpsURL)
+
+ #expect(resolution == .insecureFallback(URL(string: "http://cloud.example.com:8443/nextcloud/")!))
+ }
+
+ @Test("No network, an unknown host or a cancellation is shown, as http can't help", arguments: [NSURLErrorNotConnectedToInternet, NSURLErrorCannotFindHost, NSURLErrorDNSLookupFailed, NSURLErrorCancelled])
+ func unreachable(errorCode: Int) {
+ #expect(NCLoginServerErrorClassifier.classify(NKError(errorCode: errorCode), serverURL: httpsURL) == .generic)
+ }
+
+ @Test("Failures over http are shown")
+ func httpFailure() {
+ let httpURL = URL(string: "http://cloud.example.com/")!
+
+ #expect(NCLoginServerErrorClassifier.classify(NKError(errorCode: NSURLErrorCannotConnectToHost), serverURL: httpURL) == .generic)
+ }
+}
diff --git a/Tests/NextcloudUnitTests/NKErrorUserFriendlyMessageTests.swift b/Tests/NextcloudUnitTests/NKErrorUserFriendlyMessageTests.swift
index 3d28a56922..589f12707d 100644
--- a/Tests/NextcloudUnitTests/NKErrorUserFriendlyMessageTests.swift
+++ b/Tests/NextcloudUnitTests/NKErrorUserFriendlyMessageTests.swift
@@ -60,6 +60,16 @@ struct NKErrorUserFriendlyMessageTests {
#expect(NKError(error: CancellationError()).userFriendlyMessage() == nil)
}
+ @Test("Says no server was found when a login gets a 404")
+ func loginMessages() {
+ let notFound = NKError(errorCode: 404, errorDescription: "404: Not found")
+ let timeout = NKError(errorCode: NSURLErrorTimedOut, errorDescription: "The request timed out.")
+
+ #expect(notFound.userFriendlyMessage(for: .login) == localized("_error_login_server_not_found_"))
+ #expect(NKError.invalidData.userFriendlyMessage(for: .login) == NKError.invalidData.userFriendlyMessage())
+ #expect(timeout.userFriendlyMessage(for: .login) == timeout.userFriendlyMessage())
+ }
+
@Test("Words different kinds of failure differently")
func kindMessages() {
let timeout = NKError(errorCode: NSURLErrorTimedOut, errorDescription: "The request timed out.").userFriendlyMessage()
@@ -91,7 +101,7 @@ struct NKErrorUserFriendlyMessageTests {
@Test("Titles say what failed")
func failureTitles() throws {
- let contexts: [NCErrorContext] = [.upload(fileName: "f"), .download(fileName: "f"), .delete(fileName: "f"), .rename, .moveOrCopy(fileName: "f"), .createFolder(folderName: "f"), .favorite(fileName: "f"), .createDocument(fileName: "f"), .openDocument(fileName: "f")]
+ let contexts: [NCErrorContext] = [.upload(fileName: "f"), .download(fileName: "f"), .delete(fileName: "f"), .rename, .moveOrCopy(fileName: "f"), .createFolder(folderName: "f"), .favorite(fileName: "f"), .createDocument(fileName: "f"), .openDocument(fileName: "f"), .login]
#expect(NCErrorContext.generic.failureTitle == nil)
#expect(NCErrorContext.upload(fileName: "IMG_0042.jpg").failureTitle?.contains("IMG_0042.jpg") == true)
diff --git a/iOSClient/Account/Account Request/NCShareAccounts.storyboard b/iOSClient/Account/Account Request/NCShareAccounts.storyboard
deleted file mode 100644
index a497eca7bc..0000000000
--- a/iOSClient/Account/Account Request/NCShareAccounts.storyboard
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/iOSClient/Account/Account Request/NCShareAccounts.swift b/iOSClient/Account/Account Request/NCShareAccounts.swift
deleted file mode 100644
index c0c2142aea..0000000000
--- a/iOSClient/Account/Account Request/NCShareAccounts.swift
+++ /dev/null
@@ -1,99 +0,0 @@
-// SPDX-FileCopyrightText: Nextcloud GmbH
-// SPDX-FileCopyrightText: 2021 Marino Faggiana
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-import UIKit
-import NextcloudKit
-
-public protocol NCShareAccountsDelegate: AnyObject {
- func selected(url: String, user: String)
-}
-
-// optional func
-public extension NCShareAccountsDelegate {
- func selected(url: String, user: String) {}
-}
-
-class NCShareAccounts: UIViewController {
-
- @IBOutlet weak var titleLabel: UILabel!
- @IBOutlet weak var tableView: UITableView!
-
- public var accounts: [NKShareAccounts.DataAccounts] = []
- public let heightCell: CGFloat = 60
- public var enableTimerProgress: Bool = true
- public var dismissDidEnterBackground: Bool = true
- public weak var delegate: NCShareAccountsDelegate?
-
- // MARK: - View Life Cycle
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- titleLabel.text = NSLocalizedString("_account_select_to_add_", comment: "")
-
- tableView.tableFooterView = UIView(frame: CGRect(x: 0, y: 0, width: tableView.frame.size.width, height: 1))
- tableView.separatorStyle = UITableViewCell.SeparatorStyle.none
-
- view.backgroundColor = .secondarySystemBackground
- tableView.backgroundColor = .secondarySystemBackground
- }
-
- override func viewDidAppear(_ animated: Bool) {
- super.viewDidAppear(animated)
-
- let visibleCells = tableView.visibleCells
- if visibleCells.count == accounts.count {
- tableView.isScrollEnabled = false
- }
- }
-}
-
-extension NCShareAccounts: UITableViewDelegate {
-
- func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
- return heightCell
- }
-
- func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-
- dismiss(animated: true) {
- let account = self.accounts[indexPath.row]
- self.delegate?.selected(url: account.url, user: account.user)
- }
- }
-}
-
-extension NCShareAccounts: UITableViewDataSource {
- func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
- return accounts.count
- }
-
- func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-
- let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath)
- cell.backgroundColor = tableView.backgroundColor
-
- let avatarImage = cell.viewWithTag(10) as? UIImageView
- let userLabel = cell.viewWithTag(20) as? UILabel
- let urlLabel = cell.viewWithTag(30) as? UILabel
-
- userLabel?.text = ""
- urlLabel?.text = ""
-
- let account = accounts[indexPath.row]
-
- if let image = account.image {
- avatarImage?.image = image
- }
-
- if let name = account.name, !name.isEmpty {
- userLabel?.text = name.uppercased() + " (\(account.user))"
- } else {
- userLabel?.text = account.user.uppercased()
- }
- urlLabel?.text = (URL(string: account.url)?.host ?? "")
-
- return cell
- }
-}
diff --git a/iOSClient/Account/NCAccount.swift b/iOSClient/Account/NCAccount.swift
index fa3dace930..221a94ffef 100644
--- a/iOSClient/Account/NCAccount.swift
+++ b/iOSClient/Account/NCAccount.swift
@@ -10,11 +10,10 @@ import NextcloudKit
class NCAccount: NSObject {
private static var accountsCheckingRemoteUser: Set = []
let database = NCManageDatabase.shared
- let appDelegate = (UIApplication.shared.delegate as? AppDelegate)!
let global = NCGlobal.shared
let utilityFileSystem = NCUtilityFileSystem()
- func createAccount(viewController: UIViewController, urlBase: String, user: String, password: String, controller: NCMainTabBarController?) async {
+ func createAccount(viewController: UIViewController, urlBase: String, user: String, password: String, controller: NCMainTabBarController?) async throws {
nkLog(debug: "Creating account...")
var urlBase = urlBase
@@ -39,15 +38,13 @@ class NCAccount: NSObject {
guard resultsGetUserProfile.error == .success, let userProfile = resultsGetUserProfile.userProfile else {
NextcloudKit.shared.nkCommonInstance.nksessions.remove(account: account)
- let error = resultsGetUserProfile.error == .success ? NKError.invalidData : resultsGetUserProfile.error
+ nkLog(error: "Getting the user profile failed: \(resultsGetUserProfile.error.logDescription)")
- nkLog(error: "Getting the user profile failed: \(error.logDescription)")
+ // A reply that is no profile, such as the login page of a proxy, has no kind and so no message to show.
+ let isUnclassified = resultsGetUserProfile.error == .success || resultsGetUserProfile.error.kind == nil
+ let error = isUnclassified ? NKError.invalidData : resultsGetUserProfile.error
- let alertController = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: error.userFriendlyMessage() ?? error.localizedGenericMessage, preferredStyle: .alert)
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
- viewController.present(alertController, animated: true)
-
- return
+ throw error
}
// Login log debug
@@ -68,13 +65,16 @@ class NCAccount: NSObject {
if let controller {
controller.account = account
nkLog(debug: "Dismissing login provider view controller...")
- viewController.dismiss(animated: true)
+ // From its presenter, so a sheet the login still shows, such as the QR code scanner, closes too.
+ (viewController.presentingViewController ?? viewController).dismiss(animated: true)
} else if let controller = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController {
nkLog(debug: "Presenting initial view controller from main storyboard...")
controller.account = account
controller.modalPresentationStyle = .fullScreen
controller.view.alpha = 0
+ // A sheet the replaced login still shows, such as the QR code scanner, would stay on screen.
+ UIApplication.shared.mainAppWindow?.rootViewController?.dismiss(animated: false)
UIApplication.shared.mainAppWindow?.rootViewController = controller
UIApplication.shared.mainAppWindow?.makeKeyAndVisible()
@@ -176,6 +176,8 @@ class NCAccount: NSObject {
NCPreferences().clearAllKeysPushNotification(account: account)
// Remove Account Server in Error
NCNetworking.shared.removeServerErrorAccount(account)
+ // Stop offering the account to other apps
+ _ = await updateAppsShareAccounts()
}
func deleteAllAccounts() async {
@@ -262,7 +264,7 @@ class NCAccount: NSObject {
&& NCPreferences().getPassword(account: session.account) == token
}
- /// Presents the login (or intro) screen if no account remains.
+ /// Presents the account setup if no account remains.
func switchToFirstAvailableAccount(controller: NCMainTabBarController?) async {
let accounts = await NCManageDatabase.shared.getAccountsAsync()
@@ -270,22 +272,7 @@ class NCAccount: NSObject {
let account = accounts.first {
await changeAccount(account, userProfile: nil, controller: controller)
} else {
- if NCBrandOptions.shared.disable_intro {
- if let viewController = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin {
- viewController.controller = controller
- let navigationController = UINavigationController(rootViewController: viewController)
- navigationController.modalPresentationStyle = .fullScreen
- controller?.present(navigationController, animated: true)
- }
- } else {
- if let navigationController = UIStoryboard(name: "NCIntro", bundle: nil).instantiateInitialViewController() as? UINavigationController {
- if let viewController = navigationController.topViewController as? NCIntroViewController {
- viewController.controller = controller
- }
- navigationController.modalPresentationStyle = .fullScreen
- controller?.present(navigationController, animated: true)
- }
- }
+ controller?.present(NCAccountSetupView.viewController(controller: controller), animated: true)
}
}
}
diff --git a/iOSClient/AppDelegate.swift b/iOSClient/AppDelegate.swift
index 1bbdff022c..b284185865 100644
--- a/iOSClient/AppDelegate.swift
+++ b/iOSClient/AppDelegate.swift
@@ -21,10 +21,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}
var notificationSettings: UNNotificationSettings?
- var loginFlowV2Token = ""
- var loginFlowV2Endpoint = ""
- var loginFlowV2Login = ""
-
let backgroundQueue = DispatchQueue(label: "com.nextcloud.bgTaskQueue")
let global = NCGlobal.shared
@@ -281,7 +277,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
alertController.addAction(UIAlertAction(title: NSLocalizedString("_certificate_details_", comment: ""), style: .default, handler: { _ in
if let navigationController = UIStoryboard(name: "NCViewCertificateDetails", bundle: nil).instantiateInitialViewController() as? UINavigationController,
let viewController = navigationController.topViewController as? NCViewCertificateDetails {
- viewController.delegate = self
+ viewController.onClose = {
+ self.trustCertificateError(host: host)
+ }
viewController.host = host
UIApplication.shared.mainAppWindow?.rootViewController?.present(navigationController, animated: true)
}
@@ -330,16 +328,46 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void) -> Bool {
return false
}
-}
-// MARK: - Extension
+ // MARK: - Orientation
+
+ func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
+ // The onboarding and login are laid out for portrait on iPhone.
+ if UIDevice.current.userInterfaceIdiom == .phone, NCAccountSetupView.isShown(in: window) {
+ return .portrait
+ }
-extension AppDelegate: NCViewCertificateDetailsDelegate {
- func viewCertificateDetailsDismiss(host: String) {
- trustCertificateError(host: host)
+ return Self.infoPlistOrientations
}
+
+ /// The orientations the Info.plist allows on this device, which this delegate method otherwise replaces.
+ private static let infoPlistOrientations: UIInterfaceOrientationMask = {
+ let bundle = Bundle.main
+ let names = (UIDevice.current.userInterfaceIdiom == .pad ? bundle.object(forInfoDictionaryKey: "UISupportedInterfaceOrientations~ipad") as? [String] : nil)
+ ?? bundle.object(forInfoDictionaryKey: "UISupportedInterfaceOrientations") as? [String]
+ ?? []
+
+ let mask = names.reduce(into: UIInterfaceOrientationMask()) { mask, name in
+ switch name {
+ case "UIInterfaceOrientationPortrait":
+ mask.insert(.portrait)
+ case "UIInterfaceOrientationPortraitUpsideDown":
+ mask.insert(.portraitUpsideDown)
+ case "UIInterfaceOrientationLandscapeLeft":
+ mask.insert(.landscapeLeft)
+ case "UIInterfaceOrientationLandscapeRight":
+ mask.insert(.landscapeRight)
+ default:
+ break
+ }
+ }
+
+ return mask.isEmpty ? .all : mask
+ }()
}
+// MARK: - Extension
+
extension AppDelegate: NCCreateFormUploadConflictDelegate {
func dismissCreateFormUploadConflict(metadatas: [tableMetadata]?) {
if let metadatas {
diff --git a/iOSClient/Extensions/UIButton+Extension.swift b/iOSClient/Extensions/UIButton+Extension.swift
deleted file mode 100644
index 8050c15444..0000000000
--- a/iOSClient/Extensions/UIButton+Extension.swift
+++ /dev/null
@@ -1,36 +0,0 @@
-// SPDX-FileCopyrightText: Nextcloud GmbH
-// SPDX-FileCopyrightText: 2024 Milen Pivchev
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-extension UIButton {
- func hideButtonAndShowSpinner(tint: UIColor = .white) {
- self.isHidden = true
-
- let spinnerTag = Int(bitPattern: Unmanaged.passUnretained(self).toOpaque())
- if self.superview?.subviews.first(where: { view -> Bool in
- return view.isKind(of: UIActivityIndicatorView.self) && view.tag == spinnerTag
- }) != nil {
- return
- }
-
- let spinner = UIActivityIndicatorView(style: .medium)
- spinner.tag = spinnerTag
- spinner.color = tint
- spinner.startAnimating()
- spinner.center = self.center
- self.superview?.addSubview(spinner)
- spinner.translatesAutoresizingMaskIntoConstraints = false
- spinner.centerXAnchor.constraint(equalTo: self.centerXAnchor).isActive = true
- spinner.centerYAnchor.constraint(equalTo: self.centerYAnchor).isActive = true
- }
-
- func hideSpinnerAndShowButton() {
- let spinnerTag = Int(bitPattern: Unmanaged.passUnretained(self).toOpaque())
- let spinner = self.superview?.subviews.first(where: { view -> Bool in
- return view.isKind(of: UIActivityIndicatorView.self) && view.tag == spinnerTag
- })
-
- spinner?.removeFromSuperview()
- self.isHidden = false
- }
-}
diff --git a/iOSClient/Extensions/UINavigationController+Extension.swift b/iOSClient/Extensions/UINavigationController+Extension.swift
index 46b9a063fb..734a7edf3b 100644
--- a/iOSClient/Extensions/UINavigationController+Extension.swift
+++ b/iOSClient/Extensions/UINavigationController+Extension.swift
@@ -6,6 +6,9 @@ import Foundation
import UIKit
extension UINavigationController {
+ open override var childForStatusBarStyle: UIViewController? {
+ return topViewController?.childForStatusBarStyle ?? topViewController
+ }
// https://stackoverflow.com/questions/6131205/how-to-find-topmost-view-controller-on-ios
override func topMostViewController() -> UIViewController {
diff --git a/iOSClient/Files/NCFiles.swift b/iOSClient/Files/NCFiles.swift
index 99f4e7af87..ebe2e2f362 100644
--- a/iOSClient/Files/NCFiles.swift
+++ b/iOSClient/Files/NCFiles.swift
@@ -437,15 +437,7 @@ class NCFiles: NCCollectionViewCommon {
let currentAccount = session.account
if database.getAllTableAccount().isEmpty {
- let navigationController: UINavigationController?
-
- if NCBrandOptions.shared.disable_intro, let viewController = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin {
- navigationController = UINavigationController(rootViewController: viewController)
- } else {
- navigationController = UIStoryboard(name: "NCIntro", bundle: nil).instantiateInitialViewController() as? UINavigationController
- }
-
- UIApplication.shared.mainAppWindow?.rootViewController = navigationController
+ UIApplication.shared.mainAppWindow?.rootViewController = NCAccountSetupView.viewController()
} else if let account = tblAccount?.account, account != currentAccount {
Task {
await NCAccount().changeAccount(account, userProfile: nil, controller: controller)
diff --git a/iOSClient/Files/NCFilesNavigationController.swift b/iOSClient/Files/NCFilesNavigationController.swift
index 5e25016a5b..df7a32f05f 100644
--- a/iOSClient/Files/NCFilesNavigationController.swift
+++ b/iOSClient/Files/NCFilesNavigationController.swift
@@ -114,22 +114,7 @@ class NCFilesNavigationController: NCMainNavigationController {
}
let addAccountAction = UIAction(title: NSLocalizedString("_add_account_", comment: ""), image: utility.loadImage(named: "person.crop.circle.badge.plus", colors: NCBrandColor.shared.iconImageMultiColors)) { _ in
- if NCBrandOptions.shared.disable_intro {
- if let viewController = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin {
- viewController.controller = self.controller
- let navigationController = UINavigationController(rootViewController: viewController)
- navigationController.modalPresentationStyle = .fullScreen
- self.present(navigationController, animated: true)
- }
- } else {
- if let navigationController = UIStoryboard(name: "NCIntro", bundle: nil).instantiateInitialViewController() as? UINavigationController {
- if let viewController = navigationController.topViewController as? NCIntroViewController {
- viewController.controller = nil
- }
- navigationController.modalPresentationStyle = .fullScreen
- self.present(navigationController, animated: true)
- }
- }
+ self.present(NCAccountSetupView.viewController(controller: self.controller), animated: true)
}
let settingsAccountAction = UIAction(title: NSLocalizedString("_account_settings_", comment: ""), image: utility.loadImage(named: "gear", colors: [NCBrandColor.shared.iconImageColor])) { _ in
diff --git a/iOSClient/GUI/Lucid Banner/AlertActionBannerView.swift b/iOSClient/GUI/Lucid Banner/AlertActionBannerView.swift
deleted file mode 100644
index d5fac9a19a..0000000000
--- a/iOSClient/GUI/Lucid Banner/AlertActionBannerView.swift
+++ /dev/null
@@ -1,189 +0,0 @@
-// SPDX-FileCopyrightText: Nextcloud GmbH
-// SPDX-FileCopyrightText: 2026 Marino Faggiana
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-import SwiftUI
-import LucidBanner
-
-@MainActor
-func showAlertActionBanner(lucidBanner: LucidBanner?,
- windowScene: UIWindowScene?,
- title: String? = nil,
- subtitle: String? = nil,
- onConfirm: (() -> Void)? = nil) {
- guard let lucidBanner,
- let windowScene,
- let window = windowScene.resolvedWindow else {
- return
- }
- let horizontalLayout = horizontalLayoutBanner(bounds: window.bounds,
- safeAreaInsets: window.safeAreaInsets,
- idiom: window.traitCollection.userInterfaceIdiom)
-
- let payload = LucidBannerPayload(
- title: title,
- subtitle: subtitle,
- vPosition: .top,
- horizontalLayout: horizontalLayout,
- swipeToDismiss: true
- )
-
- lucidBanner.show(payload: payload,
- policy: .enqueue) { state in
- AlertActionBannerView(
- state: state,
- onConfirm: {
- onConfirm?()
- lucidBanner.dismiss()
- },
- onCancel: {
- lucidBanner.dismiss()
- }
- )
- }
-}
-
-// MARK: - SwiftUI
-
-struct AlertActionBannerView: View {
- @ObservedObject var state: LucidBannerState
-
- let onConfirm: (() -> Void)?
- let onCancel: (() -> Void)?
-
- init(
- state: LucidBannerState,
- onConfirm: (() -> Void)? = nil,
- onCancel: (() -> Void)? = nil
- ) {
- self.state = state
- self.onConfirm = onConfirm
- self.onCancel = onCancel
- }
-
- var body: some View {
- alertActionContainerView {
- VStack(spacing: 20) {
- // Title
- if let title = state.payload.title, !title.isEmpty {
- Text(title)
- .cappedFont(.headline, maxDynamicType: .accessibility2)
- .fontWeight(.semibold)
- .foregroundStyle(state.payload.textColor)
- .multilineTextAlignment(.center)
- }
-
- // Subtitle
- if let subtitle = state.payload.subtitle, !subtitle.isEmpty {
- Text(subtitle)
- .cappedFont(.subheadline, maxDynamicType: .accessibility1)
- .foregroundStyle(state.payload.textColor)
- .multilineTextAlignment(.center)
- }
-
- // Buttons
- HStack(spacing: 12) {
- Button {
- onCancel?()
- } label: {
- Text("_cancel_")
- .cappedFont(.footnote, maxDynamicType: .xxxLarge)
- .frame(maxWidth: .infinity)
- .contentShape(Rectangle())
- }
- .padding(.vertical, 8)
- .background(
- Capsule()
- .stroke(Color.secondary.opacity(0.5), lineWidth: 1)
- )
- .foregroundStyle(.primary)
- .buttonStyle(.plain)
-
- Button {
- onConfirm?()
- } label: {
- Text("_ok_")
- .cappedFont(.footnote, maxDynamicType: .xxxLarge)
- .frame(maxWidth: .infinity)
- .contentShape(Rectangle())
- }
- .padding(.vertical, 8)
- .background(
- Capsule().fill(Color.accentColor)
- )
- .foregroundStyle(.white)
- .buttonStyle(.plain)
- }
- .frame(maxWidth: .infinity)
- }
- .padding(20)
- }
- }
-
- // MARK: - Container
-
- @ViewBuilder
- func alertActionContainerView(@ViewBuilder _ content: () -> Content) -> some View {
- let cornerRadius: CGFloat = 22
- let backgroundColor = Color(.systemBackground).opacity(0.9)
-
- if #available(iOS 26, *) {
- content()
- .background(
- RoundedRectangle(cornerRadius: cornerRadius)
- .fill(backgroundColor)
- .id(backgroundColor)
- )
- .glassEffect(.clear, in: RoundedRectangle(cornerRadius: cornerRadius))
- .shadow(color: .black.opacity(0.5), radius: 10, x: 0, y: 4)
- } else {
- content()
- .background(
- RoundedRectangle(cornerRadius: cornerRadius)
- .fill(backgroundColor)
- .id(backgroundColor)
- )
- .background(
- RoundedRectangle(cornerRadius: cornerRadius)
- .fill(.ultraThinMaterial)
- )
- .overlay(
- RoundedRectangle(cornerRadius: cornerRadius)
- .stroke(backgroundColor, lineWidth: 0.6)
- .allowsHitTesting(false)
- )
- .shadow(color: .black.opacity(0.5), radius: 10, x: 0, y: 4)
- }
- }
-}
-
-// MARK: - Preview
-
-#Preview("Alert - Light") {
-
- let payload = LucidBannerPayload(
- title: "Title ?",
- subtitle: "Subtitle.",
- stage: .warning,
- vPosition: .center,
- blocksTouches: true
- )
-
- let state = LucidBannerState(payload: payload)
-
- return ZStack {
- Color.black.opacity(0.15)
- .ignoresSafeArea()
-
- AlertActionBannerView(
- state: state,
- onConfirm: {
- print("Confirm tapped")
- },
- onCancel: {
- print("Cancel tapped")
- }
- )
- .padding()
- }
-}
diff --git a/iOSClient/Images.xcassets/certificate.imageset/Contents.json b/iOSClient/Images.xcassets/certificate.imageset/Contents.json
deleted file mode 100644
index a9e01b039a..0000000000
--- a/iOSClient/Images.xcassets/certificate.imageset/Contents.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "images" : [
- {
- "filename" : "certificate.svg",
- "idiom" : "universal"
- }
- ],
- "info" : {
- "author" : "xcode",
- "version" : 1
- },
- "properties" : {
- "preserves-vector-representation" : true
- }
-}
diff --git a/iOSClient/Images.xcassets/certificate.imageset/certificate.svg b/iOSClient/Images.xcassets/certificate.imageset/certificate.svg
deleted file mode 100644
index abb2dff315..0000000000
--- a/iOSClient/Images.xcassets/certificate.imageset/certificate.svg
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/iOSClient/Login/NCAccountSetupModel.swift b/iOSClient/Login/NCAccountSetupModel.swift
new file mode 100644
index 0000000000..c9b2d7aa5c
--- /dev/null
+++ b/iOSClient/Login/NCAccountSetupModel.swift
@@ -0,0 +1,287 @@
+// SPDX-FileCopyrightText: Nextcloud GmbH
+// SPDX-FileCopyrightText: 2026 Milen Pivchev
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import NextcloudKit
+import NextcloudKitUI
+import SwiftUI
+import UIKit
+
+/// Connects the shared NextcloudKitUI onboarding and login to the app: branding, managed configuration, certificate trust and account creation.
+@MainActor
+@Observable
+final class NCAccountSetupModel {
+ /// Shown once before the first login, unless the brand turned it off.
+ private(set) var showsOnboarding: Bool
+
+ var isPresentingCertificatePrompt = false
+ var isPresentingInsecureConnectionPrompt = false
+ var isPresentingCertificateDetails = false
+
+ /// The server whose certificate the prompt and its details are about.
+ private(set) var certificateHost = ""
+
+ /// The controller hosting the setup, which dismisses it and shows its error banners.
+ @ObservationIgnored weak var presenter: UIViewController?
+
+ @ObservationIgnored private(set) var configuration = LoginFlowConfiguration()
+ @ObservationIgnored private(set) var sharedAccounts: [SharedAccount] = []
+
+ @ObservationIgnored private let controller: NCMainTabBarController?
+ @ObservationIgnored private var answerContinuation: CheckedContinuation?
+ @ObservationIgnored private var hasLoginAppeared = false
+
+ /// - Parameter controller: The tab bar the setup is presented on, or `nil` when the setup is the root of the window.
+ init(controller: NCMainTabBarController?) {
+ self.controller = controller
+
+ let hasAccounts = !NCManageDatabase.shared.getAllTableAccount().isEmpty
+
+ showsOnboarding = !NCBrandOptions.shared.disable_intro && !hasAccounts && !NCPreferences().hasSeenOnboarding
+ configuration = makeConfiguration(showsCancelButton: controller != nil && hasAccounts)
+ sharedAccounts = loadSharedAccounts()
+ }
+
+ func finishOnboarding() {
+ NCPreferences().hasSeenOnboarding = true
+ showsOnboarding = false
+ }
+
+ // MARK: - Configuration
+
+ /// Built from the brand options when the setup is created, so values overridden by the managed configuration apply.
+ private func makeConfiguration(showsCancelButton: Bool) -> LoginFlowConfiguration {
+ let brandOptions = NCBrandOptions.shared
+ var configuration = LoginFlowConfiguration()
+
+ configuration.foregroundColor = NCBrandColor.shared.customer.isTooLight() ? .black : .white
+ configuration.serverAddressPrompt = NSLocalizedString("_login_url_", comment: "")
+ configuration.serverAddressDescription = String.localizedStringWithFormat(NSLocalizedString("_login_address_detail_", comment: ""), brandOptions.brand)
+ configuration.enforcedServersPrompt = NSLocalizedString("_select_server_", comment: "")
+
+ if case .prefill(let serverURL) = appConfigAction {
+ configuration.initialServerAddress = serverURL
+ } else if !brandOptions.loginBaseUrl.isEmpty {
+ configuration.initialServerAddress = brandOptions.loginBaseUrl
+ }
+
+ configuration.isServerAddressEditable = !brandOptions.disable_request_login_url
+ configuration.enforcedServers = brandOptions.enforce_servers.compactMap { server in
+ URL(string: server.url).map { LoginFlowConfiguration.Server(name: server.name, url: $0) }
+ }
+ configuration.upgradesInsecureHTTP = true
+ configuration.loginURLScheme = brandOptions.webLoginAutenticationProtocol.replacingOccurrences(of: "://", with: "")
+
+ // Branded apps link to neither the nextcloud.com providers nor its install page.
+ if !brandOptions.disable_intro {
+ configuration.providerSignUp = URL(string: brandOptions.linkloginPreferredProviders).map {
+ LoginFlowConfiguration.WebLink(title: NSLocalizedString("_sign_up_", comment: ""), url: $0)
+ }
+
+ configuration.hostingInformation = URL(string: brandOptions.linkLoginHost).map {
+ LoginFlowConfiguration.WebLink(title: NSLocalizedString("_host_your_own_server_", comment: ""), url: $0)
+ }
+ }
+
+ if showsCancelButton {
+ configuration.onCancel = { [weak self] in
+ self?.presenter?.dismiss(animated: true)
+ }
+ }
+
+ configuration.onServerError = { [weak self] error, serverURL in
+ await self?.recover(from: error, serverURL: serverURL) ?? .presentError
+ }
+
+ return configuration
+ }
+
+ /// Accounts of other Nextcloud apps on this device which are not added here yet.
+ private func loadSharedAccounts() -> [SharedAccount] {
+ // Not offered while the managed configuration logs in by itself.
+ switch appConfigAction {
+ case .createAccount, .requestAppPassword:
+ return []
+ case .prefill, nil:
+ break
+ }
+
+ guard let directory = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps),
+ let shareAccounts = NKShareAccounts().getShareAccount(at: directory, application: UIApplication.shared) else {
+ return []
+ }
+
+ return shareAccounts.compactMap { shareAccount in
+ let predicate = NSPredicate(format: "urlBase == %@ AND user == %@", shareAccount.url, shareAccount.user)
+
+ guard NCManageDatabase.shared.getTableAccount(predicate: predicate) == nil,
+ let host = URL(string: shareAccount.url) else {
+ return nil
+ }
+
+ let name = shareAccount.name.flatMap { $0.isEmpty ? nil : $0 } ?? shareAccount.user
+ let image = shareAccount.image.map { Image(uiImage: $0) } ?? Image(systemName: "person.crop.circle")
+
+ return SharedAccount(name, user: shareAccount.user, on: host, with: image)
+ }
+ }
+
+ // MARK: - Account
+
+ func addAccount(host: URL, user: String, password: String) async throws {
+ guard let presenter else { return }
+
+ // The setup may still be sliding in, as for the managed auto-login, while the QR code scanner stays open and closes with the setup.
+ await waitForTransitions()
+
+ let controller = self.controller ?? SceneManager.shared.getController(window: UIApplication.shared.mainAppWindow)
+
+ // A certificate is trusted only from the prompt in recover(from:serverURL:), never by adding the account.
+ try await NCAccount().createAccount(viewController: presenter, urlBase: host.absoluteString, user: user, password: password, controller: controller)
+ }
+
+ /// Publishes the accounts for other apps and logs in with the managed configuration, once.
+ func loginDidAppear() {
+ guard !hasLoginAppeared else { return }
+
+ hasLoginAppeared = true
+
+ Task {
+ _ = await NCAccount().updateAppsShareAccounts()
+ }
+
+ Task {
+ await runAppConfigAutoLoginIfNeeded()
+ }
+ }
+
+ // MARK: - Managed configuration
+
+ private var appConfigAction: NCLoginAppConfig.Action? {
+#if DEBUG
+ // Passcode UI tests provision an account through the same path as the managed configuration.
+ let process = ProcessInfo.processInfo
+ let environment = process.environment
+
+ if process.arguments.contains("UI_TESTING"), process.arguments.contains("UI_TESTING_PASSCODE"),
+ let server = environment["UI_TESTING_PASSCODE_SERVER"],
+ let username = environment["UI_TESTING_PASSCODE_USERNAME"],
+ let password = environment["UI_TESTING_PASSCODE_PASSWORD"] {
+ return .requestAppPassword(serverURL: server, user: username, password: password)
+ }
+#endif
+ return NCLoginAppConfig.action(managed: UserDefaults.standard.dictionary(forKey: "com.apple.configuration.managed"),
+ useAppConfig: NCBrandOptions.shared.use_AppConfig,
+ disableMultiaccount: NCBrandOptions.shared.disable_multiaccount,
+ accountCount: NCManageDatabase.shared.getAccounts()?.count ?? 0)
+ }
+
+ private func runAppConfigAutoLoginIfNeeded() async {
+ do {
+ let serverURL: String
+ let user: String
+ let password: String
+
+ switch appConfigAction {
+ case .createAccount(let url, let name, let appPassword):
+ serverURL = url
+ user = name
+ password = appPassword
+ case .requestAppPassword(let url, let name, let userPassword):
+ let results = await NextcloudKit.shared.getAppPasswordAsync(url: url, user: name, password: userPassword)
+
+ guard results.error == .success, let token = results.token else {
+ let isUnclassified = results.error == .success || results.error.kind == nil
+
+ throw isUnclassified ? NKError.invalidData : results.error
+ }
+
+ serverURL = url
+ user = name
+ password = token
+ case .prefill, nil:
+ return
+ }
+
+ guard let host = URL(string: serverURL) else {
+ throw NKError.urlError
+ }
+
+ try await addAccount(host: host, user: user, password: password)
+ } catch {
+ await showErrorBanner(windowScene: presenter?.view.window?.windowScene, error: error as? NKError ?? NKError(error: error), context: .login)
+ }
+ }
+
+ // MARK: - Server errors
+
+ func recover(from error: NKError, serverURL: URL) async -> LoginFlowConfiguration.Recovery {
+ switch NCLoginServerErrorClassifier.classify(error, serverURL: serverURL) {
+ case .untrustedCertificate(let host):
+ certificateHost = host
+
+ guard await ask(\.isPresentingCertificatePrompt) else { return .cancel }
+
+ NCNetworking.shared.writeCertificate(host: host)
+ return .retry(serverURL)
+ case .insecureFallback(let httpURL):
+#if DEBUG
+ return .retry(httpURL)
+#else
+ return await ask(\.isPresentingInsecureConnectionPrompt) ? .retry(httpURL) : .cancel
+#endif
+ case .generic:
+ return .presentError
+ }
+ }
+
+ /// Shows the prompt once nothing else is closing, and waits for its answer.
+ private func ask(_ prompt: ReferenceWritableKeyPath) async -> Bool {
+ await waitForTransitions()
+
+ return await withCheckedContinuation { continuation in
+ answerContinuation?.resume(returning: false)
+ answerContinuation = continuation
+ self[keyPath: prompt] = true
+ }
+ }
+
+ /// Resumes the login waiting for the prompt.
+ func answer(_ isConfirmed: Bool) {
+ isPresentingCertificatePrompt = false
+ isPresentingInsecureConnectionPrompt = false
+
+ answerContinuation?.resume(returning: isConfirmed)
+ answerContinuation = nil
+ }
+
+ func presentCertificateDetails() {
+ isPresentingCertificateDetails = true
+ }
+
+ /// Asks again about the certificate whose details were shown.
+ func certificateDetailsDidClose() {
+ isPresentingCertificateDetails = false
+
+ guard answerContinuation != nil else { return }
+
+ isPresentingCertificatePrompt = true
+ }
+
+ // MARK: - Transitions
+
+ /// A sheet still closing, or the setup still sliding in, would drop what is presented or dismissed next.
+ private func waitForTransitions() async {
+ let deadline = ContinuousClock.now + .seconds(2)
+
+ while isTransitioning, ContinuousClock.now < deadline {
+ try? await Task.sleep(for: .milliseconds(50))
+ }
+ }
+
+ private var isTransitioning: Bool {
+ guard let presenter else { return false }
+
+ return presenter.isBeingPresented || presenter.presentedViewController?.isBeingDismissed == true
+ }
+}
diff --git a/iOSClient/Login/NCAccountSetupView.swift b/iOSClient/Login/NCAccountSetupView.swift
new file mode 100644
index 0000000000..c0adf4a33a
--- /dev/null
+++ b/iOSClient/Login/NCAccountSetupView.swift
@@ -0,0 +1,116 @@
+// SPDX-FileCopyrightText: Nextcloud GmbH
+// SPDX-FileCopyrightText: 2026 Milen Pivchev
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import NextcloudKitUI
+import SwiftUI
+import UIKit
+
+/// The onboarding and login of NextcloudKitUI, shown while the app has no account and to add one.
+struct NCAccountSetupView: View {
+ @Bindable var model: NCAccountSetupModel
+
+ var body: some View {
+ ZStack {
+ if model.showsOnboarding {
+ OnboardingView(title: String.localizedStringWithFormat(NSLocalizedString("_onboarding_title_", comment: ""), NCBrandOptions.shared.brand),
+ features: features,
+ tint: Color(uiColor: NCBrandColor.shared.customer)) {
+ withAnimation {
+ model.finishOnboarding()
+ }
+ }
+ .transition(.opacity)
+ } else {
+ ServerAddressView(backgroundColor: .constant(Color(uiColor: NCBrandColor.shared.customer)),
+ brandImage: Image("logo"),
+ sharedAccounts: model.sharedAccounts,
+ userAgent: userAgent,
+ configuration: model.configuration) { host, name, password in
+ try await model.addAccount(host: host, user: name, password: password)
+ }
+ .onAppear {
+ model.loginDidAppear()
+ }
+ .transition(.opacity)
+ }
+ }
+ .alert(NSLocalizedString("_ssl_certificate_untrusted_", comment: ""), isPresented: $model.isPresentingCertificatePrompt) {
+ Button(NSLocalizedString("_yes_", comment: "")) {
+ model.answer(true)
+ }
+
+ Button(NSLocalizedString("_no_", comment: "")) {
+ model.answer(false)
+ }
+
+ Button(NSLocalizedString("_certificate_details_", comment: "")) {
+ model.presentCertificateDetails()
+ }
+ } message: {
+ Text(NSLocalizedString("_connect_server_anyway_", comment: ""))
+ }
+ .alert(NSLocalizedString("_warning_", comment: ""), isPresented: $model.isPresentingInsecureConnectionPrompt) {
+ Button(NSLocalizedString("_cancel_", comment: ""), role: .cancel) {
+ model.answer(false)
+ }
+
+ Button(NSLocalizedString("_continue_", comment: ""), role: .destructive) {
+ model.answer(true)
+ }
+ } message: {
+ Text(NSLocalizedString("_https_failed_try_http_", comment: ""))
+ }
+ .sheet(isPresented: $model.isPresentingCertificateDetails) {
+ // The details close themselves, which a sheet binding may not notice.
+ certificateDetailsView(host: model.certificateHost, title: NSLocalizedString("_certificate_view_", comment: "")) {
+ model.certificateDetailsDidClose()
+ }
+ }
+ .onAppear {
+ // Turns to portrait right away when shown over the files in landscape.
+ model.presenter?.setNeedsUpdateOfSupportedInterfaceOrientations()
+ }
+ .onDisappear {
+ // A login must not wait for a prompt of a setup that is gone.
+ model.answer(false)
+ }
+ }
+
+ private var features: [OnboardingFeature] {
+ [
+ OnboardingFeature(icon: Image(systemName: "lock.shield"), title: NSLocalizedString("_intro_1_title_", comment: "")),
+ OnboardingFeature(icon: Image(systemName: "person.2"), title: NSLocalizedString("_intro_2_title_", comment: "")),
+ OnboardingFeature(icon: Image(systemName: "envelope"), title: NSLocalizedString("_intro_3_title_", comment: "")),
+ OnboardingFeature(icon: Image(systemName: "video"), title: NSLocalizedString("_intro_4_title_", comment: ""))
+ ]
+ }
+
+ /// Whether the setup is the root of the window or presented in it, with anything it presents on top.
+ static func isShown(in window: UIWindow?) -> Bool {
+ var viewController = window?.rootViewController
+
+ while let current = viewController {
+ if current is UIHostingController {
+ return true
+ }
+
+ viewController = current.presentedViewController
+ }
+
+ return false
+ }
+
+ /// The setup in a full screen controller, for the root of a window or to present on the tab bar.
+ /// - Parameter controller: The tab bar to present the setup on.
+ static func viewController(controller: NCMainTabBarController? = nil) -> UIViewController {
+ let model = NCAccountSetupModel(controller: controller)
+ let viewController = UIHostingController(rootView: NCAccountSetupView(model: model))
+
+ viewController.modalPresentationStyle = .fullScreen
+ viewController.view.backgroundColor = model.showsOnboarding ? .systemBackground : NCBrandColor.shared.customer
+ model.presenter = viewController
+
+ return viewController
+ }
+}
diff --git a/iOSClient/Login/NCLogin.storyboard b/iOSClient/Login/NCLogin.storyboard
deleted file mode 100644
index 981eadcc58..0000000000
--- a/iOSClient/Login/NCLogin.storyboard
+++ /dev/null
@@ -1,211 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/iOSClient/Login/NCLogin.swift b/iOSClient/Login/NCLogin.swift
deleted file mode 100644
index 86b2053048..0000000000
--- a/iOSClient/Login/NCLogin.swift
+++ /dev/null
@@ -1,587 +0,0 @@
-// SPDX-FileCopyrightText: Nextcloud GmbH
-// SPDX-FileCopyrightText: 2025 Marino Faggiana
-// SPDX-FileCopyrightText: 2025 Milen Pivchev
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-import UniformTypeIdentifiers
-import UIKit
-import NextcloudKit
-import SwiftUI
-import SafariServices
-import LucidBanner
-
-class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
- @IBOutlet weak var imageBrand: UIImageView!
- @IBOutlet weak var imageBrandConstraintY: NSLayoutConstraint!
- @IBOutlet weak var baseUrlTextField: UITextField!
- @IBOutlet weak var loginAddressDetail: UILabel!
- @IBOutlet weak var loginButton: UIButton!
- @IBOutlet weak var qrCode: UIButton!
- @IBOutlet weak var certificate: UIButton!
- @IBOutlet weak var enforceServersButton: UIButton!
- @IBOutlet weak var enforceServersDropdownImage: UIImageView!
-
- private let appDelegate = (UIApplication.shared.delegate as? AppDelegate)!
- private var textColor: UIColor = .white
- private var textColorOpponent: UIColor = .black
- private var activeTextfieldDiff: CGFloat = 0
- private var activeTextField = UITextField()
-
- private var shareAccounts: [NKShareAccounts.DataAccounts]?
-
- /// Controller
- var controller: NCMainTabBarController?
-
- /// The URL that will show up on the URL field when this screen appears
- var urlBase = ""
-
- // Used for MDM
- var configServerUrl: String?
- var configUsername: String?
- var configPassword: String?
- var configAppPassword: String?
-
- private var p12Data: Data?
- private var p12Password: String?
- private var QRCodeCheck: Bool = false
- private var activeLoginProvider: NCLoginProvider?
-
- // LucidBanner
- var banner: LucidBanner?
-
- // MARK: - View Life Cycle
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- // Text color
- if NCBrandColor.shared.customer.isTooLight() {
- textColor = .black
- textColorOpponent = .white
- } else if NCBrandColor.shared.customer.isTooDark() {
- textColor = .white
- textColorOpponent = .black
- } else {
- textColor = .white
- textColorOpponent = .black
- }
-
- // Image Brand
- imageBrand.image = UIImage(named: "logo")
-
- // Url
- baseUrlTextField.textColor = textColor
- baseUrlTextField.tintColor = textColor
- baseUrlTextField.layer.cornerRadius = 10
- baseUrlTextField.layer.borderWidth = 1
- baseUrlTextField.layer.borderColor = textColor.cgColor
- baseUrlTextField.leftView = UIView(frame: CGRect(x: 0, y: 0, width: 15, height: baseUrlTextField.frame.height))
- baseUrlTextField.leftViewMode = .always
- baseUrlTextField.rightView = UIView(frame: CGRect(x: 0, y: 0, width: 35, height: baseUrlTextField.frame.height))
- baseUrlTextField.rightViewMode = .always
- baseUrlTextField.attributedPlaceholder = NSAttributedString(string: NSLocalizedString("_login_url_", comment: ""), attributes: [NSAttributedString.Key.foregroundColor: textColor.withAlphaComponent(0.5)])
- baseUrlTextField.delegate = self
-
- baseUrlTextField.isEnabled = !NCBrandOptions.shared.disable_request_login_url
-
- // Login button
- loginAddressDetail.textColor = textColor
- loginAddressDetail.text = String.localizedStringWithFormat(NSLocalizedString("_login_address_detail_", comment: ""), NCBrandOptions.shared.brand)
-
- // QR code button
- qrCode.tintColor = NCBrandColor.shared.customer.isTooLight() ? .black : .white
-
- urlBase = NCBrandOptions.shared.loginBaseUrl
-
- // brand
- if NCBrandOptions.shared.disable_request_login_url {
- baseUrlTextField.isEnabled = false
- baseUrlTextField.isUserInteractionEnabled = false
- baseUrlTextField.alpha = 0.5
- }
-
- // certificate
- certificate.setImage(UIImage(named: "certificate")?.image(color: textColor, size: 100), for: .normal)
- certificate.isHidden = true
- certificate.isEnabled = false
-
- // navigation
- let navBarAppearance = UINavigationBarAppearance()
- navBarAppearance.configureWithTransparentBackground()
- navBarAppearance.shadowColor = .clear
- navBarAppearance.shadowImage = UIImage()
- navBarAppearance.titleTextAttributes = [.foregroundColor: textColor]
- navBarAppearance.largeTitleTextAttributes = [.foregroundColor: textColor]
- self.navigationController?.navigationBar.standardAppearance = navBarAppearance
- self.navigationController?.view.backgroundColor = NCBrandColor.shared.customer
- self.navigationController?.navigationBar.tintColor = textColor
-
- if let dirGroupApps = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps) {
- // Nextcloud update share accounts
- Task {
- await NCAccount().updateAppsShareAccounts()
- }
- // Nextcloud get share accounts
- if let shareAccounts = NKShareAccounts().getShareAccount(at: dirGroupApps, application: UIApplication.shared) {
- var accountTemp = [NKShareAccounts.DataAccounts]()
- for shareAccount in shareAccounts {
- if NCManageDatabase.shared.getTableAccount(predicate: NSPredicate(format: "urlBase == %@ AND user == %@", shareAccount.url, shareAccount.user)) == nil {
- accountTemp.append(shareAccount)
- }
- }
- if !accountTemp.isEmpty {
- self.shareAccounts = accountTemp
- let image = NCUtility().loadImage(named: "person.badge.plus")
- let navigationItem = UIBarButtonItem(image: image, style: .plain, target: self, action: #selector(openShareAccountsViewController(_:)))
- navigationItem.tintColor = textColor
- self.navigationItem.rightBarButtonItem = navigationItem
- }
- }
- }
-
- self.navigationController?.navigationBar.setValue(true, forKey: "hidesShadow")
- view.backgroundColor = NCBrandColor.shared.customer
-
- NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillShow(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
- NotificationCenter.default.addObserver(self, selector: #selector(keyboardWillHide(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
-
- handleLoginWithAppConfig()
- baseUrlTextField.text = urlBase
-
- enforceServersButton.setTitle(NSLocalizedString("_select_server_", comment: ""), for: .normal)
-
- let enforceServers = NCBrandOptions.shared.enforce_servers
-
- if !enforceServers.isEmpty {
- baseUrlTextField.isHidden = true
- enforceServersDropdownImage.isHidden = false
- enforceServersButton.isHidden = false
-
- let actions = enforceServers.map { server in
- UIAction(title: server.name, handler: { [self] _ in
- enforceServersButton.setTitle(server.name, for: .normal)
- baseUrlTextField.text = server.url
- })
- }
-
- enforceServersButton.layer.cornerRadius = 10
- enforceServersButton.menu = .init(title: NSLocalizedString("_servers_", comment: ""), children: actions)
- enforceServersButton.showsMenuAsPrimaryAction = true
- enforceServersButton.configuration?.titleTextAttributesTransformer =
- UIConfigurationTextAttributesTransformer { incoming in
- var outgoing = incoming
- outgoing.font = UIFont.systemFont(ofSize: 13)
- return outgoing
- }
- }
-
- NCNetworking.shared.certificateDelegate = self
- }
-
- override func viewWillAppear(_ animated: Bool) {
- super.viewWillAppear(animated)
-
- if !NCManageDatabase.shared.getAllTableAccount().isEmpty,
- self.navigationController?.viewControllers.count ?? 0 == 1 {
- let navigationItemCancel = UIBarButtonItem(image: UIImage(systemName: "xmark"), style: .plain, target: self, action: #selector(actionCancel(_:)))
- navigationItemCancel.tintColor = textColor
- navigationItem.leftBarButtonItem = navigationItemCancel
- }
- }
-
- override func viewDidAppear(_ animated: Bool) {
- super.viewDidAppear(animated)
-
- if self.shareAccounts != nil,
- let windowScene = view.window?.windowScene {
- let title = String(format: NSLocalizedString("_apps_nextcloud_detect_", comment: ""), NCBrandOptions.shared.brand)
- let subtitle = String(format: NSLocalizedString("_add_existing_account_", comment: ""), NCBrandOptions.shared.brand)
- self.banner = LucidBannerRegistry.shared.banner(for: windowScene)
-
- showAlertActionBanner(lucidBanner: banner,
- windowScene: windowScene,
- title: title,
- subtitle: subtitle) {
- self.openShareAccountsViewController(nil)
- }
- }
- }
-
- override func viewWillDisappear(_ animated: Bool) {
- super.viewWillDisappear(animated)
-
- self.banner?.dismiss()
- }
-
- private func handleLoginWithAppConfig() {
-#if DEBUG
- // Passcode UI tests provision an account through the same API as AppConfig.
- let process = ProcessInfo.processInfo
- let environment = process.environment
- if process.arguments.contains("UI_TESTING"), process.arguments.contains("UI_TESTING_PASSCODE"),
- let server = environment["UI_TESTING_PASSCODE_SERVER"],
- let username = environment["UI_TESTING_PASSCODE_USERNAME"],
- let password = environment["UI_TESTING_PASSCODE_PASSWORD"] {
- Task { await getAppPassword(urlBase: server, user: username, password: password) }
- return
- }
-#endif
- let accountCount = NCManageDatabase.shared.getAccounts()?.count ?? 0
-
- // load AppConfig
- if (NCBrandOptions.shared.disable_multiaccount == false) || (NCBrandOptions.shared.disable_multiaccount == true && accountCount == 0) {
- if let configurationManaged = UserDefaults.standard.dictionary(forKey: "com.apple.configuration.managed"), NCBrandOptions.shared.use_AppConfig {
- if let serverUrl = configurationManaged[NCGlobal.shared.configuration_serverUrl] as? String {
- self.configServerUrl = serverUrl
- }
- if let username = configurationManaged[NCGlobal.shared.configuration_username] as? String, !username.isEmpty, username.lowercased() != "username" {
- self.configUsername = username
- }
- if let password = configurationManaged[NCGlobal.shared.configuration_password] as? String, !password.isEmpty, password.lowercased() != "password" {
- self.configPassword = password
- }
- if let apppassword = configurationManaged[NCGlobal.shared.configuration_apppassword] as? String, !apppassword.isEmpty, apppassword.lowercased() != "apppassword" {
- self.configAppPassword = apppassword
- }
- }
- }
-
- // AppConfig
- if let url = configServerUrl {
- Task {
- if let user = self.configUsername, let password = configAppPassword {
- await createAccount(urlBase: url, user: user, password: password)
- return
- } else if let user = self.configUsername, let password = configPassword {
- await getAppPassword(urlBase: url, user: user, password: password)
- return
- } else {
- urlBase = url
- }
- }
- }
- }
-
- // MARK: - TextField
-
- func textFieldShouldReturn(_ textField: UITextField) -> Bool {
- textField.resignFirstResponder()
- actionButtonLogin(self)
- return false
- }
-
- func textFieldDidBeginEditing(_ textField: UITextField) {
- self.activeTextField = textField
- }
-
- // MARK: - Keyboard notification
-
- @objc internal func keyboardWillShow(_ notification: Notification?) {
- activeTextfieldDiff = 0
- if let info = notification?.userInfo, let centerObject = self.activeTextField.superview?.convert(self.activeTextField.center, to: nil) {
-
- let frameEndUserInfoKey = UIResponder.keyboardFrameEndUserInfoKey
- if let keyboardFrame = info[frameEndUserInfoKey] as? CGRect {
- let diff = keyboardFrame.origin.y - centerObject.y - self.activeTextField.frame.height
- if diff < 0 {
- activeTextfieldDiff = diff
- imageBrandConstraintY.constant += diff
- }
- }
- }
- }
-
- @objc func keyboardWillHide(_ notification: Notification) {
- imageBrandConstraintY.constant -= activeTextfieldDiff
- }
-
- // MARK: - Action
-
- @objc func actionCancel(_ sender: Any?) {
- dismiss(animated: true) { }
- }
-
- @IBAction func actionButtonLogin(_ sender: Any) {
- NCNetworking.shared.p12Data = nil
- NCNetworking.shared.p12Password = nil
- login()
- }
-
- @IBAction func actionQRCode(_ sender: Any) {
- let qrCode = NCLoginQRCode(delegate: self)
- qrCode.scan()
- }
-
- @IBAction func actionCertificate(_ sender: Any) {
-
- }
-
- // MARK: - Share accounts View Controller
-
- @objc func openShareAccountsViewController(_ sender: Any?) {
- if let shareAccounts = self.shareAccounts, let vc = UIStoryboard(name: "NCShareAccounts", bundle: nil).instantiateInitialViewController() as? NCShareAccounts {
- vc.accounts = shareAccounts
- vc.enableTimerProgress = false
- vc.dismissDidEnterBackground = false
- vc.delegate = self
-
- let maximumHeight = view.safeAreaLayoutGuide.layoutFrame.height * 0.8
- let numberCell = shareAccounts.count
- let height = min(CGFloat(numberCell * Int(vc.heightCell) + 45), maximumHeight)
- let popup = NCPopupViewController(contentController: vc, popupWidth: 300, popupHeight: height + 20)
-
- self.present(popup, animated: true)
- }
- }
-
- // MARK: - Login
-
- private func login() {
- guard var url = baseUrlTextField.text?.trimmingCharacters(in: .whitespacesAndNewlines) else { return }
- if url.hasSuffix("/") { url = String(url.dropLast()) }
- if url.isEmpty { return }
-
- attemptLogin(url: url)
- }
-
- private func attemptLogin(url: String) {
- var url = url
-
- if url.hasPrefix("https") == false && url.hasPrefix("http") == false {
- url = "https://" + url
- } else if url.isInsecureHTTPURL {
- url = "https://" + url.dropFirst("http://".count)
- }
-
- self.baseUrlTextField.text = url
- startLogin(url: url)
- }
-
- private func startLogin(url: String) {
- loginButton.isEnabled = false
- loginButton.hideButtonAndShowSpinner()
-
- NextcloudKit.shared.getServerStatus(serverUrl: url) { [self] _, serverInfoResult in
- switch serverInfoResult {
- case .success:
- if let host = URL(string: url)?.host {
- NCNetworking.shared.writeCertificate(host: host)
- }
- let loginOptions = NKRequestOptions(customUserAgent: userAgent)
- NextcloudKit.shared.getLoginFlowV2(serverUrl: url, options: loginOptions) { [self] token, endpoint, login, _, error in
- // Login Flow V2
- if error == .success, let token, let endpoint, let login {
- nkLog(debug: "Successfully received login flow information.")
- let loginProvider = NCLoginProvider()
- loginProvider.initialURLString = login
- loginProvider.delegate = self
- loginProvider.controller = self.controller
- loginProvider.presentingViewController = self
- loginProvider.startPolling(loginFlowV2Token: token, loginFlowV2Endpoint: endpoint, loginFlowV2Login: login)
- loginProvider.startAuthentication()
- self.activeLoginProvider = loginProvider
- } else {
- let loginFlowError = error == .success ? NKError.invalidData : error
-
- nkLog(error: "Login flow v2 failed: \(loginFlowError.logDescription)")
-
- loginButton.hideSpinnerAndShowButton()
- loginButton.isEnabled = true
-
- let alertController = UIAlertController(title: NSLocalizedString("_connection_error_", comment: ""), message: loginFlowError.localizedGenericMessage, preferredStyle: .alert)
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
- self.present(alertController, animated: true, completion: { })
- }
- }
- case .failure(let error):
- loginButton.hideSpinnerAndShowButton()
- loginButton.isEnabled = true
-
- if error.errorCode == NSURLErrorServerCertificateUntrusted {
- let alertController = UIAlertController(title: NSLocalizedString("_ssl_certificate_untrusted_", comment: ""), message: NSLocalizedString("_connect_server_anyway_", comment: ""), preferredStyle: .alert)
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_yes_", comment: ""), style: .default, handler: { _ in
- if let host = URL(string: url)?.host {
- NCNetworking.shared.writeCertificate(host: host)
- }
- }))
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_no_", comment: ""), style: .default, handler: { _ in }))
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_certificate_details_", comment: ""), style: .default, handler: { _ in
- if let navigationController = UIStoryboard(name: "NCViewCertificateDetails", bundle: nil).instantiateInitialViewController() as? UINavigationController,
- let viewController = navigationController.topViewController as? NCViewCertificateDetails {
- if let host = URL(string: url)?.host {
- viewController.host = host
- }
- self.present(navigationController, animated: true)
- }
- }))
- self.present(alertController, animated: true)
- } else if url.lowercased().hasPrefix("https://") {
- let httpUrl = "http://" + url.dropFirst("https://".count)
-
- #if DEBUG
- self.baseUrlTextField.text = httpUrl
- self.startLogin(url: httpUrl)
- #else
- // Any failed https attempt may fall back to plain http, but only with explicit consent.
- let alertController = UIAlertController(title: NSLocalizedString("_warning_", comment: ""),
- message: NSLocalizedString("_https_failed_try_http_", comment: ""),
- preferredStyle: .alert)
-
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel))
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_continue_", comment: ""), style: .destructive) { _ in
- self.baseUrlTextField.text = httpUrl
- self.startLogin(url: httpUrl)
- })
-
- self.present(alertController, animated: true)
- #endif
- } else {
- let alertController = UIAlertController(title: NSLocalizedString("_connection_error_", comment: ""), message: error.localizedGenericMessage, preferredStyle: .alert)
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
- self.present(alertController, animated: true, completion: { })
- }
- }
- }
- }
-
- // MARK: - QRCode
-
- func dismissQRCode(_ value: String?, metadataType: String?) {
- guard let value, !QRCodeCheck else {
- return
- }
- QRCodeCheck = true
-
- Task { @MainActor in
- let protocolLogin = NCBrandOptions.shared.webLoginAutenticationProtocol + "login/"
- let protocolLoginOneTime = NCBrandOptions.shared.webLoginAutenticationProtocol + "onetime-login/"
- var parameters: String = ""
-
- if value.hasPrefix(protocolLoginOneTime) {
- parameters = value.replacingOccurrences(of: protocolLoginOneTime, with: "")
- } else if value.hasPrefix(protocolLogin) {
- parameters = value.replacingOccurrences(of: protocolLogin, with: "")
- } else {
- QRCodeCheck = false
- return
- }
-
- guard parameters.contains("user:"),
- parameters.contains("password:"),
- parameters.contains("server:") else {
- QRCodeCheck = false
- return
- }
- let parametersArray = parameters.components(separatedBy: "&")
- let user = parametersArray[0].replacingOccurrences(of: "user:", with: "")
- let password = parametersArray[1].replacingOccurrences(of: "password:", with: "")
- let server = parametersArray[2].replacingOccurrences(of: "server:", with: "")
-
- if value.hasPrefix(protocolLoginOneTime) {
- let results = await NextcloudKit.shared.getAppPasswordOnetimeAsync(url: server, user: user, onetimeToken: password)
- if results.error == .success, let token = results.token {
- await createAccount(urlBase: server, user: user, password: token)
- } else {
- let windowScene = SceneManager.shared.getWindowScene(controller: self.controller)
-
- let error = results.error == .success ? NKError.invalidData : results.error
-
- await showErrorBanner(windowScene: windowScene, error: error)
- dismiss(animated: true, completion: nil)
- }
- } else if value.hasPrefix(protocolLogin) {
- await self.createAccount(urlBase: server, user: user, password: password)
- }
- }
- }
-
- private func getAppPassword(urlBase: String, user: String, password: String) async {
- let results = await NextcloudKit.shared.getAppPasswordAsync(url: urlBase, user: user, password: password)
-
- if results.error == .success, let password = results.token {
- await self.createAccount(urlBase: urlBase, user: user, password: password)
- } else {
- let windowScene = SceneManager.shared.getWindowScene(controller: self.controller)
-
- let error = results.error == .success ? NKError.invalidData : results.error
-
- await showErrorBanner(windowScene: windowScene, error: error)
- dismiss(animated: true, completion: nil)
- }
- }
-
- @MainActor
- private func createAccount(urlBase: String, user: String, password: String) async {
- if self.controller == nil {
- self.controller = SceneManager.shared.getController(window: UIApplication.shared.mainAppWindow)
- }
-
- if let host = URL(string: urlBase)?.host {
- NCNetworking.shared.writeCertificate(host: host)
- }
-
- await NCAccount().createAccount(viewController: self, urlBase: urlBase, user: user, password: password, controller: self.controller)
- }
-}
-
-// MARK: - NCShareAccountsDelegate
-
-extension NCLogin: NCShareAccountsDelegate {
- func selected(url: String, user: String) {
- attemptLogin(url: url)
- }
-}
-
-// MARK: - UIDocumentPickerDelegate
-
-extension NCLogin: ClientCertificateDelegate, UIDocumentPickerDelegate {
- func didAskForClientCertificate() {
- let alertNoCertFound = UIAlertController(title: NSLocalizedString("_no_client_cert_found_", comment: ""), message: NSLocalizedString("_no_client_cert_found_desc_", comment: ""), preferredStyle: .alert)
- alertNoCertFound.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil))
- alertNoCertFound.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in
- let documentProviderMenu = UIDocumentPickerViewController(forOpeningContentTypes: [UTType.pkcs12])
- documentProviderMenu.delegate = self
- self.present(documentProviderMenu, animated: true, completion: nil)
- }))
- DispatchQueue.main.async {
- self.present(alertNoCertFound, animated: true)
- }
- }
-
- func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
- let alertEnterPassword = UIAlertController(title: NSLocalizedString("_client_cert_enter_password_", comment: ""), message: "", preferredStyle: .alert)
- alertEnterPassword.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil))
- alertEnterPassword.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in
- NCNetworking.shared.p12Data = try? Data(contentsOf: urls[0])
- NCNetworking.shared.p12Password = alertEnterPassword.textFields?[0].text
- self.login()
- }))
- alertEnterPassword.addTextField { textField in
- textField.isSecureTextEntry = true
- }
- DispatchQueue.main.async {
- self.present(alertEnterPassword, animated: true)
- }
- }
-
- func onIncorrectPassword() {
- NCNetworking.shared.p12Data = nil
- NCNetworking.shared.p12Password = nil
- let alertWrongPassword = UIAlertController(title: NSLocalizedString("_client_cert_wrong_password_", comment: ""), message: "", preferredStyle: .alert)
- alertWrongPassword.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default))
- DispatchQueue.main.async {
- self.present(alertWrongPassword, animated: true)
- }
- }
-}
-
-// MARK: - NCLoginProviderDelegate
-
-extension NCLogin: NCLoginProviderDelegate {
- func onBack() {
- loginButton.isEnabled = true
- loginButton.hideSpinnerAndShowButton()
- activeLoginProvider?.cancel()
- activeLoginProvider = nil
- }
-}
diff --git a/iOSClient/Login/NCLoginAppConfig.swift b/iOSClient/Login/NCLoginAppConfig.swift
new file mode 100644
index 0000000000..fccba236e2
--- /dev/null
+++ b/iOSClient/Login/NCLoginAppConfig.swift
@@ -0,0 +1,53 @@
+// SPDX-FileCopyrightText: Nextcloud GmbH
+// SPDX-FileCopyrightText: 2026 Milen Pivchev
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import Foundation
+
+/// Login values from the managed app configuration (MDM).
+enum NCLoginAppConfig {
+ enum Action: Equatable {
+ case createAccount(serverURL: String, user: String, appPassword: String)
+ case requestAppPassword(serverURL: String, user: String, password: String)
+ case prefill(serverURL: String)
+ }
+
+ static func action(managed: [String: Any]?, useAppConfig: Bool, disableMultiaccount: Bool, accountCount: Int) -> Action? {
+ guard useAppConfig,
+ let managed,
+ disableMultiaccount == false || accountCount == 0 else {
+ return nil
+ }
+
+ let global = NCGlobal.shared
+
+ guard let serverURL = value(in: managed, for: global.configuration_serverUrl, placeholder: nil) else { return nil }
+
+ let user = value(in: managed, for: global.configuration_username, placeholder: "username")
+ let password = value(in: managed, for: global.configuration_password, placeholder: "password", trimming: false)
+ let appPassword = value(in: managed, for: global.configuration_apppassword, placeholder: "apppassword")
+
+ if let user, let appPassword {
+ return .createAccount(serverURL: serverURL, user: user, appPassword: appPassword)
+ }
+
+ if let user, let password {
+ return .requestAppPassword(serverURL: serverURL, user: user, password: password)
+ }
+
+ return .prefill(serverURL: serverURL)
+ }
+
+ /// MDM templates ship the key name as a placeholder value. Only passwords keep surrounding whitespace.
+ private static func value(in managed: [String: Any], for key: String, placeholder: String?, trimming: Bool = true) -> String? {
+ guard var value = managed[key] as? String else { return nil }
+
+ if trimming {
+ value = value.trimmingCharacters(in: .whitespacesAndNewlines)
+ }
+
+ guard !value.isEmpty, value.lowercased() != placeholder else { return nil }
+
+ return value
+ }
+}
diff --git a/iOSClient/Login/NCLoginProvider.swift b/iOSClient/Login/NCLoginProvider.swift
deleted file mode 100644
index 405f4429b8..0000000000
--- a/iOSClient/Login/NCLoginProvider.swift
+++ /dev/null
@@ -1,401 +0,0 @@
-// SPDX-FileCopyrightText: Nextcloud GmbH
-// SPDX-FileCopyrightText: 2025 Iva Horn
-// SPDX-FileCopyrightText: 2025 Milen Pivchev
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-import AuthenticationServices
-import UIKit
-@preconcurrency import WebKit
-import NextcloudKit
-
-protocol NCLoginProviderDelegate: AnyObject {
- ///
- /// Called when the authentication is cancelled or fails.
- ///
- func onBack()
-}
-
-///
-/// Handles login authentication using ASWebAuthenticationSession with WKWebView fallback for mTLS.
-///
-class NCLoginProvider: NSObject, ASWebAuthenticationPresentationContextProviding {
- var initialURLString = ""
- weak var delegate: NCLoginProviderDelegate?
- var controller: NCMainTabBarController?
-
- /// The presenting view controller for the authentication session.
- weak var presentingViewController: UIViewController?
-
- /// The active authentication session.
- private var authSession: ASWebAuthenticationSession?
-
- /// Fallback web view controller for mTLS/certificate handling.
- private var webViewFallbackVC: NCLoginProviderWebViewFallback?
-
- ///
- /// A polling loop active in the background to check for the current status of the login flow.
- ///
- var pollingTask: Task?
-
- // MARK: - ASWebAuthenticationPresentationContextProviding
-
- func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
- return presentingViewController?.view.window ?? UIApplication.shared.mainAppWindow ?? ASPresentationAnchor()
- }
-
- // MARK: - Authentication
-
- ///
- /// Start the authentication flow using ASWebAuthenticationSession.
- /// Falls back to WKWebView if authentication fails (e.g., asked for mTLS cert etc).
- ///
- func startAuthentication() {
- guard let url = URL(string: initialURLString) else {
- Task {
- let windowScene = SceneManager.shared.getWindowScene(controller: self.controller)
- await showErrorBanner(windowScene: windowScene, text: "_login_url_error_", errorCode: NCGlobal.shared.errorInternalError)
- }
- return
- }
-
- // Use custom URL scheme to handle login callbacks (e.g., nc://login/...)
- let callbackScheme = NCBrandOptions.shared.webLoginAutenticationProtocol.replacingOccurrences(of: "://", with: "")
-
- authSession = ASWebAuthenticationSession(url: url, callbackURLScheme: callbackScheme) { [weak self] callbackURL, error in
- guard let self else { return }
-
- if let error = error {
- if let asError = error as? ASWebAuthenticationSessionError, asError.code == .canceledLogin {
- // Only treat as user cancellation if polling hasn't succeeded yet
- if self.pollingTask != nil {
- Task { @MainActor in
- self.delegate?.onBack()
- }
- }
- } else {
- // Fall back to WKWebView for other errors (e.g., certificate issues)
- Task { @MainActor in
- self.fallbackToWebView(url: url)
- }
- }
- return
- }
-
- // Handle login callback URL (e.g., nc://login/server:...&user:...&password:...)
- if let callbackURL {
- self.handleLoginCallback(url: callbackURL)
- }
- }
-
- authSession?.presentationContextProvider = self
- authSession?.prefersEphemeralWebBrowserSession = true
-
- if authSession?.start() != true {
- // Fall back to WKWebView if ASWebAuthenticationSession fails to start
- fallbackToWebView(url: url)
- }
- }
-
- ///
- /// Cancel the authentication session and clean up.
- ///
- func cancel() {
- authSession?.cancel()
- authSession = nil
-
- webViewFallbackVC?.dismiss(animated: true)
- webViewFallbackVC = nil
-
- pollingTask?.cancel()
- pollingTask = nil
- }
-
- // MARK: - WKWebView Fallback
-
- ///
- /// Present WKWebView as a fallback for mTLS/certificate handling.
- ///
- private func fallbackToWebView(url: URL) {
- authSession?.cancel()
- authSession = nil
-
- guard let presentingVC = presentingViewController else { return }
-
- let fallbackVC = NCLoginProviderWebViewFallback()
- fallbackVC.initialURL = url
- fallbackVC.initialURLString = initialURLString
- fallbackVC.controller = controller
- fallbackVC.loginProvider = self
-
- let navController = UINavigationController(rootViewController: fallbackVC)
- navController.modalPresentationStyle = .fullScreen
-
- presentingVC.present(navController, animated: true)
- self.webViewFallbackVC = fallbackVC
- }
-
- ///
- /// Handle the login callback URL from the authentication session.
- ///
- func handleLoginCallback(url: URL) {
- let urlString = url.absoluteString.lowercased()
-
- // Check if this is a login callback
- guard urlString.hasPrefix(NCBrandOptions.shared.webLoginAutenticationProtocol) && urlString.contains("login") else {
- return
- }
-
- var server: String = ""
- var user: String = ""
- var password: String = ""
- let keyValue = url.path.components(separatedBy: "&")
-
- for value in keyValue {
- if value.contains("server:") { server = value }
- if value.contains("user:") { user = value }
- if value.contains("password:") { password = value }
- }
-
- if !server.isEmpty, !user.isEmpty, !password.isEmpty {
- let server = server.replacingOccurrences(of: "/server:", with: "")
- let username = user.replacingOccurrences(of: "user:", with: "").replacingOccurrences(of: "+", with: " ")
- let password = password.replacingOccurrences(of: "password:", with: "")
-
- // Stop polling since we got credentials from callback
- pollingTask?.cancel()
- pollingTask = nil
-
- // Dismiss fallback web view if present
- webViewFallbackVC?.dismiss(animated: true)
- webViewFallbackVC = nil
-
- if self.controller == nil {
- self.controller = SceneManager.shared.getController(window: UIApplication.shared.mainAppWindow)
- }
-
- Task { @MainActor in
- guard let viewController = self.presentingViewController else { return }
- await NCAccount().createAccount(viewController: viewController, urlBase: server, user: username, password: password, controller: self.controller)
- }
- }
- }
-
- // MARK: - Polling
-
- ///
- /// Start checking the status of the login flow in the background periodically.
- ///
- func startPolling(loginFlowV2Token: String, loginFlowV2Endpoint: String, loginFlowV2Login: String) {
- nkLog(start: "Starting polling at \(loginFlowV2Endpoint) with token \(loginFlowV2Token)")
- pollingTask = createPollingTask(token: loginFlowV2Token, endpoint: loginFlowV2Endpoint)
- nkLog(debug: "Polling task created.")
- }
-
- ///
- /// Fetch the server response and process it.
- ///
- private func poll(token: String, endpoint: String, options: NKRequestOptions) async -> (urlBase: String, loginName: String, appPassword: String)? {
- await withCheckedContinuation { continuation in
- NextcloudKit.shared.getLoginFlowV2Poll(token: token, endpoint: endpoint, options: options) { server, loginName, appPassword, _, error in
-
- guard error == .success else {
- continuation.resume(returning: nil)
- return
- }
-
- guard let urlBase = server else {
- nkLog(error: "Login poll response field for server for token \"\(token)\" is nil!")
- continuation.resume(returning: nil)
- return
- }
-
- guard let user = loginName else {
- nkLog(error: "Login poll response field for user name for token \"\(token)\" is nil!")
- continuation.resume(returning: nil)
- return
- }
-
- guard let appPassword = appPassword else {
- nkLog(error: "Login poll response field for app password for token \"\(token)\" is nil!")
- continuation.resume(returning: nil)
- return
- }
-
- nkLog(debug: "Returning login poll response for \"\(user)\" on \"\(urlBase)\" for token \"\(token)\".")
- continuation.resume(returning: (urlBase, user, appPassword))
- }
- }
- }
-
- ///
- /// Handle login when polling is successful and access is granted.
- ///
- private func handleGrant(urlBase: String, loginName: String, appPassword: String) async {
- nkLog(debug: "Handling login grant values for \(loginName) on \(urlBase)")
-
- // Cancel the auth session since login was successful
- authSession?.cancel()
- authSession = nil
-
- // Dismiss fallback web view if present
- webViewFallbackVC?.dismiss(animated: true)
- webViewFallbackVC = nil
-
- if controller == nil {
- nkLog(debug: "View controller is still undefined, will resolve root view controller of first window.")
- controller = SceneManager.shared.getController(window: UIApplication.shared.mainAppWindow)
- }
-
- guard let viewController = presentingViewController else {
- nkLog(error: "No presenting view controller available for account creation.")
- return
- }
-
- await NCAccount().createAccount(viewController: viewController, urlBase: urlBase, user: loginName, password: appPassword, controller: controller)
- nkLog(debug: "Account creation for \(loginName) on \(urlBase) completed based on login grant values.")
- }
-
- ///
- /// Sets up polling.
- ///
- private func createPollingTask(token: String, endpoint: String) -> Task {
- let options = NKRequestOptions(customUserAgent: userAgent)
- var grantValues: (urlBase: String, loginName: String, appPassword: String)?
-
- return Task { @MainActor in
- repeat {
- try Task.checkCancellation()
-
- grantValues = await poll(token: token, endpoint: endpoint, options: options)
- try await Task.sleep(for: .seconds(1))
- } while grantValues == nil
-
- guard let grantValues else {
- return
- }
-
- // Clear the polling task before handling grant to prevent cancellation callback
- self.pollingTask = nil
-
- await handleGrant(urlBase: grantValues.urlBase, loginName: grantValues.loginName, appPassword: grantValues.appPassword)
- nkLog(debug: "Polling task completed.")
- }
- }
-}
-
-// MARK: - WKWebView Fallback View Controller
-
-///
-/// Fallback view controller using WKWebView for mTLS/certificate handling.
-///
-class NCLoginProviderWebViewFallback: UIViewController, WKNavigationDelegate {
- var initialURL: URL?
- var initialURLString = ""
- var controller: NCMainTabBarController?
- weak var loginProvider: NCLoginProvider?
-
- private var webView: WKWebView!
-
- override func viewDidLoad() {
- super.viewDidLoad()
-
- view.backgroundColor = NCBrandColor.shared.customer
-
- // Navigation bar
- let closeButton = UIBarButtonItem(image: UIImage(systemName: "xmark"), style: .plain, target: self, action: #selector(closeTapped))
- closeButton.tintColor = .white
- navigationItem.leftBarButtonItem = closeButton
-
- if let host = initialURL?.host {
- title = host
- }
-
- // Web view setup
- let configuration = WKWebViewConfiguration()
- configuration.websiteDataStore = WKWebsiteDataStore.nonPersistent()
-
- webView = WKWebView(frame: .zero, configuration: configuration)
- webView.customUserAgent = userAgent
- webView.navigationDelegate = self
- view.addSubview(webView)
-
- webView.translatesAutoresizingMaskIntoConstraints = false
- NSLayoutConstraint.activate([
- webView.leadingAnchor.constraint(equalTo: view.leadingAnchor),
- webView.trailingAnchor.constraint(equalTo: view.trailingAnchor),
- webView.topAnchor.constraint(equalTo: view.topAnchor),
- webView.bottomAnchor.constraint(equalTo: view.bottomAnchor)
- ])
-
- if let url = initialURL {
- loadWebPage(url: url)
- }
- }
-
- @objc private func closeTapped() {
- loginProvider?.delegate?.onBack()
- dismiss(animated: true)
- }
-
- private func loadWebPage(url: URL) {
- let language = NSLocale.preferredLanguages[0] as String
- var request = URLRequest(url: url)
-
- request.addValue("true", forHTTPHeaderField: "OCS-APIRequest")
- request.addValue(language, forHTTPHeaderField: "Accept-Language")
-
- webView.load(request)
- }
-
- // MARK: - WKNavigationDelegate
-
- func webView(_ webView: WKWebView, didReceiveServerRedirectForProvisionalNavigation navigation: WKNavigation!) {
- guard let currentWebViewURL = webView.url else { return }
-
- let currentWebViewURLString = currentWebViewURL.absoluteString.lowercased()
-
- // Prevent HTTP redirects
- if initialURLString.lowercased().hasPrefix("https://") && currentWebViewURLString.hasPrefix("http://") {
- let alertController = UIAlertController(
- title: NSLocalizedString("_error_", comment: ""),
- message: NSLocalizedString("_prevent_http_redirection_", comment: ""),
- preferredStyle: .alert
- )
- alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { _ in
- self.dismiss(animated: true)
- })
- present(alertController, animated: true)
- return
- }
-
- // Login via provider
- if currentWebViewURLString.hasPrefix(NCBrandOptions.shared.webLoginAutenticationProtocol) && currentWebViewURLString.contains("login") {
- loginProvider?.handleLoginCallback(url: currentWebViewURL)
- }
- }
-
- func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
- DispatchQueue.global().async {
- if let serverTrust = challenge.protectionSpace.serverTrust {
- completionHandler(.useCredential, URLCredential(trust: serverTrust))
- } else {
- completionHandler(.useCredential, nil)
- }
- }
- }
-
- func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {
- nkLog(debug: "Web view will allow navigation to \(navigationAction.request.url?.absoluteString ?? "nil")")
- decisionHandler(.allow)
- }
-
- func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) {
- nkLog(debug: "Web view did start provisional navigation.")
- NCActivityIndicator.shared.startActivity(backgroundView: view, style: .medium, blurEffect: false)
- }
-
- func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
- nkLog(debug: "Web view did finish navigation to \(webView.url?.absoluteString ?? "nil")")
- NCActivityIndicator.shared.stop()
- }
-}
diff --git a/iOSClient/Login/NCLoginQRCode.swift b/iOSClient/Login/NCLoginQRCode.swift
deleted file mode 100644
index 64c6ea97ef..0000000000
--- a/iOSClient/Login/NCLoginQRCode.swift
+++ /dev/null
@@ -1,81 +0,0 @@
-// SPDX-FileCopyrightText: Nextcloud GmbH
-// SPDX-FileCopyrightText: 2019 Marino Faggiana
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-import UIKit
-import QRCodeReader
-
-@objc public protocol NCLoginQRCodeDelegate {
- @objc func dismissQRCode(_ value: String?, metadataType: String?)
-}
-
-class NCLoginQRCode: NSObject, QRCodeReaderViewControllerDelegate {
- lazy var reader: QRCodeReader = QRCodeReader()
- weak var delegate: UIViewController?
- lazy var readerVC: QRCodeReaderViewController = {
- let builder = QRCodeReaderViewControllerBuilder {
- $0.reader = QRCodeReader(metadataObjectTypes: [.qr], captureDevicePosition: .back)
- $0.showTorchButton = true
- $0.preferredStatusBarStyle = .lightContent
- $0.showOverlayView = true
- $0.rectOfInterest = CGRect(x: 0.2, y: 0.2, width: 0.6, height: 0.6)
-
- $0.reader.stopScanningWhenCodeIsFound = false
- }
- return QRCodeReaderViewController(builder: builder)
- }()
-
- override init() { }
-
- @objc public init(delegate: UIViewController) {
- self.delegate = delegate
- }
-
- @objc func scan() {
- guard checkScanPermissions() else { return }
-
- readerVC.modalPresentationStyle = .formSheet
- readerVC.delegate = self
-
- readerVC.completionBlock = { (_: QRCodeReaderResult?) in
- self.readerVC.dismiss(animated: true, completion: nil)
- }
- delegate?.present(readerVC, animated: true, completion: nil)
- }
-
- private func checkScanPermissions() -> Bool {
- do {
- return try QRCodeReader.supportsMetadataObjectTypes()
- } catch let error as NSError {
- let alert: UIAlertController
- switch error.code {
- case -11852:
- alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_qrcode_not_authorized_", comment: ""), preferredStyle: .alert)
- alert.addAction(UIAlertAction(title: NSLocalizedString("_settings_", comment: ""), style: .default, handler: { _ in
- DispatchQueue.main.async {
- if let settingsURL = URL(string: UIApplication.openSettingsURLString) {
- UIApplication.shared.open(settingsURL, options: [:], completionHandler: nil)
- }
- }
- }))
-
- alert.addAction(UIAlertAction(title: NSLocalizedString("_cancel_", comment: ""), style: .cancel, handler: nil))
- default:
- alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_qrcode_not_supported_", comment: ""), preferredStyle: .alert)
- alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .cancel, handler: nil))
- }
- delegate?.present(alert, animated: true, completion: nil)
- return false
- }
- }
-
- func reader(_ reader: QRCodeReaderViewController, didScanResult result: QRCodeReaderResult) {
- reader.stopScanning()
- (self.delegate as? NCLoginQRCodeDelegate)?.dismissQRCode(result.value, metadataType: result.metadataType)
- }
-
- func readerDidCancel(_ reader: QRCodeReaderViewController) {
- reader.stopScanning()
- (self.delegate as? NCLoginQRCodeDelegate)?.dismissQRCode(nil, metadataType: nil)
- }
-}
diff --git a/iOSClient/Login/NCLoginServerErrorClassifier.swift b/iOSClient/Login/NCLoginServerErrorClassifier.swift
new file mode 100644
index 0000000000..c3006b6c20
--- /dev/null
+++ b/iOSClient/Login/NCLoginServerErrorClassifier.swift
@@ -0,0 +1,49 @@
+// SPDX-FileCopyrightText: Nextcloud GmbH
+// SPDX-FileCopyrightText: 2026 Milen Pivchev
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+import Foundation
+import NextcloudKit
+
+/// Decides how the login reacts to a failed server status check.
+enum NCLoginServerErrorClassifier {
+ enum Resolution: Equatable {
+ case untrustedCertificate(host: String)
+ case insecureFallback(URL)
+ case generic
+ }
+
+ private static let certificateErrorCodes = [
+ NSURLErrorServerCertificateUntrusted,
+ NSURLErrorServerCertificateHasBadDate,
+ NSURLErrorServerCertificateHasUnknownRoot,
+ NSURLErrorServerCertificateNotYetValid
+ ]
+
+ /// The host name does not exist, which plain http can't change.
+ private static let unknownHostErrorCodes = [
+ NSURLErrorCannotFindHost,
+ NSURLErrorDNSLookupFailed
+ ]
+
+ static func classify(_ error: NKError, serverURL: URL) -> Resolution {
+ if certificateErrorCodes.contains(error.errorCode), let host = serverURL.host {
+ return .untrustedCertificate(host: host)
+ }
+
+ // Other failed https attempts may fall back to plain http, unless there is no network or no such host.
+ guard error.kind != .cancelled,
+ error.kind != .offline,
+ !unknownHostErrorCodes.contains(error.errorCode),
+ serverURL.scheme?.lowercased() == "https",
+ var components = URLComponents(url: serverURL, resolvingAgainstBaseURL: false) else {
+ return .generic
+ }
+
+ components.scheme = "http"
+
+ guard let httpURL = components.url else { return .generic }
+
+ return .insecureFallback(httpURL)
+ }
+}
diff --git a/iOSClient/Login/NCViewCertificateDetails.swift b/iOSClient/Login/NCViewCertificateDetails.swift
index 46bd3cdf01..42fb3f5f89 100644
--- a/iOSClient/Login/NCViewCertificateDetails.swift
+++ b/iOSClient/Login/NCViewCertificateDetails.swift
@@ -5,22 +5,14 @@
import UIKit
import SwiftUI
-public protocol NCViewCertificateDetailsDelegate: AnyObject {
- func viewCertificateDetailsDismiss(host: String)
-}
-
-// optional func
-public extension NCViewCertificateDetailsDelegate {
- func viewCertificateDetailsDismiss(host: String) {}
-}
-
class NCViewCertificateDetails: UIViewController {
@IBOutlet weak var buttonCancel: UIBarButtonItem!
@IBOutlet weak var scrollView: UIScrollView!
@IBOutlet weak var textView: UITextView!
@IBOutlet weak var privateKey: UILabel!
- var delegate: NCViewCertificateDetailsDelegate?
+ /// Called when the details close, also when they close themselves.
+ var onClose: (() -> Void)?
let utilityFileSystem = NCUtilityFileSystem()
public var privateKeyString: String = ""
@@ -84,7 +76,7 @@ class NCViewCertificateDetails: UIViewController {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
- self.delegate?.viewCertificateDetailsDismiss(host: host)
+ onClose?()
}
// MARK: ACTION
@@ -101,6 +93,8 @@ struct certificateDetailsView: UIViewControllerRepresentable {
var privateKeyString: String = ""
var host: String = ""
var title: String = ""
+ /// Called when the details close, also when they close themselves.
+ var onClose: (() -> Void)?
func makeUIViewController(context: Context) -> UINavigationController {
let storyboard = UIStoryboard(name: "NCViewCertificateDetails", bundle: nil)
@@ -110,6 +104,7 @@ struct certificateDetailsView: UIViewControllerRepresentable {
viewController?.privateKeyString = privateKeyString
viewController?.host = host
viewController?.certificateTitle = title
+ viewController?.onClose = onClose
return navigationController!
}
diff --git a/iOSClient/NCGlobal.swift b/iOSClient/NCGlobal.swift
index 4c5ffed945..010b5404f5 100644
--- a/iOSClient/NCGlobal.swift
+++ b/iOSClient/NCGlobal.swift
@@ -48,11 +48,6 @@ final class NCGlobal: Sendable {
let editorOnlyOffice: String = "onlyoffice"
let editorWhiteboard: String = "whiteboard"
- // Intro selector
- //
- let introLogin: Int = 0
- let introSignUpWithProvider: Int = 1
-
// Avatar
//
// Shared download resolution for a 128-point avatar at 3x scale, also used without a UI context.
diff --git a/iOSClient/Networking/NCErrorContext.swift b/iOSClient/Networking/NCErrorContext.swift
index ffcd89d8f7..e6d23d9a30 100644
--- a/iOSClient/Networking/NCErrorContext.swift
+++ b/iOSClient/Networking/NCErrorContext.swift
@@ -16,6 +16,7 @@ enum NCErrorContext: Equatable {
case favorite(fileName: String)
case createDocument(fileName: String)
case openDocument(fileName: String)
+ case login
/// The context of a transfer event, from its `networkingStatus`.
init(networkingStatus: String, fileName: String) {
@@ -111,6 +112,9 @@ enum NCErrorContext: Equatable {
case .openDocument(let fileName):
return String(format: NSLocalizedString("_error_title_open_document_", comment: ""), fileName)
+
+ case .login:
+ return NSLocalizedString("_error_title_login_", comment: "")
}
}
}
diff --git a/iOSClient/Networking/NCNetworking.swift b/iOSClient/Networking/NCNetworking.swift
index 9e4e518436..5fd0564822 100644
--- a/iOSClient/Networking/NCNetworking.swift
+++ b/iOSClient/Networking/NCNetworking.swift
@@ -11,11 +11,6 @@ import UIKit
import NextcloudKit
import Alamofire
-protocol ClientCertificateDelegate: AnyObject {
- func onIncorrectPassword()
- func didAskForClientCertificate()
-}
-
protocol NCTransferDelegate: AnyObject {
var sceneIdentifier: String { get }
@@ -72,7 +67,6 @@ class NCNetworking: @unchecked Sendable, NextcloudKitDelegate {
var lastReachability: Bool = true
var networkReachability: NKTypeReachability?
- weak var certificateDelegate: ClientCertificateDelegate?
var p12Data: Data?
var p12Password: String?
@@ -123,12 +117,11 @@ class NCNetworking: @unchecked Sendable, NextcloudKitDelegate {
if let p12Data = self.p12Data,
let cert = (p12Data, self.p12Password) as? UserCertificate,
let pkcs12 = try? PKCS12(pkcs12Data: cert.data, password: cert.password, onIncorrectPassword: {
- self.certificateDelegate?.onIncorrectPassword()
+ nkLog(error: "The client certificate password is incorrect.")
}) {
let creds = PKCS12.urlCredential(for: pkcs12)
completionHandler(URLSession.AuthChallengeDisposition.useCredential, creds)
} else {
- self.certificateDelegate?.didAskForClientCertificate()
completionHandler(URLSession.AuthChallengeDisposition.cancelAuthenticationChallenge, nil)
}
} else {
diff --git a/iOSClient/Networking/NKError+UserFriendlyMessage.swift b/iOSClient/Networking/NKError+UserFriendlyMessage.swift
index 45b4b4815c..cfcc4ac67f 100644
--- a/iOSClient/Networking/NKError+UserFriendlyMessage.swift
+++ b/iOSClient/Networking/NKError+UserFriendlyMessage.swift
@@ -45,6 +45,10 @@ extension NKError {
case (.createDocument, .forbidden), (.openDocument, .forbidden):
return NSLocalizedString("_error_occurred_", comment: "")
+ // While logging in, a 404 means the address has no Nextcloud server, not a missing file.
+ case (.login, .notFound):
+ return NSLocalizedString("_error_login_server_not_found_", comment: "")
+
default:
return nil
}
diff --git a/iOSClient/SceneDelegate.swift b/iOSClient/SceneDelegate.swift
index bed47795dc..eba1dd238e 100644
--- a/iOSClient/SceneDelegate.swift
+++ b/iOSClient/SceneDelegate.swift
@@ -130,18 +130,8 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
UserDefaults.standard.removePersistentDomain(forName: bundleID)
}
- if NCBrandOptions.shared.disable_intro {
- if let viewController = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLogin") as? NCLogin {
- let navigationController = UINavigationController(rootViewController: viewController)
- window?.rootViewController = navigationController
- window?.makeKeyAndVisible()
- }
- } else {
- if let navigationController = UIStoryboard(name: "NCIntro", bundle: nil).instantiateInitialViewController() as? UINavigationController {
- window?.rootViewController = navigationController
- window?.makeKeyAndVisible()
- }
- }
+ window?.rootViewController = NCAccountSetupView.viewController()
+ window?.makeKeyAndVisible()
}
}
diff --git a/iOSClient/Settings/Acknowledgements.rtf b/iOSClient/Settings/Acknowledgements.rtf
index 9ca49c01cb..2469e848b0 100644
--- a/iOSClient/Settings/Acknowledgements.rtf
+++ b/iOSClient/Settings/Acknowledgements.rtf
@@ -303,18 +303,6 @@ License: https://github.com/google/promises/blob/f4a19a3c313dc2616c70bb49d29a799
__________________________________\
\
-\f1\b QRCodeReader.swift\f0\b0\
-\
-https://github.com/yannickl/QRCodeReader.swift\
-\
-MIT License\
-\
-Copyright (c) 2014-present Yannick Loriot\
-\
-License: https://github.com/yannickl/QRCodeReader.swift/blob/5020b5a47199d8ba80c83a4b4fafd70e9dc9dc7f/LICENSE\
-__________________________________\
-\
-
\f1\b Realm Core\f0\b0\
\
https://github.com/realm/realm-core\
diff --git a/iOSClient/Settings/NCPreferences.swift b/iOSClient/Settings/NCPreferences.swift
index fd07152e5d..73d1bcae43 100644
--- a/iOSClient/Settings/NCPreferences.swift
+++ b/iOSClient/Settings/NCPreferences.swift
@@ -37,6 +37,15 @@ final class NCPreferences: NSObject {
}
}
+ var hasSeenOnboarding: Bool {
+ get {
+ return getBoolPreference(key: "hasSeenOnboarding", defaultValue: false)
+ }
+ set {
+ setUserDefaults(newValue, forKey: "hasSeenOnboarding")
+ }
+ }
+
var showRecommendedFiles: Bool {
get {
return getBoolPreference(key: "showRecommendedFiles", defaultValue: true)
diff --git a/iOSClient/Supporting Files/en.lproj/Localizable.strings b/iOSClient/Supporting Files/en.lproj/Localizable.strings
index 75a737c0a9..895eaa4bee 100644
--- a/iOSClient/Supporting Files/en.lproj/Localizable.strings
+++ b/iOSClient/Supporting Files/en.lproj/Localizable.strings
@@ -142,10 +142,8 @@
"_privacy_legal_" = "Privacy and Legal Policy";
"_source_code_" = "Get source code";
"_account_select_" = "Select the account";
-"_account_select_to_add_" = "Select the account to add";
"_remove_local_account_" = "Remove local account";
"_want_delete_account_" = "Do you want to remove local account?";
-"_prevent_http_redirection_"= "The redirection in HTTP is not permitted.";
"_http_account_insecure_" = "This account uses an insecure HTTP server address. Data is transmitted unencrypted.";
"_https_failed_try_http_" = "A secure connection could not be established. Do you want to try insecure HTTP instead? Your data will be transmitted unencrypted.";
"_single_file_conflict_title_" = "File conflict";
@@ -267,9 +265,6 @@
"_set_log_level_" = "Set Log level";
"_connect_server_anyway_" = "Do you want to connect to the server anyway?";
"_server_is_trusted_" = "Do you consider this server trusted?";
-"_connection_error_" = "Connection error";
-"_login_url_" = "Server address https:// …";
-"_login_url_error_" = "URL error, please verify your server URL";
"_favorites_" = "Favorites";
"_favorite_short_" = "Favorite";
"_tutorial_favorite_view_" = "Files and folders you mark as favorites will show up here";
@@ -343,7 +338,6 @@
"_good_afternoon_" = "Good afternoon";
"_good_evening_" = "Good evening";
"_good_night_" = "Good night";
-"_servers_" = "Servers";
"_select_server_" = "Please select a server...";
// MARK: Share
@@ -454,11 +448,11 @@
"_create_new_diagram_" = "Diagram";
"_more_documents_" = "More Documents";
"_go_online_" = "Go online to see the document";
+"_onboarding_title_" = "Welcome to %@";
"_intro_1_title_" = "Keep your data secure and under your control";
"_intro_2_title_" = "Secure collaboration & file exchange";
"_intro_3_title_" = "Easy-to-use web mail, calendaring & contacts";
"_intro_4_title_" = "Screen sharing, online meetings & web conferences";
-"_log_in_" = "Log in";
"_sign_up_" = "Sign up with provider";
"_host_your_own_server_" = "Host your own server";
"_ssl_certificate_untrusted_" = "The certificate for this server is invalid.";
@@ -466,8 +460,6 @@
"_file_already_exists_" = "Could not complete the operation, a file with the same name exists.";
"_err_permission_microphone_" = "Please allow Microphone usage from Settings.";
"_err_permission_photolibrary_" = "Please allow Photos from Settings.";
-"_qrcode_not_authorized_" = "This app is not authorized to use the Back Camera.";
-"_qrcode_not_supported_" = "QR code not supported by the current device.";
"_create_voice_memo_" = "Create voice memo";
"_voice_memo_start_" = "Tap to start";
"_voice_memo_stop_" = "Tap to stop";
@@ -498,6 +490,7 @@
"_monthly_" = "Monthly";
"_yearly_" = "Yearly";
"_daily_" = "Daily";
+"_login_url_" = "Server address https:// …";
"_login_address_detail_" = "The link to your %@ web interface when you open it in the browser.";
"_go_to_page_" = "Go to page";
"_page_" = "Page";
@@ -528,8 +521,6 @@
"_description_lockscreenwidget_" = "Keep an eye on available space and recent activity";
"_keep_running_" = "Keep the app running for a better user experience.";
-"_apps_nextcloud_detect_" = "Detected %@ apps";
-"_add_existing_account_" = "Other %@ Apps has been detected, do you want to add an existing account?";
"_status_in_progress_" = "Status reading in progress …";
"_status_e2ee_on_server_" = "The end-to-end encryption is already configured in the server but not yet enabled on this device.";
"_status_e2ee_not_setup_" = "The end-to-end encryption is not yet configured on the server.";
@@ -676,14 +667,6 @@
"_assistant_error_load_messages_" = "Could not load messages. Please try again.";
"_assistant_error_generate_response_" = "Could not generate response. Please try again.";
-// MARK: Client certificate
-"_no_client_cert_found_" = "The server is requesting a client certificate.";
-"_no_client_cert_found_desc_" = "Do you want to install a TLS client certificate? \n Note that the .p12 certificate must be installed on your device first by clicking on it and installing it as an Identitity Certificate Profile in Settings. The certificate MUST also have a password as that is a requirement by iOS.";
-"_client_cert_enter_password_" = "Enter the password for the chosen certificate";
-"_client_cert_wrong_password_" = "Sorry, you entered an invalid password.";
-
-// MARK: Login poll
-
// MARK: File name validator
"_file_name_validator_error_reserved_name_" = "\"%@\" is a forbidden name.";
"_file_name_new_extension_" = "Changing the extension might cause this file to open in a different application.";
@@ -884,5 +867,7 @@
"_error_title_favorite_" = "Couldn't update the favorite for “%@”";
"_error_title_create_document_" = "Couldn't create “%@”";
"_error_title_open_document_" = "Couldn't open “%@”";
+"_error_title_login_" = "Couldn't log in";
"_error_password_incorrect_" = "The password is incorrect.";
"_error_file_busy_" = "The file is still being transferred. Try again later.";
+"_error_login_server_not_found_" = "No server was found at this address.";