Skip to content

Commit

Permalink
Merge branch 'release/2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
tobihagemann committed Jun 7, 2022
2 parents 74d302b + ebdd600 commit 22081d2
Show file tree
Hide file tree
Showing 107 changed files with 2,512 additions and 101 deletions.
5 changes: 5 additions & 0 deletions .crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ commit_message: '[ci skip]'
files:
- source: /SharedResources/en.lproj/Localizable.strings
translation: /SharedResources/%osx_code%/%original_file_name%
skip_untranslated_strings: false
skip_untranslated_files: true
- source: /CryptomatorIntents/en.lproj/Intents.strings
translation: /CryptomatorIntents/%osx_code%/%original_file_name%
skip_untranslated_strings: false
skip_untranslated_files: true
271 changes: 268 additions & 3 deletions Cryptomator.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/openid/AppAuth-iOS.git",
"state": {
"branch": null,
"revision": "01131d68346c8ae552961c768d583c715fbe1410",
"version": "1.4.0"
"revision": "33660c271c961f8ce1084cc13f2ea8195e864f7d",
"version": "1.5.0"
}
},
{
Expand All @@ -33,8 +33,8 @@
"repositoryURL": "https://github.com/cryptomator/cloud-access-swift.git",
"state": {
"branch": null,
"revision": "0bdd40641ef409e46dab8e70be7ef3d9cc76309e",
"version": "1.2.3"
"revision": "f8aa06dbc245368aee16ff3e4047ab0cb881a81d",
"version": "1.3.0"
}
},
{
Expand All @@ -51,8 +51,8 @@
"repositoryURL": "https://github.com/cryptomator/cryptolib-swift.git",
"state": {
"branch": null,
"revision": "ea363662f52e3cdddd5c319da6894246b3bdf565",
"version": "1.0.2"
"revision": "6e5dbea6e05742ad82a074bf7ee8c3305d92fbae",
"version": "1.1.0"
}
},
{
Expand Down Expand Up @@ -87,17 +87,17 @@
"repositoryURL": "https://github.com/google/gtm-session-fetcher.git",
"state": {
"branch": null,
"revision": "bc6a19702ac76ac4e488b68148710eb815f9bc56",
"version": "1.7.0"
"revision": "4e9bbf2808b8fee444e84a48f5f3c12641987d3e",
"version": "1.7.2"
}
},
{
"package": "GTMAppAuth",
"repositoryURL": "https://github.com/google/GTMAppAuth.git",
"state": {
"branch": null,
"revision": "40f4103fb52109032c05599a0c39ad43edbdf80a",
"version": "1.2.2"
"revision": "e803d09da0147fbf1bbb30e126c47ff43254e057",
"version": "1.2.3"
}
},
{
Expand All @@ -114,8 +114,8 @@
"repositoryURL": "https://github.com/AzureAD/microsoft-authentication-library-for-objc.git",
"state": {
"branch": null,
"revision": "2825c3f72bf51f8be43df7177fe1c66370be2d0e",
"version": "1.2.0"
"revision": "e4202b9175d7b5566845b60e0ad233ed72b2783c",
"version": "1.2.1"
}
},
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1340"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4AD3D7D3282EBDE7008188CD"
BuildableName = "CryptomatorIntents.appex"
BlueprintName = "CryptomatorIntents"
ReferencedContainer = "container:Cryptomator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4AE97DA724572E4900452814"
BuildableName = "Cryptomator.app"
BlueprintName = "Cryptomator"
ReferencedContainer = "container:Cryptomator.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4AE97DA724572E4900452814"
BuildableName = "Cryptomator.app"
BlueprintName = "Cryptomator"
ReferencedContainer = "container:Cryptomator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "4AE97DA724572E4900452814"
BuildableName = "Cryptomator.app"
BlueprintName = "Cryptomator"
ReferencedContainer = "container:Cryptomator.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
9 changes: 7 additions & 2 deletions Cryptomator/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSFaceIDUsageDescription</key>
<string>This lets you unlock your vault.</string>
<key>NSUserActivityTypes</key>
<array>
<string>GetFolderIntent</string>
<string>SaveFileIntent</string>
</array>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
Expand All @@ -75,7 +82,5 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSFaceIDUsageDescription</key>
<string>This lets you unlock your vault.</string>
</dict>
</plist>
6 changes: 6 additions & 0 deletions Cryptomator/Settings/SettingsCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ class SettingsCoordinator: Coordinator {
}
}

func openShortcutsGuide() {
if let shortcutsGuideURL = URL(string: "https://docs.cryptomator.org/en/1.6/ios/shortcuts-guide/") {
UIApplication.shared.open(shortcutsGuideURL)
}
}

func showUnlockFullVersion() {
let child = SettingsPurchaseCoordinator(navigationController: navigationController)
childCoordinators.append(child) // TODO: remove missing?
Expand Down
2 changes: 2 additions & 0 deletions Cryptomator/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ class SettingsViewController: StaticUITableViewController<SettingsSection> {
viewModel.restorePurchase().then { [weak self] _ in
self?.refreshRows()
}
case .showShortcutsGuide:
coordinator?.openShortcutsGuide()
case .none:
break
}
Expand Down
2 changes: 2 additions & 0 deletions Cryptomator/Settings/SettingsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ enum SettingsButtonAction: String {
case showCloudServices
case showContact
case showRateApp
case showShortcutsGuide
case showUnlockFullVersion
case showManageSubscriptions
case restorePurchase
Expand Down Expand Up @@ -61,6 +62,7 @@ class SettingsViewModel: TableViewModel<SettingsSection> {
ButtonCellViewModel<SettingsButtonAction>(action: .sendLogFile, title: LocalizedString.getValue("settings.sendLogFile"))
]),
Section(id: .miscSection, elements: [
ButtonCellViewModel(action: SettingsButtonAction.showShortcutsGuide, title: LocalizedString.getValue("settings.shortcutsGuide")),
ButtonCellViewModel(action: SettingsButtonAction.showContact, title: LocalizedString.getValue("settings.contact")),
ButtonCellViewModel(action: SettingsButtonAction.showRateApp, title: LocalizedString.getValue("settings.rateApp"))
])
Expand Down
2 changes: 1 addition & 1 deletion CryptomatorCommon/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let package = Package(
)
],
dependencies: [
.package(url: "https://github.com/cryptomator/cloud-access-swift.git", .upToNextMinor(from: "1.2.0")),
.package(url: "https://github.com/cryptomator/cloud-access-swift.git", .upToNextMinor(from: "1.3.0")),
.package(url: "https://github.com/CocoaLumberjack/CocoaLumberjack.git", .upToNextMinor(from: "3.7.0"))
],
targets: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public class CryptomatorDatabase {
}

static var migrator: DatabaseMigrator {
CryptomatorDatabase.cleanupOldDatabase()

var migrator = DatabaseMigrator()
migrator.registerMigration("v1") { db in
try v1Migration(db)
Expand Down Expand Up @@ -187,19 +185,4 @@ public class CryptomatorDatabase {
}
}
}

/**
Removes the old shared database (prior 2.0.0-beta9).

The old shared database prior 2.0.0-beta9 does not support the new CloudProviderType with associated values for WebDAV and LocalFileSystem.
Instead of simply nuking the existing database, we remove the old database (and change the path of the new database) as this also resolves issues when upgrading from an older testflight version to the release version.
This function will be removed in the future.
*/
private static func cleanupOldDatabase() {
#warning("TODO (after April 2022): Remove this function")
guard let url = oldSharedDBURL else {
return
}
try? FileManager.default.removeItem(at: url)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
//
// FileImporting.swift
// CryptomatorCommonCore
//
// Created by Philipp Schmid on 13.05.22.
// Copyright © 2022 Skymatic GmbH. All rights reserved.
//

import FileProvider
import Foundation
import Promises

@objc public protocol FileImporting: NSFileProviderServiceSource {
/**
Imports the file at the given `localURL` to the given `parentItemIdentifier`.

- Parameter localURL: The URL of the file to be imported
- Parameter parentItemIdentifier: The item identifier of the folder into which the file will be imported.
- Parameter reply: Reply block which gets called with `nil` once the file has been imported locally. If an error occurs when importing the file locally, the reply block gets called with this error.
*/
func importFile(at localURL: URL, toParentItemIdentifier parentItemIdentifier: String, reply: @escaping (NSError?) -> Void)

/**
Returns the identifier for an item at the given path.

- Parameter path: The path of the item in the cloud
- Parameter reply: Reply block which is called with the `rawValue` of the `NSFileProviderItemIdentifier` if there is an item for the passed path in the cloud. If an error occurs while checking the path in the cloud, the reply block is called with it. Furthermore, the reply block is called with an error if the item does not exist in the cloud.
*/
func getIdentifierForItem(at path: String, reply: @escaping (NSString?, NSError?) -> Void)
}

public extension FileImporting {
/**
Imports the file at the given `localURL` to the given `parentItemIdentifier`.

- Parameter localURL: The URL of the file to be imported
- Parameter parentItemIdentifier: The item identifier of the folder into which the file will be imported.
*/
func importFile(at localURL: URL, toParentItemIdentifier parentItemIdentifier: String) -> Promise<Void> {
return wrap {
self.importFile(at: localURL, toParentItemIdentifier: parentItemIdentifier, reply: $0)
}.then { error -> Void in
if let error = error {
throw error
}
}
}

/**
Returns the identifier for an item at the given path.

- Parameter path: The path of the item in the cloud
*/
func getIdentifierForItem(at path: String) -> Promise<NSString> {
return wrap {
self.getIdentifierForItem(at: path, reply: $0)
}.then {
return $0!
}
}
}

public extension NSFileProviderServiceName {
static let fileImporting = NSFileProviderServiceName("org.cryptomator.ios.file-importing")
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public class VaultDBManager: VaultManager {
*/
public func createNewVault(withVaultUID vaultUID: String, delegateAccountUID: String, vaultPath: CloudPath, password: String, storePasswordInKeychain: Bool) -> Promise<Void> {
let tmpDirURL = URL(fileURLWithPath: NSTemporaryDirectory(), isDirectory: true).appendingPathComponent(UUID().uuidString, isDirectory: true)
let vaultConfig = VaultConfig.createNew(format: 8, cipherCombo: .sivCTRMAC, shorteningThreshold: 220)
let cipherCombo = CryptorScheme.sivCtrMac
let vaultConfig = VaultConfig.createNew(format: 8, cipherCombo: cipherCombo, shorteningThreshold: 220)
let masterkey: Masterkey
let provider: LocalizedCloudProviderDecorator
let vaultConfigToken: Data
Expand All @@ -96,7 +97,7 @@ public class VaultDBManager: VaultManager {
return try self.uploadVaultConfigToken(vaultConfigToken, vaultPath: vaultPath, provider: provider, tmpDirURL: tmpDirURL)
}.then { vaultConfigMetadata -> Promise<Void> in
cachedVault.vaultConfigLastModifiedDate = vaultConfigMetadata.lastModifiedDate
return try self.createVaultFolderStructure(masterkey: masterkey, vaultPath: vaultPath, provider: provider)
return try self.createVaultFolderStructure(masterkey: masterkey, cipherCombo: cipherCombo, vaultPath: vaultPath, provider: provider)
}.then { _ -> Promise<Void> in
let unverifiedVaultConfig = try UnverifiedVaultConfig(token: vaultConfigToken)
_ = try VaultProviderFactory.createVaultProvider(from: unverifiedVaultConfig, masterkey: masterkey, vaultPath: vaultPath, with: provider.delegate)
Expand Down Expand Up @@ -134,8 +135,8 @@ public class VaultDBManager: VaultManager {
return provider.uploadFile(from: localVaultConfigURL, to: vaultConfigCloudPath, replaceExisting: false)
}

private func createVaultFolderStructure(masterkey: Masterkey, vaultPath: CloudPath, provider: CloudProvider) throws -> Promise<Void> {
let cryptor = Cryptor(masterkey: masterkey)
private func createVaultFolderStructure(masterkey: Masterkey, cipherCombo: CryptorScheme, vaultPath: CloudPath, provider: CloudProvider) throws -> Promise<Void> {
let cryptor = Cryptor(masterkey: masterkey, scheme: cipherCombo)
let rootDirPath = try VaultDBManager.getRootDirectoryPath(for: cryptor, vaultPath: vaultPath)
let dPath = vaultPath.appendingPathComponent("d")
return provider.createFolder(at: dPath).then { _ -> Promise<Void> in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class VaultDBCacheTests: XCTestCase {
private let updatedMasterkey = Masterkey.createFromRaw(aesMasterKey: [UInt8](repeating: 0x56, count: 32), macMasterKey: [UInt8](repeating: 0x78, count: 32))
private var vaultConfigData: Data!
private var updatedVaultConfigData: Data!
private let vaultConfig = VaultConfig(id: "ABB9F673-F3E8-41A7-A43B-D29F5DA65068", format: 8, cipherCombo: .sivCTRMAC, shorteningThreshold: 220)
private let vaultConfig = VaultConfig(id: "ABB9F673-F3E8-41A7-A43B-D29F5DA65068", format: 8, cipherCombo: .sivCtrMac, shorteningThreshold: 220)
private var defaultCachedVault: CachedVault!
private let updatedMasterkeyFileLastModifiedDate = Date(timeIntervalSince1970: 100)
private let updatedVaultConfigLastModifiedDate = Date(timeIntervalSince1970: 200)
Expand Down
Loading

0 comments on commit 22081d2

Please sign in to comment.