|
@@ -685,7 +685,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
|
|
|
func requestAccount() {
|
|
|
|
|
|
- if isPasscodePresented() { return }
|
|
|
+ if isPasscodePresented { return }
|
|
|
if !NCKeychain().accountRequest { return }
|
|
|
|
|
|
let accounts = NCManageDatabase.shared.getAllAccount()
|
|
@@ -727,6 +727,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
return passcodeCounterFail > 0 && passcodeCounterFail.isMultiple(of: 3)
|
|
|
}
|
|
|
|
|
|
+ var isPasscodePresented: Bool {
|
|
|
+ return privacyProtectionWindow?.rootViewController?.presentedViewController is TOPasscodeViewController
|
|
|
+ }
|
|
|
+
|
|
|
func presentPasscode(completion: @escaping () -> Void) {
|
|
|
|
|
|
var error: NSError?
|
|
@@ -760,10 +764,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- func isPasscodePresented() -> Bool {
|
|
|
- return privacyProtectionWindow?.rootViewController?.presentedViewController is TOPasscodeViewController
|
|
|
- }
|
|
|
-
|
|
|
func enableTouchFaceID() {
|
|
|
guard !account.isEmpty,
|
|
|
NCKeychain().touchFaceID,
|
|
@@ -790,8 +790,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
|
|
|
if let error = evaluateError {
|
|
|
switch error._code {
|
|
|
case LAError.userFallback.rawValue, LAError.authenticationFailed.rawValue:
|
|
|
- NCKeychain().passcodeCounterFail = 3
|
|
|
- NCKeychain().passcodeCounterFailReset += 1
|
|
|
+ if LAContext().biometryType == .faceID {
|
|
|
+ NCKeychain().passcodeCounterFail = 2
|
|
|
+ NCKeychain().passcodeCounterFailReset += 2
|
|
|
+ } else {
|
|
|
+ NCKeychain().passcodeCounterFail = 3
|
|
|
+ NCKeychain().passcodeCounterFailReset += 3
|
|
|
+ }
|
|
|
self.openAlert(passcodeViewController: passcodeViewController)
|
|
|
case LAError.biometryLockout.rawValue:
|
|
|
LAContext().evaluatePolicy(LAPolicy.deviceOwnerAuthentication, localizedReason: NSLocalizedString("_deviceOwnerAuthentication_", comment: ""), reply: { success, _ in
|