Skip to content

Commit e97f47b

Browse files
author
Marino Faggiana
authored
New version 5.4.0 (#2966)
Signed-off-by: Marino Faggiana <[email protected]> Signed-off-by: Milen Pivchev <[email protected]> Signed-off-by: Nextcloud bot <[email protected]>
1 parent aa28af8 commit e97f47b

File tree

345 files changed

+6623
-7945
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

345 files changed

+6623
-7945
lines changed

.swiftlint.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ disabled_rules:
3636
- shorthand_operator
3737
- type_name
3838
- void_function_in_ternary
39-
39+
- switch_case_alignment
4040
excluded:
4141
- Carthage
4242
- Pods

Brand/Database.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ import Foundation
2626
// Database Realm
2727
//
2828
let databaseName = "nextcloud.realm"
29-
let databaseSchemaVersion: UInt64 = 347
29+
let databaseSchemaVersion: UInt64 = 348

Brand/Intro/NCIntroViewController.swift

+18-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class NCIntroViewController: UIViewController, UICollectionViewDataSource, UICol
3333
@IBOutlet weak var introCollectionView: UICollectionView!
3434
@IBOutlet weak var pageControl: UIPageControl!
3535

36-
@objc weak var delegate: NCIntroViewController?
36+
weak var delegate: NCIntroViewController?
3737

3838
private let appDelegate = (UIApplication.shared.delegate as? AppDelegate)!
3939
private let titles = [NSLocalizedString("_intro_1_title_", comment: ""), NSLocalizedString("_intro_2_title_", comment: ""), NSLocalizedString("_intro_3_title_", comment: ""), NSLocalizedString("_intro_4_title_", comment: "")]
@@ -98,6 +98,23 @@ class NCIntroViewController: UIViewController, UICollectionViewDataSource, UICol
9898

9999
view.backgroundColor = NCBrandColor.shared.customer
100100
timerAutoScroll = Timer.scheduledTimer(timeInterval: 5, target: self, selector: (#selector(NCIntroViewController.autoScroll)), userInfo: nil, repeats: true)
101+
102+
NotificationCenter.default.addObserver(forName: NSNotification.Name(rawValue: NCGlobal.shared.notificationCenterChangeUser), object: nil, queue: nil) { _ in
103+
let window = UIApplication.shared.firstWindow
104+
if window?.rootViewController is NCMainTabBarController {
105+
self.dismiss(animated: true)
106+
} else {
107+
if let mainTabBarController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController() as? NCMainTabBarController {
108+
mainTabBarController.modalPresentationStyle = .fullScreen
109+
mainTabBarController.view.alpha = 0
110+
window?.rootViewController = mainTabBarController
111+
window?.makeKeyAndVisible()
112+
UIView.animate(withDuration: 0.5) {
113+
mainTabBarController.view.alpha = 1
114+
}
115+
}
116+
}
117+
}
101118
}
102119

103120
override var preferredStatusBarStyle: UIStatusBarStyle {

Brand/NCBrand.swift

+52-72
Original file line numberDiff line numberDiff line change
@@ -35,75 +35,60 @@ let userAgent: String = {
3535
return instance
3636
}()
3737

38-
@objc public var brand: String = "Nextcloud"
39-
@objc public var textCopyrightNextcloudiOS: String = "Nextcloud Hydrogen for iOS %@ © 2024"
40-
@objc public var textCopyrightNextcloudServer: String = "Nextcloud Server %@"
41-
@objc public var loginBaseUrl: String = "https://cloud.nextcloud.com"
42-
@objc public var pushNotificationServerProxy: String = "https://push-notifications.nextcloud.com"
43-
@objc public var linkLoginHost: String = "https://nextcloud.com/install"
44-
@objc public var linkloginPreferredProviders: String = "https://nextcloud.com/signup-ios"
45-
@objc public var webLoginAutenticationProtocol: String = "nc://" // example "abc://"
46-
@objc public var privacy: String = "https://nextcloud.com/privacy"
47-
@objc public var sourceCode: String = "https://github.com/nextcloud/ios"
48-
@objc public var mobileconfig: String = "/remote.php/dav/provisioning/apple-provisioning.mobileconfig"
49-
50-
// Personalized
51-
@objc public var webCloseViewProtocolPersonalized: String = "" // example "abc://change/plan" Don't touch me !!
52-
@objc public var folderBrandAutoUpload: String = "" // example "_auto_upload_folder_" Don't touch me !!
38+
var brand: String = "Nextcloud"
39+
var textCopyrightNextcloudiOS: String = "Nextcloud Hydrogen for iOS %@ © 2024"
40+
var textCopyrightNextcloudServer: String = "Nextcloud Server %@"
41+
var loginBaseUrl: String = "https://cloud.nextcloud.com"
42+
@objc var pushNotificationServerProxy: String = "https://push-notifications.nextcloud.com"
43+
var linkLoginHost: String = "https://nextcloud.com/install"
44+
var linkloginPreferredProviders: String = "https://nextcloud.com/signup-ios"
45+
var webLoginAutenticationProtocol: String = "nc://" // example "abc://"
46+
var privacy: String = "https://nextcloud.com/privacy"
47+
var sourceCode: String = "https://github.com/nextcloud/ios"
48+
var mobileconfig: String = "/remote.php/dav/provisioning/apple-provisioning.mobileconfig"
49+
var appStoreUrl: String = "https://apps.apple.com/in/app/nextcloud/id1125420102"
5350

5451
// Auto Upload default folder
55-
@objc public var folderDefaultAutoUpload: String = "Photos"
52+
var folderDefaultAutoUpload: String = "Photos"
5653

5754
// Capabilities Group
58-
@objc public var capabilitiesGroups: String = "group.it.twsweb.Crypto-Cloud"
59-
@objc public var capabilitiesGroupApps: String = "group.com.nextcloud.apps"
55+
var capabilitiesGroups: String = "group.it.twsweb.Crypto-Cloud"
56+
var capabilitiesGroupApps: String = "group.com.nextcloud.apps"
6057

6158
// BRAND ONLY
62-
@objc public var use_login_web_personalized: Bool = false // Don't touch me !!
6359
@objc public var use_AppConfig: Bool = false // Don't touch me !!
64-
@objc public var use_GroupApps: Bool = true // Don't touch me !!
6560

6661
// Options
67-
@objc public var use_default_auto_upload: Bool = false
6862
@objc public var use_themingColor: Bool = true
69-
@objc public var use_themingLogo: Bool = false
70-
@objc public var use_storeLocalAutoUploadAll: Bool = false
71-
@objc public var use_loginflowv2: Bool = false // Don't touch me !!
72-
73-
@objc public var disable_intro: Bool = false
74-
@objc public var disable_request_login_url: Bool = false
75-
@objc public var disable_multiaccount: Bool = false
76-
@objc public var disable_manage_account: Bool = false
77-
@objc public var disable_more_external_site: Bool = false
78-
@objc public var disable_openin_file: Bool = false // Don't touch me !!
79-
@objc public var disable_crash_service: Bool = false
80-
@objc public var disable_log: Bool = false
81-
@objc public var disable_mobileconfig: Bool = false
82-
@objc public var disable_show_more_nextcloud_apps_in_settings: Bool = false
83-
@objc public var doNotAskPasscodeAtStartup: Bool = false
63+
64+
var disable_intro: Bool = false
65+
var disable_request_login_url: Bool = false
66+
var disable_multiaccount: Bool = false
67+
var disable_more_external_site: Bool = false
68+
var disable_openin_file: Bool = false // Don't touch me !!
69+
var disable_crash_service: Bool = false
70+
var disable_log: Bool = false
71+
var disable_mobileconfig: Bool = false
72+
var disable_show_more_nextcloud_apps_in_settings: Bool = false
73+
var doNotAskPasscodeAtStartup: Bool = false
8474

8575
// Internal option behaviour
86-
@objc public var cleanUpDay: Int = 0 // Set default "Delete, in the cache, all files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
76+
var cleanUpDay: Int = 0 // Set default "Delete, in the cache, all files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
8777

8878
// Max download/upload concurrent
89-
public let maxConcurrentOperationDownload: Int = 5
90-
public let maxConcurrentOperationUpload: Int = 5
79+
let maxConcurrentOperationDownload: Int = 5
80+
let maxConcurrentOperationUpload: Int = 5
9181

9282
// Number of failed attempts after reset app
93-
@objc public let resetAppPasscodeAttempts: Int = 10
94-
public let passcodeSecondsFail: Int = 60
83+
let resetAppPasscodeAttempts: Int = 10
84+
let passcodeSecondsFail: Int = 60
9585

9686
// Info Paging
9787
enum NCInfoPagingTab: Int, CaseIterable {
9888
case activity, sharing
9989
}
10090

10191
override init() {
102-
103-
if folderBrandAutoUpload != "" {
104-
folderDefaultAutoUpload = folderBrandAutoUpload
105-
}
106-
10792
// wrapper AppConfig
10893
if let configurationManaged = UserDefaults.standard.dictionary(forKey: "com.apple.configuration.managed"), use_AppConfig {
10994

@@ -122,9 +107,6 @@ let userAgent: String = {
122107
if let str = configurationManaged[NCGlobal.shared.configuration_disable_log] as? String {
123108
disable_log = (str as NSString).boolValue
124109
}
125-
if let str = configurationManaged[NCGlobal.shared.configuration_disable_manage_account] as? String {
126-
disable_manage_account = (str as NSString).boolValue
127-
}
128110
if let str = configurationManaged[NCGlobal.shared.configuration_disable_more_external_site] as? String {
129111
disable_more_external_site = (str as NSString).boolValue
130112
}
@@ -140,53 +122,53 @@ let userAgent: String = {
140122
}
141123

142124
class NCBrandColor: NSObject {
143-
@objc static let shared: NCBrandColor = {
125+
static let shared: NCBrandColor = {
144126
let instance = NCBrandColor()
145127
return instance
146128
}()
147129

148130
// Color
149-
@objc public let customer: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0) // BLU NC : #0082c9
150-
@objc public var customerText: UIColor = .white
131+
let customer: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0) // BLU NC : #0082c9
132+
var customerText: UIColor = .white
151133

152-
@objc private var brand: UIColor // don't touch me
153-
@objc public var brandElement: UIColor // don't touch me
154-
@objc public var brandText: UIColor // don't touch me
134+
var brand: UIColor // don't touch me
135+
var brandElement: UIColor // don't touch me
136+
var brandText: UIColor // don't touch me
155137

156-
@objc public let nextcloud: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0)
157-
@objc public let yellowFavorite: UIColor = UIColor(red: 248.0 / 255.0, green: 205.0 / 255.0, blue: 70.0 / 255.0, alpha: 1.0)
138+
let nextcloud: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0)
139+
let yellowFavorite: UIColor = UIColor(red: 248.0 / 255.0, green: 205.0 / 255.0, blue: 70.0 / 255.0, alpha: 1.0)
158140

159-
public var userColors: [CGColor] = []
160-
public var themingColor: String = ""
161-
public var themingColorElement: String = ""
162-
public var themingColorText: String = ""
141+
var userColors: [CGColor] = []
142+
var themingColor: String = ""
143+
var themingColorElement: String = ""
144+
var themingColorText: String = ""
163145

164-
@objc public let iconImageColor: UIColor = .label
165-
@objc public let iconImageColor2: UIColor = .secondaryLabel
166-
@objc public let iconImageMultiColors: [UIColor] = [.secondaryLabel, .label]
146+
let iconImageColor: UIColor = .label
147+
let iconImageColor2: UIColor = .secondaryLabel
148+
let iconImageMultiColors: [UIColor] = [.secondaryLabel, .label]
167149

168-
@objc public let textColor: UIColor = .label
169-
@objc public let textColor2: UIColor = .secondaryLabel
150+
let textColor: UIColor = .label
151+
let textColor2: UIColor = .secondaryLabel
170152

171-
@objc public var systemMint: UIColor {
153+
var systemMint: UIColor {
172154
get {
173155
return UIColor(red: 0.0 / 255.0, green: 199.0 / 255.0, blue: 190.0 / 255.0, alpha: 1.0)
174156
}
175157
}
176158

177-
@objc public var documentIconColor: UIColor {
159+
var documentIconColor: UIColor {
178160
get {
179161
return UIColor(hex: "#49abe9")!
180162
}
181163
}
182164

183-
@objc public var spreadsheetIconColor: UIColor {
165+
var spreadsheetIconColor: UIColor {
184166
get {
185167
return UIColor(hex: "#9abd4e")!
186168
}
187169
}
188170

189-
@objc public var presentationIconColor: UIColor {
171+
var presentationIconColor: UIColor {
190172
get {
191173
return UIColor(hex: "#f0965f")!
192174
}
@@ -203,12 +185,10 @@ class NCBrandColor: NSObject {
203185
}
204186

205187
func settingThemingColor(account: String) {
206-
207188
let darker: CGFloat = 30 // %
208189
let lighter: CGFloat = 30 // %
209190

210191
if NCBrandOptions.shared.use_themingColor {
211-
212192
self.themingColor = NCGlobal.shared.capabilityThemingColor
213193
self.themingColorElement = NCGlobal.shared.capabilityThemingColorElement
214194
self.themingColorText = NCGlobal.shared.capabilityThemingColorText

File Provider Extension UI/FileProviderExtensionUI-Bridging-Header.h

-24
This file was deleted.

File Provider Extension/FileProviderExtension-Bridging-Header.h

-24
This file was deleted.

File Provider Extension/FileProviderExtension.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
//
2323

2424
import UIKit
25+
import UniformTypeIdentifiers
2526
import FileProvider
2627
import NextcloudKit
2728
import Alamofire
@@ -96,8 +97,7 @@ class FileProviderExtension: NSFileProviderExtension {
9697
// - for a directory, instantiate an enumerator of its subitems
9798
// - for a file, instantiate an enumerator that observes changes to the file
9899
let item = try self.item(for: containerItemIdentifier)
99-
100-
if item.typeIdentifier == kUTTypeFolder as String {
100+
if item.contentType == UTType.folder {
101101
maybeEnumerator = FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier)
102102
} else {
103103
maybeEnumerator = FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier)

0 commit comments

Comments
 (0)