Skip to content

Commit

Permalink
Merge branch 'release/2.4.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
tobihagemann committed Jan 23, 2023
2 parents 5371905 + 68cba49 commit 6067db0
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 52 deletions.
4 changes: 2 additions & 2 deletions Cryptomator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3260,7 +3260,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.4.4;
MARKETING_VERSION = 2.4.5;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -3322,7 +3322,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
MARKETING_VERSION = 2.4.4;
MARKETING_VERSION = 2.4.5;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200";
Expand Down
29 changes: 0 additions & 29 deletions Cryptomator/WebDAV/WebDAVAuthentication.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,35 +42,6 @@ struct WebDAVAuthentication: View {
.introspectTableView(customize: { tableView in
tableView.backgroundColor = .cryptomatorBackground
})
.alert(isPresented: $viewModel.showUntrustedCertificateError) {
untrustedCertificateAlert
}
.alert(isPresented: $viewModel.showAllowInsecureConnectionAlert) {
insecureConnectionAlert
}
}

private var untrustedCertificateAlert: Alert {
Alert(title: Text(LocalizedString.getValue("untrustedTLSCertificate.title")),
message: Text(LocalizedString.getValue("untrustedTLSCertificate.message")),
primaryButton: .default(Text(LocalizedString.getValue("untrustedTLSCertificate.add")),
action: {
viewModel.allowCertificate()
}),
secondaryButton: .cancel(Text(LocalizedString.getValue("untrustedTLSCertificate.dismiss"))))
}

private var insecureConnectionAlert: Alert {
Alert(title: Text(LocalizedString.getValue("webDAVAuthentication.httpConnection.alert.title")),
message: Text(LocalizedString.getValue("webDAVAuthentication.httpConnection.alert.message")),
primaryButton: .default(Text(LocalizedString.getValue("webDAVAuthentication.httpConnection.change")),
action: {
viewModel.saveAccountWithTransformedURL()
}),
secondaryButton: .destructive(Text(LocalizedString.getValue("webDAVAuthentication.httpConnection.continue")),
action: {
viewModel.saveAccountWithInsecureConnection()
}))
}
}

Expand Down
51 changes: 50 additions & 1 deletion Cryptomator/WebDAV/WebDAVAuthenticationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ class WebDAVAuthenticationViewController: UIViewController {
hud?.transformToSelfDismissingSuccess().then {
self.coordinator?.authenticated(with: credential)
}
case .initial, .insecureConnectionNotAllowed, .untrustedCertificate:
case .insecureConnectionNotAllowed:
showInsecureConnectionAlert()
case let .untrustedCertificate(certificate: certificate, url: url):
showUntrustedCertificateAlert(certificate: certificate, url: url)
case .initial:
break
}
}
Expand All @@ -86,6 +90,51 @@ class WebDAVAuthenticationViewController: UIViewController {
hud?.showLoadingIndicator()
}

private func showUntrustedCertificateAlert(certificate: TLSCertificate, url: URL) {
let precondition: Promise<Void>
if let hud = hud {
precondition = hud.dismiss(animated: true)
} else {
precondition = Promise(())
}
precondition.then { [weak self] in
let message = String(format: LocalizedString.getValue("untrustedTLSCertificate.message"), url.absoluteString, certificate.fingerprint)
let alertController = UIAlertController(title: LocalizedString.getValue("untrustedTLSCertificate.title"),
message: message,
preferredStyle: .alert)
let addAction = UIAlertAction(title: LocalizedString.getValue("untrustedTLSCertificate.add"),
style: .default,
handler: { _ in self?.viewModel.saveAccountWithCertificate() })
alertController.addAction(addAction)
alertController.addAction(UIAlertAction(title: LocalizedString.getValue("untrustedTLSCertificate.dismiss"), style: .cancel))
self?.present(alertController, animated: true)
}
}

private func showInsecureConnectionAlert() {
let precondition: Promise<Void>
if let hud = hud {
precondition = hud.dismiss(animated: true)
} else {
precondition = Promise(())
}
precondition.then { [weak self] in
let alertController = UIAlertController(title: LocalizedString.getValue("webDAVAuthentication.httpConnection.alert.title"),
message: LocalizedString.getValue("webDAVAuthentication.httpConnection.alert.message"),
preferredStyle: .alert)
let changeToHTTPSAction = UIAlertAction(title: LocalizedString.getValue("webDAVAuthentication.httpConnection.change"), style: .default, handler: { _ in
self?.viewModel.saveAccountWithTransformedURL()
})

alertController.addAction(changeToHTTPSAction)
alertController.preferredAction = changeToHTTPSAction
alertController.addAction(UIAlertAction(title: LocalizedString.getValue("webDAVAuthentication.httpConnection.continue"), style: .destructive, handler: { _ in
self?.viewModel.saveAccountWithInsecureConnection()
}))
self?.present(alertController, animated: true)
}
}

@objc func cancel() {
coordinator?.cancel()
}
Expand Down
5 changes: 1 addition & 4 deletions fastlane/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
- Added download progress indication to Google Drive and WebDAV (#276, #293)
- Added upload progress indication to WebDAV (#293)
- Added background download/upload support to pCloud (#218, #293)
- Fixed error when trying to use self-signed certificates with WebDAV (#291)
- Fixed adding WebDAV connection stuck at "Authenticating…" when using self-signed certificate (#295, #298)
5 changes: 1 addition & 4 deletions fastlane/config/freemium/metadata/de-DE/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
- Anzeige des Download-Fortschritts zu Google Drive und WebDAV hinzugefügt (#276, #293)
- Anzeige des Upload-Fortschritts zu WebDAV hinzugefügt (#293)
- Hintergrund-Download/Upload-Unterstützung zu pCloud hinzugefügt (#218, #293)
- Fehler behoben, wenn versucht wurde, selbstsignierte Zertifikate mit WebDAV zu verwenden (#291)
- Hinzufügen von WebDAV-Verbindungen behoben, die bei "Authentifizierung …" hingen, wenn ein selbstsigniertes Zertifikat verwendet wurde (#295, #298)
5 changes: 1 addition & 4 deletions fastlane/config/freemium/metadata/en-US/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
- Added download progress indication to Google Drive and WebDAV (#276, #293)
- Added upload progress indication to WebDAV (#293)
- Added background download/upload support to pCloud (#218, #293)
- Fixed error when trying to use self-signed certificates with WebDAV (#291)
- Fixed adding WebDAV connection stuck at "Authenticating…" when using self-signed certificate (#295, #298)
5 changes: 1 addition & 4 deletions fastlane/config/premium/metadata/de-DE/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
- Anzeige des Download-Fortschritts zu Google Drive und WebDAV hinzugefügt (#276, #293)
- Anzeige des Upload-Fortschritts zu WebDAV hinzugefügt (#293)
- Hintergrund-Download/Upload-Unterstützung zu pCloud hinzugefügt (#218, #293)
- Fehler behoben, wenn versucht wurde, selbstsignierte Zertifikate mit WebDAV zu verwenden (#291)
- Hinzufügen von WebDAV-Verbindungen behoben, die bei "Authentifizierung …" hingen, wenn ein selbstsigniertes Zertifikat verwendet wurde (#295, #298)
5 changes: 1 addition & 4 deletions fastlane/config/premium/metadata/en-US/release_notes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
- Added download progress indication to Google Drive and WebDAV (#276, #293)
- Added upload progress indication to WebDAV (#293)
- Added background download/upload support to pCloud (#218, #293)
- Fixed error when trying to use self-signed certificates with WebDAV (#291)
- Fixed adding WebDAV connection stuck at "Authenticating…" when using self-signed certificate (#295, #298)

0 comments on commit 6067db0

Please sign in to comment.