浏览代码

new build

Signed-off-by: Marino Faggiana <8616947+marinofaggiana@users.noreply.github.com>
Marino Faggiana 1 年之前
父节点
当前提交
84d3a1404e

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -4751,7 +4751,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 14;
+				CURRENT_PROJECT_VERSION = 15;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
@@ -4816,7 +4816,7 @@
 				CLANG_WARN_UNREACHABLE_CODE = YES;
 				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
-				CURRENT_PROJECT_VERSION = 14;
+				CURRENT_PROJECT_VERSION = 15;
 				DEVELOPMENT_TEAM = NKUJUXUJ3B;
 				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;

+ 9 - 23
iOSClient/AppDelegate.swift

@@ -847,31 +847,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         passcodeViewController.present(alertController, animated: true, completion: { })
 
         DispatchQueue.main.asyncAfter(deadline: .now() + 4) {
-            self.resetApplication()
+            self.removeAllSettings(killEmAll: true)
         }
     }
 
-    // MARK: - Remove / Reset App
+    // MARK: - Remove All Settings
 
-    @objc func removeAllSettings() {
-
-        let utilityFileSystem = NCUtilityFileSystem()
-
-        URLCache.shared.memoryCapacity = 0
-        URLCache.shared.diskCapacity = 0
-
-        utilityFileSystem.removeGroupDirectoryProviderStorage()
-        utilityFileSystem.removeGroupLibraryDirectory()
-        utilityFileSystem.removeDocumentsDirectory()
-        utilityFileSystem.removeTemporaryDirectory()
-
-        utilityFileSystem.createDirectoryStandard()
-
-        NCKeychain().removeAll()
-        NCManageDatabase.shared.clearDatabase(account: nil, removeAccount: true)
-    }
-
-    @objc func resetApplication() {
+    @objc func removeAllSettings(killEmAll: Bool) {
 
         let utilityFileSystem = NCUtilityFileSystem()
 
@@ -891,9 +873,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
             utilityFileSystem.removeTemporaryDirectory()
 
             NCKeychain().removeAll()
-            NCManageDatabase.shared.removeDB()
 
-            exit(0)
+            if killEmAll {
+                NCManageDatabase.shared.removeDB()
+                exit(0)
+            } else {
+                NCManageDatabase.shared.clearDatabase(account: nil, removeAccount: true)
+            }
         }
     }
 

+ 1 - 1
iOSClient/Login/NCLogin.swift

@@ -396,7 +396,7 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
                 if error == .success, let userProfile {
 
                     if NCManageDatabase.shared.getAccounts() == nil {
-                        self.appDelegate.removeAllSettings()
+                        self.appDelegate.removeAllSettings(killEmAll: false)
                     }
 
                     NCManageDatabase.shared.deleteAccount(account)

+ 1 - 1
iOSClient/Login/NCLoginWeb.swift

@@ -294,7 +294,7 @@ extension NCLoginWeb: WKNavigationDelegate {
             if error == .success, let userProfile {
 
                 if NCManageDatabase.shared.getAccounts() == nil {
-                    self.appDelegate.removeAllSettings()
+                    self.appDelegate.removeAllSettings(killEmAll: false)
                 }
 
                 NCManageDatabase.shared.deleteAccount(account)

+ 1 - 1
iOSClient/Settings/CCAdvanced.m

@@ -455,7 +455,7 @@
     UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"" message:NSLocalizedString(@"_want_exit_", nil) preferredStyle:UIAlertControllerStyleActionSheet];
     
     [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) {
-        [appDelegate resetApplication];
+        [appDelegate removeAllSettingsWithKillEmAll:true];
     }]];
     
     [alertController addAction: [UIAlertAction actionWithTitle:NSLocalizedString(@"_cancel_", nil) style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) {

+ 1 - 1
iOSClient/Settings/NCSettingsBundleHelper.swift

@@ -41,7 +41,7 @@ class NCSettingsBundleHelper: NSObject {
 
             DispatchQueue.main.asyncAfter(deadline: .now() + delay) {
                 let appDelegate = (UIApplication.shared.delegate as? AppDelegate)!
-                appDelegate.resetApplication()
+                appDelegate.removeAllSettings(killEmAll: true)
             }
         }
     }