Browse Source

Change group share data to group.com.nextcloud.apps

Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
Marino Faggiana 2 years ago
parent
commit
e36a53d1d7

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -3701,7 +3701,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;
@@ -3764,7 +3764,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;

+ 4 - 3
iOSClient/AppDelegate.swift

@@ -250,7 +250,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
         NCNetworkingProcessUpload.shared.invalidateObserveTableMetadata()
         NCNetworkingProcessUpload.shared.stopTimer()
 
-        // Create file account for Nextcloud Talk
+        // Create file account for Nextcloud data share
         if let error = createDataAccountFile() {
             NKCommon.shared.writeLog("[ERROR] Create account file for Talk \(error.localizedDescription)")
         }
@@ -640,9 +640,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
     }
 
     func createDataAccountFile() -> Error? {
-        guard !account.isEmpty else { return nil }
+        guard !account.isEmpty, let dirGroupApps = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps) else { return nil }
 
-        let url =  CCUtility.getDirectoryGroup().appendingPathComponent(NCGlobal.shared.appDatabaseNextcloud + "/" + NCGlobal.shared.fileAccounts)
+        try? FileManager.default.createDirectory(at: dirGroupApps.appendingPathComponent(NCGlobal.shared.appDatabaseNextcloud), withIntermediateDirectories: true)
+        let url =  dirGroupApps.appendingPathComponent(NCGlobal.shared.appDatabaseNextcloud + "/" + NCGlobal.shared.fileAccounts)
 
         let tableAccount = NCManageDatabase.shared.getAllAccount()
         var accounts = [NKDataAccountFile]()

+ 2 - 2
iOSClient/Brand/NCBrand.swift

@@ -52,7 +52,7 @@ import UIKit
 
     // Capabilities Group
     @objc public var capabilitiesGroups: String = "group.it.twsweb.Crypto-Cloud"
-    @objc public var capabilitiesGroupsTalk: String = "group.com.nextcloud.Talk"
+    @objc public var capabilitiesGroupApps: String = "group.com.nextcloud.apps"
 
     // User Agent
     @objc public var userAgent: String = "Nextcloud-iOS"                                                            // Don't touch me !!
@@ -60,7 +60,7 @@ import UIKit
     // BRAND ONLY
     @objc public var use_login_web_personalized:        Bool = false                                                // Don't touch me !!
     @objc public var use_AppConfig:                     Bool = false                                                // Don't touch me !!
-    @objc public var use_talkDetect:                    Bool = true                                                 // Don't touch me !!
+    @objc public var use_GroupApp:                      Bool = true                                                 // Don't touch me !!
 
     // Options
     @objc public var use_default_auto_upload:           Bool = false

+ 1 - 1
iOSClient/Brand/iOSClient.entitlements

@@ -6,8 +6,8 @@
 	<string>development</string>
 	<key>com.apple.security.application-groups</key>
 	<array>
+		<string>group.com.nextcloud.apps</string>
 		<string>group.it.twsweb.Crypto-Cloud</string>
-		<string>group.com.nextcloud.Talk</string>
 	</array>
 	<key>keychain-access-groups</key>
 	<array>

+ 2 - 2
iOSClient/Login/NCLogin.swift

@@ -115,8 +115,8 @@ class NCLogin: UIViewController, UITextFieldDelegate, NCLoginQRCodeDelegate {
             navigationItem.leftBarButtonItem = navigationItemCancel
         }
 
-        if NCBrandOptions.shared.use_talkDetect, let dirGroupTalk = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupsTalk) {
-            let url = dirGroupTalk.appendingPathComponent(NCGlobal.shared.appDatabaseTalk + "/" + NCGlobal.shared.fileAccounts)
+        if NCBrandOptions.shared.use_GroupApp, let dirGroupApps = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroupApps) {
+            let url = dirGroupApps.appendingPathComponent(NCGlobal.shared.appDataShareTalk + "/" + NCGlobal.shared.fileAccounts)
             if FileManager.default.fileExists(atPath: url.path), let talkAccounts = NKCommon.shared.readDataAccountFile(at: url) {
                 var accountTemp = [NKDataAccountFile]()
                 for talkAccount in talkAccounts {

+ 1 - 1
iOSClient/NCGlobal.swift

@@ -77,7 +77,7 @@ class NCGlobal: NSObject {
     @objc let appDatabaseNextcloud                  = "Library/Application Support/Nextcloud"
     @objc let appScan                               = "Library/Application Support/Scan"
     @objc let appUserData                           = "Library/Application Support/UserData"
-    @objc let appDatabaseTalk                       = "Library/Application Support/Talk"
+    @objc let appDataShareTalk                      = "Library/Application Support/Talk"
 
     // Service
     //