diff --git a/OpenSesame.xcodeproj/project.pbxproj b/OpenSesame.xcodeproj/project.pbxproj index a296ed8..887ac3e 100644 --- a/OpenSesame.xcodeproj/project.pbxproj +++ b/OpenSesame.xcodeproj/project.pbxproj @@ -1552,7 +1552,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = "AutoFill iOS/AutoFill_iOS.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 30; + CURRENT_PROJECT_VERSION = 31; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "AutoFill iOS/Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = "AutoFill iOS"; @@ -1580,7 +1580,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = "AutoFill iOS/AutoFill_iOS.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 30; + CURRENT_PROJECT_VERSION = 31; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "AutoFill iOS/Info.plist"; INFOPLIST_KEY_CFBundleDisplayName = "AutoFill iOS"; @@ -1609,7 +1609,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = "AutoFill macOS/AutoFill_macOS.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 30; + CURRENT_PROJECT_VERSION = 31; ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; @@ -1638,7 +1638,7 @@ buildSettings = { CODE_SIGN_ENTITLEMENTS = "AutoFill macOS/AutoFill_macOS.entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 30; + CURRENT_PROJECT_VERSION = 31; ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; GENERATE_INFOPLIST_FILE = YES; @@ -1783,7 +1783,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "OpenSesame (iOS).entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 30; + CURRENT_PROJECT_VERSION = 31; ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; INFOPLIST_FILE = "OpenSesame--iOS--Info.plist"; @@ -1819,7 +1819,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = "OpenSesame (iOS).entitlements"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 30; + CURRENT_PROJECT_VERSION = 31; ENABLE_PREVIEWS = YES; GCC_OPTIMIZATION_LEVEL = z; GENERATE_INFOPLIST_FILE = YES; @@ -1859,7 +1859,7 @@ CODE_SIGN_ENTITLEMENTS = "OpenSesame (macOS).entitlements"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 30; + CURRENT_PROJECT_VERSION = 31; ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; @@ -1896,7 +1896,7 @@ CODE_SIGN_ENTITLEMENTS = "OpenSesame (macOS).entitlements"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 30; + CURRENT_PROJECT_VERSION = 31; ENABLE_APP_SANDBOX = YES; ENABLE_HARDENED_RUNTIME = YES; ENABLE_PREVIEWS = YES; diff --git a/OpenSesame.xcodeproj/xcshareddata/xcschemes/OpenSesame (iOS).xcscheme b/OpenSesame.xcodeproj/xcshareddata/xcschemes/OpenSesame (iOS).xcscheme index 7fc0cdb..95626c3 100644 --- a/OpenSesame.xcodeproj/xcshareddata/xcschemes/OpenSesame (iOS).xcscheme +++ b/OpenSesame.xcodeproj/xcshareddata/xcschemes/OpenSesame (iOS).xcscheme @@ -63,11 +63,11 @@ + isEnabled = "NO"> + isEnabled = "NO"> diff --git a/Shared/Documents/ImportDocumentView.swift b/Shared/Documents/ImportDocumentView.swift index 8d81a90..370c41d 100644 --- a/Shared/Documents/ImportDocumentView.swift +++ b/Shared/Documents/ImportDocumentView.swift @@ -79,6 +79,7 @@ struct ImportDocumentView: View { } private func add(encryptionKey: SymmetricKey) throws { + let _ = file.url.startAccessingSecurityScopedResource() guard let data = FileManager.default.contents(atPath: file.url.path) else { throw CocoaError(.fileReadCorruptFile) } let type = UTType(filenameExtension: file.url.pathExtension)! @@ -93,6 +94,8 @@ struct ImportDocumentView: View { account.password = try CryptoSecurityService.encrypt(accountDoc.password, encryptionKey: encryptionKey) account.passwordLength = Int16(accountDoc.password.count) + print(accountDoc) + selectedVault?.addToAccounts(account) case .cardDocument: let cardDoc = try JSONDecoder().decode(CardDocument.self, from: data) diff --git a/Shared/Persistence/Persistence.swift b/Shared/Persistence/Persistence.swift index 43b31a4..6a13962 100644 --- a/Shared/Persistence/Persistence.swift +++ b/Shared/Persistence/Persistence.swift @@ -43,10 +43,10 @@ class PersistenceController { container = NSPersistentContainer.create(inMemory: inMemory) let coreDataVersion = UserDefaults.group.float(forKey: "coreDataVersion") - if coreDataVersion < 1.3 { + if coreDataVersion < 1.4 { try? FileManager.default.removeItem(at: PersistenceController.storeURL) - UserDefaults(suiteName: OpenSesameConfig.APP_GROUP)?.set(1.3, forKey: "coreDataVersion") + UserDefaults(suiteName: OpenSesameConfig.APP_GROUP)?.set(1.4, forKey: "coreDataVersion") do { try self.downloadStoreFrom(.iCloud)