소스 검색

Improvements

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 년 전
부모
커밋
1133808de1
3개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      iOSClient/AppDelegate.swift
  2. 2 0
      iOSClient/Utility/CCUtility.h
  3. 6 0
      iOSClient/Utility/CCUtility.m

+ 3 - 3
iOSClient/AppDelegate.swift

@@ -297,8 +297,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
        
     private func showPrivacyProtectionWindow() {
         
-        if isPasscodePresented() { return }
         if !CCUtility.getPrivacyScreen() { return }
+        if CCUtility.isPasscodeEnableAtStart() { return }
         
         privacyProtectionWindow = UIWindow(frame: UIScreen.main.bounds)
           
@@ -739,7 +739,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         }
                 
         if account == "" { return }
-        if CCUtility.getPasscode().count == 0 || CCUtility.getNotPasscodeAtStart() { return }
+        if !CCUtility.isPasscodeEnableAtStart() { return }
                 
         // Dismiss present window?.rootViewController? [ONLY PASSCODE]
         let presentedViewController = window?.rootViewController?.presentedViewController
@@ -778,7 +778,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         
         if account == "" { return }
         if !CCUtility.getEnableTouchFaceID() { return }
-        if CCUtility.getPasscode().count == 0 || CCUtility.getNotPasscodeAtStart() { return }
+        if !CCUtility.isPasscodeEnableAtStart() { return }
         guard let passcodeViewController = window?.rootViewController?.presentedViewController as? TOPasscodeViewController else { return }
 
         LAContext().evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: NCBrandOptions.shared.brand) { (success, error) in

+ 2 - 0
iOSClient/Utility/CCUtility.h

@@ -51,6 +51,8 @@
 + (BOOL)getEnableTouchFaceID;
 + (void)setEnableTouchFaceID:(BOOL)set;
 
++ (BOOL)isPasscodeEnableAtStart;
+
 + (NSString *)getGroupBySettings;
 + (void)setGroupBySettings:(NSString *)groupby;
 

+ 6 - 0
iOSClient/Utility/CCUtility.m

@@ -103,6 +103,12 @@
     [UICKeyChainStore setString:sSet forKey:@"enableTouchFaceID" service:NCGlobal.shared.serviceShareKeyChain];
 }
 
++ (BOOL)isPasscodeEnableAtStart
+{
+    if ([self getPasscode].length > 0 && ![self getNotPasscodeAtStart]) return true;
+    else return false;
+}
+
 + (NSString *)getGroupBySettings
 {
     NSString *groupby = [UICKeyChainStore stringForKey:@"groupby" service:NCGlobal.shared.serviceShareKeyChain];