Explorar el Código

ITMS-90076

Signed-off-by: marinofaggiana <ios@nextcloud.com>
marinofaggiana hace 2 años
padre
commit
06e46e6f5e

+ 1 - 1
iOSClient/AppDelegate.swift

@@ -110,7 +110,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         }
 
         // ITMS-90076: Potential Loss of Keychain Access
-        if let account = NCManageDatabase.shared.getActiveAccount(), CCUtility.getPassword(account.account).isEmpty, NCUtility.shared.getVersionApp(withBuild: false) == "4.4.1" {
+        if let account = NCManageDatabase.shared.getActiveAccount(), CCUtility.getPassword(account.account).isEmpty, NCUtility.shared.getVersionApp(withBuild: false).starts(with: "4.4") {
             errorITMS90076 = true
         }
 

+ 4 - 2
iOSClient/Login/NCLoginWeb.swift

@@ -99,7 +99,7 @@ class NCLoginWeb: UIViewController {
         appDelegate.timerErrorNetworking?.invalidate()
 
         // ITMS-90076: Potential Loss of Keychain Access
-        if let account = NCManageDatabase.shared.getActiveAccount(), appDelegate.errorITMS90076 {
+        if let account = NCManageDatabase.shared.getActiveAccount(), appDelegate.errorITMS90076, !CCUtility.getPresentErrorITMS90076() {
 
             var title = titleView
             if let host = URL(string: urlBase)?.host {
@@ -107,7 +107,9 @@ class NCLoginWeb: UIViewController {
             }
             let alertController = UIAlertController(title: title, message: "\n" + "Due to a change in the Nextcloud application identifier, the settings and password for accessing your cloud are reset, so please re-enter your account data and check your Settings, we are sorry about what happened but it is not up to us.", preferredStyle: .alert)
             alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
-            present(alertController, animated: true, completion: { })
+            present(alertController, animated: true, completion: {
+                CCUtility.setPresentErrorITMS90076(true)
+            })
             return
         }
     }

+ 3 - 0
iOSClient/Utility/CCUtility.h

@@ -180,6 +180,9 @@
 + (BOOL)getRemovePhotoCameraRoll;
 + (void)setRemovePhotoCameraRoll:(BOOL)set;
 
++ (BOOL)getPresentErrorITMS90076;
++ (void)setPresentErrorITMS90076:(BOOL)set;
+
 // ===== Varius =====
 
 + (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL;

+ 11 - 0
iOSClient/Utility/CCUtility.m

@@ -723,6 +723,17 @@
     [UICKeyChainStore setString:sSet forKey:@"removePhotoCameraRoll" service:NCGlobal.shared.serviceShareKeyChain];
 }
 
++ (BOOL)getPresentErrorITMS90076
+{
+    return [[UICKeyChainStore stringForKey:@"errorITMS90076" service:NCGlobal.shared.serviceShareKeyChain] boolValue];
+}
+
++ (void)setPresentErrorITMS90076:(BOOL)set
+{
+    NSString *sSet = (set) ? @"true" : @"false";
+    [UICKeyChainStore setString:sSet forKey:@"errorITMS90076" service:NCGlobal.shared.serviceShareKeyChain];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Various =====
 #pragma --------------------------------------------------------------------------------------------