Kaynağa Gözat

Merge branch 'develop'

Marino Faggiana 7 yıl önce
ebeveyn
işleme
9477ba9b89
100 değiştirilmiş dosya ile 13523 ekleme ve 10422 silme
  1. 254 220
      Libraries external/Realm/Realm.framework/0B1BA92F-07F7-3E55-843F-3D90666371D7.bcsymbolmap
  2. 631 487
      Libraries external/Realm/Realm.framework/2402BC3D-6D1C-3FAE-A019-486C6947B517.bcsymbolmap
  3. 225 237
      Libraries external/Realm/Realm.framework/36DC9203-E974-342F-97CD-408C41782BDD.bcsymbolmap
  4. 630 485
      Libraries external/Realm/Realm.framework/382E12C8-AA8F-374F-B12C-5BF974436B8D.bcsymbolmap
  5. 225 237
      Libraries external/Realm/Realm.framework/46647090-26A8-3096-AE67-A3BA4635E65B.bcsymbolmap
  6. 631 487
      Libraries external/Realm/Realm.framework/585CE4DD-AC68-3D41-80EC-A753ECC254D0.bcsymbolmap
  7. 246 214
      Libraries external/Realm/Realm.framework/76D7D231-6DB0-32AE-8968-063313662ACF.bcsymbolmap
  8. 237 195
      Libraries external/Realm/Realm.framework/91B537E0-3CE4-3D7D-AC87-536A5341BE55.bcsymbolmap
  9. 254 220
      Libraries external/Realm/Realm.framework/C9077E03-D54F-3B58-97DE-9F51841B5F71.bcsymbolmap
  10. 59 0
      Libraries external/Realm/Realm.framework/CHANGELOG.md
  11. 630 485
      Libraries external/Realm/Realm.framework/D06F7022-6F9E-3C83-B3C1-EB2771B6AEA4.bcsymbolmap
  12. 237 194
      Libraries external/Realm/Realm.framework/D1AAD4ED-E539-3A05-A21B-ADF62F2B9E60.bcsymbolmap
  13. 242 237
      Libraries external/Realm/Realm.framework/DCE593B2-4B41-3EC1-9543-930EF55B8018.bcsymbolmap
  14. 630 485
      Libraries external/Realm/Realm.framework/F62230D8-6DCD-32B5-BFB3-F0205F5B89C0.bcsymbolmap
  15. 631 487
      Libraries external/Realm/Realm.framework/F7FB8F75-4353-31F6-9FFB-A10D16E94755.bcsymbolmap
  16. 7 0
      Libraries external/Realm/Realm.framework/Headers/NSError+RLMSync.h
  17. 2 2
      Libraries external/Realm/Realm.framework/Headers/RLMArray.h
  18. 4 4
      Libraries external/Realm/Realm.framework/Headers/RLMCollection.h
  19. 16 17
      Libraries external/Realm/Realm.framework/Headers/RLMConstants.h
  20. 6 6
      Libraries external/Realm/Realm.framework/Headers/RLMMigration.h
  21. 3 3
      Libraries external/Realm/Realm.framework/Headers/RLMObject.h
  22. 8 8
      Libraries external/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h
  23. 3 3
      Libraries external/Realm/Realm.framework/Headers/RLMObjectSchema.h
  24. 19 19
      Libraries external/Realm/Realm.framework/Headers/RLMProperty.h
  25. 2 2
      Libraries external/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h
  26. 2 2
      Libraries external/Realm/Realm.framework/Headers/RLMRealmConfiguration.h
  27. 5 5
      Libraries external/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h
  28. 5 5
      Libraries external/Realm/Realm.framework/Headers/RLMResults.h
  29. 2 2
      Libraries external/Realm/Realm.framework/Headers/RLMSchema.h
  30. 1 1
      Libraries external/Realm/Realm.framework/Headers/RLMSyncConfiguration.h
  31. 12 2
      Libraries external/Realm/Realm.framework/Headers/RLMSyncCredentials.h
  32. 1 1
      Libraries external/Realm/Realm.framework/Headers/RLMSyncManager.h
  33. 32 4
      Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionValue.h
  34. 1 1
      Libraries external/Realm/Realm.framework/Headers/RLMSyncSession.h
  35. 60 2
      Libraries external/Realm/Realm.framework/Headers/RLMSyncUser.h
  36. 30 3
      Libraries external/Realm/Realm.framework/Headers/RLMSyncUtil.h
  37. BIN
      Libraries external/Realm/Realm.framework/Info.plist
  38. 4 2
      Libraries external/Realm/Realm.framework/Modules/module.modulemap
  39. 27 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMCollection_Private.h
  40. 28 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectBase_Private.h
  41. 4 4
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h
  42. 2 2
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h
  43. 11 1
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h
  44. 4 6
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h
  45. 4 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h
  46. 3 0
      Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h
  47. BIN
      Libraries external/Realm/Realm.framework/Realm
  48. 254 220
      Libraries external/Realm/RealmSwift.framework/0B1BA92F-07F7-3E55-843F-3D90666371D7.bcsymbolmap
  49. 631 487
      Libraries external/Realm/RealmSwift.framework/2402BC3D-6D1C-3FAE-A019-486C6947B517.bcsymbolmap
  50. 225 237
      Libraries external/Realm/RealmSwift.framework/36DC9203-E974-342F-97CD-408C41782BDD.bcsymbolmap
  51. 630 485
      Libraries external/Realm/RealmSwift.framework/382E12C8-AA8F-374F-B12C-5BF974436B8D.bcsymbolmap
  52. 225 237
      Libraries external/Realm/RealmSwift.framework/46647090-26A8-3096-AE67-A3BA4635E65B.bcsymbolmap
  53. 631 487
      Libraries external/Realm/RealmSwift.framework/585CE4DD-AC68-3D41-80EC-A753ECC254D0.bcsymbolmap
  54. 10 4
      Libraries external/Realm/RealmSwift.framework/6B15B9E1-DBC6-3D97-A8C4-B431FC22A2E8.bcsymbolmap
  55. 246 214
      Libraries external/Realm/RealmSwift.framework/76D7D231-6DB0-32AE-8968-063313662ACF.bcsymbolmap
  56. 30 50
      Libraries external/Realm/RealmSwift.framework/8EE8ADCC-6401-388C-B28F-86DD302DD5C7.bcsymbolmap
  57. 237 195
      Libraries external/Realm/RealmSwift.framework/91B537E0-3CE4-3D7D-AC87-536A5341BE55.bcsymbolmap
  58. 254 220
      Libraries external/Realm/RealmSwift.framework/C9077E03-D54F-3B58-97DE-9F51841B5F71.bcsymbolmap
  59. 630 485
      Libraries external/Realm/RealmSwift.framework/D06F7022-6F9E-3C83-B3C1-EB2771B6AEA4.bcsymbolmap
  60. 237 194
      Libraries external/Realm/RealmSwift.framework/D1AAD4ED-E539-3A05-A21B-ADF62F2B9E60.bcsymbolmap
  61. 242 237
      Libraries external/Realm/RealmSwift.framework/DCE593B2-4B41-3EC1-9543-930EF55B8018.bcsymbolmap
  62. 630 485
      Libraries external/Realm/RealmSwift.framework/F62230D8-6DCD-32B5-BFB3-F0205F5B89C0.bcsymbolmap
  63. 631 487
      Libraries external/Realm/RealmSwift.framework/F7FB8F75-4353-31F6-9FFB-A10D16E94755.bcsymbolmap
  64. BIN
      Libraries external/Realm/RealmSwift.framework/Info.plist
  65. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm.swiftdoc
  66. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm.swiftmodule
  67. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftdoc
  68. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftmodule
  69. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftdoc
  70. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftmodule
  71. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftdoc
  72. BIN
      Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule
  73. BIN
      Libraries external/Realm/RealmSwift.framework/RealmSwift
  74. 473 36
      Nextcloud.xcodeproj/project.pbxproj
  75. 94 141
      Picker/DocumentPickerViewController.swift
  76. 115 3
      PickerFileProvider/FileProvider.swift
  77. 22 1
      PickerFileProvider/PickerFileProvider-Bridging-Header.h
  78. 15 25
      Share/ShareViewController.m
  79. 2 11
      iOSClient/Actions/CCActions.swift
  80. 19 17
      iOSClient/AppDelegate.h
  81. 288 170
      iOSClient/AppDelegate.m
  82. 0 2
      iOSClient/AutoUpload/NCAutoUpload.h
  83. 14 110
      iOSClient/AutoUpload/NCAutoUpload.m
  84. 2 2
      iOSClient/Brand/Picker.plist
  85. 2 2
      iOSClient/Brand/PickerFileProvider.plist
  86. 2 2
      iOSClient/Brand/Share.plist
  87. 2 2
      iOSClient/Brand/iOSClient.plist
  88. 16 16
      iOSClient/CCGlobal.h
  89. 214 29
      iOSClient/Create/CCCreateCloud.swift
  90. 17 0
      iOSClient/Database/NCDatabase.swift
  91. 323 121
      iOSClient/Database/NCManageDatabase.swift
  92. 30 31
      iOSClient/Favorites/CCFavorites.m
  93. 23 0
      iOSClient/Images.xcassets/actionSheetModify.imageset/Contents.json
  94. BIN
      iOSClient/Images.xcassets/actionSheetModify.imageset/actionSheetModify.png
  95. BIN
      iOSClient/Images.xcassets/actionSheetModify.imageset/actionSheetModify@2x.png
  96. BIN
      iOSClient/Images.xcassets/actionSheetModify.imageset/actionSheetModify@3x.png
  97. 0 30
      iOSClient/Library/AHKActionSheet/AHKActionSheet.h
  98. 16 48
      iOSClient/Library/AHKActionSheet/AHKActionSheet.m
  99. 21 15
      iOSClient/Library/AHKActionSheet/AHKActionSheetViewController.m
  100. 0 107
      iOSClient/Library/AHKActionSheet/UIImage+AHKAdditions.h

Dosya farkı çok büyük olduğundan ihmal edildi
+ 254 - 220
Libraries external/Realm/Realm.framework/0B1BA92F-07F7-3E55-843F-3D90666371D7.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 631 - 487
Libraries external/Realm/Realm.framework/2402BC3D-6D1C-3FAE-A019-486C6947B517.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 225 - 237
Libraries external/Realm/Realm.framework/36DC9203-E974-342F-97CD-408C41782BDD.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 630 - 485
Libraries external/Realm/Realm.framework/382E12C8-AA8F-374F-B12C-5BF974436B8D.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 225 - 237
Libraries external/Realm/Realm.framework/46647090-26A8-3096-AE67-A3BA4635E65B.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 631 - 487
Libraries external/Realm/Realm.framework/585CE4DD-AC68-3D41-80EC-A753ECC254D0.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 246 - 214
Libraries external/Realm/Realm.framework/76D7D231-6DB0-32AE-8968-063313662ACF.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 237 - 195
Libraries external/Realm/Realm.framework/91B537E0-3CE4-3D7D-AC87-536A5341BE55.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 254 - 220
Libraries external/Realm/Realm.framework/C9077E03-D54F-3B58-97DE-9F51841B5F71.bcsymbolmap


+ 59 - 0
Libraries external/Realm/Realm.framework/CHANGELOG.md

@@ -1,3 +1,62 @@
+2.9.1 Release notes (2017-08-01)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* None.
+
+### Bugfixes
+
+* The `shouldCompactOnLaunch` block is no longer invoked if the Realm at that
+  path is already open on other threads.
+* Fix an assertion failure in collection notifications when changes are made to
+  the schema via sync while the notification block is active.
+
+2.9.0 Release notes (2017-07-26)
+=============================================================
+
+### API Breaking Changes
+
+* None.
+
+### Enhancements
+
+* Add a new error code to denote 'permission denied' errors when working
+  with synchronized Realms, as well as an accompanying block that can be
+  called to inform the binding that the offending Realm's files should be
+  deleted immediately. This allows recovering from 'permission denied'
+  errors in a more robust manner. See the documentation for
+  `RLMSyncErrorPermissionDeniedError` for more information.
+* Add `-[RLMSyncPermissionValue initWithRealmPath:username:accessLevel:]`
+  API allowing permissions to be applied to a user based on their username
+  (usually, an email address). Requires any edition of the Realm Object
+  Server 1.6.0 or later.
+* Improve performance of creating Swift objects which contain at least one List
+  property.
+* It is now possible to create and log in multiple Realm Object Server users
+  with the same identity if they originate from different servers. Note that
+  if the URLs are different aliases for the same authentication server each
+  user will still be treated as separate (e.g. they will have their own copy
+  of each synchronized Realm opened using them). It is highly encouraged that
+  users defined using the access token credential type be logged in with an
+  authentication server URL specified; this parameter will become mandatory
+  in a future version of the SDK.
+* Add `-[RLMSyncUser retrieveInfoForUser:identityProvider:completion:]`
+  API allowing administrator users to retrieve information about a user based
+  on their provider identity (for example, a username). Requires any edition
+  of the Realm Object Server 1.8.2 or later.
+
+### Bugfixes
+
+* `List.description` now reports the correct types for nested lists.
+* Fix unmanaged object initialization when a nested property type returned
+  `false` from `Object.shouldIncludeInDefaultSchema()`.
+* Don't clear RLMArrays on self-assignment.
+
 2.8.3 Release notes (2017-06-20)
 2.8.3 Release notes (2017-06-20)
 =============================================================
 =============================================================
 
 

Dosya farkı çok büyük olduğundan ihmal edildi
+ 630 - 485
Libraries external/Realm/Realm.framework/D06F7022-6F9E-3C83-B3C1-EB2771B6AEA4.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 237 - 194
Libraries external/Realm/Realm.framework/D1AAD4ED-E539-3A05-A21B-ADF62F2B9E60.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 242 - 237
Libraries external/Realm/Realm.framework/DCE593B2-4B41-3EC1-9543-930EF55B8018.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 630 - 485
Libraries external/Realm/Realm.framework/F62230D8-6DCD-32B5-BFB3-F0205F5B89C0.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 631 - 487
Libraries external/Realm/Realm.framework/F7FB8F75-4353-31F6-9FFB-A10D16E94755.bcsymbolmap


+ 7 - 0
Libraries external/Realm/Realm.framework/Headers/NSError+RLMSync.h

@@ -31,6 +31,13 @@ NS_ASSUME_NONNULL_BEGIN
  */
  */
 - (nullable void(^)(void))rlmSync_clientResetBlock NS_REFINED_FOR_SWIFT;
 - (nullable void(^)(void))rlmSync_clientResetBlock NS_REFINED_FOR_SWIFT;
 
 
+/**
+ Given a Realm Object Server permission denied error, return the block that
+ can be called to manually initiate the Realm file deletion process, or nil
+ if the error isn't a permission denied error.
+ */
+- (nullable void(^)(void))rlmSync_deleteRealmBlock NS_REFINED_FOR_SWIFT;
+
 /**
 /**
  Given a Realm Object Server client reset error, return the path where the
  Given a Realm Object Server client reset error, return the path where the
  backup copy of the Realm will be placed once the client reset process is
  backup copy of the Realm will be placed once the client reset process is

+ 2 - 2
Libraries external/Realm/Realm.framework/Headers/RLMArray.h

@@ -418,13 +418,13 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  `-[RLMArray init]` is not available because `RLMArray`s cannot be created directly.
  `-[RLMArray init]` is not available because `RLMArray`s cannot be created directly.
- `RLMArray` properties on `RLMObject`s are lazily created when accessed, or can be obtained by querying a Realm.
+ `RLMArray` properties on `RLMObject`s are lazily created when accessed.
  */
  */
 - (instancetype)init __attribute__((unavailable("RLMArrays cannot be created directly")));
 - (instancetype)init __attribute__((unavailable("RLMArrays cannot be created directly")));
 
 
 /**
 /**
  `+[RLMArray new]` is not available because `RLMArray`s cannot be created directly.
  `+[RLMArray new]` is not available because `RLMArray`s cannot be created directly.
- `RLMArray` properties on `RLMObject`s are lazily created when accessed, or can be obtained by querying a Realm.
+ `RLMArray` properties on `RLMObject`s are lazily created when accessed.
  */
  */
 + (instancetype)new __attribute__((unavailable("RLMArrays cannot be created directly")));
 + (instancetype)new __attribute__((unavailable("RLMArrays cannot be created directly")));
 
 

+ 4 - 4
Libraries external/Realm/Realm.framework/Headers/RLMCollection.h

@@ -18,7 +18,7 @@
 
 
 #import <Foundation/Foundation.h>
 #import <Foundation/Foundation.h>
 
 
-#import "RLMThreadSafeReference.h"
+#import <Realm/RLMThreadSafeReference.h>
 
 
 NS_ASSUME_NONNULL_BEGIN
 NS_ASSUME_NONNULL_BEGIN
 
 
@@ -313,7 +313,7 @@ NS_ASSUME_NONNULL_BEGIN
  `sortedResultsUsingDescriptors:`. It is similar to `NSSortDescriptor`, but supports
  `sortedResultsUsingDescriptors:`. It is similar to `NSSortDescriptor`, but supports
  only the subset of functionality which can be efficiently run by Realm's query
  only the subset of functionality which can be efficiently run by Realm's query
  engine.
  engine.
- 
+
  `RLMSortDescriptor` instances are immutable.
  `RLMSortDescriptor` instances are immutable.
  */
  */
 @interface RLMSortDescriptor : NSObject
 @interface RLMSortDescriptor : NSObject
@@ -388,11 +388,11 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  The indices in the new version of the collection which were modified.
  The indices in the new version of the collection which were modified.
- 
+
  For `RLMResults`, this means that one or more of the properties of the object at
  For `RLMResults`, this means that one or more of the properties of the object at
  that index were modified (or an object linked to by that object was
  that index were modified (or an object linked to by that object was
  modified).
  modified).
- 
+
  For `RLMArray`, the array itself being modified to contain a
  For `RLMArray`, the array itself being modified to contain a
  different object at that index will also be reported as a modification.
  different object at that index will also be reported as a modification.
  */
  */

+ 16 - 17
Libraries external/Realm/Realm.framework/Headers/RLMConstants.h

@@ -47,7 +47,6 @@ NS_ASSUME_NONNULL_BEGIN
 
 
  For more information, see [Realm Models](https://realm.io/docs/objc/latest/#models).
  For more information, see [Realm Models](https://realm.io/docs/objc/latest/#models).
  */
  */
-// Make sure numbers match those in <realm/data_type.hpp>
 typedef NS_ENUM(int32_t, RLMPropertyType) {
 typedef NS_ENUM(int32_t, RLMPropertyType) {
 
 
 #pragma mark - Primitive types
 #pragma mark - Primitive types
@@ -57,34 +56,34 @@ typedef NS_ENUM(int32_t, RLMPropertyType) {
     /** Booleans: `BOOL`, `bool`, `Bool` (Swift) */
     /** Booleans: `BOOL`, `bool`, `Bool` (Swift) */
     RLMPropertyTypeBool   = 1,
     RLMPropertyTypeBool   = 1,
     /** Floating-point numbers: `float`, `Float` (Swift) */
     /** Floating-point numbers: `float`, `Float` (Swift) */
-    RLMPropertyTypeFloat  = 9,
+    RLMPropertyTypeFloat  = 5,
     /** Double-precision floating-point numbers: `double`, `Double` (Swift) */
     /** Double-precision floating-point numbers: `double`, `Double` (Swift) */
-    RLMPropertyTypeDouble = 10,
+    RLMPropertyTypeDouble = 6,
 
 
 #pragma mark - Object types
 #pragma mark - Object types
 
 
     /** Strings: `NSString`, `String` (Swift) */
     /** Strings: `NSString`, `String` (Swift) */
     RLMPropertyTypeString = 2,
     RLMPropertyTypeString = 2,
     /** Binary data: `NSData` */
     /** Binary data: `NSData` */
-    RLMPropertyTypeData   = 4,
-    /** 
+    RLMPropertyTypeData   = 3,
+    /**
      Any object: `id`.
      Any object: `id`.
-     
+
      This property type is no longer supported for new models. However, old models with any-typed properties are still
      This property type is no longer supported for new models. However, old models with any-typed properties are still
      supported for migration purposes.
      supported for migration purposes.
      */
      */
-    RLMPropertyTypeAny    = 6,
+    RLMPropertyTypeAny    = 9,
     /** Dates: `NSDate` */
     /** Dates: `NSDate` */
-    RLMPropertyTypeDate   = 8,
+    RLMPropertyTypeDate   = 4,
 
 
 #pragma mark - Array/Linked object types
 #pragma mark - Array/Linked object types
 
 
     /** Realm model objects. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
     /** Realm model objects. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
-    RLMPropertyTypeObject = 12,
+    RLMPropertyTypeObject = 7,
     /** Realm arrays. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
     /** Realm arrays. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
-    RLMPropertyTypeArray  = 13,
+    RLMPropertyTypeArray  = 128,
     /** Realm linking objects. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
     /** Realm linking objects. See [Realm Models](https://realm.io/docs/objc/latest/#models) for more information. */
-    RLMPropertyTypeLinkingObjects = 14,
+    RLMPropertyTypeLinkingObjects = 8,
 };
 };
 
 
 /** An error domain identifying Realm-specific errors. */
 /** An error domain identifying Realm-specific errors. */
@@ -104,9 +103,9 @@ typedef RLM_ERROR_ENUM(NSInteger, RLMError, RLMErrorDomain) {
     /** Denotes a file I/O error that occurred when trying to open a Realm. */
     /** Denotes a file I/O error that occurred when trying to open a Realm. */
     RLMErrorFileAccess            = 2,
     RLMErrorFileAccess            = 2,
 
 
-    /** 
+    /**
      Denotes a file permission error that ocurred when trying to open a Realm.
      Denotes a file permission error that ocurred when trying to open a Realm.
-     
+
      This error can occur if the user does not have permission to open or create
      This error can occur if the user does not have permission to open or create
      the specified file in the specified access mode when opening a Realm.
      the specified file in the specified access mode when opening a Realm.
      */
      */
@@ -117,24 +116,24 @@ typedef RLM_ERROR_ENUM(NSInteger, RLMError, RLMErrorDomain) {
 
 
     /**
     /**
      Denotes an error that occurs if a file could not be found.
      Denotes an error that occurs if a file could not be found.
-     
+
      This error may occur if a Realm file could not be found on disk when trying to open a
      This error may occur if a Realm file could not be found on disk when trying to open a
      Realm as read-only, or if the directory part of the specified path was not found when
      Realm as read-only, or if the directory part of the specified path was not found when
      trying to write a copy.
      trying to write a copy.
      */
      */
     RLMErrorFileNotFound          = 5,
     RLMErrorFileNotFound          = 5,
 
 
-    /** 
+    /**
      Denotes an error that occurs if a file format upgrade is required to open the file,
      Denotes an error that occurs if a file format upgrade is required to open the file,
      but upgrades were explicitly disabled.
      but upgrades were explicitly disabled.
      */
      */
     RLMErrorFileFormatUpgradeRequired = 6,
     RLMErrorFileFormatUpgradeRequired = 6,
 
 
-    /** 
+    /**
      Denotes an error that occurs if the database file is currently open in another
      Denotes an error that occurs if the database file is currently open in another
      process which cannot share with the current process due to an
      process which cannot share with the current process due to an
      architecture mismatch.
      architecture mismatch.
-     
+
      This error may occur if trying to share a Realm file between an i386 (32-bit) iOS
      This error may occur if trying to share a Realm file between an i386 (32-bit) iOS
      Simulator and the Realm Browser application. In this case, please use the 64-bit
      Simulator and the Realm Browser application. In this case, please use the 64-bit
      version of the iOS Simulator.
      version of the iOS Simulator.

+ 6 - 6
Libraries external/Realm/Realm.framework/Headers/RLMMigration.h

@@ -25,11 +25,11 @@ NS_ASSUME_NONNULL_BEGIN
 @class RLMObject;
 @class RLMObject;
 
 
 /**
 /**
- A block type which provides both the old and new versions of an object in the Realm. Object 
+ A block type which provides both the old and new versions of an object in the Realm. Object
  properties can only be accessed using keyed subscripting.
  properties can only be accessed using keyed subscripting.
- 
+
  @see `-[RLMMigration enumerateObjects:block:]`
  @see `-[RLMMigration enumerateObjects:block:]`
- 
+
  @param oldObject The object from the original Realm (read-only).
  @param oldObject The object from the original Realm (read-only).
  @param newObject The object from the migrated Realm (read-write).
  @param newObject The object from the migrated Realm (read-write).
 */
 */
@@ -37,7 +37,7 @@ typedef void (^RLMObjectMigrationBlock)(RLMObject * __nullable oldObject, RLMObj
 
 
 /**
 /**
  `RLMMigration` instances encapsulate information intended to facilitate a schema migration.
  `RLMMigration` instances encapsulate information intended to facilitate a schema migration.
- 
+
  A `RLMMigration` instance is passed into a user-defined `RLMMigrationBlock` block when updating
  A `RLMMigration` instance is passed into a user-defined `RLMMigrationBlock` block when updating
  the version of a Realm. This instance provides access to the old and new database schemas, the
  the version of a Realm. This instance provides access to the old and new database schemas, the
  objects in the Realm, and provides functionality for modifying the Realm during the migration.
  objects in the Realm, and provides functionality for modifying the Realm during the migration.
@@ -75,8 +75,8 @@ typedef void (^RLMObjectMigrationBlock)(RLMObject * __nullable oldObject, RLMObj
 
 
 /**
 /**
  Creates and returns an `RLMObject` instance of type `className` in the Realm being migrated.
  Creates and returns an `RLMObject` instance of type `className` in the Realm being migrated.
- 
- The `value` argument is used to populate the object. It can be a key-value coding compliant object, an array or 
+
+ The `value` argument is used to populate the object. It can be a key-value coding compliant object, an array or
  dictionary returned from the methods in `NSJSONSerialization`, or an array containing one element for each managed
  dictionary returned from the methods in `NSJSONSerialization`, or an array containing one element for each managed
  property. An exception will be thrown if any required properties are not present and those properties were not defined
  property. An exception will be thrown if any required properties are not present and those properties were not defined
  with default values.
  with default values.

+ 3 - 3
Libraries external/Realm/Realm.framework/Headers/RLMObject.h

@@ -138,7 +138,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
  The `value` argument can be a key-value coding compliant object, an array or dictionary returned from the methods in
  The `value` argument can be a key-value coding compliant object, an array or dictionary returned from the methods in
  `NSJSONSerialization`, or an array containing one element for each managed property.
  `NSJSONSerialization`, or an array containing one element for each managed property.
- 
+
  An exception will be thrown if any required properties are not present and those properties
  An exception will be thrown if any required properties are not present and those properties
  were not defined with default values.
  were not defined with default values.
 
 
@@ -159,7 +159,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
  The `value` argument can be a key-value coding compliant object, an array or dictionary returned from the methods in
  The `value` argument can be a key-value coding compliant object, an array or dictionary returned from the methods in
  `NSJSONSerialization`, or an array containing one element for each managed property.
  `NSJSONSerialization`, or an array containing one element for each managed property.
- 
+
  An exception will be thrown if any required properties are not present and those properties
  An exception will be thrown if any required properties are not present and those properties
  were not defined with default values.
  were not defined with default values.
 
 
@@ -189,7 +189,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
  If the object is being created, an exception will be thrown if any required properties
  If the object is being created, an exception will be thrown if any required properties
  are not present and those properties were not defined with default values.
  are not present and those properties were not defined with default values.
- 
+
  If the `value` argument is a Realm object already managed by the default Realm, the
  If the `value` argument is a Realm object already managed by the default Realm, the
  argument's type is the same as the receiver, and the objects have identical values for
  argument's type is the same as the receiver, and the objects have identical values for
  their managed properties, this method does nothing.
  their managed properties, this method does nothing.

+ 8 - 8
Libraries external/Realm/Realm.framework/Headers/RLMObjectBase_Dynamic.h

@@ -24,26 +24,26 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  Returns the Realm that manages the object, if one exists.
  Returns the Realm that manages the object, if one exists.
- 
+
  @warning  This function is useful only in specialized circumstances, for example, when building components
  @warning  This function is useful only in specialized circumstances, for example, when building components
            that integrate with Realm. If you are simply building an app on Realm, it is
            that integrate with Realm. If you are simply building an app on Realm, it is
            recommended to retrieve the Realm that manages the object via `RLMObject`.
            recommended to retrieve the Realm that manages the object via `RLMObject`.
 
 
  @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
  @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
- 
+
  @return The Realm which manages this object. Returns `nil `for unmanaged objects.
  @return The Realm which manages this object. Returns `nil `for unmanaged objects.
  */
  */
 FOUNDATION_EXTERN RLMRealm * _Nullable RLMObjectBaseRealm(RLMObjectBase * _Nullable object);
 FOUNDATION_EXTERN RLMRealm * _Nullable RLMObjectBaseRealm(RLMObjectBase * _Nullable object);
 
 
 /**
 /**
  Returns an `RLMObjectSchema` which describes the managed properties of the object.
  Returns an `RLMObjectSchema` which describes the managed properties of the object.
- 
+
  @warning  This function is useful only in specialized circumstances, for example, when building components
  @warning  This function is useful only in specialized circumstances, for example, when building components
            that integrate with Realm. If you are simply building an app on Realm, it is
            that integrate with Realm. If you are simply building an app on Realm, it is
            recommended to retrieve `objectSchema` via `RLMObject`.
            recommended to retrieve `objectSchema` via `RLMObject`.
 
 
  @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
  @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
- 
+
  @return The object schema which lists the managed properties for the object.
  @return The object schema which lists the managed properties for the object.
  */
  */
 FOUNDATION_EXTERN RLMObjectSchema * _Nullable RLMObjectBaseObjectSchema(RLMObjectBase * _Nullable object);
 FOUNDATION_EXTERN RLMObjectSchema * _Nullable RLMObjectBaseObjectSchema(RLMObjectBase * _Nullable object);
@@ -56,23 +56,23 @@ FOUNDATION_EXTERN RLMObjectSchema * _Nullable RLMObjectBaseObjectSchema(RLMObjec
            recommended to retrieve key values via `RLMObject`.
            recommended to retrieve key values via `RLMObject`.
 
 
  @warning Will throw an `NSUndefinedKeyException` if `key` is not present on the object.
  @warning Will throw an `NSUndefinedKeyException` if `key` is not present on the object.
- 
+
  @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
  @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
  @param key		The name of the property.
  @param key		The name of the property.
- 
+
  @return The object for the property requested.
  @return The object for the property requested.
  */
  */
 FOUNDATION_EXTERN id _Nullable RLMObjectBaseObjectForKeyedSubscript(RLMObjectBase * _Nullable object, NSString *key);
 FOUNDATION_EXTERN id _Nullable RLMObjectBaseObjectForKeyedSubscript(RLMObjectBase * _Nullable object, NSString *key);
 
 
 /**
 /**
  Sets a value for a key on the object.
  Sets a value for a key on the object.
- 
+
  @warning  This function is useful only in specialized circumstances, for example, when building components
  @warning  This function is useful only in specialized circumstances, for example, when building components
            that integrate with Realm. If you are simply building an app on Realm, it is
            that integrate with Realm. If you are simply building an app on Realm, it is
            recommended to set key values via `RLMObject`.
            recommended to set key values via `RLMObject`.
 
 
  @warning Will throw an `NSUndefinedKeyException` if `key` is not present on the object.
  @warning Will throw an `NSUndefinedKeyException` if `key` is not present on the object.
- 
+
  @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
  @param object	An `RLMObjectBase` obtained via a Swift `Object` or `RLMObject`.
  @param key		The name of the property.
  @param key		The name of the property.
  @param obj		The object to set as the value of the key.
  @param obj		The object to set as the value of the key.

+ 3 - 3
Libraries external/Realm/Realm.framework/Headers/RLMObjectSchema.h

@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  An array of `RLMProperty` instances representing the managed properties of a class described by the schema.
  An array of `RLMProperty` instances representing the managed properties of a class described by the schema.
- 
+
  @see `RLMProperty`
  @see `RLMProperty`
  */
  */
 @property (nonatomic, readonly, copy) NSArray<RLMProperty *> *properties;
 @property (nonatomic, readonly, copy) NSArray<RLMProperty *> *properties;
@@ -55,9 +55,9 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  Retrieves an `RLMProperty` object by the property name.
  Retrieves an `RLMProperty` object by the property name.
- 
+
  @param propertyName The property's name.
  @param propertyName The property's name.
- 
+
  @return An `RLMProperty` object, or `nil` if there is no property with the given name.
  @return An `RLMProperty` object, or `nil` if there is no property with the given name.
  */
  */
 - (nullable RLMProperty *)objectForKeyedSubscript:(NSString *)propertyName;
 - (nullable RLMProperty *)objectForKeyedSubscript:(NSString *)propertyName;

+ 19 - 19
Libraries external/Realm/Realm.framework/Headers/RLMProperty.h

@@ -16,37 +16,37 @@
 //
 //
 ////////////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////////////
 
 
-#import <Foundation/Foundation.h>
 #import <Realm/RLMConstants.h>
 #import <Realm/RLMConstants.h>
 
 
 NS_ASSUME_NONNULL_BEGIN
 NS_ASSUME_NONNULL_BEGIN
 
 
 /// :nodoc:
 /// :nodoc:
-@protocol RLMInt
-@end
-
+@protocol RLMInt @end
 /// :nodoc:
 /// :nodoc:
-@protocol RLMBool
-@end
-
+@protocol RLMBool @end
 /// :nodoc:
 /// :nodoc:
-@protocol RLMDouble
-@end
-
+@protocol RLMDouble @end
 /// :nodoc:
 /// :nodoc:
-@protocol RLMFloat
-@end
+@protocol RLMFloat @end
+/// :nodoc:
+@protocol RLMString @end
+/// :nodoc:
+@protocol RLMDate @end
+/// :nodoc:
+@protocol RLMData @end
 
 
 /// :nodoc:
 /// :nodoc:
 @interface NSNumber ()<RLMInt, RLMBool, RLMDouble, RLMFloat>
 @interface NSNumber ()<RLMInt, RLMBool, RLMDouble, RLMFloat>
 @end
 @end
 
 
 /**
 /**
- `RLMProperty` instances represent properties managed by a Realm in the context of an object schema. Such properties may
- be persisted to a Realm file or computed from other data from the Realm.
- 
- When using Realm, `RLMProperty` instances allow performing migrations and introspecting the database's schema.
- 
+ `RLMProperty` instances represent properties managed by a Realm in the context
+ of an object schema. Such properties may be persisted to a Realm file or
+ computed from other data from the Realm.
+
+ When using Realm, `RLMProperty` instances allow performing migrations and
+ introspecting the database's schema.
+
  These property instances map to columns in the core database.
  These property instances map to columns in the core database.
  */
  */
 @interface RLMProperty : NSObject
 @interface RLMProperty : NSObject
@@ -60,14 +60,14 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  The type of the property.
  The type of the property.
- 
+
  @see `RLMPropertyType`
  @see `RLMPropertyType`
  */
  */
 @property (nonatomic, readonly) RLMPropertyType type;
 @property (nonatomic, readonly) RLMPropertyType type;
 
 
 /**
 /**
  Indicates whether this property is indexed.
  Indicates whether this property is indexed.
- 
+
  @see `RLMObject`
  @see `RLMObject`
  */
  */
 @property (nonatomic, readonly) BOOL indexed;
 @property (nonatomic, readonly) BOOL indexed;

+ 2 - 2
Libraries external/Realm/Realm.framework/Headers/RLMRealmConfiguration+Sync.h

@@ -30,10 +30,10 @@ NS_ASSUME_NONNULL_BEGIN
 /**
 /**
  A configuration object representing configuration state for Realms intended
  A configuration object representing configuration state for Realms intended
  to sync with a Realm Object Server.
  to sync with a Realm Object Server.
- 
+
  This property is mutually exclusive with both `inMemoryIdentifier` and `fileURL`;
  This property is mutually exclusive with both `inMemoryIdentifier` and `fileURL`;
  setting any one of the three properties will automatically nil out the other two.
  setting any one of the three properties will automatically nil out the other two.
- 
+
  @see `RLMSyncConfiguration`
  @see `RLMSyncConfiguration`
  */
  */
 @property (nullable, nonatomic) RLMSyncConfiguration *syncConfiguration;
 @property (nullable, nonatomic) RLMSyncConfiguration *syncConfiguration;

+ 2 - 2
Libraries external/Realm/Realm.framework/Headers/RLMRealmConfiguration.h

@@ -39,10 +39,10 @@ typedef BOOL (^RLMShouldCompactOnLaunchBlock)(NSUInteger totalBytes, NSUInteger
  `RLMRealmConfiguration` instances are just plain `NSObject`s. Unlike `RLMRealm`s
  `RLMRealmConfiguration` instances are just plain `NSObject`s. Unlike `RLMRealm`s
  and `RLMObject`s, they can be freely shared between threads as long as you do not
  and `RLMObject`s, they can be freely shared between threads as long as you do not
  mutate them.
  mutate them.
- 
+
  Creating configuration objects for class subsets (by setting the
  Creating configuration objects for class subsets (by setting the
  `objectClasses` property) can be expensive. Because of this, you will normally want to
  `objectClasses` property) can be expensive. Because of this, you will normally want to
- cache and reuse a single configuration object for each distinct configuration rather than 
+ cache and reuse a single configuration object for each distinct configuration rather than
  creating a new object each time you open a Realm.
  creating a new object each time you open a Realm.
  */
  */
 @interface RLMRealmConfiguration : NSObject<NSCopying>
 @interface RLMRealmConfiguration : NSObject<NSCopying>

+ 5 - 5
Libraries external/Realm/Realm.framework/Headers/RLMRealm_Dynamic.h

@@ -79,22 +79,22 @@ NS_ASSUME_NONNULL_BEGIN
 /**
 /**
  Returns the object of the given type with the given primary key from the Realm.
  Returns the object of the given type with the given primary key from the Realm.
 
 
- @warning This method is useful only in specialized circumstances, for example, when building components 
+ @warning This method is useful only in specialized circumstances, for example, when building components
           that integrate with Realm. The preferred way to get an object of a single class is to use the class
           that integrate with Realm. The preferred way to get an object of a single class is to use the class
           methods on `RLMObject`.
           methods on `RLMObject`.
- 
+
  @param className   The class name for the object you are looking for.
  @param className   The class name for the object you are looking for.
  @param primaryKey  The primary key value for the object you are looking for.
  @param primaryKey  The primary key value for the object you are looking for.
- 
+
  @return    An object, or `nil` if an object with the given primary key does not exist.
  @return    An object, or `nil` if an object with the given primary key does not exist.
- 
+
  @see       `+[RLMObject objectForPrimaryKey:]`
  @see       `+[RLMObject objectForPrimaryKey:]`
  */
  */
 - (nullable RLMObject *)objectWithClassName:(NSString *)className forPrimaryKey:(id)primaryKey;
 - (nullable RLMObject *)objectWithClassName:(NSString *)className forPrimaryKey:(id)primaryKey;
 
 
 /**
 /**
  Creates an `RLMObject` instance of type `className` in the Realm, and populates it using a given object.
  Creates an `RLMObject` instance of type `className` in the Realm, and populates it using a given object.
- 
+
  The `value` argument is used to populate the object. It can be a key-value coding compliant object, an array or
  The `value` argument is used to populate the object. It can be a key-value coding compliant object, an array or
  dictionary returned from the methods in `NSJSONSerialization`, or an array containing one element for each managed
  dictionary returned from the methods in `NSJSONSerialization`, or an array containing one element for each managed
  property. An exception will be thrown if any required properties are not present and those properties were not defined
  property. An exception will be thrown if any required properties are not present and those properties were not defined

+ 5 - 5
Libraries external/Realm/Realm.framework/Headers/RLMResults.h

@@ -38,8 +38,8 @@ NS_ASSUME_NONNULL_BEGIN
  enumeration.
  enumeration.
 
 
  `RLMResults` are lazily evaluated the first time they are accessed; they only
  `RLMResults` are lazily evaluated the first time they are accessed; they only
- run queries when the result of the query is requested. This means that 
- chaining several temporary `RLMResults` to sort and filter your data does not 
+ run queries when the result of the query is requested. This means that
+ chaining several temporary `RLMResults` to sort and filter your data does not
  perform any extra work processing the intermediate state.
  perform any extra work processing the intermediate state.
 
 
  Once the results have been evaluated or a notification block has been added,
  Once the results have been evaluated or a notification block has been added,
@@ -201,7 +201,7 @@ NS_ASSUME_NONNULL_BEGIN
  which rows in the results collection were added, removed or modified. If a
  which rows in the results collection were added, removed or modified. If a
  write transaction did not modify any objects in the results collection,
  write transaction did not modify any objects in the results collection,
  the block is not called at all. See the `RLMCollectionChange` documentation for
  the block is not called at all. See the `RLMCollectionChange` documentation for
- information on how the changes are reported and an example of updating a 
+ information on how the changes are reported and an example of updating a
  `UITableView`.
  `UITableView`.
 
 
  If an error occurs the block will be called with `nil` for the results
  If an error occurs the block will be called with `nil` for the results
@@ -275,7 +275,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
  @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
  @warning You cannot use this method on `RLMObject`, `RLMArray`, and `NSData` properties.
 
 
- @param property The property whose maximum value is desired. Only properties of types `int`, `float`, `double`, and 
+ @param property The property whose maximum value is desired. Only properties of types `int`, `float`, `double`, and
                  `NSDate` are supported.
                  `NSDate` are supported.
 
 
  @return The maximum value of the property, or `nil` if the Results are empty.
  @return The maximum value of the property, or `nil` if the Results are empty.
@@ -332,7 +332,7 @@ NS_ASSUME_NONNULL_BEGIN
 /**
 /**
  `RLMLinkingObjects` is an auto-updating container type. It represents a collection of objects that link to its
  `RLMLinkingObjects` is an auto-updating container type. It represents a collection of objects that link to its
  parent object.
  parent object.
- 
+
  For more information, please see the "Inverse Relationships" section in the
  For more information, please see the "Inverse Relationships" section in the
  [documentation](https://realm.io/docs/objc/latest/#relationships).
  [documentation](https://realm.io/docs/objc/latest/#relationships).
  */
  */

+ 2 - 2
Libraries external/Realm/Realm.framework/Headers/RLMSchema.h

@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  An `NSArray` containing `RLMObjectSchema`s for all object types in the Realm.
  An `NSArray` containing `RLMObjectSchema`s for all object types in the Realm.
- 
+
  This property is intended to be used during migrations for dynamic introspection.
  This property is intended to be used during migrations for dynamic introspection.
 
 
  @see `RLMObjectSchema`
  @see `RLMObjectSchema`
@@ -57,7 +57,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  Looks up and returns an `RLMObjectSchema` for the given class name in the Realm.
  Looks up and returns an `RLMObjectSchema` for the given class name in the Realm.
- 
+
  If there is no object of type `className` in the schema, an exception will be thrown.
  If there is no object of type `className` in the schema, an exception will be thrown.
 
 
  @param className   The object class name.
  @param className   The object class name.

+ 1 - 1
Libraries external/Realm/Realm.framework/Headers/RLMSyncConfiguration.h

@@ -33,7 +33,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
  The URL of the remote Realm upon the Realm Object Server.
  The URL of the remote Realm upon the Realm Object Server.
- 
+
  @warning The URL cannot end with `.realm`, `.realm.lock` or `.realm.management`.
  @warning The URL cannot end with `.realm`, `.realm.lock` or `.realm.management`.
  */
  */
 @property (nonatomic, readonly) NSURL *realmURL;
 @property (nonatomic, readonly) NSURL *realmURL;

+ 12 - 2
Libraries external/Realm/Realm.framework/Headers/RLMSyncCredentials.h

@@ -82,8 +82,18 @@ extern RLMIdentityProvider const RLMIdentityProviderCloudKit;
                                register:(BOOL)shouldRegister;
                                register:(BOOL)shouldRegister;
 
 
 /**
 /**
- Construct and return special credentials representing a token that can be directly used to open a Realm. The identity
- is used to uniquely identify the user across application launches.
+ Construct and return special credentials representing a token that can
+ be directly used to open a Realm. The identity is used to uniquely identify
+ the user across application launches.
+
+ @warning The custom user identity will be deprecated in a future release.
+
+ @warning Do not specify a user identity that is the URL of an authentication
+          server.
+
+ @warning When passing an access token credential into any of `RLMSyncUser`'s
+          login methods, you must always specify the same authentication server
+          URL, or none at all, every time you call the login method.
  */
  */
 + (instancetype)credentialsWithAccessToken:(RLMServerToken)accessToken identity:(NSString *)identity;
 + (instancetype)credentialsWithAccessToken:(RLMServerToken)accessToken identity:(NSString *)identity;
 
 

+ 1 - 1
Libraries external/Realm/Realm.framework/Headers/RLMSyncManager.h

@@ -83,7 +83,7 @@ typedef void(^RLMSyncErrorReportingBlock)(NSError *, RLMSyncSession * _Nullable)
 
 
 /**
 /**
  Whether SSL certificate validation should be disabled.
  Whether SSL certificate validation should be disabled.
- 
+
  Once this value is set (either way), it will be used as the default value for SSL
  Once this value is set (either way), it will be used as the default value for SSL
  validation when initializing new sync configuration values. A given configuration's
  validation when initializing new sync configuration values. A given configuration's
  SSL validation setting can still be overriden from the global default by setting it
  SSL validation setting can still be overriden from the global default by setting it

+ 32 - 4
Libraries external/Realm/Realm.framework/Headers/RLMSyncPermissionValue.h

@@ -32,7 +32,7 @@ typedef NS_ENUM(NSUInteger, RLMSyncAccessLevel) {
     RLMSyncAccessLevelNone          = 0,
     RLMSyncAccessLevelNone          = 0,
     /**
     /**
      User can only read the contents of the Realm.
      User can only read the contents of the Realm.
-     
+
      @warning Users who have read-only access to a Realm should open the
      @warning Users who have read-only access to a Realm should open the
               Realm using `+[RLMRealm asyncOpenWithConfiguration:callbackQueue:callback:]`.
               Realm using `+[RLMRealm asyncOpenWithConfiguration:callbackQueue:callback:]`.
               Attempting to directly open the Realm is an error; in this
               Attempting to directly open the Realm is an error; in this
@@ -52,7 +52,7 @@ NS_ASSUME_NONNULL_BEGIN
  A value representing a permission granted to the specified user(s) to access the specified Realm(s).
  A value representing a permission granted to the specified user(s) to access the specified Realm(s).
 
 
  `RLMSyncPermissionValue` is immutable and can be accessed from any thread.
  `RLMSyncPermissionValue` is immutable and can be accessed from any thread.
- 
+
  See https://realm.io/docs/realm-object-server/#permissions for general documentation.
  See https://realm.io/docs/realm-object-server/#permissions for general documentation.
  */
  */
 @interface RLMSyncPermissionValue : NSObject
 @interface RLMSyncPermissionValue : NSObject
@@ -82,7 +82,7 @@ NS_ASSUME_NONNULL_BEGIN
  Create a new sync permission value, for use with permission APIs.
  Create a new sync permission value, for use with permission APIs.
 
 
  @param path        The Realm Object Server path to the Realm whose permission should be modified
  @param path        The Realm Object Server path to the Realm whose permission should be modified
-                    (e.g. "/path/to/realm"). Pass "*" to apply to all Realms managed by the server.
+                    (e.g. "/path/to/realm"). Pass "*" to apply to all Realms managed by the user.
  @param userID      The identity of the user who should be granted access to the Realm at `path`.
  @param userID      The identity of the user who should be granted access to the Realm at `path`.
                     Pass "*" to apply to all users managed by the server.
                     Pass "*" to apply to all users managed by the server.
  @param accessLevel The access level to grant.
  @param accessLevel The access level to grant.
@@ -91,12 +91,40 @@ NS_ASSUME_NONNULL_BEGIN
                            userID:(NSString *)userID
                            userID:(NSString *)userID
                       accessLevel:(RLMSyncAccessLevel)accessLevel;
                       accessLevel:(RLMSyncAccessLevel)accessLevel;
 
 
+/**
+ Create a new sync permission value, for use with permission APIs.
+
+ @param path        The Realm Object Server path to the Realm whose permission should be modified
+                    (e.g. "/path/to/realm"). Pass "*" to apply to all Realms managed by the user.
+ @param username    The username (often an email address) of the user who should be granted access
+                    to the Realm at `path`.
+ @param accessLevel The access level to grant.
+ */
+- (instancetype)initWithRealmPath:(NSString *)path
+                         username:(NSString *)username
+                      accessLevel:(RLMSyncAccessLevel)accessLevel;
+
 /**
 /**
  The identity of the user to whom this permission is granted, or "*"
  The identity of the user to whom this permission is granted, or "*"
- if all users are granted this permission.
+ if all users are granted this permission. Nil if the permission is
+ defined in terms of a key-value pair.
  */
  */
 @property (nullable, nonatomic, readonly) NSString *userId;
 @property (nullable, nonatomic, readonly) NSString *userId;
 
 
+/**
+ If the permission is defined in terms of a key-value pair, the key
+ describing the type of criterion used to determine what users the
+ permission applies to. Otherwise, nil.
+ */
+@property (nullable, nonatomic, readonly) NSString *key;
+
+/**
+ If the permission is defined in terms of a key-value pair, a string
+ describing the criterion value used to determine what users the
+ permission applies to. Otherwise, nil.
+ */
+@property (nullable, nonatomic, readonly) NSString *value;
+
 /**
 /**
  When this permission object was last updated.
  When this permission object was last updated.
  */
  */

+ 1 - 1
Libraries external/Realm/Realm.framework/Headers/RLMSyncSession.h

@@ -124,7 +124,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 
  Multiple blocks can be registered with the same session at once. Each block
  Multiple blocks can be registered with the same session at once. Each block
  will be invoked on a side queue devoted to progress notifications.
  will be invoked on a side queue devoted to progress notifications.
- 
+
  If the session has already received progress information from the
  If the session has already received progress information from the
  synchronization subsystem, the block will be called immediately. Otherwise, it
  synchronization subsystem, the block will be called immediately. Otherwise, it
  will be called as soon as progress information becomes available.
  will be called as soon as progress information becomes available.

+ 60 - 2
Libraries external/Realm/Realm.framework/Headers/RLMSyncUser.h

@@ -18,7 +18,9 @@
 
 
 #import <Foundation/Foundation.h>
 #import <Foundation/Foundation.h>
 
 
-@class RLMSyncUser, RLMSyncCredentials, RLMSyncPermissionValue, RLMSyncPermissionResults, RLMSyncSession, RLMRealm;
+#import "RLMSyncCredentials.h"
+
+@class RLMSyncUser, RLMSyncUserInfo, RLMSyncCredentials, RLMSyncPermissionValue, RLMSyncPermissionResults, RLMSyncSession, RLMRealm;
 
 
 /**
 /**
  The state of the user object.
  The state of the user object.
@@ -47,6 +49,10 @@ typedef void(^RLMPermissionStatusBlock)(NSError * _Nullable);
 /// Exactly one of the two arguments will be populated.
 /// Exactly one of the two arguments will be populated.
 typedef void(^RLMPermissionResultsBlock)(RLMSyncPermissionResults * _Nullable, NSError * _Nullable);
 typedef void(^RLMPermissionResultsBlock)(RLMSyncPermissionResults * _Nullable, NSError * _Nullable);
 
 
+/// A block type used to asynchronously report results of a user info retrieval.
+/// Exactly one of the two arguments will be populated.
+typedef void(^RLMRetrieveUserBlock)(RLMSyncUserInfo * _Nullable, NSError * _Nullable);
+
 NS_ASSUME_NONNULL_BEGIN
 NS_ASSUME_NONNULL_BEGIN
 
 
 /**
 /**
@@ -173,6 +179,23 @@ NS_SWIFT_UNAVAILABLE("Use the full version of this API.");
  */
  */
 - (void)changePassword:(NSString *)newPassword forUserID:(NSString *)userID completion:(RLMPasswordChangeStatusBlock)completion;
 - (void)changePassword:(NSString *)newPassword forUserID:(NSString *)userID completion:(RLMPasswordChangeStatusBlock)completion;
 
 
+#pragma mark - Administrator API
+
+/**
+ Given a Realm Object Server authentication provider and a provider identifier for a user
+ (for example, a username), look up and return user information for that user.
+
+ @param providerUserIdentity    The username or identity of the user as issued by the authentication provider.
+                                In most cases this is different from the Realm Object Server-issued identity.
+ @param provider                The authentication provider that manages the user whose information is desired.
+ @param completion              Completion block invoked when request has completed or failed.
+                                The callback will be invoked on a background queue provided
+                                by `NSURLSession`.
+ */
+- (void)retrieveInfoForUser:(NSString *)providerUserIdentity
+           identityProvider:(RLMIdentityProvider)provider
+                 completion:(RLMRetrieveUserBlock)completion;
+
 // This set of permissions APIs uses immutable `RLMSyncPermissionValue` objects to
 // This set of permissions APIs uses immutable `RLMSyncPermissionValue` objects to
 // retrieve and apply permissions. It is intended to replace the set of APIs which
 // retrieve and apply permissions. It is intended to replace the set of APIs which
 // directly access Realms and Realm model objects to work with permissions.
 // directly access Realms and Realm model objects to work with permissions.
@@ -245,6 +268,41 @@ NS_SWIFT_UNAVAILABLE("Use the full version of this API.");
 /// :nodoc:
 /// :nodoc:
 + (instancetype)new __attribute__((unavailable("RLMSyncUser cannot be created directly")));
 + (instancetype)new __attribute__((unavailable("RLMSyncUser cannot be created directly")));
 
 
-NS_ASSUME_NONNULL_END
+@end
+
+/**
+ A data object representing information about a user that was retrieved from a user lookup call.
+ */
+@interface RLMSyncUserInfo : NSObject
+
+/**
+ The authentication provider which manages the user represented by this user info instance.
+ */
+@property (nonatomic, readonly) RLMIdentityProvider provider;
+
+/**
+ The username or identity issued to this user by the authentication provider.
+ */
+@property (nonatomic, readonly) NSString *providerUserIdentity;
+
+/**
+ The identity issued to this user by the Realm Object Server.
+ */
+@property (nonatomic, readonly) NSString *identity;
+
+/**
+ Whether the user is flagged on the Realm Object Server as an administrator.
+ */
+@property (nonatomic, readonly) BOOL isAdmin;
+
+#pragma mark - Miscellaneous
+
+/// :nodoc:
+- (instancetype)init __attribute__((unavailable("RLMSyncUserInfo cannot be created directly")));
+
+/// :nodoc:
++ (instancetype)new __attribute__((unavailable("RLMSyncUserInfo cannot be created directly")));
 
 
 @end
 @end
+
+NS_ASSUME_NONNULL_END

+ 30 - 3
Libraries external/Realm/Realm.framework/Headers/RLMSyncUtil.h

@@ -29,6 +29,9 @@ extern NSString *const kRLMSyncPathOfRealmBackupCopyKey;
 /// A user info key for use with `RLMSyncErrorClientResetError`.
 /// A user info key for use with `RLMSyncErrorClientResetError`.
 extern NSString *const kRLMSyncInitiateClientResetBlockKey;
 extern NSString *const kRLMSyncInitiateClientResetBlockKey;
 
 
+/// A user info key for use with `RLMSyncErrorPermissionDeniedError`.
+extern NSString *const kRLMSyncInitiateDeleteRealmBlockKey;
+
 /**
 /**
  The error domain string for all SDK errors related to errors reported
  The error domain string for all SDK errors related to errors reported
  by the synchronization manager error handler, as well as general sync
  by the synchronization manager error handler, as well as general sync
@@ -56,7 +59,7 @@ typedef RLM_ERROR_ENUM(NSInteger, RLMSyncError, RLMSyncErrorDomain) {
     /**
     /**
      An error that indicates that the response received from the
      An error that indicates that the response received from the
      authentication server was malformed.
      authentication server was malformed.
-     
+
      @warning This error is deprecated, and has been replaced by
      @warning This error is deprecated, and has been replaced by
               `RLMSyncAuthErrorBadResponse`.
               `RLMSyncAuthErrorBadResponse`.
      */
      */
@@ -68,7 +71,7 @@ typedef RLM_ERROR_ENUM(NSInteger, RLMSyncError, RLMSyncErrorDomain) {
     /// An error that indicates a problem with a specific user.
     /// An error that indicates a problem with a specific user.
     RLMSyncErrorClientUserError         = 5,
     RLMSyncErrorClientUserError         = 5,
 
 
-    /** 
+    /**
      An error that indicates an internal, unrecoverable problem
      An error that indicates an internal, unrecoverable problem
      with the underlying synchronization engine.
      with the underlying synchronization engine.
      */
      */
@@ -95,7 +98,7 @@ typedef RLM_ERROR_ENUM(NSInteger, RLMSyncError, RLMSyncErrorDomain) {
      The client reset process can be initiated in one of two ways. The block provided in the
      The client reset process can be initiated in one of two ways. The block provided in the
      `userInfo` dictionary under `kRLMSyncInitiateClientResetBlockKey` can be called to
      `userInfo` dictionary under `kRLMSyncInitiateClientResetBlockKey` can be called to
      initiate the reset process. This block can be called any time after the error is
      initiate the reset process. This block can be called any time after the error is
-     received, but should only be called if and when your app closes and invalidates every
+     received, but should only be called after your app closes and invalidates every
      instance of the offending Realm on all threads (note that autorelease pools may make this
      instance of the offending Realm on all threads (note that autorelease pools may make this
      difficult to guarantee).
      difficult to guarantee).
 
 
@@ -118,6 +121,30 @@ typedef RLM_ERROR_ENUM(NSInteger, RLMSyncError, RLMSyncErrorDomain) {
      error domain.
      error domain.
      */
      */
     RLMSyncErrorUnderlyingAuthError     = 8,
     RLMSyncErrorUnderlyingAuthError     = 8,
+
+    /**
+     An error that indicates the user does not have permission to perform an operation
+     upon a synced Realm. For example, a user may receive this error if they attempt to
+     open a Realm they do not have at least read access to, or write to a Realm they only
+     have read access to.
+     
+     This error may also occur if a user incorrectly opens a Realm they have read-only
+     permissions to without using the `asyncOpen()` APIs.
+
+     A Realm that suffers a permission denied error is, by default, flagged so that its
+     local copy will be deleted the next time the application starts.
+     
+     The `userInfo` dictionary contains a block under the key
+     `kRLMSyncInitiateDeleteRealmBlockKey`, which can be used to request that the file be
+     deleted immediately instead. This block can be called any time after the error is
+     received to immediately delete the Realm file, but should only be called after your
+     app closes and invalidates every instance of the offending Realm on all threads (note
+     that autorelease pools may make this difficult to guarantee).
+
+     @warning It is strongly recommended that, if a Realm has encountered a permission denied
+              error, its files be deleted before attempting to re-open it.
+     */
+    RLMSyncErrorPermissionDeniedError   = 9,
 };
 };
 
 
 /// An error which is related to authentication to a Realm Object Server.
 /// An error which is related to authentication to a Realm Object Server.

BIN
Libraries external/Realm/Realm.framework/Info.plist


+ 4 - 2
Libraries external/Realm/Realm.framework/Modules/module.modulemap

@@ -7,15 +7,17 @@ framework module Realm {
     explicit module Private {
     explicit module Private {
         header "RLMAccessor.h"
         header "RLMAccessor.h"
         header "RLMArray_Private.h"
         header "RLMArray_Private.h"
+        header "RLMCollection_Private.h"
         header "RLMListBase.h"
         header "RLMListBase.h"
+        header "RLMObject_Private.h"
         header "RLMObjectBase_Dynamic.h"
         header "RLMObjectBase_Dynamic.h"
+        header "RLMObjectBase_Private.h"
         header "RLMObjectSchema_Private.h"
         header "RLMObjectSchema_Private.h"
         header "RLMObjectStore.h"
         header "RLMObjectStore.h"
-        header "RLMObject_Private.h"
         header "RLMOptionalBase.h"
         header "RLMOptionalBase.h"
         header "RLMProperty_Private.h"
         header "RLMProperty_Private.h"
-        header "RLMRealmConfiguration_Private.h"
         header "RLMRealm_Private.h"
         header "RLMRealm_Private.h"
+        header "RLMRealmConfiguration_Private.h"
         header "RLMResults_Private.h"
         header "RLMResults_Private.h"
         header "RLMSchema_Private.h"
         header "RLMSchema_Private.h"
         header "RLMSyncConfiguration_Private.h"
         header "RLMSyncConfiguration_Private.h"

+ 27 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMCollection_Private.h

@@ -0,0 +1,27 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2016 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMCollection.h>
+
+#import <Realm/RLMRealm.h>
+
+@protocol RLMFastEnumerable;
+
+NSArray *RLMCollectionValueForKey(id<RLMFastEnumerable> collection, NSString *key);
+void RLMCollectionSetValueForKey(id<RLMFastEnumerable> collection, NSString *key, id value);
+FOUNDATION_EXTERN NSString *RLMDescriptionWithMaxDepth(NSString *name, id<RLMCollection> collection, NSUInteger depth);

+ 28 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectBase_Private.h

@@ -0,0 +1,28 @@
+////////////////////////////////////////////////////////////////////////////
+//
+// Copyright 2017 Realm Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////
+
+#import <Realm/RLMObjectBase.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+// RLMObjectBase private
+@interface RLMObjectBase ()
++ (void)initializeLinkedObjectSchemas;
+@end
+
+NS_ASSUME_NONNULL_END

+ 4 - 4
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectSchema_Private.h

@@ -54,15 +54,15 @@ NS_ASSUME_NONNULL_BEGIN
  This method is useful only in specialized circumstances, for example, when accessing objects
  This method is useful only in specialized circumstances, for example, when accessing objects
  in a Realm produced externally. If you are simply building an app on Realm, it is not recommended
  in a Realm produced externally. If you are simply building an app on Realm, it is not recommended
  to use this method as an [RLMObjectSchema](RLMObjectSchema) is generated automatically for every [RLMObject](RLMObject) subclass.
  to use this method as an [RLMObjectSchema](RLMObjectSchema) is generated automatically for every [RLMObject](RLMObject) subclass.
- 
+
  Initialize an RLMObjectSchema with classname, objectClass, and an array of properties
  Initialize an RLMObjectSchema with classname, objectClass, and an array of properties
- 
+
  @warning This method is useful only in specialized circumstances.
  @warning This method is useful only in specialized circumstances.
- 
+
  @param objectClassName     The name of the class used to refer to objects of this type.
  @param objectClassName     The name of the class used to refer to objects of this type.
  @param objectClass         The Objective-C class used when creating instances of this type.
  @param objectClass         The Objective-C class used when creating instances of this type.
  @param properties          An array of RLMProperty instances describing the managed properties for this type.
  @param properties          An array of RLMProperty instances describing the managed properties for this type.
- 
+
  @return    An initialized instance of RLMObjectSchema.
  @return    An initialized instance of RLMObjectSchema.
  */
  */
 - (instancetype)initWithClassName:(NSString *)objectClassName objectClass:(Class)objectClass properties:(NSArray *)properties;
 - (instancetype)initWithClassName:(NSString *)objectClassName objectClass:(Class)objectClass properties:(NSArray *)properties;

+ 2 - 2
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObjectStore.h

@@ -58,14 +58,14 @@ id _Nullable RLMGetObject(RLMRealm *realm, NSString *objectClassName, id _Nullab
 RLMObjectBase *RLMCreateObjectInRealmWithValue(RLMRealm *realm, NSString *className,
 RLMObjectBase *RLMCreateObjectInRealmWithValue(RLMRealm *realm, NSString *className,
                                                id _Nullable value, bool createOrUpdate)
                                                id _Nullable value, bool createOrUpdate)
 NS_RETURNS_RETAINED;
 NS_RETURNS_RETAINED;
-    
+
 
 
 //
 //
 // Accessor Creation
 // Accessor Creation
 //
 //
 
 
 
 
-// switch List<> properties from being backed by unmanaged RLMArrays to RLMArrayLinkView
+// switch List<> properties from being backed by unmanaged RLMArrays to RLMManagedArray
 void RLMInitializeSwiftAccessorGenerics(RLMObjectBase *object);
 void RLMInitializeSwiftAccessorGenerics(RLMObjectBase *object);
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus

+ 11 - 1
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMObject_Private.h

@@ -81,6 +81,16 @@ typedef void (^RLMObjectNotificationCallback)(NSArray<NSString *> *_Nullable pro
                                               NSError *_Nullable error);
                                               NSError *_Nullable error);
 FOUNDATION_EXTERN RLMNotificationToken *RLMObjectAddNotificationBlock(RLMObjectBase *obj, RLMObjectNotificationCallback block);
 FOUNDATION_EXTERN RLMNotificationToken *RLMObjectAddNotificationBlock(RLMObjectBase *obj, RLMObjectNotificationCallback block);
 
 
+// Returns whether the class is a descendent of RLMObjectBase
+FOUNDATION_EXTERN BOOL RLMIsObjectOrSubclass(Class klass);
+
+// Returns whether the class is an indirect descendant of RLMObjectBase
+FOUNDATION_EXTERN BOOL RLMIsObjectSubclass(Class klass);
+
+// For unit testing purposes, allow an Objective-C class named FakeObject to also be used
+// as the base class of managed objects. This allows for testing invalid schemas.
+FOUNDATION_EXTERN void RLMSetTreatFakeObjectAsRLMObject(BOOL flag);
+
 // Get ObjectUil class for objc or swift
 // Get ObjectUil class for objc or swift
 FOUNDATION_EXTERN Class RLMObjectUtilClass(BOOL isSwift);
 FOUNDATION_EXTERN Class RLMObjectUtilClass(BOOL isSwift);
 
 
@@ -94,7 +104,7 @@ FOUNDATION_EXTERN const NSUInteger RLMDescriptionMaxDepth;
 + (nullable NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *)linkingObjectsPropertiesForClass:(Class)cls;
 + (nullable NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *)linkingObjectsPropertiesForClass:(Class)cls;
 
 
 + (nullable NSArray<NSString *> *)getGenericListPropertyNames:(id)obj;
 + (nullable NSArray<NSString *> *)getGenericListPropertyNames:(id)obj;
-+ (nullable NSDictionary<NSString *, NSString *> *)getLinkingObjectsProperties:(id)object;
++ (nullable NSDictionary<NSString *, NSDictionary<NSString *, NSString *> *> *)getLinkingObjectsProperties:(id)object;
 
 
 + (nullable NSDictionary<NSString *, NSNumber *> *)getOptionalProperties:(id)obj;
 + (nullable NSDictionary<NSString *, NSNumber *> *)getOptionalProperties:(id)obj;
 + (nullable NSArray<NSString *> *)requiredPropertiesForClass:(Class)cls;
 + (nullable NSArray<NSString *> *)requiredPropertiesForClass:(Class)cls;

+ 4 - 6
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMProperty_Private.h

@@ -24,7 +24,6 @@
 
 
 NS_ASSUME_NONNULL_BEGIN
 NS_ASSUME_NONNULL_BEGIN
 
 
-BOOL RLMPropertyTypeIsNullable(RLMPropertyType propertyType);
 BOOL RLMPropertyTypeIsComputed(RLMPropertyType propertyType);
 BOOL RLMPropertyTypeIsComputed(RLMPropertyType propertyType);
 FOUNDATION_EXTERN void RLMValidateSwiftPropertyName(NSString *name);
 FOUNDATION_EXTERN void RLMValidateSwiftPropertyName(NSString *name);
 
 
@@ -76,8 +75,7 @@ static inline NSString *RLMTypeToString(RLMPropertyType type) {
                                  instance:(RLMObjectBase *)objectInstance;
                                  instance:(RLMObjectBase *)objectInstance;
 
 
 - (instancetype)initSwiftListPropertyWithName:(NSString *)name
 - (instancetype)initSwiftListPropertyWithName:(NSString *)name
-                                         ivar:(Ivar)ivar
-                              objectClassName:(nullable NSString *)objectClassName;
+                                     instance:(id)object;
 
 
 - (instancetype)initSwiftOptionalPropertyWithName:(NSString *)name
 - (instancetype)initSwiftOptionalPropertyWithName:(NSString *)name
                                           indexed:(BOOL)indexed
                                           indexed:(BOOL)indexed
@@ -116,11 +114,11 @@ static inline NSString *RLMTypeToString(RLMPropertyType type) {
  This method is useful only in specialized circumstances, for example, in conjunction with
  This method is useful only in specialized circumstances, for example, in conjunction with
  +[RLMObjectSchema initWithClassName:objectClass:properties:]. If you are simply building an
  +[RLMObjectSchema initWithClassName:objectClass:properties:]. If you are simply building an
  app on Realm, it is not recommened to use this method.
  app on Realm, it is not recommened to use this method.
- 
+
  Initialize an RLMProperty
  Initialize an RLMProperty
- 
+
  @warning This method is useful only in specialized circumstances.
  @warning This method is useful only in specialized circumstances.
- 
+
  @param name            The property name.
  @param name            The property name.
  @param type            The property type.
  @param type            The property type.
  @param objectClassName The object type used for Object and Array types.
  @param objectClassName The object type used for Object and Array types.

+ 4 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSchema_Private.h

@@ -44,6 +44,10 @@ NS_ASSUME_NONNULL_BEGIN
 // schema based upon all currently registered object classes
 // schema based upon all currently registered object classes
 + (instancetype)partialSharedSchema;
 + (instancetype)partialSharedSchema;
 
 
+// private schema based upon all currently registered object classes.
+// includes classes that are excluded from the default schema.
++ (instancetype)partialPrivateSharedSchema;
+
 // class for string
 // class for string
 + (nullable Class)classForString:(NSString *)className;
 + (nullable Class)classForString:(NSString *)className;
 
 

+ 3 - 0
Libraries external/Realm/Realm.framework/PrivateHeaders/RLMSyncUtil_Private.h

@@ -25,6 +25,7 @@
 typedef NS_ENUM(NSUInteger, RLMSyncSystemErrorKind) {
 typedef NS_ENUM(NSUInteger, RLMSyncSystemErrorKind) {
     // Specific
     // Specific
     RLMSyncSystemErrorKindClientReset,
     RLMSyncSystemErrorKindClientReset,
+    RLMSyncSystemErrorKindPermissionDenied,
     // General
     // General
     RLMSyncSystemErrorKindClient,
     RLMSyncSystemErrorKindClient,
     RLMSyncSystemErrorKindConnection,
     RLMSyncSystemErrorKindConnection,
@@ -57,7 +58,9 @@ extern NSString *const kRLMSyncErrorStatusCodeKey;
 extern NSString *const kRLMSyncIdentityKey;
 extern NSString *const kRLMSyncIdentityKey;
 extern NSString *const kRLMSyncPasswordKey;
 extern NSString *const kRLMSyncPasswordKey;
 extern NSString *const kRLMSyncPathKey;
 extern NSString *const kRLMSyncPathKey;
+extern NSString *const kRLMSyncTokenKey;
 extern NSString *const kRLMSyncProviderKey;
 extern NSString *const kRLMSyncProviderKey;
+extern NSString *const kRLMSyncProviderIDKey;
 extern NSString *const kRLMSyncRegisterKey;
 extern NSString *const kRLMSyncRegisterKey;
 extern NSString *const kRLMSyncUnderlyingErrorKey;
 extern NSString *const kRLMSyncUnderlyingErrorKey;
 
 

BIN
Libraries external/Realm/Realm.framework/Realm


Dosya farkı çok büyük olduğundan ihmal edildi
+ 254 - 220
Libraries external/Realm/RealmSwift.framework/0B1BA92F-07F7-3E55-843F-3D90666371D7.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 631 - 487
Libraries external/Realm/RealmSwift.framework/2402BC3D-6D1C-3FAE-A019-486C6947B517.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 225 - 237
Libraries external/Realm/RealmSwift.framework/36DC9203-E974-342F-97CD-408C41782BDD.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 630 - 485
Libraries external/Realm/RealmSwift.framework/382E12C8-AA8F-374F-B12C-5BF974436B8D.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 225 - 237
Libraries external/Realm/RealmSwift.framework/46647090-26A8-3096-AE67-A3BA4635E65B.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 631 - 487
Libraries external/Realm/RealmSwift.framework/585CE4DD-AC68-3D41-80EC-A753ECC254D0.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 10 - 4
Libraries external/Realm/RealmSwift.framework/6B15B9E1-DBC6-3D97-A8C4-B431FC22A2E8.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 246 - 214
Libraries external/Realm/RealmSwift.framework/76D7D231-6DB0-32AE-8968-063313662ACF.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 30 - 50
Libraries external/Realm/RealmSwift.framework/8EE8ADCC-6401-388C-B28F-86DD302DD5C7.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 237 - 195
Libraries external/Realm/RealmSwift.framework/91B537E0-3CE4-3D7D-AC87-536A5341BE55.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 254 - 220
Libraries external/Realm/RealmSwift.framework/C9077E03-D54F-3B58-97DE-9F51841B5F71.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 630 - 485
Libraries external/Realm/RealmSwift.framework/D06F7022-6F9E-3C83-B3C1-EB2771B6AEA4.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 237 - 194
Libraries external/Realm/RealmSwift.framework/D1AAD4ED-E539-3A05-A21B-ADF62F2B9E60.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 242 - 237
Libraries external/Realm/RealmSwift.framework/DCE593B2-4B41-3EC1-9543-930EF55B8018.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 630 - 485
Libraries external/Realm/RealmSwift.framework/F62230D8-6DCD-32B5-BFB3-F0205F5B89C0.bcsymbolmap


Dosya farkı çok büyük olduğundan ihmal edildi
+ 631 - 487
Libraries external/Realm/RealmSwift.framework/F7FB8F75-4353-31F6-9FFB-A10D16E94755.bcsymbolmap


BIN
Libraries external/Realm/RealmSwift.framework/Info.plist


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm.swiftdoc


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm.swiftmodule


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftdoc


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/arm64.swiftmodule


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftdoc


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/i386.swiftmodule


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftdoc


BIN
Libraries external/Realm/RealmSwift.framework/Modules/RealmSwift.swiftmodule/x86_64.swiftmodule


BIN
Libraries external/Realm/RealmSwift.framework/RealmSwift


+ 473 - 36
Nextcloud.xcodeproj/project.pbxproj

@@ -149,14 +149,53 @@
 		F725437C1E12A44A009BF4C2 /* CCSection.m in Sources */ = {isa = PBXBuildFile; fileRef = F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */; };
 		F725437C1E12A44A009BF4C2 /* CCSection.m in Sources */ = {isa = PBXBuildFile; fileRef = F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */; };
 		F72AAECA1E5C60C700BB17E1 /* AHKActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */; };
 		F72AAECA1E5C60C700BB17E1 /* AHKActionSheet.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */; };
 		F72AAECB1E5C60C700BB17E1 /* AHKActionSheetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */; };
 		F72AAECB1E5C60C700BB17E1 /* AHKActionSheetViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */; };
-		F72AAECC1E5C60C700BB17E1 /* UIImage+AHKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC71E5C60C700BB17E1 /* UIImage+AHKAdditions.m */; };
-		F72AAECD1E5C60C700BB17E1 /* UIWindow+AHKAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = F72AAEC91E5C60C700BB17E1 /* UIWindow+AHKAdditions.m */; };
 		F72C63891DC14B0400FA5ED5 /* libMagicalRecord.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7B61E9B1DC13C20009E938F /* libMagicalRecord.a */; };
 		F72C63891DC14B0400FA5ED5 /* libMagicalRecord.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7B61E9B1DC13C20009E938F /* libMagicalRecord.a */; };
 		F732B3371E8045A1002B7D75 /* SwiftWebVC.strings in Resources */ = {isa = PBXBuildFile; fileRef = F732B3351E8045A1002B7D75 /* SwiftWebVC.strings */; };
 		F732B3371E8045A1002B7D75 /* SwiftWebVC.strings in Resources */ = {isa = PBXBuildFile; fileRef = F732B3351E8045A1002B7D75 /* SwiftWebVC.strings */; };
 		F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
 		F732BA061D76CE1500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
 		F732BA0B1D76DBA500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
 		F732BA0B1D76DBA500E9878B /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
 		F734E5891F019D860060CB77 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
 		F734E5891F019D860060CB77 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
 		F734E5921F019D870060CB77 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
 		F734E5921F019D870060CB77 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
+		F73B4EEE1F470D9100BBEE4B /* Big5Freq.tab in Resources */ = {isa = PBXBuildFile; fileRef = F73B4EAD1F470D9100BBEE4B /* Big5Freq.tab */; };
+		F73B4EEF1F470D9100BBEE4B /* CharDistribution.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EAE1F470D9100BBEE4B /* CharDistribution.cpp */; };
+		F73B4EF01F470D9100BBEE4B /* CMakeLists.txt in Resources */ = {isa = PBXBuildFile; fileRef = F73B4EB01F470D9100BBEE4B /* CMakeLists.txt */; };
+		F73B4EF11F470D9100BBEE4B /* EUCKRFreq.tab in Resources */ = {isa = PBXBuildFile; fileRef = F73B4EB11F470D9100BBEE4B /* EUCKRFreq.tab */; };
+		F73B4EF21F470D9100BBEE4B /* EUCTWFreq.tab in Resources */ = {isa = PBXBuildFile; fileRef = F73B4EB21F470D9100BBEE4B /* EUCTWFreq.tab */; };
+		F73B4EF31F470D9100BBEE4B /* GB2312Freq.tab in Resources */ = {isa = PBXBuildFile; fileRef = F73B4EB31F470D9100BBEE4B /* GB2312Freq.tab */; };
+		F73B4EF41F470D9100BBEE4B /* JISFreq.tab in Resources */ = {isa = PBXBuildFile; fileRef = F73B4EB41F470D9100BBEE4B /* JISFreq.tab */; };
+		F73B4EF51F470D9100BBEE4B /* JpCntx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EB51F470D9100BBEE4B /* JpCntx.cpp */; };
+		F73B4EF61F470D9100BBEE4B /* LangArabicModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EB81F470D9100BBEE4B /* LangArabicModel.cpp */; };
+		F73B4EF71F470D9100BBEE4B /* LangBulgarianModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EB91F470D9100BBEE4B /* LangBulgarianModel.cpp */; };
+		F73B4EF81F470D9100BBEE4B /* LangDanishModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EBA1F470D9100BBEE4B /* LangDanishModel.cpp */; };
+		F73B4EF91F470D9100BBEE4B /* LangEsperantoModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EBB1F470D9100BBEE4B /* LangEsperantoModel.cpp */; };
+		F73B4EFA1F470D9100BBEE4B /* LangFrenchModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EBC1F470D9100BBEE4B /* LangFrenchModel.cpp */; };
+		F73B4EFB1F470D9100BBEE4B /* LangGermanModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EBD1F470D9100BBEE4B /* LangGermanModel.cpp */; };
+		F73B4EFC1F470D9100BBEE4B /* LangGreekModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EBE1F470D9100BBEE4B /* LangGreekModel.cpp */; };
+		F73B4EFD1F470D9100BBEE4B /* LangHebrewModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EBF1F470D9100BBEE4B /* LangHebrewModel.cpp */; };
+		F73B4EFE1F470D9100BBEE4B /* LangHungarianModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EC01F470D9100BBEE4B /* LangHungarianModel.cpp */; };
+		F73B4EFF1F470D9100BBEE4B /* LangRussianModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EC11F470D9100BBEE4B /* LangRussianModel.cpp */; };
+		F73B4F001F470D9100BBEE4B /* LangSpanishModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EC21F470D9100BBEE4B /* LangSpanishModel.cpp */; };
+		F73B4F011F470D9100BBEE4B /* LangThaiModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EC31F470D9100BBEE4B /* LangThaiModel.cpp */; };
+		F73B4F021F470D9100BBEE4B /* LangTurkishModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EC41F470D9100BBEE4B /* LangTurkishModel.cpp */; };
+		F73B4F031F470D9100BBEE4B /* LangVietnameseModel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EC51F470D9100BBEE4B /* LangVietnameseModel.cpp */; };
+		F73B4F041F470D9100BBEE4B /* nsBig5Prober.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EC61F470D9100BBEE4B /* nsBig5Prober.cpp */; };
+		F73B4F051F470D9100BBEE4B /* nsCharSetProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EC81F470D9100BBEE4B /* nsCharSetProber.cpp */; };
+		F73B4F061F470D9100BBEE4B /* nsEscCharsetProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4ECC1F470D9100BBEE4B /* nsEscCharsetProber.cpp */; };
+		F73B4F071F470D9100BBEE4B /* nsEscSM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4ECE1F470D9100BBEE4B /* nsEscSM.cpp */; };
+		F73B4F081F470D9100BBEE4B /* nsEUCJPProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4ECF1F470D9100BBEE4B /* nsEUCJPProber.cpp */; };
+		F73B4F091F470D9100BBEE4B /* nsEUCKRProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4ED11F470D9100BBEE4B /* nsEUCKRProber.cpp */; };
+		F73B4F0A1F470D9100BBEE4B /* nsEUCTWProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4ED31F470D9100BBEE4B /* nsEUCTWProber.cpp */; };
+		F73B4F0B1F470D9100BBEE4B /* nsGB2312Prober.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4ED51F470D9100BBEE4B /* nsGB2312Prober.cpp */; };
+		F73B4F0C1F470D9100BBEE4B /* nsHebrewProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4ED71F470D9100BBEE4B /* nsHebrewProber.cpp */; };
+		F73B4F0D1F470D9100BBEE4B /* nsLatin1Prober.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4ED91F470D9100BBEE4B /* nsLatin1Prober.cpp */; };
+		F73B4F0E1F470D9100BBEE4B /* nsMBCSGroupProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EDB1F470D9100BBEE4B /* nsMBCSGroupProber.cpp */; };
+		F73B4F0F1F470D9100BBEE4B /* nsMBCSSM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EDD1F470D9100BBEE4B /* nsMBCSSM.cpp */; };
+		F73B4F101F470D9100BBEE4B /* nsSBCharSetProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EDF1F470D9100BBEE4B /* nsSBCharSetProber.cpp */; };
+		F73B4F111F470D9100BBEE4B /* nsSBCSGroupProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EE11F470D9100BBEE4B /* nsSBCSGroupProber.cpp */; };
+		F73B4F121F470D9100BBEE4B /* nsSJISProber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EE31F470D9100BBEE4B /* nsSJISProber.cpp */; };
+		F73B4F131F470D9100BBEE4B /* nsUniversalDetector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EE51F470D9100BBEE4B /* nsUniversalDetector.cpp */; };
+		F73B4F141F470D9100BBEE4B /* nsUTF8Prober.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EE71F470D9100BBEE4B /* nsUTF8Prober.cpp */; };
+		F73B4F151F470D9100BBEE4B /* symbols.cmake in Resources */ = {isa = PBXBuildFile; fileRef = F73B4EEA1F470D9100BBEE4B /* symbols.cmake */; };
+		F73B4F171F470D9100BBEE4B /* uchardet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F73B4EEC1F470D9100BBEE4B /* uchardet.cpp */; };
 		F73B4F791E8D3BF800A97F07 /* CCMainTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73B4F781E8D3BF800A97F07 /* CCMainTabBarController.swift */; };
 		F73B4F791E8D3BF800A97F07 /* CCMainTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73B4F781E8D3BF800A97F07 /* CCMainTabBarController.swift */; };
 		F73C002F1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.m in Sources */ = {isa = PBXBuildFile; fileRef = F73C002E1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.m */; };
 		F73C002F1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.m in Sources */ = {isa = PBXBuildFile; fileRef = F73C002E1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.m */; };
 		F73CC0691E813DFF006E3047 /* BKPasscodeDummyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0591E813DFF006E3047 /* BKPasscodeDummyViewController.m */; };
 		F73CC0691E813DFF006E3047 /* BKPasscodeDummyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0591E813DFF006E3047 /* BKPasscodeDummyViewController.m */; };
@@ -186,6 +225,8 @@
 		F73CCE261DC13788007E38D8 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
 		F73CCE261DC13788007E38D8 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
 		F73CCE301DC13798007E38D8 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
 		F73CCE301DC13798007E38D8 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
 		F73CCE321DC13798007E38D8 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
 		F73CCE321DC13798007E38D8 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
+		F73D71621F2673C200E233EB /* NCText.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73D71611F2673C200E233EB /* NCText.swift */; };
+		F73D71641F2674A400E233EB /* NCText.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F73D71631F2674A400E233EB /* NCText.storyboard */; };
 		F73F537F1E929C8500F8678D /* CCMore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73F537E1E929C8500F8678D /* CCMore.swift */; };
 		F73F537F1E929C8500F8678D /* CCMore.swift in Sources */ = {isa = PBXBuildFile; fileRef = F73F537E1E929C8500F8678D /* CCMore.swift */; };
 		F74344171E1264EE001CC831 /* DocumentPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74344161E1264EE001CC831 /* DocumentPickerViewController.swift */; };
 		F74344171E1264EE001CC831 /* DocumentPickerViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74344161E1264EE001CC831 /* DocumentPickerViewController.swift */; };
 		F74344251E1264EE001CC831 /* FileProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74344241E1264EE001CC831 /* FileProvider.swift */; };
 		F74344251E1264EE001CC831 /* FileProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = F74344241E1264EE001CC831 /* FileProvider.swift */; };
@@ -423,6 +464,7 @@
 		F7B1FBC91E72E3D1001781FE /* SwiftWebVCActivityChrome.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B1FBC21E72E3D1001781FE /* SwiftWebVCActivityChrome.swift */; };
 		F7B1FBC91E72E3D1001781FE /* SwiftWebVCActivityChrome.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B1FBC21E72E3D1001781FE /* SwiftWebVCActivityChrome.swift */; };
 		F7B1FBCA1E72E3D1001781FE /* SwiftWebVCActivitySafari.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B1FBC31E72E3D1001781FE /* SwiftWebVCActivitySafari.swift */; };
 		F7B1FBCA1E72E3D1001781FE /* SwiftWebVCActivitySafari.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B1FBC31E72E3D1001781FE /* SwiftWebVCActivitySafari.swift */; };
 		F7B3A4EE1E97818A000DACE8 /* CCLoginWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B3A4ED1E97818A000DACE8 /* CCLoginWeb.swift */; };
 		F7B3A4EE1E97818A000DACE8 /* CCLoginWeb.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7B3A4ED1E97818A000DACE8 /* CCLoginWeb.swift */; };
+		F7B4F1CB1F44356F00B53B42 /* NCUchardet.m in Sources */ = {isa = PBXBuildFile; fileRef = F7B4F1C81F44356F00B53B42 /* NCUchardet.m */; };
 		F7BAADC51ED5A87C00B7EAD4 /* CCCoreData.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */; };
 		F7BAADC51ED5A87C00B7EAD4 /* CCCoreData.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */; };
 		F7BAADC61ED5A87C00B7EAD4 /* CCCoreData.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */; };
 		F7BAADC61ED5A87C00B7EAD4 /* CCCoreData.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */; };
 		F7BAADC71ED5A87C00B7EAD4 /* CCCoreData.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */; };
 		F7BAADC71ED5A87C00B7EAD4 /* CCCoreData.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */; };
@@ -450,6 +492,90 @@
 		F7BAADFF1ED5B2A500B7EAD4 /* TableLocalFile+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADFE1ED5B2A500B7EAD4 /* TableLocalFile+CoreDataClass.m */; };
 		F7BAADFF1ED5B2A500B7EAD4 /* TableLocalFile+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADFE1ED5B2A500B7EAD4 /* TableLocalFile+CoreDataClass.m */; };
 		F7BB14961D5B62C000ECEE68 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63061D5B3467004E2AA5 /* libcrypto.a */; };
 		F7BB14961D5B62C000ECEE68 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63061D5B3467004E2AA5 /* libcrypto.a */; };
 		F7BB14971D5B62C000ECEE68 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63071D5B3467004E2AA5 /* libssl.a */; };
 		F7BB14971D5B62C000ECEE68 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63071D5B3467004E2AA5 /* libssl.a */; };
+		F7BB50A31F2236C500C47094 /* CCGlobal.m in Sources */ = {isa = PBXBuildFile; fileRef = F7C8C1911B482CEA0048180E /* CCGlobal.m */; };
+		F7BB50AC1F2236CD00C47094 /* cryptocloud.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = F78088E51DD3A1DB005C5A7C /* cryptocloud.xcdatamodeld */; };
+		F7BB50AD1F2236D100C47094 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F7F67BB81A24D27800EE80DA /* Images.xcassets */; };
+		F7BB50AE1F2236E900C47094 /* Custom.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F700222B1EC479840080073F /* Custom.xcassets */; };
+		F7BB50AF1F22370300C47094 /* NCManageDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB51ED5A87C00B7EAD4 /* NCManageDatabase.swift */; };
+		F7BB50B01F22370600C47094 /* NCDatabase.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB41ED5A87C00B7EAD4 /* NCDatabase.swift */; };
+		F7BB50B11F22370C00C47094 /* CCCoreData.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */; };
+		F7BB50B21F22371300C47094 /* TableAccount+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB71ED5A87C00B7EAD4 /* TableAccount+CoreDataClass.m */; };
+		F7BB50B31F22371600C47094 /* TableAccount+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADB91ED5A87C00B7EAD4 /* TableAccount+CoreDataProperties.m */; };
+		F7BB50B41F22371900C47094 /* TableCertificates+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADBB1ED5A87C00B7EAD4 /* TableCertificates+CoreDataClass.m */; };
+		F7BB50B51F22371C00C47094 /* TableCertificates+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADBD1ED5A87C00B7EAD4 /* TableCertificates+CoreDataProperties.m */; };
+		F7BB50B61F22372000C47094 /* TableDirectory+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADBF1ED5A87C00B7EAD4 /* TableDirectory+CoreDataClass.m */; };
+		F7BB50B71F22372300C47094 /* TableDirectory+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADC11ED5A87C00B7EAD4 /* TableDirectory+CoreDataProperties.m */; };
+		F7BB50B81F22372600C47094 /* TableLocalFile+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADFE1ED5B2A500B7EAD4 /* TableLocalFile+CoreDataClass.m */; };
+		F7BB50B91F22372900C47094 /* TableLocalFile+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BAADC41ED5A87C00B7EAD4 /* TableLocalFile+CoreDataProperties.m */; };
+		F7BB50BA1F22374A00C47094 /* CCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F732BA041D76CE1500E9878B /* CCNetworking.m */; };
+		F7BB50BB1F22374E00C47094 /* OCNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = F74D3DBE1BAC1941000BAE4B /* OCNetworking.m */; };
+		F7BB50BC1F22375D00C47094 /* CCBKPasscode.m in Sources */ = {isa = PBXBuildFile; fileRef = F7FE125D1BAC03FB0041924B /* CCBKPasscode.m */; };
+		F7BB50BD1F22376000C47094 /* CCCertificate.m in Sources */ = {isa = PBXBuildFile; fileRef = F7F801011D98205A007537BC /* CCCertificate.m */; };
+		F7BB50BE1F22376300C47094 /* CCCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = F7FE125F1BAC03FB0041924B /* CCCrypto.m */; };
+		F7BB50BF1F22378800C47094 /* CCExifGeo.m in Sources */ = {isa = PBXBuildFile; fileRef = F7A54C351C6267B500E2C8BF /* CCExifGeo.m */; };
+		F7BB50C01F22378B00C47094 /* CCError.m in Sources */ = {isa = PBXBuildFile; fileRef = F76C3B881C638A4C00DC4301 /* CCError.m */; };
+		F7BB50C11F22378E00C47094 /* CCHud.m in Sources */ = {isa = PBXBuildFile; fileRef = F7514EDB1C7B1336008F3338 /* CCHud.m */; };
+		F7BB50C21F22379100C47094 /* CCGraphics.m in Sources */ = {isa = PBXBuildFile; fileRef = F76C3B841C6388BC00DC4301 /* CCGraphics.m */; };
+		F7BB50C31F22379400C47094 /* CCUtility.m in Sources */ = {isa = PBXBuildFile; fileRef = F7053E3D1C639DF500741EA5 /* CCUtility.m */; };
+		F7BB50C41F22379800C47094 /* NSString+TruncateToWidth.m in Sources */ = {isa = PBXBuildFile; fileRef = F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */; };
+		F7BB50C51F22379B00C47094 /* NSNotificationCenter+MainThread.m in Sources */ = {isa = PBXBuildFile; fileRef = F78071081EDAB65800EAFFF6 /* NSNotificationCenter+MainThread.m */; };
+		F7BB50C61F22383D00C47094 /* BKPasscodeView.strings in Resources */ = {isa = PBXBuildFile; fileRef = F72B60911A24F00B004EF66F /* BKPasscodeView.strings */; };
+		F7BB50C71F22384100C47094 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7E70DE91A24DE4100E1B66A /* Localizable.strings */; };
+		F7BB50C81F22384700C47094 /* Error.strings in Resources */ = {isa = PBXBuildFile; fileRef = F7B381BF1C074E3E004693F8 /* Error.strings */; };
+		F7BB50C91F22386400C47094 /* OCActivity.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022671EC4C9100080073F /* OCActivity.m */; };
+		F7BB50CA1F22386700C47094 /* OCCapabilities.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022691EC4C9100080073F /* OCCapabilities.m */; };
+		F7BB50CB1F22386900C47094 /* OCCommunication.m in Sources */ = {isa = PBXBuildFile; fileRef = F700226B1EC4C9100080073F /* OCCommunication.m */; };
+		F7BB50CC1F22387900C47094 /* OCExternalSites.m in Sources */ = {isa = PBXBuildFile; fileRef = F700226E1EC4C9100080073F /* OCExternalSites.m */; };
+		F7BB50CD1F22387C00C47094 /* OCFileDto.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022701EC4C9100080073F /* OCFileDto.m */; };
+		F7BB50CE1F22388000C47094 /* OCNotifications.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022731EC4C9100080073F /* OCNotifications.m */; };
+		F7BB50CF1F22388300C47094 /* OCNotificationsAction.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022751EC4C9100080073F /* OCNotificationsAction.m */; };
+		F7BB50D01F22388600C47094 /* OCRichObjectStrings.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022771EC4C9100080073F /* OCRichObjectStrings.m */; };
+		F7BB50D11F22388900C47094 /* OCSharedDto.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022791EC4C9100080073F /* OCSharedDto.m */; };
+		F7BB50D21F22388B00C47094 /* OCShareUser.m in Sources */ = {isa = PBXBuildFile; fileRef = F700227B1EC4C9100080073F /* OCShareUser.m */; };
+		F7BB50D31F22388E00C47094 /* OCUserProfile.m in Sources */ = {isa = PBXBuildFile; fileRef = F700227D1EC4C9100080073F /* OCUserProfile.m */; };
+		F7BB50D41F22389300C47094 /* NSDate+ISO8601.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022801EC4C9100080073F /* NSDate+ISO8601.m */; };
+		F7BB50D51F22389600C47094 /* NSDate+RFC1123.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022821EC4C9100080073F /* NSDate+RFC1123.m */; };
+		F7BB50D61F22389900C47094 /* OCHTTPRequestOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022841EC4C9100080073F /* OCHTTPRequestOperation.m */; };
+		F7BB50D71F22389C00C47094 /* OCWebDAVClient.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022861EC4C9100080073F /* OCWebDAVClient.m */; };
+		F7BB50D81F2238A000C47094 /* OCXMLListParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022891EC4C9100080073F /* OCXMLListParser.m */; };
+		F7BB50D91F2238A300C47094 /* OCXMLParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F700228B1EC4C9100080073F /* OCXMLParser.m */; };
+		F7BB50DA1F2238A600C47094 /* OCXMLServerErrorsParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F700228D1EC4C9100080073F /* OCXMLServerErrorsParser.m */; };
+		F7BB50DB1F2238A900C47094 /* OCXMLShareByLinkParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F700228F1EC4C9100080073F /* OCXMLShareByLinkParser.m */; };
+		F7BB50DC1F2238AC00C47094 /* OCXMLSharedParser.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022911EC4C9100080073F /* OCXMLSharedParser.m */; };
+		F7BB50DD1F2238B100C47094 /* NSString+Encode.m in Sources */ = {isa = PBXBuildFile; fileRef = F700229D1EC4C9100080073F /* NSString+Encode.m */; };
+		F7BB50DE1F2238B700C47094 /* UtilsFramework.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022A01EC4C9100080073F /* UtilsFramework.m */; };
+		F7BB50DF1F2238C700C47094 /* AFHTTPSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F700225A1EC4C9100080073F /* AFHTTPSessionManager.m */; };
+		F7BB50E01F2238CA00C47094 /* AFNetworkReachabilityManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F700225D1EC4C9100080073F /* AFNetworkReachabilityManager.m */; };
+		F7BB50E11F2238CD00C47094 /* AFSecurityPolicy.m in Sources */ = {isa = PBXBuildFile; fileRef = F700225F1EC4C9100080073F /* AFSecurityPolicy.m */; };
+		F7BB50E21F2238D000C47094 /* AFURLRequestSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022611EC4C9100080073F /* AFURLRequestSerialization.m */; };
+		F7BB50E31F2238D200C47094 /* AFURLResponseSerialization.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022631EC4C9100080073F /* AFURLResponseSerialization.m */; };
+		F7BB50E41F2238D500C47094 /* AFURLSessionManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F70022651EC4C9100080073F /* AFURLSessionManager.m */; };
+		F7BB50E51F2238E400C47094 /* AESCrypt.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02AB1C889183008DAB36 /* AESCrypt.m */; };
+		F7BB50E61F2238E700C47094 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02AD1C889183008DAB36 /* NSData+Base64.m */; };
+		F7BB50E71F2238EA00C47094 /* NSData+CommonCrypto.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02AF1C889183008DAB36 /* NSData+CommonCrypto.m */; };
+		F7BB50E81F2238ED00C47094 /* NSString+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02B11C889183008DAB36 /* NSString+Base64.m */; };
+		F7BB50E91F2238F500C47094 /* AFViewShaker.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F02B41C889183008DAB36 /* AFViewShaker.m */; };
+		F7BB50EA1F2238FB00C47094 /* UIScrollView+EmptyDataSet.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE241DC13788007E38D8 /* UIScrollView+EmptyDataSet.m */; };
+		F7BB50EB1F22391000C47094 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F04841C889183008DAB36 /* MBProgressHUD.m */; };
+		F7BB50EC1F22394100C47094 /* Realm.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7DFE24F1EBDC3A400CF5202 /* Realm.framework */; };
+		F7BB50ED1F22394400C47094 /* RealmSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7DFE2501EBDC3A400CF5202 /* RealmSwift.framework */; };
+		F7BB50EE1F22394B00C47094 /* RNCryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05351C889184008DAB36 /* RNCryptor.m */; };
+		F7BB50EF1F22394E00C47094 /* RNCryptorEngine.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05371C889184008DAB36 /* RNCryptorEngine.m */; };
+		F7BB50F01F22395100C47094 /* RNDecryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05391C889184008DAB36 /* RNDecryptor.m */; };
+		F7BB50F11F22395400C47094 /* RNEncryptor.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F053B1C889184008DAB36 /* RNEncryptor.m */; };
+		F7BB50F21F22395D00C47094 /* UICKeyChainStore.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */; };
+		F7BB50F31F22396300C47094 /* UIImage+animatedGIF.m in Sources */ = {isa = PBXBuildFile; fileRef = F70F05581C889184008DAB36 /* UIImage+animatedGIF.m */; };
+		F7BB50F41F2239B600C47094 /* BKPasscodeDummyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0591E813DFF006E3047 /* BKPasscodeDummyViewController.m */; };
+		F7BB50F51F2239B900C47094 /* BKPasscodeField.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC05B1E813DFF006E3047 /* BKPasscodeField.m */; };
+		F7BB50F61F2239BC00C47094 /* BKPasscodeInputView.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC05D1E813DFF006E3047 /* BKPasscodeInputView.m */; };
+		F7BB50F71F2239BF00C47094 /* BKPasscodeLockScreenManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC05F1E813DFF006E3047 /* BKPasscodeLockScreenManager.m */; };
+		F7BB50F81F2239C400C47094 /* BKPasscodeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0621E813DFF006E3047 /* BKPasscodeViewController.m */; };
+		F7BB50F91F2239C800C47094 /* BKShiftingView.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0641E813DFF006E3047 /* BKShiftingView.m */; };
+		F7BB50FA1F2239CB00C47094 /* BKTouchIDManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0661E813DFF006E3047 /* BKTouchIDManager.m */; };
+		F7BB50FB1F2239CE00C47094 /* BKTouchIDSwitchView.m in Sources */ = {isa = PBXBuildFile; fileRef = F73CC0681E813DFF006E3047 /* BKTouchIDSwitchView.m */; };
+		F7BB50FC1F223A3B00C47094 /* libssl.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63071D5B3467004E2AA5 /* libssl.a */; };
+		F7BB50FD1F223A3D00C47094 /* libcrypto.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F70A63061D5B3467004E2AA5 /* libcrypto.a */; };
+		F7BB50FE1F223A5400C47094 /* libMagicalRecord.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F7B61E9B1DC13C20009E938F /* libMagicalRecord.a */; };
 		F7BE6E2F1D2D5C3B00106933 /* CCQuickActions.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BE6E2C1D2D5C3B00106933 /* CCQuickActions.m */; };
 		F7BE6E2F1D2D5C3B00106933 /* CCQuickActions.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BE6E2C1D2D5C3B00106933 /* CCQuickActions.m */; };
 		F7BF1B431D51E893000854F6 /* CCLogin.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BF1B401D51E893000854F6 /* CCLogin.m */; };
 		F7BF1B431D51E893000854F6 /* CCLogin.m in Sources */ = {isa = PBXBuildFile; fileRef = F7BF1B401D51E893000854F6 /* CCLogin.m */; };
 		F7C525A01E3B48B700FFE02C /* CCNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7C5259F1E3B48B700FFE02C /* CCNotification.swift */; };
 		F7C525A01E3B48B700FFE02C /* CCNotification.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7C5259F1E3B48B700FFE02C /* CCNotification.swift */; };
@@ -986,15 +1112,74 @@
 		F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AHKActionSheet.m; sourceTree = "<group>"; };
 		F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AHKActionSheet.m; sourceTree = "<group>"; };
 		F72AAEC41E5C60C700BB17E1 /* AHKActionSheetViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AHKActionSheetViewController.h; sourceTree = "<group>"; };
 		F72AAEC41E5C60C700BB17E1 /* AHKActionSheetViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AHKActionSheetViewController.h; sourceTree = "<group>"; };
 		F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AHKActionSheetViewController.m; sourceTree = "<group>"; };
 		F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AHKActionSheetViewController.m; sourceTree = "<group>"; };
-		F72AAEC61E5C60C700BB17E1 /* UIImage+AHKAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImage+AHKAdditions.h"; sourceTree = "<group>"; };
-		F72AAEC71E5C60C700BB17E1 /* UIImage+AHKAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+AHKAdditions.m"; sourceTree = "<group>"; };
-		F72AAEC81E5C60C700BB17E1 /* UIWindow+AHKAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIWindow+AHKAdditions.h"; sourceTree = "<group>"; };
-		F72AAEC91E5C60C700BB17E1 /* UIWindow+AHKAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIWindow+AHKAdditions.m"; sourceTree = "<group>"; };
 		F73049B81CB567F000C7C320 /* NSString+TruncateToWidth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+TruncateToWidth.h"; sourceTree = "<group>"; };
 		F73049B81CB567F000C7C320 /* NSString+TruncateToWidth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSString+TruncateToWidth.h"; sourceTree = "<group>"; };
 		F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+TruncateToWidth.m"; sourceTree = "<group>"; };
 		F73049B91CB567F000C7C320 /* NSString+TruncateToWidth.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSString+TruncateToWidth.m"; sourceTree = "<group>"; };
 		F732B3361E8045A1002B7D75 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/SwiftWebVC.strings; sourceTree = "<group>"; };
 		F732B3361E8045A1002B7D75 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/SwiftWebVC.strings; sourceTree = "<group>"; };
 		F732BA031D76CE1500E9878B /* CCNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNetworking.h; sourceTree = "<group>"; };
 		F732BA031D76CE1500E9878B /* CCNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCNetworking.h; sourceTree = "<group>"; };
 		F732BA041D76CE1500E9878B /* CCNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCNetworking.m; sourceTree = "<group>"; };
 		F732BA041D76CE1500E9878B /* CCNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCNetworking.m; sourceTree = "<group>"; };
+		F73B4EAD1F470D9100BBEE4B /* Big5Freq.tab */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Big5Freq.tab; sourceTree = "<group>"; };
+		F73B4EAE1F470D9100BBEE4B /* CharDistribution.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CharDistribution.cpp; sourceTree = "<group>"; };
+		F73B4EAF1F470D9100BBEE4B /* CharDistribution.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharDistribution.h; sourceTree = "<group>"; };
+		F73B4EB01F470D9100BBEE4B /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
+		F73B4EB11F470D9100BBEE4B /* EUCKRFreq.tab */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EUCKRFreq.tab; sourceTree = "<group>"; };
+		F73B4EB21F470D9100BBEE4B /* EUCTWFreq.tab */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = EUCTWFreq.tab; sourceTree = "<group>"; };
+		F73B4EB31F470D9100BBEE4B /* GB2312Freq.tab */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = GB2312Freq.tab; sourceTree = "<group>"; };
+		F73B4EB41F470D9100BBEE4B /* JISFreq.tab */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = JISFreq.tab; sourceTree = "<group>"; };
+		F73B4EB51F470D9100BBEE4B /* JpCntx.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JpCntx.cpp; sourceTree = "<group>"; };
+		F73B4EB61F470D9100BBEE4B /* JpCntx.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JpCntx.h; sourceTree = "<group>"; };
+		F73B4EB81F470D9100BBEE4B /* LangArabicModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangArabicModel.cpp; sourceTree = "<group>"; };
+		F73B4EB91F470D9100BBEE4B /* LangBulgarianModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangBulgarianModel.cpp; sourceTree = "<group>"; };
+		F73B4EBA1F470D9100BBEE4B /* LangDanishModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangDanishModel.cpp; sourceTree = "<group>"; };
+		F73B4EBB1F470D9100BBEE4B /* LangEsperantoModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangEsperantoModel.cpp; sourceTree = "<group>"; };
+		F73B4EBC1F470D9100BBEE4B /* LangFrenchModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangFrenchModel.cpp; sourceTree = "<group>"; };
+		F73B4EBD1F470D9100BBEE4B /* LangGermanModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangGermanModel.cpp; sourceTree = "<group>"; };
+		F73B4EBE1F470D9100BBEE4B /* LangGreekModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangGreekModel.cpp; sourceTree = "<group>"; };
+		F73B4EBF1F470D9100BBEE4B /* LangHebrewModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangHebrewModel.cpp; sourceTree = "<group>"; };
+		F73B4EC01F470D9100BBEE4B /* LangHungarianModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangHungarianModel.cpp; sourceTree = "<group>"; };
+		F73B4EC11F470D9100BBEE4B /* LangRussianModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangRussianModel.cpp; sourceTree = "<group>"; };
+		F73B4EC21F470D9100BBEE4B /* LangSpanishModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangSpanishModel.cpp; sourceTree = "<group>"; };
+		F73B4EC31F470D9100BBEE4B /* LangThaiModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangThaiModel.cpp; sourceTree = "<group>"; };
+		F73B4EC41F470D9100BBEE4B /* LangTurkishModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangTurkishModel.cpp; sourceTree = "<group>"; };
+		F73B4EC51F470D9100BBEE4B /* LangVietnameseModel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LangVietnameseModel.cpp; sourceTree = "<group>"; };
+		F73B4EC61F470D9100BBEE4B /* nsBig5Prober.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsBig5Prober.cpp; sourceTree = "<group>"; };
+		F73B4EC71F470D9100BBEE4B /* nsBig5Prober.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsBig5Prober.h; sourceTree = "<group>"; };
+		F73B4EC81F470D9100BBEE4B /* nsCharSetProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsCharSetProber.cpp; sourceTree = "<group>"; };
+		F73B4EC91F470D9100BBEE4B /* nsCharSetProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsCharSetProber.h; sourceTree = "<group>"; };
+		F73B4ECA1F470D9100BBEE4B /* nsCodingStateMachine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsCodingStateMachine.h; sourceTree = "<group>"; };
+		F73B4ECB1F470D9100BBEE4B /* nscore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nscore.h; sourceTree = "<group>"; };
+		F73B4ECC1F470D9100BBEE4B /* nsEscCharsetProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsEscCharsetProber.cpp; sourceTree = "<group>"; };
+		F73B4ECD1F470D9100BBEE4B /* nsEscCharsetProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsEscCharsetProber.h; sourceTree = "<group>"; };
+		F73B4ECE1F470D9100BBEE4B /* nsEscSM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsEscSM.cpp; sourceTree = "<group>"; };
+		F73B4ECF1F470D9100BBEE4B /* nsEUCJPProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsEUCJPProber.cpp; sourceTree = "<group>"; };
+		F73B4ED01F470D9100BBEE4B /* nsEUCJPProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsEUCJPProber.h; sourceTree = "<group>"; };
+		F73B4ED11F470D9100BBEE4B /* nsEUCKRProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsEUCKRProber.cpp; sourceTree = "<group>"; };
+		F73B4ED21F470D9100BBEE4B /* nsEUCKRProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsEUCKRProber.h; sourceTree = "<group>"; };
+		F73B4ED31F470D9100BBEE4B /* nsEUCTWProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsEUCTWProber.cpp; sourceTree = "<group>"; };
+		F73B4ED41F470D9100BBEE4B /* nsEUCTWProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsEUCTWProber.h; sourceTree = "<group>"; };
+		F73B4ED51F470D9100BBEE4B /* nsGB2312Prober.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsGB2312Prober.cpp; sourceTree = "<group>"; };
+		F73B4ED61F470D9100BBEE4B /* nsGB2312Prober.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsGB2312Prober.h; sourceTree = "<group>"; };
+		F73B4ED71F470D9100BBEE4B /* nsHebrewProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsHebrewProber.cpp; sourceTree = "<group>"; };
+		F73B4ED81F470D9100BBEE4B /* nsHebrewProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsHebrewProber.h; sourceTree = "<group>"; };
+		F73B4ED91F470D9100BBEE4B /* nsLatin1Prober.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsLatin1Prober.cpp; sourceTree = "<group>"; };
+		F73B4EDA1F470D9100BBEE4B /* nsLatin1Prober.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsLatin1Prober.h; sourceTree = "<group>"; };
+		F73B4EDB1F470D9100BBEE4B /* nsMBCSGroupProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsMBCSGroupProber.cpp; sourceTree = "<group>"; };
+		F73B4EDC1F470D9100BBEE4B /* nsMBCSGroupProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsMBCSGroupProber.h; sourceTree = "<group>"; };
+		F73B4EDD1F470D9100BBEE4B /* nsMBCSSM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsMBCSSM.cpp; sourceTree = "<group>"; };
+		F73B4EDE1F470D9100BBEE4B /* nsPkgInt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsPkgInt.h; sourceTree = "<group>"; };
+		F73B4EDF1F470D9100BBEE4B /* nsSBCharSetProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsSBCharSetProber.cpp; sourceTree = "<group>"; };
+		F73B4EE01F470D9100BBEE4B /* nsSBCharSetProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsSBCharSetProber.h; sourceTree = "<group>"; };
+		F73B4EE11F470D9100BBEE4B /* nsSBCSGroupProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsSBCSGroupProber.cpp; sourceTree = "<group>"; };
+		F73B4EE21F470D9100BBEE4B /* nsSBCSGroupProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsSBCSGroupProber.h; sourceTree = "<group>"; };
+		F73B4EE31F470D9100BBEE4B /* nsSJISProber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsSJISProber.cpp; sourceTree = "<group>"; };
+		F73B4EE41F470D9100BBEE4B /* nsSJISProber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsSJISProber.h; sourceTree = "<group>"; };
+		F73B4EE51F470D9100BBEE4B /* nsUniversalDetector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsUniversalDetector.cpp; sourceTree = "<group>"; };
+		F73B4EE61F470D9100BBEE4B /* nsUniversalDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsUniversalDetector.h; sourceTree = "<group>"; };
+		F73B4EE71F470D9100BBEE4B /* nsUTF8Prober.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = nsUTF8Prober.cpp; sourceTree = "<group>"; };
+		F73B4EE81F470D9100BBEE4B /* nsUTF8Prober.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = nsUTF8Prober.h; sourceTree = "<group>"; };
+		F73B4EE91F470D9100BBEE4B /* prmem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prmem.h; sourceTree = "<group>"; };
+		F73B4EEA1F470D9100BBEE4B /* symbols.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = symbols.cmake; sourceTree = "<group>"; };
+		F73B4EEC1F470D9100BBEE4B /* uchardet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = uchardet.cpp; sourceTree = "<group>"; };
+		F73B4EED1F470D9100BBEE4B /* uchardet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = uchardet.h; sourceTree = "<group>"; };
 		F73B4F781E8D3BF800A97F07 /* CCMainTabBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCMainTabBarController.swift; sourceTree = "<group>"; };
 		F73B4F781E8D3BF800A97F07 /* CCMainTabBarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCMainTabBarController.swift; sourceTree = "<group>"; };
 		F73C002D1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCManageCryptoCloudSecurity.h; sourceTree = "<group>"; };
 		F73C002D1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCManageCryptoCloudSecurity.h; sourceTree = "<group>"; };
 		F73C002E1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCManageCryptoCloudSecurity.m; sourceTree = "<group>"; };
 		F73C002E1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCManageCryptoCloudSecurity.m; sourceTree = "<group>"; };
@@ -1021,6 +1206,8 @@
 		F73CCE281DC13798007E38D8 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		F73CCE281DC13798007E38D8 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
 		F73CCE291DC13798007E38D8 /* UICKeyChainStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICKeyChainStore.h; sourceTree = "<group>"; };
 		F73CCE291DC13798007E38D8 /* UICKeyChainStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICKeyChainStore.h; sourceTree = "<group>"; };
 		F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICKeyChainStore.m; sourceTree = "<group>"; };
 		F73CCE2A1DC13798007E38D8 /* UICKeyChainStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICKeyChainStore.m; sourceTree = "<group>"; };
+		F73D71611F2673C200E233EB /* NCText.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NCText.swift; sourceTree = "<group>"; };
+		F73D71631F2674A400E233EB /* NCText.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = NCText.storyboard; sourceTree = "<group>"; };
 		F73F537E1E929C8500F8678D /* CCMore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCMore.swift; sourceTree = "<group>"; };
 		F73F537E1E929C8500F8678D /* CCMore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCMore.swift; sourceTree = "<group>"; };
 		F74344161E1264EE001CC831 /* DocumentPickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentPickerViewController.swift; sourceTree = "<group>"; };
 		F74344161E1264EE001CC831 /* DocumentPickerViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DocumentPickerViewController.swift; sourceTree = "<group>"; };
 		F74344241E1264EE001CC831 /* FileProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProvider.swift; sourceTree = "<group>"; };
 		F74344241E1264EE001CC831 /* FileProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileProvider.swift; sourceTree = "<group>"; };
@@ -1364,13 +1551,6 @@
 		F78D6F631F0B7DDF002F9619 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		F78D6F631F0B7DDF002F9619 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = "<group>"; };
 		F78D6F641F0B7DDF002F9619 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Intro.strings; sourceTree = "<group>"; };
 		F78D6F641F0B7DDF002F9619 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Intro.strings; sourceTree = "<group>"; };
 		F78D6F651F0B7DDF002F9619 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Error.strings; sourceTree = "<group>"; };
 		F78D6F651F0B7DDF002F9619 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Error.strings; sourceTree = "<group>"; };
-		F78D6F661F0B7E1E002F9619 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/CTAssetsPicker.strings; sourceTree = "<group>"; };
-		F78D6F671F0B7E1F002F9619 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/SwiftWebVC.strings; sourceTree = "<group>"; };
-		F78D6F681F0B7E1F002F9619 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/BKPasscodeView.strings; sourceTree = "<group>"; };
-		F78D6F691F0B7E1F002F9619 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Localizable.strings; sourceTree = "<group>"; };
-		F78D6F6A1F0B7E1F002F9619 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/InfoPlist.strings; sourceTree = "<group>"; };
-		F78D6F6B1F0B7E1F002F9619 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Intro.strings; sourceTree = "<group>"; };
-		F78D6F6C1F0B7E1F002F9619 /* el */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = el; path = el.lproj/Error.strings; sourceTree = "<group>"; };
 		F78F6FAE1CC8CCB700F4EA25 /* CCSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSection.h; sourceTree = "<group>"; };
 		F78F6FAE1CC8CCB700F4EA25 /* CCSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSection.h; sourceTree = "<group>"; };
 		F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSection.m; sourceTree = "<group>"; };
 		F78F6FAF1CC8CCB700F4EA25 /* CCSection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCSection.m; sourceTree = "<group>"; };
 		F792A77B1BC7C45400C9388E /* CCSplit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSplit.h; sourceTree = "<group>"; };
 		F792A77B1BC7C45400C9388E /* CCSplit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCSplit.h; sourceTree = "<group>"; };
@@ -1431,6 +1611,8 @@
 		F7B1FBC21E72E3D1001781FE /* SwiftWebVCActivityChrome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftWebVCActivityChrome.swift; sourceTree = "<group>"; };
 		F7B1FBC21E72E3D1001781FE /* SwiftWebVCActivityChrome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftWebVCActivityChrome.swift; sourceTree = "<group>"; };
 		F7B1FBC31E72E3D1001781FE /* SwiftWebVCActivitySafari.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftWebVCActivitySafari.swift; sourceTree = "<group>"; };
 		F7B1FBC31E72E3D1001781FE /* SwiftWebVCActivitySafari.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SwiftWebVCActivitySafari.swift; sourceTree = "<group>"; };
 		F7B3A4ED1E97818A000DACE8 /* CCLoginWeb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCLoginWeb.swift; sourceTree = "<group>"; };
 		F7B3A4ED1E97818A000DACE8 /* CCLoginWeb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCLoginWeb.swift; sourceTree = "<group>"; };
+		F7B4F1C71F44356F00B53B42 /* NCUchardet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCUchardet.h; sourceTree = "<group>"; };
+		F7B4F1C81F44356F00B53B42 /* NCUchardet.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NCUchardet.m; sourceTree = "<group>"; };
 		F7B61E861DC13C20009E938F /* MagicalRecord.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MagicalRecord.xcodeproj; path = "Libraries external/MagicalRecord/MagicalRecord.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		F7B61E861DC13C20009E938F /* MagicalRecord.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = MagicalRecord.xcodeproj; path = "Libraries external/MagicalRecord/MagicalRecord.xcodeproj"; sourceTree = SOURCE_ROOT; };
 		F7BAADB21ED5A87C00B7EAD4 /* CCCoreData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCoreData.h; sourceTree = "<group>"; };
 		F7BAADB21ED5A87C00B7EAD4 /* CCCoreData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCoreData.h; sourceTree = "<group>"; };
 		F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCCoreData.m; sourceTree = "<group>"; };
 		F7BAADB31ED5A87C00B7EAD4 /* CCCoreData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCCoreData.m; sourceTree = "<group>"; };
@@ -1740,8 +1922,22 @@
 		F7DC5FE91F011EB700A903C7 /* MGSwipeButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGSwipeButton.m; sourceTree = "<group>"; };
 		F7DC5FE91F011EB700A903C7 /* MGSwipeButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGSwipeButton.m; sourceTree = "<group>"; };
 		F7DC5FEA1F011EB700A903C7 /* MGSwipeTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGSwipeTableCell.h; sourceTree = "<group>"; };
 		F7DC5FEA1F011EB700A903C7 /* MGSwipeTableCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGSwipeTableCell.h; sourceTree = "<group>"; };
 		F7DC5FEB1F011EB700A903C7 /* MGSwipeTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGSwipeTableCell.m; sourceTree = "<group>"; };
 		F7DC5FEB1F011EB700A903C7 /* MGSwipeTableCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MGSwipeTableCell.m; sourceTree = "<group>"; };
+		F7DE9AAD1F482FA5008DFE10 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/CTAssetsPicker.strings; sourceTree = "<group>"; };
+		F7DE9AAE1F482FA5008DFE10 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/SwiftWebVC.strings; sourceTree = "<group>"; };
+		F7DE9AAF1F482FA5008DFE10 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/BKPasscodeView.strings; sourceTree = "<group>"; };
+		F7DE9AB01F482FA5008DFE10 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Localizable.strings; sourceTree = "<group>"; };
+		F7DE9AB11F482FA5008DFE10 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		F7DE9AB21F482FA5008DFE10 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Intro.strings; sourceTree = "<group>"; };
+		F7DE9AB31F482FA5008DFE10 /* sv */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sv; path = sv.lproj/Error.strings; sourceTree = "<group>"; };
 		F7DFE24F1EBDC3A400CF5202 /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Realm.framework; sourceTree = "<group>"; };
 		F7DFE24F1EBDC3A400CF5202 /* Realm.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Realm.framework; sourceTree = "<group>"; };
 		F7DFE2501EBDC3A400CF5202 /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RealmSwift.framework; sourceTree = "<group>"; };
 		F7DFE2501EBDC3A400CF5202 /* RealmSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = RealmSwift.framework; sourceTree = "<group>"; };
+		F7E394951F2A1CC600A94CAC /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = sq.lproj/CTAssetsPicker.strings; sourceTree = "<group>"; };
+		F7E394961F2A1CC600A94CAC /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = sq.lproj/SwiftWebVC.strings; sourceTree = "<group>"; };
+		F7E394971F2A1CC600A94CAC /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = sq.lproj/BKPasscodeView.strings; sourceTree = "<group>"; };
+		F7E394981F2A1CC600A94CAC /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = sq.lproj/Localizable.strings; sourceTree = "<group>"; };
+		F7E394991F2A1CC700A94CAC /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = sq.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+		F7E3949A1F2A1CC700A94CAC /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = sq.lproj/Intro.strings; sourceTree = "<group>"; };
+		F7E3949B1F2A1CC700A94CAC /* sq */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sq; path = sq.lproj/Error.strings; sourceTree = "<group>"; };
 		F7ECBA6C1E239DCD003E6328 /* CCCreateCloud.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCCreateCloud.swift; sourceTree = "<group>"; };
 		F7ECBA6C1E239DCD003E6328 /* CCCreateCloud.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CCCreateCloud.swift; sourceTree = "<group>"; };
 		F7F0617A1BAACDD300846525 /* CryptoCloud.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCloud.pch; sourceTree = "<group>"; };
 		F7F0617A1BAACDD300846525 /* CryptoCloud.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoCloud.pch; sourceTree = "<group>"; };
 		F7F54CAB1E5AFF1E00E19C62 /* PickerFileProvider-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PickerFileProvider-Bridging-Header.h"; sourceTree = "<group>"; };
 		F7F54CAB1E5AFF1E00E19C62 /* PickerFileProvider-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "PickerFileProvider-Bridging-Header.h"; sourceTree = "<group>"; };
@@ -1847,6 +2043,11 @@
 			isa = PBXFrameworksBuildPhase;
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
+				F7BB50FE1F223A5400C47094 /* libMagicalRecord.a in Frameworks */,
+				F7BB50ED1F22394400C47094 /* RealmSwift.framework in Frameworks */,
+				F7BB50EC1F22394100C47094 /* Realm.framework in Frameworks */,
+				F7BB50FD1F223A3D00C47094 /* libcrypto.a in Frameworks */,
+				F7BB50FC1F223A3B00C47094 /* libssl.a in Frameworks */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
@@ -2254,10 +2455,6 @@
 				F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */,
 				F72AAEC31E5C60C700BB17E1 /* AHKActionSheet.m */,
 				F72AAEC41E5C60C700BB17E1 /* AHKActionSheetViewController.h */,
 				F72AAEC41E5C60C700BB17E1 /* AHKActionSheetViewController.h */,
 				F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */,
 				F72AAEC51E5C60C700BB17E1 /* AHKActionSheetViewController.m */,
-				F72AAEC61E5C60C700BB17E1 /* UIImage+AHKAdditions.h */,
-				F72AAEC71E5C60C700BB17E1 /* UIImage+AHKAdditions.m */,
-				F72AAEC81E5C60C700BB17E1 /* UIWindow+AHKAdditions.h */,
-				F72AAEC91E5C60C700BB17E1 /* UIWindow+AHKAdditions.m */,
 			);
 			);
 			path = AHKActionSheet;
 			path = AHKActionSheet;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -2276,6 +2473,84 @@
 			name = Localizations;
 			name = Localizations;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		F73B4EAC1F470D9100BBEE4B /* src */ = {
+			isa = PBXGroup;
+			children = (
+				F73B4EAD1F470D9100BBEE4B /* Big5Freq.tab */,
+				F73B4EAE1F470D9100BBEE4B /* CharDistribution.cpp */,
+				F73B4EAF1F470D9100BBEE4B /* CharDistribution.h */,
+				F73B4EB01F470D9100BBEE4B /* CMakeLists.txt */,
+				F73B4EB11F470D9100BBEE4B /* EUCKRFreq.tab */,
+				F73B4EB21F470D9100BBEE4B /* EUCTWFreq.tab */,
+				F73B4EB31F470D9100BBEE4B /* GB2312Freq.tab */,
+				F73B4EB41F470D9100BBEE4B /* JISFreq.tab */,
+				F73B4EB51F470D9100BBEE4B /* JpCntx.cpp */,
+				F73B4EB61F470D9100BBEE4B /* JpCntx.h */,
+				F73B4EB71F470D9100BBEE4B /* LangModels */,
+				F73B4EC61F470D9100BBEE4B /* nsBig5Prober.cpp */,
+				F73B4EC71F470D9100BBEE4B /* nsBig5Prober.h */,
+				F73B4EC81F470D9100BBEE4B /* nsCharSetProber.cpp */,
+				F73B4EC91F470D9100BBEE4B /* nsCharSetProber.h */,
+				F73B4ECA1F470D9100BBEE4B /* nsCodingStateMachine.h */,
+				F73B4ECB1F470D9100BBEE4B /* nscore.h */,
+				F73B4ECC1F470D9100BBEE4B /* nsEscCharsetProber.cpp */,
+				F73B4ECD1F470D9100BBEE4B /* nsEscCharsetProber.h */,
+				F73B4ECE1F470D9100BBEE4B /* nsEscSM.cpp */,
+				F73B4ECF1F470D9100BBEE4B /* nsEUCJPProber.cpp */,
+				F73B4ED01F470D9100BBEE4B /* nsEUCJPProber.h */,
+				F73B4ED11F470D9100BBEE4B /* nsEUCKRProber.cpp */,
+				F73B4ED21F470D9100BBEE4B /* nsEUCKRProber.h */,
+				F73B4ED31F470D9100BBEE4B /* nsEUCTWProber.cpp */,
+				F73B4ED41F470D9100BBEE4B /* nsEUCTWProber.h */,
+				F73B4ED51F470D9100BBEE4B /* nsGB2312Prober.cpp */,
+				F73B4ED61F470D9100BBEE4B /* nsGB2312Prober.h */,
+				F73B4ED71F470D9100BBEE4B /* nsHebrewProber.cpp */,
+				F73B4ED81F470D9100BBEE4B /* nsHebrewProber.h */,
+				F73B4ED91F470D9100BBEE4B /* nsLatin1Prober.cpp */,
+				F73B4EDA1F470D9100BBEE4B /* nsLatin1Prober.h */,
+				F73B4EDB1F470D9100BBEE4B /* nsMBCSGroupProber.cpp */,
+				F73B4EDC1F470D9100BBEE4B /* nsMBCSGroupProber.h */,
+				F73B4EDD1F470D9100BBEE4B /* nsMBCSSM.cpp */,
+				F73B4EDE1F470D9100BBEE4B /* nsPkgInt.h */,
+				F73B4EDF1F470D9100BBEE4B /* nsSBCharSetProber.cpp */,
+				F73B4EE01F470D9100BBEE4B /* nsSBCharSetProber.h */,
+				F73B4EE11F470D9100BBEE4B /* nsSBCSGroupProber.cpp */,
+				F73B4EE21F470D9100BBEE4B /* nsSBCSGroupProber.h */,
+				F73B4EE31F470D9100BBEE4B /* nsSJISProber.cpp */,
+				F73B4EE41F470D9100BBEE4B /* nsSJISProber.h */,
+				F73B4EE51F470D9100BBEE4B /* nsUniversalDetector.cpp */,
+				F73B4EE61F470D9100BBEE4B /* nsUniversalDetector.h */,
+				F73B4EE71F470D9100BBEE4B /* nsUTF8Prober.cpp */,
+				F73B4EE81F470D9100BBEE4B /* nsUTF8Prober.h */,
+				F73B4EE91F470D9100BBEE4B /* prmem.h */,
+				F73B4EEA1F470D9100BBEE4B /* symbols.cmake */,
+				F73B4EEC1F470D9100BBEE4B /* uchardet.cpp */,
+				F73B4EED1F470D9100BBEE4B /* uchardet.h */,
+			);
+			path = src;
+			sourceTree = "<group>";
+		};
+		F73B4EB71F470D9100BBEE4B /* LangModels */ = {
+			isa = PBXGroup;
+			children = (
+				F73B4EB81F470D9100BBEE4B /* LangArabicModel.cpp */,
+				F73B4EB91F470D9100BBEE4B /* LangBulgarianModel.cpp */,
+				F73B4EBA1F470D9100BBEE4B /* LangDanishModel.cpp */,
+				F73B4EBB1F470D9100BBEE4B /* LangEsperantoModel.cpp */,
+				F73B4EBC1F470D9100BBEE4B /* LangFrenchModel.cpp */,
+				F73B4EBD1F470D9100BBEE4B /* LangGermanModel.cpp */,
+				F73B4EBE1F470D9100BBEE4B /* LangGreekModel.cpp */,
+				F73B4EBF1F470D9100BBEE4B /* LangHebrewModel.cpp */,
+				F73B4EC01F470D9100BBEE4B /* LangHungarianModel.cpp */,
+				F73B4EC11F470D9100BBEE4B /* LangRussianModel.cpp */,
+				F73B4EC21F470D9100BBEE4B /* LangSpanishModel.cpp */,
+				F73B4EC31F470D9100BBEE4B /* LangThaiModel.cpp */,
+				F73B4EC41F470D9100BBEE4B /* LangTurkishModel.cpp */,
+				F73B4EC51F470D9100BBEE4B /* LangVietnameseModel.cpp */,
+			);
+			path = LangModels;
+			sourceTree = "<group>";
+		};
 		F73CC0571E813DFF006E3047 /* BKPasscodeView */ = {
 		F73CC0571E813DFF006E3047 /* BKPasscodeView */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -2319,6 +2594,15 @@
 			path = UICKeyChainStore;
 			path = UICKeyChainStore;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		F73D71561F26739100E233EB /* Text */ = {
+			isa = PBXGroup;
+			children = (
+				F73D71611F2673C200E233EB /* NCText.swift */,
+				F73D71631F2674A400E233EB /* NCText.storyboard */,
+			);
+			path = Text;
+			sourceTree = "<group>";
+		};
 		F74344131E1264EE001CC831 /* Picker */ = {
 		F74344131E1264EE001CC831 /* Picker */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -2960,6 +3244,16 @@
 			path = Resources;
 			path = Resources;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		F7B4F1C51F44356F00B53B42 /* NCUchardet */ = {
+			isa = PBXGroup;
+			children = (
+				F73B4EAC1F470D9100BBEE4B /* src */,
+				F7B4F1C71F44356F00B53B42 /* NCUchardet.h */,
+				F7B4F1C81F44356F00B53B42 /* NCUchardet.m */,
+			);
+			path = NCUchardet;
+			sourceTree = "<group>";
+		};
 		F7B61E871DC13C20009E938F /* Products */ = {
 		F7B61E871DC13C20009E938F /* Products */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -3438,6 +3732,7 @@
 				F7D423A31F063B81009C9782 /* CTAssetsPickerController */,
 				F7D423A31F063B81009C9782 /* CTAssetsPickerController */,
 				F762CB9C1EACB89C00B38484 /* LMMediaPlayer */,
 				F762CB9C1EACB89C00B38484 /* LMMediaPlayer */,
 				F7F54CAD1E5B14C700E19C62 /* MWPhotoBrowser */,
 				F7F54CAD1E5B14C700E19C62 /* MWPhotoBrowser */,
+				F7B4F1C51F44356F00B53B42 /* NCUchardet */,
 				F762CB7B1EACB81000B38484 /* REMenu */,
 				F762CB7B1EACB81000B38484 /* REMenu */,
 				F7B1FBAF1E72E3D1001781FE /* SwiftWebVC */,
 				F7B1FBAF1E72E3D1001781FE /* SwiftWebVC */,
 				F762CB8B1EACB84400B38484 /* TWMessageBarManager */,
 				F762CB8B1EACB84400B38484 /* TWMessageBarManager */,
@@ -3546,8 +3841,8 @@
 				F78088E51DD3A1DB005C5A7C /* cryptocloud.xcdatamodeld */,
 				F78088E51DD3A1DB005C5A7C /* cryptocloud.xcdatamodeld */,
 				F7F67BB81A24D27800EE80DA /* Images.xcassets */,
 				F7F67BB81A24D27800EE80DA /* Images.xcassets */,
 				F70211F31BAC56E9003FC03E /* Main */,
 				F70211F31BAC56E9003FC03E /* Main */,
-				F7B0C1701EE8397E0033AC24 /* AutoUpload */,
 				F7C1CDD91E6DFC6F005D92BE /* Brand */,
 				F7C1CDD91E6DFC6F005D92BE /* Brand */,
+				F7B0C1701EE8397E0033AC24 /* AutoUpload */,
 				F720E02A1E48C74C001A4B9E /* Actions */,
 				F720E02A1E48C74C001A4B9E /* Actions */,
 				F7A321621E9E37960069AD1B /* Activity */,
 				F7A321621E9E37960069AD1B /* Activity */,
 				F7ECBA6B1E239DCD003E6328 /* Create */,
 				F7ECBA6B1E239DCD003E6328 /* Create */,
@@ -3569,6 +3864,7 @@
 				F7169A161EE590930086BD69 /* Shares */,
 				F7169A161EE590930086BD69 /* Shares */,
 				F7B0C0CA1EE7E7750033AC24 /* Synchronize */,
 				F7B0C0CA1EE7E7750033AC24 /* Synchronize */,
 				F721371B1BAFF0920012B613 /* Templates */,
 				F721371B1BAFF0920012B613 /* Templates */,
+				F73D71561F26739100E233EB /* Text */,
 				F7A321731E9E3EAF0069AD1B /* Transfers */,
 				F7A321731E9E3EAF0069AD1B /* Transfers */,
 				F70784811A2C8A0D00AC9FFF /* UploadFromOtherUpp */,
 				F70784811A2C8A0D00AC9FFF /* UploadFromOtherUpp */,
 				F7BFFA991A24D7BB0044ED85 /* Utility */,
 				F7BFFA991A24D7BB0044ED85 /* Utility */,
@@ -3812,9 +4108,10 @@
 				pl,
 				pl,
 				nl,
 				nl,
 				es,
 				es,
-				el,
 				"zh-Hans",
 				"zh-Hans",
 				is,
 				is,
+				sq,
+				sv,
 			);
 			);
 			mainGroup = F7F67B9F1A24D27800EE80DA;
 			mainGroup = F7F67B9F1A24D27800EE80DA;
 			productRefGroup = F7F67B9F1A24D27800EE80DA;
 			productRefGroup = F7F67B9F1A24D27800EE80DA;
@@ -3927,6 +4224,11 @@
 			isa = PBXResourcesBuildPhase;
 			isa = PBXResourcesBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
+				F7BB50C81F22384700C47094 /* Error.strings in Resources */,
+				F7BB50C61F22383D00C47094 /* BKPasscodeView.strings in Resources */,
+				F7BB50C71F22384100C47094 /* Localizable.strings in Resources */,
+				F7BB50AE1F2236E900C47094 /* Custom.xcassets in Resources */,
+				F7BB50AD1F2236D100C47094 /* Images.xcassets in Resources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
@@ -3948,6 +4250,7 @@
 				F7D4233D1F0596AC009C9782 /* Reader-Button-N@3x.png in Resources */,
 				F7D4233D1F0596AC009C9782 /* Reader-Button-N@3x.png in Resources */,
 				F7D424B61F063B82009C9782 /* ZSSundo.png in Resources */,
 				F7D424B61F063B82009C9782 /* ZSSundo.png in Resources */,
 				F7D424A91F063B82009C9782 /* ZSSrightjustify@2x.png in Resources */,
 				F7D424A91F063B82009C9782 /* ZSSrightjustify@2x.png in Resources */,
+				F73B4EF21F470D9100BBEE4B /* EUCTWFreq.tab in Resources */,
 				F700222C1EC479840080073F /* Custom.xcassets in Resources */,
 				F700222C1EC479840080073F /* Custom.xcassets in Resources */,
 				F77B0EFE1D118A16002130FE /* CCUploadFromOtherUpp.storyboard in Resources */,
 				F77B0EFE1D118A16002130FE /* CCUploadFromOtherUpp.storyboard in Resources */,
 				F7D4246E1F063B82009C9782 /* CTAssetsPickerController.bundle in Resources */,
 				F7D4246E1F063B82009C9782 /* CTAssetsPickerController.bundle in Resources */,
@@ -3966,6 +4269,7 @@
 				F77B0F0E1D118A16002130FE /* BKPasscodeView.strings in Resources */,
 				F77B0F0E1D118A16002130FE /* BKPasscodeView.strings in Resources */,
 				F7D4248D1F063B82009C9782 /* ZSShorizontalrule@2x.png in Resources */,
 				F7D4248D1F063B82009C9782 /* ZSShorizontalrule@2x.png in Resources */,
 				F7D424AF1F063B82009C9782 /* ZSSsuperscript@2x.png in Resources */,
 				F7D424AF1F063B82009C9782 /* ZSSsuperscript@2x.png in Resources */,
+				F73B4EEE1F470D9100BBEE4B /* Big5Freq.tab in Resources */,
 				F7D424A71F063B82009C9782 /* ZSSredo@2x.png in Resources */,
 				F7D424A71F063B82009C9782 /* ZSSredo@2x.png in Resources */,
 				F7D4233B1F0596AC009C9782 /* Reader-Button-N.png in Resources */,
 				F7D4233B1F0596AC009C9782 /* Reader-Button-N.png in Resources */,
 				F7D424A51F063B82009C9782 /* ZSSquicklink@2x.png in Resources */,
 				F7D424A51F063B82009C9782 /* ZSSquicklink@2x.png in Resources */,
@@ -4004,6 +4308,7 @@
 				F7D4234B1F0596AC009C9782 /* Reader-Print@2x.png in Resources */,
 				F7D4234B1F0596AC009C9782 /* Reader-Print@2x.png in Resources */,
 				F762CB971EACB84400B38484 /* icon-info.png in Resources */,
 				F762CB971EACB84400B38484 /* icon-info.png in Resources */,
 				F7169A1E1EE590930086BD69 /* NCSharesCell.xib in Resources */,
 				F7169A1E1EE590930086BD69 /* NCSharesCell.xib in Resources */,
+				F73D71641F2674A400E233EB /* NCText.storyboard in Resources */,
 				F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */,
 				F7226EDC1EE4089300EBECB1 /* Main.storyboard in Resources */,
 				F7D424BB1F063B82009C9782 /* ZSSunorderedlist@2x.png in Resources */,
 				F7D424BB1F063B82009C9782 /* ZSSunorderedlist@2x.png in Resources */,
 				F7D423471F0596AC009C9782 /* Reader-Mark-Y.png in Resources */,
 				F7D423471F0596AC009C9782 /* Reader-Mark-Y.png in Resources */,
@@ -4037,6 +4342,7 @@
 				F7D424B31F063B82009C9782 /* ZSStextcolor@2x.png in Resources */,
 				F7D424B31F063B82009C9782 /* ZSStextcolor@2x.png in Resources */,
 				F7D4249D1F063B82009C9782 /* ZSSorderedlist@2x.png in Resources */,
 				F7D4249D1F063B82009C9782 /* ZSSorderedlist@2x.png in Resources */,
 				F7F54CEE1E5B14C700E19C62 /* ImageSelectedSmallOff.png in Resources */,
 				F7F54CEE1E5B14C700E19C62 /* ImageSelectedSmallOff.png in Resources */,
+				F73B4EF31F470D9100BBEE4B /* GB2312Freq.tab in Resources */,
 				F7F54D051E5B14C800E19C62 /* VideoOverlay@3x.png in Resources */,
 				F7F54D051E5B14C800E19C62 /* VideoOverlay@3x.png in Resources */,
 				F7D424A11F063B82009C9782 /* ZSSparagraph@2x.png in Resources */,
 				F7D424A11F063B82009C9782 /* ZSSparagraph@2x.png in Resources */,
 				F7F54D011E5B14C700E19C62 /* UIBarButtonItemGrid@2x.png in Resources */,
 				F7F54D011E5B14C700E19C62 /* UIBarButtonItemGrid@2x.png in Resources */,
@@ -4068,8 +4374,10 @@
 				F7D424A61F063B82009C9782 /* ZSSredo.png in Resources */,
 				F7D424A61F063B82009C9782 /* ZSSredo.png in Resources */,
 				F7F54CF01E5B14C700E19C62 /* ImageSelectedSmallOff@3x.png in Resources */,
 				F7F54CF01E5B14C700E19C62 /* ImageSelectedSmallOff@3x.png in Resources */,
 				F7D424771F063B82009C9782 /* ZSSbgcolor@2x.png in Resources */,
 				F7D424771F063B82009C9782 /* ZSSbgcolor@2x.png in Resources */,
+				F73B4EF01F470D9100BBEE4B /* CMakeLists.txt in Resources */,
 				F7F54CEC1E5B14C700E19C62 /* ImageSelectedOn@2x.png in Resources */,
 				F7F54CEC1E5B14C700E19C62 /* ImageSelectedOn@2x.png in Resources */,
 				F7D424951F063B82009C9782 /* ZSSitalic@2x.png in Resources */,
 				F7D424951F063B82009C9782 /* ZSSitalic@2x.png in Resources */,
+				F73B4F151F470D9100BBEE4B /* symbols.cmake in Resources */,
 				F7D424B41F063B82009C9782 /* ZSSunderline.png in Resources */,
 				F7D424B41F063B82009C9782 /* ZSSunderline.png in Resources */,
 				F7D424831F063B82009C9782 /* ZSSh2@2x.png in Resources */,
 				F7D424831F063B82009C9782 /* ZSSh2@2x.png in Resources */,
 				F7F54CF21E5B14C700E19C62 /* ImageSelectedSmallOn@2x.png in Resources */,
 				F7F54CF21E5B14C700E19C62 /* ImageSelectedSmallOn@2x.png in Resources */,
@@ -4096,11 +4404,13 @@
 				F7F54CE91E5B14C700E19C62 /* ImageSelectedOff@2x.png in Resources */,
 				F7F54CE91E5B14C700E19C62 /* ImageSelectedOff@2x.png in Resources */,
 				F77B0F8A1D118A16002130FE /* CCCellMain.xib in Resources */,
 				F77B0F8A1D118A16002130FE /* CCCellMain.xib in Resources */,
 				F77B0F8C1D118A16002130FE /* CCCellMainTransfer.xib in Resources */,
 				F77B0F8C1D118A16002130FE /* CCCellMainTransfer.xib in Resources */,
+				F73B4EF41F470D9100BBEE4B /* JISFreq.tab in Resources */,
 				F7D4249A1F063B82009C9782 /* ZSSlink.png in Resources */,
 				F7D4249A1F063B82009C9782 /* ZSSlink.png in Resources */,
 				F7D4247A1F063B82009C9782 /* ZSScenterjustify.png in Resources */,
 				F7D4247A1F063B82009C9782 /* ZSScenterjustify.png in Resources */,
 				F7D423451F0596AC009C9782 /* Reader-Mark-N@2x.png in Resources */,
 				F7D423451F0596AC009C9782 /* Reader-Mark-N@2x.png in Resources */,
 				F7D423481F0596AC009C9782 /* Reader-Mark-Y@2x.png in Resources */,
 				F7D423481F0596AC009C9782 /* Reader-Mark-Y@2x.png in Resources */,
 				F7D4233F1F0596AC009C9782 /* Reader-Email@2x.png in Resources */,
 				F7D4233F1F0596AC009C9782 /* Reader-Email@2x.png in Resources */,
+				F73B4EF11F470D9100BBEE4B /* EUCKRFreq.tab in Resources */,
 				F75797AE1E81356C00187A1B /* CTAssetsPicker.strings in Resources */,
 				F75797AE1E81356C00187A1B /* CTAssetsPicker.strings in Resources */,
 				F7D424BC1F063B82009C9782 /* ZSSviewsource.png in Resources */,
 				F7D424BC1F063B82009C9782 /* ZSSviewsource.png in Resources */,
 				F762CB961EACB84400B38484 /* icon-error@2x.png in Resources */,
 				F762CB961EACB84400B38484 /* icon-error@2x.png in Resources */,
@@ -4346,8 +4656,82 @@
 			isa = PBXSourcesBuildPhase;
 			isa = PBXSourcesBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
+				F7BB50D91F2238A300C47094 /* OCXMLParser.m in Sources */,
+				F7BB50D11F22388900C47094 /* OCSharedDto.m in Sources */,
+				F7BB50CB1F22386900C47094 /* OCCommunication.m in Sources */,
+				F7BB50D31F22388E00C47094 /* OCUserProfile.m in Sources */,
+				F7BB50BF1F22378800C47094 /* CCExifGeo.m in Sources */,
+				F7BB50F51F2239B900C47094 /* BKPasscodeField.m in Sources */,
+				F7BB50B91F22372900C47094 /* TableLocalFile+CoreDataProperties.m in Sources */,
+				F7BB50CA1F22386700C47094 /* OCCapabilities.m in Sources */,
+				F7BB50CE1F22388000C47094 /* OCNotifications.m in Sources */,
+				F7BB50CC1F22387900C47094 /* OCExternalSites.m in Sources */,
+				F7BB50EA1F2238FB00C47094 /* UIScrollView+EmptyDataSet.m in Sources */,
+				F7BB50F71F2239BF00C47094 /* BKPasscodeLockScreenManager.m in Sources */,
+				F7BB50DB1F2238A900C47094 /* OCXMLShareByLinkParser.m in Sources */,
+				F7BB50E21F2238D000C47094 /* AFURLRequestSerialization.m in Sources */,
+				F7BB50B41F22371900C47094 /* TableCertificates+CoreDataClass.m in Sources */,
+				F7BB50BC1F22375D00C47094 /* CCBKPasscode.m in Sources */,
+				F7BB50B21F22371300C47094 /* TableAccount+CoreDataClass.m in Sources */,
+				F7BB50D81F2238A000C47094 /* OCXMLListParser.m in Sources */,
+				F7BB50E41F2238D500C47094 /* AFURLSessionManager.m in Sources */,
+				F7BB50F91F2239C800C47094 /* BKShiftingView.m in Sources */,
+				F7BB50B61F22372000C47094 /* TableDirectory+CoreDataClass.m in Sources */,
+				F7BB50F21F22395D00C47094 /* UICKeyChainStore.m in Sources */,
+				F7BB50D01F22388600C47094 /* OCRichObjectStrings.m in Sources */,
+				F7BB50C91F22386400C47094 /* OCActivity.m in Sources */,
+				F7BB50AF1F22370300C47094 /* NCManageDatabase.swift in Sources */,
+				F7BB50FA1F2239CB00C47094 /* BKTouchIDManager.m in Sources */,
+				F7BB50EF1F22394E00C47094 /* RNCryptorEngine.m in Sources */,
+				F7BB50BB1F22374E00C47094 /* OCNetworking.m in Sources */,
+				F7BB50C11F22378E00C47094 /* CCHud.m in Sources */,
+				F7BB50DE1F2238B700C47094 /* UtilsFramework.m in Sources */,
+				F7BB50D61F22389900C47094 /* OCHTTPRequestOperation.m in Sources */,
+				F7BB50AC1F2236CD00C47094 /* cryptocloud.xcdatamodeld in Sources */,
+				F7BB50BD1F22376000C47094 /* CCCertificate.m in Sources */,
+				F7BB50DA1F2238A600C47094 /* OCXMLServerErrorsParser.m in Sources */,
+				F7BB50C51F22379B00C47094 /* NSNotificationCenter+MainThread.m in Sources */,
+				F7BB50F11F22395400C47094 /* RNEncryptor.m in Sources */,
+				F7BB50D71F22389C00C47094 /* OCWebDAVClient.m in Sources */,
+				F7BB50C01F22378B00C47094 /* CCError.m in Sources */,
+				F7BB50E01F2238CA00C47094 /* AFNetworkReachabilityManager.m in Sources */,
+				F7BB50F81F2239C400C47094 /* BKPasscodeViewController.m in Sources */,
+				F7BB50E81F2238ED00C47094 /* NSString+Base64.m in Sources */,
 				F74344251E1264EE001CC831 /* FileProvider.swift in Sources */,
 				F74344251E1264EE001CC831 /* FileProvider.swift in Sources */,
+				F7BB50BA1F22374A00C47094 /* CCNetworking.m in Sources */,
+				F7BB50DD1F2238B100C47094 /* NSString+Encode.m in Sources */,
+				F7BB50D51F22389600C47094 /* NSDate+RFC1123.m in Sources */,
+				F7BB50A31F2236C500C47094 /* CCGlobal.m in Sources */,
+				F7BB50B51F22371C00C47094 /* TableCertificates+CoreDataProperties.m in Sources */,
+				F7BB50B71F22372300C47094 /* TableDirectory+CoreDataProperties.m in Sources */,
+				F7BB50E61F2238E700C47094 /* NSData+Base64.m in Sources */,
 				F76B3CD11EAE01BD00921AC9 /* NCBrand.swift in Sources */,
 				F76B3CD11EAE01BD00921AC9 /* NCBrand.swift in Sources */,
+				F7BB50CF1F22388300C47094 /* OCNotificationsAction.m in Sources */,
+				F7BB50F01F22395100C47094 /* RNDecryptor.m in Sources */,
+				F7BB50E51F2238E400C47094 /* AESCrypt.m in Sources */,
+				F7BB50DF1F2238C700C47094 /* AFHTTPSessionManager.m in Sources */,
+				F7BB50FB1F2239CE00C47094 /* BKTouchIDSwitchView.m in Sources */,
+				F7BB50B81F22372600C47094 /* TableLocalFile+CoreDataClass.m in Sources */,
+				F7BB50E91F2238F500C47094 /* AFViewShaker.m in Sources */,
+				F7BB50C31F22379400C47094 /* CCUtility.m in Sources */,
+				F7BB50BE1F22376300C47094 /* CCCrypto.m in Sources */,
+				F7BB50DC1F2238AC00C47094 /* OCXMLSharedParser.m in Sources */,
+				F7BB50F61F2239BC00C47094 /* BKPasscodeInputView.m in Sources */,
+				F7BB50F41F2239B600C47094 /* BKPasscodeDummyViewController.m in Sources */,
+				F7BB50C41F22379800C47094 /* NSString+TruncateToWidth.m in Sources */,
+				F7BB50B11F22370C00C47094 /* CCCoreData.m in Sources */,
+				F7BB50E31F2238D200C47094 /* AFURLResponseSerialization.m in Sources */,
+				F7BB50EB1F22391000C47094 /* MBProgressHUD.m in Sources */,
+				F7BB50B31F22371600C47094 /* TableAccount+CoreDataProperties.m in Sources */,
+				F7BB50D21F22388B00C47094 /* OCShareUser.m in Sources */,
+				F7BB50E71F2238EA00C47094 /* NSData+CommonCrypto.m in Sources */,
+				F7BB50F31F22396300C47094 /* UIImage+animatedGIF.m in Sources */,
+				F7BB50C21F22379100C47094 /* CCGraphics.m in Sources */,
+				F7BB50E11F2238CD00C47094 /* AFSecurityPolicy.m in Sources */,
+				F7BB50EE1F22394B00C47094 /* RNCryptor.m in Sources */,
+				F7BB50B01F22370600C47094 /* NCDatabase.swift in Sources */,
+				F7BB50D41F22389300C47094 /* NSDate+ISO8601.m in Sources */,
+				F7BB50CD1F22387C00C47094 /* OCFileDto.m in Sources */,
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 		};
@@ -4364,24 +4748,29 @@
 				F762CAFD1EACB66200B38484 /* XLFormInlineSelectorCell.m in Sources */,
 				F762CAFD1EACB66200B38484 /* XLFormInlineSelectorCell.m in Sources */,
 				F77B0DF21D118A16002130FE /* CCUploadFromOtherUpp.m in Sources */,
 				F77B0DF21D118A16002130FE /* CCUploadFromOtherUpp.m in Sources */,
 				F77B0DF41D118A16002130FE /* CCMain.m in Sources */,
 				F77B0DF41D118A16002130FE /* CCMain.m in Sources */,
+				F73B4F0D1F470D9100BBEE4B /* nsLatin1Prober.cpp in Sources */,
 				F77B0DF51D118A16002130FE /* CCUtility.m in Sources */,
 				F77B0DF51D118A16002130FE /* CCUtility.m in Sources */,
-				F72AAECC1E5C60C700BB17E1 /* UIImage+AHKAdditions.m in Sources */,
 				F762CB071EACB66200B38484 /* XLFormOptionsObject.m in Sources */,
 				F762CB071EACB66200B38484 /* XLFormOptionsObject.m in Sources */,
 				F7C525A01E3B48B700FFE02C /* CCNotification.swift in Sources */,
 				F7C525A01E3B48B700FFE02C /* CCNotification.swift in Sources */,
 				F77B0DFB1D118A16002130FE /* NYXProgressiveImageView.m in Sources */,
 				F77B0DFB1D118A16002130FE /* NYXProgressiveImageView.m in Sources */,
 				F7F54D0E1E5B14C800E19C62 /* UIImage+MWPhotoBrowser.m in Sources */,
 				F7F54D0E1E5B14C800E19C62 /* UIImage+MWPhotoBrowser.m in Sources */,
 				F7F54D091E5B14C800E19C62 /* MWPhoto.m in Sources */,
 				F7F54D091E5B14C800E19C62 /* MWPhoto.m in Sources */,
+				F73B4F041F470D9100BBEE4B /* nsBig5Prober.cpp in Sources */,
+				F73B4EEF1F470D9100BBEE4B /* CharDistribution.cpp in Sources */,
 				F7B0C0CD1EE7E7750033AC24 /* CCSynchronize.m in Sources */,
 				F7B0C0CD1EE7E7750033AC24 /* CCSynchronize.m in Sources */,
 				F77B0DFF1D118A16002130FE /* OCNetworking.m in Sources */,
 				F77B0DFF1D118A16002130FE /* OCNetworking.m in Sources */,
 				F77B0E011D118A16002130FE /* RNCryptor.m in Sources */,
 				F77B0E011D118A16002130FE /* RNCryptor.m in Sources */,
+				F73B4F081F470D9100BBEE4B /* nsEUCJPProber.cpp in Sources */,
 				F70022DA1EC4C9100080073F /* OCHTTPRequestOperation.m in Sources */,
 				F70022DA1EC4C9100080073F /* OCHTTPRequestOperation.m in Sources */,
 				F7D4245C1F063B82009C9782 /* CTAssetCheckmark.m in Sources */,
 				F7D4245C1F063B82009C9782 /* CTAssetCheckmark.m in Sources */,
 				F70022A11EC4C9100080073F /* AFHTTPSessionManager.m in Sources */,
 				F70022A11EC4C9100080073F /* AFHTTPSessionManager.m in Sources */,
 				F762CB041EACB66200B38484 /* XLFormSwitchCell.m in Sources */,
 				F762CB041EACB66200B38484 /* XLFormSwitchCell.m in Sources */,
+				F73B4F0F1F470D9100BBEE4B /* nsMBCSSM.cpp in Sources */,
 				F77B0E031D118A16002130FE /* CCShareInfoCMOC.m in Sources */,
 				F77B0E031D118A16002130FE /* CCShareInfoCMOC.m in Sources */,
 				F77B0E041D118A16002130FE /* UIImage+animatedGIF.m in Sources */,
 				F77B0E041D118A16002130FE /* UIImage+animatedGIF.m in Sources */,
 				F7D423881F0596C6009C9782 /* ReaderThumbView.m in Sources */,
 				F7D423881F0596C6009C9782 /* ReaderThumbView.m in Sources */,
 				F73CCE301DC13798007E38D8 /* UICKeyChainStore.m in Sources */,
 				F73CCE301DC13798007E38D8 /* UICKeyChainStore.m in Sources */,
+				F73B4EFE1F470D9100BBEE4B /* LangHungarianModel.cpp in Sources */,
 				F762CBBF1EACB89C00B38484 /* LMMediaItemStreamingCache.m in Sources */,
 				F762CBBF1EACB89C00B38484 /* LMMediaItemStreamingCache.m in Sources */,
 				F7D4238A1F0596C6009C9782 /* ThumbsMainToolbar.m in Sources */,
 				F7D4238A1F0596C6009C9782 /* ThumbsMainToolbar.m in Sources */,
 				F70022EC1EC4C9100080073F /* OCXMLSharedParser.m in Sources */,
 				F70022EC1EC4C9100080073F /* OCXMLSharedParser.m in Sources */,
@@ -4399,6 +4788,7 @@
 				F7D4237F1F0596C6009C9782 /* ReaderDocumentOutline.m in Sources */,
 				F7D4237F1F0596C6009C9782 /* ReaderDocumentOutline.m in Sources */,
 				F73F537F1E929C8500F8678D /* CCMore.swift in Sources */,
 				F73F537F1E929C8500F8678D /* CCMore.swift in Sources */,
 				F7D424621F063B82009C9782 /* CTAssetSelectionButton.m in Sources */,
 				F7D424621F063B82009C9782 /* CTAssetSelectionButton.m in Sources */,
+				F73B4EF71F470D9100BBEE4B /* LangBulgarianModel.cpp in Sources */,
 				F7F54D0C1E5B14C800E19C62 /* MWTapDetectingView.m in Sources */,
 				F7F54D0C1E5B14C800E19C62 /* MWTapDetectingView.m in Sources */,
 				F7D424631F063B82009C9782 /* CTAssetSelectionLabel.m in Sources */,
 				F7D424631F063B82009C9782 /* CTAssetSelectionLabel.m in Sources */,
 				F77B0E121D118A16002130FE /* CCPatenteGuida.m in Sources */,
 				F77B0E121D118A16002130FE /* CCPatenteGuida.m in Sources */,
@@ -4411,10 +4801,13 @@
 				F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */,
 				F750374F1DBFA91A008FB480 /* NSArray+PureLayout.m in Sources */,
 				F7A13A031E7F3D5D00016680 /* CCProgressView.m in Sources */,
 				F7A13A031E7F3D5D00016680 /* CCProgressView.m in Sources */,
 				F77B0E141D118A16002130FE /* CCError.m in Sources */,
 				F77B0E141D118A16002130FE /* CCError.m in Sources */,
+				F73B4F131F470D9100BBEE4B /* nsUniversalDetector.cpp in Sources */,
 				F7B0C1751EE839A30033AC24 /* NCAutoUpload.m in Sources */,
 				F7B0C1751EE839A30033AC24 /* NCAutoUpload.m in Sources */,
 				F77B0E161D118A16002130FE /* AFViewShaker.m in Sources */,
 				F77B0E161D118A16002130FE /* AFViewShaker.m in Sources */,
 				F7D424C81F063B82009C9782 /* ZSSBarButtonItem.m in Sources */,
 				F7D424C81F063B82009C9782 /* ZSSBarButtonItem.m in Sources */,
+				F73B4F111F470D9100BBEE4B /* nsSBCSGroupProber.cpp in Sources */,
 				F7D424641F063B82009C9782 /* CTAssetsGridSelectedView.m in Sources */,
 				F7D424641F063B82009C9782 /* CTAssetsGridSelectedView.m in Sources */,
+				F73B4F091F470D9100BBEE4B /* nsEUCKRProber.cpp in Sources */,
 				F7D424711F063B82009C9782 /* CTAssetsViewControllerTransition.m in Sources */,
 				F7D424711F063B82009C9782 /* CTAssetsViewControllerTransition.m in Sources */,
 				F762CB021EACB66200B38484 /* XLFormSliderCell.m in Sources */,
 				F762CB021EACB66200B38484 /* XLFormSliderCell.m in Sources */,
 				F77B0E1B1D118A16002130FE /* CCGraphics.m in Sources */,
 				F77B0E1B1D118A16002130FE /* CCGraphics.m in Sources */,
@@ -4428,7 +4821,9 @@
 				F720E01F1E48C73E001A4B9E /* CCActions.swift in Sources */,
 				F720E01F1E48C73E001A4B9E /* CCActions.swift in Sources */,
 				F762CB081EACB66200B38484 /* XLFormOptionsViewController.m in Sources */,
 				F762CB081EACB66200B38484 /* XLFormOptionsViewController.m in Sources */,
 				F73CC0721E813DFF006E3047 /* BKPasscodeLockScreenManager.m in Sources */,
 				F73CC0721E813DFF006E3047 /* BKPasscodeLockScreenManager.m in Sources */,
+				F73B4F101F470D9100BBEE4B /* nsSBCharSetProber.cpp in Sources */,
 				F762CB0E1EACB66200B38484 /* NSExpression+XLFormAdditions.m in Sources */,
 				F762CB0E1EACB66200B38484 /* NSExpression+XLFormAdditions.m in Sources */,
+				F73B4F071F470D9100BBEE4B /* nsEscSM.cpp in Sources */,
 				F77B0E221D118A16002130FE /* CCManageLocation.m in Sources */,
 				F77B0E221D118A16002130FE /* CCManageLocation.m in Sources */,
 				F70022C51EC4C9100080073F /* OCNotificationsAction.m in Sources */,
 				F70022C51EC4C9100080073F /* OCNotificationsAction.m in Sources */,
 				F77B0E231D118A16002130FE /* CCSharePermissionOC.m in Sources */,
 				F77B0E231D118A16002130FE /* CCSharePermissionOC.m in Sources */,
@@ -4438,6 +4833,8 @@
 				F75AE3C71E9D12900088BB09 /* SwiftyAvatar.swift in Sources */,
 				F75AE3C71E9D12900088BB09 /* SwiftyAvatar.swift in Sources */,
 				F762CAFC1EACB66200B38484 /* XLFormImageCell.m in Sources */,
 				F762CAFC1EACB66200B38484 /* XLFormImageCell.m in Sources */,
 				F70022D11EC4C9100080073F /* OCUserProfile.m in Sources */,
 				F70022D11EC4C9100080073F /* OCUserProfile.m in Sources */,
+				F73B4EF61F470D9100BBEE4B /* LangArabicModel.cpp in Sources */,
+				F73B4F0B1F470D9100BBEE4B /* nsGB2312Prober.cpp in Sources */,
 				F762CAFE1EACB66200B38484 /* XLFormLeftRightSelectorCell.m in Sources */,
 				F762CAFE1EACB66200B38484 /* XLFormLeftRightSelectorCell.m in Sources */,
 				F77B0E301D118A16002130FE /* CCHud.m in Sources */,
 				F77B0E301D118A16002130FE /* CCHud.m in Sources */,
 				F7D423891F0596C6009C9782 /* ReaderViewController.m in Sources */,
 				F7D423891F0596C6009C9782 /* ReaderViewController.m in Sources */,
@@ -4447,11 +4844,13 @@
 				F70022E31EC4C9100080073F /* OCXMLParser.m in Sources */,
 				F70022E31EC4C9100080073F /* OCXMLParser.m in Sources */,
 				F77B0E311D118A16002130FE /* CCExifGeo.m in Sources */,
 				F77B0E311D118A16002130FE /* CCExifGeo.m in Sources */,
 				F7D4246B1F063B82009C9782 /* CTAssetsPageView.m in Sources */,
 				F7D4246B1F063B82009C9782 /* CTAssetsPageView.m in Sources */,
+				F73B4F0E1F470D9100BBEE4B /* nsMBCSGroupProber.cpp in Sources */,
 				F78964AE1EBB576C00403E13 /* JDStatusBarStyle.m in Sources */,
 				F78964AE1EBB576C00403E13 /* JDStatusBarStyle.m in Sources */,
 				F7D424C11F063B82009C9782 /* CYRToken.m in Sources */,
 				F7D424C11F063B82009C9782 /* CYRToken.m in Sources */,
 				F7BAADD71ED5A87C00B7EAD4 /* TableCertificates+CoreDataProperties.m in Sources */,
 				F7BAADD71ED5A87C00B7EAD4 /* TableCertificates+CoreDataProperties.m in Sources */,
 				F762CBC01EACB89C00B38484 /* LMMediaPlayer.m in Sources */,
 				F762CBC01EACB89C00B38484 /* LMMediaPlayer.m in Sources */,
 				F7D423831F0596C6009C9782 /* ReaderThumbFetch.m in Sources */,
 				F7D423831F0596C6009C9782 /* ReaderThumbFetch.m in Sources */,
+				F73B4F171F470D9100BBEE4B /* uchardet.cpp in Sources */,
 				F7D424C31F063B82009C9782 /* HRCgUtil.m in Sources */,
 				F7D424C31F063B82009C9782 /* HRCgUtil.m in Sources */,
 				F77B0E351D118A16002130FE /* NYXImagesHelper.m in Sources */,
 				F77B0E351D118A16002130FE /* NYXImagesHelper.m in Sources */,
 				F7D424721F063B82009C9782 /* CTAssetThumbnailOverlay.m in Sources */,
 				F7D424721F063B82009C9782 /* CTAssetThumbnailOverlay.m in Sources */,
@@ -4459,6 +4858,7 @@
 				F77B0E391D118A16002130FE /* CCContoCorrente.m in Sources */,
 				F77B0E391D118A16002130FE /* CCContoCorrente.m in Sources */,
 				F77B0E3A1D118A16002130FE /* RNCryptorEngine.m in Sources */,
 				F77B0E3A1D118A16002130FE /* RNCryptorEngine.m in Sources */,
 				F7D424CB1F063B82009C9782 /* ZSSTextView.m in Sources */,
 				F7D424CB1F063B82009C9782 /* ZSSTextView.m in Sources */,
+				F73B4F121F470D9100BBEE4B /* nsSJISProber.cpp in Sources */,
 				F77B0E3C1D118A16002130FE /* CCCartaIdentita.m in Sources */,
 				F77B0E3C1D118A16002130FE /* CCCartaIdentita.m in Sources */,
 				F7BAADD41ED5A87C00B7EAD4 /* TableCertificates+CoreDataClass.m in Sources */,
 				F7BAADD41ED5A87C00B7EAD4 /* TableCertificates+CoreDataClass.m in Sources */,
 				F762CAFF1EACB66200B38484 /* XLFormPickerCell.m in Sources */,
 				F762CAFF1EACB66200B38484 /* XLFormPickerCell.m in Sources */,
@@ -4485,10 +4885,15 @@
 				F762CB171EACB66200B38484 /* XLFormRegexValidator.m in Sources */,
 				F762CB171EACB66200B38484 /* XLFormRegexValidator.m in Sources */,
 				F73CC0691E813DFF006E3047 /* BKPasscodeDummyViewController.m in Sources */,
 				F73CC0691E813DFF006E3047 /* BKPasscodeDummyViewController.m in Sources */,
 				F762CB1A1EACB66200B38484 /* XLForm.m in Sources */,
 				F762CB1A1EACB66200B38484 /* XLForm.m in Sources */,
+				F73B4EFC1F470D9100BBEE4B /* LangGreekModel.cpp in Sources */,
 				F762CB051EACB66200B38484 /* XLFormTextFieldCell.m in Sources */,
 				F762CB051EACB66200B38484 /* XLFormTextFieldCell.m in Sources */,
+				F7B4F1CB1F44356F00B53B42 /* NCUchardet.m in Sources */,
+				F73B4EFB1F470D9100BBEE4B /* LangGermanModel.cpp in Sources */,
 				F77B0E5B1D118A16002130FE /* UIImage+Rotating.m in Sources */,
 				F77B0E5B1D118A16002130FE /* UIImage+Rotating.m in Sources */,
+				F73B4F061F470D9100BBEE4B /* nsEscCharsetProber.cpp in Sources */,
 				F7A321561E9E2A070069AD1B /* CCFavoritesCell.m in Sources */,
 				F7A321561E9E2A070069AD1B /* CCFavoritesCell.m in Sources */,
 				F7D4237D1F0596C6009C9782 /* ReaderContentView.m in Sources */,
 				F7D4237D1F0596C6009C9782 /* ReaderContentView.m in Sources */,
+				F73B4EFA1F470D9100BBEE4B /* LangFrenchModel.cpp in Sources */,
 				F7D4245D1F063B82009C9782 /* CTAssetCollectionViewCell.m in Sources */,
 				F7D4245D1F063B82009C9782 /* CTAssetCollectionViewCell.m in Sources */,
 				F7D4245E1F063B82009C9782 /* CTAssetCollectionViewController.m in Sources */,
 				F7D4245E1F063B82009C9782 /* CTAssetCollectionViewController.m in Sources */,
 				F762CAF91EACB66200B38484 /* XLFormCheckCell.m in Sources */,
 				F762CAF91EACB66200B38484 /* XLFormCheckCell.m in Sources */,
@@ -4508,11 +4913,14 @@
 				F7D424611F063B82009C9782 /* CTAssetScrollView.m in Sources */,
 				F7D424611F063B82009C9782 /* CTAssetScrollView.m in Sources */,
 				F762CB141EACB66200B38484 /* XLFormRightImageButton.m in Sources */,
 				F762CB141EACB66200B38484 /* XLFormRightImageButton.m in Sources */,
 				F7B3A4EE1E97818A000DACE8 /* CCLoginWeb.swift in Sources */,
 				F7B3A4EE1E97818A000DACE8 /* CCLoginWeb.swift in Sources */,
+				F73D71621F2673C200E233EB /* NCText.swift in Sources */,
 				F77B0E631D118A16002130FE /* CCShareOC.m in Sources */,
 				F77B0E631D118A16002130FE /* CCShareOC.m in Sources */,
+				F73B4EF81F470D9100BBEE4B /* LangDanishModel.cpp in Sources */,
 				F73CCE261DC13788007E38D8 /* UIScrollView+EmptyDataSet.m in Sources */,
 				F73CCE261DC13788007E38D8 /* UIScrollView+EmptyDataSet.m in Sources */,
 				F7D4246F1F063B82009C9782 /* CTAssetsPickerController.m in Sources */,
 				F7D4246F1F063B82009C9782 /* CTAssetsPickerController.m in Sources */,
 				F7F54D071E5B14C800E19C62 /* MWGridCell.m in Sources */,
 				F7F54D071E5B14C800E19C62 /* MWGridCell.m in Sources */,
 				F77B0E661D118A16002130FE /* NSString+Base64.m in Sources */,
 				F77B0E661D118A16002130FE /* NSString+Base64.m in Sources */,
+				F73B4F051F470D9100BBEE4B /* nsCharSetProber.cpp in Sources */,
 				F77B0E671D118A16002130FE /* Reachability.m in Sources */,
 				F77B0E671D118A16002130FE /* Reachability.m in Sources */,
 				F762CB121EACB66200B38484 /* UIView+XLFormAdditions.m in Sources */,
 				F762CB121EACB66200B38484 /* UIView+XLFormAdditions.m in Sources */,
 				F73CC06F1E813DFF006E3047 /* BKPasscodeInputView.m in Sources */,
 				F73CC06F1E813DFF006E3047 /* BKPasscodeInputView.m in Sources */,
@@ -4525,6 +4933,7 @@
 				F762CBBD1EACB89C00B38484 /* LMMediaItem.m in Sources */,
 				F762CBBD1EACB89C00B38484 /* LMMediaItem.m in Sources */,
 				F7659A2E1DC0B72F004860C4 /* EARestrictedScrollView.m in Sources */,
 				F7659A2E1DC0B72F004860C4 /* EARestrictedScrollView.m in Sources */,
 				F7D423861F0596C6009C9782 /* ReaderThumbRequest.m in Sources */,
 				F7D423861F0596C6009C9782 /* ReaderThumbRequest.m in Sources */,
+				F73B4EF51F470D9100BBEE4B /* JpCntx.cpp in Sources */,
 				F77B0E741D118A16002130FE /* CCBancomat.m in Sources */,
 				F77B0E741D118A16002130FE /* CCBancomat.m in Sources */,
 				F77B0E7B1D118A16002130FE /* CCPassaporto.m in Sources */,
 				F77B0E7B1D118A16002130FE /* CCPassaporto.m in Sources */,
 				F7D4246A1F063B82009C9782 /* CTAssetsNavigationController.m in Sources */,
 				F7D4246A1F063B82009C9782 /* CTAssetsNavigationController.m in Sources */,
@@ -4540,10 +4949,10 @@
 				F77B0E8A1D118A16002130FE /* CCCartaDiCredito.m in Sources */,
 				F77B0E8A1D118A16002130FE /* CCCartaDiCredito.m in Sources */,
 				F70022B91EC4C9100080073F /* OCCommunication.m in Sources */,
 				F70022B91EC4C9100080073F /* OCCommunication.m in Sources */,
 				F762CB181EACB66200B38484 /* XLFormValidationStatus.m in Sources */,
 				F762CB181EACB66200B38484 /* XLFormValidationStatus.m in Sources */,
+				F73B4EF91F470D9100BBEE4B /* LangEsperantoModel.cpp in Sources */,
 				F77B0E8F1D118A16002130FE /* CCSection.m in Sources */,
 				F77B0E8F1D118A16002130FE /* CCSection.m in Sources */,
 				F72AAECB1E5C60C700BB17E1 /* AHKActionSheetViewController.m in Sources */,
 				F72AAECB1E5C60C700BB17E1 /* AHKActionSheetViewController.m in Sources */,
 				F77B0E911D118A16002130FE /* CCTemplates.m in Sources */,
 				F77B0E911D118A16002130FE /* CCTemplates.m in Sources */,
-				F72AAECD1E5C60C700BB17E1 /* UIWindow+AHKAdditions.m in Sources */,
 				F77B0E921D118A16002130FE /* CCCellMainTransfer.m in Sources */,
 				F77B0E921D118A16002130FE /* CCCellMainTransfer.m in Sources */,
 				F7659A391DC0B737004860C4 /* iRate.m in Sources */,
 				F7659A391DC0B737004860C4 /* iRate.m in Sources */,
 				F7B1FBC81E72E3D1001781FE /* SwiftWebVCActivity.swift in Sources */,
 				F7B1FBC81E72E3D1001781FE /* SwiftWebVCActivity.swift in Sources */,
@@ -4563,10 +4972,12 @@
 				F78088EA1DD3A1DB005C5A7C /* cryptocloud.xcdatamodeld in Sources */,
 				F78088EA1DD3A1DB005C5A7C /* cryptocloud.xcdatamodeld in Sources */,
 				F70022C21EC4C9100080073F /* OCNotifications.m in Sources */,
 				F70022C21EC4C9100080073F /* OCNotifications.m in Sources */,
 				F70022BF1EC4C9100080073F /* OCFileDto.m in Sources */,
 				F70022BF1EC4C9100080073F /* OCFileDto.m in Sources */,
+				F73B4F011F470D9100BBEE4B /* LangThaiModel.cpp in Sources */,
 				F7A13A041E7F3D5D00016680 /* UINavigationController+CCProgress.m in Sources */,
 				F7A13A041E7F3D5D00016680 /* UINavigationController+CCProgress.m in Sources */,
 				F73C002F1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.m in Sources */,
 				F73C002F1E55D7DF00EEEFA7 /* CCManageCryptoCloudSecurity.m in Sources */,
 				F70022DD1EC4C9100080073F /* OCWebDAVClient.m in Sources */,
 				F70022DD1EC4C9100080073F /* OCWebDAVClient.m in Sources */,
 				F7D424C41F063B82009C9782 /* HRColorCursor.m in Sources */,
 				F7D424C41F063B82009C9782 /* HRColorCursor.m in Sources */,
+				F73B4F001F470D9100BBEE4B /* LangSpanishModel.cpp in Sources */,
 				F77B0EAD1D118A16002130FE /* CCGlobal.m in Sources */,
 				F77B0EAD1D118A16002130FE /* CCGlobal.m in Sources */,
 				F70022BC1EC4C9100080073F /* OCExternalSites.m in Sources */,
 				F70022BC1EC4C9100080073F /* OCExternalSites.m in Sources */,
 				F73CC07B1E813DFF006E3047 /* BKTouchIDManager.m in Sources */,
 				F73CC07B1E813DFF006E3047 /* BKTouchIDManager.m in Sources */,
@@ -4587,19 +4998,23 @@
 				F7D4238C1F0596C6009C9782 /* UIXToolbarView.m in Sources */,
 				F7D4238C1F0596C6009C9782 /* UIXToolbarView.m in Sources */,
 				F77B0EB81D118A16002130FE /* CCAccountWeb.m in Sources */,
 				F77B0EB81D118A16002130FE /* CCAccountWeb.m in Sources */,
 				F7A321791E9E3EAF0069AD1B /* CCTransfers.m in Sources */,
 				F7A321791E9E3EAF0069AD1B /* CCTransfers.m in Sources */,
+				F73B4F0C1F470D9100BBEE4B /* nsHebrewProber.cpp in Sources */,
 				F762CBC11EACB89C00B38484 /* LMMediaPlayerView.m in Sources */,
 				F762CBC11EACB89C00B38484 /* LMMediaPlayerView.m in Sources */,
 				F762CAFB1EACB66200B38484 /* XLFormDatePickerCell.m in Sources */,
 				F762CAFB1EACB66200B38484 /* XLFormDatePickerCell.m in Sources */,
 				F762CB0F1EACB66200B38484 /* NSObject+XLFormAdditions.m in Sources */,
 				F762CB0F1EACB66200B38484 /* NSObject+XLFormAdditions.m in Sources */,
 				F762CB891EACB81000B38484 /* REMenuItem.m in Sources */,
 				F762CB891EACB81000B38484 /* REMenuItem.m in Sources */,
 				F762CBBB1EACB89C00B38484 /* NSArray+LMMediaPlayerShuffle.m in Sources */,
 				F762CBBB1EACB89C00B38484 /* NSArray+LMMediaPlayerShuffle.m in Sources */,
 				F7D423791F0596C6009C9782 /* CGPDFDocument.m in Sources */,
 				F7D423791F0596C6009C9782 /* CGPDFDocument.m in Sources */,
+				F73B4EFF1F470D9100BBEE4B /* LangRussianModel.cpp in Sources */,
 				F7BAADFF1ED5B2A500B7EAD4 /* TableLocalFile+CoreDataClass.m in Sources */,
 				F7BAADFF1ED5B2A500B7EAD4 /* TableLocalFile+CoreDataClass.m in Sources */,
 				F7BAADCB1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */,
 				F7BAADCB1ED5A87C00B7EAD4 /* NCManageDatabase.swift in Sources */,
 				F7D424551F063B82009C9782 /* NSIndexSet+CTAssetsPickerController.m in Sources */,
 				F7D424551F063B82009C9782 /* NSIndexSet+CTAssetsPickerController.m in Sources */,
 				F7BAADDA1ED5A87C00B7EAD4 /* TableDirectory+CoreDataClass.m in Sources */,
 				F7BAADDA1ED5A87C00B7EAD4 /* TableDirectory+CoreDataClass.m in Sources */,
 				F7A321551E9E2A070069AD1B /* CCFavorites.m in Sources */,
 				F7A321551E9E2A070069AD1B /* CCFavorites.m in Sources */,
 				F7BAADE01ED5A87C00B7EAD4 /* TableLocalFile+CoreDataProperties.m in Sources */,
 				F7BAADE01ED5A87C00B7EAD4 /* TableLocalFile+CoreDataProperties.m in Sources */,
+				F73B4F031F470D9100BBEE4B /* LangVietnameseModel.cpp in Sources */,
 				F77B0EBE1D118A16002130FE /* CCNote.m in Sources */,
 				F77B0EBE1D118A16002130FE /* CCNote.m in Sources */,
+				F73B4F021F470D9100BBEE4B /* LangTurkishModel.cpp in Sources */,
 				F7F54D0B1E5B14C800E19C62 /* MWTapDetectingImageView.m in Sources */,
 				F7F54D0B1E5B14C800E19C62 /* MWTapDetectingImageView.m in Sources */,
 				F77B0EBF1D118A16002130FE /* RNEncryptor.m in Sources */,
 				F77B0EBF1D118A16002130FE /* RNEncryptor.m in Sources */,
 				F7D423821F0596C6009C9782 /* ReaderThumbCache.m in Sources */,
 				F7D423821F0596C6009C9782 /* ReaderThumbCache.m in Sources */,
@@ -4619,6 +5034,7 @@
 				F7D423811F0596C6009C9782 /* ReaderMainToolbar.m in Sources */,
 				F7D423811F0596C6009C9782 /* ReaderMainToolbar.m in Sources */,
 				F762CB131EACB66200B38484 /* XLFormRightDetailCell.m in Sources */,
 				F762CB131EACB66200B38484 /* XLFormRightDetailCell.m in Sources */,
 				F7D4237B1F0596C6009C9782 /* ReaderContentPage.m in Sources */,
 				F7D4237B1F0596C6009C9782 /* ReaderContentPage.m in Sources */,
+				F73B4F0A1F470D9100BBEE4B /* nsEUCTWProber.cpp in Sources */,
 				F762CB871EACB81000B38484 /* REMenu.m in Sources */,
 				F762CB871EACB81000B38484 /* REMenu.m in Sources */,
 				F762CB091EACB66200B38484 /* XLFormViewController.m in Sources */,
 				F762CB091EACB66200B38484 /* XLFormViewController.m in Sources */,
 				F762CB161EACB66200B38484 /* XLFormTextView.m in Sources */,
 				F762CB161EACB66200B38484 /* XLFormTextView.m in Sources */,
@@ -4635,6 +5051,7 @@
 				F7D423851F0596C6009C9782 /* ReaderThumbRender.m in Sources */,
 				F7D423851F0596C6009C9782 /* ReaderThumbRender.m in Sources */,
 				F72AAECA1E5C60C700BB17E1 /* AHKActionSheet.m in Sources */,
 				F72AAECA1E5C60C700BB17E1 /* AHKActionSheet.m in Sources */,
 				F7D424C51F063B82009C9782 /* HRColorPickerView.m in Sources */,
 				F7D424C51F063B82009C9782 /* HRColorPickerView.m in Sources */,
+				F73B4F141F470D9100BBEE4B /* nsUTF8Prober.cpp in Sources */,
 				F70022C81EC4C9100080073F /* OCRichObjectStrings.m in Sources */,
 				F70022C81EC4C9100080073F /* OCRichObjectStrings.m in Sources */,
 				F7D423841F0596C6009C9782 /* ReaderThumbQueue.m in Sources */,
 				F7D423841F0596C6009C9782 /* ReaderThumbQueue.m in Sources */,
 				F7A3217A1E9E3EAF0069AD1B /* CCTransfersCell.m in Sources */,
 				F7A3217A1E9E3EAF0069AD1B /* CCTransfersCell.m in Sources */,
@@ -4644,6 +5061,7 @@
 				F7D4245B1F063B82009C9782 /* UIImage+CTAssetsPickerController.m in Sources */,
 				F7D4245B1F063B82009C9782 /* UIImage+CTAssetsPickerController.m in Sources */,
 				F73CC06C1E813DFF006E3047 /* BKPasscodeField.m in Sources */,
 				F73CC06C1E813DFF006E3047 /* BKPasscodeField.m in Sources */,
 				F77B0ED51D118A16002130FE /* PHAsset+Utility.m in Sources */,
 				F77B0ED51D118A16002130FE /* PHAsset+Utility.m in Sources */,
+				F73B4EFD1F470D9100BBEE4B /* LangHebrewModel.cpp in Sources */,
 				F70022CE1EC4C9100080073F /* OCShareUser.m in Sources */,
 				F70022CE1EC4C9100080073F /* OCShareUser.m in Sources */,
 				F77B0ED91D118A16002130FE /* main.m in Sources */,
 				F77B0ED91D118A16002130FE /* main.m in Sources */,
 			);
 			);
@@ -4688,9 +5106,10 @@
 				F78D6F531F0B7D47002F9619 /* pl */,
 				F78D6F531F0B7D47002F9619 /* pl */,
 				F78D6F5A1F0B7D9B002F9619 /* nl */,
 				F78D6F5A1F0B7D9B002F9619 /* nl */,
 				F78D6F611F0B7DDF002F9619 /* es */,
 				F78D6F611F0B7DDF002F9619 /* es */,
-				F78D6F681F0B7E1F002F9619 /* el */,
 				F7D046B11F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046B11F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046B81F0E1EA000A3F350 /* is */,
 				F7D046B81F0E1EA000A3F350 /* is */,
+				F7E394971F2A1CC600A94CAC /* sq */,
+				F7DE9AAF1F482FA5008DFE10 /* sv */,
 			);
 			);
 			name = BKPasscodeView.strings;
 			name = BKPasscodeView.strings;
 			path = "Supporting Files";
 			path = "Supporting Files";
@@ -4714,9 +5133,10 @@
 				F78D6F521F0B7D47002F9619 /* pl */,
 				F78D6F521F0B7D47002F9619 /* pl */,
 				F78D6F591F0B7D9A002F9619 /* nl */,
 				F78D6F591F0B7D9A002F9619 /* nl */,
 				F78D6F601F0B7DDF002F9619 /* es */,
 				F78D6F601F0B7DDF002F9619 /* es */,
-				F78D6F671F0B7E1F002F9619 /* el */,
 				F7D046B01F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046B01F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046B71F0E1EA000A3F350 /* is */,
 				F7D046B71F0E1EA000A3F350 /* is */,
+				F7E394961F2A1CC600A94CAC /* sq */,
+				F7DE9AAE1F482FA5008DFE10 /* sv */,
 			);
 			);
 			name = SwiftWebVC.strings;
 			name = SwiftWebVC.strings;
 			path = "Supporting Files";
 			path = "Supporting Files";
@@ -4740,9 +5160,10 @@
 				F78D6F561F0B7D47002F9619 /* pl */,
 				F78D6F561F0B7D47002F9619 /* pl */,
 				F78D6F5D1F0B7D9B002F9619 /* nl */,
 				F78D6F5D1F0B7D9B002F9619 /* nl */,
 				F78D6F641F0B7DDF002F9619 /* es */,
 				F78D6F641F0B7DDF002F9619 /* es */,
-				F78D6F6B1F0B7E1F002F9619 /* el */,
 				F7D046B41F0E1E2000A3F350 /* zh-Hans */,
 				F7D046B41F0E1E2000A3F350 /* zh-Hans */,
 				F7D046BB1F0E1EA100A3F350 /* is */,
 				F7D046BB1F0E1EA100A3F350 /* is */,
+				F7E3949A1F2A1CC700A94CAC /* sq */,
+				F7DE9AB21F482FA5008DFE10 /* sv */,
 			);
 			);
 			name = Intro.strings;
 			name = Intro.strings;
 			path = "Supporting Files";
 			path = "Supporting Files";
@@ -4766,9 +5187,10 @@
 				F78D6F511F0B7D47002F9619 /* pl */,
 				F78D6F511F0B7D47002F9619 /* pl */,
 				F78D6F581F0B7D9A002F9619 /* nl */,
 				F78D6F581F0B7D9A002F9619 /* nl */,
 				F78D6F5F1F0B7DDE002F9619 /* es */,
 				F78D6F5F1F0B7DDE002F9619 /* es */,
-				F78D6F661F0B7E1E002F9619 /* el */,
 				F7D046AF1F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046AF1F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046B61F0E1EA000A3F350 /* is */,
 				F7D046B61F0E1EA000A3F350 /* is */,
+				F7E394951F2A1CC600A94CAC /* sq */,
+				F7DE9AAD1F482FA5008DFE10 /* sv */,
 			);
 			);
 			name = CTAssetsPicker.strings;
 			name = CTAssetsPicker.strings;
 			path = "Supporting Files";
 			path = "Supporting Files";
@@ -4792,9 +5214,10 @@
 				F78D6F571F0B7D48002F9619 /* pl */,
 				F78D6F571F0B7D48002F9619 /* pl */,
 				F78D6F5E1F0B7D9B002F9619 /* nl */,
 				F78D6F5E1F0B7D9B002F9619 /* nl */,
 				F78D6F651F0B7DDF002F9619 /* es */,
 				F78D6F651F0B7DDF002F9619 /* es */,
-				F78D6F6C1F0B7E1F002F9619 /* el */,
 				F7D046B51F0E1E2000A3F350 /* zh-Hans */,
 				F7D046B51F0E1E2000A3F350 /* zh-Hans */,
 				F7D046BC1F0E1EA100A3F350 /* is */,
 				F7D046BC1F0E1EA100A3F350 /* is */,
+				F7E3949B1F2A1CC700A94CAC /* sq */,
+				F7DE9AB31F482FA5008DFE10 /* sv */,
 			);
 			);
 			name = Error.strings;
 			name = Error.strings;
 			path = "Supporting Files";
 			path = "Supporting Files";
@@ -4818,9 +5241,10 @@
 				F78D6F551F0B7D47002F9619 /* pl */,
 				F78D6F551F0B7D47002F9619 /* pl */,
 				F78D6F5C1F0B7D9B002F9619 /* nl */,
 				F78D6F5C1F0B7D9B002F9619 /* nl */,
 				F78D6F631F0B7DDF002F9619 /* es */,
 				F78D6F631F0B7DDF002F9619 /* es */,
-				F78D6F6A1F0B7E1F002F9619 /* el */,
 				F7D046B31F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046B31F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046BA1F0E1EA100A3F350 /* is */,
 				F7D046BA1F0E1EA100A3F350 /* is */,
+				F7E394991F2A1CC700A94CAC /* sq */,
+				F7DE9AB11F482FA5008DFE10 /* sv */,
 			);
 			);
 			name = InfoPlist.strings;
 			name = InfoPlist.strings;
 			path = "Supporting Files";
 			path = "Supporting Files";
@@ -4844,9 +5268,10 @@
 				F78D6F541F0B7D47002F9619 /* pl */,
 				F78D6F541F0B7D47002F9619 /* pl */,
 				F78D6F5B1F0B7D9B002F9619 /* nl */,
 				F78D6F5B1F0B7D9B002F9619 /* nl */,
 				F78D6F621F0B7DDF002F9619 /* es */,
 				F78D6F621F0B7DDF002F9619 /* es */,
-				F78D6F691F0B7E1F002F9619 /* el */,
 				F7D046B21F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046B21F0E1E1F00A3F350 /* zh-Hans */,
 				F7D046B91F0E1EA100A3F350 /* is */,
 				F7D046B91F0E1EA100A3F350 /* is */,
+				F7E394981F2A1CC600A94CAC /* sq */,
+				F7DE9AB01F482FA5008DFE10 /* sv */,
 			);
 			);
 			name = Localizable.strings;
 			name = Localizable.strings;
 			path = "Supporting Files";
 			path = "Supporting Files";
@@ -5022,22 +5447,28 @@
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
 				CLANG_ANALYZER_NONNULL = YES;
 				CLANG_ANALYZER_NONNULL = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_MODULES = YES;
-				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/PickerFileProvider.entitlements;
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/PickerFileProvider.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEBUG_INFORMATION_FORMAT = dwarf;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
-				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(PROJECT_DIR)\"/Libraries external/Realm\"",
+				);
+				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					DEBUG,
 					DEBUG,
 					EXTENSION,
 					EXTENSION,
+					EXTENSION_PICKER_FILE_PROVIDER,
 					NC,
 					NC,
 				);
 				);
+				HEADER_SEARCH_PATHS = "\"Libraries external\"/**";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/PickerFileProvider.plist";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/PickerFileProvider.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
-				LIBRARY_SEARCH_PATHS = "$(inherited)";
+				LIBRARY_SEARCH_PATHS = "\"Libraries external\"/**";
 				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.PickerFileProvider;
 				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.PickerFileProvider;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SKIP_INSTALL = YES;
@@ -5055,21 +5486,27 @@
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
 				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
 				CLANG_ANALYZER_NONNULL = YES;
 				CLANG_ANALYZER_NONNULL = YES;
 				CLANG_ENABLE_MODULES = YES;
 				CLANG_ENABLE_MODULES = YES;
-				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/PickerFileProvider.entitlements;
 				CODE_SIGN_ENTITLEMENTS = iOSClient/Brand/PickerFileProvider.entitlements;
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				CODE_SIGN_IDENTITY = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
 				DEVELOPMENT_TEAM = 6JLRKY9ZV7;
-				FRAMEWORK_SEARCH_PATHS = "$(inherited)";
+				FRAMEWORK_SEARCH_PATHS = (
+					"$(inherited)",
+					"$(PROJECT_DIR)\"/Libraries external/Realm\"",
+				);
+				GCC_PREFIX_HEADER = iOSClient/CryptoCloud.pch;
 				GCC_PREPROCESSOR_DEFINITIONS = (
 				GCC_PREPROCESSOR_DEFINITIONS = (
 					EXTENSION,
 					EXTENSION,
+					EXTENSION_PICKER_FILE_PROVIDER,
 					NC,
 					NC,
 				);
 				);
+				HEADER_SEARCH_PATHS = "\"Libraries external\"/**";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/PickerFileProvider.plist";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/PickerFileProvider.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
-				LIBRARY_SEARCH_PATHS = "$(inherited)";
+				LIBRARY_SEARCH_PATHS = "\"Libraries external\"/**";
 				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.PickerFileProvider;
 				PRODUCT_BUNDLE_IDENTIFIER = it.twsweb.Nextcloud.PickerFileProvider;
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				PRODUCT_NAME = "$(TARGET_NAME)";
 				SKIP_INSTALL = YES;
 				SKIP_INSTALL = YES;
@@ -5109,7 +5546,7 @@
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
-				LIBRARY_SEARCH_PATHS = "\"Libraries external\"/**";
+				LIBRARY_SEARCH_PATHS = "\"Libraries external/openssl\"";
 				OTHER_LDFLAGS = (
 				OTHER_LDFLAGS = (
 					"-Obj-C",
 					"-Obj-C",
 					"-all_load",
 					"-all_load",
@@ -5157,7 +5594,7 @@
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
 				INFOPLIST_FILE = "$(SRCROOT)/iOSClient/Brand/iOSClient.plist";
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				IPHONEOS_DEPLOYMENT_TARGET = 8.0;
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
 				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks";
-				LIBRARY_SEARCH_PATHS = "\"Libraries external\"/**";
+				LIBRARY_SEARCH_PATHS = "\"Libraries external/openssl\"";
 				OTHER_LDFLAGS = (
 				OTHER_LDFLAGS = (
 					"-Obj-C",
 					"-Obj-C",
 					"-all_load",
 					"-all_load",

+ 94 - 141
Picker/DocumentPickerViewController.swift

@@ -39,19 +39,19 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
     var parameterMode: UIDocumentPickerMode?
     var parameterMode: UIDocumentPickerMode?
     var parameterOriginalURL: URL?
     var parameterOriginalURL: URL?
     var parameterProviderIdentifier: String!
     var parameterProviderIdentifier: String!
-    var parameterPasscodeCorrect: Bool? = false
-    var parameterEncrypted: Bool? = false
-    var isCryptoCloudMode: Bool? = false
+    var parameterPasscodeCorrect: Bool = false
+    var parameterEncrypted: Bool = false
+    var isCryptoCloudMode: Bool = false
     
     
-    var metadata: tableMetadata?
+    var recordMetadata = tableMetadata()
     var recordsTableMetadata: [tableMetadata]?
     var recordsTableMetadata: [tableMetadata]?
-    var titleFolder: String?
+    var titleFolder: String = ""
     
     
-    var activeAccount: String?
-    var activeUrl: String?
-    var activeUser: String?
-    var activePassword: String?
-    var directoryUser: String?
+    var activeAccount: String = ""
+    var activeUrl: String = ""
+    var activeUser: String = ""
+    var activePassword: String = ""
+    var directoryUser: String = ""
     
     
     var serverUrl: String?
     var serverUrl: String?
     var thumbnailInLoading = [String: IndexPath]()
     var thumbnailInLoading = [String: IndexPath]()
@@ -59,8 +59,8 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
     
     
     var passcodeFailedAttempts: UInt = 0
     var passcodeFailedAttempts: UInt = 0
     var passcodeLockUntilDate: Date? = nil
     var passcodeLockUntilDate: Date? = nil
-    var passcodeIsPush: Bool? = false
-    var serverUrlPush: String?
+    var passcodeIsPush: Bool = false
+    var serverUrlPush: String = ""
     
     
     
     
     lazy var networkingOperationQueue: OperationQueue = {
     lazy var networkingOperationQueue: OperationQueue = {
@@ -95,15 +95,12 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
             activeUser = record.user
             activeUser = record.user
             directoryUser = CCUtility.getDirectoryActiveUser(activeUser, activeUrl: activeUrl)
             directoryUser = CCUtility.getDirectoryActiveUser(activeUser, activeUrl: activeUrl)
             
             
-            if (self.serverUrl == nil) {
-            
-                self.serverUrl = CCUtility.getHomeServerUrlActiveUrl(activeUrl)
-                                
+            if serverUrl == nil {
+                serverUrl = CCUtility.getHomeServerUrlActiveUrl(activeUrl)
             } else {
             } else {
-                
                 self.navigationItem.title = titleFolder
                 self.navigationItem.title = titleFolder
             }
             }
-            
+        
         } else {
         } else {
             
             
             // Close error no account return nil
             // Close error no account return nil
@@ -123,7 +120,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         }
         }
         
         
         //  MARK: - init Object
         //  MARK: - init Object
-        CCNetworking.shared().settingDelegate(self)
+        CCNetworking.shared().delegate = self
         hud = CCHud.init(view: self.navigationController?.view)
         hud = CCHud.init(view: self.navigationController?.view)
         
         
         // Theming
         // Theming
@@ -146,26 +143,22 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         let password = CCUtility.getKeyChainPasscode(forUUID: CCUtility.getUUID())
         let password = CCUtility.getKeyChainPasscode(forUUID: CCUtility.getUUID())
         
         
         if password?.characters.count == 0 {
         if password?.characters.count == 0 {
-            
             isCryptoCloudMode = false
             isCryptoCloudMode = false
-            
         } else {
         } else {
-            
             isCryptoCloudMode = true
             isCryptoCloudMode = true
         }
         }
         
         
         // Managed Crypto Cloud Mode
         // Managed Crypto Cloud Mode
-        if isCryptoCloudMode == true {
+        if isCryptoCloudMode {
             
             
             // Encrypted mode
             // Encrypted mode
             encryptedButton.image = UIImage(named:"shareExtEncrypt")?.withRenderingMode(.automatic)
             encryptedButton.image = UIImage(named:"shareExtEncrypt")?.withRenderingMode(.automatic)
             
             
             // Color Button
             // Color Button
-            if parameterEncrypted == true {
+            if parameterEncrypted {
                 encryptedButton.tintColor = NCBrandColor.sharedInstance.cryptocloud
                 encryptedButton.tintColor = NCBrandColor.sharedInstance.cryptocloud
             } else {
             } else {
                 encryptedButton.tintColor = self.view.tintColor
                 encryptedButton.tintColor = self.view.tintColor
-                
             }
             }
             
             
             saveButton.tintColor = encryptedButton.tintColor
             saveButton.tintColor = encryptedButton.tintColor
@@ -262,10 +255,11 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         let metadataNet = CCMetadataNet.init(account: activeAccount)!
         let metadataNet = CCMetadataNet.init(account: activeAccount)!
 
 
         metadataNet.action = actionReadFolder
         metadataNet.action = actionReadFolder
+        metadataNet.depth = "1"
         metadataNet.serverUrl = self.serverUrl
         metadataNet.serverUrl = self.serverUrl
         metadataNet.selector = selectorReadFolder
         metadataNet.selector = selectorReadFolder
         
         
-        let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, isCryptoCloudMode: isCryptoCloudMode!)
+        let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, isCryptoCloudMode: isCryptoCloudMode)
         networkingOperationQueue.addOperation(ocNetworking)
         networkingOperationQueue.addOperation(ocNetworking)
         
         
         hud.visibleIndeterminateHud()
         hud.visibleIndeterminateHud()
@@ -286,20 +280,18 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
     func readFolderSuccess(_ metadataNet: CCMetadataNet!, metadataFolder: tableMetadata?, metadatas: [Any]!) {
     func readFolderSuccess(_ metadataNet: CCMetadataNet!, metadataFolder: tableMetadata?, metadatas: [Any]!) {
         
         
         // remove all record
         // remove all record
-        var predicate = NSPredicate(format: "account = %@ AND directoryID = %@ AND session = ''", activeAccount!, metadataNet.directoryID!)
+        var predicate = NSPredicate(format: "account = %@ AND directoryID = %@ AND session = ''", activeAccount, metadataNet.directoryID!)
         NCManageDatabase.sharedInstance.deleteMetadata(predicate: predicate, clearDateReadDirectoryID: metadataNet.directoryID!)
         NCManageDatabase.sharedInstance.deleteMetadata(predicate: predicate, clearDateReadDirectoryID: metadataNet.directoryID!)
         
         
         for metadata in metadatas as! [tableMetadata] {
         for metadata in metadatas as! [tableMetadata] {
             
             
             // do not insert crypto file
             // do not insert crypto file
             if CCUtility.isCryptoString(metadata.fileName) {
             if CCUtility.isCryptoString(metadata.fileName) {
-                
                 continue
                 continue
             }
             }
             
             
             // Only Directory ?
             // Only Directory ?
             if (parameterMode == .moveToService || parameterMode == .exportToService) && metadata.directory == false {
             if (parameterMode == .moveToService || parameterMode == .exportToService) && metadata.directory == false {
-                
                 continue
                 continue
             }
             }
             
             
@@ -311,13 +303,11 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
                 for completeMetadata in metadatas as! [tableMetadata] {
                 for completeMetadata in metadatas as! [tableMetadata] {
                     
                     
                     if completeMetadata.fileName == CCUtility.trasformedFileNamePlist(inCrypto: metadata.fileName) {
                     if completeMetadata.fileName == CCUtility.trasformedFileNamePlist(inCrypto: metadata.fileName) {
-                        
                         isCryptoComplete = true
                         isCryptoComplete = true
                     }
                     }
                 }
                 }
 
 
                 if isCryptoComplete == false {
                 if isCryptoComplete == false {
-                    
                     continue
                     continue
                 }
                 }
             }
             }
@@ -328,25 +318,13 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
             _ = NCManageDatabase.sharedInstance.addMetadata(metadata)
             _ = NCManageDatabase.sharedInstance.addMetadata(metadata)
             
             
             // if plist do not exists, download it
             // if plist do not exists, download it
-            if CCUtility.isCryptoPlistString(fileName) && FileManager.default.fileExists(atPath: "\(directoryUser!)/\(fileName)") == false {
-                
-                let metadataNet = CCMetadataNet.init(account: activeAccount)!
+            if CCUtility.isCryptoPlistString(fileName) && FileManager.default.fileExists(atPath: "\(directoryUser)/\(fileName)") == false {
                 
                 
-                metadataNet.action = actionDownloadFile
-                metadataNet.downloadData = false
-                metadataNet.downloadPlist = true
-                metadataNet.fileID = fileID
-                metadataNet.selector = selectorLoadPlist
-                metadataNet.serverUrl = self.serverUrl
-                metadataNet.session = k_download_session_foreground
-                metadataNet.taskStatus = Int(k_taskStatusResume)
-                
-                let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, isCryptoCloudMode: isCryptoCloudMode!)
-                networkingOperationQueue.addOperation(ocNetworking)
+                CCNetworking.shared().downloadFile(fileID, serverUrl: self.serverUrl, downloadData: false, downloadPlist: true, selector: selectorLoadPlist, selectorPost: nil, session: k_download_session_foreground, taskStatus: Int(k_taskStatusResume), delegate: self)
             }
             }
         }
         }
         
         
-        predicate = NSPredicate(format: "account = %@ AND directoryID = %@", activeAccount!, metadataNet.directoryID!)
+        predicate = NSPredicate(format: "account = %@ AND directoryID = %@", activeAccount, metadataNet.directoryID!)
         recordsTableMetadata = NCManageDatabase.sharedInstance.getMetadatas(predicate: predicate, sorted: "fileNamePrint", ascending: true)
         recordsTableMetadata = NCManageDatabase.sharedInstance.getMetadatas(predicate: predicate, sorted: "fileNamePrint", ascending: true)
         
         
         tableView.reloadData()
         tableView.reloadData()
@@ -357,7 +335,6 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
     //  MARK: - Download Thumbnail
     //  MARK: - Download Thumbnail
     
     
     func downloadThumbnailFailure(_ metadataNet: CCMetadataNet!, message: String!, errorCode: Int) {
     func downloadThumbnailFailure(_ metadataNet: CCMetadataNet!, message: String!, errorCode: Int) {
-        
         NSLog("[LOG] Thumbnail Error \(metadataNet.fileName) \(message) (error \(errorCode))");
         NSLog("[LOG] Thumbnail Error \(metadataNet.fileName) \(message) (error \(errorCode))");
     }
     }
     
     
@@ -365,12 +342,11 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         
         
         if let indexPath = thumbnailInLoading[metadataNet.fileID] {
         if let indexPath = thumbnailInLoading[metadataNet.fileID] {
             
             
-            let path = "\(directoryUser!)/\(metadataNet.fileID!).ico"
+            let path = "\(directoryUser)/\(metadataNet.fileID!).ico"
             
             
             if FileManager.default.fileExists(atPath: path) {
             if FileManager.default.fileExists(atPath: path) {
                 
                 
                 if let cell = tableView.cellForRow(at: indexPath) as? recordMetadataCell {
                 if let cell = tableView.cellForRow(at: indexPath) as? recordMetadataCell {
-                    
                     cell.fileImageView.image = UIImage(contentsOfFile: path)
                     cell.fileImageView.image = UIImage(contentsOfFile: path)
                 }
                 }
             }
             }
@@ -390,7 +366,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         metadataNet.selector = selectorDownloadThumbnail;
         metadataNet.selector = selectorDownloadThumbnail;
         metadataNet.serverUrl = self.serverUrl
         metadataNet.serverUrl = self.serverUrl
         
         
-        let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, isCryptoCloudMode: isCryptoCloudMode!)
+        let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, isCryptoCloudMode: isCryptoCloudMode)
         networkingOperationQueue.addOperation(ocNetworking)
         networkingOperationQueue.addOperation(ocNetworking)
     }
     }
 
 
@@ -404,11 +380,6 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         hud.progress(progress)
         hud.progress(progress)
     }
     }
     
     
-    func cancelTransfer() {
-        
-        networkingOperationQueue.cancelAllOperations()
-    }
-
     //  MARK: - Download
     //  MARK: - Download
 
 
     func downloadFileFailure(_ fileID: String!, serverUrl: String!, selector: String!, message: String!, errorCode: Int) {
     func downloadFileFailure(_ fileID: String!, serverUrl: String!, selector: String!, message: String!, errorCode: Int) {
@@ -429,18 +400,24 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
     func downloadFileSuccess(_ fileID: String!, serverUrl: String!, selector: String!, selectorPost: String!) {
     func downloadFileSuccess(_ fileID: String!, serverUrl: String!, selector: String!, selectorPost: String!) {
         
         
         hud.hideHud()
         hud.hideHud()
+    
+        guard let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "account = %@ AND fileID == %@", activeAccount, fileID!)) else {
+            self.dismissGrantingAccess(to: nil)
+            return
+        }
         
         
-        let predicate = NSPredicate(format: "account = %@ AND fileID == %@", activeAccount!, fileID!)
-        metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: predicate)
+        recordMetadata = metadata
         
         
-        //let metadata = CCCoreData.getMetadataWithPreficate(NSPredicate(format: "(account == '\(activeAccount!)') AND (fileID == '\(fileID!)')"), context: nil)
+        // Save for PickerFileProvide
+        CCUtility.setFileNameExt(metadata.fileName)
+        CCUtility.setServerUrlExt(serverUrl)
         
         
         switch selector {
         switch selector {
             
             
         case selectorLoadFileView :
         case selectorLoadFileView :
             
             
-            let sourceUrl = URL(string: "file://\(directoryUser!)/\(fileID!)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)!
-            let destinationUrl : URL! = appGroupContainerURL()?.appendingPathComponent(metadata!.fileNamePrint)
+            let sourceUrl = URL(string: "file://\(directoryUser)/\(fileID!)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)!
+            let destinationUrl : URL! = appGroupContainerURL()?.appendingPathComponent(recordMetadata.fileNamePrint)
             
             
             // Destination Provider
             // Destination Provider
 
 
@@ -463,11 +440,11 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         case selectorLoadPlist :
         case selectorLoadPlist :
             
             
             let autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
             let autoUploadFileName = NCManageDatabase.sharedInstance.getAccountAutoUploadFileName()
-            let autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(activeUrl!)
+            let autoUploadDirectory = NCManageDatabase.sharedInstance.getAccountAutoUploadDirectory(activeUrl)
             
             
-            var metadata : tableMetadata? = CCUtility.insertInformationPlist(self.metadata, directoryUser: directoryUser)!
+            var metadata : tableMetadata? = CCUtility.insertInformationPlist(recordMetadata, directoryUser: directoryUser)!
             metadata = CCUtility.insertTypeFileIconName(metadata, serverUrl: serverUrl, autoUploadFileName: autoUploadFileName, autoUploadDirectory: autoUploadDirectory)
             metadata = CCUtility.insertTypeFileIconName(metadata, serverUrl: serverUrl, autoUploadFileName: autoUploadFileName, autoUploadDirectory: autoUploadDirectory)
-            metadata = NCManageDatabase.sharedInstance.updateMetadata(metadata!, activeUrl: activeUrl!)
+            metadata = NCManageDatabase.sharedInstance.updateMetadata(metadata!)
             
             
             if metadata != nil {
             if metadata != nil {
                 if metadata!.type == k_metadataType_template {
                 if metadata!.type == k_metadataType_template {
@@ -490,7 +467,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         hud.hideHud()
         hud.hideHud()
         
         
         // remove file
         // remove file
-        let predicate = NSPredicate(format: "account = %@ AND fileID == %@", activeAccount!, fileID)
+        let predicate = NSPredicate(format: "account = %@ AND fileID == %@", activeAccount, fileID)
         NCManageDatabase.sharedInstance.deleteMetadata(predicate: predicate, clearDateReadDirectoryID: nil)
         NCManageDatabase.sharedInstance.deleteMetadata(predicate: predicate, clearDateReadDirectoryID: nil)
         
         
         if errorCode != -999 {
         if errorCode != -999 {
@@ -519,7 +496,7 @@ extension DocumentPickerViewController {
     
     
     @IBAction func encryptedButtonTapped(_ sender: AnyObject) {
     @IBAction func encryptedButtonTapped(_ sender: AnyObject) {
 
 
-        parameterEncrypted = !parameterEncrypted!
+        parameterEncrypted = !parameterEncrypted
         
         
         if parameterEncrypted == true {
         if parameterEncrypted == true {
             encryptedButton.tintColor = NCBrandColor.sharedInstance.cryptocloud
             encryptedButton.tintColor = NCBrandColor.sharedInstance.cryptocloud
@@ -541,28 +518,27 @@ extension DocumentPickerViewController {
         case .moveToService, .exportToService:
         case .moveToService, .exportToService:
             
             
             let fileName = sourceURL.lastPathComponent
             let fileName = sourceURL.lastPathComponent
-            let destinationURLDirectoryUser = URL(string: "file://\(directoryUser!)/\(fileName)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)!
-            
-            //let fileSize = (try! FileManager.default.attributesOfItem(atPath: sourceURL.path)[FileAttributeKey.size] as! NSNumber).uint64Value
+            let destinationURLDirectoryUser = URL(string: "file://\(directoryUser)/\(fileName)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)!
             
             
-            self.destinationURL = appGroupContainerURL()?.appendingPathComponent(fileName)
-            
-            // copy sourceURL on directoryUser
-            do {
-                try FileManager.default.removeItem(at: destinationURLDirectoryUser)
-            } catch _ {
-                print("file do not exists")
-            }
-            
-            do {
-                try FileManager.default.copyItem(at: sourceURL, to: destinationURLDirectoryUser)
-            } catch _ {
-                print("file do not exists")
-                return
-            }
+            destinationURL = appGroupContainerURL()?.appendingPathComponent(fileName)
             
             
             fileCoordinator.coordinate(readingItemAt: sourceURL, options: .withoutChanges, error: nil, byAccessor: { [weak self] newURL in
             fileCoordinator.coordinate(readingItemAt: sourceURL, options: .withoutChanges, error: nil, byAccessor: { [weak self] newURL in
                 
                 
+                // copy sourceURL on directoryUser
+                do {
+                    try FileManager.default.removeItem(at: destinationURLDirectoryUser)
+                } catch _ {
+                    print("file do not exists")
+                }
+                
+                do {
+                    try FileManager.default.copyItem(at: sourceURL, to: destinationURLDirectoryUser)
+                } catch _ {
+                    print("file do not exists")
+                    self?.dismissGrantingAccess(to: self?.destinationURL)
+                    return
+                }
+                
                 do {
                 do {
                     try FileManager.default.removeItem(at: (self?.destinationURL)!)
                     try FileManager.default.removeItem(at: (self?.destinationURL)!)
                 } catch _ {
                 } catch _ {
@@ -572,32 +548,30 @@ extension DocumentPickerViewController {
                 do {
                 do {
                     try FileManager.default.copyItem(at: sourceURL, to: (self?.destinationURL)!)
                     try FileManager.default.copyItem(at: sourceURL, to: (self?.destinationURL)!)
                     
                     
-                    // Upload fileName to Cloud
+                    let fileSize = (try! FileManager.default.attributesOfItem(atPath: sourceURL.path)[FileAttributeKey.size] as! NSNumber).uint64Value
                     
                     
-                    let metadataNet = CCMetadataNet.init(account: self!.activeAccount)!
-                    
-                    metadataNet.action = actionUploadFile
-                    metadataNet.cryptated = self!.parameterEncrypted!
-                    metadataNet.fileName = fileName
-                    metadataNet.fileNamePrint = fileName
-                    metadataNet.serverUrl = self!.serverUrl
-                    metadataNet.session = k_upload_session_foreground
-                    metadataNet.taskStatus = Int(k_taskStatusResume)
-                    
-                    let ocNetworking : OCnetworking = OCnetworking.init(delegate: self!, metadataNet: metadataNet, withUser: self!.activeUser, withPassword: self!.activePassword, withUrl: self!.activeUrl, isCryptoCloudMode: self!.isCryptoCloudMode!)
-                    self!.networkingOperationQueue.addOperation(ocNetworking)
+                    if fileSize == 0 {
+                        
+                        CCUtility.setFileNameExt(fileName)
+                        CCUtility.setServerUrlExt(self!.serverUrl)
+                        self?.dismissGrantingAccess(to: self?.destinationURL)
+                        
+                    } else {
                     
                     
-                    self!.hud.visibleHudTitle(NSLocalizedString("_uploading_", comment: ""), mode: MBProgressHUDMode.determinateHorizontalBar, color: self!.navigationController?.view.tintColor)
-                    self!.hud.addButtonCancel(withTarget: self, selector: "cancelTransfer")
+                        // Upload fileName to Cloud
                     
                     
+                        CCNetworking.shared().uploadFile(fileName, serverUrl: self!.serverUrl, cryptated: self!.parameterEncrypted, onlyPlist: false, 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.brand)
+                    }
                 } catch _ {
                 } catch _ {
-                    
+                    self?.dismissGrantingAccess(to: self?.destinationURL)
                     print("error copying file")
                     print("error copying file")
                 }
                 }
             })
             })
         
         
         default:
         default:
-            dismiss(animated: true, completion: nil)
+            dismissGrantingAccess(to: self.destinationURL)
         }
         }
     }
     }
     
     
@@ -734,7 +708,6 @@ extension DocumentPickerViewController: UITableViewDelegate {
 extension DocumentPickerViewController: UITableViewDataSource {
 extension DocumentPickerViewController: UITableViewDataSource {
     
     
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
     func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
-        
        return recordsTableMetadata?.count ?? 0
        return recordsTableMetadata?.count ?? 0
     }
     }
         
         
@@ -748,11 +721,11 @@ extension DocumentPickerViewController: UITableViewDataSource {
         //let metadata = CCCoreData.insertEntity(in: recordTableMetadata)!
         //let metadata = CCCoreData.insertEntity(in: recordTableMetadata)!
         
         
         // File Image View
         // File Image View
-        let filePath = "\(directoryUser!)/\(metadata!.fileID)).ico"
+        let fileNamePath = "\(directoryUser)/\(metadata!.fileID)).ico"
         
         
-        if FileManager.default.fileExists(atPath: filePath) {
+        if FileManager.default.fileExists(atPath: fileNamePath) {
             
             
-            cell.fileImageView.image = UIImage(contentsOfFile: filePath)
+            cell.fileImageView.image = UIImage(contentsOfFile: fileNamePath)
             
             
         } else {
         } else {
             
             
@@ -776,15 +749,10 @@ extension DocumentPickerViewController: UITableViewDataSource {
         
         
         // Status Image View
         // Status Image View
         let lockServerUrl = CCUtility.stringAppendServerUrl(self.serverUrl!, addFileName: metadata!.fileNameData)
         let lockServerUrl = CCUtility.stringAppendServerUrl(self.serverUrl!, addFileName: metadata!.fileNameData)
-        
-        var passcode: String? = CCUtility.getBlockCode()
-        if passcode == nil {
-            passcode = ""
-        }
-        
-        let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate:NSPredicate(format: "account = %@ AND serverUrl = %@", activeAccount!, lockServerUrl!))
+                
+        let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate:NSPredicate(format: "account = %@ AND serverUrl = %@", activeAccount, lockServerUrl!))
         if tableDirectory != nil {
         if tableDirectory != nil {
-            if metadata!.directory &&  (tableDirectory?.lock)! && (passcode?.characters.count)! > 0 {
+            if metadata!.directory &&  (tableDirectory?.lock)! && (CCUtility.getBlockCode() != nil) {
                 cell.StatusImageView.image = UIImage(named: "passcode")
                 cell.StatusImageView.image = UIImage(named: "passcode")
             } else {
             } else {
                 cell.StatusImageView.image = nil
                 cell.StatusImageView.image = nil
@@ -805,42 +773,29 @@ extension DocumentPickerViewController: UITableViewDataSource {
             return
             return
         }
         }
         
         
-        self.metadata = metadata!
+        recordMetadata = metadata!
 
 
         if metadata!.directory == false {
         if metadata!.directory == false {
             
             
-            if FileManager.default.fileExists(atPath: "\(directoryUser!)/\(String(describing: self.metadata?.fileID))") {
+            let fileNamePath = "\(directoryUser)/\(metadata!.fileID)"
+            
+            if FileManager.default.fileExists(atPath: fileNamePath) {
                 
                 
-                downloadFileSuccess(self.metadata?.fileID, serverUrl: self.serverUrl!, selector: selectorLoadFileView, selectorPost: nil)
+                downloadFileSuccess(recordMetadata.fileID, serverUrl: self.serverUrl!, selector: selectorLoadFileView, selectorPost: nil)
                 
                 
             } else {
             } else {
             
             
-                // Download file
-                let metadataNet = CCMetadataNet.init(account: activeAccount)!
-            
-                metadataNet.action = actionDownloadFile
-                metadataNet.downloadData = true
-                metadataNet.downloadPlist = false
-                metadataNet.fileID = metadata?.fileID
-                metadataNet.selector = selectorLoadFileView
-                metadataNet.serverUrl = self.serverUrl
-                metadataNet.session = k_download_session_foreground
-                metadataNet.taskStatus = Int(k_taskStatusResume)
-            
-                let ocNetworking : OCnetworking = OCnetworking.init(delegate: self, metadataNet: metadataNet, withUser: activeUser, withPassword: activePassword, withUrl: activeUrl, isCryptoCloudMode: self.isCryptoCloudMode!)
-                networkingOperationQueue.addOperation(ocNetworking)
-                
-                hud.visibleHudTitle(NSLocalizedString("_loading_", comment: ""), mode: MBProgressHUDMode.determinateHorizontalBar, color: self.navigationController?.view.tintColor)
-                hud.addButtonCancel(withTarget: self, selector: "cancelTransfer")
+                CCNetworking.shared().downloadFile(metadata?.fileID, serverUrl: self.serverUrl, downloadData: true, downloadPlist: false, selector: selectorLoadFileView, selectorPost: nil, session: k_download_session_foreground, taskStatus: Int(k_taskStatusResume), delegate: self)
+
+                hud.visibleHudTitle(NSLocalizedString("_loading_", comment: ""), mode: MBProgressHUDMode.determinate, color: NCBrandColor.sharedInstance.brand)
             }
             }
             
             
         } else {
         } else {
             
             
-            var dir : String! = self.metadata?.fileName
+            var dir = recordMetadata.fileName
             
             
-            if (self.metadata?.cryptated)! {
-                
-                dir = CCUtility.trasformedFileNamePlist(inCrypto: self.metadata?.fileName)
+            if recordMetadata.cryptated {
+                dir = CCUtility.trasformedFileNamePlist(inCrypto: recordMetadata.fileName)
             }
             }
             
             
             serverUrlPush = CCUtility.stringAppendServerUrl(self.serverUrl!, addFileName: dir)
             serverUrlPush = CCUtility.stringAppendServerUrl(self.serverUrl!, addFileName: dir)
@@ -850,22 +805,20 @@ extension DocumentPickerViewController: UITableViewDataSource {
                 passcode = ""
                 passcode = ""
             }
             }
             
             
-            let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate:NSPredicate(format: "account = %@ AND serverUrl = %@", activeAccount!, serverUrlPush!))
+            let tableDirectory = NCManageDatabase.sharedInstance.getTableDirectory(predicate:NSPredicate(format: "account = %@ AND serverUrl = %@", activeAccount, serverUrlPush))
 
 
             if tableDirectory != nil {
             if tableDirectory != nil {
                 
                 
                 if (tableDirectory?.lock)! && (passcode?.characters.count)! > 0 {
                 if (tableDirectory?.lock)! && (passcode?.characters.count)! > 0 {
                     
                     
                     self.passcodeIsPush = true
                     self.passcodeIsPush = true
-                    openBKPasscode(self.metadata?.fileNamePrint)
+                    openBKPasscode(recordMetadata.fileNamePrint)
                     
                     
                 } else {
                 } else {
-                    
                     performSegue()
                     performSegue()
                 }
                 }
                 
                 
             } else {
             } else {
-                
                 performSegue()
                 performSegue()
             }
             }
         }
         }
@@ -881,7 +834,7 @@ extension DocumentPickerViewController: UITableViewDataSource {
         nextViewController.parameterPasscodeCorrect = parameterPasscodeCorrect
         nextViewController.parameterPasscodeCorrect = parameterPasscodeCorrect
         nextViewController.parameterEncrypted = parameterEncrypted
         nextViewController.parameterEncrypted = parameterEncrypted
         nextViewController.serverUrl = serverUrlPush
         nextViewController.serverUrl = serverUrlPush
-        nextViewController.titleFolder = self.metadata?.fileNamePrint
+        nextViewController.titleFolder = recordMetadata.fileNamePrint
         
         
         self.navigationController?.pushViewController(nextViewController, animated: true)
         self.navigationController?.pushViewController(nextViewController, animated: true)
     }
     }

+ 115 - 3
PickerFileProvider/FileProvider.swift

@@ -23,7 +23,16 @@
 
 
 import UIKit
 import UIKit
 
 
-class FileProvider: NSFileProviderExtension {
+class FileProvider: NSFileProviderExtension, CCNetworkingDelegate {
+
+    lazy var networkingOperationQueue: OperationQueue = {
+        
+        var queue = OperationQueue()
+        queue.name = k_queue
+        queue.maxConcurrentOperationCount = 10
+        
+        return queue
+    }()
 
 
     var fileCoordinator: NSFileCoordinator {
     var fileCoordinator: NSFileCoordinator {
         let fileCoordinator = NSFileCoordinator()
         let fileCoordinator = NSFileCoordinator()
@@ -81,10 +90,88 @@ class FileProvider: NSFileProviderExtension {
     }
     }
     
     
     override func itemChanged(at url: URL) {
     override func itemChanged(at url: URL) {
+        
         // Called at some point after the file has changed; the provider may then trigger an upload
         // Called at some point after the file has changed; the provider may then trigger an upload
+                
+        let fileSize = (try! FileManager.default.attributesOfItem(atPath: url.path)[FileAttributeKey.size] as! NSNumber).uint64Value
+        NSLog("Item changed at URL %@ %lu", url as NSURL, fileSize)
+
+        guard let account = NCManageDatabase.sharedInstance.getAccountActive() else {
+            self.stopProvidingItem(at: url)
+            return
+        }
+        guard let fileName = CCUtility.getFileNameExt() else {
+            self.stopProvidingItem(at: url)
+            return
+        }
+        // -------> Fix : Clear FileName for twice Office 365
+        CCUtility.setFileNameExt("")
+        // --------------------------------------------------
+        if (fileName != url.lastPathComponent) {
+            self.stopProvidingItem(at: url)
+            return
+        }
+        guard let serverUrl = CCUtility.getServerUrlExt() else {
+            self.stopProvidingItem(at: url)
+            return
+        }
+        guard let directoryID = NCManageDatabase.sharedInstance.getDirectoryID(serverUrl) else {
+            self.stopProvidingItem(at: url)
+            return
+        }
         
         
-        // TODO: mark file at <url> as needing an update in the model; kick off update process
-        NSLog("Item changed at URL %@", url as NSURL)
+        let metadata = NCManageDatabase.sharedInstance.getMetadata(predicate: NSPredicate(format: "fileName == %@ AND directoryID == %@", fileName, directoryID))
+        if metadata != nil {
+            
+            // Update
+            let uploadID = k_uploadSessionID + CCUtility.createRandomString(16)
+            let directoryUser = CCUtility.getDirectoryActiveUser(account.user, activeUrl: account.url)
+            let destinationURLDirectoryUser = URL(string: "file://\(directoryUser!)/\(uploadID)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)!
+
+            // copy sourceURL on directoryUser
+            do {
+                try FileManager.default.removeItem(at: destinationURLDirectoryUser)
+            } catch _ {
+                print("file do not exists")
+            }
+            
+            do {
+                try FileManager.default.copyItem(at: url, to: destinationURLDirectoryUser)
+            } catch _ {
+                print("file do not exists")
+                self.stopProvidingItem(at: url)
+                return
+            }
+
+            // Prepare for send Metadata
+            metadata!.sessionID = uploadID
+            metadata!.session = k_upload_session
+            metadata!.sessionTaskIdentifier = Int(k_taskIdentifierWaitStart)
+            _ = NCManageDatabase.sharedInstance.updateMetadata(metadata!)
+            
+        } else {
+            
+            // New
+            let directoryUser = CCUtility.getDirectoryActiveUser(account.user, activeUrl: account.url)
+            let destinationURLDirectoryUser = URL(string: "file://\(directoryUser!)/\(fileName)".addingPercentEncoding(withAllowedCharacters: .urlPathAllowed)!)!
+            
+            do {
+                try FileManager.default.removeItem(at: destinationURLDirectoryUser)
+            } catch _ {
+                print("file do not exists")
+            }
+            do {
+                try FileManager.default.copyItem(at: url, to: destinationURLDirectoryUser)
+            } catch _ {
+                print("file do not exists")
+                self.stopProvidingItem(at: url)
+                return
+            }
+            
+            CCNetworking.shared().uploadFile(fileName, serverUrl: serverUrl, cryptated: false, onlyPlist: false, session: k_upload_session, taskStatus: Int(k_taskStatusResume), selector: nil, selectorPost: nil, errorCode: 0, delegate: self)
+        }
+
+        self.stopProvidingItem(at: url)
     }
     }
     
     
     override func stopProvidingItem(at url: URL) {
     override func stopProvidingItem(at url: URL) {
@@ -100,5 +187,30 @@ class FileProvider: NSFileProviderExtension {
             // TODO: handle any error, do any necessary cleanup
             // TODO: handle any error, do any necessary cleanup
         })
         })
     }
     }
+    
+    // UTILITY //
+    
+    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
+    }
+
 
 
 }
 }

+ 22 - 1
PickerFileProvider/PickerFileProvider-Bridging-Header.h

@@ -1,4 +1,25 @@
 //
 //
-//  Use this file to import your target's public headers that you would like to expose to Swift.
+//  PickerFileProvider-Bridging-Header.h
+//  Nextcloud
 //
 //
+//  Created by Marino Faggiana on 24/05/17.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+
+#import "CCNetworking.h"
+#import "OCNetworking.h"
+#import "CCGlobal.h"
+#import "CCHud.h"
+#import "BKPasscodeViewController.h"
+#import "CCBKPasscode.h"
+
+#import "OCActivity.h"
+#import "OCUserProfile.h"
+#import "OCCapabilities.h"
+#import "OCExternalSites.h"
+#import "OCSharedDto.h"
 
 
+#import "TableAccount+CoreDataClass.h"
+#import "TableCertificates+CoreDataClass.h"
+#import "TableDirectory+CoreDataClass.h"
+#import "TableLocalFile+CoreDataClass.h"

+ 15 - 25
Share/ShareViewController.m

@@ -77,31 +77,31 @@
         }
         }
 
 
         
         
-        if ([_activeAccount isEqualToString:[CCUtility getActiveAccountShareExt]]) {
+        if ([_activeAccount isEqualToString:[CCUtility getActiveAccountExt]]) {
             
             
             // load
             // load
             
             
-            _serverUrl = [CCUtility getServerUrlShareExt];
+            _serverUrl = [CCUtility getServerUrlExt];
             
             
-            _destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), [CCUtility getTitleServerUrlShareExt]];
+            _destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), [CCUtility getTitleServerUrlExt]];
             
             
             if (_isCryptoCloudMode)
             if (_isCryptoCloudMode)
-                _localCryptated = [CCUtility getCryptatedShareExt];
+                _localCryptated = [CCUtility getCryptatedExt];
             
             
         } else {
         } else {
             
             
             // Default settings
             // Default settings
             
             
-            [CCUtility setActiveAccountShareExt:self.activeAccount];
+            [CCUtility setActiveAccountExt:self.activeAccount];
 
 
             _serverUrl  = [CCUtility getHomeServerUrlActiveUrl:self.activeUrl];
             _serverUrl  = [CCUtility getHomeServerUrlActiveUrl:self.activeUrl];
-            [CCUtility setServerUrlShareExt:_serverUrl];
+            [CCUtility setServerUrlExt:_serverUrl];
 
 
             _destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), NSLocalizedString(@"_home_", nil)];
             _destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), NSLocalizedString(@"_home_", nil)];
-            [CCUtility setTitleServerUrlShareExt:NSLocalizedString(@"_home_", nil)];
+            [CCUtility setTitleServerUrlExt:NSLocalizedString(@"_home_", nil)];
 
 
             _localCryptated = NO;
             _localCryptated = NO;
-            [CCUtility setCryptatedShareExt:NO];
+            [CCUtility setCryptatedExt:NO];
         }
         }
     }
     }
 
 
@@ -115,7 +115,7 @@
     _networkingOperationQueue.name = k_queue;
     _networkingOperationQueue.name = k_queue;
     _networkingOperationQueue.maxConcurrentOperationCount = 1;
     _networkingOperationQueue.maxConcurrentOperationCount = 1;
     
     
-    [[CCNetworking sharedNetworking] settingDelegate:self];
+    [CCNetworking sharedNetworking].delegate = self;
         
         
     [self.shareTable registerNib:[UINib nibWithNibName:@"CCCellShareExt" bundle:nil] forCellReuseIdentifier:@"ShareExtCell"];
     [self.shareTable registerNib:[UINib nibWithNibName:@"CCCellShareExt" bundle:nil] forCellReuseIdentifier:@"ShareExtCell"];
     
     
@@ -213,14 +213,14 @@
     
     
     if (title) {
     if (title) {
         self.destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), title];
         self.destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), title];
-        [CCUtility setTitleServerUrlShareExt:title];
+        [CCUtility setTitleServerUrlExt:title];
     } else {
     } else {
         self.destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), NSLocalizedString(@"_home_", nil)];
         self.destinyFolderButton.title = [NSString stringWithFormat:NSLocalizedString(@"_destiny_folder_", nil), NSLocalizedString(@"_home_", nil)];
-        [CCUtility setTitleServerUrlShareExt:NSLocalizedString(@"_home_", nil)];
+        [CCUtility setTitleServerUrlExt:NSLocalizedString(@"_home_", nil)];
     }
     }
     
     
-    [CCUtility setActiveAccountShareExt:self.activeAccount];
-    [CCUtility setServerUrlShareExt:_serverUrl];
+    [CCUtility setActiveAccountExt:self.activeAccount];
+    [CCUtility setServerUrlExt:_serverUrl];
 }
 }
 
 
 - (IBAction)destinyFolderButtonTapped:(UIBarButtonItem *)sender
 - (IBAction)destinyFolderButtonTapped:(UIBarButtonItem *)sender
@@ -246,17 +246,7 @@
     
     
         NSString *fileName = [self.filesName objectAtIndex:0];
         NSString *fileName = [self.filesName objectAtIndex:0];
         
         
-        CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:_activeAccount];
-            
-        metadataNet.action = actionUploadFile;
-        metadataNet.cryptated = _localCryptated;
-        metadataNet.fileName = fileName;
-        metadataNet.fileNamePrint = fileName;
-        metadataNet.serverUrl = _serverUrl;
-        metadataNet.session = k_upload_session_foreground;
-        metadataNet.taskStatus = k_taskStatusResume;
-        
-        [self addNetworkingQueue:metadataNet];
+        [[CCNetworking sharedNetworking] uploadFile:fileName serverUrl:_serverUrl cryptated:_localCryptated onlyPlist:NO session:k_upload_session_foreground taskStatus:k_taskStatusResume selector:@"" selectorPost:@"" errorCode:0 delegate:self];
         
         
         [self.hud visibleHudTitle:NSLocalizedString(@"_uploading_", nil) mode:MBProgressHUDModeDeterminate color:[NCBrandColor sharedInstance].brand];
         [self.hud visibleHudTitle:NSLocalizedString(@"_uploading_", nil) mode:MBProgressHUDModeDeterminate color:[NCBrandColor sharedInstance].brand];
     }
     }
@@ -281,7 +271,7 @@
     if (self.localCryptated) self.localCryptated = NO;
     if (self.localCryptated) self.localCryptated = NO;
     else self.localCryptated = YES;
     else self.localCryptated = YES;
     
     
-    [CCUtility setCryptatedShareExt:self.localCryptated];
+    [CCUtility setCryptatedExt:self.localCryptated];
 
 
     [self navigationBarToolBar];
     [self navigationBarToolBar];
 }
 }

+ 2 - 11
iOSClient/Actions/CCActions.swift

@@ -238,16 +238,7 @@ class CCActions: NSObject {
                 }
                 }
             }
             }
             
             
-            metadataNet.action = actionUploadOnlyPlist
-            metadataNet.delegate = delegate
-            metadataNet.fileID = metadata.fileID
-            metadataNet.fileName = metadata.fileName
-            metadataNet.selectorPost = selectorReadFolderForced
-            metadataNet.serverUrl = serverUrl
-            metadataNet.session = k_upload_session_foreground
-            metadataNet.taskStatus = Int(k_taskStatusResume)
-            
-            appDelegate.addNetworkingOperationQueue(appDelegate.netQueue, delegate: self, metadataNet: metadataNet)
+            CCNetworking.shared().uploadFile(metadata.fileName, serverUrl: serverUrl, cryptated: true, onlyPlist: true, session: k_upload_session_foreground, taskStatus: Int(k_taskStatusResume), selector: "", selectorPost: selectorReadFolderForced, errorCode: 0, delegate: delegate)
             
             
             // delete file in filesystem
             // delete file in filesystem
             self.deleteFile(metadata: metadata, serverUrl: serverUrl)
             self.deleteFile(metadata: metadata, serverUrl: serverUrl)
@@ -358,7 +349,7 @@ class CCActions: NSObject {
         metadataNet.delegate = delegate
         metadataNet.delegate = delegate
         metadataNet.directoryID = directoryID
         metadataNet.directoryID = directoryID
         metadataNet.fileName = fileName
         metadataNet.fileName = fileName
-        metadataNet.options = depth
+        metadataNet.depth = depth
         metadataNet.priority = Operation.QueuePriority.high.rawValue
         metadataNet.priority = Operation.QueuePriority.high.rawValue
         metadataNet.selector = selector
         metadataNet.selector = selector
         metadataNet.serverUrl = serverUrl
         metadataNet.serverUrl = serverUrl

+ 19 - 17
iOSClient/AppDelegate.h

@@ -41,10 +41,12 @@
 #import "CCSettings.h"
 #import "CCSettings.h"
 #import "CCFavorites.h"
 #import "CCFavorites.h"
 
 
+@class CCLoginWeb;
+
 @interface AppDelegate : UIResponder <UIApplicationDelegate, BKPasscodeLockScreenManagerDelegate, BKPasscodeViewControllerDelegate, LMMediaPlayerViewDelegate, TWMessageBarStyleSheet, CCNetworkingDelegate>
 @interface AppDelegate : UIResponder <UIApplicationDelegate, BKPasscodeLockScreenManagerDelegate, BKPasscodeViewControllerDelegate, LMMediaPlayerViewDelegate, TWMessageBarStyleSheet, CCNetworkingDelegate>
 
 
 // Timer Process
 // Timer Process
-@property (nonatomic, strong) NSTimer *timerProcessAutoUpload;
+@property (nonatomic, strong) NSTimer *timerProcessAutoDownloadUpload;
 @property (nonatomic, strong) NSTimer *timerUpdateApplicationIconBadgeNumber;
 @property (nonatomic, strong) NSTimer *timerUpdateApplicationIconBadgeNumber;
 
 
 // For LMMediaPlayerView
 // For LMMediaPlayerView
@@ -68,11 +70,6 @@
 // Network Operation
 // Network Operation
 @property (nonatomic, strong) NSOperationQueue *netQueue;
 @property (nonatomic, strong) NSOperationQueue *netQueue;
 
 
-@property (nonatomic, strong) NSOperationQueue *netQueueDownload;
-@property (nonatomic, strong) NSOperationQueue *netQueueDownloadWWan;
-@property (nonatomic, strong) NSOperationQueue *netQueueUpload;
-@property (nonatomic, strong) NSOperationQueue *netQueueUploadWWan;
-
 // Networking 
 // Networking 
 @property (nonatomic, copy) void (^backgroundSessionCompletionHandler)(void);
 @property (nonatomic, copy) void (^backgroundSessionCompletionHandler)(void);
 
 
@@ -123,6 +120,8 @@
 @property (nonatomic, retain) CCSettings *activeSettings;
 @property (nonatomic, retain) CCSettings *activeSettings;
 @property (nonatomic, retain) CCActivity *activeActivity;
 @property (nonatomic, retain) CCActivity *activeActivity;
 @property (nonatomic, retain) CCTransfers *activeTransfers;
 @property (nonatomic, retain) CCTransfers *activeTransfers;
+@property (nonatomic, retain) CCLogin *activeLogin;
+@property (nonatomic, retain) CCLoginWeb *activeLoginWeb;
 
 
 @property (nonatomic, strong) NSMutableDictionary *listMainVC;
 @property (nonatomic, strong) NSMutableDictionary *listMainVC;
 @property (nonatomic, strong) NSMutableDictionary *listProgressMetadata;
 @property (nonatomic, strong) NSMutableDictionary *listProgressMetadata;
@@ -133,37 +132,40 @@
 // Maintenance Mode
 // Maintenance Mode
 @property BOOL maintenanceMode;
 @property BOOL maintenanceMode;
 
 
+// Login View
+- (void)openLoginView:(id)delegate loginType:(enumLoginType)loginType;
+
 // Setting Active Account
 // Setting Active Account
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activePassword:(NSString *)activePassword;
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activePassword:(NSString *)activePassword;
 
 
 // initializations 
 // initializations 
 - (void)applicationInitialized;
 - (void)applicationInitialized;
 
 
-- (void)maintenanceMode:(BOOL)mode;
-
+// Quick Actions - ShotcutItem
 - (void)configDynamicShortcutItems;
 - (void)configDynamicShortcutItems;
+- (BOOL)handleShortCutItem:(UIApplicationShortcutItem *)shortcutItem;
 
 
+// StatusBar & ApplicationIconBadgeNumber
 - (void)messageNotification:(NSString *)title description:(NSString *)description visible:(BOOL)visible delay:(NSTimeInterval)delay type:(TWMessageBarMessageType)type errorCode:(NSInteger)errorcode;
 - (void)messageNotification:(NSString *)title description:(NSString *)description visible:(BOOL)visible delay:(NSTimeInterval)delay type:(TWMessageBarMessageType)type errorCode:(NSInteger)errorcode;
 - (void)updateApplicationIconBadgeNumber;
 - (void)updateApplicationIconBadgeNumber;
-- (BOOL)handleShortCutItem:(UIApplicationShortcutItem *)shortcutItem;
+
+// TabBarController
 - (void)aspectNavigationControllerBar:(UINavigationBar *)nav encrypted:(BOOL)encrypted online:(BOOL)online hidden:(BOOL)hidden;
 - (void)aspectNavigationControllerBar:(UINavigationBar *)nav encrypted:(BOOL)encrypted online:(BOOL)online hidden:(BOOL)hidden;
 - (void)aspectTabBar:(UITabBar *)tab hidden:(BOOL)hidden;
 - (void)aspectTabBar:(UITabBar *)tab hidden:(BOOL)hidden;
 - (void)plusButtonVisibile:(BOOL)visible;
 - (void)plusButtonVisibile:(BOOL)visible;
 - (void)selectedTabBarController:(NSInteger)index;
 - (void)selectedTabBarController:(NSInteger)index;
+- (NSString *)getTabBarControllerActiveServerUrl;
 
 
+// Theming Color
 - (void)settingThemingColorBrand;
 - (void)settingThemingColorBrand;
 - (void)changeTheming:(UIViewController *)vc;
 - (void)changeTheming:(UIViewController *)vc;
 
 
-// Operation Networking
-- (void)cancelAllOperations;
+// Task Networking
 - (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet;
 - (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet;
+- (void)loadAutoDownloadUpload:(NSNumber *)maxConcurrent;
 
 
-- (NSMutableArray *)verifyExistsInQueuesDownloadSelector:(NSString *)selector;
-
-- (NSInteger)getNumberDownloadInQueues;
-- (NSInteger)getNumberDownloadInQueuesWWan;
-- (NSInteger)getNumberUploadInQueues;
-- (NSInteger)getNumberUploadInQueuesWWan;
+// Maintenance Mode
+- (void)maintenanceMode:(BOOL)mode;
 
 
 @end
 @end
 
 

+ 288 - 170
iOSClient/AppDelegate.m

@@ -51,8 +51,8 @@
 
 
 + (void)initialize
 + (void)initialize
 {
 {
-    [iRate sharedInstance].daysUntilPrompt = 10;
-    [iRate sharedInstance].usesUntilPrompt = 10;
+    [iRate sharedInstance].daysUntilPrompt = 5;
+    [iRate sharedInstance].usesUntilPrompt = 5;
     [iRate sharedInstance].promptForNewVersionIfUserRated = true;
     [iRate sharedInstance].promptForNewVersionIfUserRated = true;
     
     
     [[NSUserDefaults standardUserDefaults] registerDefaults:@{@"UserAgent": [CCUtility getUserAgent]}];
     [[NSUserDefaults standardUserDefaults] registerDefaults:@{@"UserAgent": [CCUtility getUserAgent]}];
@@ -164,22 +164,6 @@
     _netQueue.name = k_queue;
     _netQueue.name = k_queue;
     _netQueue.maxConcurrentOperationCount = k_maxConcurrentOperation;
     _netQueue.maxConcurrentOperationCount = k_maxConcurrentOperation;
    
    
-    _netQueueDownload = [[NSOperationQueue alloc] init];
-    _netQueueDownload.name = k_download_queue;
-    _netQueueDownload.maxConcurrentOperationCount = k_maxConcurrentOperationDownloadUpload;
-
-    _netQueueDownloadWWan = [[NSOperationQueue alloc] init];
-    _netQueueDownloadWWan.name = k_download_queuewwan;
-    _netQueueDownloadWWan.maxConcurrentOperationCount = k_maxConcurrentOperationDownloadUpload;
-    
-    _netQueueUpload = [[NSOperationQueue alloc] init];
-    _netQueueUpload.name = k_upload_queue;
-    _netQueueUpload.maxConcurrentOperationCount = k_maxConcurrentOperationDownloadUpload;
-    
-    _netQueueUploadWWan = [[NSOperationQueue alloc] init];
-    _netQueueUploadWWan.name = k_upload_queuewwan;
-    _netQueueUploadWWan.maxConcurrentOperationCount = k_maxConcurrentOperationDownloadUpload;
-    
     // Add notification change session
     // Add notification change session
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sessionChanged:) name:k_networkingSessionNotification object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sessionChanged:) name:k_networkingSessionNotification object:nil];
         
         
@@ -248,7 +232,7 @@
     }
     }
     
     
     // Start Timer
     // Start Timer
-    self.timerProcessAutoUpload = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(processAutoUpload) userInfo:nil repeats:YES];
+    self.timerProcessAutoDownloadUpload = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(processAutoDownloadUpload) userInfo:nil repeats:YES];
     
     
     self.timerUpdateApplicationIconBadgeNumber = [NSTimer scheduledTimerWithTimeInterval:k_timerUpdateApplicationIconBadgeNumber target:self selector:@selector(updateApplicationIconBadgeNumber) userInfo:nil repeats:YES];
     self.timerUpdateApplicationIconBadgeNumber = [NSTimer scheduledTimerWithTimeInterval:k_timerUpdateApplicationIconBadgeNumber target:self selector:@selector(updateApplicationIconBadgeNumber) userInfo:nil repeats:YES];
 
 
@@ -285,6 +269,11 @@
         [_activeMain readFileReloadFolder];
         [_activeMain readFileReloadFolder];
     }
     }
     
     
+    // refresh Photos tab
+    if (_activePhotos) {
+        [_activePhotos reloadDatasourceForced];
+    }
+    
     // Initializations
     // Initializations
     [self applicationInitialized];
     [self applicationInitialized];
 }
 }
@@ -320,7 +309,7 @@
 {    
 {    
     [MagicalRecord cleanUp];
     [MagicalRecord cleanUp];
 
 
-    NSLog(@"[LOG] bye bye, Crypto Cloud !");
+    NSLog(@"[LOG] bye bye, Nextcloud !");
 }
 }
 
 
 //
 //
@@ -335,13 +324,26 @@
     // Execute : now
     // Execute : now
     NSLog(@"[LOG] Update Folder Photo");
     NSLog(@"[LOG] Update Folder Photo");
     NSString *autoUploadPath = [[NCManageDatabase sharedInstance] getAccountAutoUploadPath:_activeUrl];
     NSString *autoUploadPath = [[NCManageDatabase sharedInstance] getAccountAutoUploadPath:_activeUrl];
-    if ([autoUploadPath length] > 0)
-        [[CCSynchronize sharedSynchronize] synchronizedFolder:autoUploadPath selector:selectorReadFolder];
-
-    // Execute : after 1 sec.
+    if ([autoUploadPath length] > 0) {
+        
+        NSString *fileName = [[NCManageDatabase sharedInstance] getAccountAutoUploadFileName];
+        NSString *serverUrl = [[NCManageDatabase sharedInstance] getAccountAutoUploadDirectory:_activeUrl];
+        
+        [[CCSynchronize sharedSynchronize] readFileForFolder:fileName serverUrl:serverUrl selector:selectorReadFileFolder];        
+    }
     
     
+    // Execute : after 1 sec.
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
+    
+        // verify Download
+        [[CCNetworking sharedNetworking] verifyDownloadInProgress];
+        if (_activeMain)
+            [[CCNetworking sharedNetworking] verifyDownloadInError:self.activeMain];
         
         
+        // verify Upload
+        [[CCNetworking sharedNetworking] verifyUploadInProgress];
+        [[CCNetworking sharedNetworking] verifyUploadInErrorOrWait];
+
         if (_activeMain) {
         if (_activeMain) {
             NSLog(@"[LOG] Request Server Capabilities");
             NSLog(@"[LOG] Request Server Capabilities");
             [_activeMain requestServerCapabilities];
             [_activeMain requestServerCapabilities];
@@ -361,33 +363,43 @@
 }
 }
 
 
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Process Auto Upload k_timerProcess seconds =====
+#pragma mark ===== Login =====
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 
 
-- (void)processAutoUpload
+- (void)openLoginView:(id)delegate loginType:(enumLoginType)loginType
 {
 {
-    // Test Maintenance
-    if (self.maintenanceMode)
-        return;
-    
-    // BACKGROND & FOREGROUND
-
-    NSLog(@"-PROCESS-AUTO-UPLOAD-");
-    
-    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) {
-
-        // ONLY BACKGROUND
-        [[NCAutoUpload sharedInstance] performSelectorOnMainThread:@selector(loadAutoUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUploadBackground] waitUntilDone:NO];
+    if ([NCBrandOptions sharedInstance].use_login_web) {
+        
+        if (!_activeLoginWeb.isViewLoaded || !_activeLoginWeb.view.window) {
+        
+            _activeLoginWeb = [CCLoginWeb new];
+            _activeLoginWeb.delegate = delegate;
+            _activeLoginWeb.loginType = loginType;
+        
+            dispatch_async(dispatch_get_main_queue(), ^ {
+                [_activeLoginWeb presentModalWithDefaultTheme:delegate];
+            });
+        }
         
         
     } else {
     } else {
+        
+        if (!_activeLogin.isViewLoaded || !_activeLogin.view.window) {
 
 
-        // ONLY FOREFROUND
-        [[NCAutoUpload sharedInstance] performSelectorOnMainThread:@selector(loadAutoUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
+            _activeLogin = [[UIStoryboard storyboardWithName:@"CCLogin" bundle:nil] instantiateViewControllerWithIdentifier:@"CCLoginNextcloud"];
+            _activeLogin.delegate = delegate;
+            _activeLogin.loginType = loginType;
+        
+            dispatch_async(dispatch_get_main_queue(), ^ {
+                [self.window makeKeyAndVisible];
+                [self.window.rootViewController presentViewController:_activeLogin animated:YES completion:nil];
+            });
+        }
     }
     }
 }
 }
 
 
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Setting Active Account =====
+#pragma mark ===== Setting Active Account for all APP =====
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 
 
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activePassword:(NSString *)activePassword
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activePassword:(NSString *)activePassword
@@ -397,7 +409,10 @@
     self.activeUser = activeUser;
     self.activeUser = activeUser;
     self.activePassword = activePassword;
     self.activePassword = activePassword;
     
     
-    self.directoryUser = [CCUtility getDirectoryActiveUser:activeUser activeUrl:activeUrl];    
+    self.directoryUser = [CCUtility getDirectoryActiveUser:activeUser activeUrl:activeUrl];
+    
+    // Setting Account to CCNetworking
+    [[CCNetworking sharedNetworking] settingAccount];
 }
 }
 
 
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
@@ -565,20 +580,20 @@
     UIApplicationShortcutIcon *shortcutUploadEncryptedIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"quickActionUploadEncrypted"];
     UIApplicationShortcutIcon *shortcutUploadEncryptedIcon = [UIApplicationShortcutIcon iconWithTemplateImageName:@"quickActionUploadEncrypted"];
     
     
     UIApplicationShortcutItem *shortcutPhotos = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.photos", bundleId] localizedTitle:NSLocalizedString(@"_photo_camera_", nil) localizedSubtitle:nil icon:shortcutPhotosIcon userInfo:nil];
     UIApplicationShortcutItem *shortcutPhotos = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.photos", bundleId] localizedTitle:NSLocalizedString(@"_photo_camera_", nil) localizedSubtitle:nil icon:shortcutPhotosIcon userInfo:nil];
-
     UIApplicationShortcutItem *shortcutUpload = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.upload", bundleId] localizedTitle:NSLocalizedString(@"_upload_file_", nil) localizedSubtitle:nil icon:shortcutUploadIcon userInfo:nil];
     UIApplicationShortcutItem *shortcutUpload = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.upload", bundleId] localizedTitle:NSLocalizedString(@"_upload_file_", nil) localizedSubtitle:nil icon:shortcutUploadIcon userInfo:nil];
-    
     UIApplicationShortcutItem *shortcutUploadEncrypted = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.uploadEncrypted", bundleId] localizedTitle:NSLocalizedString(@"_upload_encrypted_file_", nil) localizedSubtitle:nil icon:shortcutUploadEncryptedIcon userInfo:nil];
     UIApplicationShortcutItem *shortcutUploadEncrypted = [[UIApplicationShortcutItem alloc] initWithType:[NSString stringWithFormat:@"%@.uploadEncrypted", bundleId] localizedTitle:NSLocalizedString(@"_upload_encrypted_file_", nil) localizedSubtitle:nil icon:shortcutUploadEncryptedIcon userInfo:nil];
     
     
     if (app.isCryptoCloudMode) {
     if (app.isCryptoCloudMode) {
         
         
         // add the array to our app
         // add the array to our app
-        [UIApplication sharedApplication].shortcutItems = @[shortcutUploadEncrypted, shortcutUpload, shortcutPhotos];
+        if (shortcutUploadEncrypted && shortcutUpload && shortcutPhotos)
+            [UIApplication sharedApplication].shortcutItems = @[shortcutUploadEncrypted, shortcutUpload, shortcutPhotos];
 
 
     } else {
     } else {
 
 
         // add the array to our app
         // add the array to our app
-        [UIApplication sharedApplication].shortcutItems = @[shortcutUpload, shortcutPhotos];
+        if (shortcutUpload && shortcutPhotos)
+            [UIApplication sharedApplication].shortcutItems = @[shortcutUpload, shortcutPhotos];
     }
     }
 }
 }
 
 
@@ -805,6 +820,39 @@
     return iconImage;
     return iconImage;
 }
 }
 
 
+- (void)updateApplicationIconBadgeNumber
+{
+    // Test Maintenance
+    if (self.maintenanceMode)
+        return;
+    
+    NSInteger queueDownload = [[[NCManageDatabase sharedInstance] getTableMetadataDownload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataDownloadWWan] count];
+    NSInteger queueUpload = [[[NCManageDatabase sharedInstance] getTableMetadataUpload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataUploadWWan] count];
+    
+    // Total
+    NSInteger total = queueDownload + queueUpload + [[NCManageDatabase sharedInstance] countQueueDownloadWithSession:nil] + [[NCManageDatabase sharedInstance] countQueueUploadWithSession:nil];
+    
+    [UIApplication sharedApplication].applicationIconBadgeNumber = total;
+    
+    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
+    
+    if ([[splitViewController.viewControllers firstObject] isKindOfClass:[UITabBarController class]]) {
+        
+        UITabBarController *tbc = [splitViewController.viewControllers firstObject];
+        
+        UITabBarItem *tbItem = [tbc.tabBar.items objectAtIndex:0];
+        
+        if (total > 0) {
+            [tbItem setBadgeValue:[NSString stringWithFormat:@"%li", (unsigned long)total]];
+        } else {
+            [tbItem setBadgeValue:nil];
+            
+            NSDictionary* userInfo = @{@"fileID": @"", @"serverUrl": @"", @"cryptated": [NSNumber numberWithFloat:0], @"progress": [NSNumber numberWithFloat:0]};
+            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
+        }
+    }
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== TabBarController =====
 #pragma mark ===== TabBarController =====
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
@@ -929,45 +977,14 @@
     if (self.maintenanceMode)
     if (self.maintenanceMode)
         return;
         return;
     
     
+    UIView *view = [(UIButton *)sender superview];
+    
     CreateMenuAdd *menuAdd = [[CreateMenuAdd alloc] initWithThemingColor:[NCBrandColor sharedInstance].brand];
     CreateMenuAdd *menuAdd = [[CreateMenuAdd alloc] initWithThemingColor:[NCBrandColor sharedInstance].brand];
     
     
     if ([CCUtility getCreateMenuEncrypted])
     if ([CCUtility getCreateMenuEncrypted])
-        [menuAdd createMenuEncryptedWithView:self.window.rootViewController.view];
+        [menuAdd createMenuEncryptedWithView:view];
     else
     else
-        [menuAdd createMenuPlainWithView:self.window.rootViewController.view];
-}
-
-- (void)updateApplicationIconBadgeNumber
-{
-    // Test Maintenance
-    if (self.maintenanceMode)
-        return;
-
-    NSInteger queueDownload = [self getNumberDownloadInQueues] + [self getNumberDownloadInQueuesWWan];
-    NSInteger queueUpload = [self getNumberUploadInQueues] + [self getNumberUploadInQueuesWWan];
-    
-    // Total
-    NSInteger total = queueDownload + queueUpload + [[NCManageDatabase sharedInstance] countQueueUploadWithSession:nil];
-    
-    [UIApplication sharedApplication].applicationIconBadgeNumber = total;
-    
-    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
-    
-    if ([[splitViewController.viewControllers firstObject] isKindOfClass:[UITabBarController class]]) {
-        
-        UITabBarController *tbc = [splitViewController.viewControllers firstObject];
-        
-        UITabBarItem *tbItem = [tbc.tabBar.items objectAtIndex:0];
-        
-        if (total > 0) {
-            [tbItem setBadgeValue:[NSString stringWithFormat:@"%li", (unsigned long)total]];
-        } else {
-            [tbItem setBadgeValue:nil];
-            
-            NSDictionary* userInfo = @{@"fileID": @"", @"serverUrl": @"", @"cryptated": [NSNumber numberWithFloat:0], @"progress": [NSNumber numberWithFloat:0]};
-            [[NSNotificationCenter defaultCenter] postNotificationOnMainThreadName:@"NotificationProgressTask" object:nil userInfo:userInfo];
-        }
-    }
+        [menuAdd createMenuPlainWithView:view];
 }
 }
 
 
 - (void)selectedTabBarController:(NSInteger)index
 - (void)selectedTabBarController:(NSInteger)index
@@ -995,6 +1012,27 @@
     }
     }
 }
 }
 
 
+- (NSString *)getTabBarControllerActiveServerUrl
+{
+    UISplitViewController *splitViewController = (UISplitViewController *)self.window.rootViewController;
+    UITabBarController *tabBarController = [splitViewController.viewControllers firstObject];
+
+    NSString *serverUrl = [CCUtility getHomeServerUrlActiveUrl:app.activeUrl];
+    NSInteger index = tabBarController.selectedIndex;
+    
+    // select active serverUrl
+    if (index == k_tabBarApplicationIndexFile) {
+        serverUrl = app.activeMain.serverUrl;
+    } else if (index == k_tabBarApplicationIndexFavorite) {
+        if (app.activeFavorites.serverUrl)
+            serverUrl = app.activeFavorites.serverUrl;
+    } else if (index == k_tabBarApplicationIndexPhotos) {
+        serverUrl = [[NCManageDatabase sharedInstance] getAccountAutoUploadPath:app.activeUrl];
+    }
+    
+    return serverUrl;
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Theming Color =====
 #pragma mark ===== Theming Color =====
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
@@ -1016,7 +1054,7 @@
                 // Activity
                 // Activity
                 [[NCManageDatabase sharedInstance] addActivityClient:@"" fileID:@"" action:k_activityDebugActionCapabilities selector:@"Server Theming" note:NSLocalizedString(@"_theming_is_light_", nil) type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:_activeUrl];
                 [[NCManageDatabase sharedInstance] addActivityClient:@"" fileID:@"" action:k_activityDebugActionCapabilities selector:@"Server Theming" note:NSLocalizedString(@"_theming_is_light_", nil) type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:_activeUrl];
                 
                 
-                [NCBrandColor sharedInstance].brand = [NCBrandColor sharedInstance].customer;
+                newColor = [NCBrandColor sharedInstance].customer;
                 
                 
             } else {
             } else {
                 
                 
@@ -1306,16 +1344,6 @@
     });
     });
 }
 }
 
 
-- (void)cancelAllOperations
-{
-    [_netQueue cancelAllOperations];
-    
-    [_netQueueDownload cancelAllOperations];
-    [_netQueueDownloadWWan cancelAllOperations];
-    [_netQueueUpload cancelAllOperations];
-    [_netQueueUploadWWan cancelAllOperations];
-}
-
 - (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet
 - (void)addNetworkingOperationQueue:(NSOperationQueue *)netQueue delegate:(id)delegate metadataNet:(CCMetadataNet *)metadataNet
 {
 {
     id operation;
     id operation;
@@ -1327,73 +1355,6 @@
     [netQueue addOperation:operation];
     [netQueue addOperation:operation];
 }
 }
 
 
-- (NSMutableArray *)verifyExistsInQueuesDownloadSelector:(NSString *)selector
-{
-    NSMutableArray *metadatasNet = [[NSMutableArray alloc] init];
-    
-    for (OCnetworking *operation in [self.netQueueDownload operations])
-        if ([operation.metadataNet.selector isEqualToString:selector])
-            [metadatasNet addObject:[operation.metadataNet copy]];
-        
-    for (OCnetworking *operation in [self.netQueueDownloadWWan operations])
-        if ([operation.metadataNet.selector isEqualToString:selector])
-            [metadatasNet addObject:[operation.metadataNet copy]];
-    
-    return metadatasNet;
-}
-
-- (NSInteger)getNumberDownloadInQueues
-{
-    NSArray *results = [[NCManageDatabase sharedInstance] getTableMetadataDownload];
-    
-    NSInteger queueNunDownload = [results count];
-    
-    // netQueueDownload
-    for (NSOperation *operation in [self.netQueueDownload operations])
-        if (((OCnetworking *)operation).isExecuting == NO) queueNunDownload++;
-    
-    return queueNunDownload;
-}
-
-- (NSInteger)getNumberDownloadInQueuesWWan
-{
-    NSArray *results = [[NCManageDatabase sharedInstance] getTableMetadataDownloadWWan];
-    
-    NSInteger queueNumDownloadWWan = [results count];
-    
-    // netQueueDownloadWWan
-    for (NSOperation *operation in [self.netQueueDownloadWWan operations])
-        if (((OCnetworking *)operation).isExecuting == NO) queueNumDownloadWWan++;
-    
-    return queueNumDownloadWWan;
-}
-
-- (NSInteger)getNumberUploadInQueues
-{
-    NSArray *results = [[NCManageDatabase sharedInstance] getTableMetadataUpload];
-    
-    NSInteger queueNumUpload = [results count];
-    
-    // netQueueUpload
-    for (NSOperation *operation in [self.netQueueUpload operations])
-        if (((OCnetworking *)operation).isExecuting == NO) queueNumUpload++;
-    
-    return queueNumUpload;
-}
-
-- (NSInteger)getNumberUploadInQueuesWWan
-{
-    NSArray *results = [[NCManageDatabase sharedInstance] getTableMetadataUploadWWan];
-    
-    NSInteger queueNumUploadWWan = [results count];
-    
-    // netQueueUploadWWan
-    for (NSOperation *operation in [self.netQueueUploadWWan operations])
-        if (((OCnetworking *)operation).isExecuting == NO) queueNumUploadWWan++;
-    
-    return queueNumUploadWWan;
-}
-
 // Notification change session
 // Notification change session
 - (void)sessionChanged:(NSNotification *)notification
 - (void)sessionChanged:(NSNotification *)notification
 {
 {
@@ -1464,7 +1425,7 @@
         if (metadata.sessionTaskIdentifierPlist != k_taskIdentifierDone) downloadPlist = YES;
         if (metadata.sessionTaskIdentifierPlist != k_taskIdentifierDone) downloadPlist = YES;
         
         
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
         dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
-            [[CCNetworking sharedNetworking] downloadFile:fileID serverUrl:serverUrl downloadData:downloadData downloadPlist:downloadPlist selector:metadata.sessionSelector selectorPost:metadata.sessionSelectorPost session:k_download_session taskStatus:k_taskStatusResume delegate:nil];
+            [[CCNetworking sharedNetworking] downloadFile:fileID serverUrl:serverUrl downloadData:downloadData downloadPlist:downloadPlist selector:metadata.sessionSelector selectorPost:metadata.sessionSelectorPost session:k_download_session taskStatus:k_taskStatusResume delegate:self.activeMain];
         });
         });
     }
     }
     else if ([[_listChangeTask objectForKey:metadata.fileID] isEqualToString:@"cancelUpload"]) {
     else if ([[_listChangeTask objectForKey:metadata.fileID] isEqualToString:@"cancelUpload"]) {
@@ -1498,6 +1459,158 @@
     }
     }
 }
 }
 
 
+#pragma --------------------------------------------------------------------------------------------
+#pragma mark ===== Process Auto Upload < k_timerProcess seconds > =====
+#pragma --------------------------------------------------------------------------------------------
+
+- (void)processAutoDownloadUpload
+{
+    // Test Maintenance
+    if (self.maintenanceMode)
+        return;
+    
+    // BACKGROND & FOREGROUND
+    NSLog(@"-PROCESS-AUTO-UPLOAD-");
+    
+    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) {
+        
+        // ONLY BACKGROUND
+        [self performSelectorOnMainThread:@selector(loadAutoDownloadUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUploadBackground] waitUntilDone:NO];
+        
+    } else {
+        
+        // ONLY FOREFROUND
+        [self performSelectorOnMainThread:@selector(loadAutoDownloadUpload:) withObject:[NSNumber numberWithInt:k_maxConcurrentOperationDownloadUpload] waitUntilDone:NO];
+    }
+}
+
+- (void)loadAutoDownloadUpload:(NSNumber *)maxConcurrent
+{
+    CCMetadataNet *metadataNet;
+    
+    // Stop Timer
+    [_timerProcessAutoDownloadUpload invalidate];
+    
+    NSInteger maxConcurrentDownloadUpload = [maxConcurrent integerValue];
+    
+    NSInteger counterDownloadInSession = [[[NCManageDatabase sharedInstance] getTableMetadataDownload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataDownloadWWan] count];
+    NSInteger counterUploadInSessionAndInLock = [[[NCManageDatabase sharedInstance] getTableMetadataUpload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataUploadWWan] count] + [[[NCManageDatabase sharedInstance] getLockQueueUpload] count];
+    
+    NSInteger counterNewUpload = 0;
+    
+    // ------------------------- <selector Auto Download> -------------------------
+    
+    while (counterDownloadInSession < maxConcurrentDownloadUpload) {
+        
+        metadataNet = [[NCManageDatabase sharedInstance] getQueueDownload];
+        if (metadataNet) {
+            
+            [[CCNetworking sharedNetworking] downloadFile:metadataNet.fileID serverUrl:metadataNet.serverUrl downloadData:metadataNet.downloadData downloadPlist:metadataNet.downloadPlist selector:metadataNet.selector selectorPost:metadataNet.selectorPost session:metadataNet.session taskStatus:metadataNet.taskStatus delegate:app.activeMain];
+            
+        } else
+            break;
+        
+        counterDownloadInSession = [[[NCManageDatabase sharedInstance] getTableMetadataDownload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataDownloadWWan] count];
+    }
+    
+    // ------------------------- <selector Auto Upload> -------------------------
+    
+    while (counterUploadInSessionAndInLock < maxConcurrentDownloadUpload) {
+        
+        metadataNet = [[NCManageDatabase sharedInstance] getQueueUploadWithSelector:selectorUploadAutoUpload];
+        if (metadataNet) {
+            
+            // Priority Error only in Foreground
+            if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground && metadataNet.priority <= k_priorityAutoUploadError)
+                continue;
+            
+            [[CCNetworking sharedNetworking] uploadFileFromAssetLocalIdentifier:metadataNet delegate:_activeMain];
+            
+            counterNewUpload++;
+            
+        } else
+            break;
+        
+        counterUploadInSessionAndInLock = [[[NCManageDatabase sharedInstance] getTableMetadataUpload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataUploadWWan] count] + [[[NCManageDatabase sharedInstance] getLockQueueUpload] count];
+    }
+    
+    // ------------------------- <selector Auto Upload All> ----------------------
+    
+    // Verify num error MAX 10 after STOP
+    NSArray *metadatas = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account = %@ AND sessionSelector = %@ AND (sessionTaskIdentifier = %i OR sessionTaskIdentifierPlist = %i)", _activeAccount, selectorUploadAutoUploadAll, k_taskIdentifierError, k_taskIdentifierError] sorted:nil ascending:NO];
+    
+    NSInteger errorCount = [metadatas count];
+    
+    if (errorCount >= 10) {
+        
+        [self messageNotification:@"_error_" description:@"_too_errors_automatic_all_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:0];
+        
+    } else {
+        
+        while (counterUploadInSessionAndInLock < maxConcurrentDownloadUpload) {
+            
+            metadataNet =  [[NCManageDatabase sharedInstance] getQueueUploadWithSelector:selectorUploadAutoUploadAll];
+            if (metadataNet) {
+                
+                // Priority Error only in Foreground
+                if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground && metadataNet.priority <= k_priorityAutoUploadError)
+                    continue;
+                
+                [[CCNetworking sharedNetworking] uploadFileFromAssetLocalIdentifier:metadataNet delegate:_activeMain];
+                
+                counterNewUpload++;
+                
+            } else
+                break;
+            
+            counterUploadInSessionAndInLock = [[[NCManageDatabase sharedInstance] getTableMetadataUpload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataUploadWWan] count] + [[[NCManageDatabase sharedInstance] getLockQueueUpload] count];
+        }
+    }
+    
+    // ------------------------- <selector Upload File> -------------------------
+    
+    while (counterUploadInSessionAndInLock < maxConcurrentDownloadUpload) {
+        
+        metadataNet = [[NCManageDatabase sharedInstance] getQueueUploadWithSelector:selectorUploadFile];
+        if (metadataNet) {
+            
+            // Priority Error only in Foreground
+            if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground && metadataNet.priority <= k_priorityAutoUploadError)
+                continue;
+            
+            [[CCNetworking sharedNetworking] uploadFileFromAssetLocalIdentifier:metadataNet delegate:_activeMain];
+            
+            counterNewUpload++;
+            
+        } else
+            break;
+        
+        counterUploadInSessionAndInLock = [[[NCManageDatabase sharedInstance] getTableMetadataUpload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataUploadWWan] count] + [[[NCManageDatabase sharedInstance] getLockQueueUpload] count];
+    }
+    
+    // Verify Lock
+    NSInteger counterUploadInSession = [[[NCManageDatabase sharedInstance] getTableMetadataUpload] count] + [[[NCManageDatabase sharedInstance] getTableMetadataUploadWWan] count];
+    NSArray *tableMetadatasInLock = [[NCManageDatabase sharedInstance] getLockQueueUpload];
+    
+    if (counterNewUpload == 0 && counterUploadInSession == 0 && [tableMetadatasInLock count] > 0) {
+        
+        // Unlock
+        for (tableMetadata *metadata in tableMetadatasInLock) {
+            
+            if ([[NCManageDatabase sharedInstance] isTableInvalidated:metadata] == NO)
+                [[NCManageDatabase sharedInstance] unlockQueueUploadWithAssetLocalIdentifier:metadata.assetLocalIdentifier];
+        }
+    }
+    
+    // In background verify Upload in error
+    if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground) {
+        [[CCNetworking sharedNetworking] verifyUploadInErrorOrWait];
+    }
+    
+    // Start Timer
+    _timerProcessAutoDownloadUpload = [NSTimer scheduledTimerWithTimeInterval:k_timerProcessAutoDownloadUpload target:app selector:@selector(processAutoDownloadUpload) userInfo:nil repeats:YES];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Open CCUploadFromOtherUpp  =====
 #pragma mark ===== Open CCUploadFromOtherUpp  =====
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
@@ -1547,7 +1660,7 @@
 }
 }
 
 
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== maintenance Mode =====
+#pragma mark ===== Maintenance Mode =====
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 
 
 - (void)maintenanceMode:(BOOL)mode
 - (void)maintenanceMode:(BOOL)mode
@@ -1566,7 +1679,7 @@
 #endif
 #endif
     
     
     NSString *actualVersion = [CCUtility getVersion];
     NSString *actualVersion = [CCUtility getVersion];
-    //NSString *actualBuild = [CCUtility getBuild];
+    NSString *actualBuild = [CCUtility getBuild];
     
     
     /* ---------------------- UPGRADE VERSION ----------------------- */
     /* ---------------------- UPGRADE VERSION ----------------------- */
     
     
@@ -1614,18 +1727,23 @@
         [self maintenanceMode:NO];
         [self maintenanceMode:NO];
     }
     }
     
     
-    // VERSION == 2.17.4
+    // VERSION < 2.17.6
 
 
-    if ([actualVersion isEqualToString:@"2.17.4"]) {
+    if (([actualVersion compare:@"2.17.6" options:NSNumericSearch] == NSOrderedAscending)) {
         
         
-        // Build < 37 (example)
-        /*
-        if (([actualBuild compare:@"37" options:NSNumericSearch] == NSOrderedAscending) || actualBuild == nil) {
+        // Remove All old Photo Library
+        [[NCManageDatabase sharedInstance] clearTable:[tablePhotoLibrary class] account:nil];
+    }
+    
+    // VERSION == 2.17.6
+    if ([actualVersion isEqualToString:@"2.17.6"]) {
+        
+        // Build < 10
+        if (([actualBuild compare:@"10" options:NSNumericSearch] == NSOrderedAscending) || actualBuild == nil) {
             
             
-            [CCUtility setOrderSettings:@"fileName"];
-            [CCUtility setBuild];
+            // Remove All old Photo Library
+            //[[NCManageDatabase sharedInstance] clearTable:[tablePhotoLibrary class] account:nil];
         }
         }
-        */ 
     }
     }
     
     
     return YES;
     return YES;

+ 0 - 2
iOSClient/AutoUpload/NCAutoUpload.h

@@ -35,8 +35,6 @@
 - (BOOL)checkIfLocationIsEnabled;
 - (BOOL)checkIfLocationIsEnabled;
 - (void)setupAutoUploadFull;
 - (void)setupAutoUploadFull;
 
 
-- (void)loadAutoUpload:(NSNumber *)maxConcurrent;
-
 - (BOOL)createFolderSubFolderAutoUploadFolderPhotos:(NSString *)folderPhotos useSubFolder:(BOOL)useSubFolder assets:(PHFetchResult *)assets selector:(NSString *)selector;
 - (BOOL)createFolderSubFolderAutoUploadFolderPhotos:(NSString *)folderPhotos useSubFolder:(BOOL)useSubFolder assets:(PHFetchResult *)assets selector:(NSString *)selector;
 
 
 - (void)alignPhotoLibrary;
 - (void)alignPhotoLibrary;

+ 14 - 110
iOSClient/AutoUpload/NCAutoUpload.m

@@ -404,7 +404,6 @@
         
         
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
         
         
-        metadataNet.action = actionUploadAsset;
         metadataNet.assetLocalIdentifier = asset.localIdentifier;
         metadataNet.assetLocalIdentifier = asset.localIdentifier;
         if (assetsFull) {
         if (assetsFull) {
             metadataNet.selector = selectorUploadAutoUploadAll;
             metadataNet.selector = selectorUploadAutoUploadAll;
@@ -477,100 +476,6 @@
     }
     }
 }
 }
 
 
-#pragma --------------------------------------------------------------------------------------------
-#pragma mark ===== Load Auto Upload ====
-#pragma --------------------------------------------------------------------------------------------
-
-- (void)loadAutoUpload:(NSNumber *)maxConcurrent
-{
-    CCMetadataNet *metadataNet;
-    
-    // Stop Timer
-    [app.timerProcessAutoUpload invalidate];
-    
-    NSInteger maxConcurrentUpload = [maxConcurrent integerValue];
-    NSInteger counterUploadInQueueAndInLock = [app getNumberUploadInQueues] + [app getNumberUploadInQueuesWWan] + [[[NCManageDatabase sharedInstance] getLockQueueUpload] count];
-    NSInteger counterNewUpload = 0;
- 
-    // ------------------------- <selector Auto Upload> -------------------------
-    
-    while (counterUploadInQueueAndInLock < maxConcurrentUpload) {
-        
-        metadataNet = [[NCManageDatabase sharedInstance] getQueueUploadWithSelector:selectorUploadAutoUpload];
-        if (metadataNet) {
-            
-            // Priority Error only in Foreground
-            if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground && metadataNet.priority <= k_priorityAutoUploadError)
-                continue;
-            
-            [[CCNetworking sharedNetworking] uploadFileFromAssetLocalIdentifier:metadataNet delegate:app.activeMain];
-            
-            counterNewUpload++;
-            
-        } else
-            break;
-        
-        counterUploadInQueueAndInLock = [app getNumberUploadInQueues] + [app getNumberUploadInQueuesWWan] + [[[NCManageDatabase sharedInstance] getLockQueueUpload] count];
-    }
-    
-    // ------------------------- <selector Auto Upload All> ----------------------
-    
-    // Verify num error MAX 10 after STOP
-    NSArray *metadatas = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account = %@ AND sessionSelector = %@ AND (sessionTaskIdentifier = %i OR sessionTaskIdentifierPlist = %i)", app.activeAccount, selectorUploadAutoUploadAll, k_taskIdentifierError, k_taskIdentifierError] sorted:nil ascending:NO];
-    
-    NSInteger errorCount = [metadatas count];
-    
-    if (errorCount >= 10) {
-        
-        [app messageNotification:@"_error_" description:@"_too_errors_automatic_all_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:0];
-    
-    } else {
-    
-        while (counterUploadInQueueAndInLock < maxConcurrentUpload) {
-        
-            metadataNet =  [[NCManageDatabase sharedInstance] getQueueUploadWithSelector:selectorUploadAutoUploadAll];
-            if (metadataNet) {
-                
-                // Priority Error only in Foreground
-                if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateBackground && metadataNet.priority <= k_priorityAutoUploadError)
-                    continue;
-
-                [[CCNetworking sharedNetworking] uploadFileFromAssetLocalIdentifier:metadataNet delegate:app.activeMain];
-                
-                counterNewUpload++;
-        
-            } else
-                break;
-            
-            counterUploadInQueueAndInLock = [app getNumberUploadInQueues] + [app getNumberUploadInQueuesWWan] + [[[NCManageDatabase sharedInstance] getLockQueueUpload] count];
-        }
-    }
-    
-    // Verify Lock
-    NSInteger counterUploadInQueue = [app getNumberUploadInQueues] + [app getNumberUploadInQueuesWWan];
-    NSArray *tableMetadatasInLock = [[NCManageDatabase sharedInstance] getLockQueueUpload];
-
-    if (counterNewUpload == 0 && counterUploadInQueue == 0 && [tableMetadatasInLock count] > 0) {
-        
-        // Unlock
-        for (tableMetadata *metadata in tableMetadatasInLock) {
-            
-            if ([[NCManageDatabase sharedInstance] isTableInvalidated:metadata] == NO)
-                [[NCManageDatabase sharedInstance] unlockQueueUploadWithAssetLocalIdentifier:metadata.assetLocalIdentifier];
-        }
-    }
-    
-    // verify Download/Upload 
-    if (counterNewUpload == 0) {
-        
-        [[CCNetworking sharedNetworking] verifyDownloadInProgress];
-        [[CCNetworking sharedNetworking] verifyUploadInProgress];
-    }
-
-    // Start Timer
-    app.timerProcessAutoUpload = [NSTimer scheduledTimerWithTimeInterval:k_timerProcessAutoUpload target:app selector:@selector(processAutoUpload) userInfo:nil repeats:YES];
-}
-
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Create Folder SubFolder Auto Upload Folder Photos ====
 #pragma mark ===== Create Folder SubFolder Auto Upload Folder Photos ====
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
@@ -581,14 +486,15 @@
     
     
     if ([ocNetworking automaticCreateFolderSync:folderPhotos]) {
     if ([ocNetworking automaticCreateFolderSync:folderPhotos]) {
         
         
-        (void)[[NCManageDatabase sharedInstance] addDirectoryWithServerUrl:folderPhotos permissions:@""];
+        (void)[[NCManageDatabase sharedInstance] addDirectoryWithServerUrl:folderPhotos permissions:nil];
         
         
     } else {
     } else {
         
         
         // Activity
         // Activity
         [[NCManageDatabase sharedInstance] addActivityClient:folderPhotos fileID:@"" action:k_activityDebugActionAutoUpload selector:selector note:NSLocalizedStringFromTable(@"_not_possible_create_folder_", @"Error", nil) type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:app.activeUrl];
         [[NCManageDatabase sharedInstance] addActivityClient:folderPhotos fileID:@"" action:k_activityDebugActionAutoUpload selector:selector note:NSLocalizedStringFromTable(@"_not_possible_create_folder_", @"Error", nil) type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:app.activeUrl];
         
         
-        [app messageNotification:@"_error_" description:@"_error_createsubfolders_upload_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:0];
+        if ([selector isEqualToString:selectorUploadAutoUploadAll])
+            [app messageNotification:@"_error_" description:@"_error_createsubfolders_upload_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:0];
 
 
         return false;
         return false;
     }
     }
@@ -600,14 +506,15 @@
             
             
             if ([ocNetworking automaticCreateFolderSync:[NSString stringWithFormat:@"%@/%@", folderPhotos, dateSubFolder]]) {
             if ([ocNetworking automaticCreateFolderSync:[NSString stringWithFormat:@"%@/%@", folderPhotos, dateSubFolder]]) {
                 
                 
-                (void)[[NCManageDatabase sharedInstance] addDirectoryWithServerUrl:[NSString stringWithFormat:@"%@/%@", folderPhotos, dateSubFolder] permissions:@""];
+                (void)[[NCManageDatabase sharedInstance] addDirectoryWithServerUrl:[NSString stringWithFormat:@"%@/%@", folderPhotos, dateSubFolder] permissions:nil];
                 
                 
             } else {
             } else {
                 
                 
                 // Activity
                 // Activity
                 [[NCManageDatabase sharedInstance] addActivityClient:[NSString stringWithFormat:@"%@/%@", folderPhotos, dateSubFolder] fileID:@"" action:k_activityDebugActionAutoUpload selector:selector note:NSLocalizedString(@"_error_createsubfolders_upload_",nil) type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:app.activeUrl];
                 [[NCManageDatabase sharedInstance] addActivityClient:[NSString stringWithFormat:@"%@/%@", folderPhotos, dateSubFolder] fileID:@"" action:k_activityDebugActionAutoUpload selector:selector note:NSLocalizedString(@"_error_createsubfolders_upload_",nil) type:k_activityTypeFailure verbose:k_activityVerboseDefault activeUrl:app.activeUrl];
                 
                 
-                [app messageNotification:@"_error_" description:@"_error_createsubfolders_upload_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:0];
+                if ([selector isEqualToString:selectorUploadAutoUploadAll])
+                    [app messageNotification:@"_error_" description:@"_error_createsubfolders_upload_" visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:0];
 
 
                 return false;
                 return false;
             }
             }
@@ -662,17 +569,15 @@
             if (assetsFull == NO) {
             if (assetsFull == NO) {
             
             
                 NSString *creationDate;
                 NSString *creationDate;
-                NSString *modificationDate;
                 NSString *idAsset;
                 NSString *idAsset;
-                
+
                 NSArray *idsAsset = [[NCManageDatabase sharedInstance] getPhotoLibraryIdAssetWithImage:account.autoUploadImage video:account.autoUploadVideo];
                 NSArray *idsAsset = [[NCManageDatabase sharedInstance] getPhotoLibraryIdAssetWithImage:account.autoUploadImage video:account.autoUploadVideo];
                 
                 
                 for (PHAsset *asset in assets) {
                 for (PHAsset *asset in assets) {
                     
                     
                     (asset.creationDate != nil) ? (creationDate = [NSString stringWithFormat:@"%@", asset.creationDate]) : (creationDate = @"");
                     (asset.creationDate != nil) ? (creationDate = [NSString stringWithFormat:@"%@", asset.creationDate]) : (creationDate = @"");
-                    (asset.modificationDate != nil) ? (modificationDate = [NSString stringWithFormat:@"%@", asset.modificationDate]) : (modificationDate = @"");
                     
                     
-                    idAsset = [NSString stringWithFormat:@"%@%@%@%@", account.account, asset.localIdentifier, creationDate, modificationDate];
+                    idAsset = [NSString stringWithFormat:@"%@%@%@", account.account, asset.localIdentifier, creationDate];
                     
                     
                     if (![idsAsset containsObject: idAsset])
                     if (![idsAsset containsObject: idAsset])
                         [newAssets addObject:asset];
                         [newAssets addObject:asset];
@@ -696,15 +601,14 @@
 
 
 - (void)alignPhotoLibrary
 - (void)alignPhotoLibrary
 {
 {
-    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
-        
-        tableAccount *account = [[NCManageDatabase sharedInstance] getAccountActive];
+    tableAccount *account = [[NCManageDatabase sharedInstance] getAccountActive];
 
 
-        PHFetchResult *assets = [self getCameraRollAssets:account assetsFull:YES alignPhotoLibrary:YES];
-        (void)[[NCManageDatabase sharedInstance] addPhotoLibrary:(NSArray *)assets];
+    PHFetchResult *assets = [self getCameraRollAssets:account assetsFull:YES alignPhotoLibrary:YES];
+        
+    [[NCManageDatabase sharedInstance] clearTable:[tablePhotoLibrary class] account:app.activeAccount];
+    (void)[[NCManageDatabase sharedInstance] addPhotoLibrary:(NSArray *)assets];
 
 
-        NSLog(@"Align Photo Library %lu", (unsigned long)[assets count]);
-    });
+    NSLog(@"Align Photo Library %lu", (unsigned long)[assets count]);
 }
 }
 
 
 @end
 @end

+ 2 - 2
iOSClient/Brand/Picker.plist

@@ -17,9 +17,9 @@
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
-	<string>2.17.5</string>
+	<string>2.17.6</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>00005</string>
+	<string>00014</string>
 	<key>NSAppTransportSecurity</key>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>
 		<key>NSAllowsArbitraryLoads</key>

+ 2 - 2
iOSClient/Brand/PickerFileProvider.plist

@@ -17,9 +17,9 @@
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
-	<string>2.17.5</string>
+	<string>2.17.6</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>00005</string>
+	<string>00014</string>
 	<key>NSExtension</key>
 	<key>NSExtension</key>
 	<dict>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 2 - 2
iOSClient/Brand/Share.plist

@@ -17,9 +17,9 @@
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>XPC!</string>
 	<string>XPC!</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
-	<string>2.17.5</string>
+	<string>2.17.6</string>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>00005</string>
+	<string>00014</string>
 	<key>NSAppTransportSecurity</key>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>
 		<key>NSAllowsArbitraryLoads</key>

+ 2 - 2
iOSClient/Brand/iOSClient.plist

@@ -46,7 +46,7 @@
 	<key>CFBundlePackageType</key>
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
 	<key>CFBundleShortVersionString</key>
-	<string>2.17.5</string>
+	<string>2.17.6</string>
 	<key>CFBundleSignature</key>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<string>????</string>
 	<key>CFBundleURLTypes</key>
 	<key>CFBundleURLTypes</key>
@@ -69,7 +69,7 @@
 		</dict>
 		</dict>
 	</array>
 	</array>
 	<key>CFBundleVersion</key>
 	<key>CFBundleVersion</key>
-	<string>00005</string>
+	<string>00014</string>
 	<key>Fabric</key>
 	<key>Fabric</key>
 	<dict>
 	<dict>
 		<key>APIKey</key>
 		<key>APIKey</key>

+ 16 - 16
iOSClient/CCGlobal.h

@@ -60,20 +60,21 @@ extern NSString *const urlBaseUploadDB;
 #define k_returnCreateFolderEncrypted                   3
 #define k_returnCreateFolderEncrypted                   3
 #define k_returnCreateFotoVideoEncrypted                4
 #define k_returnCreateFotoVideoEncrypted                4
 #define k_returnCreateFileEncrypted                     5
 #define k_returnCreateFileEncrypted                     5
-#define k_returnCartaDiCredito                          6
-#define k_returnBancomat                                7
-#define k_returnContoCorrente                           8
-#define k_returnAccountWeb                              9
-#define k_returnNote                                    10
-#define k_returnPatenteGuida                            11
-#define k_returnCartaIdentita                           12
-#define k_returnPassaporto                              13
+#define k_returnCreateFileText                          6
+#define k_returnCartaDiCredito                          7
+#define k_returnBancomat                                8
+#define k_returnContoCorrente                           9
+#define k_returnAccountWeb                              10
+#define k_returnNote                                    11
+#define k_returnPatenteGuida                            12
+#define k_returnCartaIdentita                           13
+#define k_returnPassaporto                              14
 
 
 // Name Default DB
 // Name Default DB
 #define k_databaseDefault                               @"nextcloud.realm"
 #define k_databaseDefault                               @"nextcloud.realm"
 
 
 // Picker select image
 // Picker select image
-#define k_pickerControllerMax                           100.0
+#define k_pickerControllerMax                           1000.0
 
 
 // define Nextcloud IOS
 // define Nextcloud IOS
 #define k_share_link_middle_part_url_after_version_8    @"index.php/s/"
 #define k_share_link_middle_part_url_after_version_8    @"index.php/s/"
@@ -115,6 +116,7 @@ extern NSString *const urlBaseUploadDB;
 // TaskIdentifier
 // TaskIdentifier
 #define k_taskIdentifierDone                            -1
 #define k_taskIdentifierDone                            -1
 #define k_taskIdentifierStop                            -2
 #define k_taskIdentifierStop                            -2
+#define k_taskIdentifierWaitStart                       -3
 #define k_taskIdentifierError                           -99999
 #define k_taskIdentifierError                           -99999
 #define k_taskIdentifierNULL                            99999
 #define k_taskIdentifierNULL                            99999
 
 
@@ -125,7 +127,7 @@ extern NSString *const urlBaseUploadDB;
 #define k_taskStatusSuspend                             -3
 #define k_taskStatusSuspend                             -3
 
 
 #define k_timerVerifySession                            10
 #define k_timerVerifySession                            10
-#define k_timerProcessAutoUpload                        5
+#define k_timerProcessAutoDownloadUpload                5
 #define k_timerUpdateApplicationIconBadgeNumber         3
 #define k_timerUpdateApplicationIconBadgeNumber         3
 
 
 #define k_maxConcurrentOperation                         10
 #define k_maxConcurrentOperation                         10
@@ -173,6 +175,8 @@ extern NSString *const urlBaseUploadDB;
 #define selectorReadFileVerifyUpload                    @"readFileVerifyUpload"
 #define selectorReadFileVerifyUpload                    @"readFileVerifyUpload"
 #define selectorReadFileWithDownload                    @"readFileWithDownload"
 #define selectorReadFileWithDownload                    @"readFileWithDownload"
 #define selectorReadFileReloadFolder                    @"readFileReloadFolder"
 #define selectorReadFileReloadFolder                    @"readFileReloadFolder"
+#define selectorReadFileFolder                          @"readFileFolder"
+#define selectorReadFileFolderWithDownload              @"readFileFolderWithDownload"
 #define selectorReadFolder                              @"readFolder"
 #define selectorReadFolder                              @"readFolder"
 #define selectorReadFolderForced                        @"readFolderForced"
 #define selectorReadFolderForced                        @"readFolderForced"
 #define selectorReadFolderWithDownload                  @"readFolderWithDownload"
 #define selectorReadFolderWithDownload                  @"readFolderWithDownload"
@@ -193,14 +197,13 @@ extern NSString *const urlBaseUploadDB;
 // Metadata.Net ACTION
 // Metadata.Net ACTION
 #define actionCreateFolder                              @"createFolder"
 #define actionCreateFolder                              @"createFolder"
 #define actionDeleteFileDirectory                       @"deleteFileOrFolder"
 #define actionDeleteFileDirectory                       @"deleteFileOrFolder"
-#define actionDownloadFile                              @"downloadFile"
 #define actionDownloadThumbnail                         @"downloadThumbnail"
 #define actionDownloadThumbnail                         @"downloadThumbnail"
 #define actionGetActivityServer                         @"getActivityServer"
 #define actionGetActivityServer                         @"getActivityServer"
 #define actionGetCapabilities                           @"getCapabilitiesOfServer"
 #define actionGetCapabilities                           @"getCapabilitiesOfServer"
 #define actionGetUserAndGroup                           @"getUserAndGroup"
 #define actionGetUserAndGroup                           @"getUserAndGroup"
 #define actionGetUserProfile                            @"getUserProfile"
 #define actionGetUserProfile                            @"getUserProfile"
 #define actionGetNotificationServer                     @"getNotificationServer"
 #define actionGetNotificationServer                     @"getNotificationServer"
-#define actionSetNotificationServer                     @"setNotificationServer"
+#define actionGetSharePermissionsFile                   @"getSharePermissionsFile"
 #define actionGetExternalSitesServer                    @"getExternalSitesServer"
 #define actionGetExternalSitesServer                    @"getExternalSitesServer"
 #define actionMiddlewarePing                            @"middlewarePing"
 #define actionMiddlewarePing                            @"middlewarePing"
 #define actionListingFavorites                          @"listingFavorites"
 #define actionListingFavorites                          @"listingFavorites"
@@ -209,16 +212,13 @@ extern NSString *const urlBaseUploadDB;
 #define actionReadFolder                                @"readFolder"
 #define actionReadFolder                                @"readFolder"
 #define actionReadShareServer                           @"readShareServer"
 #define actionReadShareServer                           @"readShareServer"
 #define actionSearch                                    @"search"
 #define actionSearch                                    @"search"
+#define actionSetNotificationServer                     @"setNotificationServer"
 #define actionSettingFavorite                           @"settingFavorite"
 #define actionSettingFavorite                           @"settingFavorite"
 #define actionShare                                     @"share"
 #define actionShare                                     @"share"
 #define actionShareWith                                 @"shareWith"
 #define actionShareWith                                 @"shareWith"
 #define actionSubscribingNextcloudServer                @"subscribingNextcloudServer"
 #define actionSubscribingNextcloudServer                @"subscribingNextcloudServer"
 #define actionUnShare                                   @"unShare"
 #define actionUnShare                                   @"unShare"
 #define actionUpdateShare                               @"updateShare"
 #define actionUpdateShare                               @"updateShare"
-#define actionUploadFile                                @"uploadFile"
-#define actionUploadAsset                               @"uploadAsset"
-#define actionUploadTemplate                            @"uploadTemplate"
-#define actionUploadOnlyPlist                           @"uploadOnlyPlist"
 
 
 // Metadata : FileType
 // Metadata : FileType
 #define k_metadataTypeFile_audio                        @"audio"
 #define k_metadataTypeFile_audio                        @"audio"

+ 214 - 29
iOSClient/Create/CCCreateCloud.swift

@@ -29,17 +29,18 @@ class CreateMenuAdd: NSObject {
     
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
 
 
-    let fontButton = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
+    let fontButton = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: UIColor.black]
     let fontEncrypted = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: NCBrandColor.sharedInstance.cryptocloud] as [String : Any]
     let fontEncrypted = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: NCBrandColor.sharedInstance.cryptocloud] as [String : Any]
-    let fontCancel = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: NCBrandColor.sharedInstance.brand] as [String : Any]
-    let fontDisable = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: UIColor(colorLiteralRed: 65.0/255.0, green: 64.0/255.0, blue: 66.0/255.0, alpha: 1.0)]
+    let fontCancel = [NSFontAttributeName:UIFont(name: "HelveticaNeue-Bold", size: 17)!, NSForegroundColorAttributeName: UIColor.black] as [String : Any]
+    let fontDisable = [NSFontAttributeName:UIFont(name: "HelveticaNeue", size: 16)!, NSForegroundColorAttributeName: UIColor.darkGray]
 
 
     let colorLightGray = UIColor(colorLiteralRed: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1)
     let colorLightGray = UIColor(colorLiteralRed: 250.0/255.0, green: 250.0/255.0, blue: 250.0/255.0, alpha: 1)
+    let colorGray = UIColor(colorLiteralRed: 150.0/255.0, green: 150.0/255.0, blue: 150.0/255.0, alpha: 1)
     var colorIcon = NCBrandColor.sharedInstance.brand
     var colorIcon = NCBrandColor.sharedInstance.brand
     
     
     init (themingColor : UIColor) {
     init (themingColor : UIColor) {
-        super.init()
         
         
+        super.init()
         colorIcon = themingColor
         colorIcon = themingColor
     }
     }
     
     
@@ -51,9 +52,6 @@ class CreateMenuAdd: NSObject {
         actionSheet.animationDuration = 0.2
         actionSheet.animationDuration = 0.2
         actionSheet.automaticallyTintButtonImages = 0
         actionSheet.automaticallyTintButtonImages = 0
         
         
-        actionSheet.blurRadius = 0.0
-        actionSheet.blurTintColor = UIColor(white: 0.0, alpha: 0.50)
-        
         actionSheet.buttonHeight = 50.0
         actionSheet.buttonHeight = 50.0
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.separatorHeight = 5.0
         actionSheet.separatorHeight = 5.0
@@ -67,18 +65,22 @@ class CreateMenuAdd: NSObject {
         
         
         actionSheet.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
         actionSheet.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
         
         
-        actionSheet.addButton(withTitle: NSLocalizedString("_create_folder_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "folder"), color: colorIcon), backgroundColor: UIColor.white, height: 50.0 ,type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
-            appDelegate.activeMain.returnCreate(Int(k_returnCreateFolderPlain))
-        })
-        
-        actionSheet.addButton(withTitle: NSLocalizedString("_upload_photos_videos_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "menuUploadPhoto"), color: colorIcon), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+        actionSheet.addButton(withTitle: NSLocalizedString("_upload_photos_videos_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "menuUploadPhoto"), color: colorGray), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFotoVideoPlain))
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFotoVideoPlain))
         })
         })
         
         
-        actionSheet.addButton(withTitle: NSLocalizedString("_upload_file_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "menuUploadFile"), color: colorIcon), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+        actionSheet.addButton(withTitle: NSLocalizedString("_upload_file_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "menuUploadFile"), color: colorGray), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFilePlain))
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFilePlain))
         })
         })
         
         
+        actionSheet.addButton(withTitle: NSLocalizedString("_upload_file_text_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "file_txt"), color: colorGray), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(k_returnCreateFileText))
+        })
+        
+        actionSheet.addButton(withTitle: NSLocalizedString("_create_folder_", comment: ""), image: CCGraphics.changeThemingColorImage(UIImage(named: "folder"), color: colorIcon), backgroundColor: UIColor.white, height: 50.0 ,type: AHKActionSheetButtonType.default, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(k_returnCreateFolderPlain))
+        })
+        
         if appDelegate.isCryptoCloudMode {
         if appDelegate.isCryptoCloudMode {
         
         
             actionSheet.addButton(withTitle: NSLocalizedString("_upload_encrypted_mode", comment: ""), image: UIImage(named: "actionSheetLock"), backgroundColor: colorLightGray, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
             actionSheet.addButton(withTitle: NSLocalizedString("_upload_encrypted_mode", comment: ""), image: UIImage(named: "actionSheetLock"), backgroundColor: colorLightGray, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
@@ -97,9 +99,6 @@ class CreateMenuAdd: NSObject {
         
         
         actionSheet.animationDuration = 0.2
         actionSheet.animationDuration = 0.2
         
         
-        actionSheet.blurRadius = 0.0
-        actionSheet.blurTintColor = UIColor(white: 0.0, alpha: 0.50)
-
         actionSheet.buttonHeight = 50.0
         actionSheet.buttonHeight = 50.0
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.separatorHeight = 5.0
         actionSheet.separatorHeight = 5.0
@@ -113,19 +112,19 @@ class CreateMenuAdd: NSObject {
         
         
         actionSheet.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
         actionSheet.cancelButtonTitle = NSLocalizedString("_cancel_", comment: "")
         
         
-        actionSheet.addButton(withTitle: NSLocalizedString("_create_folder_", comment: ""), image: UIImage(named: "foldercrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
-            appDelegate.activeMain.returnCreate(Int(k_returnCreateFolderEncrypted))
-        })
-        
         actionSheet.addButton(withTitle: NSLocalizedString("_upload_photos_videos_", comment: ""), image: UIImage(named: "menuUploadPhotoCrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
         actionSheet.addButton(withTitle: NSLocalizedString("_upload_photos_videos_", comment: ""), image: UIImage(named: "menuUploadPhotoCrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFotoVideoEncrypted))
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFotoVideoEncrypted))
         })
         })
-        
+
         actionSheet.addButton(withTitle: NSLocalizedString("_upload_file_", comment: ""), image: UIImage(named: "menuUploadFileCrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
         actionSheet.addButton(withTitle: NSLocalizedString("_upload_file_", comment: ""), image: UIImage(named: "menuUploadFileCrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFileEncrypted))
             appDelegate.activeMain.returnCreate(Int(k_returnCreateFileEncrypted))
         })
         })
+        
+        actionSheet.addButton(withTitle: NSLocalizedString("_create_folder_", comment: ""), image: UIImage(named: "foldercrypto"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+            appDelegate.activeMain.returnCreate(Int(k_returnCreateFolderEncrypted))
+        })
 
 
-        actionSheet.addButton(withTitle: NSLocalizedString("_upload_template_", comment: ""), image: UIImage(named: "menuTemplate"), backgroundColor: colorLightGray, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
+        actionSheet.addButton(withTitle: NSLocalizedString("_upload_template_", comment: ""), image: UIImage(named: "menuTemplate"), backgroundColor: UIColor.white, height: 50.0, type: AHKActionSheetButtonType.encrypted, handler: {(AHKActionSheet) -> Void in
             self.createMenuTemplate(view: view)
             self.createMenuTemplate(view: view)
         })
         })
 
 
@@ -145,9 +144,6 @@ class CreateMenuAdd: NSObject {
         
         
         actionSheet.animationDuration = 0.2
         actionSheet.animationDuration = 0.2
         
         
-        actionSheet.blurRadius = 0.0
-        actionSheet.blurTintColor = UIColor(white: 0.0, alpha: 0.50)
-
         actionSheet.buttonHeight = 50.0
         actionSheet.buttonHeight = 50.0
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.cancelButtonHeight = 50.0
         actionSheet.separatorHeight = 5.0
         actionSheet.separatorHeight = 5.0
@@ -224,14 +220,14 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
     
     
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
     let appDelegate = UIApplication.shared.delegate as! AppDelegate
 
 
-    convenience init(_ titleServerUrl : String?, serverUrl : String, assets : NSMutableArray, cryptated : Bool, session : String, delegate: createFormUploadAssetsDelegate) {
+    convenience init(serverUrl : String, assets : NSMutableArray, cryptated : Bool, session : String, delegate: createFormUploadAssetsDelegate) {
         
         
         self.init()
         self.init()
         
         
-        if titleServerUrl == nil || titleServerUrl?.isEmpty == true {
-            self.titleServerUrl = "/"
+        if serverUrl == CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl) {
+            titleServerUrl = "/"
         } else {
         } else {
-            self.titleServerUrl = titleServerUrl
+            titleServerUrl = (serverUrl as NSString).lastPathComponent
         }
         }
         
         
         self.serverUrl = serverUrl
         self.serverUrl = serverUrl
@@ -566,4 +562,193 @@ class CreateFormUploadAssets: XLFormViewController, CCMoveDelegate {
     
     
 }
 }
 
 
+class CreateFormUploadFile: XLFormViewController, CCMoveDelegate {
+    
+    var serverUrl = ""
+    var titleServerUrl = ""
+    var fileName = ""
+    var text = ""
+    
+    let appDelegate = UIApplication.shared.delegate as! AppDelegate
+    
+    convenience init(serverUrl: String, text: String, fileName: String) {
+        
+        self.init()
+        
+        if serverUrl == CCUtility.getHomeServerUrlActiveUrl(appDelegate.activeUrl) {
+            titleServerUrl = "/"
+        } else {
+            titleServerUrl = (serverUrl as NSString).lastPathComponent
+        }
+        
+        self.fileName = fileName
+        self.serverUrl = serverUrl
+        self.text = text
+        
+        initializeForm()
+    }
+    
+    //MARK: XLFormDescriptorDelegate
+    
+    func initializeForm() {
+        
+        let form : XLFormDescriptor = XLFormDescriptor() as XLFormDescriptor
+        form.rowNavigationOptions = XLFormRowNavigationOptions.stopDisableRow
+        
+        var section : XLFormSectionDescriptor
+        var row : XLFormRowDescriptor
+        
+        // Section: Destination Folder
+        
+        section = XLFormSectionDescriptor.formSection()
+        form.addFormSection(section)
+        row = XLFormRowDescriptor(tag: "ButtonDestinationFolder", rowType: XLFormRowDescriptorTypeButton, title: self.titleServerUrl)
+        let imageFolder = CCGraphics.changeThemingColorImage(UIImage(named: "folder")!, color: NCBrandColor.sharedInstance.brand) as UIImage
+        row.cellConfig.setObject(imageFolder, forKey: "imageView.image" as NSCopying)
+        row.cellConfig.setObject(UIColor.black, forKey: "textLabel.textColor" as NSCopying)
+        row.action.formSelector = #selector(changeDestinationFolder(_:))
+        section.addFormRow(row)
+        
+        // Section: File Name
+        
+        section = XLFormSectionDescriptor.formSection()
+        form.addFormSection(section)
+        
+        row = XLFormRowDescriptor(tag: "fileName", rowType: XLFormRowDescriptorTypeAccount, title: NSLocalizedString("_filename_", comment: ""))
+        row.value = fileName
+        section.addFormRow(row)
+        
+        self.form = form
+    }
+    
+    override func formRowDescriptorValueHasChanged(_ formRow: XLFormRowDescriptor!, oldValue: Any!, newValue: Any!) {
+        
+        super.formRowDescriptorValueHasChanged(formRow, oldValue: oldValue, newValue: newValue)
+        
+        if formRow.tag == "fileName" {
+            
+            self.form.delegate = nil
+            
+            if let fileNameNew = formRow.value {
+                 self.fileName = CCUtility.removeForbiddenCharactersServer(fileNameNew as! String)
+            }
+        
+            self.title = fileName
+
+            self.form.delegate = self
+        }
+    }
+    
+    // MARK: - View Life Cycle
+    
+    override func viewDidLoad() {
+        
+        super.viewDidLoad()
+        
+        let saveButton : UIBarButtonItem = UIBarButtonItem(title: NSLocalizedString("_save_", comment: ""), style: UIBarButtonItemStyle.plain, target: self, action: #selector(save))
+        
+        self.navigationItem.rightBarButtonItem = saveButton
+        
+        self.navigationController?.navigationBar.isTranslucent = false
+        self.navigationController?.navigationBar.barTintColor = NCBrandColor.sharedInstance.brand
+        self.navigationController?.navigationBar.tintColor = NCBrandColor.sharedInstance.navigationBarText
+        self.navigationController?.navigationBar.titleTextAttributes = [NSForegroundColorAttributeName: NCBrandColor.sharedInstance.navigationBarText]
+        
+        self.tableView.separatorStyle = UITableViewCellSeparatorStyle.none
+        self.tableView.backgroundColor = NCBrandColor.sharedInstance.tableBackground
+        
+        self.reloadForm()
+    }
+    
+    func reloadForm() {
+        
+        self.form.delegate = nil
+        
+        let buttonDestinationFolder : XLFormRowDescriptor  = self.form.formRow(withTag: "ButtonDestinationFolder")!
+        buttonDestinationFolder.title = self.titleServerUrl
+        
+        self.title = fileName
+        
+        self.tableView.reloadData()
+        
+        self.form.delegate = self
+    }
+    
+    // MARK: - Action
+    
+    func moveServerUrl(to serverUrlTo: String!, title: String!) {
+        
+        self.serverUrl = serverUrlTo
+        
+        if let title = title {
+            
+            self.titleServerUrl = title
+            
+        } else {
+            
+            self.titleServerUrl = "/"
+        }
+        
+        self.reloadForm()
+    }
+    
+    func save() {
+        
+        let rowFileName : XLFormRowDescriptor  = self.form.formRow(withTag: "fileName")!
+        guard let name = rowFileName.value else {
+            return
+        }
+        let ext = (name as! NSString).pathExtension.uppercased()
+        var fileNameSave = ""
+        
+        switch ext
+        {
+            case "":
+                fileNameSave = name as! String + ".txt"
+            
+            case "TXT":
+                fileNameSave = name as! String
+            
+            default:
+                fileNameSave = (name as! NSString).deletingPathExtension + ".txt"
+        }
+        
+        self.dismiss(animated: true, completion: {
+            
+            let data = self.text.data(using: .utf8)
+            let success = FileManager.default.createFile(atPath: "\(self.appDelegate.directoryUser!)/\(fileNameSave)", contents: data, attributes: nil)
+            
+            if success {
+                CCNetworking.shared().uploadFile(fileNameSave, serverUrl: self.serverUrl, cryptated: false, onlyPlist: false, session: k_upload_session, taskStatus: Int(k_taskStatusResume), selector: nil, selectorPost: nil, errorCode: 0, delegate: self.appDelegate.activeMain)
+            } else {
+                self.appDelegate.messageNotification("_error_", description: "_error_creation_file_", visible: true, delay: TimeInterval(k_dismissAfterSecond), type: TWMessageBarMessageType.info, errorCode: 0)
+            }
+        })
+    }
+    
+    func cancel() {
+        
+        self.dismiss(animated: true, completion: nil)
+    }
+    
+    func changeDestinationFolder(_ sender: XLFormRowDescriptor) {
+        
+        self.deselectFormRow(sender)
+        
+        let storyboard : UIStoryboard = UIStoryboard(name: "CCMove", bundle: nil)
+        let navigationController = storyboard.instantiateViewController(withIdentifier: "CCMove") as! UINavigationController
+        let viewController : CCMove = navigationController.topViewController as! CCMove
+        
+        viewController.delegate = self;
+        viewController.tintColor = NCBrandColor.sharedInstance.navigationBarText
+        viewController.barTintColor = NCBrandColor.sharedInstance.brand
+        viewController.tintColorTitle = NCBrandColor.sharedInstance.navigationBarText
+        viewController.move.title = NSLocalizedString("_select_", comment: "");
+        viewController.networkingOperationQueue =  appDelegate.netQueue
+        
+        navigationController.modalPresentationStyle = UIModalPresentationStyle.formSheet
+        self.present(navigationController, animated: true, completion: nil)
+    }
+}
+
 
 

+ 17 - 0
iOSClient/Database/NCDatabase.swift

@@ -52,6 +52,7 @@ class tableAccount: Object {
     dynamic var twitter = ""
     dynamic var twitter = ""
     dynamic var url = ""
     dynamic var url = ""
     dynamic var user = ""
     dynamic var user = ""
+    dynamic var username = ""
     dynamic var webpage = ""
     dynamic var webpage = ""
 }
 }
 
 
@@ -207,6 +208,22 @@ class tablePhotoLibrary: Object {
     }
     }
 }
 }
 
 
+class tableQueueDownload: Object {
+    
+    dynamic var account = ""
+    dynamic var fileID = ""
+    dynamic var downloadData: Bool = false
+    dynamic var downloadPlist: Bool = false
+    dynamic var selector = ""
+    dynamic var selectorPost = ""
+    dynamic var serverUrl = ""
+    dynamic var session = ""
+
+    override static func primaryKey() -> String {
+        return "fileID"
+    }
+}
+
 class tableQueueUpload: Object {
 class tableQueueUpload: Object {
     
     
     dynamic var account = ""
     dynamic var account = ""

+ 323 - 121
iOSClient/Database/NCManageDatabase.swift

@@ -57,11 +57,11 @@ class NCManageDatabase: NSObject {
         let config = Realm.Configuration(
         let config = Realm.Configuration(
         
         
             fileURL: dirGroup?.appendingPathComponent("\(appDatabaseNextcloud)/\(k_databaseDefault)"),
             fileURL: dirGroup?.appendingPathComponent("\(appDatabaseNextcloud)/\(k_databaseDefault)"),
-            schemaVersion: 4,
+            schemaVersion: 6,
             
             
             migrationBlock: { migration, oldSchemaVersion in
             migrationBlock: { migration, oldSchemaVersion in
                 // We haven’t migrated anything yet, so oldSchemaVersion == 0
                 // We haven’t migrated anything yet, so oldSchemaVersion == 0
-                if (oldSchemaVersion < 4) {
+                if (oldSchemaVersion < 6) {
                     // Nothing to do!
                     // Nothing to do!
                     // Realm will automatically detect new properties and removed properties
                     // Realm will automatically detect new properties and removed properties
                     // And will update the schema on disk automatically
                     // And will update the schema on disk automatically
@@ -143,25 +143,26 @@ class NCManageDatabase: NSObject {
         
         
         realm.beginWrite()
         realm.beginWrite()
             
             
-        let addAccount = tableAccount()
+        let addObject = tableAccount()
             
             
-        addAccount.account = account
+        addObject.account = account
             
             
         // Brand
         // Brand
         if NCBrandOptions.sharedInstance.use_default_auto_upload {
         if NCBrandOptions.sharedInstance.use_default_auto_upload {
                 
                 
-            addAccount.autoUpload = true
-            addAccount.autoUploadImage = true
-            addAccount.autoUploadVideo = true
+            addObject.autoUpload = true
+            addObject.autoUploadImage = true
+            addObject.autoUploadVideo = true
 
 
-            addAccount.autoUploadWWAnVideo = true
+            addObject.autoUploadWWAnVideo = true
         }
         }
             
             
-        addAccount.password = password
-        addAccount.url = url
-        addAccount.user = user
-            
-        realm.add(addAccount)
+        addObject.password = password
+        addObject.url = url
+        addObject.user = user
+        addObject.username = user
+
+        realm.add(addObject)
         
         
         do {
         do {
             try realm.commitWrite()
             try realm.commitWrite()
@@ -170,7 +171,7 @@ class NCManageDatabase: NSObject {
         }
         }
     }
     }
     
     
-    func setAccountPassword(_ account: String, password: String) {
+    func setAccountPassword(_ account: String, password: String) -> tableAccount? {
         
         
         let realm = try! Realm()
         let realm = try! Realm()
         
         
@@ -178,7 +179,7 @@ class NCManageDatabase: NSObject {
 
 
         guard let result = realm.objects(tableAccount.self).filter("account = %@", account).first else {
         guard let result = realm.objects(tableAccount.self).filter("account = %@", account).first else {
             realm.cancelWrite()
             realm.cancelWrite()
-            return
+            return nil
         }
         }
         
         
         result.password = password
         result.password = password
@@ -187,7 +188,10 @@ class NCManageDatabase: NSObject {
             try realm.commitWrite()
             try realm.commitWrite()
         } catch let error {
         } catch let error {
             print("[LOG] Could not write to database: ", error)
             print("[LOG] Could not write to database: ", error)
+            return nil
         }
         }
+        
+        return result
     }
     }
     
     
     func deleteAccount(_ account: String) {
     func deleteAccount(_ account: String) {
@@ -254,11 +258,8 @@ class NCManageDatabase: NSObject {
         }
         }
         
         
         if result.autoUploadFileName.characters.count > 0 {
         if result.autoUploadFileName.characters.count > 0 {
-                
             return result.autoUploadFileName
             return result.autoUploadFileName
-                
         } else {
         } else {
-                
             return NCBrandOptions.sharedInstance.folderDefaultAutoUpload
             return NCBrandOptions.sharedInstance.folderDefaultAutoUpload
         }
         }
     }
     }
@@ -272,11 +273,8 @@ class NCManageDatabase: NSObject {
         }
         }
         
         
         if result.autoUploadDirectory.characters.count > 0 {
         if result.autoUploadDirectory.characters.count > 0 {
-                
             return result.autoUploadDirectory
             return result.autoUploadDirectory
-                
         } else {
         } else {
-                
             return CCUtility.getHomeServerUrlActiveUrl(activeUrl)
             return CCUtility.getHomeServerUrlActiveUrl(activeUrl)
         }
         }
     }
     }
@@ -410,6 +408,17 @@ class NCManageDatabase: NSObject {
                     return
                     return
                 }
                 }
                 
                 
+                // Copy user -> username 
+                // https://github.com/nextcloud/ios/issues/331
+                if result.username.characters.count == 0 {
+                    result.username = result.user
+                }
+                
+                // Update user with ID
+                if userProfile.id.characters.count > 0 {
+                    result.user = userProfile.id
+                }
+                
                 result.enabled = userProfile.enabled
                 result.enabled = userProfile.enabled
                 result.address = userProfile.address
                 result.address = userProfile.address
                 result.displayName = userProfile.displayName
                 result.displayName = userProfile.displayName
@@ -457,20 +466,20 @@ class NCManageDatabase: NSObject {
                     if realm.objects(tableActivity.self).filter("idActivity = %d", activity.idActivity).first == nil {
                     if realm.objects(tableActivity.self).filter("idActivity = %d", activity.idActivity).first == nil {
                         
                         
                         // Add new Activity
                         // Add new Activity
-                        let addActivity = tableActivity()
+                        let addObject = tableActivity()
                 
                 
-                        addActivity.account = tableAccount.account
+                        addObject.account = tableAccount.account
                 
                 
                         if let date = activity.date {
                         if let date = activity.date {
-                            addActivity.date = date as NSDate
+                            addObject.date = date as NSDate
                         }
                         }
                         
                         
-                        addActivity.idActivity = Double(activity.idActivity)
-                        addActivity.link = activity.link
-                        addActivity.note = activity.subject
-                        addActivity.type = k_activityTypeInfo
+                        addObject.idActivity = Double(activity.idActivity)
+                        addObject.link = activity.link
+                        addObject.note = activity.subject
+                        addObject.type = k_activityTypeInfo
 
 
-                        realm.add(addActivity)
+                        realm.add(addObject)
                     }
                     }
                 }
                 }
             }
             }
@@ -505,18 +514,18 @@ class NCManageDatabase: NSObject {
                 try realm.write {
                 try realm.write {
                 
                 
                     // Add new Activity
                     // Add new Activity
-                    let addActivity = tableActivity()
+                    let addObject = tableActivity()
                 
                 
-                    addActivity.account = tableAccount.account
-                    addActivity.action = action
-                    addActivity.file = file
-                    addActivity.fileID = fileID
-                    addActivity.note = noteReplacing
-                    addActivity.selector = selector
-                    addActivity.type = type
-                    addActivity.verbose = verbose
+                    addObject.account = tableAccount.account
+                    addObject.action = action
+                    addObject.file = file
+                    addObject.fileID = fileID
+                    addObject.note = noteReplacing
+                    addObject.selector = selector
+                    addObject.type = type
+                    addObject.verbose = verbose
                 
                 
-                    realm.add(addActivity)
+                    realm.add(addObject)
                 }
                 }
             } catch let error {
             } catch let error {
                 print("[LOG] Could not write to database: ", error)
                 print("[LOG] Could not write to database: ", error)
@@ -593,6 +602,39 @@ class NCManageDatabase: NSObject {
         return result.versionMajor
         return result.versionMajor
     }
     }
 
 
+    func compareServerVersion(_ versionCompare: String) -> Int {
+        
+        guard let tableAccount = self.getAccountActive() else {
+            return 0
+        }
+        
+        let realm = try! Realm()
+        
+        guard let capabilities = realm.objects(tableCapabilities.self).filter("account = %@", tableAccount.account).first else {
+            return -1
+        }
+        
+        let versionServer = capabilities.versionString
+        
+        var v1 = versionServer.characters.split(separator:".").map { Int(String($0)) }
+        var v2 = versionCompare.characters.split(separator:".").map { Int(String($0)) }
+        
+        var result = 0
+        for i in 0..<max(v1.count,v2.count) {
+            let left = i >= v1.count ? 0 : v1[i]
+            let right = i >= v2.count ? 0 : v2[i]
+            
+            if (left == right) {
+                result = 0
+            } else if left! > right! {
+                return 1
+            } else if right! > left! {
+                return -1
+            }
+        }
+        return result
+    }
+    
     //MARK: -
     //MARK: -
     //MARK: Table Certificates
     //MARK: Table Certificates
     
     
@@ -603,11 +645,11 @@ class NCManageDatabase: NSObject {
         do {
         do {
             try realm.write {
             try realm.write {
 
 
-                let addCertificates = tableCertificates()
+                let addObject = tableCertificates()
             
             
-                addCertificates.certificateLocation = certificateLocation
+                addObject.certificateLocation = certificateLocation
             
             
-                realm.add(addCertificates)
+                realm.add(addObject)
             }
             }
         } catch let error {
         } catch let error {
             print("Could not write to database: ", error)
             print("Could not write to database: ", error)
@@ -626,7 +668,7 @@ class NCManageDatabase: NSObject {
     //MARK: -
     //MARK: -
     //MARK: Table Directory
     //MARK: Table Directory
     
     
-    func addDirectory(serverUrl: String, permissions: String) -> String {
+    func addDirectory(serverUrl: String, permissions: String?) -> String {
         
         
         guard let tableAccount = self.getAccountActive() else {
         guard let tableAccount = self.getAccountActive() else {
             return ""
             return ""
@@ -643,19 +685,23 @@ class NCManageDatabase: NSObject {
             
             
                 if result == nil || (result?.isInvalidated)! {
                 if result == nil || (result?.isInvalidated)! {
                 
                 
-                    let addDirectory = tableDirectory()
-                    addDirectory.account = tableAccount.account
+                    let addObject = tableDirectory()
+                    addObject.account = tableAccount.account
                 
                 
                     directoryID = NSUUID().uuidString
                     directoryID = NSUUID().uuidString
-                    addDirectory.directoryID = directoryID
+                    addObject.directoryID = directoryID
                 
                 
-                    addDirectory.permissions = permissions
-                    addDirectory.serverUrl = serverUrl
-                    realm.add(addDirectory, update: true)
+                    if let permissions = permissions {
+                        addObject.permissions = permissions
+                    }
+                    addObject.serverUrl = serverUrl
+                    realm.add(addObject, update: true)
                 
                 
                 } else {
                 } else {
                 
                 
-                    result?.permissions = permissions
+                    if let permissions = permissions {
+                        result!.permissions = permissions
+                    }
                     directoryID = result!.directoryID
                     directoryID = result!.directoryID
                     realm.add(result!, update: true)
                     realm.add(result!, update: true)
                 }
                 }
@@ -801,7 +847,7 @@ class NCManageDatabase: NSObject {
         let realm = try! Realm()
         let realm = try! Realm()
         
         
         guard let result = realm.objects(tableDirectory.self).filter("account = %@ AND serverUrl = %@", tableAccount.account,serverUrl).first else {
         guard let result = realm.objects(tableDirectory.self).filter("account = %@ AND serverUrl = %@", tableAccount.account,serverUrl).first else {
-            return self.addDirectory(serverUrl: serverUrl, permissions: "")
+            return self.addDirectory(serverUrl: serverUrl, permissions: nil)
         }
         }
         
         
         return result.directoryID
         return result.directoryID
@@ -938,17 +984,17 @@ class NCManageDatabase: NSObject {
         do {
         do {
             try realm.write {
             try realm.write {
             
             
-                let addExternalSite = tableExternalSites()
+                let addObject = tableExternalSites()
             
             
-                addExternalSite.account = tableAccount.account
-                addExternalSite.idExternalSite = externalSites.idExternalSite
-                addExternalSite.icon = externalSites.icon
-                addExternalSite.lang = externalSites.lang
-                addExternalSite.name = externalSites.name
-                addExternalSite.url = externalSites.url
-                addExternalSite.type = externalSites.type
+                addObject.account = tableAccount.account
+                addObject.idExternalSite = externalSites.idExternalSite
+                addObject.icon = externalSites.icon
+                addObject.lang = externalSites.lang
+                addObject.name = externalSites.name
+                addObject.url = externalSites.url
+                addObject.type = externalSites.type
            
            
-                realm.add(addExternalSite)
+                realm.add(addObject)
             }
             }
         } catch let error {
         } catch let error {
             print("Could not write to database: ", error)
             print("Could not write to database: ", error)
@@ -1000,18 +1046,18 @@ class NCManageDatabase: NSObject {
         }
         }
         
         
         // Add new GPS
         // Add new GPS
-        let addGPS = tableGPS()
+        let addObject = tableGPS()
             
             
-        addGPS.latitude = latitude
-        addGPS.location = location
-        addGPS.longitude = longitude
-        addGPS.placemarkAdministrativeArea = placemarkAdministrativeArea
-        addGPS.placemarkCountry = placemarkCountry
-        addGPS.placemarkLocality = placemarkLocality
-        addGPS.placemarkPostalCode = placemarkPostalCode
-        addGPS.placemarkThoroughfare = placemarkThoroughfare
+        addObject.latitude = latitude
+        addObject.location = location
+        addObject.longitude = longitude
+        addObject.placemarkAdministrativeArea = placemarkAdministrativeArea
+        addObject.placemarkCountry = placemarkCountry
+        addObject.placemarkLocality = placemarkLocality
+        addObject.placemarkPostalCode = placemarkPostalCode
+        addObject.placemarkThoroughfare = placemarkThoroughfare
             
             
-        realm.add(addGPS)
+        realm.add(addObject)
         
         
         do {
         do {
             try realm.commitWrite()
             try realm.commitWrite()
@@ -1045,20 +1091,20 @@ class NCManageDatabase: NSObject {
         do {
         do {
             try realm.write {
             try realm.write {
             
             
-                let addLocaFile = tableLocalFile()
+                let addObject = tableLocalFile()
             
             
-                addLocaFile.account = tableAccount.account
-                addLocaFile.date = metadata.date
-                addLocaFile.etag = metadata.etag
-                addLocaFile.exifDate = NSDate()
-                addLocaFile.exifLatitude = "-1"
-                addLocaFile.exifLongitude = "-1"
-                addLocaFile.fileID = metadata.fileID
-                addLocaFile.fileName = metadata.fileName
-                addLocaFile.fileNamePrint = metadata.fileNamePrint
-                addLocaFile.size = metadata.size
+                addObject.account = tableAccount.account
+                addObject.date = metadata.date
+                addObject.etag = metadata.etag
+                addObject.exifDate = NSDate()
+                addObject.exifLatitude = "-1"
+                addObject.exifLongitude = "-1"
+                addObject.fileID = metadata.fileID
+                addObject.fileName = metadata.fileName
+                addObject.fileNamePrint = metadata.fileNamePrint
+                addObject.size = metadata.size
             
             
-                realm.add(addLocaFile, update: true)
+                realm.add(addObject, update: true)
             }
             }
         } catch let error {
         } catch let error {
             print("Could not write to database: ", error)
             print("Could not write to database: ", error)
@@ -1149,6 +1195,11 @@ class NCManageDatabase: NSObject {
             return nil
             return nil
         }
         }
         
         
+        if metadata.isInvalidated {
+            return nil
+        }
+        
+        let directoryID = metadata.directoryID
         let realm = try! Realm()
         let realm = try! Realm()
         
         
         do {
         do {
@@ -1159,12 +1210,12 @@ class NCManageDatabase: NSObject {
             print("Could not write to database: ", error)
             print("Could not write to database: ", error)
         }
         }
         
         
-        self.setDateReadDirectory(directoryID: metadata.directoryID)
+        self.setDateReadDirectory(directoryID: directoryID)
         
         
         return tableMetadata.init(value: metadata)
         return tableMetadata.init(value: metadata)
     }
     }
     
     
-    func addMetadatas(_ metadatas: [tableMetadata], serverUrl: String) -> [tableMetadata]? {
+    func addMetadatas(_ metadatas: [tableMetadata], serverUrl: String?) -> [tableMetadata]? {
         
         
         guard self.getAccountActive() != nil else {
         guard self.getAccountActive() != nil else {
             return nil
             return nil
@@ -1182,8 +1233,10 @@ class NCManageDatabase: NSObject {
             print("Could not write to database: ", error)
             print("Could not write to database: ", error)
         }
         }
         
         
-        if let directoryID = self.getDirectoryID(serverUrl) {
-            self.setDateReadDirectory(directoryID: directoryID)
+        if let serverUrl = serverUrl {
+            if let directoryID = self.getDirectoryID(serverUrl) {
+                self.setDateReadDirectory(directoryID: directoryID)
+            }
         }
         }
         
         
         return Array(metadatas.map { tableMetadata.init(value:$0) })
         return Array(metadatas.map { tableMetadata.init(value:$0) })
@@ -1249,7 +1302,7 @@ class NCManageDatabase: NSObject {
         self.setDateReadDirectory(directoryID: directoryIDTo)
         self.setDateReadDirectory(directoryID: directoryIDTo)
     }
     }
     
     
-    func updateMetadata(_ metadata: tableMetadata, activeUrl: String) -> tableMetadata? {
+    func updateMetadata(_ metadata: tableMetadata) -> tableMetadata? {
         
         
         let directoryID = metadata.directoryID
         let directoryID = metadata.directoryID
         
         
@@ -1461,7 +1514,7 @@ class NCManageDatabase: NSObject {
             return nil
             return nil
         }
         }
         
         
-        let predicate = NSPredicate(format: "account = %@ AND (session = %@ OR session = %@) AND (sessionTaskIdentifier != %i OR sessionTaskIdentifierPlist != %i)", tableAccount.account, k_download_session, k_download_session_foreground, k_taskIdentifierDone, k_taskIdentifierDone)
+        let predicate = NSPredicate(format: "account = %@ AND (session = %@ OR session = %@) AND (sessionTaskIdentifier != %i OR sessionTaskIdentifierPlist != %i)", tableAccount.account, k_download_session, k_download_session_foreground, Int(k_taskIdentifierDone), Int(k_taskIdentifierDone))
         
         
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
     }
     }
@@ -1472,7 +1525,7 @@ class NCManageDatabase: NSObject {
             return nil
             return nil
         }
         }
 
 
-        let predicate = NSPredicate(format: "account = %@ AND session = %@ AND (sessionTaskIdentifier != %i OR sessionTaskIdentifierPlist != %i)", tableAccount.account, k_download_session_wwan, k_taskIdentifierDone, k_taskIdentifierDone)
+        let predicate = NSPredicate(format: "account = %@ AND session = %@ AND (sessionTaskIdentifier != %i OR sessionTaskIdentifierPlist != %i)", tableAccount.account, k_download_session_wwan, Int(k_taskIdentifierDone), Int(k_taskIdentifierDone))
         
         
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
     }
     }
@@ -1483,7 +1536,7 @@ class NCManageDatabase: NSObject {
             return nil
             return nil
         }
         }
 
 
-        let predicate = NSPredicate(format: "account = %@ AND (session = %@ OR session = %@) AND (sessionTaskIdentifier != %i OR sessionTaskIdentifierPlist != %i)", tableAccount.account, k_upload_session, k_upload_session_foreground, k_taskIdentifierDone, k_taskIdentifierDone)
+        let predicate = NSPredicate(format: "account = %@ AND (session = %@ OR session = %@) AND (sessionTaskIdentifier != %i OR sessionTaskIdentifierPlist != %i)", tableAccount.account, k_upload_session, k_upload_session_foreground, Int(k_taskIdentifierDone), Int(k_taskIdentifierDone))
         
         
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
     }
     }
@@ -1494,7 +1547,7 @@ class NCManageDatabase: NSObject {
             return nil
             return nil
         }
         }
         
         
-        let predicate = NSPredicate(format: "account = %@ AND session = %@ AND (sessionTaskIdentifier != %i OR sessionTaskIdentifierPlist != %i)", tableAccount.account, k_upload_session_wwan, k_taskIdentifierDone, k_taskIdentifierDone)
+        let predicate = NSPredicate(format: "account = %@ AND session = %@ AND (sessionTaskIdentifier != %i OR sessionTaskIdentifierPlist != %i)", tableAccount.account, k_upload_session_wwan, Int(k_taskIdentifierDone), Int(k_taskIdentifierDone))
         
         
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
         return self.getMetadatas(predicate: predicate, sorted: nil, ascending: false)
     }
     }
@@ -1537,7 +1590,6 @@ class NCManageDatabase: NSObject {
                 try realm.write {
                 try realm.write {
                 
                 
                     var creationDateString = ""
                     var creationDateString = ""
-                    var modificationDateString = ""
 
 
                     for asset in assets {
                     for asset in assets {
                     
                     
@@ -1556,12 +1608,9 @@ class NCManageDatabase: NSObject {
                         
                         
                         if let modificationDate = asset.modificationDate {
                         if let modificationDate = asset.modificationDate {
                             addObject.modificationDate = modificationDate as NSDate
                             addObject.modificationDate = modificationDate as NSDate
-                            modificationDateString = String(describing: modificationDate)
-                        } else {
-                            modificationDateString = ""
                         }
                         }
                         
                         
-                        addObject.idAsset = "\(tableAccount.account)\(asset.localIdentifier)\(creationDateString)\(modificationDateString)"
+                        addObject.idAsset = "\(tableAccount.account)\(asset.localIdentifier)\(creationDateString)"
 
 
                         realm.add(addObject, update: true)
                         realm.add(addObject, update: true)
                     }
                     }
@@ -1604,7 +1653,159 @@ class NCManageDatabase: NSObject {
         
         
         return Array(idsAsset)
         return Array(idsAsset)
     }
     }
+    
+    func getPhotoLibrary(predicate: NSPredicate) -> [tablePhotoLibrary] {
+        
+        let realm = try! Realm()
+        
+        let results = realm.objects(tablePhotoLibrary.self).filter(predicate)
+        
+        return Array(results.map { tablePhotoLibrary.init(value:$0) })
+    }
+    
+    //MARK: -
+    //MARK: Table Queue Download
+    
+    func addQueueDownload(fileID: String, downloadData: Bool, downloadPlist: Bool, selector: String, selectorPost: String?, serverUrl: String, session: String) -> Bool {
+        
+        guard let tableAccount = self.getAccountActive() else {
+            return false
+        }
+        
+        let realm = try! Realm()
+        
+        if realm.isInWriteTransaction {
+            
+            print("[LOG] Could not write to database, addQueueDownload is already in write transaction")
+            return false
+            
+        } else {
+            
+            do {
+                try realm.write {
+                    
+                    // Add new
+                    let addObject = tableQueueDownload()
+                        
+                    addObject.account = tableAccount.account
+                    addObject.fileID = fileID
+                    addObject.downloadData = downloadData
+                    addObject.downloadPlist = downloadPlist
+                    addObject.selector = selector
+                        
+                    if let selectorPost = selectorPost {
+                        addObject.selectorPost = selectorPost
+                    }
+                    
+                    addObject.serverUrl = serverUrl
+                    addObject.session = session
+                    
+                    realm.add(addObject, update: true)
+                }
+            } catch let error {
+                print("[LOG] Could not write to database: ", error)
+                return false
+            }
+        }
+        
+        return true
+    }
+    
+    func addQueueDownload(metadatasNet: [CCMetadataNet]) {
+        
+        guard let tableAccount = self.getAccountActive() else {
+            return
+        }
+        
+        let realm = try! Realm()
+        
+        do {
+            try realm.write {
+                
+                for metadataNet in metadatasNet {
+                        
+                    // Add new
+                    let addObject = tableQueueDownload()
+                    
+                    addObject.account = tableAccount.account
+                    addObject.fileID = metadataNet.fileID
+                    addObject.downloadData = metadataNet.downloadData
+                    addObject.downloadPlist = metadataNet.downloadPlist
+                    addObject.selector = metadataNet.selector
+                    
+                    if let selectorPost = metadataNet.selectorPost {
+                        addObject.selectorPost = selectorPost
+                    }
+                    
+                    addObject.serverUrl = metadataNet.serverUrl
+                    addObject.session = metadataNet.session
+                    
+                    realm.add(addObject, update: true)
+                }
+            }
+        } catch let error {
+            print("[LOG] Could not write to database: ", error)
+        }
+    }
 
 
+    func getQueueDownload() -> CCMetadataNet? {
+        
+        guard let tableAccount = self.getAccountActive() else {
+            return nil
+        }
+        
+        let realm = try! Realm()
+        
+        realm.beginWrite()
+        
+        guard let result = realm.objects(tableQueueDownload.self).filter("account = %@", tableAccount.account).first else {
+            realm.cancelWrite()
+            return nil
+        }
+        
+        let metadataNet = CCMetadataNet()
+        
+        metadataNet.fileID = result.fileID
+        metadataNet.downloadData = result.downloadData
+        metadataNet.downloadPlist = result.downloadPlist
+        metadataNet.selector = result.selector
+        metadataNet.selectorPost = result.selectorPost
+        metadataNet.serverUrl = result.serverUrl
+        metadataNet.session = result.session
+        metadataNet.taskStatus = Int(k_taskStatusResume)
+        
+        // delete record
+        realm.delete(result)
+        
+        do {
+            try realm.commitWrite()
+        } catch let error {
+            print("[LOG] Could not write to database: ", error)
+            return nil
+        }
+        
+        return metadataNet
+    }
+    
+    func countQueueDownload(session: String?) -> Int {
+        
+        guard let tableAccount = self.getAccountActive() else {
+            return 0
+        }
+        
+        let realm = try! Realm()
+        let results : Results<tableQueueDownload>
+        
+        if let session = session {
+            results = realm.objects(tableQueueDownload.self).filter("account = %@ AND session = %@", tableAccount.account, session)
+        } else {
+            results = realm.objects(tableQueueDownload.self).filter("account = %@", tableAccount.account)
+        }
+        
+        return results.count
+    }
+
+    
     //MARK: -
     //MARK: -
     //MARK: Table Queue Upload
     //MARK: Table Queue Upload
     
     
@@ -1649,6 +1850,7 @@ class NCManageDatabase: NSObject {
                 }
                 }
             } catch let error {
             } catch let error {
                 print("[LOG] Could not write to database: ", error)
                 print("[LOG] Could not write to database: ", error)
+                return false
             }
             }
         }
         }
         
         
@@ -1712,7 +1914,6 @@ class NCManageDatabase: NSObject {
         
         
         let metadataNet = CCMetadataNet()
         let metadataNet = CCMetadataNet()
         
         
-        metadataNet.action = actionUploadAsset
         metadataNet.assetLocalIdentifier = result.assetLocalIdentifier
         metadataNet.assetLocalIdentifier = result.assetLocalIdentifier
         metadataNet.fileName = result.fileName
         metadataNet.fileName = result.fileName
         metadataNet.priority = result.priority
         metadataNet.priority = result.priority
@@ -1895,6 +2096,7 @@ class NCManageDatabase: NSObject {
             try realm.commitWrite()
             try realm.commitWrite()
         } catch let error {
         } catch let error {
             print("[LOG] Could not write to database: ", error)
             print("[LOG] Could not write to database: ", error)
+            return nil
         }
         }
 
 
         return ["\(serverUrl)\(fileName)" : share]
         return ["\(serverUrl)\(fileName)" : share]
@@ -2219,22 +2421,22 @@ class NCManageDatabase: NSObject {
         let results = realm.objects(tableDirectory.self).filter("directoryID = %@", table.directoryID!)
         let results = realm.objects(tableDirectory.self).filter("directoryID = %@", table.directoryID!)
         if (results.count == 0) {
         if (results.count == 0) {
             
             
-            let addDirectory = tableDirectory()
+            let addObject = tableDirectory()
                 
                 
-            addDirectory.account = table.account!
-            addDirectory.directoryID = table.directoryID!
-            addDirectory.etag = table.rev!
+            addObject.account = table.account!
+            addObject.directoryID = table.directoryID!
+            addObject.etag = table.rev!
             if table.favorite == 1 {
             if table.favorite == 1 {
-                addDirectory.favorite = true
+                addObject.favorite = true
             }
             }
-            addDirectory.fileID = table.fileID!
+            addObject.fileID = table.fileID!
             if table.lock == 1 {
             if table.lock == 1 {
-                addDirectory.lock = true
+                addObject.lock = true
             }
             }
-            addDirectory.permissions = table.permissions!
-            addDirectory.serverUrl = table.serverUrl!
+            addObject.permissions = table.permissions!
+            addObject.serverUrl = table.serverUrl!
             
             
-            realm.add(addDirectory)
+            realm.add(addObject)
         }
         }
         
         
         do {
         do {
@@ -2253,37 +2455,37 @@ class NCManageDatabase: NSObject {
         let results = realm.objects(tableLocalFile.self).filter("fileID = %@", table.fileID!)
         let results = realm.objects(tableLocalFile.self).filter("fileID = %@", table.fileID!)
         if (results.count == 0) {
         if (results.count == 0) {
             
             
-            let addLocalFile = tableLocalFile()
+            let addObject = tableLocalFile()
             
             
-            addLocalFile.account = table.account!
+            addObject.account = table.account!
                 
                 
             if table.date != nil {
             if table.date != nil {
-                addLocalFile.date = table.date! as NSDate
+                addObject.date = table.date! as NSDate
             } else {
             } else {
-                addLocalFile.date = NSDate()
+                addObject.date = NSDate()
             }
             }
             
             
             if (table.rev != nil) {
             if (table.rev != nil) {
-                addLocalFile.etag = table.rev!
+                addObject.etag = table.rev!
             } else {
             } else {
                 realm.cancelWrite()
                 realm.cancelWrite()
                 return
                 return
             }
             }
             
             
             if table.exifDate != nil {
             if table.exifDate != nil {
-                addLocalFile.exifDate = table.exifDate! as NSDate
+                addObject.exifDate = table.exifDate! as NSDate
             }
             }
-            addLocalFile.exifLatitude = table.exifLatitude!
-            addLocalFile.exifLongitude = table.exifLongitude!
+            addObject.exifLatitude = table.exifLatitude!
+            addObject.exifLongitude = table.exifLongitude!
             if table.favorite == 1 {
             if table.favorite == 1 {
-                addLocalFile.favorite = true
+                addObject.favorite = true
             }
             }
-            addLocalFile.fileID = table.fileID!
-            addLocalFile.fileName = table.fileName!
-            addLocalFile.fileNamePrint = table.fileNamePrint!
-            addLocalFile.size = table.size as! Double
+            addObject.fileID = table.fileID!
+            addObject.fileName = table.fileName!
+            addObject.fileNamePrint = table.fileNamePrint!
+            addObject.size = table.size as! Double
 
 
-            realm.add(addLocalFile)
+            realm.add(addObject)
         }
         }
         
         
         do {
         do {

+ 30 - 31
iOSClient/Favorites/CCFavorites.m

@@ -99,6 +99,15 @@
     [self reloadDatasource];
     [self reloadDatasource];
 }
 }
 
 
+// E' arrivato
+- (void)viewDidAppear:(BOOL)animated
+{
+    [super viewDidAppear:animated];
+    
+    // Active Main
+    app.activeFavorites = self;
+}
+
 - (void)changeTheming
 - (void)changeTheming
 {
 {
     if (self.isViewLoaded && self.view.window)
     if (self.isViewLoaded && self.view.window)
@@ -161,7 +170,7 @@
 
 
 - (void)deleteFileOrFolderFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 - (void)deleteFileOrFolderFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 {
 {
-    NSLog(@"[LOG] Delete error %@", message);
+    NSLog(@"[LOG] DeleteFileOrFolder failure error %lu, %@", (long)errorCode, message);
 }
 }
 
 
 - (void)deleteFileOrFolderSuccess:(CCMetadataNet *)metadataNet
 - (void)deleteFileOrFolderSuccess:(CCMetadataNet *)metadataNet
@@ -175,7 +184,7 @@
 
 
 - (void)settingFavoriteFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 - (void)settingFavoriteFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 {
 {
-    NSLog(@"[LOG] Remove Favorite error %@", message);
+    NSLog(@"[LOG] Setting Favorite failure error %lu, %@", (long)errorCode, message);
 }
 }
 
 
 - (void)settingFavoriteSuccess:(CCMetadataNet *)metadataNet
 - (void)settingFavoriteSuccess:(CCMetadataNet *)metadataNet
@@ -190,11 +199,7 @@
     // test
     // test
     if (app.activeAccount.length == 0)
     if (app.activeAccount.length == 0)
         return;
         return;
-    
-    // verify if is already in progress selectorDownloadSynchronize
-    if ([[app verifyExistsInQueuesDownloadSelector:selectorDownloadSynchronize] count] > 0)
-        return;
-    
+
     [[CCActions sharedInstance] listingFavorites:@"" delegate:self];
     [[CCActions sharedInstance] listingFavorites:@"" delegate:self];
 }
 }
 
 
@@ -207,6 +212,7 @@
     CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
     CCMetadataNet *metadataNet = [[CCMetadataNet alloc] initWithAccount:app.activeAccount];
     
     
     metadataNet.action = actionReadFolder;
     metadataNet.action = actionReadFolder;
+    metadataNet.depth = @"1";
     metadataNet.directoryID = directoryID;
     metadataNet.directoryID = directoryID;
     
     
     if ([CCUtility getFavoriteOffline])
     if ([CCUtility getFavoriteOffline])
@@ -243,32 +249,27 @@
         // insert for test NOT favorite
         // insert for test NOT favorite
         [filesEtag addObject:metadata.fileID];
         [filesEtag addObject:metadata.fileID];
         
         
-        // Get ServerUrl
         NSString *serverUrl = [[NCManageDatabase sharedInstance] getServerUrl:metadata.directoryID];
         NSString *serverUrl = [[NCManageDatabase sharedInstance] getServerUrl:metadata.directoryID];
-        serverUrl = [CCUtility stringAppendServerUrl:serverUrl addFileName:metadata.fileNameData];
+        NSString *serverUrlSon = [CCUtility stringAppendServerUrl:serverUrl addFileName:metadata.fileNameData];
         
         
-        if (![serverUrl containsString:father]) {
+        if (![serverUrlSon containsString:father]) {
             
             
             if (metadata.directory) {
             if (metadata.directory) {
                 
                 
-                NSString *selector;
-                
                 if ([CCUtility getFavoriteOffline])
                 if ([CCUtility getFavoriteOffline])
-                    selector = selectorReadFolderWithDownload;
+                    [[CCSynchronize sharedSynchronize] readFileForFolder:metadata.fileNameData serverUrl:serverUrl selector:selectorReadFileFolderWithDownload];
                 else
                 else
-                    selector = selectorReadFolder;
-                
-                [[CCSynchronize sharedSynchronize] synchronizedFolder:serverUrl selector:selector];
-                
+                    [[CCSynchronize sharedSynchronize] readFileForFolder:metadata.fileNameData serverUrl:serverUrl selector:selectorReadFileFolder];
+
             } else {
             } else {
                 
                 
                 if ([CCUtility getFavoriteOffline])
                 if ([CCUtility getFavoriteOffline])
-                    [[CCSynchronize sharedSynchronize] synchronizedFile:metadata selector:selectorReadFileWithDownload];
+                    [[CCSynchronize sharedSynchronize] readFile:metadata selector:selectorReadFileWithDownload];
                 else
                 else
-                    [[CCSynchronize sharedSynchronize] synchronizedFile:metadata selector:selectorReadFile];
+                    [[CCSynchronize sharedSynchronize] readFile:metadata selector:selectorReadFile];
             }
             }
             
             
-            father = serverUrl;
+            father = serverUrlSon;
         }
         }
     }
     }
     
     
@@ -284,7 +285,7 @@
 
 
 - (void)listingFavoritesFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 - (void)listingFavoritesFailure:(CCMetadataNet *)metadataNet message:(NSString *)message errorCode:(NSInteger)errorCode
 {
 {
-    NSLog(@"Read Favorites Failure");
+    NSLog(@"[LOG] Listing Favorites failure error %lu, %@", (long)errorCode, message);
 }
 }
 
 
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
@@ -301,8 +302,9 @@
 #pragma --------------------------------------------------------------------------------------------
 #pragma --------------------------------------------------------------------------------------------
 
 
 - (void)downloadFileFailure:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector message:(NSString *)message errorCode:(NSInteger)errorCode
 - (void)downloadFileFailure:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector message:(NSString *)message errorCode:(NSInteger)errorCode
-{    
-    [app messageNotification:@"_download_file_" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
+{
+    if (errorCode != k_CCErrorFileAlreadyInDownload)
+        [app messageNotification:@"_download_file_" description:message visible:YES delay:k_dismissAfterSecond type:TWMessageBarMessageTypeError errorCode:errorCode];
 }
 }
 
 
 - (void)downloadFileSuccess:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector selectorPost:(NSString *)selectorPost
 - (void)downloadFileSuccess:(NSString *)fileID serverUrl:(NSString *)serverUrl selector:(NSString *)selector selectorPost:(NSString *)selectorPost
@@ -423,13 +425,10 @@
     
     
     metadata = [_dataSource objectAtIndex:indexPath.row];
     metadata = [_dataSource objectAtIndex:indexPath.row];
     
     
-    AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithView:self.view title:nil];
+    AHKActionSheet *actionSheet = [[AHKActionSheet alloc] initWithView:self.tabBarController.view title:nil];
     
     
     actionSheet.animationDuration = 0.2;
     actionSheet.animationDuration = 0.2;
-    
-    actionSheet.blurRadius = 0.0f;
-    actionSheet.blurTintColor = [UIColor colorWithWhite:0.0f alpha:0.50f];
-    
+        
     actionSheet.buttonHeight = 50.0;
     actionSheet.buttonHeight = 50.0;
     actionSheet.cancelButtonHeight = 50.0f;
     actionSheet.cancelButtonHeight = 50.0f;
     actionSheet.separatorHeight = 5.0f;
     actionSheet.separatorHeight = 5.0f;
@@ -438,8 +437,8 @@
     
     
     actionSheet.encryptedButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:[NCBrandColor sharedInstance].cryptocloud };
     actionSheet.encryptedButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:[NCBrandColor sharedInstance].cryptocloud };
     actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:[UIColor blackColor] };
     actionSheet.buttonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:[UIColor blackColor] };
-    actionSheet.cancelButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:[NCBrandColor sharedInstance].brand };
-    actionSheet.disableButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:[UIColor blackColor] };
+    actionSheet.cancelButtonTextAttributes = @{ NSFontAttributeName:[UIFont boldSystemFontOfSize:17], NSForegroundColorAttributeName:[UIColor blackColor] };
+    actionSheet.disableButtonTextAttributes = @{ NSFontAttributeName:[UIFont systemFontOfSize:16], NSForegroundColorAttributeName:[UIColor darkGrayColor] };
     
     
     actionSheet.separatorColor = [NCBrandColor sharedInstance].seperator;
     actionSheet.separatorColor = [NCBrandColor sharedInstance].seperator;
     actionSheet.cancelButtonTitle = NSLocalizedString(@"_cancel_",nil);
     actionSheet.cancelButtonTitle = NSLocalizedString(@"_cancel_",nil);
@@ -565,7 +564,7 @@
             recordsTableMetadata = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account = %@ AND directoryID = %@", app.activeAccount, directoryID] sorted:sorted ascending:[CCUtility getAscendingSettings]];
             recordsTableMetadata = [[NCManageDatabase sharedInstance] getMetadatasWithPredicate:[NSPredicate predicateWithFormat:@"account = %@ AND directoryID = %@", app.activeAccount, directoryID] sorted:sorted ascending:[CCUtility getAscendingSettings]];
     }
     }
         
         
-    CCSectionDataSourceMetadata *sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:recordsTableMetadata listProgressMetadata:nil groupByField:nil replaceDateToExifDate:NO activeAccount:app.activeAccount];
+    CCSectionDataSourceMetadata *sectionDataSource = [CCSectionMetadata creataDataSourseSectionMetadata:recordsTableMetadata listProgressMetadata:nil groupByField:nil activeAccount:app.activeAccount];
         
         
     NSArray *fileIDs = [sectionDataSource.sectionArrayRow objectForKey:@"_none_"];
     NSArray *fileIDs = [sectionDataSource.sectionArrayRow objectForKey:@"_none_"];
     for (NSString *fileID in fileIDs)
     for (NSString *fileID in fileIDs)

+ 23 - 0
iOSClient/Images.xcassets/actionSheetModify.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "actionSheetModify.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "actionSheetModify@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "actionSheetModify@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
iOSClient/Images.xcassets/actionSheetModify.imageset/actionSheetModify.png


BIN
iOSClient/Images.xcassets/actionSheetModify.imageset/actionSheetModify@2x.png


BIN
iOSClient/Images.xcassets/actionSheetModify.imageset/actionSheetModify@3x.png


+ 0 - 30
iOSClient/Library/AHKActionSheet/AHKActionSheet.h

@@ -33,9 +33,6 @@ typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
 /**
 /**
  *  See UIImage+AHKAdditions.h/.m to learn how these three properties are used.
  *  See UIImage+AHKAdditions.h/.m to learn how these three properties are used.
  */
  */
-@property (nonatomic) CGFloat blurRadius UI_APPEARANCE_SELECTOR;
-@property (strong, nonatomic) UIColor *blurTintColor UI_APPEARANCE_SELECTOR;
-@property (nonatomic) CGFloat blurSaturationDeltaFactor UI_APPEARANCE_SELECTOR;
 
 
 /// Height of the button (internally it's a `UITableViewCell`).
 /// Height of the button (internally it's a `UITableViewCell`).
 @property (nonatomic) CGFloat buttonHeight UI_APPEARANCE_SELECTOR;
 @property (nonatomic) CGFloat buttonHeight UI_APPEARANCE_SELECTOR;
@@ -55,7 +52,6 @@ typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
 /// Color of the separator between buttons.
 /// Color of the separator between buttons.
 @property (strong, nonatomic) UIColor *separatorColor UI_APPEARANCE_SELECTOR;
 @property (strong, nonatomic) UIColor *separatorColor UI_APPEARANCE_SELECTOR;
 /// Text attributes of the title (passed in initWithTitle: or set via `title` property)
 /// Text attributes of the title (passed in initWithTitle: or set via `title` property)
-@property (copy, nonatomic) NSDictionary *titleTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *buttonTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *buttonTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *disableButtonTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *disableButtonTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *destructiveButtonTextAttributes UI_APPEARANCE_SELECTOR;
 @property (copy, nonatomic) NSDictionary *destructiveButtonTextAttributes UI_APPEARANCE_SELECTOR;
@@ -83,35 +79,9 @@ typedef void(^AHKActionSheetHandler)(AHKActionSheet *actionSheet);
 /// View actionSheet was presented.
 /// View actionSheet was presented.
 @property (nonatomic, weak) UIView *view;
 @property (nonatomic, weak) UIView *view;
 
 
-/**
- *  Initializes the action sheet with a specified title. `headerView` can be used if a string is insufficient for the title; set `title` as `nil` in this case.
- *
- *  It's the designated initializer.
- *
- *  @param title A string to display in the title area, above the buttons.
- *
- *  @return A newly initialized action sheet.
- */
-- (instancetype)initWithTitle:(NSString *)title;
 
 
-/**
- *  Initializes the action sheet with a specified view and title. `headerView` can be used if a string is insufficient for the title; set `title` as `nil` in this case.
- *
- *  It's the designated initializer.
- *
- *  @param view
- *  @param title A string to display in the title area, above the buttons.
- *
- *  @return A newly initialized action sheet.
- */
 - (instancetype)initWithView:(UIView *)view title:(NSString *)title;
 - (instancetype)initWithView:(UIView *)view title:(NSString *)title;
 
 
-/**
- *  Adds a button with an image. Has to be called before showing the action sheet.
- *
- *  @param image   The image to display on the left of the title.
- *  @param handler A completion handler block to execute when a dismissal animation (after the user tapped on the button) has finished.
- */
 - (void)addButtonWithTitle:(NSString *)title image:(UIImage *)image backgroundColor:(UIColor *)backgroundColor height:(CGFloat)height type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler;
 - (void)addButtonWithTitle:(NSString *)title image:(UIImage *)image backgroundColor:(UIColor *)backgroundColor height:(CGFloat)height type:(AHKActionSheetButtonType)type handler:(AHKActionSheetHandler)handler;
 
 
 /// Displays the action sheet.
 /// Displays the action sheet.

+ 16 - 48
iOSClient/Library/AHKActionSheet/AHKActionSheet.m

@@ -15,8 +15,6 @@
 #import <QuartzCore/QuartzCore.h>
 #import <QuartzCore/QuartzCore.h>
 #import "AHKActionSheet.h"
 #import "AHKActionSheet.h"
 #import "AHKActionSheetViewController.h"
 #import "AHKActionSheetViewController.h"
-#import "UIImage+AHKAdditions.h"
-#import "UIWindow+AHKAdditions.h"
 
 
 
 
 static const NSTimeInterval kDefaultAnimationDuration = 0.2f;
 static const NSTimeInterval kDefaultAnimationDuration = 0.2f;
@@ -55,10 +53,9 @@ static const CGFloat maxWidth = 414.0f;
 @property (strong, nonatomic) NSMutableArray *items;
 @property (strong, nonatomic) NSMutableArray *items;
 @property (weak, nonatomic, readwrite) UIWindow *previousKeyWindow;
 @property (weak, nonatomic, readwrite) UIWindow *previousKeyWindow;
 @property (strong, nonatomic) UIWindow *window;
 @property (strong, nonatomic) UIWindow *window;
-@property (weak, nonatomic) UIImageView *blurredBackgroundView;
+@property (weak, nonatomic) UIView *blurredBackgroundView;
 @property (weak, nonatomic) UITableView *tableView;
 @property (weak, nonatomic) UITableView *tableView;
 @property (weak, nonatomic) UIButton *cancelButton;
 @property (weak, nonatomic) UIButton *cancelButton;
-@property (weak, nonatomic) UIView *cancelButtonShadowView;
 @end
 @end
 
 
 @implementation AHKActionSheet
 @implementation AHKActionSheet
@@ -72,9 +69,6 @@ static const CGFloat maxWidth = 414.0f;
     }
     }
 
 
     AHKActionSheet *appearance = [self appearance];
     AHKActionSheet *appearance = [self appearance];
-    [appearance setBlurRadius:0.0f];
-    [appearance setBlurTintColor:[UIColor colorWithWhite:0.0f alpha:0.5f]];
-    [appearance setBlurSaturationDeltaFactor:1.8f];
     [appearance setButtonHeight:50.0f];
     [appearance setButtonHeight:50.0f];
     [appearance setSeparatorHeight:5.0f];
     [appearance setSeparatorHeight:5.0f];
     [appearance setCancelButtonHeight:44.0f];
     [appearance setCancelButtonHeight:44.0f];
@@ -83,24 +77,11 @@ static const CGFloat maxWidth = 414.0f;
     [appearance setButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f]}];
     [appearance setButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f]}];
     [appearance setDisableButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f]}];
     [appearance setDisableButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f]}];
     [appearance setDestructiveButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f], NSForegroundColorAttributeName : [UIColor redColor] }];
     [appearance setDestructiveButtonTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:17.0f], NSForegroundColorAttributeName : [UIColor redColor] }];
-    [appearance setTitleTextAttributes:@{ NSFontAttributeName : [UIFont systemFontOfSize:14.0f], NSForegroundColorAttributeName : [UIColor grayColor] }];
     [appearance setCancelOnPanGestureEnabled:@(NO)];
     [appearance setCancelOnPanGestureEnabled:@(NO)];
     [appearance setCancelOnTapEmptyAreaEnabled:@(YES)];
     [appearance setCancelOnTapEmptyAreaEnabled:@(YES)];
     [appearance setAnimationDuration:kDefaultAnimationDuration];
     [appearance setAnimationDuration:kDefaultAnimationDuration];
 }
 }
 
 
-- (instancetype)initWithTitle:(NSString *)title
-{
-    self = [super init];
-
-    if (self) {
-        _title = [title copy];
-        _cancelButtonTitle = @"Cancel";
-    }
-
-    return self;
-}
-
 - (instancetype)initWithView:(UIView *)view title:(NSString *)title
 - (instancetype)initWithView:(UIView *)view title:(NSString *)title
 {
 {
     self = [super init];
     self = [super init];
@@ -114,11 +95,6 @@ static const CGFloat maxWidth = 414.0f;
     return self;
     return self;
 }
 }
 
 
-- (instancetype)init
-{
-    return [self initWithTitle:nil];
-}
-
 - (void)dealloc
 - (void)dealloc
 {
 {
     self.tableView.dataSource = nil;
     self.tableView.dataSource = nil;
@@ -170,13 +146,13 @@ static const CGFloat maxWidth = 414.0f;
     
     
     if (item.type == AHKActionSheetButtonTypeDisabled) {
     if (item.type == AHKActionSheetButtonTypeDisabled) {
         
         
-        imageView = [[UIImageView alloc]initWithFrame:CGRectMake(15, _buttonHeight/2 - (30/2), 30, 30)];
+        imageView = [[UIImageView alloc]initWithFrame:CGRectMake(20, _buttonHeight/2 - (30/2), 30, 30)];
         imageView.backgroundColor = [UIColor clearColor];
         imageView.backgroundColor = [UIColor clearColor];
         [imageView setImage:item.image];
         [imageView setImage:item.image];
         
         
     } else {
     } else {
         
         
-        imageView = [[UIImageView alloc]initWithFrame:CGRectMake(15, _buttonHeight/2 - (25/2), 25, 25)];
+        imageView = [[UIImageView alloc]initWithFrame:CGRectMake(20, _buttonHeight/2 - (25/2), 25, 25)];
         
         
         BOOL useTemplateMode = [UIImage instancesRespondToSelector:@selector(imageWithRenderingMode:)] && [self.automaticallyTintButtonImages boolValue];
         BOOL useTemplateMode = [UIImage instancesRespondToSelector:@selector(imageWithRenderingMode:)] && [self.automaticallyTintButtonImages boolValue];
 
 
@@ -346,15 +322,15 @@ static const CGFloat maxWidth = 414.0f;
     }
     }
 
 
     self.previousKeyWindow = [UIApplication sharedApplication].keyWindow;
     self.previousKeyWindow = [UIApplication sharedApplication].keyWindow;
-    UIImage *previousKeyWindowSnapshot = [self.previousKeyWindow ahk_snapshot];
 
 
     [self setUpNewWindow];
     [self setUpNewWindow];
-    [self setUpBlurredBackgroundWithSnapshot:previousKeyWindowSnapshot];
+    [self setUpBlurredBackground];
     [self setUpCancelButton];
     [self setUpCancelButton];
     [self setUpTableView];
     [self setUpTableView];
     
     
     if (self.cancelOnTapEmptyAreaEnabled.boolValue) {
     if (self.cancelOnTapEmptyAreaEnabled.boolValue) {
         [self setUpCancelTapGestureForView:self.tableView];
         [self setUpCancelTapGestureForView:self.tableView];
+        [self setUpCancelTapGestureForView:self.blurredBackgroundView];
     }
     }
     
     
     CGFloat slideDownMinOffset = (CGFloat)fmin(CGRectGetHeight(self.frame) + self.tableView.contentOffset.y, CGRectGetHeight(self.frame));
     CGFloat slideDownMinOffset = (CGFloat)fmin(CGRectGetHeight(self.frame) + self.tableView.contentOffset.y, CGRectGetHeight(self.frame));
@@ -366,10 +342,10 @@ static const CGFloat maxWidth = 414.0f;
 
 
     void(^delayedAnimations)(void) = ^(void) {
     void(^delayedAnimations)(void) = ^(void) {
         
         
-        CGFloat width = CGRectGetWidth(self.bounds);
+        CGFloat width = CGRectGetWidth(self.view.bounds);
         if (width > maxWidth) width = maxWidth;
         if (width > maxWidth) width = maxWidth;
         
         
-        self.cancelButton.frame = CGRectMake(10 + (CGRectGetWidth(self.bounds)/2 - width/2), CGRectGetMaxY(self.bounds) - self.cancelButtonHeight, width - 20, self.cancelButtonHeight - kSpaceDivide);
+        self.cancelButton.frame = CGRectMake(10 + (CGRectGetWidth(self.view.bounds)/2 - width/2), CGRectGetMaxY(self.view.bounds) - self.cancelButtonHeight, width - 20, self.cancelButtonHeight - kSpaceDivide);
     
     
         // Corner Radius
         // Corner Radius
         self.cancelButton.layer.cornerRadius = 10;
         self.cancelButton.layer.cornerRadius = 10;
@@ -466,7 +442,6 @@ static const CGFloat maxWidth = 414.0f;
         [UIView animateWithDuration:duration animations:^{
         [UIView animateWithDuration:duration animations:^{
             self.blurredBackgroundView.alpha = 0.0f;
             self.blurredBackgroundView.alpha = 0.0f;
             self.cancelButton.transform = CGAffineTransformTranslate(self.cancelButton.transform, 0, self.cancelButtonHeight - kSpaceDivide);
             self.cancelButton.transform = CGAffineTransformTranslate(self.cancelButton.transform, 0, self.cancelButtonHeight - kSpaceDivide);
-            self.cancelButtonShadowView.alpha = 0.0f;
 
 
             // Shortest shift of position sufficient to hide all tableView contents below the bottom margin.
             // Shortest shift of position sufficient to hide all tableView contents below the bottom margin.
             // contentInset isn't used here (unlike in -show) because it caused weird problems with animations in some cases.
             // contentInset isn't used here (unlike in -show) because it caused weird problems with animations in some cases.
@@ -492,16 +467,11 @@ static const CGFloat maxWidth = 414.0f;
     [self.window makeKeyAndVisible];
     [self.window makeKeyAndVisible];
 }
 }
 
 
-- (void)setUpBlurredBackgroundWithSnapshot:(UIImage *)previousKeyWindowSnapshot
+- (void)setUpBlurredBackground
 {
 {
-    UIImage *blurredViewSnapshot = [previousKeyWindowSnapshot
-                                    ahk_applyBlurWithRadius:self.blurRadius
-                                    tintColor:self.blurTintColor
-                                    saturationDeltaFactor:self.blurSaturationDeltaFactor
-                                    maskImage:nil];
-    UIImageView *backgroundView = [[UIImageView alloc] initWithImage:blurredViewSnapshot];
-    backgroundView.frame = self.bounds;
-    backgroundView.alpha = 0.0f;
+    UIView *backgroundView = [UIView new];
+    backgroundView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
+    backgroundView.frame = [UIScreen mainScreen].bounds;
     [self addSubview:backgroundView];
     [self addSubview:backgroundView];
     self.blurredBackgroundView = backgroundView;
     self.blurredBackgroundView = backgroundView;
 }
 }
@@ -516,10 +486,9 @@ static const CGFloat maxWidth = 414.0f;
 {
 {
     UIButton *cancelButton;
     UIButton *cancelButton;
     
     
-    CGFloat width = CGRectGetWidth(self.bounds);
+    CGFloat width = CGRectGetWidth(self.view.bounds);
     if (width > maxWidth) width = maxWidth;
     if (width > maxWidth) width = maxWidth;
 
 
-    
     // It's hard to check if UIButtonTypeSystem enumeration exists, so we're checking existence of another method that was introduced in iOS 7.
     // It's hard to check if UIButtonTypeSystem enumeration exists, so we're checking existence of another method that was introduced in iOS 7.
     if ([UIView instancesRespondToSelector:@selector(tintAdjustmentMode)]) {
     if ([UIView instancesRespondToSelector:@selector(tintAdjustmentMode)]) {
         cancelButton= [UIButton buttonWithType:UIButtonTypeSystem];
         cancelButton= [UIButton buttonWithType:UIButtonTypeSystem];
@@ -532,7 +501,7 @@ static const CGFloat maxWidth = 414.0f;
     [cancelButton setAttributedTitle:attrTitle forState:UIControlStateNormal];
     [cancelButton setAttributedTitle:attrTitle forState:UIControlStateNormal];
     [cancelButton addTarget:self action:@selector(cancelButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
     [cancelButton addTarget:self action:@selector(cancelButtonTapped:) forControlEvents:UIControlEventTouchUpInside];
     
     
-    cancelButton.frame = CGRectMake(10 + (CGRectGetWidth(self.bounds)/2 - width/2), CGRectGetMaxY(self.bounds) - self.cancelButtonHeight, width - 20, self.cancelButtonHeight - kSpaceDivide);
+    cancelButton.frame = CGRectMake(10 + (CGRectGetWidth(self.view.bounds)/2 - width/2), CGRectGetMaxY(self.view.bounds) - self.cancelButtonHeight, width - 20, self.cancelButtonHeight - kSpaceDivide);
     
     
     // move the button below the screen (ready to be animated -show)
     // move the button below the screen (ready to be animated -show)
     cancelButton.transform = CGAffineTransformMakeTranslation(0, self.cancelButtonHeight - kSpaceDivide);
     cancelButton.transform = CGAffineTransformMakeTranslation(0, self.cancelButtonHeight - kSpaceDivide);
@@ -544,13 +513,13 @@ static const CGFloat maxWidth = 414.0f;
 
 
 - (void)setUpTableView
 - (void)setUpTableView
 {
 {
-    CGFloat width = CGRectGetWidth(self.bounds);
+    CGFloat width = CGRectGetWidth(self.view.bounds);
     if (width > maxWidth) width = maxWidth;
     if (width > maxWidth) width = maxWidth;
     
     
     CGRect statusBarViewRect = [self convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
     CGRect statusBarViewRect = [self convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
     CGFloat statusBarHeight = CGRectGetHeight(statusBarViewRect);
     CGFloat statusBarHeight = CGRectGetHeight(statusBarViewRect);
     
     
-    CGRect frame = CGRectMake((CGRectGetWidth(self.bounds)/2 - width/2), statusBarHeight, width, CGRectGetHeight(self.bounds) - statusBarHeight - self.cancelButtonHeight - self.separatorHeight);
+    CGRect frame = CGRectMake((CGRectGetWidth(self.view.bounds)/2 - width/2), statusBarHeight, width, CGRectGetHeight(self.view.bounds) - statusBarHeight - self.cancelButtonHeight - self.separatorHeight);
 
 
     UITableView *tableView = [[UITableView alloc] initWithFrame:frame];
     UITableView *tableView = [[UITableView alloc] initWithFrame:frame];
     
     
@@ -567,7 +536,7 @@ static const CGFloat maxWidth = 414.0f;
     [tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kCellIdentifier];
     [tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kCellIdentifier];
     [self insertSubview:tableView aboveSubview:self.blurredBackgroundView];
     [self insertSubview:tableView aboveSubview:self.blurredBackgroundView];
     // move the content below the screen, ready to be animated in -show
     // move the content below the screen, ready to be animated in -show
-    tableView.contentInset = UIEdgeInsetsMake(CGRectGetHeight(self.bounds), 0, 0, 0);
+    tableView.contentInset = UIEdgeInsetsMake(CGRectGetHeight(self.view.bounds), 0, 0, 0);
     // removes separators below the footer (between empty cells)
     // removes separators below the footer (between empty cells)
     tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
     tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
 
 
@@ -581,7 +550,6 @@ static const CGFloat maxWidth = 414.0f;
         // limit alpha to the interval [0, 1]
         // limit alpha to the interval [0, 1]
         CGFloat alpha = (CGFloat)fmax(fmin(alphaWithoutBounds, 1.0f), 0.0f);
         CGFloat alpha = (CGFloat)fmax(fmin(alphaWithoutBounds, 1.0f), 0.0f);
         self.blurredBackgroundView.alpha = alpha;
         self.blurredBackgroundView.alpha = alpha;
-        self.cancelButtonShadowView.alpha = alpha;
     }
     }
 }
 }
 
 

+ 21 - 15
iOSClient/Library/AHKActionSheet/AHKActionSheetViewController.m

@@ -8,10 +8,12 @@
 
 
 #import "AHKActionSheetViewController.h"
 #import "AHKActionSheetViewController.h"
 #import "AHKActionSheet.h"
 #import "AHKActionSheet.h"
-#import "UIWindow+AHKAdditions.h"
 
 
 @interface AHKActionSheetViewController ()
 @interface AHKActionSheetViewController ()
+
 @property (nonatomic) BOOL viewAlreadyAppear;
 @property (nonatomic) BOOL viewAlreadyAppear;
+@property (nonatomic) UIInterfaceOrientation storeOrientation;
+
 @end
 @end
 
 
 @implementation AHKActionSheetViewController
 @implementation AHKActionSheetViewController
@@ -22,6 +24,9 @@
 {
 {
     [super viewDidLoad];
     [super viewDidLoad];
 
 
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotateDeviceChangeNotification:) name:UIApplicationDidChangeStatusBarOrientationNotification object:nil];
+    _storeOrientation = [[UIApplication sharedApplication] statusBarOrientation];
+
     [self.view addSubview:self.actionSheet];
     [self.view addSubview:self.actionSheet];
     self.actionSheet.frame = self.view.bounds;
     self.actionSheet.frame = self.view.bounds;
 }
 }
@@ -33,6 +38,14 @@
     self.viewAlreadyAppear = YES;
     self.viewAlreadyAppear = YES;
 }
 }
 
 
+- (void)viewWillDisappear:(BOOL)animated
+{
+    [super viewWillDisappear:animated];
+    
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+}
+
+
 - (void)viewWillLayoutSubviews
 - (void)viewWillLayoutSubviews
 {
 {
     [super viewWillLayoutSubviews];
     [super viewWillLayoutSubviews];
@@ -55,22 +68,15 @@
     return UIInterfaceOrientationMaskAll;
     return UIInterfaceOrientationMaskAll;
 }
 }
 
 
-- (UIStatusBarStyle)preferredStatusBarStyle
-{
-    UIWindow *window = self.actionSheet.previousKeyWindow;
-    if (!window) {
-        window = [[UIApplication sharedApplication].windows firstObject];
-    }
-    return [[window ahk_viewControllerForStatusBarStyle] preferredStatusBarStyle];
-}
-
-- (BOOL)prefersStatusBarHidden
+-(void)didRotateDeviceChangeNotification:(NSNotification *)notification
 {
 {
-    UIWindow *window = self.actionSheet.previousKeyWindow;
-    if (!window) {
-        window = [[UIApplication sharedApplication].windows firstObject];
+    UIInterfaceOrientation currentOrientation = [[UIApplication sharedApplication] statusBarOrientation];
+    
+    if (currentOrientation != _storeOrientation) {
+        [self.actionSheet dismissAnimated:NO];
     }
     }
-    return [[window ahk_viewControllerForStatusBarHidden] prefersStatusBarHidden];
+    
+    _storeOrientation = currentOrientation;
 }
 }
 
 
 @end
 @end

+ 0 - 107
iOSClient/Library/AHKActionSheet/UIImage+AHKAdditions.h

@@ -1,107 +0,0 @@
-/*
- File: UIImage+ImageEffects.h
- Abstract: This is a category of UIImage that adds methods to apply blur and tint effects to an image. This is the code you’ll want to look out to find out how to use vImage to efficiently calculate a blur.
- Version: 1.0
-
- Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple
- Inc. ("Apple") in consideration of your agreement to the following
- terms, and your use, installation, modification or redistribution of
- this Apple software constitutes acceptance of these terms.  If you do
- not agree with these terms, please do not use, install, modify or
- redistribute this Apple software.
-
- In consideration of your agreement to abide by the following terms, and
- subject to these terms, Apple grants you a personal, non-exclusive
- license, under Apple's copyrights in this original Apple software (the
- "Apple Software"), to use, reproduce, modify and redistribute the Apple
- Software, with or without modifications, in source and/or binary forms;
- provided that if you redistribute the Apple Software in its entirety and
- without modifications, you must retain this notice and the following
- text and disclaimers in all such redistributions of the Apple Software.
- Neither the name, trademarks, service marks or logos of Apple Inc. may
- be used to endorse or promote products derived from the Apple Software
- without specific prior written permission from Apple.  Except as
- expressly stated in this notice, no other rights or licenses, express or
- implied, are granted by Apple herein, including but not limited to any
- patent rights that may be infringed by your derivative works or by other
- works in which the Apple Software may be incorporated.
-
- The Apple Software is provided by Apple on an "AS IS" basis.  APPLE
- MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
- THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
- FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
- OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
-
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
- MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
- AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
- STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
- Copyright (C) 2013 Apple Inc. All Rights Reserved.
-
-
- Copyright © 2013 Apple Inc. All rights reserved.
- WWDC 2013 License
-
- NOTE: This Apple Software was supplied by Apple as part of a WWDC 2013
- Session. Please refer to the applicable WWDC 2013 Session for further
- information.
-
- IMPORTANT: This Apple software is supplied to you by Apple Inc.
- ("Apple") in consideration of your agreement to the following terms, and
- your use, installation, modification or redistribution of this Apple
- software constitutes acceptance of these terms. If you do not agree with
- these terms, please do not use, install, modify or redistribute this
- Apple software.
-
- In consideration of your agreement to abide by the following terms, and
- subject to these terms, Apple grants you a non-exclusive license, under
- Apple's copyrights in this original Apple software (the "Apple
- Software"), to use, reproduce, modify and redistribute the Apple
- Software, with or without modifications, in source and/or binary forms;
- provided that if you redistribute the Apple Software in its entirety and
- without modifications, you must retain this notice and the following
- text and disclaimers in all such redistributions of the Apple Software.
- Neither the name, trademarks, service marks or logos of Apple Inc. may
- be used to endorse or promote products derived from the Apple Software
- without specific prior written permission from Apple. Except as
- expressly stated in this notice, no other rights or licenses, express or
- implied, are granted by Apple herein, including but not limited to any
- patent rights that may be infringed by your derivative works or by other
- works in which the Apple Software may be incorporated.
-
- The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES
- NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
- IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
- OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
-
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
- MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
- AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
- STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
-
- EA1002
- 5/3/2013
- */
-
-@import UIKit;
-
-@interface UIImage (AHKAdditions)
-
-- (UIImage *)ahk_applyLightEffect;
-- (UIImage *)ahk_applyExtraLightEffect;
-- (UIImage *)ahk_applyDarkEffect;
-- (UIImage *)ahk_applyTintEffectWithColor:(UIColor *)tintColor;
-
-- (UIImage *)ahk_applyBlurWithRadius:(CGFloat)blurRadius tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage;
-
-@end

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor