NCSettings.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445
  1. //
  2. // NCSettings.m
  3. // Nextcloud
  4. //
  5. // Created by Marino Faggiana on 24/11/14.
  6. // Copyright (c) 2014 Marino Faggiana. All rights reserved.
  7. //
  8. // Author Marino Faggiana <marino.faggiana@nextcloud.com>
  9. //
  10. // This program is free software: you can redistribute it and/or modify
  11. // it under the terms of the GNU General Public License as published by
  12. // the Free Software Foundation, either version 3 of the License, or
  13. // (at your option) any later version.
  14. //
  15. // This program is distributed in the hope that it will be useful,
  16. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. // GNU General Public License for more details.
  19. //
  20. // You should have received a copy of the GNU General Public License
  21. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  22. //
  23. #import "NCSettings.h"
  24. #import "CCAdvanced.h"
  25. #import "CCManageAccount.h"
  26. #import "CCManageAutoUpload.h"
  27. #import "NCManageEndToEndEncryption.h"
  28. #import "NCBridgeSwift.h"
  29. #import "NSNotificationCenter+MainThread.h"
  30. #import <LocalAuthentication/LocalAuthentication.h>
  31. #import <TOPasscodeViewController/TOPasscodeViewController.h>
  32. #define alertViewEsci 1
  33. #define alertViewAzzeraCache 2
  34. @interface NCSettings () <TOPasscodeSettingsViewControllerDelegate, TOPasscodeViewControllerDelegate>
  35. {
  36. AppDelegate *appDelegate;
  37. TOPasscodeViewController *passcodeViewController;
  38. TOPasscodeSettingsViewController *passcodeSettingsViewController;
  39. }
  40. @end
  41. @implementation NCSettings
  42. - (void)initializeForm
  43. {
  44. XLFormDescriptor *form = [XLFormDescriptor formDescriptor];
  45. XLFormSectionDescriptor *section;
  46. XLFormRowDescriptor *row;
  47. //NSInteger serverVersionMajor = [[NCManageDatabase shared] getCapabilitiesServerIntWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesVersionMajor];
  48. form.rowNavigationOptions = XLFormRowNavigationOptionNone;
  49. // Section AUTO UPLOAD OF CAMERA IMAGES ----------------------------
  50. section = [XLFormSectionDescriptor formSection];
  51. [form addFormSection:section];
  52. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"autoUpload" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_settings_autoupload_", nil)];
  53. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  54. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  55. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  56. [row.cellConfig setObject:[[UIImage imageNamed:@"autoUpload"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  57. row.action.viewControllerClass = [CCManageAutoUpload class];
  58. [section addFormRow:row];
  59. // Section : PRIVACY --------------------------------------------------------------
  60. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_privacy_", nil)];
  61. [form addFormSection:section];
  62. // Lock active YES/NO
  63. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"bloccopasscode" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_lock_not_active_", nil)];
  64. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  65. [row.cellConfig setObject:[[UIImage imageNamed:@"lock_open"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  66. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  67. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  68. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  69. //[row.cellConfig setObject:@(UITableViewCellAccessoryDisclosureIndicator) forKey:@"accessoryType"];
  70. row.action.formSelector = @selector(passcode:);
  71. [section addFormRow:row];
  72. // Enable Touch ID
  73. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"enableTouchDaceID" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_enable_touch_face_id_", nil)];
  74. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  75. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  76. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  77. [section addFormRow:row];
  78. // Lock no screen
  79. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"notPasscodeAtStart" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_lock_protection_no_screen_", nil)];
  80. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  81. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  82. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  83. [section addFormRow:row];
  84. // Privacy screen
  85. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"privacyScreen" rowType:XLFormRowDescriptorTypeBooleanSwitch title:NSLocalizedString(@"_privacy_screen_", nil)];
  86. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  87. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  88. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  89. [section addFormRow:row];
  90. // Section : E2EEncryption --------------------------------------------------------------
  91. BOOL isE2EEEnabled = [[NCManageDatabase shared] getCapabilitiesServerBoolWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesE2EEEnabled exists:false];
  92. NSString *versionE2EE = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesE2EEApiVersion];
  93. if (isE2EEEnabled == YES && [versionE2EE isEqual:[[NCGlobal shared] e2eeVersion]]) {
  94. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_e2e_settings_title_", nil)];
  95. [form addFormSection:section];
  96. // EndToEnd Encryption
  97. NSString *title = [NSString stringWithFormat:@"%@",NSLocalizedString(@"_e2e_settings_", nil)];
  98. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"e2eEncryption" rowType:XLFormRowDescriptorTypeButton title:title];
  99. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  100. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  101. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  102. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  103. [row.cellConfig setObject:[[UIImage imageNamed:@"lock"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  104. row.action.formSelector = @selector(manageE2EE:);
  105. //row.action.viewControllerClass = [NCManageEndToEndEncryption class];
  106. [section addFormRow:row];
  107. }
  108. // Section Advanced -------------------------------------------------
  109. section = [XLFormSectionDescriptor formSection];
  110. [form addFormSection:section];
  111. // Advanced
  112. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"advanced" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_advanced_", nil)];
  113. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  114. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  115. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  116. [row.cellConfig setObject:[[UIImage imageNamed:@"gear"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  117. row.action.viewControllerClass = [CCAdvanced class];
  118. [section addFormRow:row];
  119. // Section : INFORMATION ------------------------------------------------
  120. section = [XLFormSectionDescriptor formSectionWithTitle:NSLocalizedString(@"_information_", nil)];
  121. [form addFormSection:section];
  122. // Acknowledgements
  123. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"buttonLeftAligned" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_acknowledgements_", nil)];
  124. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  125. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  126. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  127. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  128. [row.cellConfig setObject:[[UIImage imageNamed:@"acknowledgements"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  129. row.action.formBlock = ^(XLFormRowDescriptor * sender){
  130. [self performSegueWithIdentifier:@"AcknowledgementsSegue" sender:sender];
  131. [self deselectFormRow:sender];
  132. };
  133. [section addFormRow:row];
  134. if (!NCBrandOptions.shared.disable_crash_service) {
  135. // Privacy and Legal Policy
  136. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"privacy" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_privacy_legal_", nil)];
  137. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  138. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  139. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  140. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  141. [row.cellConfig setObject:[[UIImage imageNamed:@"shield.checkerboard"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  142. row.action.formSelector = @selector(privacy:);
  143. [section addFormRow:row];
  144. // Source code
  145. row = [XLFormRowDescriptor formRowDescriptorWithTag:@"sourcecode" rowType:XLFormRowDescriptorTypeButton title:NSLocalizedString(@"_source_code_", nil)];
  146. row.cellConfigAtConfigure[@"backgroundColor"] = UIColor.secondarySystemGroupedBackgroundColor;
  147. [row.cellConfig setObject:[UIFont systemFontOfSize:15.0] forKey:@"textLabel.font"];
  148. [row.cellConfig setObject:@(NSTextAlignmentLeft) forKey:@"textLabel.textAlignment"];
  149. [row.cellConfig setObject:UIColor.labelColor forKey:@"textLabel.textColor"];
  150. [row.cellConfig setObject:[[UIImage imageNamed:@"gitHub"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  151. row.action.formSelector = @selector(sourceCode:);
  152. [section addFormRow:row];
  153. }
  154. self.tableView.showsVerticalScrollIndicator = NO;
  155. self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 35, 0);
  156. self.form = form;
  157. }
  158. // MARK: - View Life Cycle
  159. - (void)viewDidLoad
  160. {
  161. [super viewDidLoad];
  162. self.title = NSLocalizedString(@"_settings_", nil);
  163. self.view.backgroundColor = UIColor.systemGroupedBackgroundColor;
  164. self.tableView.backgroundColor = UIColor.systemGroupedBackgroundColor;
  165. appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
  166. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidEnterBackground) name:NCGlobal.shared.notificationCenterApplicationDidEnterBackground object:nil];
  167. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(initialize) name:NCGlobal.shared.notificationCenterInitialize object:nil];
  168. [self initializeForm];
  169. [self reloadForm];
  170. }
  171. - (void)viewWillAppear:(BOOL)animated
  172. {
  173. [super viewWillAppear:animated];
  174. appDelegate.activeViewController = self;
  175. }
  176. #pragma mark - NotificationCenter
  177. - (void)initialize
  178. {
  179. [self initializeForm];
  180. [self reloadForm];
  181. }
  182. - (void)applicationDidEnterBackground
  183. {
  184. if (passcodeViewController.view.window != nil) {
  185. [passcodeViewController dismissViewControllerAnimated:true completion:nil];
  186. }
  187. if (passcodeSettingsViewController.view.window != nil) {
  188. [passcodeSettingsViewController dismissViewControllerAnimated:true completion:nil];
  189. }
  190. [[self navigationController] popToRootViewControllerAnimated:false];
  191. }
  192. #pragma mark -
  193. - (void)reloadForm
  194. {
  195. self.form.delegate = nil;
  196. // ------------------------------------------------------------------
  197. XLFormRowDescriptor *rowBloccoPasscode = [self.form formRowWithTag:@"bloccopasscode"];
  198. XLFormRowDescriptor *rowNotPasscodeAtStart = [self.form formRowWithTag:@"notPasscodeAtStart"];
  199. XLFormRowDescriptor *rowEnableTouchDaceID = [self.form formRowWithTag:@"enableTouchDaceID"];
  200. XLFormRowDescriptor *rowPrivacyScreen = [self.form formRowWithTag:@"privacyScreen"];
  201. // ------------------------------------------------------------------
  202. if ([[CCUtility getPasscode] length]) {
  203. rowBloccoPasscode.title = NSLocalizedString(@"_lock_active_", nil);
  204. [rowBloccoPasscode.cellConfig setObject:[[UIImage imageNamed:@"lock"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  205. } else {
  206. rowBloccoPasscode.title = NSLocalizedString(@"_lock_not_active_", nil);
  207. [rowBloccoPasscode.cellConfig setObject:[[UIImage imageNamed:@"lock_open"] imageWithColor:NCBrandColor.shared.gray size:25] forKey:@"imageView.image"];
  208. }
  209. if ([CCUtility getEnableTouchFaceID]) [rowEnableTouchDaceID setValue:@1]; else [rowEnableTouchDaceID setValue:@0];
  210. if ([CCUtility getNotPasscodeAtStart]) [rowNotPasscodeAtStart setValue:@1]; else [rowNotPasscodeAtStart setValue:@0];
  211. if ([CCUtility getPrivacyScreenEnabled]) [rowPrivacyScreen setValue:@1]; else [rowPrivacyScreen setValue:@0];
  212. // -----------------------------------------------------------------
  213. [self.tableView reloadData];
  214. self.form.delegate = self;
  215. }
  216. - (void)formRowDescriptorValueHasChanged:(XLFormRowDescriptor *)rowDescriptor oldValue:(id)oldValue newValue:(id)newValue
  217. {
  218. [super formRowDescriptorValueHasChanged:rowDescriptor oldValue:oldValue newValue:newValue];
  219. if ([rowDescriptor.tag isEqualToString:@"notPasscodeAtStart"]) {
  220. if ([[rowDescriptor.value valueData] boolValue] == YES) {
  221. [CCUtility setNotPasscodeAtStart:true];
  222. } else {
  223. [CCUtility setNotPasscodeAtStart:false];
  224. }
  225. }
  226. if ([rowDescriptor.tag isEqualToString:@"enableTouchDaceID"]) {
  227. if ([[rowDescriptor.value valueData] boolValue] == YES) {
  228. [CCUtility setEnableTouchFaceID:true];
  229. } else {
  230. [CCUtility setEnableTouchFaceID:false];
  231. }
  232. }
  233. if ([rowDescriptor.tag isEqualToString:@"privacyScreen"]) {
  234. if ([[rowDescriptor.value valueData] boolValue] == YES) {
  235. [CCUtility setPrivacyScreenEnabled:true];
  236. } else {
  237. [CCUtility setPrivacyScreenEnabled:false];
  238. }
  239. }
  240. }
  241. #pragma mark -
  242. - (void)manageE2EE:(XLFormRowDescriptor *)sender
  243. {
  244. [self deselectFormRow:sender];
  245. UIViewController *vc = [[NCManageE2EEInterface alloc] makeShipDetailsUI];
  246. [self.navigationController pushViewController:vc animated:YES];
  247. }
  248. - (void)privacy:(XLFormRowDescriptor *)sender
  249. {
  250. [self deselectFormRow:sender];
  251. NCBrowserWeb* browserWebVC = [[UIStoryboard storyboardWithName:@"NCBrowserWeb" bundle:nil] instantiateInitialViewController];
  252. browserWebVC.urlBase = NCBrandOptions.shared.privacy;
  253. browserWebVC.isHiddenButtonExit = false;
  254. browserWebVC.titleBrowser = NSLocalizedString(@"_privacy_", nil);
  255. [self presentViewController:browserWebVC animated:YES completion:nil];
  256. }
  257. - (void)sourceCode:(XLFormRowDescriptor *)sender
  258. {
  259. [self deselectFormRow:sender];
  260. NCBrowserWeb* browserWebVC = [[UIStoryboard storyboardWithName:@"NCBrowserWeb" bundle:nil] instantiateInitialViewController];
  261. browserWebVC.urlBase = NCBrandOptions.shared.sourceCode;
  262. browserWebVC.isHiddenButtonExit = false;
  263. browserWebVC.titleBrowser = NSLocalizedString(@"_source_code_", nil);
  264. [self presentViewController:browserWebVC animated:YES completion:nil];
  265. }
  266. #pragma mark - Passcode
  267. - (void)didPerformBiometricValidationRequestInPasscodeViewController:(TOPasscodeViewController *)passcodeViewController
  268. {
  269. [[LAContext new] evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics localizedReason:[[NCBrandOptions shared] brand] reply:^(BOOL success, NSError * _Nullable error) {
  270. if (success) {
  271. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.5 * NSEC_PER_SEC), dispatch_get_main_queue(), ^(void) {
  272. [CCUtility setPasscode:@""];
  273. [passcodeViewController dismissViewControllerAnimated:YES completion:nil];
  274. [self reloadForm];
  275. });
  276. }
  277. }];
  278. }
  279. - (void)passcodeSettingsViewController:(TOPasscodeSettingsViewController *)passcodeSettingsViewController didChangeToNewPasscode:(NSString *)passcode ofType:(TOPasscodeType)type
  280. {
  281. [CCUtility setPasscode:passcode];
  282. [passcodeSettingsViewController dismissViewControllerAnimated:YES completion:nil];
  283. [self reloadForm];
  284. }
  285. - (void)didTapCancelInPasscodeViewController:(TOPasscodeViewController *)passcodeViewController
  286. {
  287. [passcodeViewController dismissViewControllerAnimated:YES completion:nil];
  288. }
  289. - (BOOL)passcodeViewController:(TOPasscodeViewController *)passcodeViewController isCorrectCode:(NSString *)code
  290. {
  291. if ([code isEqualToString:[CCUtility getPasscode]]) {
  292. [CCUtility setPasscode:@""];
  293. [self reloadForm];
  294. return YES;
  295. }
  296. return NO;
  297. }
  298. - (void)passcode:(XLFormRowDescriptor *)sender
  299. {
  300. LAContext *laContext = [LAContext new];
  301. NSError *error;
  302. [self deselectFormRow:sender];
  303. if ([[CCUtility getPasscode] length] == 0) {
  304. passcodeSettingsViewController = [[TOPasscodeSettingsViewController alloc] init];
  305. passcodeSettingsViewController.hideOptionsButton = YES;
  306. passcodeSettingsViewController.requireCurrentPasscode = NO;
  307. passcodeSettingsViewController.passcodeType = TOPasscodeTypeSixDigits;
  308. passcodeSettingsViewController.delegate = self;
  309. [self presentViewController:passcodeSettingsViewController animated:YES completion:nil];
  310. } else {
  311. passcodeViewController = [[TOPasscodeViewController alloc] initPasscodeType:TOPasscodeTypeSixDigits allowCancel:true];
  312. passcodeViewController.delegate = self;
  313. passcodeViewController.keypadButtonShowLettering = false;
  314. if (CCUtility.getEnableTouchFaceID && [laContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
  315. if (error == NULL) {
  316. if (laContext.biometryType == LABiometryTypeFaceID) {
  317. passcodeViewController.biometryType = TOPasscodeBiometryTypeFaceID;
  318. passcodeViewController.allowBiometricValidation = true;
  319. passcodeViewController.automaticallyPromptForBiometricValidation = true;
  320. } else if (laContext.biometryType == LABiometryTypeTouchID) {
  321. passcodeViewController.biometryType = TOPasscodeBiometryTypeTouchID;
  322. passcodeViewController.allowBiometricValidation = true;
  323. passcodeViewController.automaticallyPromptForBiometricValidation = true;
  324. } else {
  325. NSLog(@"No Biometric support");
  326. }
  327. }
  328. }
  329. [self presentViewController:passcodeViewController animated:YES completion:nil];
  330. }
  331. }
  332. #pragma mark -
  333. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  334. return NCGlobal.shared.heightCellSettings;
  335. }
  336. - (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
  337. {
  338. NSString *sectionName;
  339. NSInteger numSections = [tableView numberOfSections] - 1;
  340. if (section == 1) {
  341. sectionName = NSLocalizedString(@"_lock_protection_no_screen_footer_", nil);
  342. } else if (section == numSections) {
  343. NSString *versionServer = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesVersionString];
  344. NSString *themingName = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesThemingName];
  345. NSString *themingSlogan = [[NCManageDatabase shared] getCapabilitiesServerStringWithAccount:appDelegate.account elements:NCElementsJSON.shared.capabilitiesThemingSlogan];
  346. NSString *versionNextcloud = [NSString stringWithFormat:[NCBrandOptions shared].textCopyrightNextcloudServer, versionServer];
  347. NSString *versionNextcloudiOS = [NSString stringWithFormat:[NCBrandOptions shared].textCopyrightNextcloudiOS, [[NCUtility shared] getVersionAppWithBuild:true]];
  348. NSString *nameSlogan = [NSString stringWithFormat:@"%@ - %@", themingName, themingSlogan];
  349. sectionName = [NSString stringWithFormat:@"\n%@\n\n%@\n%@", versionNextcloudiOS, versionNextcloud, nameSlogan];
  350. }
  351. return sectionName;
  352. }
  353. @end