Forráskód Böngészése

Merge pull request #2068 from nextcloud/441Fix

441 fix
Marino Faggiana 2 éve
szülő
commit
3e13ad9412

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -2995,7 +2995,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 5;
+				CURRENT_PROJECT_VERSION = 7;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -3058,7 +3058,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 5;
+				CURRENT_PROJECT_VERSION = 7;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				ENABLE_BITCODE = YES;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;

+ 1 - 1
README.md

@@ -81,4 +81,4 @@ If you need assistance or want to ask a question about the iOS app, you are welc
 
 Do you want to try the latest version in development of Nextcloud iOS ? Simple, follow this simple step
 
-[Apple TestFlight](https://testflight.apple.com/join/GjNbfo2a)
+[Apple TestFlight](https://testflight.apple.com/join/RXEJbWj9)

+ 8 - 9
iOSClient/AppDelegate.swift

@@ -62,7 +62,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     var networkingProcessUpload: NCNetworkingProcessUpload?
     var shares: [tableShare] = []
     var timerErrorNetworking: Timer?
-    
+
+    var errorITMS90076: Bool = false
+
     private var privacyProtectionWindow: UIWindow?
     
     func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
@@ -107,6 +109,11 @@ 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).starts(with: "4.4") {
+            errorITMS90076 = true
+        }
+
         // Activate user account
         if let activeAccount = NCManageDatabase.shared.getActiveAccount() {
 
@@ -189,14 +196,6 @@ 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" {
-
-            let alertController = UIAlertController(title: NSLocalizedString("_info_", comment: ""), message: "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 }))
-            window?.rootViewController?.present(alertController, animated: true, completion: { })
-        }
-
         return true
     }
 

+ 19 - 0
iOSClient/Login/NCLoginWeb.swift

@@ -31,6 +31,7 @@ class NCLoginWeb: UIViewController {
     var activityIndicator: UIActivityIndicatorView!
     var webView: WKWebView?
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
+    var titleView: String = ""
 
     @objc var urlBase = ""
 
@@ -45,6 +46,9 @@ class NCLoginWeb: UIViewController {
         super.viewDidLoad()
 
         let accountCount = NCManageDatabase.shared.getAccounts()?.count ?? 0
+        // TITLE
+        titleView = urlBase
+        title = titleView
 
         if NCBrandOptions.shared.use_login_web_personalized  && accountCount > 0 {
             navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(self.closeView(sender:)))
@@ -93,6 +97,21 @@ class NCLoginWeb: UIViewController {
 
         // Stop timer error network
         appDelegate.timerErrorNetworking?.invalidate()
+
+        // ITMS-90076: Potential Loss of Keychain Access
+        if let account = NCManageDatabase.shared.getActiveAccount(), appDelegate.errorITMS90076, !CCUtility.getPresentErrorITMS90076() {
+
+            var title = titleView
+            if let host = URL(string: urlBase)?.host {
+                title = NSLocalizedString("_user_", comment: "") + " " + account.userId + " " + NSLocalizedString("_in_", comment: "") + " " + host
+            }
+            let alertController = UIAlertController(title: title, message: "\n" + NSLocalizedString("_ITMS-90076_", comment: ""), preferredStyle: .alert)
+            alertController.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default, handler: { _ in }))
+            present(alertController, animated: true, completion: {
+                CCUtility.setPresentErrorITMS90076(true)
+            })
+            return
+        }
     }
 
     override func viewDidDisappear(_ animated: Bool) {

+ 6 - 2
iOSClient/Main/Collection Common/NCCollectionViewCommon.swift

@@ -186,7 +186,9 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
         setNavigationItem()
 
         reloadDataSource(forced: false)
-        reloadDataSourceNetwork()
+        if !isSearching {
+            reloadDataSourceNetwork()
+        }
     }
 
     override func viewWillDisappear(_ animated: Bool) {
@@ -340,7 +342,9 @@ class NCCollectionViewCommon: UIViewController, UIGestureRecognizerDelegate, UIS
     }
 
     @objc func reloadDataSourceNetworkForced(_ notification: NSNotification) {
-        reloadDataSourceNetwork(forced: true)
+        if !isSearching {
+            reloadDataSourceNetwork(forced: true)
+        }
     }
 
     @objc func changeStatusFolderE2EE(_ notification: NSNotification) {

+ 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 --------------------------------------------------------------------------------------------