Skip to content

Commit 277f3a7

Browse files
committed
Merge branch 'release/2.7.0'
2 parents bcccf02 + 04292e0 commit 277f3a7

File tree

105 files changed

+1554
-209
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+1554
-209
lines changed

.github/CONTRIBUTING.md

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414

1515
- Suggest your change by [submitting a new issue](https://github.com/cryptomator/ios/issues/new/choose) and start writing code.
1616

17+
## Do you intend to add a new translation or change an existing one?
18+
19+
Translations are not managed directly in this repository. Instead, we use [Crowdin](https://translate.cryptomator.org/), which automatically synchronizes translations with this repository. If you want to help us with translations, please visit our translation project on Crowdin.
20+
1721
## Code of Conduct
1822

1923
Help us keep Cryptomator open and inclusive. Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md).

.github/ISSUE_TEMPLATE/bug.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
name: Bug Report
22
description: Create a report to help us improve
3-
labels: ["type:bug"]
3+
type: "Bug"
44
body:
5+
- type: input
6+
id: summary
7+
attributes:
8+
label: Summary
9+
placeholder: Please summarize your problem.
10+
validations:
11+
required: true
512
- type: checkboxes
613
id: terms
714
attributes:
@@ -11,13 +18,6 @@ body:
1118
required: true
1219
- label: I agree to follow this project's [Code of Conduct](https://github.com/cryptomator/ios/blob/develop/.github/CODE_OF_CONDUCT.md)
1320
required: true
14-
- type: input
15-
id: summary
16-
attributes:
17-
label: Summary
18-
placeholder: Please summarize your problem.
19-
validations:
20-
required: true
2121
- type: textarea
2222
id: software-versions
2323
attributes:

.github/ISSUE_TEMPLATE/feature.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
name: Feature Request
22
description: Suggest an idea for this project
3-
labels: ["type:feature-request"]
3+
type: "Feature"
44
body:
5+
- type: input
6+
id: summary
7+
attributes:
8+
label: Summary
9+
placeholder: Please summarize your feature request.
10+
validations:
11+
required: true
512
- type: checkboxes
613
id: terms
714
attributes:
@@ -11,13 +18,6 @@ body:
1118
required: true
1219
- label: I agree to follow this project's [Code of Conduct](https://github.com/cryptomator/ios/blob/develop/.github/CODE_OF_CONDUCT.md)
1320
required: true
14-
- type: input
15-
id: summary
16-
attributes:
17-
label: Summary
18-
placeholder: Please summarize your feature request.
19-
validations:
20-
required: true
2121
- type: textarea
2222
id: motivation
2323
attributes:

Cryptomator.xcodeproj/project.pbxproj

+62-6
Large diffs are not rendered by default.

Cryptomator.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

+18-18
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55
"kind" : "remoteSourceControl",
66
"location" : "https://github.com/openid/AppAuth-iOS.git",
77
"state" : {
8-
"revision" : "c89ed571ae140f8eb1142735e6e23d7bb8c34cb2",
9-
"version" : "1.7.5"
8+
"revision" : "2781038865a80e2c425a1da12cc1327bcd56501f",
9+
"version" : "1.7.6"
1010
}
1111
},
1212
{
1313
"identity" : "asn1",
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/leif-ibsen/ASN1",
1616
"state" : {
17-
"revision" : "4b4e82513e3b4d51a7573972fd7123222dd3a3bd",
18-
"version" : "2.6.0"
17+
"revision" : "e38d1b8b43d8b53ffadde9836f34289176bb7a0c",
18+
"version" : "2.7.0"
1919
}
2020
},
2121
{
@@ -50,8 +50,8 @@
5050
"kind" : "remoteSourceControl",
5151
"location" : "https://github.com/leif-ibsen/BigInt",
5252
"state" : {
53-
"revision" : "bf55e4ce076a5e2dde0db13d9b03d820cfad420d",
54-
"version" : "1.19.0"
53+
"revision" : "afb70a0038bfbba845271b60fa9a58d5840f8017",
54+
"version" : "1.21.0"
5555
}
5656
},
5757
{
@@ -68,8 +68,8 @@
6868
"kind" : "remoteSourceControl",
6969
"location" : "https://github.com/cryptomator/cloud-access-swift.git",
7070
"state" : {
71-
"revision" : "299be2306bc133b6eefbf18c172a1b5ed9808a44",
72-
"version" : "1.12.1"
71+
"revision" : "1ef0aa8c3afc5805cb76fcd05630822e2b70a626",
72+
"version" : "2.0.0"
7373
}
7474
},
7575
{
@@ -95,8 +95,8 @@
9595
"kind" : "remoteSourceControl",
9696
"location" : "https://github.com/leif-ibsen/Digest",
9797
"state" : {
98-
"revision" : "844a17be22efaa443130d081f2c4fa5f12c68e91",
99-
"version" : "1.8.0"
98+
"revision" : "1b9858026d5d3cb7b371fb1683ece54a654dfb21",
99+
"version" : "1.11.0"
100100
}
101101
},
102102
{
@@ -158,8 +158,8 @@
158158
"kind" : "remoteSourceControl",
159159
"location" : "https://github.com/AzureAD/microsoft-authentication-library-for-objc.git",
160160
"state" : {
161-
"revision" : "b8733236bfd16e10849f4752a4d1c4621e4bf930",
162-
"version" : "1.5.0"
161+
"revision" : "bad310566a9f86cc5f41b0a4e29618f7f7d5d5f6",
162+
"version" : "1.5.1"
163163
}
164164
},
165165
{
@@ -185,8 +185,8 @@
185185
"kind" : "remoteSourceControl",
186186
"location" : "https://github.com/pCloud/pcloud-sdk-swift.git",
187187
"state" : {
188-
"revision" : "ad1a7d8b3a59f12185d7bc89ff7a1b8c087ed0c0",
189-
"version" : "3.2.2"
188+
"revision" : "cc81e0250a9f378019470c78ce9a8bb501dcaeda",
189+
"version" : "3.2.3"
190190
}
191191
},
192192
{
@@ -212,8 +212,8 @@
212212
"kind" : "remoteSourceControl",
213213
"location" : "https://github.com/apple/swift-log",
214214
"state" : {
215-
"revision" : "9cb486020ebf03bfa5b5df985387a14a98744537",
216-
"version" : "1.6.1"
215+
"revision" : "3d8596ed08bd13520157f0355e35caed215ffbfa",
216+
"version" : "1.6.3"
217217
}
218218
},
219219
{
@@ -248,8 +248,8 @@
248248
"kind" : "remoteSourceControl",
249249
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
250250
"state" : {
251-
"revision" : "bc2a151366f2cd0e347274544933bc2acb00c9fe",
252-
"version" : "1.4.0"
251+
"revision" : "39de59b2d47f7ef3ca88a039dff3084688fe27f4",
252+
"version" : "1.5.2"
253253
}
254254
}
255255
],

Cryptomator/AddVault/CloudCell.swift

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class CloudCell: UITableViewCell {
2626
func configure(with cloudProviderType: CloudProviderType) {
2727
imageView?.image = UIImage(storageIconFor: cloudProviderType)
2828
textLabel?.text = cloudProviderType.localizedString()
29+
detailTextLabel?.text = cloudProviderType.localizedSecondaryString()
2930
}
3031

3132
@available(iOS 14, *)
@@ -36,6 +37,7 @@ class CloudCell: UITableViewCell {
3637
var content = defaultContentConfiguration().updated(for: state)
3738
content.image = UIImage(storageIconFor: cloudProviderType)
3839
content.text = cloudProviderType.localizedString()
40+
content.secondaryText = cloudProviderType.localizedSecondaryString()
3941
contentConfiguration = content
4042
}
4143
}

Cryptomator/AddVault/CreateNewVault/CreateNewVaultChooseFolderViewController.swift

+2
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ private class CreateNewVaultChooseFolderViewModelMock: ChooseFolderViewModelProt
7272
}
7373

7474
func refreshItems() {}
75+
76+
func addItem(_ item: CloudItemMetadata) {}
7577
}
7678

7779
struct CreateNewVaultChooseFolderVCPreview: PreviewProvider {

Cryptomator/AddVault/CreateNewVault/CreateNewVaultCoordinator.swift

+10-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CreateNewVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEditA
2424
}
2525

2626
func start() {
27-
let viewModel = ChooseCloudViewModel(clouds: [.localFileSystem(type: .iCloudDrive), .dropbox, .googleDrive, .oneDrive, .pCloud, .box, .webDAV(type: .custom), .s3(type: .custom), .localFileSystem(type: .custom)], headerTitle: LocalizedString.getValue("addVault.createNewVault.chooseCloud.header"))
27+
let viewModel = ChooseCloudViewModel(clouds: [.localFileSystem(type: .iCloudDrive), .dropbox, .googleDrive, .microsoftGraph(type: .oneDrive), .microsoftGraph(type: .sharePoint), .pCloud, .box, .webDAV(type: .custom), .s3(type: .custom), .localFileSystem(type: .custom)], headerTitle: LocalizedString.getValue("addVault.createNewVault.chooseCloud.header"))
2828
let chooseCloudVC = ChooseCloudViewController(viewModel: viewModel)
2929
chooseCloudVC.title = LocalizedString.getValue("addVault.createNewVault.title")
3030
chooseCloudVC.coordinator = self
@@ -47,6 +47,11 @@ class CreateNewVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEditA
4747
authenticator.authenticate(cloudProviderType, from: viewController).then { account in
4848
let provider = try CloudProviderDBManager.shared.getProvider(with: account.accountUID)
4949
self.startFolderChooser(with: provider, account: account)
50+
}.catch { error in
51+
guard case CocoaError.userCancelled = error else {
52+
self.handleError(error, for: self.navigationController)
53+
return
54+
}
5055
}
5156
}
5257

@@ -135,10 +140,11 @@ private class AuthenticatedCreateNewVaultCoordinator: FolderChoosing, VaultInsta
135140
navigationController.pushViewController(passwordVC, animated: true)
136141
}
137142

138-
func showCreateNewFolder(parentPath: CloudPath) {
143+
func showCreateNewFolder(parentPath: CloudPath, delegate: ChooseFolderViewModelProtocol?) {
139144
let modalNavigationController = BaseNavigationController()
140145
let child = AuthenticatedFolderCreationCoordinator(navigationController: modalNavigationController, provider: provider, parentPath: parentPath)
141146
child.parentCoordinator = self
147+
child.delegate = delegate
142148
childCoordinators.append(child)
143149
navigationController.topViewController?.present(modalNavigationController, animated: true)
144150
child.start()
@@ -163,6 +169,7 @@ private class AuthenticatedCreateNewVaultCoordinator: FolderChoosing, VaultInsta
163169

164170
class AuthenticatedFolderCreationCoordinator: FolderCreating, ChildCoordinator {
165171
weak var parentCoordinator: Coordinator?
172+
weak var delegate: ChooseFolderViewModelProtocol?
166173
var childCoordinators = [Coordinator]()
167174
var navigationController: UINavigationController
168175
private let provider: CloudProvider
@@ -183,6 +190,7 @@ class AuthenticatedFolderCreationCoordinator: FolderCreating, ChildCoordinator {
183190

184191
func createdNewFolder(at folderPath: CloudPath) {
185192
navigationController.dismiss(animated: true)
193+
delegate?.addItem(CloudItemMetadata(name: folderPath.lastPathComponent, cloudPath: folderPath, itemType: .folder, lastModifiedDate: nil, size: nil))
186194
if let folderChoosingParentCoordinator = parentCoordinator as? FolderChoosing {
187195
folderChoosingParentCoordinator.showItems(for: folderPath)
188196
}

Cryptomator/AddVault/OpenExistingVault/OpenExistingVaultChooseFolderViewController.swift

+2
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ private class OpenExistingVaultChooseFolderViewModelMock: ChooseFolderViewModelP
102102
}
103103

104104
func refreshItems() {}
105+
106+
func addItem(_ item: CloudItemMetadata) {}
105107
}
106108

107109
struct OpenExistingVaultChooseFolderVCPreview: PreviewProvider {

Cryptomator/AddVault/OpenExistingVault/OpenExistingVaultCoordinator.swift

+7-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class OpenExistingVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEd
2525
}
2626

2727
func start() {
28-
let viewModel = ChooseCloudViewModel(clouds: [.localFileSystem(type: .iCloudDrive), .dropbox, .googleDrive, .oneDrive, .pCloud, .box, .webDAV(type: .custom), .s3(type: .custom), .localFileSystem(type: .custom)], headerTitle: LocalizedString.getValue("addVault.openExistingVault.chooseCloud.header"))
28+
let viewModel = ChooseCloudViewModel(clouds: [.localFileSystem(type: .iCloudDrive), .dropbox, .googleDrive, .microsoftGraph(type: .oneDrive), .microsoftGraph(type: .sharePoint), .pCloud, .box, .webDAV(type: .custom), .s3(type: .custom), .localFileSystem(type: .custom)], headerTitle: LocalizedString.getValue("addVault.openExistingVault.chooseCloud.header"))
2929
let chooseCloudVC = ChooseCloudViewController(viewModel: viewModel)
3030
chooseCloudVC.title = LocalizedString.getValue("addVault.openExistingVault.title")
3131
chooseCloudVC.coordinator = self
@@ -48,6 +48,11 @@ class OpenExistingVaultCoordinator: AccountListing, CloudChoosing, DefaultShowEd
4848
authenticator.authenticate(cloudProviderType, from: viewController).then { account in
4949
let provider = try CloudProviderDBManager.shared.getProvider(with: account.accountUID)
5050
self.startFolderChooser(with: provider, account: account)
51+
}.catch { error in
52+
guard case CocoaError.userCancelled = error else {
53+
self.handleError(error, for: self.navigationController)
54+
return
55+
}
5156
}
5257
}
5358

@@ -208,7 +213,7 @@ private class AuthenticatedOpenExistingVaultCoordinator: VaultInstalling, Folder
208213
child.start()
209214
}
210215

211-
func showCreateNewFolder(parentPath: CloudPath) {}
216+
func showCreateNewFolder(parentPath: CloudPath, delegate: ChooseFolderViewModelProtocol?) {}
212217

213218
func handleError(error: Error) {
214219
navigationController.popViewController(animated: true)

Cryptomator/AppDelegate.swift

+6-6
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4141
DropboxSetup.constants = DropboxSetup(appKey: CloudAccessSecrets.dropboxAppKey, sharedContainerIdentifier: nil, keychainService: CryptomatorConstants.mainAppBundleId, forceForegroundSession: true)
4242
GoogleDriveSetup.constants = GoogleDriveSetup(clientId: CloudAccessSecrets.googleDriveClientId, redirectURL: CloudAccessSecrets.googleDriveRedirectURL!, sharedContainerIdentifier: nil)
4343
do {
44-
let oneDriveConfiguration = MSALPublicClientApplicationConfig(clientId: CloudAccessSecrets.oneDriveClientId, redirectUri: CloudAccessSecrets.oneDriveRedirectURI, authority: nil)
45-
oneDriveConfiguration.cacheConfig.keychainSharingGroup = CryptomatorConstants.mainAppBundleId
46-
let oneDriveClientApplication = try MSALPublicClientApplication(configuration: oneDriveConfiguration)
47-
OneDriveSetup.constants = OneDriveSetup(clientApplication: oneDriveClientApplication, sharedContainerIdentifier: nil)
44+
let microsoftGraphConfiguration = MSALPublicClientApplicationConfig(clientId: CloudAccessSecrets.microsoftGraphClientId, redirectUri: CloudAccessSecrets.microsoftGraphRedirectURI, authority: nil)
45+
microsoftGraphConfiguration.cacheConfig.keychainSharingGroup = CryptomatorConstants.mainAppBundleId
46+
let microsoftGraphClientApplication = try MSALPublicClientApplication(configuration: microsoftGraphConfiguration)
47+
MicrosoftGraphSetup.constants = MicrosoftGraphSetup(clientApplication: microsoftGraphClientApplication, sharedContainerIdentifier: nil)
4848
} catch {
4949
DDLogError("Setting up OneDrive failed with error: \(error)")
5050
}
@@ -80,14 +80,14 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
8080
let credential = DropboxCredential(tokenUID: tokenUid)
8181
DropboxAuthenticator.pendingAuthentication?.fulfill(credential)
8282
} else if authResult.isCancel() {
83-
DropboxAuthenticator.pendingAuthentication?.reject(DropboxAuthenticatorError.userCanceled)
83+
DropboxAuthenticator.pendingAuthentication?.reject(CocoaError(.userCancelled))
8484
} else if authResult.isError() {
8585
DropboxAuthenticator.pendingAuthentication?.reject(authResult.nsError)
8686
}
8787
}
8888
} else if url.scheme == CloudAccessSecrets.googleDriveRedirectURLScheme {
8989
return GoogleDriveAuthenticator.currentAuthorizationFlow?.resumeExternalUserAgentFlow(with: url) ?? false
90-
} else if url.scheme == CloudAccessSecrets.oneDriveRedirectURIScheme {
90+
} else if url.scheme == CloudAccessSecrets.microsoftGraphRedirectURIScheme {
9191
return MSALPublicClientApplication.handleMSALResponse(url, sourceApplication: options[.sourceApplication] as? String)
9292
}
9393
return false

Cryptomator/Common/ChooseFolder/ChooseFolderViewController.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ class ChooseFolderViewController: SingleSectionTableViewController {
8181
}
8282

8383
@objc func createNewFolder() {
84-
coordinator?.showCreateNewFolder(parentPath: viewModel.cloudPath)
84+
coordinator?.showCreateNewFolder(parentPath: viewModel.cloudPath, delegate: viewModel)
8585
}
8686

8787
@objc func pullToRefresh() {
@@ -205,6 +205,8 @@ private class ChooseFolderViewModelMock: ChooseFolderViewModelProtocol {
205205
}
206206

207207
func refreshItems() {}
208+
209+
func addItem(_ item: CloudItemMetadata) {}
208210
}
209211

210212
struct ChooseFolderVCPreview: PreviewProvider {

Cryptomator/Common/ChooseFolder/ChooseFolderViewModel.swift

+8-1
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ import CryptomatorCloudAccessCore
1111
import CryptomatorCommonCore
1212
import Foundation
1313

14-
protocol ChooseFolderViewModelProtocol {
14+
protocol ChooseFolderViewModelProtocol: AnyObject {
1515
var canCreateFolder: Bool { get }
1616
var cloudPath: CloudPath { get }
1717
var foundMasterkey: Bool { get }
1818
var headerTitle: String { get }
1919
var items: [CloudItemMetadata] { get }
2020
func startListenForChanges(onError: @escaping (Error) -> Void, onChange: @escaping () -> Void, onVaultDetection: @escaping (VaultDetailItem) -> Void)
2121
func refreshItems()
22+
func addItem(_ item: CloudItemMetadata)
2223
}
2324

2425
class ChooseFolderViewModel: ChooseFolderViewModelProtocol {
@@ -62,4 +63,10 @@ class ChooseFolderViewModel: ChooseFolderViewModelProtocol {
6263
self.errorListener?(error)
6364
}
6465
}
66+
67+
func addItem(_ item: CloudItemMetadata) {
68+
items.append(item)
69+
items.sort { $0.name.localizedStandardCompare($1.name) == .orderedAscending }
70+
changeListener?()
71+
}
6572
}

Cryptomator/Common/ChooseFolder/FolderChoosing.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ protocol FolderChoosing: AnyObject {
1212
func showItems(for path: CloudPath)
1313
func close()
1414
func chooseItem(_ item: Item)
15-
func showCreateNewFolder(parentPath: CloudPath)
15+
func showCreateNewFolder(parentPath: CloudPath, delegate: ChooseFolderViewModelProtocol?)
1616
func handleError(error: Error)
1717
}
1818

Cryptomator/Common/CloudAccountList/AccountListViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ class AccountListViewController: ListViewController<AccountCellContent>, ASWebAu
142142

143143
private func supportsEditing(_ cloudProviderType: CloudProviderType) -> Bool {
144144
switch cloudProviderType {
145-
case .box, .dropbox, .googleDrive, .localFileSystem, .oneDrive, .pCloud:
145+
case .box, .dropbox, .googleDrive, .localFileSystem, .microsoftGraph(type: .oneDrive), .microsoftGraph(type: .sharePoint), .pCloud:
146146
return false
147147
case .s3, .webDAV:
148148
return true

0 commit comments

Comments
 (0)