Skip to content

Commit 59d83fe

Browse files
committed
Merge branch 'release/2.6.0'
2 parents f3de4e0 + b1335c5 commit 59d83fe

File tree

94 files changed

+1374
-397
lines changed

Some content is hidden

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

94 files changed

+1374
-397
lines changed

.github/workflows/build.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Build
22

33
on:
4-
[push]
4+
push:
5+
pull_request_target:
6+
types: [labeled]
57

68
jobs:
79
build:

.swiftlint.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
disabled_rules:
22
- file_length
33
- line_length
4+
- redundant_void_return
45
- todo
56
- type_body_length
67

@@ -14,6 +15,9 @@ included:
1415
- FileProviderExtension
1516
- FileProviderExtensionUI
1617

18+
excluded:
19+
- CryptomatorCommon/.build
20+
1721
identifier_name:
1822
min_length: 1
1923
max_length: 50

Cryptomator.xcodeproj/project.pbxproj

+12-2
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,10 @@
10131013
748BF20F2B571BB4006304AD /* fil */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fil; path = fil.lproj/Intents.strings; sourceTree = "<group>"; };
10141014
748BF2102B571C0C006304AD /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Localizable.strings; sourceTree = "<group>"; };
10151015
748BF2112B571C11006304AD /* hu */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hu; path = hu.lproj/Intents.strings; sourceTree = "<group>"; };
1016+
749D911D2C93089D00FAD1A4 /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/Localizable.strings; sourceTree = "<group>"; };
1017+
749D911E2C9308A700FAD1A4 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Localizable.strings; sourceTree = "<group>"; };
1018+
749D912C2C9308DD00FAD1A4 /* sl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = sl; path = sl.lproj/Intents.strings; sourceTree = "<group>"; };
1019+
749D912D2C9308DE00FAD1A4 /* uk */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = uk; path = uk.lproj/Intents.strings; sourceTree = "<group>"; };
10161020
74A1B13D2726A9E60098224B /* hi */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hi; path = hi.lproj/Localizable.strings; sourceTree = "<group>"; };
10171021
74AE94EF27A0282300D71AEC /* ar */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ar; path = ar.lproj/Localizable.strings; sourceTree = "<group>"; };
10181022
74AE94F027A0283500D71AEC /* ca */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ca; path = ca.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -2332,9 +2336,11 @@
23322336
ro,
23332337
ru,
23342338
sk,
2339+
sl,
23352340
sv,
23362341
"sw-TZ",
23372342
tr,
2343+
uk,
23382344
"zh-Hans",
23392345
"zh-Hant",
23402346
"zh-HK",
@@ -3090,9 +3096,11 @@
30903096
74275AE128478E0F0058AD25 /* ro */,
30913097
74275AE228478E100058AD25 /* ru */,
30923098
74275AE328478E120058AD25 /* sk */,
3099+
749D912C2C9308DD00FAD1A4 /* sl */,
30933100
74275AE628478E140058AD25 /* sv */,
30943101
74275AE528478E140058AD25 /* sw-TZ */,
30953102
74275AE728478E160058AD25 /* tr */,
3103+
749D912D2C9308DE00FAD1A4 /* uk */,
30963104
74275AD128478DFF0058AD25 /* zh-Hans */,
30973105
74275AD228478E000058AD25 /* zh-Hant */,
30983106
74275AD028478DFF0058AD25 /* zh-HK */,
@@ -3139,9 +3147,11 @@
31393147
74DFF9DA26DF87A0009981ED /* ro */,
31403148
74267A1626A5798C004C61BC /* ru */,
31413149
74267A1726A57990004C61BC /* sk */,
3150+
749D911D2C93089D00FAD1A4 /* sl */,
31423151
74267A1A26A5799A004C61BC /* sv */,
31433152
74397A852832A09B00CB9410 /* sw-TZ */,
31443153
74267A1C26A5799F004C61BC /* tr */,
3154+
749D911E2C9308A700FAD1A4 /* uk */,
31453155
74267A1D26A579A4004C61BC /* zh-Hans */,
31463156
74397A842832A05E00CB9410 /* zh-Hant */,
31473157
74626665283BD2D20070924B /* zh-HK */,
@@ -3310,7 +3320,7 @@
33103320
GCC_WARN_UNUSED_FUNCTION = YES;
33113321
GCC_WARN_UNUSED_VARIABLE = YES;
33123322
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
3313-
MARKETING_VERSION = 2.5.2;
3323+
MARKETING_VERSION = 2.6.0;
33143324
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
33153325
MTL_FAST_MATH = YES;
33163326
ONLY_ACTIVE_ARCH = YES;
@@ -3372,7 +3382,7 @@
33723382
GCC_WARN_UNUSED_FUNCTION = YES;
33733383
GCC_WARN_UNUSED_VARIABLE = YES;
33743384
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
3375-
MARKETING_VERSION = 2.5.2;
3385+
MARKETING_VERSION = 2.6.0;
33763386
MTL_ENABLE_DEBUG_INFO = NO;
33773387
MTL_FAST_MATH = YES;
33783388
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200";

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

+29-20
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,26 @@
1414
"kind" : "remoteSourceControl",
1515
"location" : "https://github.com/leif-ibsen/ASN1",
1616
"state" : {
17-
"revision" : "8a5cb6ce9b4a009a5b8d82465caf1aafb720096e",
18-
"version" : "2.5.0"
17+
"revision" : "4b4e82513e3b4d51a7573972fd7123222dd3a3bd",
18+
"version" : "2.6.0"
1919
}
2020
},
2121
{
2222
"identity" : "asn1swift",
2323
"kind" : "remoteSourceControl",
2424
"location" : "https://github.com/tikhop/ASN1Swift",
2525
"state" : {
26-
"revision" : "177417b6bf89431a0750ee640012b6aed8961c6a",
27-
"version" : "1.2.5"
26+
"revision" : "403cd95194e6a962e16db7c0d373d89fce83e0f7",
27+
"version" : "1.2.7"
2828
}
2929
},
3030
{
3131
"identity" : "aws-sdk-ios-spm",
3232
"kind" : "remoteSourceControl",
3333
"location" : "https://github.com/aws-amplify/aws-sdk-ios-spm.git",
3434
"state" : {
35-
"revision" : "cfcf97f6994b6ffd9a3244dc638458f5822aba56",
36-
"version" : "2.34.0"
35+
"revision" : "8ff8bebfe24271f7b16c5abaeb78daf82bee3a80",
36+
"version" : "2.34.2"
3737
}
3838
},
3939
{
@@ -50,17 +50,26 @@
5050
"kind" : "remoteSourceControl",
5151
"location" : "https://github.com/leif-ibsen/BigInt",
5252
"state" : {
53-
"revision" : "ba54c8b51392627d4cc9b05a672cce558be56e04",
54-
"version" : "1.17.0"
53+
"revision" : "bf55e4ce076a5e2dde0db13d9b03d820cfad420d",
54+
"version" : "1.19.0"
55+
}
56+
},
57+
{
58+
"identity" : "box-swift-sdk-gen",
59+
"kind" : "remoteSourceControl",
60+
"location" : "https://github.com/box/box-swift-sdk-gen.git",
61+
"state" : {
62+
"revision" : "a6b5793ab4053f9b55b840245ad07c9e3fdae344",
63+
"version" : "0.5.0"
5564
}
5665
},
5766
{
5867
"identity" : "cloud-access-swift",
5968
"kind" : "remoteSourceControl",
6069
"location" : "https://github.com/cryptomator/cloud-access-swift.git",
6170
"state" : {
62-
"revision" : "cd7a18abcaf09349f066363c7524b738f4f4ad79",
63-
"version" : "1.10.1"
71+
"revision" : "ff48ad0c1c0f8493ef6eeed172752cf0c03b509e",
72+
"version" : "1.11.1"
6473
}
6574
},
6675
{
@@ -86,8 +95,8 @@
8695
"kind" : "remoteSourceControl",
8796
"location" : "https://github.com/leif-ibsen/Digest",
8897
"state" : {
89-
"revision" : "1202dcb976e481e7c228492c5a8d5159cfa4ea97",
90-
"version" : "1.4.0"
98+
"revision" : "bb5de567a7b109a473ef5fddd3f02f1e5b9e2a41",
99+
"version" : "1.7.0"
91100
}
92101
},
93102
{
@@ -149,8 +158,8 @@
149158
"kind" : "remoteSourceControl",
150159
"location" : "https://github.com/AzureAD/microsoft-authentication-library-for-objc.git",
151160
"state" : {
152-
"revision" : "9d15d7980a52945dd17ea529bcf4c92f2c0d9a12",
153-
"version" : "1.3.1"
161+
"revision" : "d2f81ded070ac6452b2a6acb5bc45eb566427fe7",
162+
"version" : "1.3.3"
154163
}
155164
},
156165
{
@@ -176,8 +185,8 @@
176185
"kind" : "remoteSourceControl",
177186
"location" : "https://github.com/pCloud/pcloud-sdk-swift.git",
178187
"state" : {
179-
"revision" : "6da4ca6bb4e7068145d9325988e29862d26300ba",
180-
"version" : "3.2.0"
188+
"revision" : "ad1a7d8b3a59f12185d7bc89ff7a1b8c087ed0c0",
189+
"version" : "3.2.2"
181190
}
182191
},
183192
{
@@ -203,8 +212,8 @@
203212
"kind" : "remoteSourceControl",
204213
"location" : "https://github.com/apple/swift-log",
205214
"state" : {
206-
"revision" : "e97a6fcb1ab07462881ac165fdbb37f067e205d5",
207-
"version" : "1.5.4"
215+
"revision" : "9cb486020ebf03bfa5b5df985387a14a98744537",
216+
"version" : "1.6.1"
208217
}
209218
},
210219
{
@@ -239,8 +248,8 @@
239248
"kind" : "remoteSourceControl",
240249
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
241250
"state" : {
242-
"revision" : "b13b1d1a8e787a5ffc71ac19dcaf52183ab27ba2",
243-
"version" : "1.1.1"
251+
"revision" : "bc2a151366f2cd0e347274544933bc2acb00c9fe",
252+
"version" : "1.4.0"
244253
}
245254
}
246255
],

Cryptomator/AddVault/AddVaultSuccessViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private class VaultSuccessFooterView: UITableViewHeaderFooterView {
6868

6969
let text = NSMutableAttributedString(string: LocalizedString.getValue("addVault.success.footer"), attributes: [NSAttributedString.Key.foregroundColor: UIColor.secondaryLabel])
7070
text.append(NSAttributedString(string: " "))
71-
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/en/1.6/ios/access-vault/#enable-cryptomator-in-files-app")!])
71+
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/en/latest/ios/access-vault/#enable-cryptomator-in-files-app")!])
7272
text.append(learnMoreLink)
7373
textView.attributedText = text
7474
textView.isUserInteractionEnabled = true

Cryptomator/AddVault/CreateNewVault/CreateNewVaultCoordinator.swift

+1-1
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, .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, .oneDrive, .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

Cryptomator/AddVault/LocalVault/LocalFileSystemAuthenticationViewModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class LocalFileSystemAuthenticationInfoFooterViewModel: AttributedTextHeaderFoot
132132
let infoText = LocalizedString.getValue("localFileSystemAuthentication.info.footer")
133133
let text = NSMutableAttributedString(string: infoText)
134134
text.append(NSAttributedString(string: " "))
135-
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/en/1.6/ios/cloud-management/#other-file-provider")!])
135+
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/en/latest/ios/cloud-management/#other-file-provider")!])
136136
text.append(learnMoreLink)
137137
super.init(attributedText: text)
138138
}

Cryptomator/AddVault/OpenExistingVault/OpenExistingVaultCoordinator.swift

+1-1
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, .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, .oneDrive, .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

Cryptomator/AppDelegate.swift

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4949
DDLogError("Setting up OneDrive failed with error: \(error)")
5050
}
5151
PCloudSetup.constants = PCloudSetup(appKey: CloudAccessSecrets.pCloudAppKey, sharedContainerIdentifier: nil)
52+
BoxSetup.constants = BoxSetup(clientId: CloudAccessSecrets.boxClientId, clientSecret: CloudAccessSecrets.boxClientSecret, sharedContainerIdentifier: nil)
5253

5354
// Set up payment queue
5455
SKPaymentQueue.default().add(StoreObserver.shared)

Cryptomator/Common/CloudAccountList/AccountListViewController.swift

+14-2
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66
// Copyright © 2021 Skymatic GmbH. All rights reserved.
77
//
88

9+
import AuthenticationServices
10+
import CocoaLumberjackSwift
911
import CryptomatorCommon
1012
import CryptomatorCommonCore
1113
import Foundation
1214
import Promises
1315
import UIKit
1416

15-
class AccountListViewController: ListViewController<AccountCellContent> {
17+
class AccountListViewController: ListViewController<AccountCellContent>, ASWebAuthenticationPresentationContextProviding {
1618
weak var coordinator: (Coordinator & AccountListing)?
1719
private let viewModel: AccountListViewModelProtocol
1820

@@ -103,6 +105,16 @@ class AccountListViewController: ListViewController<AccountCellContent> {
103105
}
104106
}
105107

108+
// MARK: - ASWebAuthenticationPresentationContextProviding
109+
110+
func presentationAnchor(for session: ASWebAuthenticationSession) -> ASPresentationAnchor {
111+
guard let window = UIApplication.shared.windows.first else {
112+
DDLogInfo("No window could be found as presentation anchor.")
113+
return ASPresentationAnchor()
114+
}
115+
return window
116+
}
117+
106118
// MARK: - Internal
107119

108120
private func handleLogout(_ sender: AccountCellButton) {
@@ -130,7 +142,7 @@ class AccountListViewController: ListViewController<AccountCellContent> {
130142

131143
private func supportsEditing(_ cloudProviderType: CloudProviderType) -> Bool {
132144
switch cloudProviderType {
133-
case .dropbox, .googleDrive, .localFileSystem, .oneDrive, .pCloud:
145+
case .box, .dropbox, .googleDrive, .localFileSystem, .oneDrive, .pCloud:
134146
return false
135147
case .s3, .webDAV:
136148
return true

Cryptomator/Common/CloudAccountList/AccountListViewModel.swift

+34-17
Original file line numberDiff line numberDiff line change
@@ -66,46 +66,55 @@ class AccountListViewModel: AccountListViewModelProtocol {
6666
}
6767
}
6868

69+
func refreshBoxItems() -> Promise<Void> {
70+
return all(accountInfos
71+
.map { BoxCredential(tokenStorage: BoxTokenStorage(userID: $0.accountUID)) }
72+
.map { self.createAccountCellContent(for: $0) }
73+
).then { accounts in
74+
self.accounts = accounts
75+
}
76+
}
77+
6978
func createAccountCellContent(from accountInfo: AccountInfo) throws -> AccountCellContent {
7079
switch cloudProviderType {
80+
case .box:
81+
return createAccountCellContentPlaceholder()
7182
case .dropbox:
72-
let credential = DropboxCredential(tokenUID: accountInfo.accountUID)
73-
return createAccountCellContentPlaceholder(for: credential)
83+
return createAccountCellContentPlaceholder()
7484
case .googleDrive:
7585
let credential = GoogleDriveCredential(userID: accountInfo.accountUID)
7686
return try createAccountCellContent(for: credential)
87+
case .localFileSystem:
88+
throw AccountListError.unsupportedCloudProviderType
7789
case .oneDrive:
7890
let credential = try OneDriveCredential(with: accountInfo.accountUID)
7991
return try createAccountCellContent(for: credential)
8092
case .pCloud:
81-
let credential = try PCloudCredential(userID: accountInfo.accountUID)
82-
return createAccountCellContentPlaceholder(for: credential)
83-
case .webDAV:
84-
guard let credential = WebDAVCredentialManager.shared.getCredentialFromKeychain(with: accountInfo.accountUID) else {
85-
throw CloudProviderAccountError.accountNotFoundError
86-
}
87-
return createAccountCellContent(for: credential)
88-
case .localFileSystem:
89-
throw AccountListError.unsupportedCloudProviderType
93+
return createAccountCellContentPlaceholder()
9094
case .s3:
9195
guard let credential = S3CredentialManager.shared.getCredential(with: accountInfo.accountUID) else {
9296
throw CloudProviderAccountError.accountNotFoundError
9397
}
9498
let displayName = try S3CredentialManager.shared.getDisplayName(for: credential)
9599
return createAccountCellContent(for: credential, displayName: displayName)
100+
case .webDAV:
101+
guard let credential = WebDAVCredentialManager.shared.getCredentialFromKeychain(with: accountInfo.accountUID) else {
102+
throw CloudProviderAccountError.accountNotFoundError
103+
}
104+
return createAccountCellContent(for: credential)
96105
}
97106
}
98107

108+
private func createAccountCellContentPlaceholder() -> AccountCellContent {
109+
return AccountCellContent(mainLabelText: "(…)", detailLabelText: nil)
110+
}
111+
99112
private func createAccountCellContent(for credential: DropboxCredential) -> Promise<AccountCellContent> {
100113
return credential.getUsername().then { username in
101114
AccountCellContent(mainLabelText: username, detailLabelText: nil)
102115
}
103116
}
104117

105-
private func createAccountCellContentPlaceholder(for credential: DropboxCredential) -> AccountCellContent {
106-
return AccountCellContent(mainLabelText: "(…)", detailLabelText: nil)
107-
}
108-
109118
private func createAccountCellContent(for credential: GoogleDriveCredential) throws -> AccountCellContent {
110119
let username = try credential.getUsername()
111120
return AccountCellContent(mainLabelText: username, detailLabelText: nil)
@@ -122,8 +131,10 @@ class AccountListViewModel: AccountListViewModelProtocol {
122131
}
123132
}
124133

125-
private func createAccountCellContentPlaceholder(for credential: PCloudCredential) -> AccountCellContent {
126-
return AccountCellContent(mainLabelText: "(…)", detailLabelText: nil)
134+
func createAccountCellContent(for credential: BoxCredential) -> Promise<AccountCellContent> {
135+
return credential.getUsername().then { username in
136+
AccountCellContent(mainLabelText: username, detailLabelText: nil)
137+
}
127138
}
128139

129140
func createAccountCellContent(for credential: WebDAVCredential) -> AccountCellContent {
@@ -203,6 +214,12 @@ class AccountListViewModel: AccountListViewModelProtocol {
203214
}.catch { error in
204215
self.databaseChangedPublisher.send(.failure(error))
205216
}
217+
} else if self.cloudProviderType == .box {
218+
self.refreshBoxItems().then {
219+
self.databaseChangedPublisher.send(.success(self.accounts))
220+
}.catch { error in
221+
self.databaseChangedPublisher.send(.failure(error))
222+
}
206223
}
207224
})
208225
return databaseChangedPublisher.eraseToAnyPublisher()

0 commit comments

Comments
 (0)