Skip to content

Commit

Permalink
Merge branch 'develop' into feature/sharepoint-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
tobihagemann committed Feb 17, 2025
2 parents 054a90c + ceb5eae commit 706ac1f
Show file tree
Hide file tree
Showing 85 changed files with 367 additions and 386 deletions.
4 changes: 2 additions & 2 deletions Cryptomator.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3345,7 +3345,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 2.6.4;
MARKETING_VERSION = 2.6.5;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
Expand Down Expand Up @@ -3407,7 +3407,7 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MARKETING_VERSION = 2.6.4;
MARKETING_VERSION = 2.6.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
2 changes: 1 addition & 1 deletion Cryptomator/AddVault/AddVaultSuccessViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ private class VaultSuccessFooterView: UITableViewHeaderFooterView {

let text = NSMutableAttributedString(string: LocalizedString.getValue("addVault.success.footer"), attributes: [NSAttributedString.Key.foregroundColor: UIColor.secondaryLabel])
text.append(NSAttributedString(string: " "))
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")!])
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/ios/access-vault/#enable-cryptomator-in-files-app")!])
text.append(learnMoreLink)
textView.attributedText = text
textView.isUserInteractionEnabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class LocalFileSystemAuthenticationInfoFooterViewModel: AttributedTextHeaderFoot
let infoText = LocalizedString.getValue("localFileSystemAuthentication.info.footer")
let text = NSMutableAttributedString(string: infoText)
text.append(NSAttributedString(string: " "))
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")!])
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/ios/cloud-management/#other-file-provider")!])
text.append(learnMoreLink)
super.init(attributedText: text)
}
Expand Down
11 changes: 0 additions & 11 deletions Cryptomator/MainCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ class MainCoordinator: NSObject, Coordinator, UINavigationControllerDelegate {
rootViewController.showDetailViewController(detailNavigationController, sender: nil)
}

// Temporarily added for December 2024 Sale
func showPurchase() {
let modalNavigationController = BaseNavigationController()
let child = PurchaseCoordinator(navigationController: modalNavigationController)
childCoordinators.append(child)
navigationController.topViewController?.present(modalNavigationController, animated: true)
child.start()
}

// MARK: - UINavigationControllerDelegate

func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
Expand Down Expand Up @@ -124,8 +115,6 @@ extension MainCoordinator: StoreObserverDelegate {
switch transaction {
case .fullVersion, .yearlySubscription:
showFullVersionAlert()
// Temporarily added for December 2024 Sale
NotificationCenter.default.post(name: .purchasedFullVersionNotification, object: nil)
case let .freeTrial(expiresOn):
showTrialAlert(expirationDate: expiresOn)
case .unknown:
Expand Down
2 changes: 0 additions & 2 deletions Cryptomator/Purchase/Cells/PurchaseCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import UIKit

struct PurchaseCellViewModel: Hashable {
let productName: String
let productDetail: String?
let price: String
let purchaseDetail: String?
let purchaseButtonViewModel = PurchaseButtonViewModel()
Expand All @@ -37,7 +36,6 @@ class PurchaseCell: IAPCell {

func configure(with viewModel: PurchaseCellViewModel) {
productTitleLabel.text = viewModel.productName
productDetailLabel.text = viewModel.productDetail
accessory.button.setTitle(viewModel.price, for: .normal)
accessory.detailLabel.text = viewModel.purchaseDetail
accessory.configure(with: viewModel.purchaseButtonViewModel)
Expand Down
2 changes: 0 additions & 2 deletions Cryptomator/Purchase/PurchaseCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ class PurchaseCoordinator: Coordinator {
}
self.unlockedPro()
}
// Temporarily added for December 2024 Sale
NotificationCenter.default.post(name: .purchasedFullVersionNotification, object: nil)
}

func handleRestoreResult(_ result: RestoreTransactionsResult) {
Expand Down
24 changes: 0 additions & 24 deletions Cryptomator/Purchase/PurchaseViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@ class PurchaseViewModel: BaseIAPViewModel, ProductFetching {
return LocalizedString.getValue("purchase.title")
}

// Temporarily added for December 2024 Sale
override var infoText: NSAttributedString? {
let currentYear = Calendar.current.component(.year, from: Date())
let currentMonth = Calendar.current.component(.month, from: Date())
if currentYear == 2024 && currentMonth == 12 {
return NSAttributedString(
string: "*Note: The discount amount may vary by region.",
attributes: [
.font: UIFont.preferredFont(forTextStyle: .footnote),
.foregroundColor: UIColor.secondaryLabel
]
)
} else {
return nil
}
}

private let cryptomatorSettings: CryptomatorSettings

init(storeManager: IAPStore = StoreManager.shared, iapManager: IAPManager = StoreObserver.shared, cryptomatorSettings: CryptomatorSettings = CryptomatorUserDefaults.shared, minimumDisplayTime: TimeInterval = 1.0) {
Expand All @@ -73,7 +56,6 @@ class PurchaseViewModel: BaseIAPViewModel, ProductFetching {
cells.append(.trialCell(TrialCellViewModel(expirationDate: trialExpirationDate)))
} else {
cells.append(.purchaseCell(PurchaseCellViewModel(productName: LocalizedString.getValue("purchase.product.trial"),
productDetail: nil,
price: LocalizedString.getValue("purchase.product.pricing.free"),
purchaseDetail: LocalizedString.getValue("purchase.product.trial.duration"),
productIdentifier: .thirtyDayTrial)))
Expand All @@ -83,7 +65,6 @@ class PurchaseViewModel: BaseIAPViewModel, ProductFetching {
private func addSubscriptionItem() {
if let product = products[.yearlySubscription], let localizedPrice = product.localizedPrice {
let viewModel = PurchaseCellViewModel(productName: LocalizedString.getValue("purchase.product.yearlySubscription"),
productDetail: nil,
price: localizedPrice,
purchaseDetail: LocalizedString.getValue("purchase.product.yearlySubscription.duration"),
productIdentifier: .yearlySubscription)
Expand All @@ -93,12 +74,7 @@ class PurchaseViewModel: BaseIAPViewModel, ProductFetching {

private func addLifetimeLicenseItem() {
if let product = products[.fullVersion], let localizedPrice = product.localizedPrice {
// Temporarily added for December 2024 Sale
let currentYear = Calendar.current.component(.year, from: Date())
let currentMonth = Calendar.current.component(.month, from: Date())
let productDetail = currentYear == 2024 && currentMonth == 12 ? "🎁 33%* off in December" : nil
let viewModel = PurchaseCellViewModel(productName: LocalizedString.getValue("purchase.product.lifetimeLicense"),
productDetail: productDetail,
price: localizedPrice,
purchaseDetail: LocalizedString.getValue("purchase.product.lifetimeLicense.duration"),
productIdentifier: .fullVersion)
Expand Down
2 changes: 0 additions & 2 deletions Cryptomator/Purchase/UpgradeViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class UpgradeViewModel: BaseIAPViewModel, ProductFetching {
func addFreeUpgradeItem() {
guard products[.freeUpgrade] != nil else { return }
let viewModel = PurchaseCellViewModel(productName: LocalizedString.getValue("purchase.product.freeUpgrade"),
productDetail: nil,
price: LocalizedString.getValue("purchase.product.pricing.free"),
purchaseDetail: nil,
productIdentifier: .freeUpgrade)
Expand All @@ -44,7 +43,6 @@ class UpgradeViewModel: BaseIAPViewModel, ProductFetching {
func addPaidUpgradeItem() {
if let product = products[.paidUpgrade], let localizedPrice = product.localizedPrice {
let viewModel = PurchaseCellViewModel(productName: LocalizedString.getValue("purchase.product.donateAndUpgrade"),
productDetail: nil,
price: localizedPrice,
purchaseDetail: LocalizedString.getValue("purchase.product.lifetimeLicense.duration"),
productIdentifier: .paidUpgrade)
Expand Down
4 changes: 2 additions & 2 deletions Cryptomator/Resources/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h2>Privacy Policy</h2>

<h2>Connect</h2>
<ul>
<li><a href="https://twitter.com/Cryptomator">Twitter @Cryptomator</a></li>
<li><a href="https://mastodon.online/@cryptomator">Mastodon @cryptomator@mastodon.online</a></li>
<li><a href="https://facebook.com/Cryptomator">Facebook /Cryptomator</a></li>
</ul>

Expand Down Expand Up @@ -70,6 +70,6 @@ <h2>Disclaimer</h2>
<p>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>

<h2>Copyright</h2>
<p>© 2016 – 2024 Skymatic GmbH. All rights reserved.</p>
<p>© 2016 – 2025 Skymatic GmbH. All rights reserved.</p>
</body>
</html>
2 changes: 1 addition & 1 deletion Cryptomator/Settings/SettingsCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class SettingsCoordinator: Coordinator {
}

func openShortcutsGuide() {
if let shortcutsGuideURL = URL(string: "https://docs.cryptomator.org/en/latest/ios/shortcuts-guide/") {
if let shortcutsGuideURL = URL(string: "https://docs.cryptomator.org/ios/shortcuts-guide/") {
UIApplication.shared.open(shortcutsGuideURL)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class KeepUnlockedSectionFooterViewModel: BindableAttributedTextHeaderFooterView
}
let text = NSMutableAttributedString(string: infoText)
text.append(NSAttributedString(string: " "))
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/en/latest/ios/vault-management/#unlock-duration")!])
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/ios/vault-management/#unlock-duration")!])
text.append(learnMoreLink)
return text
}
Expand Down
13 changes: 8 additions & 5 deletions Cryptomator/VaultDetail/UnlockSectionFooterViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
// Copyright © 2021 Skymatic GmbH. All rights reserved.
//

import CryptomatorCloudAccessCore
import CryptomatorCommonCore
import Foundation

Expand All @@ -31,21 +32,23 @@ class UnlockSectionFooterViewModel: HeaderFooterViewModel {
}

var biometryTypeName: String?
var vaultInfo: VaultInfo

init(vaultUnlocked: Bool, biometricalUnlockEnabled: Bool, biometryTypeName: String?, keepUnlockedDuration: KeepUnlockedDuration) {
init(vaultUnlocked: Bool, biometricalUnlockEnabled: Bool, biometryTypeName: String?, keepUnlockedDuration: KeepUnlockedDuration, vaultInfo: VaultInfo) {
self.vaultUnlocked = vaultUnlocked
self.biometricalUnlockEnabled = biometricalUnlockEnabled
self.biometryTypeName = biometryTypeName
let titleText = UnlockSectionFooterViewModel.getTitleText(vaultUnlocked: vaultUnlocked, biometricalUnlockEnabled: biometricalUnlockEnabled, biometryTypeName: biometryTypeName, keepUnlockedDuration: keepUnlockedDuration)
let titleText = UnlockSectionFooterViewModel.getTitleText(vaultUnlocked: vaultUnlocked, biometricalUnlockEnabled: biometricalUnlockEnabled, biometryTypeName: biometryTypeName, keepUnlockedDuration: keepUnlockedDuration, vaultInfo: vaultInfo)
self.title = Bindable(titleText)
self.keepUnlockedDuration = keepUnlockedDuration
self.vaultInfo = vaultInfo
}

private func updateTitle() {
title.value = UnlockSectionFooterViewModel.getTitleText(vaultUnlocked: vaultUnlocked, biometricalUnlockEnabled: biometricalUnlockEnabled, biometryTypeName: biometryTypeName, keepUnlockedDuration: keepUnlockedDuration)
title.value = UnlockSectionFooterViewModel.getTitleText(vaultUnlocked: vaultUnlocked, biometricalUnlockEnabled: biometricalUnlockEnabled, biometryTypeName: biometryTypeName, keepUnlockedDuration: keepUnlockedDuration, vaultInfo: vaultInfo)
}

private static func getTitleText(vaultUnlocked: Bool, biometricalUnlockEnabled: Bool, biometryTypeName: String?, keepUnlockedDuration: KeepUnlockedDuration) -> String {
private static func getTitleText(vaultUnlocked: Bool, biometricalUnlockEnabled: Bool, biometryTypeName: String?, keepUnlockedDuration: KeepUnlockedDuration, vaultInfo: VaultInfo) -> String {
let unlockedText: String
if vaultUnlocked {
unlockedText = LocalizedString.getValue("vaultDetail.unlocked.footer")
Expand All @@ -62,7 +65,7 @@ class UnlockSectionFooterViewModel: HeaderFooterViewModel {
keepUnlockedText = String(format: LocalizedString.getValue("vaultDetail.keepUnlocked.footer.limitedDuration"), keepUnlockedDuration.description ?? "")
}
var footerText = "\(unlockedText)\n\n\(keepUnlockedText)"
if let biometryTypeName = biometryTypeName {
if vaultInfo.vaultConfigType != .hub, let biometryTypeName = biometryTypeName {
let biometricalUnlockText: String
if biometricalUnlockEnabled {
biometricalUnlockText = String(format: LocalizedString.getValue("vaultDetail.enabledBiometricalUnlock.footer"), biometryTypeName)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class VaultDetailInfoFooterViewModel: BindableAttributedTextHeaderFooterViewMode
let infoText = loggedInText + LocalizedString.getValue("vaultDetail.info.footer.accessVault")
let text = NSMutableAttributedString(string: infoText)
text.append(NSAttributedString(string: " "))
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")!])
let learnMoreLink = NSAttributedString(string: LocalizedString.getValue("common.footer.learnMore"), attributes: [NSAttributedString.Key.link: URL(string: "https://docs.cryptomator.org/ios/access-vault/#enable-cryptomator-in-files-app")!])
text.append(learnMoreLink)
return text
}
Expand Down
8 changes: 5 additions & 3 deletions Cryptomator/VaultDetail/VaultDetailViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class VaultDetailViewModel: VaultDetailViewModelProtocol {

private var lockSectionCells: [BindableTableViewCellViewModel] {
var cells: [BindableTableViewCellViewModel] = [lockButton, keepUnlockedCellViewModel]
if let biometryTypeName = context.enrolledBiometricsAuthenticationName() {
if vaultInfo.vaultConfigType != .hub, let biometryTypeName = context.enrolledBiometricsAuthenticationName() {
let switchCellViewModel = getSwitchCellViewModel(biometryTypeName: biometryTypeName)
cells.append(switchCellViewModel)
}
Expand All @@ -146,7 +146,7 @@ class VaultDetailViewModel: VaultDetailViewModelProtocol {
.lockingSection: unlockSectionFooterViewModel,
.removeVaultSection: BaseHeaderFooterViewModel(title: LocalizedString.getValue("vaultDetail.removeVault.footer"))]

private lazy var unlockSectionFooterViewModel = UnlockSectionFooterViewModel(vaultUnlocked: vaultInfo.vaultIsUnlocked.value, biometricalUnlockEnabled: biometricalUnlockEnabled, biometryTypeName: context.enrolledBiometricsAuthenticationName(), keepUnlockedDuration: currentKeepUnlockedDuration.value)
private lazy var unlockSectionFooterViewModel = UnlockSectionFooterViewModel(vaultUnlocked: vaultInfo.vaultIsUnlocked.value, biometricalUnlockEnabled: biometricalUnlockEnabled, biometryTypeName: context.enrolledBiometricsAuthenticationName(), keepUnlockedDuration: currentKeepUnlockedDuration.value, vaultInfo: vaultInfo)

private lazy var vaultInfoCellViewModel = BindableTableViewCellViewModel(title: vaultInfo.vaultName, detailTitle: vaultInfo.vaultPath.path, detailTitleTextColor: .secondaryLabel, image: UIImage(vaultIconFor: vaultInfo.cloudProviderType, state: .normal), selectionStyle: .none)
private lazy var renameVaultCellViewModel = ButtonCellViewModel.createDisclosureButton(action: VaultDetailButtonAction.showRenameVault, title: LocalizedString.getValue("vaultDetail.button.renameVault"), detailTitle: vaultName)
Expand Down Expand Up @@ -270,7 +270,9 @@ class VaultDetailViewModel: VaultDetailViewModelProtocol {
}

private func vaultIsEligibleToMove() -> Bool {
if case CloudProviderType.localFileSystem = vaultInfo.cloudProviderType {
if vaultInfo.vaultConfigType == .hub {
return false
} else if case CloudProviderType.localFileSystem = vaultInfo.cloudProviderType {
return false
}
return vaultInfo.vaultPath != CloudPath("/")
Expand Down
Loading

0 comments on commit 706ac1f

Please sign in to comment.