Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a5bb815
WIP
mpivchev Nov 13, 2024
25bcaba
WIP
mpivchev Nov 14, 2024
e6015cf
WIP
mpivchev Nov 15, 2024
9aef669
Finish
mpivchev Nov 15, 2024
37a108a
Merge branch 'develop' of https://github.com/nextcloud/ios into enfor…
mpivchev Nov 15, 2024
3020b69
WIP
mpivchev Nov 13, 2024
eec0518
WIP
mpivchev Nov 14, 2024
ca2731a
WIP
mpivchev Nov 15, 2024
b7be621
Finish
mpivchev Nov 15, 2024
fdeff27
Merge branch 'enfore_lock' of https://github.com/nextcloud/ios into e…
marinofaggiana Nov 18, 2024
075e2c7
WIP
mpivchev Nov 19, 2024
d229d9f
Merge branch 'enfore_lock' of https://github.com/nextcloud/ios into e…
mpivchev Nov 19, 2024
baf787c
WIP
mpivchev Nov 19, 2024
84252b9
WIP
mpivchev Nov 26, 2024
475f7fa
Merge branch 'develop' of https://github.com/nextcloud/ios into enfor…
mpivchev Nov 26, 2024
280eb62
WIP
mpivchev Nov 26, 2024
983f08c
Merge branch 'develop' of https://github.com/nextcloud/ios into enfor…
mpivchev Nov 27, 2024
90ed82d
WIP
mpivchev Nov 27, 2024
52e98fa
WIP
mpivchev Nov 27, 2024
dcff66b
WIP
mpivchev Nov 27, 2024
e8ab444
WIP
mpivchev Nov 28, 2024
190869c
WIP
mpivchev Nov 28, 2024
3017823
WIP
mpivchev Nov 28, 2024
f3bb4e5
added didAttemptCurrentPasscode
marinofaggiana Nov 28, 2024
d74a381
Refactor
mpivchev Nov 28, 2024
96400ff
Merge branch 'develop' of https://github.com/nextcloud/ios into enfor…
mpivchev Nov 28, 2024
47fc019
Merge branch 'enfore_lock' of https://github.com/nextcloud/ios into e…
marinofaggiana Nov 29, 2024
32973f5
Fix build
mpivchev Nov 29, 2024
6742283
Add attempt check
mpivchev Nov 29, 2024
02b40e1
Fix
mpivchev Nov 29, 2024
592ae6a
WIP
mpivchev Nov 29, 2024
c22be9e
Refactor
mpivchev Nov 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions Brand/NCBrand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ let userAgent: String = {
var disable_show_more_nextcloud_apps_in_settings: Bool = false
var doNotAskPasscodeAtStartup: Bool = false
var disable_source_code_in_settings: Bool = false
var enforce_passcode_lock = false

// (name: "Name 1", url: "https://cloud.nextcloud.com"),(name: "Name 2", url: "https://cloud.nextcloud.com")
var enforce_servers: [(name: String, url: String)] = []

// Internal option behaviour
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
var cleanUpDay: Int = 0 // Set default "Delete all cached files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365

// Max download/upload concurrent
let maxConcurrentOperationDownload: Int = 5
Expand All @@ -95,7 +96,6 @@ let userAgent: String = {
override init() {
// wrapper AppConfig
if let configurationManaged = UserDefaults.standard.dictionary(forKey: "com.apple.configuration.managed"), use_AppConfig {

if let str = configurationManaged[NCGlobal.shared.configuration_brand] as? String {
brand = str
}
Expand All @@ -117,6 +117,9 @@ let userAgent: String = {
if let str = configurationManaged[NCGlobal.shared.configuration_disable_openin_file] as? String {
disable_openin_file = (str as NSString).boolValue
}
if let str = configurationManaged[NCGlobal.shared.configuration_enforce_passcode_lock] as? String {
enforce_passcode_lock = (str as NSString).boolValue
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions Nextcloud.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
F37208C42BAB63F0006B5430 /* Gzip in Frameworks */ = {isa = PBXBuildFile; productRef = F37208C32BAB63F0006B5430 /* Gzip */; };
F37208C62BAB63F0006B5430 /* LRUCache in Frameworks */ = {isa = PBXBuildFile; productRef = F37208C52BAB63F0006B5430 /* LRUCache */; };
F37208C82BAB63F1006B5430 /* KeychainAccess in Frameworks */ = {isa = PBXBuildFile; productRef = F37208C72BAB63F1006B5430 /* KeychainAccess */; };
F3754A7D2CF87D600009312E /* SetupPasscodeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F3754A7C2CF87D600009312E /* SetupPasscodeView.swift */; };
F38F71252B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = F38F71242B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift */; };
F39170A92CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
F39170AA2CB82024006127BC /* FileAutoRenamer+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */; };
Expand Down Expand Up @@ -560,7 +561,6 @@
F76882282C0DD1E7001CF441 /* NCEndToEndInitialize.swift in Sources */ = {isa = PBXBuildFile; fileRef = F768820F2C0DD1E7001CF441 /* NCEndToEndInitialize.swift */; };
F76882292C0DD1E7001CF441 /* NCManageE2EEModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76882102C0DD1E7001CF441 /* NCManageE2EEModel.swift */; };
F768822A2C0DD1E7001CF441 /* NCSettingsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76882112C0DD1E7001CF441 /* NCSettingsModel.swift */; };
F768822B2C0DD1E7001CF441 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = F76882122C0DD1E7001CF441 /* Settings.bundle */; };
F768822C2C0DD1E7001CF441 /* NCKeychain.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76882132C0DD1E7001CF441 /* NCKeychain.swift */; };
F768822D2C0DD1E7001CF441 /* Acknowledgements.rtf in Resources */ = {isa = PBXBuildFile; fileRef = F76882142C0DD1E7001CF441 /* Acknowledgements.rtf */; };
F768822E2C0DD1E7001CF441 /* NCSettingsBundleHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = F76882152C0DD1E7001CF441 /* NCSettingsBundleHelper.swift */; };
Expand Down Expand Up @@ -1198,6 +1198,7 @@
F36E64F62B9245210085ABB5 /* NCCollectionViewCommon+SelectTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NCCollectionViewCommon+SelectTabBar.swift"; sourceTree = "<group>"; };
F37208742BAB4AB0006B5430 /* TestConstants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestConstants.swift; sourceTree = "<group>"; };
F37208772BAB4B5D006B5430 /* BaseXCTestCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseXCTestCase.swift; sourceTree = "<group>"; };
F3754A7C2CF87D600009312E /* SetupPasscodeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SetupPasscodeView.swift; sourceTree = "<group>"; };
F38F71242B6BBDC300473CDC /* NCCollectionViewCommonSelectTabBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NCCollectionViewCommonSelectTabBar.swift; sourceTree = "<group>"; };
F39170A82CB8201B006127BC /* FileAutoRenamer+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "FileAutoRenamer+Extensions.swift"; sourceTree = "<group>"; };
F39298962A3B12CB00509762 /* BaseNCMoreCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseNCMoreCell.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1381,7 +1382,6 @@
F768820F2C0DD1E7001CF441 /* NCEndToEndInitialize.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCEndToEndInitialize.swift; sourceTree = "<group>"; };
F76882102C0DD1E7001CF441 /* NCManageE2EEModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCManageE2EEModel.swift; sourceTree = "<group>"; };
F76882112C0DD1E7001CF441 /* NCSettingsModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCSettingsModel.swift; sourceTree = "<group>"; };
F76882122C0DD1E7001CF441 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = "<group>"; };
F76882132C0DD1E7001CF441 /* NCKeychain.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCKeychain.swift; sourceTree = "<group>"; };
F76882142C0DD1E7001CF441 /* Acknowledgements.rtf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.rtf; path = Acknowledgements.rtf; sourceTree = "<group>"; };
F76882152C0DD1E7001CF441 /* NCSettingsBundleHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCSettingsBundleHelper.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2350,7 +2350,6 @@
F76882142C0DD1E7001CF441 /* Acknowledgements.rtf */,
F76882132C0DD1E7001CF441 /* NCKeychain.swift */,
F76882152C0DD1E7001CF441 /* NCSettingsBundleHelper.swift */,
F76882122C0DD1E7001CF441 /* Settings.bundle */,
);
path = Settings;
sourceTree = "<group>";
Expand Down Expand Up @@ -2381,6 +2380,7 @@
F768820D2C0DD1E7001CF441 /* E2EE */,
F76882112C0DD1E7001CF441 /* NCSettingsModel.swift */,
F768820C2C0DD1E7001CF441 /* NCSettingsView.swift */,
F3754A7C2CF87D600009312E /* SetupPasscodeView.swift */,
);
path = Settings;
sourceTree = "<group>";
Expand Down Expand Up @@ -3753,7 +3753,6 @@
F774264A22EB4D0000B23912 /* NCSearchUserDropDownCell.xib in Resources */,
F7CB689A2541676B0050EC94 /* NCMore.storyboard in Resources */,
F77B0F7D1D118A16002130FE /* Images.xcassets in Resources */,
F768822B2C0DD1E7001CF441 /* Settings.bundle in Resources */,
F73CB3B222E072A000AD728E /* NCShareHeaderView.xib in Resources */,
F7AE00FA230E81EB007ACF8A /* NCBrowserWeb.storyboard in Resources */,
F7EDE514262DC2CD00414FE6 /* NCSelectCommandViewSelect+CreateFolder.xib in Resources */,
Expand Down Expand Up @@ -4267,6 +4266,7 @@
F768822C2C0DD1E7001CF441 /* NCKeychain.swift in Sources */,
F7BFFD282C8846020029A201 /* NCHud.swift in Sources */,
F71CD6CA2930D7B1006C95C1 /* NCApplicationHandle.swift in Sources */,
F3754A7D2CF87D600009312E /* SetupPasscodeView.swift in Sources */,
F73EF7D72B0226080087E6E9 /* NCManageDatabase+Tip.swift in Sources */,
F74BAE172C7E2F4E0028D4FA /* FileProviderDomain.swift in Sources */,
F76882402C0DD30B001CF441 /* ViewOnAppear.swift in Sources */,
Expand Down
4 changes: 4 additions & 0 deletions iOSClient/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
self.handleProcessingTask(task)
}

if NCBrandOptions.shared.enforce_passcode_lock {
NCKeychain().requestPasscodeAtStart = true
}

/// Activation singleton
_ = NCActionCenter.shared
_ = NCNetworkingProcess.shared
Expand Down
8 changes: 8 additions & 0 deletions iOSClient/Main/NCMainTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
//

import UIKit
import SwiftUI

struct NavigationCollectionViewCommon {
var serverUrl: String
Expand Down Expand Up @@ -55,6 +56,13 @@ class NCMainTabBarController: UITabBarController {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
previousIndex = selectedIndex

if NCBrandOptions.shared.enforce_passcode_lock && NCKeychain().passcode.isEmptyOrNil {
let vc = UIHostingController(rootView: SetupPasscodeView(isLockActive: .constant(false)))
vc.isModalInPresentation = true

present(vc, animated: true)
}
}

@objc func changeTheming(_ notification: NSNotification) {
Expand Down
1 change: 1 addition & 0 deletions iOSClient/NCGlobal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ class NCGlobal: NSObject {
let configuration_disable_log = "disable_log"
let configuration_disable_more_external_site = "disable_more_external_site"
let configuration_disable_openin_file = "disable_openin_file"
let configuration_enforce_passcode_lock = "enforce_passcode_lock"

// MORE NEXTCLOUD APPS
//
Expand Down
1 change: 1 addition & 0 deletions iOSClient/SceneDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import UIKit
import NextcloudKit
import WidgetKit
import SwiftEntryKit
import SwiftUI

class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
Expand Down
Loading
Loading