]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Rename OwnCloudFinderSync Xcode projext to NextcloudIntegration
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Thu, 22 Dec 2022 15:03:40 +0000 (16:03 +0100)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 12 May 2023 05:21:07 +0000 (13:21 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
47 files changed:
shell_integration/MacOSX/CMakeLists.txt
shell_integration/MacOSX/Nextcloud.xcworkspace/contents.xcworkspacedata [new file with mode: 0644]
shell_integration/MacOSX/Nextcloud.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist [new file with mode: 0644]
shell_integration/MacOSX/Nextcloud.xcworkspace/xcshareddata/OwnCloud.xccheckout [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderEnumerator.swift [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExt.entitlements [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderItem.swift [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Info.plist [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.h [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSyncExt.entitlements [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/Info.plist [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LineProcessor.h [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LineProcessor.m [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LocalSocketClient.h [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LocalSocketClient.m [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/SyncClient.h [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/contents.xcworkspacedata [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/xcshareddata/xcschemes/FinderSyncExt.xcscheme [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/desktopclient/Info.plist [new file with mode: 0644]
shell_integration/MacOSX/NextcloudIntegration/desktopclient/main.m [new file with mode: 0644]
shell_integration/MacOSX/OwnCloud.xcworkspace/contents.xcworkspacedata [deleted file]
shell_integration/MacOSX/OwnCloud.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist [deleted file]
shell_integration/MacOSX/OwnCloud.xcworkspace/xcshareddata/OwnCloud.xccheckout [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderEnumerator.swift [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderExt.entitlements [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderExtension.swift [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderItem.swift [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/Info.plist [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.h [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSyncExt.entitlements [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/Info.plist [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LineProcessor.h [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LineProcessor.m [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.h [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.m [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/SyncClient.h [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.xcworkspace/contents.xcworkspacedata [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/xcshareddata/xcschemes/FinderSyncExt.xcscheme [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/desktopclient/Info.plist [deleted file]
shell_integration/MacOSX/OwnCloudFinderSync/desktopclient/main.m [deleted file]

index 1bcfecc17c74fbc127bf495a1a03bfdf6cbfb389..0c51b64ee630717a070f3736f60dceb236d93a76 100644 (file)
@@ -7,7 +7,7 @@ if(APPLE)
   # those user-defined settings to build the plist.
   add_custom_target( mac_overlayplugin ALL
     xcodebuild ARCHS=${CMAKE_OSX_ARCHITECTURES} ONLY_ACTIVE_ARCH=NO
-    -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj
+    -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj
     -target FinderSyncExt -configuration Release "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
     "OC_OEM_SHARE_ICNS=${OC_OEM_SHARE_ICNS}"
     "OC_APPLICATION_NAME=${APPLICATION_NAME}"
@@ -18,7 +18,7 @@ if(APPLE)
 
   add_custom_target( mac_fileproviderplugin ALL
     xcodebuild ARCHS=${CMAKE_OSX_ARCHITECTURES} ONLY_ACTIVE_ARCH=NO
-    -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj
+    -project ${CMAKE_SOURCE_DIR}/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj
     -target FileProviderExt -configuration Release "SYMROOT=${CMAKE_CURRENT_BINARY_DIR}"
     "OC_APPLICATION_EXECUTABLE_NAME=${APPLICATION_EXECUTABLE}"
     "OC_APPLICATION_VENDOR=${APPLICATION_VENDOR}"
diff --git a/shell_integration/MacOSX/Nextcloud.xcworkspace/contents.xcworkspacedata b/shell_integration/MacOSX/Nextcloud.xcworkspace/contents.xcworkspacedata
new file mode 100644 (file)
index 0000000..ed78110
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "group:NextcloudIntegration/NextcloudIntegration.xcodeproj">
+   </FileRef>
+</Workspace>
diff --git a/shell_integration/MacOSX/Nextcloud.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/shell_integration/MacOSX/Nextcloud.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644 (file)
index 0000000..18d9810
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>IDEDidComputeMac32BitWarning</key>
+       <true/>
+</dict>
+</plist>
diff --git a/shell_integration/MacOSX/Nextcloud.xcworkspace/xcshareddata/OwnCloud.xccheckout b/shell_integration/MacOSX/Nextcloud.xcworkspace/xcshareddata/OwnCloud.xccheckout
new file mode 100644 (file)
index 0000000..9512111
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>IDESourceControlProjectFavoriteDictionaryKey</key>
+       <false/>
+       <key>IDESourceControlProjectIdentifier</key>
+       <string>5264E8F5-AB49-45F3-868F-647EEFAB70E0</string>
+       <key>IDESourceControlProjectName</key>
+       <string>OwnCloud</string>
+       <key>IDESourceControlProjectOriginsDictionary</key>
+       <dict>
+               <key>D67321A19EF879CA55BF889202BA8C23AC9AA2B5</key>
+               <string>ssh://github.com/owncloud/client.git</string>
+       </dict>
+       <key>IDESourceControlProjectPath</key>
+       <string>shell_integration/MacOSX/OwnCloud.xcworkspace</string>
+       <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
+       <dict>
+               <key>D67321A19EF879CA55BF889202BA8C23AC9AA2B5</key>
+               <string>../../..</string>
+       </dict>
+       <key>IDESourceControlProjectURL</key>
+       <string>ssh://github.com/owncloud/client.git</string>
+       <key>IDESourceControlProjectVersion</key>
+       <integer>111</integer>
+       <key>IDESourceControlProjectWCCIdentifier</key>
+       <string>D67321A19EF879CA55BF889202BA8C23AC9AA2B5</string>
+       <key>IDESourceControlProjectWCConfigurations</key>
+       <array>
+               <dict>
+                       <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
+                       <string>public.vcs.git</string>
+                       <key>IDESourceControlWCCIdentifierKey</key>
+                       <string>D67321A19EF879CA55BF889202BA8C23AC9AA2B5</string>
+                       <key>IDESourceControlWCCName</key>
+                       <string>client</string>
+               </dict>
+       </array>
+</dict>
+</plist>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderEnumerator.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderEnumerator.swift
new file mode 100644 (file)
index 0000000..9cd3563
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+import FileProvider
+
+class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
+    
+    private let enumeratedItemIdentifier: NSFileProviderItemIdentifier
+    private let anchor = NSFileProviderSyncAnchor("an anchor".data(using: .utf8)!)
+    
+    init(enumeratedItemIdentifier: NSFileProviderItemIdentifier) {
+        self.enumeratedItemIdentifier = enumeratedItemIdentifier
+        super.init()
+    }
+
+    func invalidate() {
+        // TODO: perform invalidation of server connection if necessary
+    }
+
+    func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {
+        /* TODO:
+         - inspect the page to determine whether this is an initial or a follow-up request
+         
+         If this is an enumerator for a directory, the root container or all directories:
+         - perform a server request to fetch directory contents
+         If this is an enumerator for the active set:
+         - perform a server request to update your local database
+         - fetch the active set from your local database
+         
+         - inform the observer about the items returned by the server (possibly multiple times)
+         - inform the observer that you are finished with this page
+         */
+        observer.didEnumerate([FileProviderItem(identifier: NSFileProviderItemIdentifier("a file"))])
+        observer.finishEnumerating(upTo: nil)
+    }
+    
+    func enumerateChanges(for observer: NSFileProviderChangeObserver, from anchor: NSFileProviderSyncAnchor) {
+        /* TODO:
+         - query the server for updates since the passed-in sync anchor
+         
+         If this is an enumerator for the active set:
+         - note the changes in your local database
+         
+         - inform the observer about item deletions and updates (modifications + insertions)
+         - inform the observer when you have finished enumerating up to a subsequent sync anchor
+         */
+        observer.finishEnumeratingChanges(upTo: anchor, moreComing: false)
+    }
+
+    func currentSyncAnchor(completionHandler: @escaping (NSFileProviderSyncAnchor?) -> Void) {
+        completionHandler(anchor)
+    }
+}
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExt.entitlements b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExt.entitlements
new file mode 100644 (file)
index 0000000..f399700
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>com.apple.application-identifier</key>
+       <string>$(AppIdentifierPrefix)$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+       <key>com.apple.security.app-sandbox</key>
+       <true/>
+       <key>com.apple.security.application-groups</key>
+       <array>
+               <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
+       </array>
+</dict>
+</plist>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift
new file mode 100644 (file)
index 0000000..f32c49b
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+import FileProvider
+
+class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension {
+    let domain: NSFileProviderDomain
+    
+    required init(domain: NSFileProviderDomain) {
+        self.domain = domain
+        // The containing application must create a domain using `NSFileProviderManager.add(_:, completionHandler:)`. The system will then launch the application extension process, call `FileProviderExtension.init(domain:)` to instantiate the extension for that domain, and call methods on the instance.
+        super.init()
+    }
+    
+    func invalidate() {
+        // TODO: cleanup any resources
+    }
+    
+    func item(for identifier: NSFileProviderItemIdentifier, request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) -> Progress {
+        // resolve the given identifier to a record in the model
+        
+        // TODO: implement the actual lookup
+
+        completionHandler(FileProviderItem(identifier: identifier), nil)
+        return Progress()
+    }
+    
+    func fetchContents(for itemIdentifier: NSFileProviderItemIdentifier, version requestedVersion: NSFileProviderItemVersion?, request: NSFileProviderRequest, completionHandler: @escaping (URL?, NSFileProviderItem?, Error?) -> Void) -> Progress {
+        // TODO: implement fetching of the contents for the itemIdentifier at the specified version
+        
+        completionHandler(nil, nil, NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
+        return Progress()
+    }
+    
+    func createItem(basedOn itemTemplate: NSFileProviderItem, fields: NSFileProviderItemFields, contents url: URL?, options: NSFileProviderCreateItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress {
+        // TODO: a new item was created on disk, process the item's creation
+        
+        completionHandler(itemTemplate, [], false, nil)
+        return Progress()
+    }
+    
+    func modifyItem(_ item: NSFileProviderItem, baseVersion version: NSFileProviderItemVersion, changedFields: NSFileProviderItemFields, contents newContents: URL?, options: NSFileProviderModifyItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress {
+        // TODO: an item was modified on disk, process the item's modification
+        
+        completionHandler(nil, [], false, NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
+        return Progress()
+    }
+    
+    func deleteItem(identifier: NSFileProviderItemIdentifier, baseVersion version: NSFileProviderItemVersion, options: NSFileProviderDeleteItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (Error?) -> Void) -> Progress {
+        // TODO: an item was deleted on disk, process the item's deletion
+        
+        completionHandler(NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
+        return Progress()
+    }
+    
+    func enumerator(for containerItemIdentifier: NSFileProviderItemIdentifier, request: NSFileProviderRequest) throws -> NSFileProviderEnumerator {
+        return FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier)
+    }
+}
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderItem.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderItem.swift
new file mode 100644 (file)
index 0000000..fa793e4
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+import FileProvider
+import UniformTypeIdentifiers
+
+class FileProviderItem: NSObject, NSFileProviderItem {
+
+    // TODO: implement an initializer to create an item from your extension's backing model
+    // TODO: implement the accessors to return the values from your extension's backing model
+    
+    private let identifier: NSFileProviderItemIdentifier
+    
+    init(identifier: NSFileProviderItemIdentifier) {
+        self.identifier = identifier
+    }
+    
+    var itemIdentifier: NSFileProviderItemIdentifier {
+        return identifier
+    }
+    
+    var parentItemIdentifier: NSFileProviderItemIdentifier {
+        return .rootContainer
+    }
+    
+    var capabilities: NSFileProviderItemCapabilities {
+        return [.allowsReading, .allowsWriting, .allowsRenaming, .allowsReparenting, .allowsTrashing, .allowsDeleting]
+    }
+    
+    var itemVersion: NSFileProviderItemVersion {
+        NSFileProviderItemVersion(contentVersion: "a content version".data(using: .utf8)!, metadataVersion: "a metadata version".data(using: .utf8)!)
+    }
+    
+    var filename: String {
+        return identifier.rawValue
+    }
+    
+    var contentType: UTType {
+        return identifier == NSFileProviderItemIdentifier.rootContainer ? .folder : .plainText
+    }
+}
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Info.plist b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/Info.plist
new file mode 100644 (file)
index 0000000..5072333
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>NSExtension</key>
+       <dict>
+               <key>NSExtensionFileProviderDocumentGroup</key>
+               <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
+               <key>NSExtensionFileProviderSupportsEnumeration</key>
+               <true/>
+               <key>NSExtensionPointIdentifier</key>
+               <string>com.apple.fileprovider-nonui</string>
+               <key>NSExtensionPrincipalClass</key>
+               <string>$(PRODUCT_MODULE_NAME).FileProviderExtension</string>
+       </dict>
+</dict>
+</plist>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.h b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.h
new file mode 100644 (file)
index 0000000..4cf5765
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) by Jocelyn Turcotte <jturcotte@woboq.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+
+#import <Cocoa/Cocoa.h>
+#import <FinderSync/FinderSync.h>
+#import "SyncClient.h"
+#import "LineProcessor.h"
+#import "LocalSocketClient.h"
+
+@interface FinderSync : FIFinderSync <SyncClientDelegate>
+{
+    NSMutableSet *_registeredDirectories;
+    NSString *_shareMenuTitle;
+    NSMutableDictionary *_strings;
+    NSMutableArray *_menuItems;
+    NSCondition *_menuIsComplete;
+}
+
+@property LineProcessor *lineProcessor;
+@property LocalSocketClient *localSocketClient;
+
+@end
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSync.m
new file mode 100644 (file)
index 0000000..84a124f
--- /dev/null
@@ -0,0 +1,244 @@
+/*
+ * Copyright (C) by Jocelyn Turcotte <jturcotte@woboq.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+
+#import "FinderSync.h"
+
+
+@implementation FinderSync
+
+- (instancetype)init
+{
+       self = [super init];
+
+    if (self) {
+        FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
+        NSBundle *extBundle = [NSBundle bundleForClass:[self class]];
+        // This was added to the bundle's Info.plist to get it from the build system
+        NSString *socketApiPrefix = [extBundle objectForInfoDictionaryKey:@"SocketApiPrefix"];
+        
+        NSImage *ok = [extBundle imageForResource:@"ok.icns"];
+        NSImage *ok_swm = [extBundle imageForResource:@"ok_swm.icns"];
+        NSImage *sync = [extBundle imageForResource:@"sync.icns"];
+        NSImage *warning = [extBundle imageForResource:@"warning.icns"];
+        NSImage *error = [extBundle imageForResource:@"error.icns"];
+        
+        [syncController setBadgeImage:ok label:@"Up to date" forBadgeIdentifier:@"OK"];
+        [syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"SYNC"];
+        [syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"NEW"];
+        [syncController setBadgeImage:warning label:@"Ignored" forBadgeIdentifier:@"IGNORE"];
+        [syncController setBadgeImage:error label:@"Error" forBadgeIdentifier:@"ERROR"];
+        [syncController setBadgeImage:ok_swm label:@"Shared" forBadgeIdentifier:@"OK+SWM"];
+        [syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"SYNC+SWM"];
+        [syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"NEW+SWM"];
+        [syncController setBadgeImage:warning label:@"Ignored" forBadgeIdentifier:@"IGNORE+SWM"];
+        [syncController setBadgeImage:error label:@"Error" forBadgeIdentifier:@"ERROR+SWM"];
+        
+        // The Mach port name needs to:
+        // - Be prefixed with the code signing Team ID
+        // - Then infixed with the sandbox App Group
+        // - The App Group itself must be a prefix of (or equal to) the application bundle identifier
+        // We end up in the official signed client with: 9B5WD74GWJ.com.owncloud.desktopclient.socket
+        // With ad-hoc signing (the '-' signing identity) we must drop the Team ID.
+        // When the code isn't sandboxed (e.g. the OC client or the legacy overlay icon extension)
+        // the OS doesn't seem to put any restriction on the port name, so we just follow what
+        // the sandboxed App Extension needs.
+        // https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24
+        
+        NSURL *container = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:socketApiPrefix];
+        NSURL *socketPath = [container URLByAppendingPathComponent:@".socket" isDirectory:NO];
+        
+        NSLog(@"Socket path: %@", socketPath.path);
+        
+        if (socketPath.path) {
+            self.lineProcessor = [[LineProcessor alloc] initWithDelegate:self];
+            self.localSocketClient = [[LocalSocketClient alloc] init:socketPath.path
+                                                       lineProcessor:self.lineProcessor];
+            [self.localSocketClient start];
+        } else {
+            NSLog(@"No socket path. Not initiating local socket client.");
+            self.localSocketClient = nil;
+        }
+        _registeredDirectories = [[NSMutableSet alloc] init];
+        _strings = [[NSMutableDictionary alloc] init];
+        _menuIsComplete = [[NSCondition alloc] init];
+    }
+
+    return self;
+}
+
+#pragma mark - Primary Finder Sync protocol methods
+
+- (void)requestBadgeIdentifierForURL:(NSURL *)url
+{
+       BOOL isDir;
+       if ([[NSFileManager defaultManager] fileExistsAtPath:[url path] isDirectory: &isDir] == NO) {
+               NSLog(@"ERROR: Could not determine file type of %@", [url path]);
+               isDir = NO;
+       }
+
+       NSString* normalizedPath = [[url path] decomposedStringWithCanonicalMapping];
+       [self.localSocketClient askForIcon:normalizedPath isDirectory:isDir];
+}
+
+#pragma mark - Menu and toolbar item support
+
+- (NSString*) selectedPathsSeparatedByRecordSeparator
+{
+       FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
+       NSMutableString *string = [[NSMutableString alloc] init];
+       [syncController.selectedItemURLs enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
+               if (string.length > 0) {
+                       [string appendString:@"\x1e"]; // record separator
+               }
+               NSString* normalizedPath = [[obj path] decomposedStringWithCanonicalMapping];
+               [string appendString:normalizedPath];
+       }];
+       return string;
+}
+
+- (void)waitForMenuToArrive
+{
+    [self->_menuIsComplete lock];
+    [self->_menuIsComplete wait];
+    [self->_menuIsComplete unlock];
+}
+
+- (NSMenu *)menuForMenuKind:(FIMenuKind)whichMenu
+{
+    if(![self.localSocketClient isConnected]) {
+        return nil;
+    }
+    
+       FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
+       NSMutableSet *rootPaths = [[NSMutableSet alloc] init];
+       [syncController.directoryURLs enumerateObjectsUsingBlock: ^(id obj, BOOL *stop) {
+               [rootPaths addObject:[obj path]];
+       }];
+
+       // The server doesn't support sharing a root directory so do not show the option in this case.
+       // It is still possible to get a problematic sharing by selecting both the root and a child,
+       // but this is so complicated to do and meaningless that it's not worth putting this check
+       // also in shareMenuAction.
+       __block BOOL onlyRootsSelected = YES;
+       [syncController.selectedItemURLs enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
+               if (![rootPaths member:[obj path]]) {
+                       onlyRootsSelected = NO;
+                       *stop = YES;
+               }
+       }];
+
+       NSString *paths = [self selectedPathsSeparatedByRecordSeparator];
+       [self.localSocketClient askOnSocket:paths query:@"GET_MENU_ITEMS"];
+    
+    // Since the LocalSocketClient communicates asynchronously. wait here until the menu
+    // is delivered by another thread
+    [self waitForMenuToArrive];
+
+       id contextMenuTitle = [_strings objectForKey:@"CONTEXT_MENU_TITLE"];
+       if (contextMenuTitle && !onlyRootsSelected) {
+               NSMenu *menu = [[NSMenu alloc] initWithTitle:@""];
+               NSMenu *subMenu = [[NSMenu alloc] initWithTitle:@""];
+               NSMenuItem *subMenuItem = [menu addItemWithTitle:contextMenuTitle action:nil keyEquivalent:@""];
+               subMenuItem.submenu = subMenu;
+               subMenuItem.image = [[NSBundle mainBundle] imageForResource:@"app.icns"];
+
+               // There is an annoying bug in macOS (at least 10.13.3), it does not use/copy over the representedObject of a menu item
+               // So we have to use tag instead.
+               int idx = 0;
+               for (NSArray* item in _menuItems) {
+                       NSMenuItem *actionItem = [subMenu addItemWithTitle:[item valueForKey:@"text"]
+                                                                                                               action:@selector(subMenuActionClicked:)
+                                                                                                keyEquivalent:@""];
+                       [actionItem setTag:idx];
+                       [actionItem setTarget:self];
+                       NSString *flags = [item valueForKey:@"flags"]; // e.g. "d"
+                       if ([flags rangeOfString:@"d"].location != NSNotFound) {
+                               [actionItem setEnabled:false];
+                       }
+                       idx++;
+               }
+               return menu;
+       }
+       return nil;
+}
+
+- (void)subMenuActionClicked:(id)sender {
+       long idx = [(NSMenuItem*)sender tag];
+       NSString *command = [[_menuItems objectAtIndex:idx] valueForKey:@"command"];
+       NSString *paths = [self selectedPathsSeparatedByRecordSeparator];
+       [self.localSocketClient askOnSocket:paths query:command];
+}
+
+#pragma mark - SyncClientProxyDelegate implementation
+
+- (void)setResultForPath:(NSString*)path result:(NSString*)result
+{
+       NSString *normalizedPath = [path decomposedStringWithCanonicalMapping];
+       [[FIFinderSyncController defaultController] setBadgeIdentifier:result forURL:[NSURL fileURLWithPath:normalizedPath]];
+}
+
+- (void)reFetchFileNameCacheForPath:(NSString*)path
+{
+    
+}
+
+- (void)registerPath:(NSString*)path
+{
+       assert(_registeredDirectories);
+       [_registeredDirectories addObject:[NSURL fileURLWithPath:path]];
+       [FIFinderSyncController defaultController].directoryURLs = _registeredDirectories;
+}
+
+- (void)unregisterPath:(NSString*)path
+{
+       [_registeredDirectories removeObject:[NSURL fileURLWithPath:path]];
+       [FIFinderSyncController defaultController].directoryURLs = _registeredDirectories;
+}
+
+- (void)setString:(NSString*)key value:(NSString*)value
+{
+       [_strings setObject:value forKey:key];
+}
+
+- (void)resetMenuItems
+{
+       _menuItems = [[NSMutableArray alloc] init];
+}
+- (void)addMenuItem:(NSDictionary *)item {
+    NSLog(@"Adding menu item.");
+       [_menuItems addObject:item];
+}
+
+- (void)menuHasCompleted
+{
+    NSLog(@"Emitting menu is complete signal now.");
+    [self->_menuIsComplete signal];
+}
+
+- (void)connectionDidDie
+{
+       [_strings removeAllObjects];
+       [_registeredDirectories removeAllObjects];
+       // For some reason the FIFinderSync cache doesn't seem to be cleared for the root item when
+       // we reset the directoryURLs (seen on macOS 10.12 at least).
+       // First setting it to the FS root and then setting it to nil seems to work around the issue.
+       [FIFinderSyncController defaultController].directoryURLs = [NSSet setWithObject:[NSURL fileURLWithPath:@"/"]];
+       // This will tell Finder that this extension isn't attached to any directory
+       // until we can reconnect to the sync client.
+       [FIFinderSyncController defaultController].directoryURLs = nil;
+}
+
+@end
+
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSyncExt.entitlements b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/FinderSyncExt.entitlements
new file mode 100644 (file)
index 0000000..5d2a36d
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>com.apple.security.app-sandbox</key>
+       <true/>
+       <key>com.apple.security.application-groups</key>
+       <array>
+               <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
+       </array>
+</dict>
+</plist>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/Info.plist b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/Info.plist
new file mode 100644 (file)
index 0000000..2a669ce
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>en</string>
+       <key>CFBundleDisplayName</key>
+       <string>$(OC_APPLICATION_NAME) Extensions</string>
+       <key>CFBundleExecutable</key>
+       <string>$(EXECUTABLE_NAME)</string>
+       <key>CFBundleIdentifier</key>
+       <string>$(OC_APPLICATION_REV_DOMAIN).$(PRODUCT_NAME:rfc1034identifier)</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>$(PRODUCT_NAME)</string>
+       <key>CFBundlePackageType</key>
+       <string>XPC!</string>
+       <key>CFBundleShortVersionString</key>
+       <string>1.0</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>1</string>
+       <key>LSMinimumSystemVersion</key>
+       <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
+       <key>LSUIElement</key>
+       <true/>
+       <key>NSExtension</key>
+       <dict>
+               <key>NSExtensionAttributes</key>
+               <dict/>
+               <key>NSExtensionPointIdentifier</key>
+               <string>com.apple.FinderSync</string>
+               <key>NSExtensionPrincipalClass</key>
+               <string>FinderSync</string>
+       </dict>
+       <key>NSPrincipalClass</key>
+       <string>NSApplication</string>
+       <key>SocketApiPrefix</key>
+       <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
+</dict>
+</plist>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LineProcessor.h b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LineProcessor.h
new file mode 100644 (file)
index 0000000..137ce62
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#import "SyncClient.h"
+
+#ifndef LineProcessor_h
+#define LineProcessor_h
+
+/// This class is in charge of dispatching all work that must be done on the UI side of the extension.
+/// Tasks are dispatched on the main UI thread for this reason.
+///
+/// These tasks are parsed from byte data (UTF9 strings) acquired from the socket; look at the
+/// LocalSocketClient for more detail on how data is read from and written to the socket.
+
+@interface LineProcessor : NSObject
+@property(nonatomic, weak)id<SyncClientDelegate> delegate;
+
+- (instancetype)initWithDelegate:(id<SyncClientDelegate>)delegate;
+- (void)process:(NSString*)line;
+
+@end
+#endif /* LineProcessor_h */
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LineProcessor.m b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LineProcessor.m
new file mode 100644 (file)
index 0000000..56ec704
--- /dev/null
@@ -0,0 +1,102 @@
+/*
+ * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#import <Foundation/Foundation.h>
+#import "LineProcessor.h"
+
+@implementation LineProcessor
+
+-(instancetype)initWithDelegate:(id<SyncClientDelegate>)delegate
+{
+    NSLog(@"Init line processor with delegate.");
+    self = [super init];
+    if (self) {
+        self.delegate = delegate;
+    }
+    return self;
+}
+
+-(void)process:(NSString*)line
+{
+    NSLog(@"Processing line: %@", line);
+    NSArray *split = [line componentsSeparatedByString:@":"];
+    NSString *command = [split objectAtIndex:0];
+    
+    NSLog(@"Command: %@", command);
+    
+    if([command isEqualToString:@"STATUS"]) {
+        NSString *result = [split objectAtIndex:1];
+        NSArray *pathSplit = [split subarrayWithRange:NSMakeRange(2, [split count] - 2)]; // Get everything after location 2
+        NSString *path = [pathSplit componentsJoinedByString:@":"];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            NSLog(@"Setting result %@ for path %@", result, path);
+            [self.delegate setResultForPath:path result:result];
+        });
+    } else if([command isEqualToString:@"UPDATE_VIEW"]) {
+        NSString *path = [split objectAtIndex:1];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            NSLog(@"Re-fetching filename cache for path %@", path);
+            [self.delegate reFetchFileNameCacheForPath:path];
+        });
+    } else if([command isEqualToString:@"REGISTER_PATH"]) {
+        NSString *path = [split objectAtIndex:1];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            NSLog(@"Registering path %@", path);
+            [self.delegate registerPath:path];
+        });
+    } else if([command isEqualToString:@"UNREGISTER_PATH"]) {
+        NSString *path = [split objectAtIndex:1];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            NSLog(@"Unregistering path %@", path);
+            [self.delegate unregisterPath:path];
+        });
+    } else if([command isEqualToString:@"GET_STRINGS"]) {
+        // BEGIN and END messages, do nothing.
+        return;
+    } else if([command isEqualToString:@"STRING"]) {
+        NSString *key = [split objectAtIndex:1];
+        NSString *value = [split objectAtIndex:2];
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            NSLog(@"Setting string %@ to value %@", key, value);
+            [self.delegate setString:key value:value];
+        });
+    } else if([command isEqualToString:@"GET_MENU_ITEMS"]) {
+        if([[split objectAtIndex:1] isEqualToString:@"BEGIN"]) {
+            dispatch_async(dispatch_get_main_queue(), ^{
+                NSLog(@"Resetting menu items.");
+                [self.delegate resetMenuItems];
+            });
+        } else {
+            NSLog(@"Emitting menu has completed signal.");
+            [self.delegate menuHasCompleted];
+        }
+    } else if([command isEqualToString:@"MENU_ITEM"]) {
+        NSDictionary *item = @{@"command": [split objectAtIndex:1], @"flags": [split objectAtIndex:2], @"text": [split objectAtIndex:3]};
+        
+        dispatch_async(dispatch_get_main_queue(), ^{
+            NSLog(@"Adding menu item with command %@, flags %@, and text %@", [split objectAtIndex:1], [split objectAtIndex:2], [split objectAtIndex:3]);
+            [self.delegate addMenuItem:item];
+        });
+    } else {
+        // LOG UNKOWN COMMAND
+        NSLog(@"Unkown command: %@", command);
+    }
+}
+
+@end
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LocalSocketClient.h b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LocalSocketClient.h
new file mode 100644 (file)
index 0000000..4a858cd
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#import "LineProcessor.h"
+
+#ifndef LocalSocketClient_h
+#define LocalSocketClient_h
+#define BUF_SIZE 4096
+
+/// Class handling asynchronous communication with a server over a local UNIX socket.
+///
+/// The implementation uses a `DispatchQueue` and `DispatchSource`s to handle asynchronous communication and thread
+/// safety. The delegate that handles the line-decoding is **not invoked on the UI thread**, but the (random) thread associated
+/// with the `DispatchQueue`.
+///
+/// If any UI work needs to be done, the `LineProcessor` class dispatches this work on the main queue (so the UI thread) itself.
+///
+/// Other than the `init(withSocketPath:, lineProcessor)` and the `start()` method, all work is done "on the dispatch
+/// queue". The `localSocketQueue` is a serial dispatch queue (so a maximum of 1, and only 1, task is run at any
+/// moment), which guarantees safe access to instance variables. Both `askOnSocket(_:, query:)` and
+/// `askForIcon(_:, isDirectory:)` will internally dispatch the work on the `DispatchQueue`.
+///
+/// Sending and receiving data to and from the socket, is handled by two `DispatchSource`s. These will run an event
+/// handler when data can be read from resp. written to the socket. These handlers will also be run on the
+/// `DispatchQueue`.
+
+@interface LocalSocketClient : NSObject
+
+@property NSString* socketPath;
+@property LineProcessor* lineProcessor;
+@property int sock;
+@property dispatch_queue_t localSocketQueue;
+@property dispatch_source_t readSource;
+@property dispatch_source_t writeSource;
+@property NSMutableData* inBuffer;
+@property NSMutableData* outBuffer;
+
+- (instancetype)init:(NSString*)socketPath lineProcessor:(LineProcessor*)lineProcessor;
+- (BOOL)isConnected;
+- (void)start;
+- (void)restart;
+- (void)closeConnection;
+- (NSString*)strErr;
+- (void)askOnSocket:(NSString*)path query:(NSString*)verb;
+- (void)askForIcon:(NSString*)path isDirectory:(BOOL)isDirectory;
+- (void)readFromSocket;
+- (void)writeToSocket;
+- (void)processInBuffer;
+
+@end
+#endif /* LocalSocketClient_h */
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LocalSocketClient.m b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/LocalSocketClient.m
new file mode 100644 (file)
index 0000000..ab43a5d
--- /dev/null
@@ -0,0 +1,328 @@
+/*
+ * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#import <Foundation/Foundation.h>
+#import "LocalSocketClient.h"
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <stdio.h>
+#include <string.h>
+
+@implementation LocalSocketClient
+
+- (instancetype)init:(NSString*)socketPath lineProcessor:(LineProcessor*)lineProcessor
+{
+    NSLog(@"Initiating local socket client.");
+    self = [super init];
+    
+    if(self) {
+        self.socketPath = socketPath;
+        self.lineProcessor = lineProcessor;
+        
+        self.sock = -1;
+        self.localSocketQueue = dispatch_queue_create("localSocketQueue", DISPATCH_QUEUE_SERIAL);
+        
+        self.inBuffer = [NSMutableData data];
+        self.outBuffer = [NSMutableData data];
+    }
+        
+    return self;
+}
+
+- (BOOL)isConnected
+{
+    NSLog(@"Checking is connected: %@", self.sock != -1 ? @"YES" : @"NO");
+    return self.sock != -1;
+}
+
+- (void)start
+{
+    if([self isConnected]) {
+        NSLog(@"Socket client already connected. Not starting.");
+        return;
+    }
+    
+    struct sockaddr_un localSocketAddr;
+    unsigned long socketPathByteCount = [self.socketPath lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; // add 1 for the NUL terminator char
+    int maxByteCount = sizeof(localSocketAddr.sun_path);
+    
+    if(socketPathByteCount > maxByteCount) {
+        // LOG THAT THE SOCKET PATH IS TOO LONG HERE
+        NSLog(@"Socket path '%@' is too long: maximum socket path length is %i, this path is of length %lu", self.socketPath, maxByteCount, socketPathByteCount);
+        return;
+    }
+    
+    NSLog(@"Opening local socket...");
+    
+    // LOG THAT THE SOCKET IS BEING OPENED HERE
+    self.sock = socket(AF_LOCAL, SOCK_STREAM, 0);
+    
+    if(self.sock == -1) {
+        NSLog(@"Cannot open socket: '%@'", [self strErr]);
+        [self restart];
+        return;
+    }
+    
+    NSLog(@"Local socket opened. Connecting to '%@' ...", self.socketPath);
+    
+    localSocketAddr.sun_family = AF_LOCAL & 0xff;
+    
+    const char* pathBytes = [self.socketPath UTF8String];
+    strcpy(localSocketAddr.sun_path, pathBytes);
+    
+    int connectionStatus = connect(self.sock, (struct sockaddr*)&localSocketAddr, sizeof(localSocketAddr));
+    
+    if(connectionStatus == -1) {
+        NSLog(@"Could not connect to '%@': '%@'", self.socketPath, [self strErr]);
+        [self restart];
+        return;
+    }
+    
+    int flags = fcntl(self.sock, F_GETFL, 0);
+    
+    if(fcntl(self.sock, F_SETFL, flags | O_NONBLOCK) == -1) {
+        NSLog(@"Could not set socket to non-blocking mode: '%@'", [self strErr]);
+        [self restart];
+        return;
+    }
+    
+    NSLog(@"Connected to socket. Setting up dispatch sources...");
+    
+    self.readSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, self.sock, 0, self.localSocketQueue);
+    dispatch_source_set_event_handler(self.readSource, ^(void){ [self readFromSocket]; });
+    dispatch_source_set_cancel_handler(self.readSource, ^(void){
+        self.readSource = nil;
+        [self closeConnection];
+    });
+    
+    self.writeSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_WRITE, self.sock, 0, self.localSocketQueue);
+    dispatch_source_set_event_handler(self.writeSource, ^(void){ [self writeToSocket]; });
+    dispatch_source_set_cancel_handler(self.writeSource, ^(void){
+        self.writeSource = nil;
+        [self closeConnection];
+    });
+    
+    // These dispatch sources are suspended upon creation.
+    // We resume the writeSource when we actually have something to write, suspending it again once our outBuffer is empty.
+    // We start the readSource now.
+    
+    NSLog(@"Starting to read from socket");
+    
+    dispatch_resume(self.readSource);
+    [self askOnSocket:@"" query:@"GET_STRINGS"];
+}
+
+- (void)restart
+{
+    NSLog(@"Restarting connection to socket.");
+    [self closeConnection];
+    dispatch_async(dispatch_get_main_queue(), ^(void){
+        [NSTimer scheduledTimerWithTimeInterval:5 repeats:NO block:^(NSTimer* timer) {
+            [self start];
+        }];
+    });
+}
+
+- (void)closeConnection
+{
+    NSLog(@"Closing connection.");
+    
+    if(self.readSource) {
+        // Since dispatch_source_cancel works asynchronously, if we deallocate the dispatch source here then we can
+        // cause a crash. So instead we strongly hold a reference to the read source and deallocate it asynchronously
+        // with the handler.
+        __block dispatch_source_t previousReadSource = self.readSource;
+        dispatch_source_set_cancel_handler(self.readSource, ^{
+            previousReadSource = nil;
+        });
+        dispatch_source_cancel(self.readSource);
+        // The readSource is still alive due to the other reference and will be deallocated by the cancel handler
+        self.readSource = nil;
+    }
+    
+    if(self.writeSource) {
+        // Same deal with the write source
+        __block dispatch_source_t previousWriteSource = self.writeSource;
+        dispatch_source_set_cancel_handler(self.writeSource, ^{
+            previousWriteSource = nil;
+        });
+        dispatch_source_cancel(self.writeSource);
+        self.writeSource = nil;
+    }
+
+    [self.inBuffer setLength:0];
+    [self.outBuffer setLength: 0];
+    
+    if(self.sock != -1) {
+        close(self.sock);
+        self.sock = -1;
+    }
+}
+
+- (NSString*)strErr
+{
+    int err = errno;
+    const char *errStr = strerror(err);
+    NSString *errorStr = [NSString stringWithUTF8String:errStr];
+    
+    if([errorStr length] == 0) {
+        return errorStr;
+    } else {
+        return [NSString stringWithFormat:@"Unknown error code: %i\10", err];
+    }
+}
+
+- (void)askOnSocket:(NSString *)path query:(NSString *)verb
+{
+    NSString *line = [NSString stringWithFormat:@"%@:%@\n", verb, path];
+    dispatch_async(self.localSocketQueue, ^(void) {
+        if(![self isConnected]) {
+            return;
+        }
+        
+        BOOL writeSourceIsSuspended = [self.outBuffer length] == 0;
+        
+        [self.outBuffer appendData:[line dataUsingEncoding:NSUTF8StringEncoding]];
+        
+        NSLog(@"Writing to out buffer: '%@'", line);
+        NSLog(@"Out buffer now %li bytes", [self.outBuffer length]);
+        
+        if(writeSourceIsSuspended) {
+            NSLog(@"Resuming write dispatch source.");
+            dispatch_resume(self.writeSource);
+        }
+    });
+}
+
+- (void)writeToSocket
+{
+    if(![self isConnected]) {
+        return;
+    }
+    
+    if([self.outBuffer length] == 0) {
+        NSLog(@"Empty out buffer, suspending write dispatch source.");
+        dispatch_suspend(self.writeSource);
+        return;
+    }
+    
+    NSLog(@"About to write %li bytes from outbuffer to socket.", [self.outBuffer length]);
+    
+    long bytesWritten = write(self.sock, [self.outBuffer bytes], [self.outBuffer length]);
+    char lineWritten[[self.outBuffer length]];
+    memcpy(lineWritten, [self.outBuffer bytes], [self.outBuffer length]);
+    NSLog(@"Wrote %li bytes to socket. Line written was: '%@'", bytesWritten, [NSString stringWithUTF8String:lineWritten]);
+    
+    if(bytesWritten == 0) {
+        // 0 means we reached "end of file" and thus the socket was closed\10. So let's restart it
+        NSLog(@"Socket was closed. Restarting...");
+        [self restart];
+    } else if(bytesWritten == -1) {
+        int err = errno; // Make copy before it gets nuked by something else
+        
+        if(err == EAGAIN || err == EWOULDBLOCK)  {
+            // No free space in the OS' buffer, nothing to do here
+            NSLog(@"No free space in OS buffer. Ending write.");
+            return;
+        } else {
+            NSLog(@"Error writing to local socket: '%@'", [self strErr]);
+            [self restart];
+        }
+    } else if(bytesWritten > 0) {
+        [self.outBuffer replaceBytesInRange:NSMakeRange(0, bytesWritten) withBytes:NULL length:0];
+        
+        NSLog(@"Out buffer cleared. Now count is %li bytes.", [self.outBuffer length]);
+        
+        if([self.outBuffer length] == 0) {
+            NSLog(@"Out buffer has been emptied, suspending write dispatch source.");
+            dispatch_suspend(self.writeSource);
+        }
+    }
+}
+
+- (void)askForIcon:(NSString*)path isDirectory:(BOOL)isDirectory;
+{
+    NSLog(@"Asking for icon.");
+    
+    NSString *verb;
+    if(isDirectory) {
+        verb = @"RETRIEVE_FOLDER_STATUS";
+    } else {
+        verb = @"RETRIEVE_FILE_STATUS";
+    }
+    
+    [self askOnSocket:path query:verb];
+}
+
+- (void)readFromSocket
+{
+    if(![self isConnected]) {
+        return;
+    }
+    
+    NSLog(@"Reading from socket.");
+    
+    int bufferLength = BUF_SIZE / 2;
+    char buffer[bufferLength];
+    
+    while(true) {
+        long bytesRead = read(self.sock, buffer, bufferLength);
+        
+        NSLog(@"Read %li bytes from socket.", bytesRead);
+        
+        if(bytesRead == 0) {
+            // 0 means we reached "end of file" and thus the socket was closed\10. So let's restart it
+            NSLog(@"Socket was closed. Restarting...");
+            [self restart];
+            return;
+        } else if(bytesRead == -1) {
+            int err = errno;
+            if(err == EAGAIN) {
+                NSLog(@"No error and no data. Stopping.");
+                return; // No error, no data, so let's stop
+            } else {
+                NSLog(@"Error reading from local socket: '%@'", [self strErr]);
+                [self closeConnection];
+                return;
+            }
+        } else {
+            [self.inBuffer appendBytes:buffer length:bytesRead];
+            [self processInBuffer];
+        }
+    }
+}
+
+- (void)processInBuffer
+{
+    NSLog(@"Processing in buffer. In buffer length %li", [self.inBuffer length]);
+    UInt8 separator[] = {0xa}; // Byte value for "\n"
+    while(true) {
+        NSRange firstSeparatorIndex = [self.inBuffer rangeOfData:[NSData dataWithBytes:separator length:1] options:0 range:NSMakeRange(0, [self.inBuffer length])];
+        
+        if(firstSeparatorIndex.location == NSNotFound) {
+            NSLog(@"No separator found. Stopping.");
+            return; // No separator, nope out
+        } else {
+            unsigned char *buffer = [self.inBuffer mutableBytes];
+            buffer[firstSeparatorIndex.location] = 0; // Add NULL terminator, so we can use C string methods
+            
+            NSString *newLine = [NSString stringWithUTF8String:[self.inBuffer bytes]];
+
+            [self.inBuffer replaceBytesInRange:NSMakeRange(0, firstSeparatorIndex.location + 1) withBytes:NULL length:0];
+            [self.lineProcessor process:newLine];
+        }
+    }
+}
+    
+@end
diff --git a/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/SyncClient.h b/shell_integration/MacOSX/NextcloudIntegration/FinderSyncExt/SyncClient.h
new file mode 100644 (file)
index 0000000..f8c495a
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) by Jocelyn Turcotte <jturcotte@woboq.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * for more details.
+ */
+
+#import <Foundation/Foundation.h>
+
+@protocol SyncClientDelegate <NSObject>
+- (void)setResultForPath:(NSString *)path result:(NSString *)result;
+- (void)reFetchFileNameCacheForPath:(NSString *)path;
+- (void)registerPath:(NSString *)path;
+- (void)unregisterPath:(NSString *)path;
+- (void)setString:(NSString *)key value:(NSString *)value;
+- (void)resetMenuItems;
+- (void)addMenuItem:(NSDictionary *)item;
+- (void)menuHasCompleted;
+- (void)connectionDidDie;
+@end
diff --git a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.pbxproj
new file mode 100644 (file)
index 0000000..d7953cb
--- /dev/null
@@ -0,0 +1,814 @@
+// !$*UTF8*$!
+{
+       archiveVersion = 1;
+       classes = {
+       };
+       objectVersion = 46;
+       objects = {
+
+/* Begin PBXBuildFile section */
+               538E396A27F4765000FA63D5 /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */; };
+               538E396D27F4765000FA63D5 /* FileProviderExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538E396C27F4765000FA63D5 /* FileProviderExtension.swift */; };
+               538E396F27F4765000FA63D5 /* FileProviderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538E396E27F4765000FA63D5 /* FileProviderItem.swift */; };
+               538E397127F4765000FA63D5 /* FileProviderEnumerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538E397027F4765000FA63D5 /* FileProviderEnumerator.swift */; };
+               538E397627F4765000FA63D5 /* FileProviderExt.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 538E396727F4765000FA63D5 /* FileProviderExt.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+               539158AC27BE71A900816F56 /* LineProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 539158AB27BE71A900816F56 /* LineProcessor.m */; };
+               539158B327BEC98A00816F56 /* LocalSocketClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 539158B227BEC98A00816F56 /* LocalSocketClient.m */; };
+               C2B573BA1B1CD91E00303B36 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C2B573B91B1CD91E00303B36 /* main.m */; };
+               C2B573D21B1CD94B00303B36 /* main.m in Resources */ = {isa = PBXBuildFile; fileRef = C2B573B91B1CD91E00303B36 /* main.m */; };
+               C2B573DE1B1CD9CE00303B36 /* FinderSync.m in Sources */ = {isa = PBXBuildFile; fileRef = C2B573DD1B1CD9CE00303B36 /* FinderSync.m */; };
+               C2B573E21B1CD9CE00303B36 /* FinderSyncExt.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = C2B573D71B1CD9CE00303B36 /* FinderSyncExt.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
+               C2B573F31B1DAD6400303B36 /* error.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573EB1B1DAD6400303B36 /* error.iconset */; };
+               C2B573F41B1DAD6400303B36 /* ok_swm.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573EC1B1DAD6400303B36 /* ok_swm.iconset */; };
+               C2B573F51B1DAD6400303B36 /* ok.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573ED1B1DAD6400303B36 /* ok.iconset */; };
+               C2B573F71B1DAD6400303B36 /* sync.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573EF1B1DAD6400303B36 /* sync.iconset */; };
+               C2B573F91B1DAD6400303B36 /* warning.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573F11B1DAD6400303B36 /* warning.iconset */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+               538E397427F4765000FA63D5 /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = C2B573951B1CD88000303B36 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = 538E396627F4765000FA63D5;
+                       remoteInfo = FileProviderExt;
+               };
+               C2B573DF1B1CD9CE00303B36 /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = C2B573951B1CD88000303B36 /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = C2B573D61B1CD9CE00303B36;
+                       remoteInfo = FinderSyncExt;
+               };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXCopyFilesBuildPhase section */
+               C2B573E11B1CD9CE00303B36 /* Embed App Extensions */ = {
+                       isa = PBXCopyFilesBuildPhase;
+                       buildActionMask = 8;
+                       dstPath = "";
+                       dstSubfolderSpec = 13;
+                       files = (
+                               C2B573E21B1CD9CE00303B36 /* FinderSyncExt.appex in Embed App Extensions */,
+                               538E397627F4765000FA63D5 /* FileProviderExt.appex in Embed App Extensions */,
+                       );
+                       name = "Embed App Extensions";
+                       runOnlyForDeploymentPostprocessing = 1;
+               };
+/* End PBXCopyFilesBuildPhase section */
+
+/* Begin PBXFileReference section */
+               538E396727F4765000FA63D5 /* FileProviderExt.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = FileProviderExt.appex; sourceTree = BUILT_PRODUCTS_DIR; };
+               538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UniformTypeIdentifiers.framework; path = System/Library/Frameworks/UniformTypeIdentifiers.framework; sourceTree = SDKROOT; };
+               538E396C27F4765000FA63D5 /* FileProviderExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderExtension.swift; sourceTree = "<group>"; };
+               538E396E27F4765000FA63D5 /* FileProviderItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderItem.swift; sourceTree = "<group>"; };
+               538E397027F4765000FA63D5 /* FileProviderEnumerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderEnumerator.swift; sourceTree = "<group>"; };
+               538E397227F4765000FA63D5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               538E397327F4765000FA63D5 /* FileProviderExt.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = FileProviderExt.entitlements; sourceTree = "<group>"; };
+               539158A927BE606500816F56 /* LineProcessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LineProcessor.h; sourceTree = "<group>"; };
+               539158AA27BE67CC00816F56 /* SyncClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SyncClient.h; sourceTree = "<group>"; };
+               539158AB27BE71A900816F56 /* LineProcessor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LineProcessor.m; sourceTree = "<group>"; };
+               539158B127BE891500816F56 /* LocalSocketClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalSocketClient.h; sourceTree = "<group>"; };
+               539158B227BEC98A00816F56 /* LocalSocketClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocalSocketClient.m; sourceTree = "<group>"; };
+               C2B573B11B1CD91E00303B36 /* desktopclient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = desktopclient.app; sourceTree = BUILT_PRODUCTS_DIR; };
+               C2B573B51B1CD91E00303B36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               C2B573B91B1CD91E00303B36 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
+               C2B573D71B1CD9CE00303B36 /* FinderSyncExt.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = FinderSyncExt.appex; sourceTree = BUILT_PRODUCTS_DIR; };
+               C2B573DA1B1CD9CE00303B36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               C2B573DB1B1CD9CE00303B36 /* FinderSyncExt.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = FinderSyncExt.entitlements; sourceTree = "<group>"; };
+               C2B573DC1B1CD9CE00303B36 /* FinderSync.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinderSync.h; sourceTree = "<group>"; };
+               C2B573DD1B1CD9CE00303B36 /* FinderSync.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinderSync.m; sourceTree = "<group>"; };
+               C2B573EB1B1DAD6400303B36 /* error.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = error.iconset; path = ../../icons/nopadding/error.iconset; sourceTree = SOURCE_ROOT; };
+               C2B573EC1B1DAD6400303B36 /* ok_swm.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = ok_swm.iconset; path = ../../icons/nopadding/ok_swm.iconset; sourceTree = SOURCE_ROOT; };
+               C2B573ED1B1DAD6400303B36 /* ok.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = ok.iconset; path = ../../icons/nopadding/ok.iconset; sourceTree = SOURCE_ROOT; };
+               C2B573EF1B1DAD6400303B36 /* sync.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = sync.iconset; path = ../../icons/nopadding/sync.iconset; sourceTree = SOURCE_ROOT; };
+               C2B573F11B1DAD6400303B36 /* warning.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = warning.iconset; path = ../../icons/nopadding/warning.iconset; sourceTree = SOURCE_ROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+               538E396427F4765000FA63D5 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               538E396A27F4765000FA63D5 /* UniformTypeIdentifiers.framework in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               C2B573AE1B1CD91E00303B36 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               C2B573D41B1CD9CE00303B36 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+               538E396827F4765000FA63D5 /* Frameworks */ = {
+                       isa = PBXGroup;
+                       children = (
+                               538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */,
+                       );
+                       name = Frameworks;
+                       sourceTree = "<group>";
+               };
+               538E396B27F4765000FA63D5 /* FileProviderExt */ = {
+                       isa = PBXGroup;
+                       children = (
+                               538E396C27F4765000FA63D5 /* FileProviderExtension.swift */,
+                               538E396E27F4765000FA63D5 /* FileProviderItem.swift */,
+                               538E397027F4765000FA63D5 /* FileProviderEnumerator.swift */,
+                               538E397227F4765000FA63D5 /* Info.plist */,
+                               538E397327F4765000FA63D5 /* FileProviderExt.entitlements */,
+                       );
+                       path = FileProviderExt;
+                       sourceTree = "<group>";
+               };
+               C2B573941B1CD88000303B36 = {
+                       isa = PBXGroup;
+                       children = (
+                               C2B573B31B1CD91E00303B36 /* desktopclient */,
+                               C2B573D81B1CD9CE00303B36 /* FinderSyncExt */,
+                               538E396B27F4765000FA63D5 /* FileProviderExt */,
+                               538E396827F4765000FA63D5 /* Frameworks */,
+                               C2B573B21B1CD91E00303B36 /* Products */,
+                       );
+                       sourceTree = "<group>";
+               };
+               C2B573B21B1CD91E00303B36 /* Products */ = {
+                       isa = PBXGroup;
+                       children = (
+                               C2B573B11B1CD91E00303B36 /* desktopclient.app */,
+                               C2B573D71B1CD9CE00303B36 /* FinderSyncExt.appex */,
+                               538E396727F4765000FA63D5 /* FileProviderExt.appex */,
+                       );
+                       name = Products;
+                       sourceTree = "<group>";
+               };
+               C2B573B31B1CD91E00303B36 /* desktopclient */ = {
+                       isa = PBXGroup;
+                       children = (
+                               C2B573B41B1CD91E00303B36 /* Supporting Files */,
+                       );
+                       path = desktopclient;
+                       sourceTree = "<group>";
+               };
+               C2B573B41B1CD91E00303B36 /* Supporting Files */ = {
+                       isa = PBXGroup;
+                       children = (
+                               C2B573B51B1CD91E00303B36 /* Info.plist */,
+                               C2B573B91B1CD91E00303B36 /* main.m */,
+                       );
+                       name = "Supporting Files";
+                       sourceTree = "<group>";
+               };
+               C2B573D81B1CD9CE00303B36 /* FinderSyncExt */ = {
+                       isa = PBXGroup;
+                       children = (
+                               539158AA27BE67CC00816F56 /* SyncClient.h */,
+                               C2B573DC1B1CD9CE00303B36 /* FinderSync.h */,
+                               C2B573DD1B1CD9CE00303B36 /* FinderSync.m */,
+                               539158A927BE606500816F56 /* LineProcessor.h */,
+                               539158AB27BE71A900816F56 /* LineProcessor.m */,
+                               539158B127BE891500816F56 /* LocalSocketClient.h */,
+                               539158B227BEC98A00816F56 /* LocalSocketClient.m */,
+                               C2B573D91B1CD9CE00303B36 /* Supporting Files */,
+                       );
+                       path = FinderSyncExt;
+                       sourceTree = "<group>";
+               };
+               C2B573D91B1CD9CE00303B36 /* Supporting Files */ = {
+                       isa = PBXGroup;
+                       children = (
+                               C2B573EB1B1DAD6400303B36 /* error.iconset */,
+                               C2B573EC1B1DAD6400303B36 /* ok_swm.iconset */,
+                               C2B573ED1B1DAD6400303B36 /* ok.iconset */,
+                               C2B573EF1B1DAD6400303B36 /* sync.iconset */,
+                               C2B573F11B1DAD6400303B36 /* warning.iconset */,
+                               C2B573DA1B1CD9CE00303B36 /* Info.plist */,
+                               C2B573DB1B1CD9CE00303B36 /* FinderSyncExt.entitlements */,
+                       );
+                       name = "Supporting Files";
+                       sourceTree = "<group>";
+               };
+/* End PBXGroup section */
+
+/* Begin PBXNativeTarget section */
+               538E396627F4765000FA63D5 /* FileProviderExt */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = 538E397927F4765000FA63D5 /* Build configuration list for PBXNativeTarget "FileProviderExt" */;
+                       buildPhases = (
+                               538E396327F4765000FA63D5 /* Sources */,
+                               538E396427F4765000FA63D5 /* Frameworks */,
+                               538E396527F4765000FA63D5 /* Resources */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = FileProviderExt;
+                       packageProductDependencies = (
+                       );
+                       productName = FileProviderExt;
+                       productReference = 538E396727F4765000FA63D5 /* FileProviderExt.appex */;
+                       productType = "com.apple.product-type.app-extension";
+               };
+               C2B573B01B1CD91E00303B36 /* desktopclient */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = C2B573CC1B1CD91E00303B36 /* Build configuration list for PBXNativeTarget "desktopclient" */;
+                       buildPhases = (
+                               C2B573AD1B1CD91E00303B36 /* Sources */,
+                               C2B573AE1B1CD91E00303B36 /* Frameworks */,
+                               C2B573AF1B1CD91E00303B36 /* Resources */,
+                               C2B573E11B1CD9CE00303B36 /* Embed App Extensions */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                               C2B573E01B1CD9CE00303B36 /* PBXTargetDependency */,
+                               538E397527F4765000FA63D5 /* PBXTargetDependency */,
+                       );
+                       name = desktopclient;
+                       productName = desktopclient;
+                       productReference = C2B573B11B1CD91E00303B36 /* desktopclient.app */;
+                       productType = "com.apple.product-type.application";
+               };
+               C2B573D61B1CD9CE00303B36 /* FinderSyncExt */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = C2B573E31B1CD9CE00303B36 /* Build configuration list for PBXNativeTarget "FinderSyncExt" */;
+                       buildPhases = (
+                               C2B573D31B1CD9CE00303B36 /* Sources */,
+                               C2B573D41B1CD9CE00303B36 /* Frameworks */,
+                               C2B573D51B1CD9CE00303B36 /* Resources */,
+                               5B3335471CA058E200E11A45 /* ShellScript */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = FinderSyncExt;
+                       productName = FinderSyncExt;
+                       productReference = C2B573D71B1CD9CE00303B36 /* FinderSyncExt.appex */;
+                       productType = "com.apple.product-type.app-extension";
+               };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+               C2B573951B1CD88000303B36 /* Project object */ = {
+                       isa = PBXProject;
+                       attributes = {
+                               LastSwiftUpdateCheck = 1330;
+                               LastUpgradeCheck = 1240;
+                               TargetAttributes = {
+                                       538E396627F4765000FA63D5 = {
+                                               CreatedOnToolsVersion = 13.3;
+                                               ProvisioningStyle = Manual;
+                                       };
+                                       C2B573B01B1CD91E00303B36 = {
+                                               CreatedOnToolsVersion = 6.3.1;
+                                               DevelopmentTeam = 9B5WD74GWJ;
+                                               ProvisioningStyle = Manual;
+                                       };
+                                       C2B573D61B1CD9CE00303B36 = {
+                                               CreatedOnToolsVersion = 6.3.1;
+                                               DevelopmentTeam = 9B5WD74GWJ;
+                                               ProvisioningStyle = Manual;
+                                               SystemCapabilities = {
+                                                       com.apple.ApplicationGroups.Mac = {
+                                                               enabled = 1;
+                                                       };
+                                               };
+                                       };
+                               };
+                       };
+                       buildConfigurationList = C2B573981B1CD88000303B36 /* Build configuration list for PBXProject "NextcloudIntegration" */;
+                       compatibilityVersion = "Xcode 3.2";
+                       developmentRegion = English;
+                       hasScannedForEncodings = 0;
+                       knownRegions = (
+                               English,
+                               en,
+                               Base,
+                       );
+                       mainGroup = C2B573941B1CD88000303B36;
+                       packageReferences = (
+                       );
+                       productRefGroup = C2B573B21B1CD91E00303B36 /* Products */;
+                       projectDirPath = "";
+                       projectRoot = "";
+                       targets = (
+                               C2B573B01B1CD91E00303B36 /* desktopclient */,
+                               C2B573D61B1CD9CE00303B36 /* FinderSyncExt */,
+                               538E396627F4765000FA63D5 /* FileProviderExt */,
+                       );
+               };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+               538E396527F4765000FA63D5 /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               C2B573AF1B1CD91E00303B36 /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               C2B573D21B1CD94B00303B36 /* main.m in Resources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               C2B573D51B1CD9CE00303B36 /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               C2B573F91B1DAD6400303B36 /* warning.iconset in Resources */,
+                               C2B573F31B1DAD6400303B36 /* error.iconset in Resources */,
+                               C2B573F71B1DAD6400303B36 /* sync.iconset in Resources */,
+                               C2B573F41B1DAD6400303B36 /* ok_swm.iconset in Resources */,
+                               C2B573F51B1DAD6400303B36 /* ok.iconset in Resources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+               5B3335471CA058E200E11A45 /* ShellScript */ = {
+                       isa = PBXShellScriptBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       inputPaths = (
+                       );
+                       outputPaths = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+                       shellPath = /bin/sh;
+                       shellScript = "if [[ ${OC_OEM_SHARE_ICNS} ]]; then\n  cp ${OC_OEM_SHARE_ICNS} ${BUILT_PRODUCTS_DIR}/FinderSyncExt.appex/Contents/Resources/app.icns\nfi";
+                       showEnvVarsInLog = 0;
+               };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+               538E396327F4765000FA63D5 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               538E396D27F4765000FA63D5 /* FileProviderExtension.swift in Sources */,
+                               538E396F27F4765000FA63D5 /* FileProviderItem.swift in Sources */,
+                               538E397127F4765000FA63D5 /* FileProviderEnumerator.swift in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               C2B573AD1B1CD91E00303B36 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               C2B573BA1B1CD91E00303B36 /* main.m in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+               C2B573D31B1CD9CE00303B36 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               539158B327BEC98A00816F56 /* LocalSocketClient.m in Sources */,
+                               539158AC27BE71A900816F56 /* LineProcessor.m in Sources */,
+                               C2B573DE1B1CD9CE00303B36 /* FinderSync.m in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+               538E397527F4765000FA63D5 /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = 538E396627F4765000FA63D5 /* FileProviderExt */;
+                       targetProxy = 538E397427F4765000FA63D5 /* PBXContainerItemProxy */;
+               };
+               C2B573E01B1CD9CE00303B36 /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = C2B573D61B1CD9CE00303B36 /* FinderSyncExt */;
+                       targetProxy = C2B573DF1B1CD9CE00303B36 /* PBXContainerItemProxy */;
+               };
+/* End PBXTargetDependency section */
+
+/* Begin XCBuildConfiguration section */
+               538E397727F4765000FA63D5 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_ENABLE_OBJC_WEAK = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+                               CODE_SIGN_ENTITLEMENTS = FileProviderExt/FileProviderExt.entitlements;
+                               CODE_SIGN_IDENTITY = "-";
+                               CODE_SIGN_STYLE = Manual;
+                               COPY_PHASE_STRIP = NO;
+                               CURRENT_PROJECT_VERSION = 1;
+                               DEBUG_INFORMATION_FORMAT = dwarf;
+                               DEVELOPMENT_TEAM = "";
+                               GCC_C_LANGUAGE_STANDARD = gnu11;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "DEBUG=1",
+                                       "$(inherited)",
+                               );
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GENERATE_INFOPLIST_FILE = YES;
+                               INFOPLIST_FILE = FileProviderExt/Info.plist;
+                               INFOPLIST_KEY_CFBundleDisplayName = FileProviderExt;
+                               INFOPLIST_KEY_NSHumanReadableCopyright = "";
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
+                               MACOSX_DEPLOYMENT_TARGET = 12.3;
+                               MARKETING_VERSION = 1.0;
+                               MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+                               MTL_FAST_MATH = YES;
+                               ONLY_ACTIVE_ARCH = YES;
+                               PRODUCT_BUNDLE_IDENTIFIER = com.owncloud.desktopclient.FileProviderExt;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               PROVISIONING_PROFILE_SPECIFIER = "";
+                               SDKROOT = macosx;
+                               SKIP_INSTALL = YES;
+                               SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+                               SWIFT_EMIT_LOC_STRINGS = YES;
+                               SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+                               SWIFT_VERSION = 5.0;
+                       };
+                       name = Debug;
+               };
+               538E397827F4765000FA63D5 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_ANALYZER_NONNULL = YES;
+                               CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_ENABLE_OBJC_WEAK = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+                               CODE_SIGN_ENTITLEMENTS = FileProviderExt/FileProviderExt.entitlements;
+                               CODE_SIGN_IDENTITY = "-";
+                               CODE_SIGN_STYLE = Manual;
+                               COPY_PHASE_STRIP = NO;
+                               CURRENT_PROJECT_VERSION = 1;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               DEVELOPMENT_TEAM = "";
+                               ENABLE_NS_ASSERTIONS = NO;
+                               GCC_C_LANGUAGE_STANDARD = gnu11;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GENERATE_INFOPLIST_FILE = YES;
+                               INFOPLIST_FILE = FileProviderExt/Info.plist;
+                               INFOPLIST_KEY_CFBundleDisplayName = FileProviderExt;
+                               INFOPLIST_KEY_NSHumanReadableCopyright = "";
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
+                               MACOSX_DEPLOYMENT_TARGET = 12.3;
+                               MARKETING_VERSION = 1.0;
+                               MTL_ENABLE_DEBUG_INFO = NO;
+                               MTL_FAST_MATH = YES;
+                               PRODUCT_BUNDLE_IDENTIFIER = com.owncloud.desktopclient.FileProviderExt;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               PROVISIONING_PROFILE_SPECIFIER = "";
+                               SDKROOT = macosx;
+                               SKIP_INSTALL = YES;
+                               SWIFT_EMIT_LOC_STRINGS = YES;
+                               SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+                               SWIFT_VERSION = 5.0;
+                       };
+                       name = Release;
+               };
+               C2B573991B1CD88000303B36 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_COMMA = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+                               CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+                               CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+                               CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+                               CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+                               CLANG_WARN_STRICT_PROTOTYPES = YES;
+                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               ENABLE_TESTABILITY = YES;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                       };
+                       name = Debug;
+               };
+               C2B5739A1B1CD88000303B36 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_COMMA = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INFINITE_RECURSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+                               CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+                               CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+                               CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
+                               CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+                               CLANG_WARN_STRICT_PROTOTYPES = YES;
+                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                       };
+                       name = Release;
+               };
+               C2B573CD1B1CD91E00303B36 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_IDENTITY = "-";
+                               CODE_SIGN_STYLE = Manual;
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               DEBUG_INFORMATION_FORMAT = dwarf;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "DEBUG=1",
+                                       "$(inherited)",
+                               );
+                               GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               INFOPLIST_FILE = desktopclient/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
+                               MACOSX_DEPLOYMENT_TARGET = 10.14;
+                               MTL_ENABLE_DEBUG_INFO = YES;
+                               ONLY_ACTIVE_ARCH = YES;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               PROVISIONING_PROFILE = "";
+                               SDKROOT = macosx;
+                               SWIFT_OBJC_BRIDGING_HEADER = "desktopclient/desktopclient-Bridging-Header.h";
+                               SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+                               SWIFT_VERSION = 5.0;
+                       };
+                       name = Debug;
+               };
+               C2B573CE1B1CD91E00303B36 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_IDENTITY = "-";
+                               CODE_SIGN_STYLE = Manual;
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               ENABLE_NS_ASSERTIONS = NO;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               INFOPLIST_FILE = desktopclient/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
+                               MACOSX_DEPLOYMENT_TARGET = 10.14;
+                               MTL_ENABLE_DEBUG_INFO = NO;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               PROVISIONING_PROFILE = "";
+                               SDKROOT = macosx;
+                               SWIFT_OBJC_BRIDGING_HEADER = "desktopclient/desktopclient-Bridging-Header.h";
+                               SWIFT_VERSION = 5.0;
+                       };
+                       name = Release;
+               };
+               C2B573E41B1CD9CE00303B36 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_ENTITLEMENTS = FinderSyncExt/FinderSyncExt.entitlements;
+                               CODE_SIGN_IDENTITY = "-";
+                               CODE_SIGN_STYLE = Manual;
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               DEBUG_INFORMATION_FORMAT = dwarf;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_DYNAMIC_NO_PIC = NO;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_OPTIMIZATION_LEVEL = 0;
+                               GCC_PREPROCESSOR_DEFINITIONS = (
+                                       "DEBUG=1",
+                                       "$(inherited)",
+                               );
+                               GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               INFOPLIST_FILE = FinderSyncExt/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
+                               MACOSX_DEPLOYMENT_TARGET = 10.14;
+                               MTL_ENABLE_DEBUG_INFO = YES;
+                               OC_APPLICATION_NAME = ownCloud;
+                               OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
+                               OC_OEM_SHARE_ICNS = "";
+                               OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = "";
+                               ONLY_ACTIVE_ARCH = YES;
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               PROVISIONING_PROFILE = "";
+                               SDKROOT = macosx;
+                               SKIP_INSTALL = YES;
+                       };
+                       name = Debug;
+               };
+               C2B573E51B1CD9CE00303B36 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_SEARCH_USER_PATHS = NO;
+                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+                               CLANG_CXX_LIBRARY = "libc++";
+                               CLANG_ENABLE_MODULES = YES;
+                               CLANG_ENABLE_OBJC_ARC = YES;
+                               CLANG_WARN_BOOL_CONVERSION = YES;
+                               CLANG_WARN_CONSTANT_CONVERSION = YES;
+                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+                               CLANG_WARN_EMPTY_BODY = YES;
+                               CLANG_WARN_ENUM_CONVERSION = YES;
+                               CLANG_WARN_INT_CONVERSION = YES;
+                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+                               CLANG_WARN_UNREACHABLE_CODE = YES;
+                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+                               CODE_SIGN_ENTITLEMENTS = FinderSyncExt/FinderSyncExt.entitlements;
+                               CODE_SIGN_IDENTITY = "-";
+                               CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
+                               CODE_SIGN_STYLE = Manual;
+                               COMBINE_HIDPI_IMAGES = YES;
+                               COPY_PHASE_STRIP = NO;
+                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+                               ENABLE_NS_ASSERTIONS = NO;
+                               ENABLE_STRICT_OBJC_MSGSEND = YES;
+                               GCC_C_LANGUAGE_STANDARD = gnu99;
+                               GCC_NO_COMMON_BLOCKS = YES;
+                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+                               GCC_WARN_UNDECLARED_SELECTOR = YES;
+                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+                               GCC_WARN_UNUSED_FUNCTION = YES;
+                               GCC_WARN_UNUSED_VARIABLE = YES;
+                               INFOPLIST_FILE = FinderSyncExt/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
+                               MACOSX_DEPLOYMENT_TARGET = 10.14;
+                               MTL_ENABLE_DEBUG_INFO = NO;
+                               OC_APPLICATION_NAME = ownCloud;
+                               OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
+                               OC_OEM_SHARE_ICNS = "";
+                               OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = "";
+                               PRODUCT_NAME = "$(TARGET_NAME)";
+                               PROVISIONING_PROFILE = "";
+                               SDKROOT = macosx;
+                               SKIP_INSTALL = YES;
+                       };
+                       name = Release;
+               };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+               538E397927F4765000FA63D5 /* Build configuration list for PBXNativeTarget "FileProviderExt" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               538E397727F4765000FA63D5 /* Debug */,
+                               538E397827F4765000FA63D5 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               C2B573981B1CD88000303B36 /* Build configuration list for PBXProject "NextcloudIntegration" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               C2B573991B1CD88000303B36 /* Debug */,
+                               C2B5739A1B1CD88000303B36 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               C2B573CC1B1CD91E00303B36 /* Build configuration list for PBXNativeTarget "desktopclient" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               C2B573CD1B1CD91E00303B36 /* Debug */,
+                               C2B573CE1B1CD91E00303B36 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+               C2B573E31B1CD9CE00303B36 /* Build configuration list for PBXNativeTarget "FinderSyncExt" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               C2B573E41B1CD9CE00303B36 /* Debug */,
+                               C2B573E51B1CD9CE00303B36 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
+/* End XCConfigurationList section */
+       };
+       rootObject = C2B573951B1CD88000303B36 /* Project object */;
+}
diff --git a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/contents.xcworkspacedata
new file mode 100644 (file)
index 0000000..919434a
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:">
+   </FileRef>
+</Workspace>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
new file mode 100644 (file)
index 0000000..18d9810
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>IDEDidComputeMac32BitWarning</key>
+       <true/>
+</dict>
+</plist>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/xcshareddata/xcschemes/FinderSyncExt.xcscheme b/shell_integration/MacOSX/NextcloudIntegration/NextcloudIntegration.xcodeproj/xcshareddata/xcschemes/FinderSyncExt.xcscheme
new file mode 100644 (file)
index 0000000..d3e945f
--- /dev/null
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1240"
+   wasCreatedForAppExtension = "YES"
+   version = "2.0">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "C2B573D61B1CD9CE00303B36"
+               BuildableName = "FinderSyncExt.appex"
+               BlueprintName = "FinderSyncExt"
+               ReferencedContainer = "container:NextcloudIntegration.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "C2B573B01B1CD91E00303B36"
+               BuildableName = "desktopclient.app"
+               BlueprintName = "desktopclient"
+               ReferencedContainer = "container:NextcloudIntegration.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "C2B573D61B1CD9CE00303B36"
+            BuildableName = "FinderSyncExt.appex"
+            BlueprintName = "FinderSyncExt"
+            ReferencedContainer = "container:NextcloudIntegration.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+      <Testables>
+      </Testables>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = ""
+      selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
+      launchStyle = "0"
+      askForAppToLaunch = "Yes"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES"
+      launchAutomaticallySubstyle = "2">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "C2B573B01B1CD91E00303B36"
+            BuildableName = "desktopclient.app"
+            BlueprintName = "desktopclient"
+            ReferencedContainer = "container:NextcloudIntegration.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES"
+      askForAppToLaunch = "Yes"
+      launchAutomaticallySubstyle = "2">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "C2B573B01B1CD91E00303B36"
+            BuildableName = "desktopclient.app"
+            BlueprintName = "desktopclient"
+            ReferencedContainer = "container:NextcloudIntegration.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/desktopclient/Info.plist b/shell_integration/MacOSX/NextcloudIntegration/desktopclient/Info.plist
new file mode 100644 (file)
index 0000000..bbaa296
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>en</string>
+       <key>CFBundleExecutable</key>
+       <string>$(EXECUTABLE_NAME)</string>
+       <key>CFBundleIconFile</key>
+       <string></string>
+       <key>CFBundleIdentifier</key>
+       <string>com.owncloud.$(PRODUCT_NAME:rfc1034identifier)</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>$(PRODUCT_NAME)</string>
+       <key>CFBundlePackageType</key>
+       <string>APPL</string>
+       <key>CFBundleShortVersionString</key>
+       <string>1.0</string>
+       <key>CFBundleSignature</key>
+       <string>????</string>
+       <key>CFBundleVersion</key>
+       <string>1</string>
+       <key>LSMinimumSystemVersion</key>
+       <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
+       <key>NSPrincipalClass</key>
+       <string>NSApplication</string>
+</dict>
+</plist>
diff --git a/shell_integration/MacOSX/NextcloudIntegration/desktopclient/main.m b/shell_integration/MacOSX/NextcloudIntegration/desktopclient/main.m
new file mode 100644 (file)
index 0000000..6f580d2
--- /dev/null
@@ -0,0 +1,16 @@
+//
+//  main.m
+//  desktopclient
+//
+//  Created by Jocelyn Turcotte on 01/06/15.
+//
+//
+
+// This is fake application bundle with the same bundle ID as the real desktop client.
+// Xcode needs a wrapping application to allow the extension to be debugged.
+
+#import <Cocoa/Cocoa.h>
+
+int main(int argc, const char * argv[]) {
+    return NSApplicationMain(argc, argv);
+}
diff --git a/shell_integration/MacOSX/OwnCloud.xcworkspace/contents.xcworkspacedata b/shell_integration/MacOSX/OwnCloud.xcworkspace/contents.xcworkspacedata
deleted file mode 100644 (file)
index ed88ebf..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
-   version = "1.0">
-   <FileRef
-      location = "group:OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj">
-   </FileRef>
-</Workspace>
diff --git a/shell_integration/MacOSX/OwnCloud.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/shell_integration/MacOSX/OwnCloud.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644 (file)
index 18d9810..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>IDEDidComputeMac32BitWarning</key>
-       <true/>
-</dict>
-</plist>
diff --git a/shell_integration/MacOSX/OwnCloud.xcworkspace/xcshareddata/OwnCloud.xccheckout b/shell_integration/MacOSX/OwnCloud.xcworkspace/xcshareddata/OwnCloud.xccheckout
deleted file mode 100644 (file)
index 9512111..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>IDESourceControlProjectFavoriteDictionaryKey</key>
-       <false/>
-       <key>IDESourceControlProjectIdentifier</key>
-       <string>5264E8F5-AB49-45F3-868F-647EEFAB70E0</string>
-       <key>IDESourceControlProjectName</key>
-       <string>OwnCloud</string>
-       <key>IDESourceControlProjectOriginsDictionary</key>
-       <dict>
-               <key>D67321A19EF879CA55BF889202BA8C23AC9AA2B5</key>
-               <string>ssh://github.com/owncloud/client.git</string>
-       </dict>
-       <key>IDESourceControlProjectPath</key>
-       <string>shell_integration/MacOSX/OwnCloud.xcworkspace</string>
-       <key>IDESourceControlProjectRelativeInstallPathDictionary</key>
-       <dict>
-               <key>D67321A19EF879CA55BF889202BA8C23AC9AA2B5</key>
-               <string>../../..</string>
-       </dict>
-       <key>IDESourceControlProjectURL</key>
-       <string>ssh://github.com/owncloud/client.git</string>
-       <key>IDESourceControlProjectVersion</key>
-       <integer>111</integer>
-       <key>IDESourceControlProjectWCCIdentifier</key>
-       <string>D67321A19EF879CA55BF889202BA8C23AC9AA2B5</string>
-       <key>IDESourceControlProjectWCConfigurations</key>
-       <array>
-               <dict>
-                       <key>IDESourceControlRepositoryExtensionIdentifierKey</key>
-                       <string>public.vcs.git</string>
-                       <key>IDESourceControlWCCIdentifierKey</key>
-                       <string>D67321A19EF879CA55BF889202BA8C23AC9AA2B5</string>
-                       <key>IDESourceControlWCCName</key>
-                       <string>client</string>
-               </dict>
-       </array>
-</dict>
-</plist>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderEnumerator.swift b/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderEnumerator.swift
deleted file mode 100644 (file)
index 9cd3563..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-import FileProvider
-
-class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
-    
-    private let enumeratedItemIdentifier: NSFileProviderItemIdentifier
-    private let anchor = NSFileProviderSyncAnchor("an anchor".data(using: .utf8)!)
-    
-    init(enumeratedItemIdentifier: NSFileProviderItemIdentifier) {
-        self.enumeratedItemIdentifier = enumeratedItemIdentifier
-        super.init()
-    }
-
-    func invalidate() {
-        // TODO: perform invalidation of server connection if necessary
-    }
-
-    func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {
-        /* TODO:
-         - inspect the page to determine whether this is an initial or a follow-up request
-         
-         If this is an enumerator for a directory, the root container or all directories:
-         - perform a server request to fetch directory contents
-         If this is an enumerator for the active set:
-         - perform a server request to update your local database
-         - fetch the active set from your local database
-         
-         - inform the observer about the items returned by the server (possibly multiple times)
-         - inform the observer that you are finished with this page
-         */
-        observer.didEnumerate([FileProviderItem(identifier: NSFileProviderItemIdentifier("a file"))])
-        observer.finishEnumerating(upTo: nil)
-    }
-    
-    func enumerateChanges(for observer: NSFileProviderChangeObserver, from anchor: NSFileProviderSyncAnchor) {
-        /* TODO:
-         - query the server for updates since the passed-in sync anchor
-         
-         If this is an enumerator for the active set:
-         - note the changes in your local database
-         
-         - inform the observer about item deletions and updates (modifications + insertions)
-         - inform the observer when you have finished enumerating up to a subsequent sync anchor
-         */
-        observer.finishEnumeratingChanges(upTo: anchor, moreComing: false)
-    }
-
-    func currentSyncAnchor(completionHandler: @escaping (NSFileProviderSyncAnchor?) -> Void) {
-        completionHandler(anchor)
-    }
-}
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderExt.entitlements b/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderExt.entitlements
deleted file mode 100644 (file)
index f399700..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>com.apple.application-identifier</key>
-       <string>$(AppIdentifierPrefix)$(PRODUCT_BUNDLE_IDENTIFIER)</string>
-       <key>com.apple.security.app-sandbox</key>
-       <true/>
-       <key>com.apple.security.application-groups</key>
-       <array>
-               <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
-       </array>
-</dict>
-</plist>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderExtension.swift b/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderExtension.swift
deleted file mode 100644 (file)
index f32c49b..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-import FileProvider
-
-class FileProviderExtension: NSObject, NSFileProviderReplicatedExtension {
-    let domain: NSFileProviderDomain
-    
-    required init(domain: NSFileProviderDomain) {
-        self.domain = domain
-        // The containing application must create a domain using `NSFileProviderManager.add(_:, completionHandler:)`. The system will then launch the application extension process, call `FileProviderExtension.init(domain:)` to instantiate the extension for that domain, and call methods on the instance.
-        super.init()
-    }
-    
-    func invalidate() {
-        // TODO: cleanup any resources
-    }
-    
-    func item(for identifier: NSFileProviderItemIdentifier, request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) -> Progress {
-        // resolve the given identifier to a record in the model
-        
-        // TODO: implement the actual lookup
-
-        completionHandler(FileProviderItem(identifier: identifier), nil)
-        return Progress()
-    }
-    
-    func fetchContents(for itemIdentifier: NSFileProviderItemIdentifier, version requestedVersion: NSFileProviderItemVersion?, request: NSFileProviderRequest, completionHandler: @escaping (URL?, NSFileProviderItem?, Error?) -> Void) -> Progress {
-        // TODO: implement fetching of the contents for the itemIdentifier at the specified version
-        
-        completionHandler(nil, nil, NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
-        return Progress()
-    }
-    
-    func createItem(basedOn itemTemplate: NSFileProviderItem, fields: NSFileProviderItemFields, contents url: URL?, options: NSFileProviderCreateItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress {
-        // TODO: a new item was created on disk, process the item's creation
-        
-        completionHandler(itemTemplate, [], false, nil)
-        return Progress()
-    }
-    
-    func modifyItem(_ item: NSFileProviderItem, baseVersion version: NSFileProviderItemVersion, changedFields: NSFileProviderItemFields, contents newContents: URL?, options: NSFileProviderModifyItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, NSFileProviderItemFields, Bool, Error?) -> Void) -> Progress {
-        // TODO: an item was modified on disk, process the item's modification
-        
-        completionHandler(nil, [], false, NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
-        return Progress()
-    }
-    
-    func deleteItem(identifier: NSFileProviderItemIdentifier, baseVersion version: NSFileProviderItemVersion, options: NSFileProviderDeleteItemOptions = [], request: NSFileProviderRequest, completionHandler: @escaping (Error?) -> Void) -> Progress {
-        // TODO: an item was deleted on disk, process the item's deletion
-        
-        completionHandler(NSError(domain: NSCocoaErrorDomain, code: NSFeatureUnsupportedError, userInfo:[:]))
-        return Progress()
-    }
-    
-    func enumerator(for containerItemIdentifier: NSFileProviderItemIdentifier, request: NSFileProviderRequest) throws -> NSFileProviderEnumerator {
-        return FileProviderEnumerator(enumeratedItemIdentifier: containerItemIdentifier)
-    }
-}
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderItem.swift b/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/FileProviderItem.swift
deleted file mode 100644 (file)
index fa793e4..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-import FileProvider
-import UniformTypeIdentifiers
-
-class FileProviderItem: NSObject, NSFileProviderItem {
-
-    // TODO: implement an initializer to create an item from your extension's backing model
-    // TODO: implement the accessors to return the values from your extension's backing model
-    
-    private let identifier: NSFileProviderItemIdentifier
-    
-    init(identifier: NSFileProviderItemIdentifier) {
-        self.identifier = identifier
-    }
-    
-    var itemIdentifier: NSFileProviderItemIdentifier {
-        return identifier
-    }
-    
-    var parentItemIdentifier: NSFileProviderItemIdentifier {
-        return .rootContainer
-    }
-    
-    var capabilities: NSFileProviderItemCapabilities {
-        return [.allowsReading, .allowsWriting, .allowsRenaming, .allowsReparenting, .allowsTrashing, .allowsDeleting]
-    }
-    
-    var itemVersion: NSFileProviderItemVersion {
-        NSFileProviderItemVersion(contentVersion: "a content version".data(using: .utf8)!, metadataVersion: "a metadata version".data(using: .utf8)!)
-    }
-    
-    var filename: String {
-        return identifier.rawValue
-    }
-    
-    var contentType: UTType {
-        return identifier == NSFileProviderItemIdentifier.rootContainer ? .folder : .plainText
-    }
-}
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/Info.plist b/shell_integration/MacOSX/OwnCloudFinderSync/FileProviderExt/Info.plist
deleted file mode 100644 (file)
index 5072333..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>NSExtension</key>
-       <dict>
-               <key>NSExtensionFileProviderDocumentGroup</key>
-               <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
-               <key>NSExtensionFileProviderSupportsEnumeration</key>
-               <true/>
-               <key>NSExtensionPointIdentifier</key>
-               <string>com.apple.fileprovider-nonui</string>
-               <key>NSExtensionPrincipalClass</key>
-               <string>$(PRODUCT_MODULE_NAME).FileProviderExtension</string>
-       </dict>
-</dict>
-</plist>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.h b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.h
deleted file mode 100644 (file)
index 4cf5765..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) by Jocelyn Turcotte <jturcotte@woboq.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-
-#import <Cocoa/Cocoa.h>
-#import <FinderSync/FinderSync.h>
-#import "SyncClient.h"
-#import "LineProcessor.h"
-#import "LocalSocketClient.h"
-
-@interface FinderSync : FIFinderSync <SyncClientDelegate>
-{
-    NSMutableSet *_registeredDirectories;
-    NSString *_shareMenuTitle;
-    NSMutableDictionary *_strings;
-    NSMutableArray *_menuItems;
-    NSCondition *_menuIsComplete;
-}
-
-@property LineProcessor *lineProcessor;
-@property LocalSocketClient *localSocketClient;
-
-@end
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSync.m
deleted file mode 100644 (file)
index 84a124f..0000000
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Copyright (C) by Jocelyn Turcotte <jturcotte@woboq.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-
-#import "FinderSync.h"
-
-
-@implementation FinderSync
-
-- (instancetype)init
-{
-       self = [super init];
-
-    if (self) {
-        FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
-        NSBundle *extBundle = [NSBundle bundleForClass:[self class]];
-        // This was added to the bundle's Info.plist to get it from the build system
-        NSString *socketApiPrefix = [extBundle objectForInfoDictionaryKey:@"SocketApiPrefix"];
-        
-        NSImage *ok = [extBundle imageForResource:@"ok.icns"];
-        NSImage *ok_swm = [extBundle imageForResource:@"ok_swm.icns"];
-        NSImage *sync = [extBundle imageForResource:@"sync.icns"];
-        NSImage *warning = [extBundle imageForResource:@"warning.icns"];
-        NSImage *error = [extBundle imageForResource:@"error.icns"];
-        
-        [syncController setBadgeImage:ok label:@"Up to date" forBadgeIdentifier:@"OK"];
-        [syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"SYNC"];
-        [syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"NEW"];
-        [syncController setBadgeImage:warning label:@"Ignored" forBadgeIdentifier:@"IGNORE"];
-        [syncController setBadgeImage:error label:@"Error" forBadgeIdentifier:@"ERROR"];
-        [syncController setBadgeImage:ok_swm label:@"Shared" forBadgeIdentifier:@"OK+SWM"];
-        [syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"SYNC+SWM"];
-        [syncController setBadgeImage:sync label:@"Synchronizing" forBadgeIdentifier:@"NEW+SWM"];
-        [syncController setBadgeImage:warning label:@"Ignored" forBadgeIdentifier:@"IGNORE+SWM"];
-        [syncController setBadgeImage:error label:@"Error" forBadgeIdentifier:@"ERROR+SWM"];
-        
-        // The Mach port name needs to:
-        // - Be prefixed with the code signing Team ID
-        // - Then infixed with the sandbox App Group
-        // - The App Group itself must be a prefix of (or equal to) the application bundle identifier
-        // We end up in the official signed client with: 9B5WD74GWJ.com.owncloud.desktopclient.socket
-        // With ad-hoc signing (the '-' signing identity) we must drop the Team ID.
-        // When the code isn't sandboxed (e.g. the OC client or the legacy overlay icon extension)
-        // the OS doesn't seem to put any restriction on the port name, so we just follow what
-        // the sandboxed App Extension needs.
-        // https://developer.apple.com/library/mac/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24
-        
-        NSURL *container = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:socketApiPrefix];
-        NSURL *socketPath = [container URLByAppendingPathComponent:@".socket" isDirectory:NO];
-        
-        NSLog(@"Socket path: %@", socketPath.path);
-        
-        if (socketPath.path) {
-            self.lineProcessor = [[LineProcessor alloc] initWithDelegate:self];
-            self.localSocketClient = [[LocalSocketClient alloc] init:socketPath.path
-                                                       lineProcessor:self.lineProcessor];
-            [self.localSocketClient start];
-        } else {
-            NSLog(@"No socket path. Not initiating local socket client.");
-            self.localSocketClient = nil;
-        }
-        _registeredDirectories = [[NSMutableSet alloc] init];
-        _strings = [[NSMutableDictionary alloc] init];
-        _menuIsComplete = [[NSCondition alloc] init];
-    }
-
-    return self;
-}
-
-#pragma mark - Primary Finder Sync protocol methods
-
-- (void)requestBadgeIdentifierForURL:(NSURL *)url
-{
-       BOOL isDir;
-       if ([[NSFileManager defaultManager] fileExistsAtPath:[url path] isDirectory: &isDir] == NO) {
-               NSLog(@"ERROR: Could not determine file type of %@", [url path]);
-               isDir = NO;
-       }
-
-       NSString* normalizedPath = [[url path] decomposedStringWithCanonicalMapping];
-       [self.localSocketClient askForIcon:normalizedPath isDirectory:isDir];
-}
-
-#pragma mark - Menu and toolbar item support
-
-- (NSString*) selectedPathsSeparatedByRecordSeparator
-{
-       FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
-       NSMutableString *string = [[NSMutableString alloc] init];
-       [syncController.selectedItemURLs enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
-               if (string.length > 0) {
-                       [string appendString:@"\x1e"]; // record separator
-               }
-               NSString* normalizedPath = [[obj path] decomposedStringWithCanonicalMapping];
-               [string appendString:normalizedPath];
-       }];
-       return string;
-}
-
-- (void)waitForMenuToArrive
-{
-    [self->_menuIsComplete lock];
-    [self->_menuIsComplete wait];
-    [self->_menuIsComplete unlock];
-}
-
-- (NSMenu *)menuForMenuKind:(FIMenuKind)whichMenu
-{
-    if(![self.localSocketClient isConnected]) {
-        return nil;
-    }
-    
-       FIFinderSyncController *syncController = [FIFinderSyncController defaultController];
-       NSMutableSet *rootPaths = [[NSMutableSet alloc] init];
-       [syncController.directoryURLs enumerateObjectsUsingBlock: ^(id obj, BOOL *stop) {
-               [rootPaths addObject:[obj path]];
-       }];
-
-       // The server doesn't support sharing a root directory so do not show the option in this case.
-       // It is still possible to get a problematic sharing by selecting both the root and a child,
-       // but this is so complicated to do and meaningless that it's not worth putting this check
-       // also in shareMenuAction.
-       __block BOOL onlyRootsSelected = YES;
-       [syncController.selectedItemURLs enumerateObjectsUsingBlock: ^(id obj, NSUInteger idx, BOOL *stop) {
-               if (![rootPaths member:[obj path]]) {
-                       onlyRootsSelected = NO;
-                       *stop = YES;
-               }
-       }];
-
-       NSString *paths = [self selectedPathsSeparatedByRecordSeparator];
-       [self.localSocketClient askOnSocket:paths query:@"GET_MENU_ITEMS"];
-    
-    // Since the LocalSocketClient communicates asynchronously. wait here until the menu
-    // is delivered by another thread
-    [self waitForMenuToArrive];
-
-       id contextMenuTitle = [_strings objectForKey:@"CONTEXT_MENU_TITLE"];
-       if (contextMenuTitle && !onlyRootsSelected) {
-               NSMenu *menu = [[NSMenu alloc] initWithTitle:@""];
-               NSMenu *subMenu = [[NSMenu alloc] initWithTitle:@""];
-               NSMenuItem *subMenuItem = [menu addItemWithTitle:contextMenuTitle action:nil keyEquivalent:@""];
-               subMenuItem.submenu = subMenu;
-               subMenuItem.image = [[NSBundle mainBundle] imageForResource:@"app.icns"];
-
-               // There is an annoying bug in macOS (at least 10.13.3), it does not use/copy over the representedObject of a menu item
-               // So we have to use tag instead.
-               int idx = 0;
-               for (NSArray* item in _menuItems) {
-                       NSMenuItem *actionItem = [subMenu addItemWithTitle:[item valueForKey:@"text"]
-                                                                                                               action:@selector(subMenuActionClicked:)
-                                                                                                keyEquivalent:@""];
-                       [actionItem setTag:idx];
-                       [actionItem setTarget:self];
-                       NSString *flags = [item valueForKey:@"flags"]; // e.g. "d"
-                       if ([flags rangeOfString:@"d"].location != NSNotFound) {
-                               [actionItem setEnabled:false];
-                       }
-                       idx++;
-               }
-               return menu;
-       }
-       return nil;
-}
-
-- (void)subMenuActionClicked:(id)sender {
-       long idx = [(NSMenuItem*)sender tag];
-       NSString *command = [[_menuItems objectAtIndex:idx] valueForKey:@"command"];
-       NSString *paths = [self selectedPathsSeparatedByRecordSeparator];
-       [self.localSocketClient askOnSocket:paths query:command];
-}
-
-#pragma mark - SyncClientProxyDelegate implementation
-
-- (void)setResultForPath:(NSString*)path result:(NSString*)result
-{
-       NSString *normalizedPath = [path decomposedStringWithCanonicalMapping];
-       [[FIFinderSyncController defaultController] setBadgeIdentifier:result forURL:[NSURL fileURLWithPath:normalizedPath]];
-}
-
-- (void)reFetchFileNameCacheForPath:(NSString*)path
-{
-    
-}
-
-- (void)registerPath:(NSString*)path
-{
-       assert(_registeredDirectories);
-       [_registeredDirectories addObject:[NSURL fileURLWithPath:path]];
-       [FIFinderSyncController defaultController].directoryURLs = _registeredDirectories;
-}
-
-- (void)unregisterPath:(NSString*)path
-{
-       [_registeredDirectories removeObject:[NSURL fileURLWithPath:path]];
-       [FIFinderSyncController defaultController].directoryURLs = _registeredDirectories;
-}
-
-- (void)setString:(NSString*)key value:(NSString*)value
-{
-       [_strings setObject:value forKey:key];
-}
-
-- (void)resetMenuItems
-{
-       _menuItems = [[NSMutableArray alloc] init];
-}
-- (void)addMenuItem:(NSDictionary *)item {
-    NSLog(@"Adding menu item.");
-       [_menuItems addObject:item];
-}
-
-- (void)menuHasCompleted
-{
-    NSLog(@"Emitting menu is complete signal now.");
-    [self->_menuIsComplete signal];
-}
-
-- (void)connectionDidDie
-{
-       [_strings removeAllObjects];
-       [_registeredDirectories removeAllObjects];
-       // For some reason the FIFinderSync cache doesn't seem to be cleared for the root item when
-       // we reset the directoryURLs (seen on macOS 10.12 at least).
-       // First setting it to the FS root and then setting it to nil seems to work around the issue.
-       [FIFinderSyncController defaultController].directoryURLs = [NSSet setWithObject:[NSURL fileURLWithPath:@"/"]];
-       // This will tell Finder that this extension isn't attached to any directory
-       // until we can reconnect to the sync client.
-       [FIFinderSyncController defaultController].directoryURLs = nil;
-}
-
-@end
-
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSyncExt.entitlements b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/FinderSyncExt.entitlements
deleted file mode 100644 (file)
index 5d2a36d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>com.apple.security.app-sandbox</key>
-       <true/>
-       <key>com.apple.security.application-groups</key>
-       <array>
-               <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
-       </array>
-</dict>
-</plist>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/Info.plist b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/Info.plist
deleted file mode 100644 (file)
index 2a669ce..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>en</string>
-       <key>CFBundleDisplayName</key>
-       <string>$(OC_APPLICATION_NAME) Extensions</string>
-       <key>CFBundleExecutable</key>
-       <string>$(EXECUTABLE_NAME)</string>
-       <key>CFBundleIdentifier</key>
-       <string>$(OC_APPLICATION_REV_DOMAIN).$(PRODUCT_NAME:rfc1034identifier)</string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleName</key>
-       <string>$(PRODUCT_NAME)</string>
-       <key>CFBundlePackageType</key>
-       <string>XPC!</string>
-       <key>CFBundleShortVersionString</key>
-       <string>1.0</string>
-       <key>CFBundleSignature</key>
-       <string>????</string>
-       <key>CFBundleVersion</key>
-       <string>1</string>
-       <key>LSMinimumSystemVersion</key>
-       <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
-       <key>LSUIElement</key>
-       <true/>
-       <key>NSExtension</key>
-       <dict>
-               <key>NSExtensionAttributes</key>
-               <dict/>
-               <key>NSExtensionPointIdentifier</key>
-               <string>com.apple.FinderSync</string>
-               <key>NSExtensionPrincipalClass</key>
-               <string>FinderSync</string>
-       </dict>
-       <key>NSPrincipalClass</key>
-       <string>NSApplication</string>
-       <key>SocketApiPrefix</key>
-       <string>$(OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX)$(OC_APPLICATION_REV_DOMAIN)</string>
-</dict>
-</plist>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LineProcessor.h b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LineProcessor.h
deleted file mode 100644 (file)
index 137ce62..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-#import "SyncClient.h"
-
-#ifndef LineProcessor_h
-#define LineProcessor_h
-
-/// This class is in charge of dispatching all work that must be done on the UI side of the extension.
-/// Tasks are dispatched on the main UI thread for this reason.
-///
-/// These tasks are parsed from byte data (UTF9 strings) acquired from the socket; look at the
-/// LocalSocketClient for more detail on how data is read from and written to the socket.
-
-@interface LineProcessor : NSObject
-@property(nonatomic, weak)id<SyncClientDelegate> delegate;
-
-- (instancetype)initWithDelegate:(id<SyncClientDelegate>)delegate;
-- (void)process:(NSString*)line;
-
-@end
-#endif /* LineProcessor_h */
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LineProcessor.m b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LineProcessor.m
deleted file mode 100644 (file)
index 56ec704..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-#import <Foundation/Foundation.h>
-#import "LineProcessor.h"
-
-@implementation LineProcessor
-
--(instancetype)initWithDelegate:(id<SyncClientDelegate>)delegate
-{
-    NSLog(@"Init line processor with delegate.");
-    self = [super init];
-    if (self) {
-        self.delegate = delegate;
-    }
-    return self;
-}
-
--(void)process:(NSString*)line
-{
-    NSLog(@"Processing line: %@", line);
-    NSArray *split = [line componentsSeparatedByString:@":"];
-    NSString *command = [split objectAtIndex:0];
-    
-    NSLog(@"Command: %@", command);
-    
-    if([command isEqualToString:@"STATUS"]) {
-        NSString *result = [split objectAtIndex:1];
-        NSArray *pathSplit = [split subarrayWithRange:NSMakeRange(2, [split count] - 2)]; // Get everything after location 2
-        NSString *path = [pathSplit componentsJoinedByString:@":"];
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            NSLog(@"Setting result %@ for path %@", result, path);
-            [self.delegate setResultForPath:path result:result];
-        });
-    } else if([command isEqualToString:@"UPDATE_VIEW"]) {
-        NSString *path = [split objectAtIndex:1];
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            NSLog(@"Re-fetching filename cache for path %@", path);
-            [self.delegate reFetchFileNameCacheForPath:path];
-        });
-    } else if([command isEqualToString:@"REGISTER_PATH"]) {
-        NSString *path = [split objectAtIndex:1];
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            NSLog(@"Registering path %@", path);
-            [self.delegate registerPath:path];
-        });
-    } else if([command isEqualToString:@"UNREGISTER_PATH"]) {
-        NSString *path = [split objectAtIndex:1];
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            NSLog(@"Unregistering path %@", path);
-            [self.delegate unregisterPath:path];
-        });
-    } else if([command isEqualToString:@"GET_STRINGS"]) {
-        // BEGIN and END messages, do nothing.
-        return;
-    } else if([command isEqualToString:@"STRING"]) {
-        NSString *key = [split objectAtIndex:1];
-        NSString *value = [split objectAtIndex:2];
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            NSLog(@"Setting string %@ to value %@", key, value);
-            [self.delegate setString:key value:value];
-        });
-    } else if([command isEqualToString:@"GET_MENU_ITEMS"]) {
-        if([[split objectAtIndex:1] isEqualToString:@"BEGIN"]) {
-            dispatch_async(dispatch_get_main_queue(), ^{
-                NSLog(@"Resetting menu items.");
-                [self.delegate resetMenuItems];
-            });
-        } else {
-            NSLog(@"Emitting menu has completed signal.");
-            [self.delegate menuHasCompleted];
-        }
-    } else if([command isEqualToString:@"MENU_ITEM"]) {
-        NSDictionary *item = @{@"command": [split objectAtIndex:1], @"flags": [split objectAtIndex:2], @"text": [split objectAtIndex:3]};
-        
-        dispatch_async(dispatch_get_main_queue(), ^{
-            NSLog(@"Adding menu item with command %@, flags %@, and text %@", [split objectAtIndex:1], [split objectAtIndex:2], [split objectAtIndex:3]);
-            [self.delegate addMenuItem:item];
-        });
-    } else {
-        // LOG UNKOWN COMMAND
-        NSLog(@"Unkown command: %@", command);
-    }
-}
-
-@end
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.h b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.h
deleted file mode 100644 (file)
index 4a858cd..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-#import "LineProcessor.h"
-
-#ifndef LocalSocketClient_h
-#define LocalSocketClient_h
-#define BUF_SIZE 4096
-
-/// Class handling asynchronous communication with a server over a local UNIX socket.
-///
-/// The implementation uses a `DispatchQueue` and `DispatchSource`s to handle asynchronous communication and thread
-/// safety. The delegate that handles the line-decoding is **not invoked on the UI thread**, but the (random) thread associated
-/// with the `DispatchQueue`.
-///
-/// If any UI work needs to be done, the `LineProcessor` class dispatches this work on the main queue (so the UI thread) itself.
-///
-/// Other than the `init(withSocketPath:, lineProcessor)` and the `start()` method, all work is done "on the dispatch
-/// queue". The `localSocketQueue` is a serial dispatch queue (so a maximum of 1, and only 1, task is run at any
-/// moment), which guarantees safe access to instance variables. Both `askOnSocket(_:, query:)` and
-/// `askForIcon(_:, isDirectory:)` will internally dispatch the work on the `DispatchQueue`.
-///
-/// Sending and receiving data to and from the socket, is handled by two `DispatchSource`s. These will run an event
-/// handler when data can be read from resp. written to the socket. These handlers will also be run on the
-/// `DispatchQueue`.
-
-@interface LocalSocketClient : NSObject
-
-@property NSString* socketPath;
-@property LineProcessor* lineProcessor;
-@property int sock;
-@property dispatch_queue_t localSocketQueue;
-@property dispatch_source_t readSource;
-@property dispatch_source_t writeSource;
-@property NSMutableData* inBuffer;
-@property NSMutableData* outBuffer;
-
-- (instancetype)init:(NSString*)socketPath lineProcessor:(LineProcessor*)lineProcessor;
-- (BOOL)isConnected;
-- (void)start;
-- (void)restart;
-- (void)closeConnection;
-- (NSString*)strErr;
-- (void)askOnSocket:(NSString*)path query:(NSString*)verb;
-- (void)askForIcon:(NSString*)path isDirectory:(BOOL)isDirectory;
-- (void)readFromSocket;
-- (void)writeToSocket;
-- (void)processInBuffer;
-
-@end
-#endif /* LocalSocketClient_h */
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.m b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/LocalSocketClient.m
deleted file mode 100644 (file)
index ab43a5d..0000000
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (C) 2022 by Claudio Cambra <claudio.cambra@nextcloud.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-#import <Foundation/Foundation.h>
-#import "LocalSocketClient.h"
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <stdio.h>
-#include <string.h>
-
-@implementation LocalSocketClient
-
-- (instancetype)init:(NSString*)socketPath lineProcessor:(LineProcessor*)lineProcessor
-{
-    NSLog(@"Initiating local socket client.");
-    self = [super init];
-    
-    if(self) {
-        self.socketPath = socketPath;
-        self.lineProcessor = lineProcessor;
-        
-        self.sock = -1;
-        self.localSocketQueue = dispatch_queue_create("localSocketQueue", DISPATCH_QUEUE_SERIAL);
-        
-        self.inBuffer = [NSMutableData data];
-        self.outBuffer = [NSMutableData data];
-    }
-        
-    return self;
-}
-
-- (BOOL)isConnected
-{
-    NSLog(@"Checking is connected: %@", self.sock != -1 ? @"YES" : @"NO");
-    return self.sock != -1;
-}
-
-- (void)start
-{
-    if([self isConnected]) {
-        NSLog(@"Socket client already connected. Not starting.");
-        return;
-    }
-    
-    struct sockaddr_un localSocketAddr;
-    unsigned long socketPathByteCount = [self.socketPath lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; // add 1 for the NUL terminator char
-    int maxByteCount = sizeof(localSocketAddr.sun_path);
-    
-    if(socketPathByteCount > maxByteCount) {
-        // LOG THAT THE SOCKET PATH IS TOO LONG HERE
-        NSLog(@"Socket path '%@' is too long: maximum socket path length is %i, this path is of length %lu", self.socketPath, maxByteCount, socketPathByteCount);
-        return;
-    }
-    
-    NSLog(@"Opening local socket...");
-    
-    // LOG THAT THE SOCKET IS BEING OPENED HERE
-    self.sock = socket(AF_LOCAL, SOCK_STREAM, 0);
-    
-    if(self.sock == -1) {
-        NSLog(@"Cannot open socket: '%@'", [self strErr]);
-        [self restart];
-        return;
-    }
-    
-    NSLog(@"Local socket opened. Connecting to '%@' ...", self.socketPath);
-    
-    localSocketAddr.sun_family = AF_LOCAL & 0xff;
-    
-    const char* pathBytes = [self.socketPath UTF8String];
-    strcpy(localSocketAddr.sun_path, pathBytes);
-    
-    int connectionStatus = connect(self.sock, (struct sockaddr*)&localSocketAddr, sizeof(localSocketAddr));
-    
-    if(connectionStatus == -1) {
-        NSLog(@"Could not connect to '%@': '%@'", self.socketPath, [self strErr]);
-        [self restart];
-        return;
-    }
-    
-    int flags = fcntl(self.sock, F_GETFL, 0);
-    
-    if(fcntl(self.sock, F_SETFL, flags | O_NONBLOCK) == -1) {
-        NSLog(@"Could not set socket to non-blocking mode: '%@'", [self strErr]);
-        [self restart];
-        return;
-    }
-    
-    NSLog(@"Connected to socket. Setting up dispatch sources...");
-    
-    self.readSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, self.sock, 0, self.localSocketQueue);
-    dispatch_source_set_event_handler(self.readSource, ^(void){ [self readFromSocket]; });
-    dispatch_source_set_cancel_handler(self.readSource, ^(void){
-        self.readSource = nil;
-        [self closeConnection];
-    });
-    
-    self.writeSource = dispatch_source_create(DISPATCH_SOURCE_TYPE_WRITE, self.sock, 0, self.localSocketQueue);
-    dispatch_source_set_event_handler(self.writeSource, ^(void){ [self writeToSocket]; });
-    dispatch_source_set_cancel_handler(self.writeSource, ^(void){
-        self.writeSource = nil;
-        [self closeConnection];
-    });
-    
-    // These dispatch sources are suspended upon creation.
-    // We resume the writeSource when we actually have something to write, suspending it again once our outBuffer is empty.
-    // We start the readSource now.
-    
-    NSLog(@"Starting to read from socket");
-    
-    dispatch_resume(self.readSource);
-    [self askOnSocket:@"" query:@"GET_STRINGS"];
-}
-
-- (void)restart
-{
-    NSLog(@"Restarting connection to socket.");
-    [self closeConnection];
-    dispatch_async(dispatch_get_main_queue(), ^(void){
-        [NSTimer scheduledTimerWithTimeInterval:5 repeats:NO block:^(NSTimer* timer) {
-            [self start];
-        }];
-    });
-}
-
-- (void)closeConnection
-{
-    NSLog(@"Closing connection.");
-    
-    if(self.readSource) {
-        // Since dispatch_source_cancel works asynchronously, if we deallocate the dispatch source here then we can
-        // cause a crash. So instead we strongly hold a reference to the read source and deallocate it asynchronously
-        // with the handler.
-        __block dispatch_source_t previousReadSource = self.readSource;
-        dispatch_source_set_cancel_handler(self.readSource, ^{
-            previousReadSource = nil;
-        });
-        dispatch_source_cancel(self.readSource);
-        // The readSource is still alive due to the other reference and will be deallocated by the cancel handler
-        self.readSource = nil;
-    }
-    
-    if(self.writeSource) {
-        // Same deal with the write source
-        __block dispatch_source_t previousWriteSource = self.writeSource;
-        dispatch_source_set_cancel_handler(self.writeSource, ^{
-            previousWriteSource = nil;
-        });
-        dispatch_source_cancel(self.writeSource);
-        self.writeSource = nil;
-    }
-
-    [self.inBuffer setLength:0];
-    [self.outBuffer setLength: 0];
-    
-    if(self.sock != -1) {
-        close(self.sock);
-        self.sock = -1;
-    }
-}
-
-- (NSString*)strErr
-{
-    int err = errno;
-    const char *errStr = strerror(err);
-    NSString *errorStr = [NSString stringWithUTF8String:errStr];
-    
-    if([errorStr length] == 0) {
-        return errorStr;
-    } else {
-        return [NSString stringWithFormat:@"Unknown error code: %i\10", err];
-    }
-}
-
-- (void)askOnSocket:(NSString *)path query:(NSString *)verb
-{
-    NSString *line = [NSString stringWithFormat:@"%@:%@\n", verb, path];
-    dispatch_async(self.localSocketQueue, ^(void) {
-        if(![self isConnected]) {
-            return;
-        }
-        
-        BOOL writeSourceIsSuspended = [self.outBuffer length] == 0;
-        
-        [self.outBuffer appendData:[line dataUsingEncoding:NSUTF8StringEncoding]];
-        
-        NSLog(@"Writing to out buffer: '%@'", line);
-        NSLog(@"Out buffer now %li bytes", [self.outBuffer length]);
-        
-        if(writeSourceIsSuspended) {
-            NSLog(@"Resuming write dispatch source.");
-            dispatch_resume(self.writeSource);
-        }
-    });
-}
-
-- (void)writeToSocket
-{
-    if(![self isConnected]) {
-        return;
-    }
-    
-    if([self.outBuffer length] == 0) {
-        NSLog(@"Empty out buffer, suspending write dispatch source.");
-        dispatch_suspend(self.writeSource);
-        return;
-    }
-    
-    NSLog(@"About to write %li bytes from outbuffer to socket.", [self.outBuffer length]);
-    
-    long bytesWritten = write(self.sock, [self.outBuffer bytes], [self.outBuffer length]);
-    char lineWritten[[self.outBuffer length]];
-    memcpy(lineWritten, [self.outBuffer bytes], [self.outBuffer length]);
-    NSLog(@"Wrote %li bytes to socket. Line written was: '%@'", bytesWritten, [NSString stringWithUTF8String:lineWritten]);
-    
-    if(bytesWritten == 0) {
-        // 0 means we reached "end of file" and thus the socket was closed\10. So let's restart it
-        NSLog(@"Socket was closed. Restarting...");
-        [self restart];
-    } else if(bytesWritten == -1) {
-        int err = errno; // Make copy before it gets nuked by something else
-        
-        if(err == EAGAIN || err == EWOULDBLOCK)  {
-            // No free space in the OS' buffer, nothing to do here
-            NSLog(@"No free space in OS buffer. Ending write.");
-            return;
-        } else {
-            NSLog(@"Error writing to local socket: '%@'", [self strErr]);
-            [self restart];
-        }
-    } else if(bytesWritten > 0) {
-        [self.outBuffer replaceBytesInRange:NSMakeRange(0, bytesWritten) withBytes:NULL length:0];
-        
-        NSLog(@"Out buffer cleared. Now count is %li bytes.", [self.outBuffer length]);
-        
-        if([self.outBuffer length] == 0) {
-            NSLog(@"Out buffer has been emptied, suspending write dispatch source.");
-            dispatch_suspend(self.writeSource);
-        }
-    }
-}
-
-- (void)askForIcon:(NSString*)path isDirectory:(BOOL)isDirectory;
-{
-    NSLog(@"Asking for icon.");
-    
-    NSString *verb;
-    if(isDirectory) {
-        verb = @"RETRIEVE_FOLDER_STATUS";
-    } else {
-        verb = @"RETRIEVE_FILE_STATUS";
-    }
-    
-    [self askOnSocket:path query:verb];
-}
-
-- (void)readFromSocket
-{
-    if(![self isConnected]) {
-        return;
-    }
-    
-    NSLog(@"Reading from socket.");
-    
-    int bufferLength = BUF_SIZE / 2;
-    char buffer[bufferLength];
-    
-    while(true) {
-        long bytesRead = read(self.sock, buffer, bufferLength);
-        
-        NSLog(@"Read %li bytes from socket.", bytesRead);
-        
-        if(bytesRead == 0) {
-            // 0 means we reached "end of file" and thus the socket was closed\10. So let's restart it
-            NSLog(@"Socket was closed. Restarting...");
-            [self restart];
-            return;
-        } else if(bytesRead == -1) {
-            int err = errno;
-            if(err == EAGAIN) {
-                NSLog(@"No error and no data. Stopping.");
-                return; // No error, no data, so let's stop
-            } else {
-                NSLog(@"Error reading from local socket: '%@'", [self strErr]);
-                [self closeConnection];
-                return;
-            }
-        } else {
-            [self.inBuffer appendBytes:buffer length:bytesRead];
-            [self processInBuffer];
-        }
-    }
-}
-
-- (void)processInBuffer
-{
-    NSLog(@"Processing in buffer. In buffer length %li", [self.inBuffer length]);
-    UInt8 separator[] = {0xa}; // Byte value for "\n"
-    while(true) {
-        NSRange firstSeparatorIndex = [self.inBuffer rangeOfData:[NSData dataWithBytes:separator length:1] options:0 range:NSMakeRange(0, [self.inBuffer length])];
-        
-        if(firstSeparatorIndex.location == NSNotFound) {
-            NSLog(@"No separator found. Stopping.");
-            return; // No separator, nope out
-        } else {
-            unsigned char *buffer = [self.inBuffer mutableBytes];
-            buffer[firstSeparatorIndex.location] = 0; // Add NULL terminator, so we can use C string methods
-            
-            NSString *newLine = [NSString stringWithUTF8String:[self.inBuffer bytes]];
-
-            [self.inBuffer replaceBytesInRange:NSMakeRange(0, firstSeparatorIndex.location + 1) withBytes:NULL length:0];
-            [self.lineProcessor process:newLine];
-        }
-    }
-}
-    
-@end
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/SyncClient.h b/shell_integration/MacOSX/OwnCloudFinderSync/FinderSyncExt/SyncClient.h
deleted file mode 100644 (file)
index f8c495a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Copyright (C) by Jocelyn Turcotte <jturcotte@woboq.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * for more details.
- */
-
-#import <Foundation/Foundation.h>
-
-@protocol SyncClientDelegate <NSObject>
-- (void)setResultForPath:(NSString *)path result:(NSString *)result;
-- (void)reFetchFileNameCacheForPath:(NSString *)path;
-- (void)registerPath:(NSString *)path;
-- (void)unregisterPath:(NSString *)path;
-- (void)setString:(NSString *)key value:(NSString *)value;
-- (void)resetMenuItems;
-- (void)addMenuItem:(NSDictionary *)item;
-- (void)menuHasCompleted;
-- (void)connectionDidDie;
-@end
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj b/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.pbxproj
deleted file mode 100644 (file)
index f15453b..0000000
+++ /dev/null
@@ -1,814 +0,0 @@
-// !$*UTF8*$!
-{
-       archiveVersion = 1;
-       classes = {
-       };
-       objectVersion = 46;
-       objects = {
-
-/* Begin PBXBuildFile section */
-               538E396A27F4765000FA63D5 /* UniformTypeIdentifiers.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */; };
-               538E396D27F4765000FA63D5 /* FileProviderExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538E396C27F4765000FA63D5 /* FileProviderExtension.swift */; };
-               538E396F27F4765000FA63D5 /* FileProviderItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538E396E27F4765000FA63D5 /* FileProviderItem.swift */; };
-               538E397127F4765000FA63D5 /* FileProviderEnumerator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538E397027F4765000FA63D5 /* FileProviderEnumerator.swift */; };
-               538E397627F4765000FA63D5 /* FileProviderExt.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 538E396727F4765000FA63D5 /* FileProviderExt.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
-               539158AC27BE71A900816F56 /* LineProcessor.m in Sources */ = {isa = PBXBuildFile; fileRef = 539158AB27BE71A900816F56 /* LineProcessor.m */; };
-               539158B327BEC98A00816F56 /* LocalSocketClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 539158B227BEC98A00816F56 /* LocalSocketClient.m */; };
-               C2B573BA1B1CD91E00303B36 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C2B573B91B1CD91E00303B36 /* main.m */; };
-               C2B573D21B1CD94B00303B36 /* main.m in Resources */ = {isa = PBXBuildFile; fileRef = C2B573B91B1CD91E00303B36 /* main.m */; };
-               C2B573DE1B1CD9CE00303B36 /* FinderSync.m in Sources */ = {isa = PBXBuildFile; fileRef = C2B573DD1B1CD9CE00303B36 /* FinderSync.m */; };
-               C2B573E21B1CD9CE00303B36 /* FinderSyncExt.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = C2B573D71B1CD9CE00303B36 /* FinderSyncExt.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
-               C2B573F31B1DAD6400303B36 /* error.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573EB1B1DAD6400303B36 /* error.iconset */; };
-               C2B573F41B1DAD6400303B36 /* ok_swm.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573EC1B1DAD6400303B36 /* ok_swm.iconset */; };
-               C2B573F51B1DAD6400303B36 /* ok.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573ED1B1DAD6400303B36 /* ok.iconset */; };
-               C2B573F71B1DAD6400303B36 /* sync.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573EF1B1DAD6400303B36 /* sync.iconset */; };
-               C2B573F91B1DAD6400303B36 /* warning.iconset in Resources */ = {isa = PBXBuildFile; fileRef = C2B573F11B1DAD6400303B36 /* warning.iconset */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
-               538E397427F4765000FA63D5 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = C2B573951B1CD88000303B36 /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = 538E396627F4765000FA63D5;
-                       remoteInfo = FileProviderExt;
-               };
-               C2B573DF1B1CD9CE00303B36 /* PBXContainerItemProxy */ = {
-                       isa = PBXContainerItemProxy;
-                       containerPortal = C2B573951B1CD88000303B36 /* Project object */;
-                       proxyType = 1;
-                       remoteGlobalIDString = C2B573D61B1CD9CE00303B36;
-                       remoteInfo = FinderSyncExt;
-               };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
-               C2B573E11B1CD9CE00303B36 /* Embed App Extensions */ = {
-                       isa = PBXCopyFilesBuildPhase;
-                       buildActionMask = 8;
-                       dstPath = "";
-                       dstSubfolderSpec = 13;
-                       files = (
-                               C2B573E21B1CD9CE00303B36 /* FinderSyncExt.appex in Embed App Extensions */,
-                               538E397627F4765000FA63D5 /* FileProviderExt.appex in Embed App Extensions */,
-                       );
-                       name = "Embed App Extensions";
-                       runOnlyForDeploymentPostprocessing = 1;
-               };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
-               538E396727F4765000FA63D5 /* FileProviderExt.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = FileProviderExt.appex; sourceTree = BUILT_PRODUCTS_DIR; };
-               538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UniformTypeIdentifiers.framework; path = System/Library/Frameworks/UniformTypeIdentifiers.framework; sourceTree = SDKROOT; };
-               538E396C27F4765000FA63D5 /* FileProviderExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderExtension.swift; sourceTree = "<group>"; };
-               538E396E27F4765000FA63D5 /* FileProviderItem.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderItem.swift; sourceTree = "<group>"; };
-               538E397027F4765000FA63D5 /* FileProviderEnumerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProviderEnumerator.swift; sourceTree = "<group>"; };
-               538E397227F4765000FA63D5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-               538E397327F4765000FA63D5 /* FileProviderExt.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = FileProviderExt.entitlements; sourceTree = "<group>"; };
-               539158A927BE606500816F56 /* LineProcessor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LineProcessor.h; sourceTree = "<group>"; };
-               539158AA27BE67CC00816F56 /* SyncClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SyncClient.h; sourceTree = "<group>"; };
-               539158AB27BE71A900816F56 /* LineProcessor.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LineProcessor.m; sourceTree = "<group>"; };
-               539158B127BE891500816F56 /* LocalSocketClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalSocketClient.h; sourceTree = "<group>"; };
-               539158B227BEC98A00816F56 /* LocalSocketClient.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocalSocketClient.m; sourceTree = "<group>"; };
-               C2B573B11B1CD91E00303B36 /* desktopclient.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = desktopclient.app; sourceTree = BUILT_PRODUCTS_DIR; };
-               C2B573B51B1CD91E00303B36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-               C2B573B91B1CD91E00303B36 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
-               C2B573D71B1CD9CE00303B36 /* FinderSyncExt.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = FinderSyncExt.appex; sourceTree = BUILT_PRODUCTS_DIR; };
-               C2B573DA1B1CD9CE00303B36 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
-               C2B573DB1B1CD9CE00303B36 /* FinderSyncExt.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = FinderSyncExt.entitlements; sourceTree = "<group>"; };
-               C2B573DC1B1CD9CE00303B36 /* FinderSync.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FinderSync.h; sourceTree = "<group>"; };
-               C2B573DD1B1CD9CE00303B36 /* FinderSync.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FinderSync.m; sourceTree = "<group>"; };
-               C2B573EB1B1DAD6400303B36 /* error.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = error.iconset; path = ../../icons/nopadding/error.iconset; sourceTree = SOURCE_ROOT; };
-               C2B573EC1B1DAD6400303B36 /* ok_swm.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = ok_swm.iconset; path = ../../icons/nopadding/ok_swm.iconset; sourceTree = SOURCE_ROOT; };
-               C2B573ED1B1DAD6400303B36 /* ok.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = ok.iconset; path = ../../icons/nopadding/ok.iconset; sourceTree = SOURCE_ROOT; };
-               C2B573EF1B1DAD6400303B36 /* sync.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = sync.iconset; path = ../../icons/nopadding/sync.iconset; sourceTree = SOURCE_ROOT; };
-               C2B573F11B1DAD6400303B36 /* warning.iconset */ = {isa = PBXFileReference; lastKnownFileType = folder.iconset; name = warning.iconset; path = ../../icons/nopadding/warning.iconset; sourceTree = SOURCE_ROOT; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
-               538E396427F4765000FA63D5 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               538E396A27F4765000FA63D5 /* UniformTypeIdentifiers.framework in Frameworks */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               C2B573AE1B1CD91E00303B36 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               C2B573D41B1CD9CE00303B36 /* Frameworks */ = {
-                       isa = PBXFrameworksBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
-               538E396827F4765000FA63D5 /* Frameworks */ = {
-                       isa = PBXGroup;
-                       children = (
-                               538E396927F4765000FA63D5 /* UniformTypeIdentifiers.framework */,
-                       );
-                       name = Frameworks;
-                       sourceTree = "<group>";
-               };
-               538E396B27F4765000FA63D5 /* FileProviderExt */ = {
-                       isa = PBXGroup;
-                       children = (
-                               538E396C27F4765000FA63D5 /* FileProviderExtension.swift */,
-                               538E396E27F4765000FA63D5 /* FileProviderItem.swift */,
-                               538E397027F4765000FA63D5 /* FileProviderEnumerator.swift */,
-                               538E397227F4765000FA63D5 /* Info.plist */,
-                               538E397327F4765000FA63D5 /* FileProviderExt.entitlements */,
-                       );
-                       path = FileProviderExt;
-                       sourceTree = "<group>";
-               };
-               C2B573941B1CD88000303B36 = {
-                       isa = PBXGroup;
-                       children = (
-                               C2B573B31B1CD91E00303B36 /* desktopclient */,
-                               C2B573D81B1CD9CE00303B36 /* FinderSyncExt */,
-                               538E396B27F4765000FA63D5 /* FileProviderExt */,
-                               538E396827F4765000FA63D5 /* Frameworks */,
-                               C2B573B21B1CD91E00303B36 /* Products */,
-                       );
-                       sourceTree = "<group>";
-               };
-               C2B573B21B1CD91E00303B36 /* Products */ = {
-                       isa = PBXGroup;
-                       children = (
-                               C2B573B11B1CD91E00303B36 /* desktopclient.app */,
-                               C2B573D71B1CD9CE00303B36 /* FinderSyncExt.appex */,
-                               538E396727F4765000FA63D5 /* FileProviderExt.appex */,
-                       );
-                       name = Products;
-                       sourceTree = "<group>";
-               };
-               C2B573B31B1CD91E00303B36 /* desktopclient */ = {
-                       isa = PBXGroup;
-                       children = (
-                               C2B573B41B1CD91E00303B36 /* Supporting Files */,
-                       );
-                       path = desktopclient;
-                       sourceTree = "<group>";
-               };
-               C2B573B41B1CD91E00303B36 /* Supporting Files */ = {
-                       isa = PBXGroup;
-                       children = (
-                               C2B573B51B1CD91E00303B36 /* Info.plist */,
-                               C2B573B91B1CD91E00303B36 /* main.m */,
-                       );
-                       name = "Supporting Files";
-                       sourceTree = "<group>";
-               };
-               C2B573D81B1CD9CE00303B36 /* FinderSyncExt */ = {
-                       isa = PBXGroup;
-                       children = (
-                               539158AA27BE67CC00816F56 /* SyncClient.h */,
-                               C2B573DC1B1CD9CE00303B36 /* FinderSync.h */,
-                               C2B573DD1B1CD9CE00303B36 /* FinderSync.m */,
-                               539158A927BE606500816F56 /* LineProcessor.h */,
-                               539158AB27BE71A900816F56 /* LineProcessor.m */,
-                               539158B127BE891500816F56 /* LocalSocketClient.h */,
-                               539158B227BEC98A00816F56 /* LocalSocketClient.m */,
-                               C2B573D91B1CD9CE00303B36 /* Supporting Files */,
-                       );
-                       path = FinderSyncExt;
-                       sourceTree = "<group>";
-               };
-               C2B573D91B1CD9CE00303B36 /* Supporting Files */ = {
-                       isa = PBXGroup;
-                       children = (
-                               C2B573EB1B1DAD6400303B36 /* error.iconset */,
-                               C2B573EC1B1DAD6400303B36 /* ok_swm.iconset */,
-                               C2B573ED1B1DAD6400303B36 /* ok.iconset */,
-                               C2B573EF1B1DAD6400303B36 /* sync.iconset */,
-                               C2B573F11B1DAD6400303B36 /* warning.iconset */,
-                               C2B573DA1B1CD9CE00303B36 /* Info.plist */,
-                               C2B573DB1B1CD9CE00303B36 /* FinderSyncExt.entitlements */,
-                       );
-                       name = "Supporting Files";
-                       sourceTree = "<group>";
-               };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
-               538E396627F4765000FA63D5 /* FileProviderExt */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = 538E397927F4765000FA63D5 /* Build configuration list for PBXNativeTarget "FileProviderExt" */;
-                       buildPhases = (
-                               538E396327F4765000FA63D5 /* Sources */,
-                               538E396427F4765000FA63D5 /* Frameworks */,
-                               538E396527F4765000FA63D5 /* Resources */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                       );
-                       name = FileProviderExt;
-                       packageProductDependencies = (
-                       );
-                       productName = FileProviderExt;
-                       productReference = 538E396727F4765000FA63D5 /* FileProviderExt.appex */;
-                       productType = "com.apple.product-type.app-extension";
-               };
-               C2B573B01B1CD91E00303B36 /* desktopclient */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = C2B573CC1B1CD91E00303B36 /* Build configuration list for PBXNativeTarget "desktopclient" */;
-                       buildPhases = (
-                               C2B573AD1B1CD91E00303B36 /* Sources */,
-                               C2B573AE1B1CD91E00303B36 /* Frameworks */,
-                               C2B573AF1B1CD91E00303B36 /* Resources */,
-                               C2B573E11B1CD9CE00303B36 /* Embed App Extensions */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                               C2B573E01B1CD9CE00303B36 /* PBXTargetDependency */,
-                               538E397527F4765000FA63D5 /* PBXTargetDependency */,
-                       );
-                       name = desktopclient;
-                       productName = desktopclient;
-                       productReference = C2B573B11B1CD91E00303B36 /* desktopclient.app */;
-                       productType = "com.apple.product-type.application";
-               };
-               C2B573D61B1CD9CE00303B36 /* FinderSyncExt */ = {
-                       isa = PBXNativeTarget;
-                       buildConfigurationList = C2B573E31B1CD9CE00303B36 /* Build configuration list for PBXNativeTarget "FinderSyncExt" */;
-                       buildPhases = (
-                               C2B573D31B1CD9CE00303B36 /* Sources */,
-                               C2B573D41B1CD9CE00303B36 /* Frameworks */,
-                               C2B573D51B1CD9CE00303B36 /* Resources */,
-                               5B3335471CA058E200E11A45 /* ShellScript */,
-                       );
-                       buildRules = (
-                       );
-                       dependencies = (
-                       );
-                       name = FinderSyncExt;
-                       productName = FinderSyncExt;
-                       productReference = C2B573D71B1CD9CE00303B36 /* FinderSyncExt.appex */;
-                       productType = "com.apple.product-type.app-extension";
-               };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
-               C2B573951B1CD88000303B36 /* Project object */ = {
-                       isa = PBXProject;
-                       attributes = {
-                               LastSwiftUpdateCheck = 1330;
-                               LastUpgradeCheck = 1240;
-                               TargetAttributes = {
-                                       538E396627F4765000FA63D5 = {
-                                               CreatedOnToolsVersion = 13.3;
-                                               ProvisioningStyle = Manual;
-                                       };
-                                       C2B573B01B1CD91E00303B36 = {
-                                               CreatedOnToolsVersion = 6.3.1;
-                                               DevelopmentTeam = 9B5WD74GWJ;
-                                               ProvisioningStyle = Manual;
-                                       };
-                                       C2B573D61B1CD9CE00303B36 = {
-                                               CreatedOnToolsVersion = 6.3.1;
-                                               DevelopmentTeam = 9B5WD74GWJ;
-                                               ProvisioningStyle = Manual;
-                                               SystemCapabilities = {
-                                                       com.apple.ApplicationGroups.Mac = {
-                                                               enabled = 1;
-                                                       };
-                                               };
-                                       };
-                               };
-                       };
-                       buildConfigurationList = C2B573981B1CD88000303B36 /* Build configuration list for PBXProject "OwnCloudFinderSync" */;
-                       compatibilityVersion = "Xcode 3.2";
-                       developmentRegion = English;
-                       hasScannedForEncodings = 0;
-                       knownRegions = (
-                               English,
-                               en,
-                               Base,
-                       );
-                       mainGroup = C2B573941B1CD88000303B36;
-                       packageReferences = (
-                       );
-                       productRefGroup = C2B573B21B1CD91E00303B36 /* Products */;
-                       projectDirPath = "";
-                       projectRoot = "";
-                       targets = (
-                               C2B573B01B1CD91E00303B36 /* desktopclient */,
-                               C2B573D61B1CD9CE00303B36 /* FinderSyncExt */,
-                               538E396627F4765000FA63D5 /* FileProviderExt */,
-                       );
-               };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
-               538E396527F4765000FA63D5 /* Resources */ = {
-                       isa = PBXResourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               C2B573AF1B1CD91E00303B36 /* Resources */ = {
-                       isa = PBXResourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               C2B573D21B1CD94B00303B36 /* main.m in Resources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               C2B573D51B1CD9CE00303B36 /* Resources */ = {
-                       isa = PBXResourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               C2B573F91B1DAD6400303B36 /* warning.iconset in Resources */,
-                               C2B573F31B1DAD6400303B36 /* error.iconset in Resources */,
-                               C2B573F71B1DAD6400303B36 /* sync.iconset in Resources */,
-                               C2B573F41B1DAD6400303B36 /* ok_swm.iconset in Resources */,
-                               C2B573F51B1DAD6400303B36 /* ok.iconset in Resources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXShellScriptBuildPhase section */
-               5B3335471CA058E200E11A45 /* ShellScript */ = {
-                       isa = PBXShellScriptBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                       );
-                       inputPaths = (
-                       );
-                       outputPaths = (
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-                       shellPath = /bin/sh;
-                       shellScript = "if [[ ${OC_OEM_SHARE_ICNS} ]]; then\n  cp ${OC_OEM_SHARE_ICNS} ${BUILT_PRODUCTS_DIR}/FinderSyncExt.appex/Contents/Resources/app.icns\nfi";
-                       showEnvVarsInLog = 0;
-               };
-/* End PBXShellScriptBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
-               538E396327F4765000FA63D5 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               538E396D27F4765000FA63D5 /* FileProviderExtension.swift in Sources */,
-                               538E396F27F4765000FA63D5 /* FileProviderItem.swift in Sources */,
-                               538E397127F4765000FA63D5 /* FileProviderEnumerator.swift in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               C2B573AD1B1CD91E00303B36 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               C2B573BA1B1CD91E00303B36 /* main.m in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-               C2B573D31B1CD9CE00303B36 /* Sources */ = {
-                       isa = PBXSourcesBuildPhase;
-                       buildActionMask = 2147483647;
-                       files = (
-                               539158B327BEC98A00816F56 /* LocalSocketClient.m in Sources */,
-                               539158AC27BE71A900816F56 /* LineProcessor.m in Sources */,
-                               C2B573DE1B1CD9CE00303B36 /* FinderSync.m in Sources */,
-                       );
-                       runOnlyForDeploymentPostprocessing = 0;
-               };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
-               538E397527F4765000FA63D5 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = 538E396627F4765000FA63D5 /* FileProviderExt */;
-                       targetProxy = 538E397427F4765000FA63D5 /* PBXContainerItemProxy */;
-               };
-               C2B573E01B1CD9CE00303B36 /* PBXTargetDependency */ = {
-                       isa = PBXTargetDependency;
-                       target = C2B573D61B1CD9CE00303B36 /* FinderSyncExt */;
-                       targetProxy = C2B573DF1B1CD9CE00303B36 /* PBXContainerItemProxy */;
-               };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
-               538E397727F4765000FA63D5 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = NO;
-                               CLANG_ANALYZER_NONNULL = YES;
-                               CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
-                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
-                               CLANG_ENABLE_MODULES = YES;
-                               CLANG_ENABLE_OBJC_ARC = YES;
-                               CLANG_ENABLE_OBJC_WEAK = YES;
-                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-                               CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
-                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-                               CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
-                               CODE_SIGN_ENTITLEMENTS = FileProviderExt/FileProviderExt.entitlements;
-                               CODE_SIGN_IDENTITY = "-";
-                               CODE_SIGN_STYLE = Manual;
-                               COPY_PHASE_STRIP = NO;
-                               CURRENT_PROJECT_VERSION = 1;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               DEVELOPMENT_TEAM = "";
-                               GCC_C_LANGUAGE_STANDARD = gnu11;
-                               GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_OPTIMIZATION_LEVEL = 0;
-                               GCC_PREPROCESSOR_DEFINITIONS = (
-                                       "DEBUG=1",
-                                       "$(inherited)",
-                               );
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-                               GENERATE_INFOPLIST_FILE = YES;
-                               INFOPLIST_FILE = FileProviderExt/Info.plist;
-                               INFOPLIST_KEY_CFBundleDisplayName = FileProviderExt;
-                               INFOPLIST_KEY_NSHumanReadableCopyright = "";
-                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
-                               MACOSX_DEPLOYMENT_TARGET = 12.3;
-                               MARKETING_VERSION = 1.0;
-                               MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
-                               MTL_FAST_MATH = YES;
-                               ONLY_ACTIVE_ARCH = YES;
-                               PRODUCT_BUNDLE_IDENTIFIER = com.owncloud.desktopclient.FileProviderExt;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               PROVISIONING_PROFILE_SPECIFIER = "";
-                               SDKROOT = macosx;
-                               SKIP_INSTALL = YES;
-                               SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
-                               SWIFT_EMIT_LOC_STRINGS = YES;
-                               SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-                               SWIFT_VERSION = 5.0;
-                       };
-                       name = Debug;
-               };
-               538E397827F4765000FA63D5 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = NO;
-                               CLANG_ANALYZER_NONNULL = YES;
-                               CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
-                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
-                               CLANG_ENABLE_MODULES = YES;
-                               CLANG_ENABLE_OBJC_ARC = YES;
-                               CLANG_ENABLE_OBJC_WEAK = YES;
-                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-                               CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
-                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-                               CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
-                               CODE_SIGN_ENTITLEMENTS = FileProviderExt/FileProviderExt.entitlements;
-                               CODE_SIGN_IDENTITY = "-";
-                               CODE_SIGN_STYLE = Manual;
-                               COPY_PHASE_STRIP = NO;
-                               CURRENT_PROJECT_VERSION = 1;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               DEVELOPMENT_TEAM = "";
-                               ENABLE_NS_ASSERTIONS = NO;
-                               GCC_C_LANGUAGE_STANDARD = gnu11;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-                               GENERATE_INFOPLIST_FILE = YES;
-                               INFOPLIST_FILE = FileProviderExt/Info.plist;
-                               INFOPLIST_KEY_CFBundleDisplayName = FileProviderExt;
-                               INFOPLIST_KEY_NSHumanReadableCopyright = "";
-                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
-                               MACOSX_DEPLOYMENT_TARGET = 12.3;
-                               MARKETING_VERSION = 1.0;
-                               MTL_ENABLE_DEBUG_INFO = NO;
-                               MTL_FAST_MATH = YES;
-                               PRODUCT_BUNDLE_IDENTIFIER = com.owncloud.desktopclient.FileProviderExt;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               PROVISIONING_PROFILE_SPECIFIER = "";
-                               SDKROOT = macosx;
-                               SKIP_INSTALL = YES;
-                               SWIFT_EMIT_LOC_STRINGS = YES;
-                               SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
-                               SWIFT_VERSION = 5.0;
-                       };
-                       name = Release;
-               };
-               C2B573991B1CD88000303B36 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
-                               CLANG_WARN_BOOL_CONVERSION = YES;
-                               CLANG_WARN_COMMA = YES;
-                               CLANG_WARN_CONSTANT_CONVERSION = YES;
-                               CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
-                               CLANG_WARN_EMPTY_BODY = YES;
-                               CLANG_WARN_ENUM_CONVERSION = YES;
-                               CLANG_WARN_INFINITE_RECURSION = YES;
-                               CLANG_WARN_INT_CONVERSION = YES;
-                               CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
-                               CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
-                               CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
-                               CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
-                               CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
-                               CLANG_WARN_STRICT_PROTOTYPES = YES;
-                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
-                               CLANG_WARN_UNREACHABLE_CODE = YES;
-                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-                               ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               ENABLE_TESTABILITY = YES;
-                               GCC_NO_COMMON_BLOCKS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                               GCC_WARN_UNDECLARED_SELECTOR = YES;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
-                               GCC_WARN_UNUSED_FUNCTION = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                       };
-                       name = Debug;
-               };
-               C2B5739A1B1CD88000303B36 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
-                               CLANG_WARN_BOOL_CONVERSION = YES;
-                               CLANG_WARN_COMMA = YES;
-                               CLANG_WARN_CONSTANT_CONVERSION = YES;
-                               CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
-                               CLANG_WARN_EMPTY_BODY = YES;
-                               CLANG_WARN_ENUM_CONVERSION = YES;
-                               CLANG_WARN_INFINITE_RECURSION = YES;
-                               CLANG_WARN_INT_CONVERSION = YES;
-                               CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
-                               CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
-                               CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
-                               CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
-                               CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
-                               CLANG_WARN_STRICT_PROTOTYPES = YES;
-                               CLANG_WARN_SUSPICIOUS_MOVE = YES;
-                               CLANG_WARN_UNREACHABLE_CODE = YES;
-                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-                               ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               GCC_NO_COMMON_BLOCKS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES;
-                               GCC_WARN_UNDECLARED_SELECTOR = YES;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES;
-                               GCC_WARN_UNUSED_FUNCTION = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                       };
-                       name = Release;
-               };
-               C2B573CD1B1CD91E00303B36 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
-                               ALWAYS_SEARCH_USER_PATHS = NO;
-                               ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
-                               CLANG_CXX_LIBRARY = "libc++";
-                               CLANG_ENABLE_MODULES = YES;
-                               CLANG_ENABLE_OBJC_ARC = YES;
-                               CLANG_WARN_BOOL_CONVERSION = YES;
-                               CLANG_WARN_CONSTANT_CONVERSION = YES;
-                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-                               CLANG_WARN_EMPTY_BODY = YES;
-                               CLANG_WARN_ENUM_CONVERSION = YES;
-                               CLANG_WARN_INT_CONVERSION = YES;
-                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-                               CLANG_WARN_UNREACHABLE_CODE = YES;
-                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-                               CODE_SIGN_IDENTITY = "-";
-                               CODE_SIGN_STYLE = Manual;
-                               COMBINE_HIDPI_IMAGES = YES;
-                               COPY_PHASE_STRIP = NO;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               GCC_C_LANGUAGE_STANDARD = gnu99;
-                               GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_NO_COMMON_BLOCKS = YES;
-                               GCC_OPTIMIZATION_LEVEL = 0;
-                               GCC_PREPROCESSOR_DEFINITIONS = (
-                                       "DEBUG=1",
-                                       "$(inherited)",
-                               );
-                               GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-                               GCC_WARN_UNDECLARED_SELECTOR = YES;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-                               GCC_WARN_UNUSED_FUNCTION = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               INFOPLIST_FILE = desktopclient/Info.plist;
-                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
-                               MACOSX_DEPLOYMENT_TARGET = 10.14;
-                               MTL_ENABLE_DEBUG_INFO = YES;
-                               ONLY_ACTIVE_ARCH = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               PROVISIONING_PROFILE = "";
-                               SDKROOT = macosx;
-                               SWIFT_OBJC_BRIDGING_HEADER = "desktopclient/desktopclient-Bridging-Header.h";
-                               SWIFT_OPTIMIZATION_LEVEL = "-Onone";
-                               SWIFT_VERSION = 5.0;
-                       };
-                       name = Debug;
-               };
-               C2B573CE1B1CD91E00303B36 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
-                               ALWAYS_SEARCH_USER_PATHS = NO;
-                               ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
-                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
-                               CLANG_CXX_LIBRARY = "libc++";
-                               CLANG_ENABLE_MODULES = YES;
-                               CLANG_ENABLE_OBJC_ARC = YES;
-                               CLANG_WARN_BOOL_CONVERSION = YES;
-                               CLANG_WARN_CONSTANT_CONVERSION = YES;
-                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-                               CLANG_WARN_EMPTY_BODY = YES;
-                               CLANG_WARN_ENUM_CONVERSION = YES;
-                               CLANG_WARN_INT_CONVERSION = YES;
-                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-                               CLANG_WARN_UNREACHABLE_CODE = YES;
-                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-                               CODE_SIGN_IDENTITY = "-";
-                               CODE_SIGN_STYLE = Manual;
-                               COMBINE_HIDPI_IMAGES = YES;
-                               COPY_PHASE_STRIP = NO;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               ENABLE_NS_ASSERTIONS = NO;
-                               ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               GCC_C_LANGUAGE_STANDARD = gnu99;
-                               GCC_NO_COMMON_BLOCKS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-                               GCC_WARN_UNDECLARED_SELECTOR = YES;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-                               GCC_WARN_UNUSED_FUNCTION = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               INFOPLIST_FILE = desktopclient/Info.plist;
-                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
-                               MACOSX_DEPLOYMENT_TARGET = 10.14;
-                               MTL_ENABLE_DEBUG_INFO = NO;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               PROVISIONING_PROFILE = "";
-                               SDKROOT = macosx;
-                               SWIFT_OBJC_BRIDGING_HEADER = "desktopclient/desktopclient-Bridging-Header.h";
-                               SWIFT_VERSION = 5.0;
-                       };
-                       name = Release;
-               };
-               C2B573E41B1CD9CE00303B36 /* Debug */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = NO;
-                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
-                               CLANG_CXX_LIBRARY = "libc++";
-                               CLANG_ENABLE_MODULES = YES;
-                               CLANG_ENABLE_OBJC_ARC = YES;
-                               CLANG_WARN_BOOL_CONVERSION = YES;
-                               CLANG_WARN_CONSTANT_CONVERSION = YES;
-                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-                               CLANG_WARN_EMPTY_BODY = YES;
-                               CLANG_WARN_ENUM_CONVERSION = YES;
-                               CLANG_WARN_INT_CONVERSION = YES;
-                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-                               CLANG_WARN_UNREACHABLE_CODE = YES;
-                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-                               CODE_SIGN_ENTITLEMENTS = FinderSyncExt/FinderSyncExt.entitlements;
-                               CODE_SIGN_IDENTITY = "-";
-                               CODE_SIGN_STYLE = Manual;
-                               COMBINE_HIDPI_IMAGES = YES;
-                               COPY_PHASE_STRIP = NO;
-                               DEBUG_INFORMATION_FORMAT = dwarf;
-                               ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               GCC_C_LANGUAGE_STANDARD = gnu99;
-                               GCC_DYNAMIC_NO_PIC = NO;
-                               GCC_NO_COMMON_BLOCKS = YES;
-                               GCC_OPTIMIZATION_LEVEL = 0;
-                               GCC_PREPROCESSOR_DEFINITIONS = (
-                                       "DEBUG=1",
-                                       "$(inherited)",
-                               );
-                               GCC_SYMBOLS_PRIVATE_EXTERN = NO;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-                               GCC_WARN_UNDECLARED_SELECTOR = YES;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-                               GCC_WARN_UNUSED_FUNCTION = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               INFOPLIST_FILE = FinderSyncExt/Info.plist;
-                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
-                               MACOSX_DEPLOYMENT_TARGET = 10.14;
-                               MTL_ENABLE_DEBUG_INFO = YES;
-                               OC_APPLICATION_NAME = ownCloud;
-                               OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
-                               OC_OEM_SHARE_ICNS = "";
-                               OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = "";
-                               ONLY_ACTIVE_ARCH = YES;
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               PROVISIONING_PROFILE = "";
-                               SDKROOT = macosx;
-                               SKIP_INSTALL = YES;
-                       };
-                       name = Debug;
-               };
-               C2B573E51B1CD9CE00303B36 /* Release */ = {
-                       isa = XCBuildConfiguration;
-                       buildSettings = {
-                               ALWAYS_SEARCH_USER_PATHS = NO;
-                               CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
-                               CLANG_CXX_LIBRARY = "libc++";
-                               CLANG_ENABLE_MODULES = YES;
-                               CLANG_ENABLE_OBJC_ARC = YES;
-                               CLANG_WARN_BOOL_CONVERSION = YES;
-                               CLANG_WARN_CONSTANT_CONVERSION = YES;
-                               CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
-                               CLANG_WARN_EMPTY_BODY = YES;
-                               CLANG_WARN_ENUM_CONVERSION = YES;
-                               CLANG_WARN_INT_CONVERSION = YES;
-                               CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
-                               CLANG_WARN_UNREACHABLE_CODE = YES;
-                               CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
-                               CODE_SIGN_ENTITLEMENTS = FinderSyncExt/FinderSyncExt.entitlements;
-                               CODE_SIGN_IDENTITY = "-";
-                               CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO;
-                               CODE_SIGN_STYLE = Manual;
-                               COMBINE_HIDPI_IMAGES = YES;
-                               COPY_PHASE_STRIP = NO;
-                               DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-                               ENABLE_NS_ASSERTIONS = NO;
-                               ENABLE_STRICT_OBJC_MSGSEND = YES;
-                               GCC_C_LANGUAGE_STANDARD = gnu99;
-                               GCC_NO_COMMON_BLOCKS = YES;
-                               GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
-                               GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
-                               GCC_WARN_UNDECLARED_SELECTOR = YES;
-                               GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
-                               GCC_WARN_UNUSED_FUNCTION = YES;
-                               GCC_WARN_UNUSED_VARIABLE = YES;
-                               INFOPLIST_FILE = FinderSyncExt/Info.plist;
-                               LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @executable_path/../../../../Frameworks";
-                               MACOSX_DEPLOYMENT_TARGET = 10.14;
-                               MTL_ENABLE_DEBUG_INFO = NO;
-                               OC_APPLICATION_NAME = ownCloud;
-                               OC_APPLICATION_REV_DOMAIN = com.owncloud.desktopclient;
-                               OC_OEM_SHARE_ICNS = "";
-                               OC_SOCKETAPI_TEAM_IDENTIFIER_PREFIX = "";
-                               PRODUCT_NAME = "$(TARGET_NAME)";
-                               PROVISIONING_PROFILE = "";
-                               SDKROOT = macosx;
-                               SKIP_INSTALL = YES;
-                       };
-                       name = Release;
-               };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
-               538E397927F4765000FA63D5 /* Build configuration list for PBXNativeTarget "FileProviderExt" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               538E397727F4765000FA63D5 /* Debug */,
-                               538E397827F4765000FA63D5 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               C2B573981B1CD88000303B36 /* Build configuration list for PBXProject "OwnCloudFinderSync" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               C2B573991B1CD88000303B36 /* Debug */,
-                               C2B5739A1B1CD88000303B36 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               C2B573CC1B1CD91E00303B36 /* Build configuration list for PBXNativeTarget "desktopclient" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               C2B573CD1B1CD91E00303B36 /* Debug */,
-                               C2B573CE1B1CD91E00303B36 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-               C2B573E31B1CD9CE00303B36 /* Build configuration list for PBXNativeTarget "FinderSyncExt" */ = {
-                       isa = XCConfigurationList;
-                       buildConfigurations = (
-                               C2B573E41B1CD9CE00303B36 /* Debug */,
-                               C2B573E51B1CD9CE00303B36 /* Release */,
-                       );
-                       defaultConfigurationIsVisible = 0;
-                       defaultConfigurationName = Release;
-               };
-/* End XCConfigurationList section */
-       };
-       rootObject = C2B573951B1CD88000303B36 /* Project object */;
-}
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.xcworkspace/contents.xcworkspacedata
deleted file mode 100644 (file)
index 919434a..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Workspace
-   version = "1.0">
-   <FileRef
-      location = "self:">
-   </FileRef>
-</Workspace>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
deleted file mode 100644 (file)
index 18d9810..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>IDEDidComputeMac32BitWarning</key>
-       <true/>
-</dict>
-</plist>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/xcshareddata/xcschemes/FinderSyncExt.xcscheme b/shell_integration/MacOSX/OwnCloudFinderSync/OwnCloudFinderSync.xcodeproj/xcshareddata/xcschemes/FinderSyncExt.xcscheme
deleted file mode 100644 (file)
index 63ec0b6..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "1240"
-   wasCreatedForAppExtension = "YES"
-   version = "2.0">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "C2B573D61B1CD9CE00303B36"
-               BuildableName = "FinderSyncExt.appex"
-               BlueprintName = "FinderSyncExt"
-               ReferencedContainer = "container:OwnCloudFinderSync.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "C2B573B01B1CD91E00303B36"
-               BuildableName = "desktopclient.app"
-               BlueprintName = "desktopclient"
-               ReferencedContainer = "container:OwnCloudFinderSync.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      shouldUseLaunchSchemeArgsEnv = "YES">
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "C2B573D61B1CD9CE00303B36"
-            BuildableName = "FinderSyncExt.appex"
-            BlueprintName = "FinderSyncExt"
-            ReferencedContainer = "container:OwnCloudFinderSync.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-      <Testables>
-      </Testables>
-   </TestAction>
-   <LaunchAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = ""
-      selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
-      launchStyle = "0"
-      askForAppToLaunch = "Yes"
-      useCustomWorkingDirectory = "NO"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      debugServiceExtension = "internal"
-      allowLocationSimulation = "YES"
-      launchAutomaticallySubstyle = "2">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "C2B573B01B1CD91E00303B36"
-            BuildableName = "desktopclient.app"
-            BlueprintName = "desktopclient"
-            ReferencedContainer = "container:OwnCloudFinderSync.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-   </LaunchAction>
-   <ProfileAction
-      buildConfiguration = "Release"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      debugDocumentVersioning = "YES"
-      askForAppToLaunch = "Yes"
-      launchAutomaticallySubstyle = "2">
-      <BuildableProductRunnable
-         runnableDebuggingMode = "0">
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "C2B573B01B1CD91E00303B36"
-            BuildableName = "desktopclient.app"
-            BlueprintName = "desktopclient"
-            ReferencedContainer = "container:OwnCloudFinderSync.xcodeproj">
-         </BuildableReference>
-      </BuildableProductRunnable>
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/desktopclient/Info.plist b/shell_integration/MacOSX/OwnCloudFinderSync/desktopclient/Info.plist
deleted file mode 100644 (file)
index bbaa296..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
-       <key>CFBundleDevelopmentRegion</key>
-       <string>en</string>
-       <key>CFBundleExecutable</key>
-       <string>$(EXECUTABLE_NAME)</string>
-       <key>CFBundleIconFile</key>
-       <string></string>
-       <key>CFBundleIdentifier</key>
-       <string>com.owncloud.$(PRODUCT_NAME:rfc1034identifier)</string>
-       <key>CFBundleInfoDictionaryVersion</key>
-       <string>6.0</string>
-       <key>CFBundleName</key>
-       <string>$(PRODUCT_NAME)</string>
-       <key>CFBundlePackageType</key>
-       <string>APPL</string>
-       <key>CFBundleShortVersionString</key>
-       <string>1.0</string>
-       <key>CFBundleSignature</key>
-       <string>????</string>
-       <key>CFBundleVersion</key>
-       <string>1</string>
-       <key>LSMinimumSystemVersion</key>
-       <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
-       <key>NSPrincipalClass</key>
-       <string>NSApplication</string>
-</dict>
-</plist>
diff --git a/shell_integration/MacOSX/OwnCloudFinderSync/desktopclient/main.m b/shell_integration/MacOSX/OwnCloudFinderSync/desktopclient/main.m
deleted file mode 100644 (file)
index 6f580d2..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-//  main.m
-//  desktopclient
-//
-//  Created by Jocelyn Turcotte on 01/06/15.
-//
-//
-
-// This is fake application bundle with the same bundle ID as the real desktop client.
-// Xcode needs a wrapping application to allow the extension to be debugged.
-
-#import <Cocoa/Cocoa.h>
-
-int main(int argc, const char * argv[]) {
-    return NSApplicationMain(argc, argv);
-}