Browse Source

new project

Marino Faggiana 6 years ago
parent
commit
0b8a88f87d

+ 0 - 0
PickerFileProvider/FileProviderData.swift → File Provider Extension/FileProviderData.swift


+ 0 - 0
PickerFileProvider/FileProviderEnumerator.swift → File Provider Extension/FileProviderEnumerator.swift


+ 0 - 0
PickerFileProvider/FileProviderExtension+Actions.swift → File Provider Extension/FileProviderExtension+Actions.swift


+ 0 - 0
PickerFileProvider/FileProviderExtension+Network.swift → File Provider Extension/FileProviderExtension+Network.swift


+ 0 - 0
PickerFileProvider/FileProviderExtension+Thumbnail.swift → File Provider Extension/FileProviderExtension+Thumbnail.swift


+ 0 - 0
PickerFileProvider/PickerFileProvider-Bridging-Header.h → File Provider Extension/FileProviderExtension-Bridging-Header.h


+ 0 - 0
PickerFileProvider/FileProviderExtension.swift → File Provider Extension/FileProviderExtension.swift


+ 0 - 0
PickerFileProvider/FileProviderItem.swift → File Provider Extension/FileProviderItem.swift


+ 102 - 0
File Provider ExtensionUI/Base.lproj/MainInterface.storyboard

@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13153" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="J6p-g8-CHO">
+    <device id="retina4_7" orientation="portrait">
+        <adaptation id="fullscreen"/>
+    </device>
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13133"/>
+        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Document Action View Controller-->
+        <scene sceneID="Q8I-MS-tKG">
+            <objects>
+                <viewController id="J6p-g8-CHO" customClass="DocumentActionViewController" customModuleProvider="target" sceneMemberID="viewController">
+                    <view key="view" contentMode="scaleToFill" id="Vdh-Gp-eV6">
+                        <rect key="frame" x="0.0" y="0.0" width="350" height="400"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="Type:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="g6k-sp-jtu">
+                                <rect key="frame" x="106" y="34" width="43" height="21"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gdj-d0-nZ2">
+                                <rect key="frame" x="157" y="34" width="177" height="21"/>
+                                <accessibility key="accessibilityConfiguration" identifier="FPUInternalActionContentLabelIdentifier"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="177" id="56f-VY-qXp"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" horizontalCompressionResistancePriority="749" text="Action name:" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lAh-Rn-dzR">
+                                <rect key="frame" x="49" y="80" width="100" height="21"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fwj-fa-AqO">
+                                <rect key="frame" x="157" y="80" width="177" height="21"/>
+                                <accessibility key="accessibilityConfiguration" identifier="FPUInternalActionTypeLabelIdentifier"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" relation="greaterThanOrEqual" constant="177" id="JPE-hi-Vng"/>
+                                </constraints>
+                                <fontDescription key="fontDescription" type="system" pointSize="17"/>
+                                <nil key="textColor"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="k6y-tY-87X">
+                                <rect key="frame" x="157" y="301" width="37" height="30"/>
+                                <accessibility key="accessibilityConfiguration" identifier="FPUInternalActionDoneButtonIdentifier"/>
+                                <state key="normal" title="Done"/>
+                                <connections>
+                                    <action selector="doneButtonTapped:" destination="J6p-g8-CHO" eventType="touchUpInside" id="1zB-YS-foT"/>
+                                </connections>
+                            </button>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="3gV-2h-5zD">
+                                <rect key="frame" x="151" y="350" width="48" height="30"/>
+                                <accessibility key="accessibilityConfiguration" identifier="FPUInternalActionCancelButtonIdentifier"/>
+                                <state key="normal" title="Cancel"/>
+                                <connections>
+                                    <action selector="cancelButtonTapped:" destination="J6p-g8-CHO" eventType="touchUpInside" id="rCq-0k-2gc"/>
+                                </connections>
+                            </button>
+                        </subviews>
+                        <color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                        <constraints>
+                            <constraint firstItem="g6k-sp-jtu" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="zTo-CZ-ppy" secondAttribute="leading" constant="20" symbolic="YES" id="6bZ-zO-taJ"/>
+                            <constraint firstItem="lAh-Rn-dzR" firstAttribute="top" secondItem="g6k-sp-jtu" secondAttribute="bottom" constant="25" id="8eA-2P-54S"/>
+                            <constraint firstItem="gdj-d0-nZ2" firstAttribute="leading" secondItem="g6k-sp-jtu" secondAttribute="trailing" constant="8" id="9hE-J3-3O5"/>
+                            <constraint firstItem="lAh-Rn-dzR" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="zTo-CZ-ppy" secondAttribute="leading" constant="20" symbolic="YES" id="Ded-HC-OcR"/>
+                            <constraint firstItem="zTo-CZ-ppy" firstAttribute="bottom" secondItem="3gV-2h-5zD" secondAttribute="bottom" constant="20" id="FPz-JC-wtu"/>
+                            <constraint firstItem="Fwj-fa-AqO" firstAttribute="leading" secondItem="lAh-Rn-dzR" secondAttribute="trailing" constant="8" id="LJH-hs-IBG"/>
+                            <constraint firstItem="g6k-sp-jtu" firstAttribute="top" secondItem="zTo-CZ-ppy" secondAttribute="top" constant="34" id="MQg-cl-zCF"/>
+                            <constraint firstItem="gdj-d0-nZ2" firstAttribute="trailing" secondItem="Vdh-Gp-eV6" secondAttribute="trailingMargin" id="YW6-xe-IRG"/>
+                            <constraint firstItem="gdj-d0-nZ2" firstAttribute="baseline" secondItem="g6k-sp-jtu" secondAttribute="baseline" id="eGj-Jh-4QB"/>
+                            <constraint firstItem="Fwj-fa-AqO" firstAttribute="width" secondItem="gdj-d0-nZ2" secondAttribute="width" id="gWx-d0-ASK"/>
+                            <constraint firstItem="k6y-tY-87X" firstAttribute="centerX" secondItem="zTo-CZ-ppy" secondAttribute="centerX" id="kOA-Yz-GXs"/>
+                            <constraint firstItem="Fwj-fa-AqO" firstAttribute="baseline" secondItem="lAh-Rn-dzR" secondAttribute="baseline" id="ms5-gI-BPI"/>
+                            <constraint firstItem="Fwj-fa-AqO" firstAttribute="trailing" secondItem="Vdh-Gp-eV6" secondAttribute="trailingMargin" id="o5I-zu-nnu"/>
+                            <constraint firstItem="3gV-2h-5zD" firstAttribute="centerX" secondItem="zTo-CZ-ppy" secondAttribute="centerX" id="pcx-0T-WJc"/>
+                            <constraint firstItem="3gV-2h-5zD" firstAttribute="top" secondItem="k6y-tY-87X" secondAttribute="bottom" constant="19" id="zYE-Sl-0Xi"/>
+                        </constraints>
+                        <viewLayoutGuide key="safeArea" id="zTo-CZ-ppy"/>
+                    </view>
+                    <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+                    <size key="freeformSize" width="350" height="400"/>
+                    <connections>
+                        <outlet property="actionTypeLabel" destination="Fwj-fa-AqO" id="cqr-bL-fOs"/>
+                        <outlet property="identifierLabel" destination="gdj-d0-nZ2" id="Gjq-Rr-4sd"/>
+                    </connections>
+                </viewController>
+                <placeholder placeholderIdentifier="IBFirstResponder" id="UoZ-ya-W3e" userLabel="First Responder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="-80" y="63.868065967016499"/>
+        </scene>
+    </scenes>
+</document>

+ 37 - 0
File Provider ExtensionUI/DocumentActionViewController.swift

@@ -0,0 +1,37 @@
+//
+//  DocumentActionViewController.swift
+//  File Provider ExtensionUI
+//
+//  Created by Marino Faggiana on 26/06/18.
+//  Copyright © 2018 TWS. All rights reserved.
+//
+
+import UIKit
+import FileProviderUI
+
+class DocumentActionViewController: FPUIActionExtensionViewController {
+    
+    @IBOutlet weak var identifierLabel: UILabel!
+    @IBOutlet weak var actionTypeLabel: UILabel!
+    
+    override func prepare(forAction actionIdentifier: String, itemIdentifiers: [NSFileProviderItemIdentifier]) {
+        identifierLabel?.text = actionIdentifier
+        actionTypeLabel?.text = "Custom action"
+    }
+    
+    override func prepare(forError error: Error) {
+        identifierLabel?.text = error.localizedDescription
+        actionTypeLabel?.text = "Authenticate"
+    }
+
+    @IBAction func doneButtonTapped(_ sender: Any) {
+        // Perform the action and call the completion block. If an unrecoverable error occurs you must still call the completion block with an error. Use the error code FPUIExtensionErrorCode.failed to signal the failure.
+        extensionContext.completeRequest()
+    }
+    
+    @IBAction func cancelButtonTapped(_ sender: Any) {
+        extensionContext.cancelRequest(withError: NSError(domain: FPUIErrorDomain, code: Int(FPUIExtensionErrorCode.userCancelled.rawValue), userInfo: nil))
+    }
+    
+}
+

+ 42 - 0
File Provider ExtensionUI/Info.plist

@@ -0,0 +1,42 @@
+<?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>$(DEVELOPMENT_LANGUAGE)</string>
+	<key>CFBundleDisplayName</key>
+	<string>File Provider ExtensionUI</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</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>2.22.1</string>
+	<key>CFBundleVersion</key>
+	<string>2</string>
+	<key>NSExtension</key>
+	<dict>
+		<key>NSExtensionFileProviderActions</key>
+		<array>
+			<dict>
+				<key>NSExtensionFileProviderActionActivationRule</key>
+				<string>TRUEPREDICATE</string>
+				<key>NSExtensionFileProviderActionIdentifier</key>
+				<string>com.mycompany.FileProviderUI.CustomAction</string>
+				<key>NSExtensionFileProviderActionName</key>
+				<string>Custom Action</string>
+			</dict>
+		</array>
+		<key>NSExtensionMainStoryboard</key>
+		<string>MainInterface</string>
+		<key>NSExtensionPointIdentifier</key>
+		<string>com.apple.fileprovider-actionsui</string>
+	</dict>
+</dict>
+</plist>

File diff suppressed because it is too large
+ 207 - 408
Nextcloud.xcodeproj/project.pbxproj


+ 0 - 783
Picker/DocumentPickerViewController.swift

@@ -1,783 +0,0 @@
-//
-//  DocumentPickerViewController.swift
-//  Picker
-//
-//  Created by Marino Faggiana on 27/12/16.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  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 3 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.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-
-import UIKit
-
-class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCNetworkingDelegate, OCNetworkingDelegate, BKPasscodeViewControllerDelegate {
-    
-    // MARK: - Properties
-    
-    lazy var fileCoordinator: NSFileCoordinator = {
-    
-        let fileCoordinator = NSFileCoordinator()
-        fileCoordinator.purposeIdentifier = self.parameterProviderIdentifier
-        return fileCoordinator
-        
-    }()
-    
-    var parameterMode: UIDocumentPickerMode?
-    var parameterOriginalURL: URL?
-    var parameterProviderIdentifier: String!
-    var parameterPasscodeCorrect: Bool = false
-    
-    var recordMetadata = tableMetadata()
-    var recordsTableMetadata: [tableMetadata]?
-    var titleFolder: String = ""
-    
-    var activeAccount: String = ""
-    var activeUrl: String = ""
-    var activeUser: String = ""
-    var activeUserID: String = ""
-    var activePassword: String = ""
-    var directoryUser: String = ""
-    
-    var serverUrl: String?
-    var thumbnailInLoading = [String: IndexPath]()
-    var destinationURL: URL?
-    
-    var passcodeFailedAttempts: UInt = 0
-    var passcodeLockUntilDate: Date? = nil
-    var passcodeIsPush: Bool = false
-    var serverUrlPush: String = ""
-    
-    var autoUploadFileName = ""
-    var autoUploadDirectory = ""
-    
-    lazy var networkingOperationQueue: OperationQueue = {
-        
-        var queue = OperationQueue()
-        queue.name = k_queue
-        queue.maxConcurrentOperationCount = 10
-        
-        return queue
-    }()
-    
-    var hud : CCHud!
-    
-    // MARK: - IBOutlets
-    
-    @IBOutlet weak var tableView: UITableView!
-    @IBOutlet weak var toolBar: UIToolbar!
-    @IBOutlet weak var saveButton: UIBarButtonItem!
-
-    // MARK: - View Life Cycle
-    
-    override func viewDidLoad() {
-        
-        super.viewDidLoad()
-        
-        if let record = NCManageDatabase.sharedInstance.getAccountActive() {
-            
-            activeAccount = record.account
-            activePassword = record.password
-            activeUrl = record.url
-            activeUser = record.user
-            activeUserID = record.userID
-            directoryUser = CCUtility.getDirectoryActiveUser(activeUser, activeUrl: activeUrl)
-            
-            if serverUrl == nil {
-                serverUrl = CCUtility.getHomeServerUrlActiveUrl(activeUrl)
-            } else {
-                self.navigationItem.title = titleFolder
-            }
-        
-        } else {
-            
-            // Close error no account return nil
-            
-            let deadlineTime = DispatchTime.now() + 0.1
-            DispatchQueue.main.asyncAfter(deadline: deadlineTime) {
-                
-                let alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: NSLocalizedString("_no_active_account_", comment: ""), preferredStyle: .alert)
-                alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { action in
-                    self.dismissGrantingAccess(to: nil)
-                })
-                
-                self.present(alert, animated: true, completion: nil)
-            }
-
-            return
-        }
-        
-        //  MARK: - init Object
-        CCNetworking.shared().delegate = self
-        hud = CCHud.init(view: self.navigationController?.view)
-        
-        // Theming
-        if (NCBrandOptions.sharedInstance.use_themingColor == true) {
-            let tableCapabilities = NCManageDatabase.sharedInstance.getCapabilites()
-            if (tableCapabilities != nil) {
-                CCGraphics.settingThemingColor(tableCapabilities?.themingColor, themingColorElement: tableCapabilities?.themingColorElement, themingColorText: tableCapabilities?.themingColorText)
-            }
-        }
-        
-        // COLOR
-        self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
-        self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.brandText
-        self.navigationController?.navigationBar.titleTextAttributes = [NSAttributedStringKey.foregroundColor: NCBrandColor.sharedInstance.brandText]
-        self.navigationController?.navigationBar.isTranslucent = false
-        
-        self.tableView.separatorColor = NCBrandColor.sharedInstance.seperator
-        self.tableView.tableFooterView = UIView()
-        
-        NotificationCenter.default.addObserver(self, selector: #selector(triggerProgressTask(_:)), name: NSNotification.Name(rawValue: "NotificationProgressTask"), object: nil)
-        
-        readFolder()
-    }
-    
-    override func viewWillAppear(_ animated: Bool) {
-        
-        super.viewWillAppear(animated)
-    
-        // BUGFIX 2.17 - Change user Nextcloud App
-        CCNetworking.shared().settingAccount()
-        
-        // (save) mode of presentation -> pass variable for pushViewController
-        prepareForPresentation(in: parameterMode!)
-    
-        // String is nil or empty
-        guard let passcode = CCUtility.getBlockCode(), !passcode.isEmpty else {
-            return
-        }
-        
-        if CCUtility.getOnlyLockDir() == false && parameterPasscodeCorrect == false {
-            openBKPasscode(NCBrandOptions.sharedInstance.brand)
-        }
-    }
-    
-    override func viewWillDisappear(_ animated: Bool) {
-        
-        // remove all networking operation
-        networkingOperationQueue.cancelAllOperations()
-        
-        super.viewWillDisappear(animated)
-    }
-    
-    // MARK: - Overridden Instance Methods
-    
-    override func prepareForPresentation(in mode: UIDocumentPickerMode) {
-        
-        // ------------------> Settings parameter ----------------
-        if parameterMode == nil {
-            parameterMode = mode
-        }
-        
-        // Variable for exportToService or moveToService
-        if parameterOriginalURL == nil && originalURL != nil {
-            parameterOriginalURL = originalURL
-        }
-        
-        if parameterProviderIdentifier == nil {
-            parameterProviderIdentifier = providerIdentifier
-        }
-        // -------------------------------------------------------
-        
-        switch mode {
-            
-        case .exportToService:
-            
-            print("Document Picker Mode : exportToService")
-            saveButton.title = NSLocalizedString("_save_document_picker_", comment: "") // Save in this position
-            
-        case .moveToService:
-            
-            //Show confirmation button
-            print("Document Picker Mode : moveToService")
-            saveButton.title = NSLocalizedString("_save_document_picker_", comment: "") // Save in this position
-            
-        case .open:
-            
-            print("Document Picker Mode : open")
-            saveButton.tintColor = UIColor.clear
-            
-        case .import:
-            
-            print("Document Picker Mode : import")
-            saveButton.tintColor = UIColor.clear
-        }
-    }
-
-    //  MARK: - Read folder
-    
-    func readFolder() {
-        
-        let metadataNet = CCMetadataNet.init(account: activeAccount)!
-
-        metadataNet.action = actionReadFolder
-        metadataNet.depth = "1"
-        metadataNet.serverUrl = self.serverUrl
-        metadataNet.selector = selectorReadFolder
-        
-        let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withUserID: activeUserID, withPassword: activePassword, withUrl: activeUrl)
-        networkingOperationQueue.addOperation(ocNetworking)
-        
-        hud.visibleIndeterminateHud()
-    }
-    
-    func readFolderSuccessFailure(_ metadataNet: CCMetadataNet!, metadataFolder: tableMetadata?, metadatas: [Any]!, message: String!, errorCode: Int) {
-        
-        if (errorCode == 0) {
-        
-            // remove all record
-            var predicate = NSPredicate(format: "directoryID == %@ AND session == ''", metadataNet.directoryID!)
-            NCManageDatabase.sharedInstance.deleteMetadata(predicate: predicate, clearDateReadDirectoryID: metadataNet.directoryID!)
-            
-            for metadata in metadatas as! [tableMetadata] {
-                
-                // Only Directory ?
-                if (parameterMode == .moveToService || parameterMode == .exportToService) && metadata.directory == false {
-                    continue
-                }
-                
-                // Add record
-                _ = NCManageDatabase.sharedInstance.addMetadata(metadata)
-            }
-            
-            predicate = NSPredicate(format: "directoryID == %@", metadataNet.directoryID!)
-            recordsTableMetadata = NCManageDatabase.sharedInstance.getMetadatas(predicate: predicate, sorted: "fileName", ascending: true)
-            
-            autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
-            autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(activeUrl)
-            
-            if (CCUtility.isEnd(toEndEnabled: activeAccount)) {
-            }
-            
-            tableView.reloadData()
-            
-            hud.hideHud()
-            
-        } else {
-            
-            hud.hideHud()
-            
-            let alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: message, preferredStyle: .alert)
-            alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { action in
-                self.dismissGrantingAccess(to: nil)
-            })
-            
-            self.present(alert, animated: true, completion: nil)
-        }
-    }
-    
-    //  MARK: - Download Thumbnail
-    
-    func downloadThumbnailSuccessFailure(_ metadataNet: CCMetadataNet!, message: String!, errorCode: Int) {
-        
-        if (errorCode == 0) {
-        
-            if let indexPath = thumbnailInLoading[metadataNet.fileID] {
-                
-                let path = "\(directoryUser)/\(metadataNet.fileID!).ico"
-                
-                if FileManager.default.fileExists(atPath: path) {
-                    
-                    if let cell = tableView.cellForRow(at: indexPath) as? recordMetadataCell {
-                        cell.fileImageView.image = UIImage(contentsOfFile: path)
-                    }
-                }
-            }
-        } else {
-            
-            NSLog("[LOG] Thumbnail Error \(metadataNet.fileName) \(message) (error \(errorCode))");
-        }
-    }
-    
-    func downloadThumbnail(_ metadata : tableMetadata) {
-        
-        let metadataNet = CCMetadataNet.init(account: activeAccount)!
-        
-        metadataNet.action = actionDownloadThumbnail
-        metadataNet.fileID = metadata.fileID
-        metadataNet.fileName = CCUtility.returnFileNamePath(fromFileName: metadata.fileName, serverUrl: self.serverUrl, activeUrl: activeUrl)
-        metadataNet.fileNameView = metadata.fileNameView
-        metadataNet.optionAny = "m";
-        metadataNet.selector = selectorDownloadThumbnail;
-        metadataNet.serverUrl = self.serverUrl
-        
-        let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withUserID: activeUserID, withPassword: activePassword, withUrl: activeUrl)
-        networkingOperationQueue.addOperation(ocNetworking)
-    }
-
-    //  MARK: - Download / Upload
-    
-    @objc func triggerProgressTask(_ notification: NSNotification) {
-        
-        let dict = notification.userInfo
-        let progress = dict?["progress"] as! Float
-        
-        hud.progress(progress)
-    }
-    
-    //  MARK: - Download
-
-    func downloadStart(_ fileID: String!, account: String!, task: URLSessionDownloadTask!, serverUrl: String!) {
-        print("Start downloading...")
-    }
-    
-    func downloadFileSuccessFailure(_ fileName: String!, fileID: String!, serverUrl: String!, selector: String!, selectorPost: String!, errorMessage: String!, errorCode: Int) {
-        
-        hud.hideHud()
-        
-        if (errorCode == 0) {
-            
-            guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileID == %@", fileID!)) else {
-                self.dismissGrantingAccess(to: nil)
-                return
-            }
-            
-            recordMetadata = metadata
-            
-            // Save for PickerFileProvide
-            CCUtility.setFileNameExt(metadata.fileName)
-            CCUtility.setServerUrlExt(serverUrl)
-            
-            switch selector {
-                
-            case selectorLoadFileView :
-                
-                let sourceFileNamePath = "\(directoryUser)/\(fileID!)"
-                let destinationFileNameUrl : URL! = appGroupContainerURL()?.appendingPathComponent(recordMetadata.fileName)
-                let destinationFileNamePath = destinationFileNameUrl.path
-                
-                // Destination Provider
-                
-                do {
-                    try FileManager.default.removeItem(at: destinationFileNameUrl)
-                } catch _ {
-                    print("file do not exists")
-                }
-                
-                do {
-                    try FileManager.default.copyItem(atPath: sourceFileNamePath, toPath: destinationFileNamePath)
-                } catch let error as NSError {
-                    print(error)
-                }
-                
-                // Dismiss
-                
-                self.dismissGrantingAccess(to: destinationFileNameUrl)
-                
-            default :
-                
-                print("selector : \(selector!)")
-                tableView.reloadData()
-            }
-            
-        } else {
-            
-            if selector == selectorLoadFileView && errorCode != -999 {
-                
-                let alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: errorMessage, preferredStyle: .alert)
-                alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { action in
-                    NSLog("[LOG] Download Error \(fileID) \(errorMessage) (error \(errorCode))");
-                })
-                
-                self.present(alert, animated: true, completion: nil)
-            }
-        }
-    }
- 
-    //  MARK: - Upload 
-    
-    func uploadFileSuccessFailure(_ fileName: String!, fileID: String!, assetLocalIdentifier: String!, serverUrl: String!, selector: String!, selectorPost: String!, errorMessage: String!, errorCode: Int) {
-        
-        hud.hideHud()
-        
-        if (errorCode == 0) {
-            
-            dismissGrantingAccess(to: self.destinationURL)
-            
-        } else {
-           
-            // remove file
-            let predicate = NSPredicate(format: "fileID == %@", fileID)
-            NCManageDatabase.sharedInstance.deleteMetadata(predicate: predicate, clearDateReadDirectoryID: nil)
-            
-            if errorCode != -999 {
-                
-                let alert = UIAlertController(title: NSLocalizedString("_error_", comment: ""), message: errorMessage, preferredStyle: .alert)
-                alert.addAction(UIAlertAction(title: NSLocalizedString("_ok_", comment: ""), style: .default) { action in
-                    //self.dismissGrantingAccess(to: nil)
-                    NSLog("[LOG] Download Error \(fileID) \(errorMessage) (error \(errorCode))");
-                })
-                
-                self.present(alert, animated: true, completion: nil)
-            }
-        }
-    }
-}
-
-// MARK: - IBActions
-
-extension DocumentPickerViewController {
-    
-    @IBAction func saveButtonTapped(_ sender: AnyObject) {
-        
-        guard let sourceURL = parameterOriginalURL else {
-            return
-        }
-        
-        switch parameterMode! {
-            
-        case .moveToService, .exportToService:
-            
-            let fileName = sourceURL.lastPathComponent
-            let destinationFileNamePath = "\(directoryUser)/\(fileName)"
-            
-            destinationURL = appGroupContainerURL()?.appendingPathComponent(fileName)
-            
-            fileCoordinator.coordinate(readingItemAt: sourceURL, options: .withoutChanges, error: nil, byAccessor: { [weak self] newURL in
-                
-                // copy sourceURL on directoryUser
-                do {
-                    try FileManager.default.removeItem(atPath: destinationFileNamePath)
-                } catch _ {
-                    print("file do not exists")
-                }
-                
-                do {
-                    try FileManager.default.copyItem(atPath: sourceURL.path, toPath: destinationFileNamePath)
-                } catch _ {
-                    print("file do not exists")
-                    self?.dismissGrantingAccess(to: self?.destinationURL)
-                    return
-                }
-                
-                do {
-                    try FileManager.default.removeItem(at: (self?.destinationURL)!)
-                } catch _ {
-                    print("file do not exists")
-                }
-                
-                do {
-                    try FileManager.default.copyItem(at: sourceURL, to: (self?.destinationURL)!)
-                    
-                    let fileSize = (try! FileManager.default.attributesOfItem(atPath: sourceURL.path)[FileAttributeKey.size] as! NSNumber).uint64Value
-                    
-                    if fileSize == 0 {
-                        
-                        CCUtility.setFileNameExt(fileName)
-                        CCUtility.setServerUrlExt(self!.serverUrl)
-                        self?.dismissGrantingAccess(to: self?.destinationURL)
-                        
-                    } else {
-                    
-                        // Upload fileName to Cloud
-                    
-//                        CCNetworking.shared().uploadFile(fileName, serverUrl: self!.serverUrl, assetLocalIdentifier: nil, path:directoryUser,session: k_upload_session_foreground, taskStatus: Int(k_taskStatusResume), selector: "", selectorPost: "", errorCode: 0, delegate: self)
-                        
-                        self!.hud.visibleHudTitle(NSLocalizedString("_uploading_", comment: ""), mode: MBProgressHUDMode.determinate, color: NCBrandColor.sharedInstance.brandElement)
-                    }
-                } catch _ {
-                    self?.dismissGrantingAccess(to: self?.destinationURL)
-                    print("error copying file")
-                }
-            })
-        
-        default:
-            dismissGrantingAccess(to: self.destinationURL)
-        }
-    }
-    
-    func appGroupContainerURL() -> URL? {
-        
-        guard let groupURL = FileManager.default
-            .containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.sharedInstance.capabilitiesGroups) else {
-                return nil
-        }
-        
-        let storagePathUrl = groupURL.appendingPathComponent("File Provider Storage")
-        let storagePath = storagePathUrl.path
-        
-        if !FileManager.default.fileExists(atPath: storagePath) {
-            do {
-                try FileManager.default.createDirectory(atPath: storagePath, withIntermediateDirectories: false, attributes: nil)
-            } catch let error {
-                print("error creating filepath: \(error)")
-                return nil
-            }
-        }
-        
-        return storagePathUrl
-    }
-    
-    // MARK: - Passcode
-    
-    func openBKPasscode(_ title : String?) {
-        
-        let viewController = CCBKPasscode.init()
-        
-        viewController.delegate = self
-        viewController.type = BKPasscodeViewControllerCheckPasscodeType
-        viewController.inputViewTitlePassword = true
-        
-        if CCUtility.getSimplyBlockCode() {
-            
-            viewController.passcodeStyle = BKPasscodeInputViewNumericPasscodeStyle
-            viewController.passcodeInputView.maximumLength = 6
-            
-        } else {
-            
-            viewController.passcodeStyle = BKPasscodeInputViewNormalPasscodeStyle
-            viewController.passcodeInputView.maximumLength = 64
-        }
-        
-        let touchIDManager = BKTouchIDManager.init(keychainServiceName: k_serviceShareKeyChain)
-        touchIDManager?.promptText = NSLocalizedString("_scan_fingerprint_", comment: "")
-        viewController.touchIDManager = touchIDManager
-        viewController.title = title
-        viewController.navigationItem.leftBarButtonItem = UIBarButtonItem.init(barButtonSystemItem: UIBarButtonSystemItem.cancel, target: self, action: #selector(passcodeViewCloseButtonPressed(sender:)))
-        viewController.navigationItem.leftBarButtonItem?.tintColor = UIColor.black
-        
-        let navController = UINavigationController.init(rootViewController: viewController)
-        self.present(navController, animated: true, completion: nil)
-    }
-
-    func passcodeViewControllerNumber(ofFailedAttempts aViewController: BKPasscodeViewController!) -> UInt {
-        
-        return passcodeFailedAttempts
-    }
-    
-    func passcodeViewControllerLock(untilDate aViewController: BKPasscodeViewController!) -> Date! {
-        
-        return passcodeLockUntilDate
-    }
-    
-    func passcodeViewControllerDidFailAttempt(_ aViewController: BKPasscodeViewController!) {
-        
-        passcodeFailedAttempts += 1
-        
-        if passcodeFailedAttempts > 5 {
-            
-            var timeInterval: TimeInterval = 60
-            
-            if passcodeFailedAttempts > 6 {
-                
-                let multiplier = passcodeFailedAttempts - 6
-                
-                timeInterval = TimeInterval(5 * 60 * multiplier)
-                
-                if timeInterval > 3600 * 24 {
-                    timeInterval = 3600 * 24
-                }
-            }
-            
-            passcodeLockUntilDate = Date.init(timeIntervalSinceNow: timeInterval)
-        }
-    }
-    
-    func passcodeViewController(_ aViewController: BKPasscodeViewController!, authenticatePasscode aPasscode: String!, resultHandler aResultHandler: ((Bool) -> Void)!) {
-        
-        if aPasscode == CCUtility.getBlockCode() {
-            passcodeLockUntilDate = nil
-            passcodeFailedAttempts = 0
-            aResultHandler(true)
-        } else {
-            aResultHandler(false)
-        }
-    }
-    
-    public func passcodeViewController(_ aViewController: BKPasscodeViewController!, didFinishWithPasscode aPasscode: String!) {
-        
-        parameterPasscodeCorrect = true
-        aViewController.dismiss(animated: true, completion: nil)
-        
-        if self.passcodeIsPush == true {
-            performSegue()
-        }
-    }
-    
-    @objc func passcodeViewCloseButtonPressed(sender :Any) {
-        
-        dismiss(animated: true, completion: {
-            if self.passcodeIsPush == false {
-                self.dismissGrantingAccess(to: nil)
-            }
-        })
-    }
-}
-
-// MARK: - UITableViewDelegate
-
-extension DocumentPickerViewController: UITableViewDelegate {
-
-    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
-        
-         return 50
-    }
-}
-
-// MARK: - UITableViewDataSource
-
-extension DocumentPickerViewController: UITableViewDataSource {
-    
-    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-       return recordsTableMetadata?.count ?? 0
-    }
-        
-    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
-        
-        let cell = tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as! recordMetadataCell
-        
-        cell.separatorInset = UIEdgeInsetsMake(0, 60, 0, 0)
-        
-        guard let metadata = recordsTableMetadata?[(indexPath as NSIndexPath).row] else {
-            return cell
-        }
-        
-        // File Image View
-        let fileNamePath = "\(directoryUser)/\(metadata.fileID)).ico"
-        
-        if FileManager.default.fileExists(atPath: fileNamePath) {
-            
-            cell.fileImageView.image = UIImage(contentsOfFile: fileNamePath)
-            
-        } else {
-            
-            if metadata.directory {
-                
-                if (metadata.e2eEncrypted) {
-                    cell.fileImageView.image = CCGraphics.changeThemingColorImage(UIImage(named: "folderEncrypted"), color: NCBrandColor.sharedInstance.brandElement)
-                } else if (metadata.fileName == autoUploadFileName && serverUrl == autoUploadDirectory) {
-                    cell.fileImageView.image = CCGraphics.changeThemingColorImage(UIImage(named: "folderPhotos"), color: NCBrandColor.sharedInstance.brandElement)
-                } else {
-                    cell.fileImageView.image = CCGraphics.changeThemingColorImage(UIImage(named: "folder"), color: NCBrandColor.sharedInstance.brandElement)
-                }
-                
-            } else {
-                
-                cell.fileImageView.image = UIImage(named: (metadata.iconName))
-                if (metadata.thumbnailExists) {
-                    
-                    downloadThumbnail(metadata)
-                    thumbnailInLoading[metadata.fileID] = indexPath
-                }
-            }
-        }
-        
-        // File Name
-        cell.fileName.text = metadata.fileNameView
-        
-        // Status Image View
-        let lockServerUrl = CCUtility.stringAppendServerUrl(self.serverUrl!, addFileName: metadata.fileName)
-                
-        let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate:NSPredicate(format: "account == %@ AND serverUrl == %@", activeAccount, lockServerUrl!))
-        if tableDirectory != nil {
-            if metadata.directory &&  (tableDirectory?.lock)! && (CCUtility.getBlockCode() != nil) {
-                cell.StatusImageView.image = UIImage(named: "passcode")
-            } else {
-                cell.StatusImageView.image = nil
-            }
-        }
-        
-        return cell
-    }
-    
-    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
-        
-        let metadata = recordsTableMetadata?[(indexPath as NSIndexPath).row]
-
-        tableView.deselectRow(at: indexPath, animated: true)
-        
-        recordMetadata = metadata!
-
-        if metadata!.directory == false {
-            
-            // Delete old record metadata and file
-            do {
-                try FileManager.default.removeItem(atPath: "\(directoryUser)/\(metadata!.fileID)")
-            } catch _ {
-            }
-            do {
-                try FileManager.default.removeItem(atPath: "\(directoryUser)/\(metadata!.fileID).ico")
-            } catch {
-            }
-            
-            metadata!.session = k_download_session_foreground
-            metadata!.sessionError = ""
-            metadata!.sessionSelector = selectorLoadFileView
-            metadata!.sessionSelectorPost = ""
-            metadata!.status = Int(k_metadataStatusWaitDownload)
-            
-            let metadataForDownload = NCManageDatabase.sharedInstance.addMetadata(metadata!)
-            CCNetworking.shared().downloadFile(metadataForDownload!, taskStatus: Int(k_taskStatusResume), delegate: self)
-            
-            hud.visibleHudTitle(NSLocalizedString("_loading_", comment: ""), mode: MBProgressHUDMode.determinate, color: NCBrandColor.sharedInstance.brandElement)
-            
-        } else {
-            
-            // E2EE DENIED
-            if (metadata?.e2eEncrypted == true) {
-                return
-            }
-        
-            serverUrlPush = CCUtility.stringAppendServerUrl(self.serverUrl!, addFileName: recordMetadata.fileName)
-
-            var passcode: String? = CCUtility.getBlockCode()
-            if passcode == nil {
-                passcode = ""
-            }
-        
-            let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate:NSPredicate(format: "account == %@ AND serverUrl == %@", activeAccount, serverUrlPush))
-            
-            if tableDirectory != nil {
-                
-                if (tableDirectory?.lock)! && (passcode?.count)! > 0 {
-                    
-                    self.passcodeIsPush = true
-                    openBKPasscode(recordMetadata.fileName)
-                    
-                } else {
-                    performSegue()
-                }
-                
-            } else {
-                performSegue()
-            }
-        }
-    }
-    
-    func performSegue() {
-        
-        let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "DocumentPickerViewController") as! DocumentPickerViewController
-        
-        nextViewController.parameterMode = parameterMode
-        nextViewController.parameterOriginalURL = parameterOriginalURL
-        nextViewController.parameterProviderIdentifier = parameterProviderIdentifier
-        nextViewController.parameterPasscodeCorrect = parameterPasscodeCorrect
-        nextViewController.serverUrl = serverUrlPush
-        nextViewController.titleFolder = recordMetadata.fileName
-        
-        self.navigationController?.pushViewController(nextViewController, animated: true)
-    }
-}
-
-// MARK: - Class UITableViewCell
-
-class recordMetadataCell: UITableViewCell {
-    
-    @IBOutlet weak var fileImageView: UIImageView!
-    @IBOutlet weak var StatusImageView: UIImageView!
-    @IBOutlet weak var fileName : UILabel!
-}

+ 0 - 119
Picker/MainInterface.storyboard

@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13526" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BDH-ub-KDG">
-    <device id="retina5_9" orientation="portrait">
-        <adaptation id="fullscreen"/>
-    </device>
-    <dependencies>
-        <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13524"/>
-        <capability name="Constraints to layout margins" minToolsVersion="6.0"/>
-        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
-        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
-    </dependencies>
-    <scenes>
-        <!--Document Picker View Controller-->
-        <scene sceneID="vBv-Rm-TFX">
-            <objects>
-                <viewController storyboardIdentifier="DocumentPickerViewController" id="BDH-ub-KDG" customClass="DocumentPickerViewController" customModule="Picker" customModuleProvider="target" sceneMemberID="viewController">
-                    <view key="view" contentMode="scaleToFill" id="ihd-J8-0uB">
-                        <rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <subviews>
-                            <toolbar opaque="NO" clearsContextBeforeDrawing="NO" contentMode="scaleToFill" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jNp-DD-DhT">
-                                <rect key="frame" x="0.0" y="748" width="375" height="30"/>
-                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                                <constraints>
-                                    <constraint firstAttribute="height" constant="30" id="7GX-XX-FId"/>
-                                </constraints>
-                                <items>
-                                    <barButtonItem style="plain" systemItem="flexibleSpace" id="aeq-0v-NNK"/>
-                                    <barButtonItem title="Save" id="oWL-3H-wjh" userLabel="Save">
-                                        <connections>
-                                            <action selector="saveButtonTapped:" destination="BDH-ub-KDG" id="gqF-A1-Anv"/>
-                                        </connections>
-                                    </barButtonItem>
-                                    <barButtonItem style="plain" systemItem="flexibleSpace" id="yIg-ai-AuG"/>
-                                </items>
-                            </toolbar>
-                            <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="qqj-0u-tfh">
-                                <rect key="frame" x="0.0" y="44" width="375" height="704"/>
-                                <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                                <prototypes>
-                                    <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="Cell" rowHeight="50" id="4mX-7e-Dp3" customClass="recordMetadataCell" customModule="Picker" customModuleProvider="target">
-                                        <rect key="frame" x="0.0" y="28" width="375" height="50"/>
-                                        <autoresizingMask key="autoresizingMask"/>
-                                        <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="4mX-7e-Dp3" id="c04-HP-f3b">
-                                            <rect key="frame" x="0.0" y="0.0" width="375" height="49.666666666666664"/>
-                                            <autoresizingMask key="autoresizingMask"/>
-                                            <subviews>
-                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="zdr-0G-voc" userLabel="File Image View">
-                                                    <rect key="frame" x="5" y="5" width="40" height="40"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="40" id="4Nr-GM-XJd"/>
-                                                        <constraint firstAttribute="width" constant="40" id="5VH-3p-WJJ"/>
-                                                    </constraints>
-                                                </imageView>
-                                                <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yXT-yo-gf2" userLabel="File Name">
-                                                    <rect key="frame" x="55" y="17" width="295" height="16"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="16" id="px4-9i-JdO"/>
-                                                    </constraints>
-                                                    <fontDescription key="fontDescription" type="system" pointSize="13"/>
-                                                    <nil key="textColor"/>
-                                                    <nil key="highlightedColor"/>
-                                                </label>
-                                                <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="VZU-PZ-Q0q" userLabel="Status Image View">
-                                                    <rect key="frame" x="36" y="34" width="15" height="15"/>
-                                                    <constraints>
-                                                        <constraint firstAttribute="height" constant="15" id="B6R-NL-wRx"/>
-                                                        <constraint firstAttribute="width" constant="15" id="yYj-nD-yYs"/>
-                                                    </constraints>
-                                                </imageView>
-                                            </subviews>
-                                            <constraints>
-                                                <constraint firstItem="VZU-PZ-Q0q" firstAttribute="top" secondItem="zdr-0G-voc" secondAttribute="bottom" constant="-11" id="37d-wi-HIE"/>
-                                                <constraint firstAttribute="trailingMargin" secondItem="yXT-yo-gf2" secondAttribute="trailing" constant="10" id="3LW-xM-cMl"/>
-                                                <constraint firstItem="yXT-yo-gf2" firstAttribute="centerY" secondItem="c04-HP-f3b" secondAttribute="centerY" id="KBw-cf-aJF"/>
-                                                <constraint firstItem="VZU-PZ-Q0q" firstAttribute="leading" secondItem="zdr-0G-voc" secondAttribute="trailing" constant="-9" id="U2J-eX-hdx"/>
-                                                <constraint firstItem="yXT-yo-gf2" firstAttribute="leading" secondItem="zdr-0G-voc" secondAttribute="trailing" constant="10" id="ZdW-Rc-SZO"/>
-                                                <constraint firstItem="zdr-0G-voc" firstAttribute="leading" secondItem="c04-HP-f3b" secondAttribute="leading" constant="5" id="aRt-eJ-PJF"/>
-                                                <constraint firstItem="zdr-0G-voc" firstAttribute="centerY" secondItem="c04-HP-f3b" secondAttribute="centerY" id="xX5-ci-kmh"/>
-                                            </constraints>
-                                        </tableViewCellContentView>
-                                        <connections>
-                                            <outlet property="StatusImageView" destination="VZU-PZ-Q0q" id="vfB-5x-J6O"/>
-                                            <outlet property="fileImageView" destination="zdr-0G-voc" id="fhB-Ki-sX2"/>
-                                            <outlet property="fileName" destination="yXT-yo-gf2" id="Njl-YO-5md"/>
-                                        </connections>
-                                    </tableViewCell>
-                                </prototypes>
-                                <connections>
-                                    <outlet property="dataSource" destination="BDH-ub-KDG" id="XcW-oK-tO0"/>
-                                    <outlet property="delegate" destination="BDH-ub-KDG" id="Atv-91-L4D"/>
-                                </connections>
-                            </tableView>
-                        </subviews>
-                        <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
-                        <constraints>
-                            <constraint firstItem="qqj-0u-tfh" firstAttribute="top" secondItem="wRT-YH-TC2" secondAttribute="top" id="3X8-Kp-jqI"/>
-                            <constraint firstItem="jNp-DD-DhT" firstAttribute="leading" secondItem="wRT-YH-TC2" secondAttribute="leading" id="I9F-p0-ygx"/>
-                            <constraint firstItem="wRT-YH-TC2" firstAttribute="bottom" secondItem="jNp-DD-DhT" secondAttribute="bottom" id="LXd-vy-wKs"/>
-                            <constraint firstItem="jNp-DD-DhT" firstAttribute="top" secondItem="qqj-0u-tfh" secondAttribute="bottom" id="W8D-y0-1fx"/>
-                            <constraint firstItem="jNp-DD-DhT" firstAttribute="trailing" secondItem="wRT-YH-TC2" secondAttribute="trailing" id="dZd-U9-4ac"/>
-                            <constraint firstItem="qqj-0u-tfh" firstAttribute="leading" secondItem="wRT-YH-TC2" secondAttribute="leading" id="jSY-0N-6ov"/>
-                            <constraint firstItem="wRT-YH-TC2" firstAttribute="trailing" secondItem="qqj-0u-tfh" secondAttribute="trailing" id="sGU-GU-cqa"/>
-                        </constraints>
-                        <viewLayoutGuide key="safeArea" id="wRT-YH-TC2"/>
-                    </view>
-                    <connections>
-                        <outlet property="saveButton" destination="oWL-3H-wjh" id="evc-KR-1kW"/>
-                        <outlet property="tableView" destination="qqj-0u-tfh" id="p7C-8F-Ljk"/>
-                        <outlet property="toolBar" destination="jNp-DD-DhT" id="ywY-w9-CcR"/>
-                    </connections>
-                </viewController>
-                <placeholder placeholderIdentifier="IBFirstResponder" id="Rdc-gB-tAX" userLabel="First Responder" sceneMemberID="firstResponder"/>
-            </objects>
-            <point key="canvasLocation" x="-442.39999999999998" y="173.64532019704436"/>
-        </scene>
-    </scenes>
-</document>

+ 0 - 37
Picker/Picker-Bridging-Header.h

@@ -1,37 +0,0 @@
-//
-//  Picker-Bridging-Header.h
-//  Nextcloud
-//
-//  Created by Marino Faggiana on 24/05/17.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  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 3 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.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-#import "CCNetworking.h"
-#import "OCNetworking.h"
-#import "CCGlobal.h"
-#import "CCHud.h"
-#import "CCUtility.h"
-#import "BKPasscodeViewController.h"
-#import "CCBKPasscode.h"
-#import "NCEndToEndEncryption.h"
-
-#import "OCActivity.h"
-#import "OCUserProfile.h"
-#import "OCCapabilities.h"
-#import "OCExternalSites.h"
-#import "OCSharedDto.h"

+ 0 - 0
iOSClient/Brand/PickerFileProvider.entitlements → iOSClient/Brand/File_Provider_Extension.entitlements


+ 35 - 0
iOSClient/Brand/File_Provider_Extension.plist

@@ -0,0 +1,35 @@
+<?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>Nextcloud</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</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>2.22.1</string>
+	<key>CFBundleVersion</key>
+	<string>2</string>
+	<key>NSExtension</key>
+	<dict>
+		<key>NSExtensionFileProviderDocumentGroup</key>
+		<string>group.it.twsweb.Crypto-Cloud</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>

+ 4 - 11
iOSClient/Brand/NCBridgeSwift.h

@@ -34,23 +34,16 @@
 
 #endif
 
-// Nextcloud Extension Share
+// Nextcloud Share
 #if defined(EXTENSION_SHARE)
 
     #import "Share-Swift.h"
 
 #endif
 
-// Nextcloud Extension Document Provider Picker
-#if defined(EXTENSION_PICKER)
+// Nextcloud File Provider Extension
+#if defined(EXTENSION_FILE_PROVIDER_EXTENSION)
 
-    #import "Picker-Swift.h"
-
-#endif
-
-// Nextcloud Extension Document Provider Picker File Provider
-#if defined(EXTENSION_PICKER_FILE_PROVIDER)
-
-    #import "PickerFileProvider-Swift.h"
+    #import "File_Provider_Extension-Swift.h"
 
 #endif

+ 0 - 61
iOSClient/Brand/Picker.plist

@@ -1,61 +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>Nextcloud</string>
-	<key>CFBundleExecutable</key>
-	<string>$(EXECUTABLE_NAME)</string>
-	<key>CFBundleIdentifier</key>
-	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</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>2.22.1</string>
-	<key>CFBundleVersion</key>
-	<string>2</string>
-	<key>NSAppTransportSecurity</key>
-	<dict>
-		<key>NSAllowsArbitraryLoads</key>
-		<true/>
-	</dict>
-	<key>NSExtension</key>
-	<dict>
-		<key>NSExtensionAttributes</key>
-		<dict>
-			<key>UIDocumentPickerModes</key>
-			<array>
-				<string>UIDocumentPickerModeImport</string>
-				<string>UIDocumentPickerModeOpen</string>
-				<string>UIDocumentPickerModeExportToService</string>
-				<string>UIDocumentPickerModeMoveToService</string>
-			</array>
-			<key>UIDocumentPickerSupportedFileTypes</key>
-			<array>
-				<string>public.content</string>
-				<string>public.text</string>
-				<string>public.plain-text</string>
-				<string>public.html</string>
-				<string>public.presentation</string>
-				<string>public.video</string>
-				<string>public.mpeg</string>
-				<string>public.audio</string>
-				<string>public.image</string>
-				<string>public.jpeg</string>
-				<string>public.tiff</string>
-				<string>public.data</string>
-			</array>
-		</dict>
-		<key>NSExtensionMainStoryboard</key>
-		<string>MainInterface</string>
-		<key>NSExtensionPointIdentifier</key>
-		<string>com.apple.fileprovider-ui</string>
-	</dict>
-</dict>
-</plist>

Some files were not shown because too many files changed in this diff