Jelajahi Sumber

Add the possibility for disable the Files App Integration (advanced option)

Marino Faggiana 6 tahun lalu
induk
melakukan
0a4e91bfcc

+ 4 - 0
PickerFileProvider/FileProviderData.swift

@@ -58,6 +58,10 @@ class FileProviderData: NSObject {
             NSLog("Unable to create directory \(error.debugDescription)")
         }
         
+        if CCUtility.getDisableFilesApp() {
+            return false
+        }
+        
         guard let activeAccount = NCManageDatabase.sharedInstance.getAccountActive() else {
             return false
         }

+ 1 - 1
iOSClient/Brand/Picker.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.21.1</string>
 	<key>CFBundleVersion</key>
-	<string>00001</string>
+	<string>00002</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/PickerFileProvider.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.21.1</string>
 	<key>CFBundleVersion</key>
-	<string>00001</string>
+	<string>00002</string>
 	<key>NSExtension</key>
 	<dict>
 		<key>NSExtensionFileProviderDocumentGroup</key>

+ 1 - 1
iOSClient/Brand/Share.plist

@@ -19,7 +19,7 @@
 	<key>CFBundleShortVersionString</key>
 	<string>2.21.1</string>
 	<key>CFBundleVersion</key>
-	<string>00001</string>
+	<string>00002</string>
 	<key>NSAppTransportSecurity</key>
 	<dict>
 		<key>NSAllowsArbitraryLoads</key>

+ 1 - 1
iOSClient/Brand/iOSClient.plist

@@ -69,7 +69,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>00001</string>
+	<string>00002</string>
 	<key>FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED</key>
 	<true/>
 	<key>Fabric</key>

+ 18 - 0
iOSClient/Settings/CCAdvanced.m

@@ -119,6 +119,19 @@
     [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
     [section addFormRow:row];
     
+    // Section : Files App --------------------------------------------------------------
+    
+    section = [XLFormSectionDescriptor formSection];
+    [form addFormSection:section];
+    section.footerTitle = NSLocalizedString(@"_disable_files_app_footer_", nil);
+
+    // Disable Files App
+    row = [XLFormRowDescriptor formRowDescriptorWithTag:@"disablefilesapp" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_disable_files_app_", nil)];
+    if ([CCUtility getDisableFilesApp]) row.value = @"1";
+    else row.value = @"0";
+    [row.cellConfig setObject:[UIFont systemFontOfSize:15.0]forKey:@"textLabel.font"];
+    [section addFormRow:row];
+    
     // Section CLEAR CACHE -------------------------------------------------
     
     section = [XLFormSectionDescriptor formSection];
@@ -212,6 +225,11 @@
         
         [CCUtility setFormatCompatibility:[[rowDescriptor.value valueData] boolValue]];
     }
+    
+    if ([rowDescriptor.tag isEqualToString:@"disablefilesapp"]) {
+        
+        [CCUtility setDisableFilesApp:[[rowDescriptor.value valueData] boolValue]];
+    }
 }
 
 #pragma --------------------------------------------------------------------------------------------

+ 68 - 66
iOSClient/Supporting Files/en.lproj/Localizable.strings

@@ -102,77 +102,79 @@
 
 // More
 
-"_more_"                    = "More";
-"_notifications_"           = "Notifications";
-"_logout_"                  = "Log out";
+"_more_"                        = "More";
+"_notifications_"               = "Notifications";
+"_logout_"                      = "Log out";
 
 // Settings
 
-"_acknowledgements_"        = "Acknowledgements";
-"_settings_"                = "Settings";
-"_passcode_"                = "Password";
-"_lock_"                    = "Lock";
-"_lock_active_"             = "Lock: On";
-"_lock_not_active_"         = "Lock: Off";
+"_acknowledgements_"            = "Acknowledgements";
+"_settings_"                    = "Settings";
+"_passcode_"                    = "Password";
+"_lock_"                        = "Lock";
+"_lock_active_"                 = "Lock: On";
+"_lock_not_active_"             = "Lock: Off";
 "_lock_protection_no_screen_"        = "Do not ask at startup";
 "_lock_protection_no_screen_footer_" = "Use \"Do not ask at startup\" for protected folders only or for the encryption option";
-"_url_"                     = "URL";
-"_username_"                = "Username";
-"_change_credentials_"      = "Change your credentials";
-"_wifi_only_"               = "Only use Wi-Fi connection";
-"_settings_autoupload_"     = "Auto upload";
-"_app_version_"             = "Application version";
-"_app_in_use_"              = "Application in use";
-"_contact_by_email_"        = "Contact us by email";
-"_clear_cache_"             = "Clear cache (%@ used)";
-"_clear_cache_no_size_"     = "Clear cache";
-"_exit_"                    = "Exit";
-"_funct_not_enabled_"       = "Functionality not enabled";
-"_passcode_activate_"       = "Password lock on";
-"_disabling_passcode_"      = "Removing password lock";
-"_want_exit_"               = "Attention! Will be reset to initial state. Continue?";
-"_proceed_"                 = "Proceed";
-"_delete_cache_"            = "Delete cache";
-"_want_delete_cache_"       = "Do you want to delete the cache?";
-"_want_delete_thumbnails_"  = "Do you want to delete all thumbnails too?";
-"_mail_deleted_"            = "Email deleted";
-"_mail_saved_"              = "Email saved";
-"_mail_sent_"               = "Email sent";
-"_mail_failure_"            = "Could not send email: %@";
-"_information_req_"         = "Information request";
-"_write_in_english_"        = "Kindly write to us in English";
-"_credentials_"             = "Credentials";
-"_manage_account_"          = "Manage account";
-"_change_password_"         = "Change password";
-"_add_account_"             = "Add account";
-"_delete_account_"          = "Delete account";
-"_want_delete_"             = "Do you really want to delete?";
-"_no_delete_"               = "No, do not delete";
-"_yes_delete_"              = "Yes, delete";
-"_remove_cache_"            = "Please wait, deleting cache…";
-"_optimizations_"           = "Optimizations";
-"_synchronizations_"        = "Synchronized folders";
-"_version_server_"          = "Server version";
-"_help_"                    = "Help";
-"_lock_protection_simply_"  = "Weak password protection";
-"_change_simply_passcode_"  = "Change password type";
-"_quota_"                   = "Quota";
-"_available_"               = "available";
-"_cloud_account_"           = "Cloud Account";
-"_information_"             = "Information";
-"_personal_information_"    = "Personal info";
-"_user_full_name_"          = "Full name";
-"_user_address_"            = "Address";
-"_user_phone_"              = "Phone number";
-"_user_email_"              = "Email";
-"_user_web_"                = "Website";
-"_user_twitter_"            = "Twitter";
-"_quota_using_"             = "You are using %@ of %@";
-"_favorite_offline_"        = "Favorites available offline";
-"_favorite_offline_footer_" = "Making all favorites available offline may take a while and use a lot of memory while doing it.";
-"_advanced_"                = "Advanced";
-"Skip"                      = "Skip";
-"Start"                     = "Start";
+"_url_"                         = "URL";
+"_username_"                    = "Username";
+"_change_credentials_"          = "Change your credentials";
+"_wifi_only_"                   = "Only use Wi-Fi connection";
+"_settings_autoupload_"         = "Auto upload";
+"_app_version_"                 = "Application version";
+"_app_in_use_"                  = "Application in use";
+"_contact_by_email_"            = "Contact us by email";
+"_clear_cache_"                 = "Clear cache (%@ used)";
+"_clear_cache_no_size_"         = "Clear cache";
+"_exit_"                        = "Exit";
+"_funct_not_enabled_"           = "Functionality not enabled";
+"_passcode_activate_"           = "Password lock on";
+"_disabling_passcode_"          = "Removing password lock";
+"_want_exit_"                   = "Attention! Will be reset to initial state. Continue?";
+"_proceed_"                     = "Proceed";
+"_delete_cache_"                = "Delete cache";
+"_want_delete_cache_"           = "Do you want to delete the cache?";
+"_want_delete_thumbnails_"      = "Do you want to delete all thumbnails too?";
+"_mail_deleted_"                = "Email deleted";
+"_mail_saved_"                  = "Email saved";
+"_mail_sent_"                   = "Email sent";
+"_mail_failure_"                = "Could not send email: %@";
+"_information_req_"             = "Information request";
+"_write_in_english_"            = "Kindly write to us in English";
+"_credentials_"                 = "Credentials";
+"_manage_account_"              = "Manage account";
+"_change_password_"             = "Change password";
+"_add_account_"                 = "Add account";
+"_delete_account_"              = "Delete account";
+"_want_delete_"                 = "Do you really want to delete?";
+"_no_delete_"                   = "No, do not delete";
+"_yes_delete_"                  = "Yes, delete";
+"_remove_cache_"                = "Please wait, deleting cache…";
+"_optimizations_"               = "Optimizations";
+"_synchronizations_"            = "Synchronized folders";
+"_version_server_"              = "Server version";
+"_help_"                        = "Help";
+"_lock_protection_simply_"      = "Weak password protection";
+"_change_simply_passcode_"      = "Change password type";
+"_quota_"                       = "Quota";
+"_available_"                   = "available";
+"_cloud_account_"               = "Cloud Account";
+"_information_"                 = "Information";
+"_personal_information_"        = "Personal info";
+"_user_full_name_"              = "Full name";
+"_user_address_"                = "Address";
+"_user_phone_"                  = "Phone number";
+"_user_email_"                  = "Email";
+"_user_web_"                    = "Website";
+"_user_twitter_"                = "Twitter";
+"_quota_using_"                 = "You are using %@ of %@";
+"_favorite_offline_"            = "Favorites available offline";
+"_favorite_offline_footer_"     = "Making all favorites available offline may take a while and use a lot of memory while doing it.";
+"_advanced_"                    = "Advanced";
+"Skip"                          = "Skip";
+"Start"                         = "Start";
+"_disable_files_app_"           = "Disable Files App integration";
+"_disable_files_app_footer_"    = "Do not permit the access of files across the Apple Files application";
 
 // Manage AutoUpload
 

+ 3 - 0
iOSClient/Utility/CCUtility.h

@@ -145,6 +145,9 @@
 
 + (void)clearAllKeysEndToEnd:(NSString *)account;
 
++ (BOOL)getDisableFilesApp;
++ (void)setDisableFilesApp:(BOOL)disable;
+
 // ===== Varius =====
 
 + (NSString *)getUserAgent;

+ 11 - 0
iOSClient/Utility/CCUtility.m

@@ -516,6 +516,17 @@
     [self setEndToEndPublicKeyServer:account publicKey:nil];
 }
 
++ (BOOL)getDisableFilesApp
+{
+    return [[UICKeyChainStore stringForKey:@"disablefilesapp" service:k_serviceShareKeyChain] boolValue];
+}
+
++ (void)setDisableFilesApp:(BOOL)disable
+{
+    NSString *sDisable = (disable) ? @"true" : @"false";
+    [UICKeyChainStore setString:sDisable forKey:@"disablefilesapp" service:k_serviceShareKeyChain];
+}
+
 #pragma --------------------------------------------------------------------------------------------
 #pragma mark ===== Varius =====
 #pragma --------------------------------------------------------------------------------------------