diff options
author | Marino Faggiana <ios@nextcloud.com> | 2022-07-13 17:57:00 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-13 17:57:00 +0300 |
commit | 58c157032ce1add8716a7d700c742a39ae1b7eda (patch) | |
tree | 04a95a26deab3ec743e0a462a7260629d55d3821 | |
parent | 753c86d70afa2633de354bd13813b7942593efc7 (diff) | |
parent | 46999c51b394f96d788e76e6b02cd6efdeb81c62 (diff) |
Merge pull request #2074 from nextcloud/e2ee
E2ee
-rw-r--r-- | Nextcloud.xcodeproj/project.pbxproj | 4 | ||||
-rw-r--r-- | iOSClient/Files/NCFiles.swift | 10 | ||||
-rw-r--r-- | iOSClient/Menu/NCCollectionViewCommon+Menu.swift | 4 | ||||
-rw-r--r-- | iOSClient/Settings/NCEndToEndInitialize.swift | 6 | ||||
-rw-r--r-- | iOSClient/Settings/NCManageEndToEndEncryption.m | 7 | ||||
-rw-r--r-- | iOSClient/Supporting Files/en.lproj/Localizable.strings | 2 |
6 files changed, 18 insertions, 15 deletions
diff --git a/Nextcloud.xcodeproj/project.pbxproj b/Nextcloud.xcodeproj/project.pbxproj index f24c5de69..59a9a1caf 100644 --- a/Nextcloud.xcodeproj/project.pbxproj +++ b/Nextcloud.xcodeproj/project.pbxproj @@ -2995,7 +2995,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_TEAM = 6JLRKY9ZV7; ENABLE_BITCODE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -3058,7 +3058,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 8; DEVELOPMENT_TEAM = 6JLRKY9ZV7; ENABLE_BITCODE = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; diff --git a/iOSClient/Files/NCFiles.swift b/iOSClient/Files/NCFiles.swift index b8a9b3c09..94a07257c 100644 --- a/iOSClient/Files/NCFiles.swift +++ b/iOSClient/Files/NCFiles.swift @@ -77,9 +77,7 @@ class NCFiles: NCCollectionViewCommon { override func reloadDataSource(forced: Bool = true) { super.reloadDataSource() - DispatchQueue.main.async { - self.refreshControl.endRefreshing() - } + DispatchQueue.main.async { self.refreshControl.endRefreshing() } guard !isSearching, !appDelegate.account.isEmpty, !appDelegate.urlBase.isEmpty, !serverUrl.isEmpty else { return } self.metadatasSource = NCManageDatabase.shared.getMetadatas(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", appDelegate.account, serverUrl)) @@ -106,9 +104,7 @@ class NCFiles: NCCollectionViewCommon { providers: self.providers, searchResults: self.searchResults) - DispatchQueue.main.async { - self.collectionView.reloadData() - } + DispatchQueue.main.async { self.collectionView.reloadData() } } override func reloadDataSourceNetwork(forced: Bool = false) { @@ -134,6 +130,8 @@ class NCFiles: NCCollectionViewCommon { if metadatasUpdate?.count ?? 0 > 0 || metadatasDelete?.count ?? 0 > 0 || forced { self.reloadDataSource(forced: false) + } else if self.dataSource.metadatasSource.isEmpty { + DispatchQueue.main.async { self.collectionView.reloadData() } } } } diff --git a/iOSClient/Menu/NCCollectionViewCommon+Menu.swift b/iOSClient/Menu/NCCollectionViewCommon+Menu.swift index 5c64a6a19..4f4d54a8f 100644 --- a/iOSClient/Menu/NCCollectionViewCommon+Menu.swift +++ b/iOSClient/Menu/NCCollectionViewCommon+Menu.swift @@ -325,7 +325,7 @@ extension NCCollectionViewCommon { // // SET FOLDER E2EE // - if !metadata.e2eEncrypted && metadata.directory && CCUtility.isEnd(toEndEnabled: appDelegate.account) && metadata.serverUrl == serverUrlHome { + if !metadata.e2eEncrypted && metadata.directory && CCUtility.isEnd(toEndEnabled: appDelegate.account) && metadata.serverUrl == serverUrlHome && metadata.size == 0 { actions.append( NCMenuAction( title: NSLocalizedString("_e2e_set_folder_encrypted_", comment: ""), @@ -350,7 +350,7 @@ extension NCCollectionViewCommon { // // UNSET FOLDER E2EE // - if metadata.e2eEncrypted && metadata.directory && CCUtility.isEnd(toEndEnabled: appDelegate.account) && metadata.serverUrl == serverUrlHome { + if metadata.e2eEncrypted && metadata.directory && CCUtility.isEnd(toEndEnabled: appDelegate.account) && metadata.serverUrl == serverUrlHome && metadata.size == 0 { actions.append( NCMenuAction( title: NSLocalizedString("_e2e_remove_folder_encrypted_", comment: ""), diff --git a/iOSClient/Settings/NCEndToEndInitialize.swift b/iOSClient/Settings/NCEndToEndInitialize.swift index ead2193c6..737d68097 100644 --- a/iOSClient/Settings/NCEndToEndInitialize.swift +++ b/iOSClient/Settings/NCEndToEndInitialize.swift @@ -210,8 +210,8 @@ class NCEndToEndInitialize: NSObject { case NCGlobal.shared.errorResourceNotFound: // message - let e2ePassphrase = NYMnemonic.generateString(128, language: "english") - let message = "\n" + NSLocalizedString("_e2e_settings_view_passphrase_", comment: "") + "\n\n" + e2ePassphrase! + guard let e2ePassphrase = NYMnemonic.generateString(128, language: "english") else { return } + let message = "\n" + NSLocalizedString("_e2e_settings_view_passphrase_", comment: "") + "\n\n" + e2ePassphrase let alertController = UIAlertController(title: NSLocalizedString("_e2e_settings_title_", comment: ""), message: NSLocalizedString(message, comment: ""), preferredStyle: .alert) @@ -220,9 +220,7 @@ class NCEndToEndInitialize: NSObject { var privateKeyString: NSString? guard let privateKeyChiper = NCEndToEndEncryption.sharedManager().encryptPrivateKey(self.appDelegate.userId, directory: CCUtility.getDirectoryUserData(), passphrase: e2ePassphrase, privateKey: &privateKeyString) else { - NCContentPresenter.shared.messageNotification("E2E privateKey", description: "Serious internal error to create PrivateKey chiper", delay: NCGlobal.shared.dismissAfterSecond, type: NCContentPresenter.messageType.error, errorCode: errorCode, priority: .max) - return } diff --git a/iOSClient/Settings/NCManageEndToEndEncryption.m b/iOSClient/Settings/NCManageEndToEndEncryption.m index 0d22adb5e..147671409 100644 --- a/iOSClient/Settings/NCManageEndToEndEncryption.m +++ b/iOSClient/Settings/NCManageEndToEndEncryption.m @@ -345,8 +345,13 @@ NSString *message = [NSString stringWithFormat:@"\n%@\n\n\n%@", NSLocalizedString(@"_e2e_settings_the_passphrase_is_", nil), e2ePassphrase]; UIAlertController *alertController = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"_info_", nil) message:message preferredStyle:UIAlertControllerStyleAlert]; - UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"OK", @"OK action") style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { }]; + UIAlertAction *okAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"_ok_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { }]; + UIAlertAction *copyPassphrase = [UIAlertAction actionWithTitle:NSLocalizedString(@"_copy_passphrase_", nil) style:UIAlertActionStyleDefault handler:^(UIAlertAction *action) { + UIPasteboard.generalPasteboard.string = e2ePassphrase; + }]; + [alertController addAction:okAction]; + [alertController addAction:copyPassphrase]; [self presentViewController:alertController animated:YES completion:nil]; } else if ([passcodeType isEqualToString:@"removeLocallyEncryption"]) { diff --git a/iOSClient/Supporting Files/en.lproj/Localizable.strings b/iOSClient/Supporting Files/en.lproj/Localizable.strings index ef118567c..5adba0229 100644 --- a/iOSClient/Supporting Files/en.lproj/Localizable.strings +++ b/iOSClient/Supporting Files/en.lproj/Localizable.strings @@ -875,6 +875,8 @@ "_waiting_for_" = "Waiting for:"; "_reachable_wifi_" = "network reachable via Wi-Fi or cable"; "_ITMS-90076_" = "Due to a change in the Nextcloud application identifier, the settings and password for accessing your cloud are reset, so please re-enter your account data and check your Settings. We are sorry about what happened but it is not up to us."; +"_copy_passphrase_" = "Copy passphrase"; + // Video "_select_trace_" = "Select the trace"; |