Marino Faggiana 8 жил өмнө
parent
commit
bd5dcb34ce
53 өөрчлөгдсөн 236 нэмэгдсэн , 458 устгасан
  1. 2 2
      Nextcloud.xcodeproj/project.pbxproj
  2. 4 4
      Picker/DocumentPickerViewController.swift
  3. 5 10
      Share Ext/ShareViewController.m
  4. 1 6
      iOSClient/Activity/CCActivity.m
  5. 5 10
      iOSClient/AppDelegate.m
  6. 34 0
      iOSClient/Brand/NCBrand.swift
  7. 0 50
      iOSClient/Brand/NCBrandConstant.h
  8. 0 1
      iOSClient/CCGlobal.h
  9. 1 6
      iOSClient/Favorites/CCFavorites.m
  10. 1 8
      iOSClient/Favorites/CCSynchronize.m
  11. 3 3
      iOSClient/FileSystem/CCCoreData.m
  12. 35 0
      iOSClient/FileSystem/NCDatabase.swift
  13. 25 1
      iOSClient/FileSystem/NCManageDatabase.swift
  14. 1 6
      iOSClient/Library/MWPhotoBrowser/MWPhotoBrowser.m
  15. 1 6
      iOSClient/Local storage/CCLocalStorage.m
  16. 6 11
      iOSClient/Login/CCLogin.m
  17. 2 2
      iOSClient/Login/CCLoginWeb.swift
  18. 2 6
      iOSClient/Main/CCDetail.m
  19. 5 10
      iOSClient/Main/CCMain.m
  20. 1 26
      iOSClient/Main/CCSection.m
  21. 3 8
      iOSClient/Main/CCSplit.m
  22. 1 17
      iOSClient/Move/CCMove.m
  23. 47 0
      iOSClient/NCBridgeSwift.h
  24. 4 27
      iOSClient/Networking/CCNetworking.m
  25. 5 28
      iOSClient/Networking/OCNetworking.m
  26. 1 6
      iOSClient/PhotosCameraUpload/CCPhotosCameraUpload.m
  27. 1 6
      iOSClient/QuickActions/CCQuickActions.m
  28. 1 24
      iOSClient/Security/CCCertificate.m
  29. 4 9
      iOSClient/Settings/CCAdvanced.m
  30. 5 10
      iOSClient/Settings/CCManageAccount.m
  31. 1 6
      iOSClient/Settings/CCManageCameraUpload.m
  32. 1 6
      iOSClient/Settings/CCManageCryptoCloud.m
  33. 1 6
      iOSClient/Settings/CCManageCryptoCloudSecurity.m
  34. 6 11
      iOSClient/Settings/CCSettings.m
  35. 1 6
      iOSClient/Share/CCShareInfoCMOC.m
  36. 1 6
      iOSClient/Share/CCShareOC.m
  37. 1 6
      iOSClient/Share/CCSharePermissionOC.m
  38. 1 6
      iOSClient/Share/CCShareUserOC.m
  39. 1 6
      iOSClient/Templates/CCAccountWeb.m
  40. 1 6
      iOSClient/Templates/CCBancomat.m
  41. 1 6
      iOSClient/Templates/CCCartaDiCredito.m
  42. 1 6
      iOSClient/Templates/CCCartaIdentita.m
  43. 1 6
      iOSClient/Templates/CCContoCorrente.m
  44. 1 6
      iOSClient/Templates/CCNote.m
  45. 1 6
      iOSClient/Templates/CCPassaporto.m
  46. 1 6
      iOSClient/Templates/CCPatenteGuida.m
  47. 1 6
      iOSClient/Templates/CCTemplates.m
  48. 1 6
      iOSClient/Transfers/CCTransfers.m
  49. 1 6
      iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m
  50. 1 24
      iOSClient/Utility/CCExifGeo.m
  51. 0 2
      iOSClient/Utility/CCGraphics.h
  52. 0 5
      iOSClient/Utility/CCGraphics.m
  53. 5 5
      iOSClient/Utility/CCUtility.m

+ 2 - 2
Nextcloud.xcodeproj/project.pbxproj

@@ -738,6 +738,7 @@
 		08EA97451E6554FC004C83FA /* FirebaseCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FirebaseCore.framework; sourceTree = "<group>"; };
 		08EA97461E6554FC004C83FA /* FirebaseInstanceID.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = FirebaseInstanceID.framework; sourceTree = "<group>"; };
 		08EA97471E6554FC004C83FA /* GoogleToolboxForMac.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GoogleToolboxForMac.framework; sourceTree = "<group>"; };
+		F70022201EC46E660080073F /* NCBridgeSwift.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCBridgeSwift.h; sourceTree = "<group>"; };
 		F70211F41BAC56E9003FC03E /* CCCellMain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCCellMain.h; sourceTree = "<group>"; };
 		F70211F51BAC56E9003FC03E /* CCCellMain.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CCCellMain.m; sourceTree = "<group>"; };
 		F70211F61BAC56E9003FC03E /* CCCellMain.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CCCellMain.xib; sourceTree = "<group>"; };
@@ -1437,7 +1438,6 @@
 		F7C0F46E1C8880540059EC54 /* ShareViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = ShareViewController.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
 		F7C0F46F1C8880540059EC54 /* ShareViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = ShareViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
 		F7C1CDCE1E6DFAD1005D92BE /* CCStandardImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCStandardImages.h; sourceTree = "<group>"; };
-		F7C1CDDA1E6DFC6F005D92BE /* NCBrandConstant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NCBrandConstant.h; sourceTree = "<group>"; };
 		F7C5259F1E3B48B700FFE02C /* CCNotification.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CCNotification.swift; path = Notification/CCNotification.swift; sourceTree = "<group>"; };
 		F7C525A11E3B6DA800FFE02C /* CCNotification.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = CCNotification.storyboard; path = Notification/CCNotification.storyboard; sourceTree = "<group>"; };
 		F7C742C01E7BD01F00D9C973 /* iOSClient.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = iOSClient.entitlements; sourceTree = "<group>"; };
@@ -3014,7 +3014,6 @@
 			isa = PBXGroup;
 			children = (
 				F7C742D31E7BD36600D9C973 /* Supporting Files */,
-				F7C1CDDA1E6DFC6F005D92BE /* NCBrandConstant.h */,
 				F76B3CCD1EAE01BD00921AC9 /* NCBrand.swift */,
 			);
 			path = Brand;
@@ -3269,6 +3268,7 @@
 				F7C8C1901B482CEA0048180E /* CCGlobal.h */,
 				F7C8C1911B482CEA0048180E /* CCGlobal.m */,
 				F7C1CDCE1E6DFAD1005D92BE /* CCStandardImages.h */,
+				F70022201EC46E660080073F /* NCBridgeSwift.h */,
 				F78088E51DD3A1DB005C5A7C /* cryptocloud.xcdatamodeld */,
 				F7F67BB81A24D27800EE80DA /* Images.xcassets */,
 				F70211F31BAC56E9003FC03E /* Main */,

+ 4 - 4
Picker/DocumentPickerViewController.swift

@@ -130,7 +130,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         
         // Theming
         let tableCapabilities = NCManageDatabase.sharedInstance.getCapabilitesForAccount(activeAccount!)
-        if (tableCapabilities != nil && CCGraphics.isOptionUseThemingColor() == true) {
+        if (tableCapabilities != nil && NCBrandOptions.sharedInstance.use_themingColor == true) {
             if ((tableCapabilities?.themingColor.characters.count)! > 0) {
                 NCBrandColor.sharedInstance.brand = CCGraphics.color(fromHexString: tableCapabilities?.themingColor)
             }
@@ -197,7 +197,7 @@ class DocumentPickerViewController: UIDocumentPickerExtensionViewController, CCN
         }
         
         if CCUtility.getOnlyLockDir() == false && parameterPasscodeCorrect == false {
-            openBKPasscode(k_brand)
+            openBKPasscode(NCBrandOptions.sharedInstance.brand)
         }
     }
     
@@ -584,7 +584,7 @@ extension DocumentPickerViewController {
     func appGroupContainerURL() -> URL? {
         
         guard let groupURL = FileManager.default
-            .containerURL(forSecurityApplicationGroupIdentifier: k_capabilitiesGroups) else {
+            .containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.sharedInstance.capabilitiesGroups) else {
                 return nil
         }
         
@@ -883,7 +883,7 @@ class providerSessionDB {
     
     private init() {
     
-        let dirGroup = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: k_capabilitiesGroups)
+        let dirGroup = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.sharedInstance.capabilitiesGroups)
         let pathDB = dirGroup?.appendingPathComponent(appDatabase).appendingPathComponent("cryptocloud")
         
         MagicalRecord.setupCoreDataStackWithAutoMigratingSqliteStore(at: pathDB!)

+ 5 - 10
Share Ext/ShareViewController.m

@@ -22,12 +22,7 @@
 //
 
 #import "ShareViewController.h"
-
-#ifdef CUSTOM_BUILD
-    #import "CustomSwiftShare.h"
-#else
-    #import "Share-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @import MobileCoreServices;
 
@@ -55,7 +50,7 @@
 
 -(void)viewDidLoad
 {
-    dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:k_capabilitiesGroups];
+    dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[NCBrandOptions sharedInstance].capabilitiesGroups];
     
     [MagicalRecord setupCoreDataStackWithAutoMigratingSqliteStoreNamed:(id)[dirGroup URLByAppendingPathComponent:[appDatabase stringByAppendingPathComponent:@"cryptocloud"]]];
     [MagicalRecord setLoggingLevel:MagicalRecordLoggingLevelOff];
@@ -174,7 +169,7 @@
 
     // Theming
     tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilitesForAccount:self.activeAccount];
-    if (k_option_use_themingColor && capabilities.themingColor.length > 0)
+    if ([NCBrandOptions sharedInstance].use_themingColor && capabilities.themingColor.length > 0)
         [NCBrandColor sharedInstance].brand = [CCGraphics colorFromHexString:capabilities.themingColor];
 
     self.navigationController.navigationBar.barTintColor = [NCBrandColor sharedInstance].brand;
@@ -207,7 +202,7 @@
     // Title
     [self.navigationController.navigationBar setTitleTextAttributes: @{NSForegroundColorAttributeName:self.navigationController.navigationBar.tintColor}];
     
-    self.navigationItem.title = k_brand;
+    self.navigationItem.title = [NCBrandOptions sharedInstance].brand;
     self.navigationItem.leftBarButtonItem = leftButtonCancel;
     self.navigationItem.rightBarButtonItems = [[NSArray alloc] initWithObjects:rightButtonUpload, rightButtonEncrypt, nil];
     self.navigationItem.hidesBackButton = YES;
@@ -386,7 +381,7 @@
     BKTouchIDManager *touchIDManager = [[BKTouchIDManager alloc] initWithKeychainServiceName:k_serviceShareKeyChain];
     touchIDManager.promptText = NSLocalizedString(@"_scan_fingerprint_", nil);
     viewController.touchIDManager = touchIDManager;
-    viewController.title = k_brand;
+    viewController.title = [NCBrandOptions sharedInstance].brand;
     viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
     viewController.navigationItem.leftBarButtonItem.tintColor = [NCBrandColor sharedInstance].cryptocloud;
     

+ 1 - 6
iOSClient/Activity/CCActivity.m

@@ -24,12 +24,7 @@
 #import "CCActivity.h"
 #import "AppDelegate.h"
 #import "CCSection.h"
-
-#ifdef CUSTOM_BUILD
-    #import "CustomSwift.h"
-#else
-    #import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 #define fontSizeData    [UIFont boldSystemFontOfSize:15]
 #define fontSizeAction  [UIFont systemFontOfSize:14]

+ 5 - 10
iOSClient/AppDelegate.m

@@ -38,12 +38,7 @@
 #import <Fabric/Fabric.h>
 #import <Crashlytics/Crashlytics.h>
 #import "JDStatusBarNotification.h"
-
-#ifdef CUSTOM_BUILD
-    #import "CustomSwift.h"
-#else
-    #import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface AppDelegate () <UNUserNotificationCenterDelegate, FIRMessagingDelegate>
 {
@@ -66,7 +61,7 @@
 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
 {
     // Brand
-    if (k_option_use_firebase) {
+    if ([NCBrandOptions sharedInstance].use_firebase) {
     
         /*
          In order for this to work, proper GoogleService-Info.plist must be included
@@ -102,7 +97,7 @@
     }
 
     NSString *dir;
-    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:k_capabilitiesGroups];
+    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[NCBrandOptions sharedInstance].capabilitiesGroups];
     
     NSLog(@"[LOG] Start program group -----------------");
     NSLog(@"%@", dirGroup);    
@@ -990,7 +985,7 @@
     
         tableCapabilities *capabilities = [[NCManageDatabase sharedInstance] getCapabilitesForAccount:self.activeAccount];
     
-        if (k_option_use_themingColor && capabilities.themingColor.length > 0) {
+        if ([NCBrandOptions sharedInstance].use_themingColor && capabilities.themingColor.length > 0) {
         
             [NCBrandColor sharedInstance].brand = [CCGraphics colorFromHexString:capabilities.themingColor];
             
@@ -1103,7 +1098,7 @@
     CCBKPasscode *viewController = [[CCBKPasscode alloc] initWithNibName:nil bundle:nil];
     viewController.type = BKPasscodeViewControllerCheckPasscodeType;
     viewController.delegate = self;
-    viewController.title = k_brand;
+    viewController.title = [NCBrandOptions sharedInstance].brand;
     viewController.fromType = CCBKPasscodeFromLockScreen;
     viewController.inputViewTitlePassword = YES;
     

+ 34 - 0
iOSClient/Brand/NCBrand.swift

@@ -66,3 +66,37 @@ class NCBrandImages: NSObject {
     public var themingBackground:       String = "themingBackground"
 }
 
+class NCBrandOptions: NSObject {
+    
+    static let sharedInstance: NCBrandOptions = {
+        let instance = NCBrandOptions()
+        return instance
+    }()
+    
+    public let brand:                           String = "Nextcloud"
+    public let mailMe:                          String = "ios@nextcloud.com"
+    public let textCopyrightNextcloudiOS:       String = "Nextcloud for iOS %@ © 2017 T.W.S. Inc."
+    public let textCopyrightNextcloudServer:    String = "Nextcloud Server %@"
+    public let loginBaseUrl:                    String = "https://cloud.twsweb.it"
+    public let loginBaseUrlMultiDomains:        [String] = ["domain.com", "domain.it"]
+    public let pushNotificationServer:          String = "https://push-notifications.nextcloud.com"
+    public let loginButtonLabelLink:            String = "https://nextcloud.com/providers"
+    public let webLoginAutenticationProtocol:   String = ""
+    
+    // Capabilities Group
+    public let capabilitiesGroups:              String = "group.it.twsweb.Crypto-Cloud"
+    
+    // Options
+    public let use_login_web:                   Bool = false
+    public let use_firebase:                    Bool = false
+    public let use_default_automatic_upload:    Bool = false
+    public let use_themingColor:                Bool = true
+    public let use_themingBackground:           Bool = true
+    public let use_multiDomains:                Bool = false
+    
+    public let disable_intro:                   Bool = false
+    public let disable_request_login_url:       Bool = false
+    public let disable_multiaccount:            Bool = false
+    public let disable_cryptocloudsystem:       Bool = false
+}
+

+ 0 - 50
iOSClient/Brand/NCBrandConstant.h

@@ -1,50 +0,0 @@
-//
-//  NCBrandConstant.h
-//  Crypto Cloud Technology Nextcloud
-//
-//  Created by Marino Faggiana on 06/03/17.
-//  Copyright © 2017 TWS. All rights reserved.
-//
-//  Author Marino Faggiana <m.faggiana@twsweb.it>
-//
-//  This program is free software: you can redistribute it and/or modify
-//  it under the terms of the GNU General Public License as published by
-//  the Free Software Foundation, either version 3 of the License, or
-//  (at your option) any later version.
-//
-//  This program is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-//  GNU General Public License for more details.
-//
-//  You should have received a copy of the GNU General Public License
-//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-//
-
-// Brand Text
-#define k_brand                                 @"Nextcloud"
-#define k_mailMe                                @"ios@nextcloud.com"
-#define k_textCopyrightNextcloudiOS             @"Nextcloud for iOS %@ © 2017 T.W.S. Inc."
-#define k_textCopyrightNextcloudServer          @"Nextcloud Server %@"
-#define k_loginBaseUrl                          @"https://cloud.twsweb.it"
-#define k_loginBaseUrlMultiDomains              @[@"domain.com", @"domain.it"]
-#define k_pushNotificationServer                @"https://push-notifications.nextcloud.com"
-#define k_loginButtonLabelLink                  @"https://nextcloud.com/providers"
-#define k_webLoginAutenticationProtocol         @""
-
-// Capabilities Group
-#define k_capabilitiesGroups                    @"group.it.twsweb.Crypto-Cloud"
-
-// Option 
-#define k_option_use_login_web                  NO
-#define k_option_use_firebase                   NO
-#define k_option_use_default_automatic_upload   NO
-#define k_option_use_themingColor               YES
-#define k_option_use_themingBackground          YES
-#define k_option_use_multiDomains               NO
-
-#define k_option_disable_intro                  NO
-#define k_option_disable_request_login_url      NO
-#define k_option_disable_multiaccount           NO
-#define k_option_disable_cryptocloudsystem      NO
-

+ 0 - 1
iOSClient/CCGlobal.h

@@ -23,7 +23,6 @@
 
 #import <UIKit/UIKit.h>
 #import "CCStandardImages.h"
-#import "NCBrandConstant.h"
 
 extern NSString *const appApplicationSupport;
 extern NSString *const appDatabase;

+ 1 - 6
iOSClient/Favorites/CCFavorites.m

@@ -23,12 +23,7 @@
 
 #import "CCFavorites.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCFavorites () <CCActionsDeleteDelegate, CCActionsSettingFavoriteDelegate>
 {

+ 1 - 8
iOSClient/Favorites/CCSynchronize.m

@@ -22,17 +22,10 @@
 //
 
 #import "CCSynchronize.h"
-
 #import "AppDelegate.h"
 #import "CCCoreData.h"
 #import "CCMain.h"
-
-#ifdef CUSTOM_BUILD
-    #import "CustomSwift.h"
-#else
-    #import "Nextcloud-Swift.h"
-#endif
-
+#import "NCBridgeSwift.h"
 
 @interface CCSynchronize () <CCActionsListingFavoritesDelegate>
 {

+ 3 - 3
iOSClient/FileSystem/CCCoreData.m

@@ -22,8 +22,8 @@
 //
 
 #import "CCCoreData.h"
-
 #import "CCNetworking.h"
+#import "NCBridgeSwift.h"
 
 @implementation CCCoreData
 
@@ -41,7 +41,7 @@
     record.active = [NSNumber numberWithBool:NO];
         
     // Brand
-    if (k_option_use_default_automatic_upload) {
+    if ([NCBrandOptions sharedInstance].use_default_automatic_upload) {
         
         record.cameraUpload = [NSNumber numberWithBool:YES];
         record.cameraUploadPhoto = [NSNumber numberWithBool:YES];
@@ -1818,7 +1818,7 @@
 + (void)moveCoreDataToGroup
 {
     NSString *applicationName = [[[NSBundle mainBundle] infoDictionary] valueForKey:(NSString *)kCFBundleNameKey];
-    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:k_capabilitiesGroups];
+    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[NCBrandOptions sharedInstance].capabilitiesGroups];
     NSString *dirToPath = [[dirGroup URLByAppendingPathComponent:appDatabase] path];
 
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES);

+ 35 - 0
iOSClient/FileSystem/NCDatabase.swift

@@ -8,6 +8,41 @@
 
 import RealmSwift
 
+class tableAccount: Object {
+
+    dynamic var account = ""
+    dynamic var active : Bool = false
+    dynamic var address = ""
+    dynamic var cameraUpload : Bool = false
+    dynamic var cameraUploadBackground : Bool = false
+    dynamic var cameraUploadCreateSubfolder : Bool = false
+    dynamic var cameraUploadDatePhoto = Date()
+    dynamic var cameraUploadDateVideo = Date()
+    dynamic var cameraUploadFolderName = ""
+    dynamic var cameraUploadFolderPath = ""
+    dynamic var cameraUploadFull : Bool = false
+    dynamic var cameraUploadPhoto : Bool = false
+    dynamic var cameraUploadSaveAlbum : Bool = false
+    dynamic var cameraUploadVideo : Bool = false
+    dynamic var cameraUploadWWAnPhoto : Bool = false
+    dynamic var cameraUploadWWAnVideo : Bool = false
+    dynamic var displayName = ""
+    dynamic var email = ""
+    dynamic var enabled : Bool = false
+    dynamic var optimization = Date()
+    dynamic var password = ""
+    dynamic var phone = ""
+    dynamic var quota : Double = 0
+    dynamic var quotaFree : Double = 0
+    dynamic var quotaRelative : Double = 0
+    dynamic var quotaTotal : Double = 0
+    dynamic var quotaUsed : Double = 0
+    dynamic var twitter = ""
+    dynamic var url = ""
+    dynamic var user = ""
+    dynamic var webpage = ""
+}
+
 class tableActivity: Object {
     
     dynamic var account = ""

+ 25 - 1
iOSClient/FileSystem/NCManageDatabase.swift

@@ -17,7 +17,7 @@ class NCManageDatabase: NSObject {
     
     override init() {
         
-        let dirGroup = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: k_capabilitiesGroups)
+        let dirGroup = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.sharedInstance.capabilitiesGroups)
         var config = Realm.Configuration()
         
         config.fileURL = dirGroup?.appendingPathComponent("\(appDatabaseNextcloud)/\(k_databaseDefault)")
@@ -65,6 +65,30 @@ class NCManageDatabase: NSObject {
         }
     }
     
+    //MARK: -
+    //MARK: Table Account
+    
+    func addAccount(_ account: String, url: String, user: String, password: String) {
+
+        let realm = try! Realm()
+        
+        try! realm.write {
+            
+            let addAccount = tableAccount()
+            
+            addAccount.account = account
+            
+            // Brand
+            /*
+            if (k_option_use_default_automatic_upload) {
+
+            } else {
+                
+            }
+            */
+        }
+    }
+    
     //MARK: -
     //MARK: Table Activity
 

+ 1 - 6
iOSClient/Library/MWPhotoBrowser/MWPhotoBrowser.m

@@ -11,12 +11,7 @@
 #import "MWPhotoBrowser.h"
 #import "MWPhotoBrowserPrivate.h"
 #import "UIImage+MWPhotoBrowser.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 #define PADDING                  10
 

+ 1 - 6
iOSClient/Local storage/CCLocalStorage.m

@@ -23,12 +23,7 @@
 
 #import "CCLocalStorage.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCLocalStorage ()
 {

+ 6 - 11
iOSClient/Login/CCLogin.m

@@ -25,12 +25,7 @@
 #import "AppDelegate.h"
 #import "CCUtility.h"
 #import "CCCoreData.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCLogin ()
 {
@@ -87,9 +82,9 @@
     self.loadingBaseUrl.hidden = YES;
     
     // Brand
-    if (k_option_disable_request_login_url) {
+    if ([NCBrandOptions sharedInstance].disable_request_login_url) {
         
-        _baseUrl.text = k_loginBaseUrl;
+        _baseUrl.text = [NCBrandOptions sharedInstance].loginBaseUrl;
         _imageBaseUrl.hidden = YES;
         _baseUrl.hidden = YES;
     }
@@ -164,12 +159,12 @@
 - (void)testUrl
 {
     // Use MultiDomain check if this is correct
-    if (k_option_use_multiDomains == YES) {
+    if ([NCBrandOptions sharedInstance].use_multiDomains == YES) {
         
         BOOL foundDomain = NO;
         NSString *message = @"";
         
-        for (NSString *domain in k_loginBaseUrlMultiDomains) {
+        for (NSString *domain in [NCBrandOptions sharedInstance].loginBaseUrlMultiDomains) {
             
             message = [NSString stringWithFormat:@"%@ %@", message, domain.lowercaseString];
             
@@ -359,7 +354,7 @@
 
 - (void)tabBottomLabel
 {
-    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:k_loginButtonLabelLink]];
+    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NCBrandOptions sharedInstance].loginButtonLabelLink]];
 }
 
 - (IBAction)handlebaseUrlchange:(id)sender

+ 2 - 2
iOSClient/Login/CCLoginWeb.swift

@@ -35,7 +35,7 @@ public class CCLoginWeb: UIViewController {
             doneButtonVisible = true
         }
         
-        let webVC = SwiftModalWebVC(urlString: k_loginBaseUrl, theme: .custom, color: NCBrandColor.sharedInstance.brand, colorText: NCBrandColor.sharedInstance.navigationBarText, doneButtonVisible: doneButtonVisible)
+        let webVC = SwiftModalWebVC(urlString: NCBrandOptions.sharedInstance.loginBaseUrl, theme: .custom, color: NCBrandColor.sharedInstance.brand, colorText: NCBrandColor.sharedInstance.navigationBarText, doneButtonVisible: doneButtonVisible)
         webVC.delegateWeb = self
 
         vc.present(webVC, animated: false, completion: nil)
@@ -52,7 +52,7 @@ extension CCLoginWeb: SwiftModalWebVCDelegate {
                 
         let urlString: String = url.absoluteString
         
-        if (urlString.contains(k_webLoginAutenticationProtocol) == true && urlString.contains("login") == true && (loginType == loginAdd || loginType == loginAddForced)) {
+        if (urlString.contains(NCBrandOptions.sharedInstance.webLoginAutenticationProtocol) == true && urlString.contains("login") == true && (loginType == loginAdd || loginType == loginAddForced)) {
             
             let keyValue = url.path.components(separatedBy: "&")
             if (keyValue.count == 3) {

+ 2 - 6
iOSClient/Main/CCDetail.m

@@ -24,12 +24,8 @@
 #import "CCDetail.h"
 #import "AppDelegate.h"
 #import "CCMain.h"
+#import "NCBridgeSwift.h"
 
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
 
 #define TOOLBAR_HEIGHT 49.0f
 
@@ -293,7 +289,7 @@
     
     LMMediaItem *item = [[LMMediaItem alloc] initWithInfo:@{LMMediaItemInfoURLKey:[NSURL fileURLWithPath:fileName], LMMediaItemInfoContentTypeKey:@(LMMediaItemContentTypeVideo)}];
     item.title = self.metadataDetail.fileNamePrint;
-    item.artist = k_brand;
+    item.artist = [NCBrandOptions sharedInstance].brand;
     
     [app.player.mediaPlayer removeAllMediaInQueue];
     [app.player.mediaPlayer addMedia:item];

+ 5 - 10
iOSClient/Main/CCMain.m

@@ -32,12 +32,7 @@
 #import <OCCommunicationLib/OCFrameworkConstants.h>
 #import <OCCommunicationLib/OCCapabilities.h>
 #import "CTAssetCheckmark.h"
-
-#ifdef CUSTOM_BUILD
-    #import "CustomSwift.h"
-#else
-    #import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 #define alertCreateFolder 1
 #define alertCreateFolderCrypto 2
@@ -1022,7 +1017,7 @@
 - (void)changePasswordAccount
 {
     // Brand
-    if (k_option_use_login_web) {
+    if ([NCBrandOptions sharedInstance].use_login_web) {
     
         _loginWeb = [CCLoginWeb new];
         _loginWeb.delegate = self;
@@ -1227,7 +1222,7 @@
     // Download Theming Background & Change Theming color
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{
         
-        if (k_option_use_themingBackground == YES) {
+        if ([NCBrandOptions sharedInstance].use_themingBackground == YES) {
         
             UIImage *themingBackground = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[capabilities.themingBackground stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]]];
             if (themingBackground)
@@ -3285,7 +3280,7 @@
         return;
     
     // Brand
-    if (k_option_disable_multiaccount)
+    if ([NCBrandOptions sharedInstance].disable_multiaccount)
         return;
     
     if ([app.netQueue operationCount] > 0 || [app.netQueueDownload operationCount] > 0 || [app.netQueueDownloadWWan operationCount] > 0 || [app.netQueueUpload operationCount] > 0 || [app.netQueueUploadWWan operationCount] > 0 || [[NCManageDatabase sharedInstance] countAutomaticUploadForAccount:app.activeAccount selector:nil] > 0) {
@@ -5431,7 +5426,7 @@
         viewController.type = BKPasscodeViewControllerCheckPasscodeType;
         viewController.inputViewTitlePassword = NO;
         
-        viewController.title = k_brand;
+        viewController.title = [NCBrandOptions sharedInstance].brand;
         viewController.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(passcodeViewCloseButtonPressed:)];
         viewController.navigationItem.leftBarButtonItem.tintColor = [NCBrandColor sharedInstance].cryptocloud;
 

+ 1 - 26
iOSClient/Main/CCSection.m

@@ -25,32 +25,7 @@
 #import "CCMetadata.h"
 #import "CCCoreData.h"
 #import "CCExifGeo.h"
-
-#ifndef EXTENSION
-    #ifdef CUSTOM_BUILD
-        #import "CustomSwift.h"
-    #else
-        #import "Nextcloud-Swift.h"
-    #endif
-#else
-
-#ifdef EXTENSION_SHARE
-#ifdef CUSTOM_BUILD
-#import "CustomSwiftShare.h"
-#else
-#import "Share-Swift.h"
-#endif
-#endif
-
-#ifdef EXTENSION_PICKER
-#ifdef CUSTOM_BUILD
-#import "CustomSwiftPick.h"
-#else
-#import "Picker-Swift.h"
-#endif
-#endif
-
-#endif
+#import "NCBridgeSwift.h"
 
 @implementation CCSectionDataSourceMetadata
 

+ 3 - 8
iOSClient/Main/CCSplit.m

@@ -24,12 +24,7 @@
 #import "CCSplit.h"
 #import "AppDelegate.h"
 #import "CCLogin.h"
-
-#ifdef CUSTOM_BUILD
-    #import "CustomSwift.h"
-#else
-    #import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCSplit ()
 {
@@ -108,7 +103,7 @@
 - (void)showIntro
 {
     // Brand
-    if (k_option_disable_intro) {
+    if ([NCBrandOptions sharedInstance].disable_intro) {
 
         [CCUtility setIntro:@"1.0"];
     
@@ -148,7 +143,7 @@
     if (app.activeAccount.length == 0) {
     
         // Brand
-        if (k_option_use_login_web) {
+        if ([NCBrandOptions sharedInstance].use_login_web) {
         
             _loginWeb = [CCLoginWeb new];
             _loginWeb.delegate = self;

+ 1 - 17
iOSClient/Move/CCMove.m

@@ -22,23 +22,7 @@
 //
 
 #import "CCMove.h"
-
-#ifndef EXTENSION
-
-    #import "AppDelegate.h"
-
-    #ifdef CUSTOM_BUILD
-        #import "CustomSwift.h"
-    #else
-        #import "Nextcloud-Swift.h"
-    #endif
-#else
-    #ifdef CUSTOM_BUILD
-        #import "CustomSwiftShare.h"
-    #else
-        #import "Share-Swift.h"
-    #endif
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCMove ()
 {    

+ 47 - 0
iOSClient/NCBridgeSwift.h

@@ -0,0 +1,47 @@
+//
+//  NCBridgeSwift.h
+//  Crypto Cloud Technology Nextcloud
+//
+//  Created by Marino Faggiana on 11/05/17.
+//  Copyright © 2017 TWS. All rights reserved.
+//
+//  Author Marino Faggiana <m.faggiana@twsweb.it>
+//
+//  This program is free software: you can redistribute it and/or modify
+//  it under the terms of the GNU General Public License as published by
+//  the Free Software Foundation, either version 3 of the License, or
+//  (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+//
+
+
+#ifndef EXTENSION
+    #ifdef CUSTOM_BUILD
+        #import "CustomSwift.h"
+    #else
+        #import "Nextcloud-Swift.h"
+    #endif
+#else
+    #ifdef EXTENSION_SHARE
+        #ifdef CUSTOM_BUILD
+            #import "CustomSwiftShare.h"
+        #else
+            #import "Share-Swift.h"
+        #endif
+    #endif
+
+    #ifdef EXTENSION_PICKER
+        #ifdef CUSTOM_BUILD
+            #import "CustomSwiftPick.h"
+        #else
+            #import "Picker-Swift.h"
+        #endif
+    #endif
+#endif

+ 4 - 27
iOSClient/Networking/CCNetworking.m

@@ -28,30 +28,7 @@
 #import "TableAccount+CoreDataClass.h"
 #import "NSDate+ISO8601.h"
 #import "NSString+Encode.h"
-
-#ifndef EXTENSION
-    #ifdef CUSTOM_BUILD
-        #import "CustomSwift.h"
-    #else
-        #import "Nextcloud-Swift.h"
-    #endif
-#else
-    #ifdef EXTENSION_SHARE
-        #ifdef CUSTOM_BUILD
-            #import "CustomSwiftShare.h"
-        #else
-            #import "Share-Swift.h"
-        #endif
-    #endif
-
-    #ifdef EXTENSION_PICKER
-        #ifdef CUSTOM_BUILD
-            #import "CustomSwiftPick.h"
-        #else
-            #import "Picker-Swift.h"
-        #endif
-    #endif
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCNetworking ()
 {
@@ -1472,9 +1449,9 @@
             if(result.count){
                 asset = result[0];
                 
-                [asset saveToAlbum:k_brand completionBlock:^(BOOL success) {
-                    if (success) NSLog(@"[LOG] Insert file %@ in %@", metadata.fileNamePrint, k_brand);
-                    else NSLog(@"[LOG] File %@ do not insert in %@", metadata.fileNamePrint, k_brand);
+                [asset saveToAlbum:[NCBrandOptions sharedInstance].brand completionBlock:^(BOOL success) {
+                    if (success) NSLog(@"[LOG] Insert file %@ in %@", metadata.fileNamePrint, [NCBrandOptions sharedInstance].brand);
+                    else NSLog(@"[LOG] File %@ do not insert in %@", metadata.fileNamePrint, [NCBrandOptions sharedInstance].brand);
                 }];
             }
         }

+ 5 - 28
iOSClient/Networking/OCNetworking.m

@@ -27,33 +27,10 @@
 #import "CCGraphics.h"
 #import "CCCertificate.h"
 #import "NSString+Encode.h"
+#import "NCBridgeSwift.h"
 
 #pragma clang diagnostic ignored "-Warc-performSelector-leaks"
 
-#ifndef EXTENSION
-    #ifdef CUSTOM_BUILD
-        #import "CustomSwift.h"
-    #else
-        #import "Nextcloud-Swift.h"
-    #endif
-#else
-    #ifdef EXTENSION_SHARE
-        #ifdef CUSTOM_BUILD
-            #import "CustomSwiftShare.h"
-        #else
-            #import "Share-Swift.h"
-        #endif
-    #endif
-
-    #ifdef EXTENSION_PICKER
-        #ifdef CUSTOM_BUILD
-            #import "CustomSwiftPick.h"
-        #else
-            #import "Picker-Swift.h"
-        #endif
-    #endif
-#endif
-
 @interface OCnetworking ()
 {
     NSString *_activeUser;
@@ -1439,16 +1416,16 @@
     // encode URL
     devicePublicKey = [CCUtility URLEncodeStringFromString:devicePublicKey];
     
-    [communication subscribingNextcloudServerPush:_activeUrl pushTokenHash:pushTokenHash devicePublicKey:devicePublicKey proxyServerPath:k_pushNotificationServer onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
+    [communication subscribingNextcloudServerPush:_activeUrl pushTokenHash:pushTokenHash devicePublicKey:devicePublicKey proxyServerPath: [NCBrandOptions sharedInstance].pushNotificationServer onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *publicKey, NSString *deviceIdentifier, NSString *signature, NSString *redirectedServer) {
         
         // encode URL
         deviceIdentifier = [CCUtility URLEncodeStringFromString:deviceIdentifier];
         signature = [CCUtility URLEncodeStringFromString:signature];
     
-        [communication subscribingPushProxy:k_pushNotificationServer pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature userPublicKey:[CCUtility URLEncodeStringFromString:publicKey] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
+        [communication subscribingPushProxy:[NCBrandOptions sharedInstance].pushNotificationServer pushToken:pushToken deviceIdentifier:deviceIdentifier deviceIdentifierSignature:signature userPublicKey:[CCUtility URLEncodeStringFromString:publicKey] onCommunication:communication successRequest:^(NSHTTPURLResponse *response, NSString *redirectedServer) {
             
             // Activity
-            [[NCManageDatabase sharedInstance] addActivityClient:k_pushNotificationServer fileID:@"" action:k_activityDebugActionPushProxy selector:@"" note:@"Service registered." type:k_activityTypeSuccess verbose:k_activityVerboseHigh account:_metadataNet.account activeUrl:_activeUrl];
+            [[NCManageDatabase sharedInstance] addActivityClient:[NCBrandOptions sharedInstance].pushNotificationServer fileID:@"" action:k_activityDebugActionPushProxy selector:@"" note:@"Service registered." type:k_activityTypeSuccess verbose:k_activityVerboseHigh account:_metadataNet.account activeUrl:_activeUrl];
             
             [self complete];
             
@@ -1472,7 +1449,7 @@
                 [[CCCertificate sharedManager] presentViewControllerCertificateWithTitle:[error localizedDescription] viewController:(UIViewController *)self.delegate delegate:self];
 
             // Activity
-            [[NCManageDatabase sharedInstance] addActivityClient:k_pushNotificationServer fileID:@"" action:k_activityDebugActionPushProxy selector:@"" note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account activeUrl:_activeUrl];
+            [[NCManageDatabase sharedInstance] addActivityClient:[NCBrandOptions sharedInstance].pushNotificationServer fileID:@"" action:k_activityDebugActionPushProxy selector:@"" note:[error.userInfo valueForKey:@"NSLocalizedDescription"] type:k_activityTypeFailure verbose:k_activityVerboseHigh account:_metadataNet.account activeUrl:_activeUrl];
             
             [self complete];
         }];

+ 1 - 6
iOSClient/PhotosCameraUpload/CCPhotosCameraUpload.m

@@ -23,12 +23,7 @@
 
 #import "CCPhotosCameraUpload.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-    #import "CustomSwift.h"
-#else
-    #import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCPhotosCameraUpload () <CCActionsDeleteDelegate, CCActionsDownloadThumbnailDelegate>
 {

+ 1 - 6
iOSClient/QuickActions/CCQuickActions.m

@@ -26,12 +26,7 @@
 #import "CCHud.h"
 #import "AppDelegate.h"
 #import "CCMain.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCQuickActions ()
 {

+ 1 - 24
iOSClient/Security/CCCertificate.m

@@ -23,36 +23,13 @@
 
 #import "CCUtility.h"
 #import "CCCertificate.h"
+#import "NCBridgeSwift.h"
 
 #import <openssl/x509.h>
 #import <openssl/bio.h>
 #import <openssl/err.h>
 #import <openssl/pem.h>
 
-#ifndef EXTENSION
-    #ifdef CUSTOM_BUILD
-        #import "CustomSwift.h"
-    #else
-        #import "Nextcloud-Swift.h"
-    #endif
-#else
-    #ifdef EXTENSION_SHARE
-        #ifdef CUSTOM_BUILD
-            #import "CustomSwiftShare.h"
-        #else
-            #import "Share-Swift.h"
-        #endif
-    #endif
-
-    #ifdef EXTENSION_PICKER
-        #ifdef CUSTOM_BUILD
-            #import "CustomSwiftPick.h"
-        #else
-            #import "Picker-Swift.h"
-        #endif
-    #endif
-#endif
-
 @implementation CCCertificate
 
 //Singleton

+ 4 - 9
iOSClient/Settings/CCAdvanced.m

@@ -24,12 +24,7 @@
 #import "CCAdvanced.h"
 #import "CCUtility.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-    #import "CustomSwift.h"
-#else
-    #import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCAdvanced ()
 
@@ -253,7 +248,7 @@
         fileAttachment = [fileAttachment stringByAppendingString:[NSString stringWithFormat:@"| %@ | %@ | %@ | %@ |\n", date, type, actionFile, note]];
     }
     
-    messageBody = [NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", k_brand,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
+    messageBody = [NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", [NCBrandOptions sharedInstance].brand, [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
     
     NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
     NSString *documentsDirectory = [paths objectAtIndex:0];
@@ -262,7 +257,7 @@
     // fix CCAdvanced.m line 276 2.17.2 (00005)
     if ([fileAttachment writeToFile:[documentsDirectory stringByAppendingPathComponent:@"activity.txt"] atomically:YES encoding:NSUTF8StringEncoding error:&error] && [MFMailComposeViewController canSendMail]) {
         
-        toRecipents = [NSArray arrayWithObject:k_mailMe];
+        toRecipents = [NSArray arrayWithObject:[NCBrandOptions sharedInstance].mailMe];
         
         MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
         mc.mailComposeDelegate = self;
@@ -456,7 +451,7 @@
 - (void)emptyGroupApplicationSupport
 {
     NSString *file;
-    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:k_capabilitiesGroups];
+    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[NCBrandOptions sharedInstance].capabilitiesGroups];
     NSString *dirIniziale = [[dirGroup URLByAppendingPathComponent:appApplicationSupport] path];
     
     NSDirectoryEnumerator *enumerator = [[NSFileManager defaultManager] enumeratorAtPath:dirIniziale];

+ 5 - 10
iOSClient/Settings/CCManageAccount.m

@@ -24,12 +24,7 @@
 #import "CCManageAccount.h"
 #import "AppDelegate.h"
 #import "CCLogin.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 #define actionSheetCancellaAccount 1
 
@@ -124,7 +119,7 @@
     [section addFormRow:row];
 
     // Brand
-    if (k_option_disable_multiaccount == NO) {
+    if ([NCBrandOptions sharedInstance].disable_multiaccount == NO) {
     
         // New Account nextcloud
         row = [XLFormRowDescriptor formRowDescriptorWithTag:@"addAccountNextcloud" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_add_nextcloud_", nil)];
@@ -207,7 +202,7 @@
     [[CCNetworking sharedNetworking] settingSessionsDownload:YES upload:YES taskStatus:k_taskStatusCancel activeAccount:app.activeAccount activeUser:app.activeUser activeUrl:app.activeUrl];
     
     // Brand
-    if (k_option_use_login_web) {
+    if ([NCBrandOptions sharedInstance].use_login_web) {
     
         _loginWeb = [CCLoginWeb new];
         _loginWeb.delegate = self;
@@ -228,7 +223,7 @@
 - (void)addAccountFoced
 {
     // Brand
-    if (k_option_use_login_web) {
+    if ([NCBrandOptions sharedInstance].use_login_web) {
     
         _loginWeb = [CCLoginWeb new];
         _loginWeb.delegate = self;
@@ -262,7 +257,7 @@
     [[CCNetworking sharedNetworking] settingSessionsDownload:YES upload:YES taskStatus:k_taskStatusCancel activeAccount:app.activeAccount activeUser:app.activeUser activeUrl:app.activeUrl];
     
     // Brand
-    if (k_option_use_login_web) {
+    if ([NCBrandOptions sharedInstance].use_login_web) {
     
         _loginWeb = [CCLoginWeb new];
         _loginWeb.delegate = self;

+ 1 - 6
iOSClient/Settings/CCManageCameraUpload.m

@@ -23,12 +23,7 @@
 
 #import "CCManageCameraUpload.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @implementation CCManageCameraUpload
 

+ 1 - 6
iOSClient/Settings/CCManageCryptoCloud.m

@@ -23,12 +23,7 @@
 
 #import "CCManageCryptoCloud.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @implementation CCManageCryptoCloud
 

+ 1 - 6
iOSClient/Settings/CCManageCryptoCloudSecurity.m

@@ -23,12 +23,7 @@
 
 #import "CCManageCryptoCloudSecurity.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCManageCryptoCloudSecurity()
 {

+ 6 - 11
iOSClient/Settings/CCSettings.m

@@ -29,12 +29,7 @@
 #import "CCAdvanced.h"
 #import "CCManageCryptoCloud.h"
 #import "CCManageAccount.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 #define alertViewEsci 1
 #define alertViewAzzeraCache 2
@@ -115,7 +110,7 @@
     // Section CRYPTO CLOUD SYSTEM ------------------------------------------
     
     // Brand
-    if (k_option_disable_cryptocloudsystem == NO) {
+    if ([NCBrandOptions sharedInstance].disable_cryptocloudsystem == NO) {
     
         section = [XLFormSectionDescriptor formSection];
         [form addFormSection:section];
@@ -444,8 +439,8 @@
             
             NSString *versionApp = [NSString stringWithFormat:@"%@.%@", [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
             
-            NSString *versionNextcloud = [NSString stringWithFormat:k_textCopyrightNextcloudServer, versionServer];
-            NSString *versionNextcloudiOS = [NSString stringWithFormat:k_textCopyrightNextcloudiOS, versionApp];
+            NSString *versionNextcloud = [NSString stringWithFormat:[NCBrandOptions sharedInstance].textCopyrightNextcloudServer, versionServer];
+            NSString *versionNextcloudiOS = [NSString stringWithFormat:[NCBrandOptions sharedInstance].textCopyrightNextcloudiOS, versionApp];
             
             sectionName = [NSString stringWithFormat:@"%@\n%@", versionNextcloudiOS, versionNextcloud];
         }
@@ -493,8 +488,8 @@
     // Email Recipents
     NSArray *toRecipents;
     
-    messageBody = [NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", k_brand,[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
-    toRecipents = [NSArray arrayWithObject:k_mailMe];
+    messageBody = [NSString stringWithFormat:@"\n\n\n%@ Version %@ (%@)", [NCBrandOptions sharedInstance].brand, [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"], [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]];
+    toRecipents = [NSArray arrayWithObject:[NCBrandOptions sharedInstance].mailMe];
     
     MFMailComposeViewController *mc = [[MFMailComposeViewController alloc] init];
     mc.mailComposeDelegate = self;

+ 1 - 6
iOSClient/Share/CCShareInfoCMOC.m

@@ -25,12 +25,7 @@
 #import "XLFormViewController.h"
 #import "XLForm.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCShareInfoCMOC ()
 

+ 1 - 6
iOSClient/Share/CCShareOC.m

@@ -23,12 +23,7 @@
 
 #import "CCShareOC.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCShareOC ()
 

+ 1 - 6
iOSClient/Share/CCSharePermissionOC.m

@@ -23,12 +23,7 @@
 
 #import "CCSharePermissionOC.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCSharePermissionOC ()
 {

+ 1 - 6
iOSClient/Share/CCShareUserOC.m

@@ -23,12 +23,7 @@
 
 #import "CCShareUserOC.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCShareUserOC ()
 

+ 1 - 6
iOSClient/Templates/CCAccountWeb.m

@@ -23,12 +23,7 @@
 
 #import "CCAccountWeb.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCAccountWeb()
 {

+ 1 - 6
iOSClient/Templates/CCBancomat.m

@@ -23,12 +23,7 @@
 
 #import "CCBancomat.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCBancomat()
 {

+ 1 - 6
iOSClient/Templates/CCCartaDiCredito.m

@@ -23,12 +23,7 @@
 
 #import "CCCartaDiCredito.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCCartaDiCredito()
 {

+ 1 - 6
iOSClient/Templates/CCCartaIdentita.m

@@ -23,12 +23,7 @@
 
 #import "CCCartaIdentita.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCCartaIdentita()
 {

+ 1 - 6
iOSClient/Templates/CCContoCorrente.m

@@ -23,12 +23,7 @@
 
 #import "CCContoCorrente.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCContoCorrente()
 {

+ 1 - 6
iOSClient/Templates/CCNote.m

@@ -23,12 +23,7 @@
 
 #import "CCNote.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCNote()
 {

+ 1 - 6
iOSClient/Templates/CCPassaporto.m

@@ -23,12 +23,7 @@
 
 #import "CCPassaporto.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCPassaporto()
 {

+ 1 - 6
iOSClient/Templates/CCPatenteGuida.m

@@ -25,12 +25,7 @@
 #import "XLFormViewController.h"
 #import "XLForm.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCPatenteGuida()
 {

+ 1 - 6
iOSClient/Templates/CCTemplates.m

@@ -22,12 +22,7 @@
 //
 
 #import "CCTemplates.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @implementation CCTemplates
 

+ 1 - 6
iOSClient/Transfers/CCTransfers.m

@@ -28,12 +28,7 @@
 #import "CCSection.h"
 #import "CCMetadata.h"
 #import "CCTransfersCell.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 #define download 1
 #define downloadwwan 2

+ 1 - 6
iOSClient/UploadFromOtherUpp/CCUploadFromOtherUpp.m

@@ -23,12 +23,7 @@
 
 #import "CCUploadFromOtherUpp.h"
 #import "AppDelegate.h"
-
-#ifdef CUSTOM_BUILD
-#import "CustomSwift.h"
-#else
-#import "Nextcloud-Swift.h"
-#endif
+#import "NCBridgeSwift.h"
 
 @interface CCUploadFromOtherUpp()
 {

+ 1 - 24
iOSClient/Utility/CCExifGeo.m

@@ -22,30 +22,7 @@
 //
 
 #import "CCExifGeo.h"
-
-#ifndef EXTENSION
-    #ifdef CUSTOM_BUILD
-        #import "CustomSwift.h"
-    #else
-        #import "Nextcloud-Swift.h"
-    #endif
-#else
-    #ifdef EXTENSION_SHARE
-        #ifdef CUSTOM_BUILD
-            #import "CustomSwiftShare.h"
-        #else
-            #import "Share-Swift.h"
-        #endif
-    #endif
-
-    #ifdef EXTENSION_PICKER
-        #ifdef CUSTOM_BUILD
-            #import "CustomSwiftPick.h"
-        #else
-            #import "Picker-Swift.h"
-        #endif
-    #endif
-#endif
+#import "NCBridgeSwift.h"
 
 @implementation CCExifGeo
 

+ 0 - 2
iOSClient/Utility/CCGraphics.h

@@ -43,8 +43,6 @@
 + (UIColor *)colorFromHexString:(NSString *)hexString;
 + (UIImage *)changeThemingColorImage:(UIImage *)image color:(UIColor *)color;
 
-+ (BOOL)isOptionUseThemingColor;
-
 @end
 
 @interface CCAvatar : UIImageView

+ 0 - 5
iOSClient/Utility/CCGraphics.m

@@ -287,11 +287,6 @@
     return [UIImage imageWithCGImage:img.CGImage scale:2.0 orientation: UIImageOrientationDownMirrored];
 }
 
-+ (BOOL)isOptionUseThemingColor
-{
-    return k_option_use_themingColor;
-}
-
 @end
 
 // ------------------------------------------------------------------------------------------------------

+ 5 - 5
iOSClient/Utility/CCUtility.m

@@ -22,8 +22,8 @@
 //
 
 #import "CCUtility.h"
-
 #import "CCGraphics.h"
+#import "NCBridgeSwift.h"
 
 #import <netinet/in.h>
 #import <openssl/x509.h>
@@ -546,7 +546,7 @@
 // Return path of User Crypto Cloud / <user dir>
 + (NSString *)getDirectoryActiveUser:(NSString *)activeUser activeUrl:(NSString *)activeUrl
 {
-    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:k_capabilitiesGroups];
+    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[NCBrandOptions sharedInstance].capabilitiesGroups];
     NSString *user = activeUser;
     NSString *baseUrl = [activeUrl lowercaseString];
     NSString *dirUserBaseUrl = nil;
@@ -611,7 +611,7 @@
 // Return the path of directory Cetificates
 + (NSString *)getDirectoryCerificates
 {
-    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:k_capabilitiesGroups];
+    NSURL *dirGroup = [[NSFileManager defaultManager] containerURLForSecurityApplicationGroupIdentifier:[NCBrandOptions sharedInstance].capabilitiesGroups];
     
     NSString *dir = [[dirGroup URLByAppendingPathComponent:appCertificates] path];
     if (![[NSFileManager defaultManager] fileExistsAtPath:dir])
@@ -744,8 +744,8 @@
     else
         translate = NSLocalizedString(localize, nil);
     
-    translate = [translate stringByReplacingOccurrencesOfString:@"_brand_" withString:k_brand];
-    translate = [translate stringByReplacingOccurrencesOfString:@"_mail_me_" withString:k_mailMe];
+    translate = [translate stringByReplacingOccurrencesOfString:@"_brand_" withString:[NCBrandOptions sharedInstance].brand];
+    translate = [translate stringByReplacingOccurrencesOfString:@"_mail_me_" withString:[NCBrandOptions sharedInstance].mailMe];
     
     return translate;
 }