diff --git a/PassKitTests/Info.plist b/PassKitTests/Info.plist new file mode 100644 index 0000000..6c6c23c --- /dev/null +++ b/PassKitTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/PassKitTests/passKitTests.swift b/PassKitTests/passKitTests.swift new file mode 100644 index 0000000..c248edc --- /dev/null +++ b/PassKitTests/passKitTests.swift @@ -0,0 +1,36 @@ +// +// passKitTests.swift +// passKitTests +// +// Created by Yishi Lin on 11/6/17. +// Copyright © 2017年 Bob Sun. All rights reserved. +// + +import XCTest +@testable import passKit + +class passKitTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Podfile b/Podfile index 0036760..e522491 100644 --- a/Podfile +++ b/Podfile @@ -1,3 +1,47 @@ +def generate_modulemap(name, path) + f = File.new(File.join("#{path}/module.modulemap"), "w+") + module_name = "#{name}" + while(module_name["+"]) + module_name["+"] = "_" + end + f.puts("module #{module_name} {") + f.puts(" umbrella header \"#{name}_umbrella.h\"") + f.puts(" export *") + f.puts("}") +end + +def generate_umbrella(name, path) + f = File.new(File.join("#{path}/#{name}_umbrella.h"), "w+") + f.puts("#import ") + Dir.chdir(path) { + Dir.glob("**/*.h").map { + |filename| f.puts("#import \"#{filename}\"") + } + } +end + +post_install do |installer| + require "fileutils" + headers_path = "#{Dir::pwd}/Pods/Headers/Public/" + + installer.pods_project.targets.each do |target| + target_header_path = "#{headers_path}#{target.product_name}" + if File.exist?(target_header_path) + filename = target.product_name + if filename != "." and filename != ".." + generate_umbrella(filename, target_header_path) + generate_modulemap(filename, target_header_path) + end + end + end +end + target 'pass' do pod 'ObjectivePGP', :git => 'https://github.com/mssun/ObjectivePGP.git' + target 'passKit' do + inherit! :search_paths + end + target 'passextension' do + inherit! :search_paths + end end diff --git a/pass.xcodeproj/project.pbxproj b/pass.xcodeproj/project.pbxproj index ee185b7..54eb204 100644 --- a/pass.xcodeproj/project.pbxproj +++ b/pass.xcodeproj/project.pbxproj @@ -7,25 +7,45 @@ objects = { /* Begin PBXBuildFile section */ - 94BA784B85E071D25EE89B59 /* libPods-pass.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ADCE7A5C3CCC67D7D21BB3C4 /* libPods-pass.a */; }; + 1473B150643891727EB85DFE /* libPods-pass.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7592A214C22CEBBEF4596CC1 /* libPods-pass.a */; }; + 398A8F69C2230A8117820BB7 /* libPods-passKit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45BAA15189E80AA544EAF7AD /* libPods-passKit.a */; }; A217ACE21E9AB17C00A1A6CF /* OTPScannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A217ACE11E9AB17C00A1A6CF /* OTPScannerController.swift */; }; A217ACE41E9BBBBD00A1A6CF /* GitConfigSettingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A217ACE31E9BBBBD00A1A6CF /* GitConfigSettingTableViewController.swift */; }; - A26075721EEC6B8D005DB03E /* SwiftyUserDefaults.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCA049951E3357E000522E8F /* SwiftyUserDefaults.framework */; }; - A262A58D1E68749C006B0890 /* Base32.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A262A58C1E68749C006B0890 /* Base32.framework */; }; + A26075811EEC6F34005DB03E /* passKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A26075781EEC6F34005DB03E /* passKit.framework */; }; + A26075881EEC6F34005DB03E /* passKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A26075871EEC6F34005DB03E /* passKitTests.swift */; }; + A260758A1EEC6F34005DB03E /* passKit.h in Headers */ = {isa = PBXBuildFile; fileRef = A260757A1EEC6F34005DB03E /* passKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A260758D1EEC6F34005DB03E /* passKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A26075781EEC6F34005DB03E /* passKit.framework */; }; + A260758E1EEC6F34005DB03E /* passKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = A26075781EEC6F34005DB03E /* passKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + A26075961EEC6F8C005DB03E /* passKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A26075781EEC6F34005DB03E /* passKit.framework */; }; + A26075AD1EEC7125005DB03E /* pass.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = A26075A51EEC7125005DB03E /* pass.xcdatamodeld */; }; A26700271EEC466A00176B8A /* ActionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A26700261EEC466A00176B8A /* ActionViewController.swift */; }; A267002A1EEC466A00176B8A /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A26700281EEC466A00176B8A /* MainInterface.storyboard */; }; A267002E1EEC466A00176B8A /* passextension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = A26700241EEC466A00176B8A /* passextension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; A26700361EEC475600176B8A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A26700341EEC475600176B8A /* Assets.xcassets */; }; A26700371EEC475600176B8A /* passProcessor.js in Resources */ = {isa = PBXBuildFile; fileRef = A26700351EEC475600176B8A /* passProcessor.js */; }; - A27424D91E7C35960093F436 /* NotificationNames.swift in Sources */ = {isa = PBXBuildFile; fileRef = A27424D81E7C35960093F436 /* NotificationNames.swift */; }; A2802BF91E70813A00879216 /* SliderTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2802BF71E70813A00879216 /* SliderTableViewCell.swift */; }; A2802BFA1E70813A00879216 /* SliderTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = A2802BF81E70813A00879216 /* SliderTableViewCell.xib */; }; + A2A61C121EEF8E4600CFE063 /* libObjectivePGP.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A2227D541EEE5E78002A69A9 /* libObjectivePGP.a */; }; + A2A61C131EEF90CB00CFE063 /* Base32.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A262A58C1E68749C006B0890 /* Base32.framework */; }; + A2A61C151EEF90CB00CFE063 /* KeychainAccess.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCA742D91E599ED400D54E16 /* KeychainAccess.framework */; }; + A2A61C161EEF90CB00CFE063 /* ObjectiveGit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC1208571E35EBE60042942E /* ObjectiveGit.framework */; }; + A2A61C171EEF90CB00CFE063 /* OneTimePassword.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCA671DE1E7A73B100D3ABE1 /* OneTimePassword.framework */; }; + A2A61C1A1EEF90CB00CFE063 /* SwiftyUserDefaults.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCA049951E3357E000522E8F /* SwiftyUserDefaults.framework */; }; A2A7813F1E97DBD9001311F5 /* QRScannerController.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2A7813E1E97DBD9001311F5 /* QRScannerController.swift */; }; - A2A89D691E954698003FB2D3 /* UITextFieldExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2A89D681E954698003FB2D3 /* UITextFieldExtension.swift */; }; + A2F4E2141EED800F0011986E /* GitCredential.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E2101EED800F0011986E /* GitCredential.swift */; }; + A2F4E2151EED800F0011986E /* Password.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E2111EED800F0011986E /* Password.swift */; }; + A2F4E2161EED800F0011986E /* PasswordEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E2121EED800F0011986E /* PasswordEntity.swift */; }; + A2F4E2171EED800F0011986E /* PasswordStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E2131EED800F0011986E /* PasswordStore.swift */; }; + A2F4E21E1EED80160011986E /* AppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E2181EED80160011986E /* AppError.swift */; }; + A2F4E21F1EED80160011986E /* DefaultsKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E2191EED80160011986E /* DefaultsKeys.swift */; }; + A2F4E2201EED80160011986E /* Globals.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E21A1EED80160011986E /* Globals.swift */; }; + A2F4E2211EED80160011986E /* NotificationNames.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E21B1EED80160011986E /* NotificationNames.swift */; }; + A2F4E2221EED80160011986E /* UITextFieldExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E21C1EED80160011986E /* UITextFieldExtension.swift */; }; + A2F4E2231EED80160011986E /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = A2F4E21D1EED80160011986E /* Utils.swift */; }; + B87896CC4725EE267C66D891 /* libPods-passextension.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B240CA444AC9172F3053651 /* libPods-passextension.a */; }; DC037CA61E4B883900609409 /* OpenSourceComponentsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC037CA51E4B883900609409 /* OpenSourceComponentsTableViewController.swift */; }; DC037CA81E4B898100609409 /* BasicStaticTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC037CA71E4B898100609409 /* BasicStaticTableViewController.swift */; }; DC037CAA1E4B8EAE00609409 /* SpecialThanksTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC037CA91E4B8EAE00609409 /* SpecialThanksTableViewController.swift */; }; - DC037CAC1E4C1C7100609409 /* FavIcon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC037CAB1E4C1C7100609409 /* FavIcon.framework */; }; DC037CB01E4CA51F00609409 /* GeneralSettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC037CAF1E4CA51F00609409 /* GeneralSettingsTableViewController.swift */; }; DC037CB21E4CAB1700609409 /* AboutRepositoryTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC037CB11E4CAB1700609409 /* AboutRepositoryTableViewController.swift */; }; DC037CB81E4DD1A500609409 /* AddPasswordTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC037CB71E4DD1A500609409 /* AddPasswordTableViewController.swift */; }; @@ -33,47 +53,34 @@ DC037CBC1E4DD47B00609409 /* TextFieldTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DC037CBA1E4DD47B00609409 /* TextFieldTableViewCell.xib */; }; DC037CBF1E4ED4E100609409 /* TextViewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC037CBD1E4ED4E100609409 /* TextViewTableViewCell.swift */; }; DC037CC01E4ED4E100609409 /* TextViewTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DC037CBE1E4ED4E100609409 /* TextViewTableViewCell.xib */; }; - DC1208581E35EBE60042942E /* ObjectiveGit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC1208571E35EBE60042942E /* ObjectiveGit.framework */; }; DC13B1511E8640810097803F /* passTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC13B1501E8640810097803F /* passTests.swift */; }; DC193FFA1E49B4430077E0A3 /* AdvancedSettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC193FF91E49B4430077E0A3 /* AdvancedSettingsTableViewController.swift */; }; DC193FFC1E49E0340077E0A3 /* PasscodeLock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DC193FFB1E49E0340077E0A3 /* PasscodeLock.framework */; }; DC193FFE1E49E0760077E0A3 /* PasscodeLockRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC193FFD1E49E0760077E0A3 /* PasscodeLockRepository.swift */; }; DC1940001E49E1A60077E0A3 /* PasscodeLockConfiguration.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC193FFF1E49E1A60077E0A3 /* PasscodeLockConfiguration.swift */; }; - DC19400B1E4B36B60077E0A3 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC19400A1E4B36B60077E0A3 /* Utils.swift */; }; DC3E64E61E656F11009A83DE /* CommitLogsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC3E64E51E656F11009A83DE /* CommitLogsTableViewController.swift */; }; DC4914961E434301007FF592 /* LabelTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4914941E434301007FF592 /* LabelTableViewCell.swift */; }; DC4914991E434600007FF592 /* PasswordDetailTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC4914981E434600007FF592 /* PasswordDetailTableViewController.swift */; }; DC5734AE1E439AD400D09270 /* PasswordsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC5734AD1E439AD400D09270 /* PasswordsViewController.swift */; }; DC5F385B1E56AADB00C69ACA /* PGPKeyArmorSettingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC5F385A1E56AADB00C69ACA /* PGPKeyArmorSettingTableViewController.swift */; }; - DC7E6EEA1E432E48006C2443 /* Password.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC7E6EE91E432E48006C2443 /* Password.swift */; }; DC8963C01E38EEB900828B09 /* SSHKeySettingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC8963BF1E38EEB900828B09 /* SSHKeySettingTableViewController.swift */; }; DC917BD71E2E8231000FDF54 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC917BD61E2E8231000FDF54 /* AppDelegate.swift */; }; DC917BDC1E2E8231000FDF54 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DC917BDA1E2E8231000FDF54 /* Main.storyboard */; }; DC917BDE1E2E8231000FDF54 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DC917BDD1E2E8231000FDF54 /* Assets.xcassets */; }; DC917BE11E2E8231000FDF54 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DC917BDF1E2E8231000FDF54 /* LaunchScreen.storyboard */; }; DC962CDF1E4B62C10033B5D8 /* AboutTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC962CDE1E4B62C10033B5D8 /* AboutTableViewController.swift */; }; - DCA049961E3357E000522E8F /* SwiftyUserDefaults.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCA049951E3357E000522E8F /* SwiftyUserDefaults.framework */; }; - DCA049981E33586A00522E8F /* DefaultsKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCA049971E33586A00522E8F /* DefaultsKeys.swift */; }; DCA0499A1E335CC800522E8F /* GitServerSettingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCA049991E335CC800522E8F /* GitServerSettingTableViewController.swift */; }; DCA0499C1E3362F400522E8F /* PGPKeySettingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCA0499B1E3362F400522E8F /* PGPKeySettingTableViewController.swift */; }; - DCA0499E1E33BAC100522E8F /* Globals.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCA0499D1E33BAC100522E8F /* Globals.swift */; }; - DCA671DF1E7A73B100D3ABE1 /* OneTimePassword.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCA671DE1E7A73B100D3ABE1 /* OneTimePassword.framework */; }; - DCA742DA1E599ED400D54E16 /* KeychainAccess.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCA742D91E599ED400D54E16 /* KeychainAccess.framework */; }; DCAAF7451E2FA66800AB94BC /* SettingsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCAAF7441E2FA66800AB94BC /* SettingsTableViewController.swift */; }; - DCC277D21E30D6EA00402246 /* pass.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = DCC408C81E30BA1300F29B0E /* pass.xcdatamodeld */; }; - DCC408A41E2FCC9E00F29B0E /* PasswordStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC408A31E2FCC9E00F29B0E /* PasswordStore.swift */; }; DCC408C71E307DBB00F29B0E /* SVProgressHUD.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DCC408C61E307DBB00F29B0E /* SVProgressHUD.framework */; }; DCC441521E8F6C06008A90C4 /* RawPasswordViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC441511E8F6C06008A90C4 /* RawPasswordViewController.swift */; }; DCC441541E916382008A90C4 /* GitSSHKeyArmorSettingTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCC441531E916382008A90C4 /* GitSSHKeyArmorSettingTableViewController.swift */; }; - DCD9AD131EB678500093499A /* GitCredential.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD9AD121EB678500093499A /* GitCredential.swift */; }; - DCD9AD151EB6829A0093499A /* AppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCD9AD141EB6829A0093499A /* AppError.swift */; }; DCDDEAB01E4639F300F68193 /* LabelTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DCDDEAAF1E4639F300F68193 /* LabelTableViewCell.xib */; }; DCDDEAB31E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCDDEAB11E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift */; }; DCFB779A1E4F3BCF008DE471 /* TitleTextFieldTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFB77981E4F3BCF008DE471 /* TitleTextFieldTableViewCell.swift */; }; DCFB779B1E4F3BCF008DE471 /* TitleTextFieldTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DCFB77991E4F3BCF008DE471 /* TitleTextFieldTableViewCell.xib */; }; DCFB779E1E4F40C7008DE471 /* FillPasswordTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFB779C1E4F40C7008DE471 /* FillPasswordTableViewCell.swift */; }; DCFB779F1E4F40C7008DE471 /* FillPasswordTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DCFB779D1E4F40C7008DE471 /* FillPasswordTableViewCell.xib */; }; - DCFB77A11E4F68C8008DE471 /* PasswordEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFB77A01E4F68C8008DE471 /* PasswordEntity.swift */; }; DCFB77A31E500D9C008DE471 /* PasswordDetailTitleTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = DCFB77A21E500D9C008DE471 /* PasswordDetailTitleTableViewCell.xib */; }; DCFB77A71E502DF9008DE471 /* EditPasswordTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFB77A61E502DF9008DE471 /* EditPasswordTableViewController.swift */; }; DCFB77A91E502FF6008DE471 /* PasswordEditorTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DCFB77A81E502FF6008DE471 /* PasswordEditorTableViewController.swift */; }; @@ -81,6 +88,27 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ + A26075821EEC6F34005DB03E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = DC917BCB1E2E8231000FDF54 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A26075771EEC6F34005DB03E; + remoteInfo = passKit; + }; + A26075841EEC6F34005DB03E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = DC917BCB1E2E8231000FDF54 /* Project object */; + proxyType = 1; + remoteGlobalIDString = DC917BD21E2E8231000FDF54; + remoteInfo = pass; + }; + A260758B1EEC6F34005DB03E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = DC917BCB1E2E8231000FDF54 /* Project object */; + proxyType = 1; + remoteGlobalIDString = A26075771EEC6F34005DB03E; + remoteInfo = passKit; + }; A267002C1EEC466A00176B8A /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = DC917BCB1E2E8231000FDF54 /* Project object */; @@ -98,6 +126,17 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + A26075921EEC6F34005DB03E /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + A260758E1EEC6F34005DB03E /* passKit.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; A26700191EEC450100176B8A /* Embed App Extensions */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -112,9 +151,29 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 274CCFCF32444A2FF46BE7F4 /* Pods-pass.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-pass.debug.xcconfig"; path = "Pods/Target Support Files/Pods-pass/Pods-pass.debug.xcconfig"; sourceTree = ""; }; + 1B240CA444AC9172F3053651 /* libPods-passextension.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-passextension.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 37527F98FA7BD9E603FAB2BE /* Pods-passextension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-passextension.release.xcconfig"; path = "Pods/Target Support Files/Pods-passextension/Pods-passextension.release.xcconfig"; sourceTree = ""; }; + 45BAA15189E80AA544EAF7AD /* libPods-passKit.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-passKit.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 6A8CB4D4311C90B380B99491 /* Pods-passextension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-passextension.debug.xcconfig"; path = "Pods/Target Support Files/Pods-passextension/Pods-passextension.debug.xcconfig"; sourceTree = ""; }; + 7592A214C22CEBBEF4596CC1 /* libPods-pass.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-pass.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 7E088A9255B6CB576EF757C1 /* Pods-passKit.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-passKit.debug.xcconfig"; path = "Pods/Target Support Files/Pods-passKit/Pods-passKit.debug.xcconfig"; sourceTree = ""; }; + A02ACA4077630047EA669D05 /* Pods-pass.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-pass.debug.xcconfig"; path = "Pods/Target Support Files/Pods-pass/Pods-pass.debug.xcconfig"; sourceTree = ""; }; A217ACE11E9AB17C00A1A6CF /* OTPScannerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OTPScannerController.swift; sourceTree = ""; }; A217ACE31E9BBBBD00A1A6CF /* GitConfigSettingTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = GitConfigSettingTableViewController.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; + A2227D4C1EEE5E25002A69A9 /* libObjectivePGP.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libObjectivePGP.a; path = "Pods/../build/Debug-iphoneos/ObjectivePGP/libObjectivePGP.a"; sourceTree = ""; }; + A2227D4E1EEE5E31002A69A9 /* libPods-pass.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-pass.a"; path = "Pods/../build/Debug-iphoneos/libPods-pass.a"; sourceTree = ""; }; + A2227D501EEE5E35002A69A9 /* libPods-passKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-passKit.a"; path = "Pods/../build/Debug-iphoneos/libPods-passKit.a"; sourceTree = ""; }; + A2227D521EEE5E46002A69A9 /* libPods-pass.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-pass.a"; path = "Pods/../build/Debug-iphoneos/libPods-pass.a"; sourceTree = ""; }; + A2227D541EEE5E78002A69A9 /* libObjectivePGP.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libObjectivePGP.a; path = "../../Library/Developer/Xcode/DerivedData/pass-fwlmfsjroyvbfhdyqmglrwfhvjli/Build/Products/Debug-iphonesimulator/ObjectivePGP/libObjectivePGP.a"; sourceTree = ""; }; + A2227D551EEE5E78002A69A9 /* libPods-pass.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-pass.a"; path = "../../Library/Developer/Xcode/DerivedData/pass-fwlmfsjroyvbfhdyqmglrwfhvjli/Build/Products/Debug-iphonesimulator/libPods-pass.a"; sourceTree = ""; }; + A2227D561EEE5E78002A69A9 /* libPods-passKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-passKit.a"; path = "../../Library/Developer/Xcode/DerivedData/pass-fwlmfsjroyvbfhdyqmglrwfhvjli/Build/Products/Debug-iphonesimulator/libPods-passKit.a"; sourceTree = ""; }; + A26075781EEC6F34005DB03E /* passKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = passKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A260757A1EEC6F34005DB03E /* passKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = passKit.h; sourceTree = ""; }; + A260757B1EEC6F34005DB03E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A26075801EEC6F34005DB03E /* passKitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = passKitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + A26075871EEC6F34005DB03E /* passKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = passKitTests.swift; sourceTree = ""; }; + A26075891EEC6F34005DB03E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + A26075A61EEC7125005DB03E /* pass.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = pass.xcdatamodel; sourceTree = ""; }; A262A58C1E68749C006B0890 /* Base32.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Base32.framework; path = Carthage/Build/iOS/Base32.framework; sourceTree = ""; }; A26700241EEC466A00176B8A /* passextension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = passextension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; A26700261EEC466A00176B8A /* ActionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActionViewController.swift; sourceTree = ""; }; @@ -124,13 +183,23 @@ A26700331EEC46C900176B8A /* passextension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = passextension.entitlements; sourceTree = ""; }; A26700341EEC475600176B8A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; A26700351EEC475600176B8A /* passProcessor.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = passProcessor.js; sourceTree = ""; }; - A27424D81E7C35960093F436 /* NotificationNames.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NotificationNames.swift; sourceTree = ""; }; A2802BF71E70813A00879216 /* SliderTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderTableViewCell.swift; sourceTree = ""; }; A2802BF81E70813A00879216 /* SliderTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SliderTableViewCell.xib; sourceTree = ""; }; + A2A61C0C1EEF8DFE00CFE063 /* libPods-passextension.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-passextension.a"; path = "../../Library/Developer/Xcode/DerivedData/pass-fwlmfsjroyvbfhdyqmglrwfhvjli/Build/Products/Debug-iphonesimulator/libPods-passextension.a"; sourceTree = ""; }; + A2A61C101EEF8E3500CFE063 /* libPods-passKit.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = "libPods-passKit.a"; path = "Pods/../build/Debug-iphoneos/libPods-passKit.a"; sourceTree = ""; }; A2A7813E1E97DBD9001311F5 /* QRScannerController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QRScannerController.swift; sourceTree = ""; }; - A2A89D681E954698003FB2D3 /* UITextFieldExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITextFieldExtension.swift; sourceTree = ""; }; - ADCE7A5C3CCC67D7D21BB3C4 /* libPods-pass.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-pass.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - AEAD6B31EAF5D061447A68CC /* Pods-pass.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-pass.release.xcconfig"; path = "Pods/Target Support Files/Pods-pass/Pods-pass.release.xcconfig"; sourceTree = ""; }; + A2BC54C71EEE5669001FAFBD /* Objective-CBridgingHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Objective-CBridgingHeader.h"; sourceTree = ""; }; + A2F4E2101EED800F0011986E /* GitCredential.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GitCredential.swift; path = Models/GitCredential.swift; sourceTree = ""; }; + A2F4E2111EED800F0011986E /* Password.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Password.swift; path = Models/Password.swift; sourceTree = ""; }; + A2F4E2121EED800F0011986E /* PasswordEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PasswordEntity.swift; path = Models/PasswordEntity.swift; sourceTree = ""; }; + A2F4E2131EED800F0011986E /* PasswordStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = PasswordStore.swift; path = Models/PasswordStore.swift; sourceTree = ""; }; + A2F4E2181EED80160011986E /* AppError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = AppError.swift; path = Helpers/AppError.swift; sourceTree = ""; }; + A2F4E2191EED80160011986E /* DefaultsKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = DefaultsKeys.swift; path = Helpers/DefaultsKeys.swift; sourceTree = ""; }; + A2F4E21A1EED80160011986E /* Globals.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Globals.swift; path = Helpers/Globals.swift; sourceTree = ""; }; + A2F4E21B1EED80160011986E /* NotificationNames.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NotificationNames.swift; path = Helpers/NotificationNames.swift; sourceTree = ""; }; + A2F4E21C1EED80160011986E /* UITextFieldExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = UITextFieldExtension.swift; path = Helpers/UITextFieldExtension.swift; sourceTree = ""; }; + A2F4E21D1EED80160011986E /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Utils.swift; path = Helpers/Utils.swift; sourceTree = ""; }; + CF68FFBE116027CB625ABD45 /* Pods-passKit.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-passKit.release.xcconfig"; path = "Pods/Target Support Files/Pods-passKit/Pods-passKit.release.xcconfig"; sourceTree = ""; }; DC037CA51E4B883900609409 /* OpenSourceComponentsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenSourceComponentsTableViewController.swift; sourceTree = ""; }; DC037CA71E4B898100609409 /* BasicStaticTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BasicStaticTableViewController.swift; sourceTree = ""; }; DC037CA91E4B8EAE00609409 /* SpecialThanksTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpecialThanksTableViewController.swift; sourceTree = ""; }; @@ -150,14 +219,11 @@ DC193FFB1E49E0340077E0A3 /* PasscodeLock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PasscodeLock.framework; path = Carthage/Build/iOS/PasscodeLock.framework; sourceTree = ""; }; DC193FFD1E49E0760077E0A3 /* PasscodeLockRepository.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasscodeLockRepository.swift; sourceTree = ""; }; DC193FFF1E49E1A60077E0A3 /* PasscodeLockConfiguration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasscodeLockConfiguration.swift; sourceTree = ""; }; - DC19400A1E4B36B60077E0A3 /* Utils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = ""; }; DC3E64E51E656F11009A83DE /* CommitLogsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommitLogsTableViewController.swift; sourceTree = ""; }; DC4914941E434301007FF592 /* LabelTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LabelTableViewCell.swift; sourceTree = ""; }; DC4914981E434600007FF592 /* PasswordDetailTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordDetailTableViewController.swift; sourceTree = ""; }; - DC4A746D1E30FBDE00E8EB18 /* Objective-CBridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Objective-CBridgingHeader.h"; sourceTree = ""; }; DC5734AD1E439AD400D09270 /* PasswordsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordsViewController.swift; sourceTree = ""; }; DC5F385A1E56AADB00C69ACA /* PGPKeyArmorSettingTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PGPKeyArmorSettingTableViewController.swift; sourceTree = ""; }; - DC7E6EE91E432E48006C2443 /* Password.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Password.swift; sourceTree = ""; }; DC8963BF1E38EEB900828B09 /* SSHKeySettingTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SSHKeySettingTableViewController.swift; sourceTree = ""; }; DC917BD31E2E8231000FDF54 /* pass.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = pass.app; sourceTree = BUILT_PRODUCTS_DIR; }; DC917BD61E2E8231000FDF54 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -167,39 +233,56 @@ DC917BE21E2E8231000FDF54 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DC962CDE1E4B62C10033B5D8 /* AboutTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AboutTableViewController.swift; sourceTree = ""; }; DCA049951E3357E000522E8F /* SwiftyUserDefaults.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftyUserDefaults.framework; path = Carthage/Build/iOS/SwiftyUserDefaults.framework; sourceTree = ""; }; - DCA049971E33586A00522E8F /* DefaultsKeys.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = DefaultsKeys.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DCA049991E335CC800522E8F /* GitServerSettingTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GitServerSettingTableViewController.swift; sourceTree = ""; }; DCA0499B1E3362F400522E8F /* PGPKeySettingTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PGPKeySettingTableViewController.swift; sourceTree = ""; }; - DCA0499D1E33BAC100522E8F /* Globals.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Globals.swift; sourceTree = ""; }; DCA671DE1E7A73B100D3ABE1 /* OneTimePassword.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OneTimePassword.framework; path = Carthage/Build/iOS/OneTimePassword.framework; sourceTree = ""; }; DCA742D91E599ED400D54E16 /* KeychainAccess.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KeychainAccess.framework; path = Carthage/Build/iOS/KeychainAccess.framework; sourceTree = ""; }; DCAAF7441E2FA66800AB94BC /* SettingsTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsTableViewController.swift; sourceTree = ""; }; - DCC408A31E2FCC9E00F29B0E /* PasswordStore.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; lineEnding = 0; path = PasswordStore.swift; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; DCC408C61E307DBB00F29B0E /* SVProgressHUD.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SVProgressHUD.framework; path = Carthage/Build/iOS/SVProgressHUD.framework; sourceTree = ""; }; - DCC408C91E30BA1300F29B0E /* pass.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = pass.xcdatamodel; sourceTree = ""; }; DCC441511E8F6C06008A90C4 /* RawPasswordViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RawPasswordViewController.swift; sourceTree = ""; }; DCC441531E916382008A90C4 /* GitSSHKeyArmorSettingTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GitSSHKeyArmorSettingTableViewController.swift; sourceTree = ""; }; - DCD9AD121EB678500093499A /* GitCredential.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GitCredential.swift; path = pass/Models/GitCredential.swift; sourceTree = SOURCE_ROOT; }; - DCD9AD141EB6829A0093499A /* AppError.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppError.swift; sourceTree = ""; }; DCDDEAAF1E4639F300F68193 /* LabelTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = LabelTableViewCell.xib; sourceTree = ""; }; DCDDEAB11E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordDetailTitleTableViewCell.swift; sourceTree = ""; }; DCFB77981E4F3BCF008DE471 /* TitleTextFieldTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TitleTextFieldTableViewCell.swift; sourceTree = ""; }; DCFB77991E4F3BCF008DE471 /* TitleTextFieldTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TitleTextFieldTableViewCell.xib; sourceTree = ""; }; DCFB779C1E4F40C7008DE471 /* FillPasswordTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FillPasswordTableViewCell.swift; sourceTree = ""; }; DCFB779D1E4F40C7008DE471 /* FillPasswordTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = FillPasswordTableViewCell.xib; sourceTree = ""; }; - DCFB77A01E4F68C8008DE471 /* PasswordEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordEntity.swift; sourceTree = ""; }; DCFB77A21E500D9C008DE471 /* PasswordDetailTitleTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PasswordDetailTitleTableViewCell.xib; sourceTree = ""; }; DCFB77A61E502DF9008DE471 /* EditPasswordTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditPasswordTableViewController.swift; sourceTree = ""; }; DCFB77A81E502FF6008DE471 /* PasswordEditorTableViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PasswordEditorTableViewController.swift; sourceTree = ""; }; DCFB77AA1E503729008DE471 /* ContentTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentTableViewCell.swift; sourceTree = ""; }; + E8E62D313271E34D1145C29D /* Pods-pass.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-pass.release.xcconfig"; path = "Pods/Target Support Files/Pods-pass/Pods-pass.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ + A26075741EEC6F34005DB03E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A2A61C121EEF8E4600CFE063 /* libObjectivePGP.a in Frameworks */, + 398A8F69C2230A8117820BB7 /* libPods-passKit.a in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A260757D1EEC6F34005DB03E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + A26075811EEC6F34005DB03E /* passKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; A26700211EEC466A00176B8A /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A26075721EEC6B8D005DB03E /* SwiftyUserDefaults.framework in Frameworks */, + A2A61C131EEF90CB00CFE063 /* Base32.framework in Frameworks */, + A2A61C151EEF90CB00CFE063 /* KeychainAccess.framework in Frameworks */, + A2A61C161EEF90CB00CFE063 /* ObjectiveGit.framework in Frameworks */, + A2A61C171EEF90CB00CFE063 /* OneTimePassword.framework in Frameworks */, + A2A61C1A1EEF90CB00CFE063 /* SwiftyUserDefaults.framework in Frameworks */, + A26075961EEC6F8C005DB03E /* passKit.framework in Frameworks */, + B87896CC4725EE267C66D891 /* libPods-passextension.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -214,21 +297,37 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - A262A58D1E68749C006B0890 /* Base32.framework in Frameworks */, - DCA671DF1E7A73B100D3ABE1 /* OneTimePassword.framework in Frameworks */, - DC037CAC1E4C1C7100609409 /* FavIcon.framework in Frameworks */, + A260758D1EEC6F34005DB03E /* passKit.framework in Frameworks */, DCC408C71E307DBB00F29B0E /* SVProgressHUD.framework in Frameworks */, - DCA742DA1E599ED400D54E16 /* KeychainAccess.framework in Frameworks */, DC193FFC1E49E0340077E0A3 /* PasscodeLock.framework in Frameworks */, - DC1208581E35EBE60042942E /* ObjectiveGit.framework in Frameworks */, - DCA049961E3357E000522E8F /* SwiftyUserDefaults.framework in Frameworks */, - 94BA784B85E071D25EE89B59 /* libPods-pass.a in Frameworks */, + 1473B150643891727EB85DFE /* libPods-pass.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + A26075791EEC6F34005DB03E /* passKit */ = { + isa = PBXGroup; + children = ( + A2F4E20E1EED7F040011986E /* Models */, + A26075A51EEC7125005DB03E /* pass.xcdatamodeld */, + A2F4E20F1EED7F0A0011986E /* Helpers */, + A260757A1EEC6F34005DB03E /* passKit.h */, + A260757B1EEC6F34005DB03E /* Info.plist */, + ); + path = passKit; + sourceTree = ""; + }; + A26075861EEC6F34005DB03E /* passKitTests */ = { + isa = PBXGroup; + children = ( + A26075871EEC6F34005DB03E /* passKitTests.swift */, + A26075891EEC6F34005DB03E /* Info.plist */, + ); + path = passKitTests; + sourceTree = ""; + }; A26700251EEC466A00176B8A /* passextension */ = { isa = PBXGroup; children = ( @@ -242,11 +341,39 @@ path = passextension; sourceTree = ""; }; + A2F4E20E1EED7F040011986E /* Models */ = { + isa = PBXGroup; + children = ( + A2F4E2101EED800F0011986E /* GitCredential.swift */, + A2F4E2111EED800F0011986E /* Password.swift */, + A2F4E2121EED800F0011986E /* PasswordEntity.swift */, + A2F4E2131EED800F0011986E /* PasswordStore.swift */, + ); + name = Models; + sourceTree = ""; + }; + A2F4E20F1EED7F0A0011986E /* Helpers */ = { + isa = PBXGroup; + children = ( + A2F4E2181EED80160011986E /* AppError.swift */, + A2F4E2191EED80160011986E /* DefaultsKeys.swift */, + A2F4E21A1EED80160011986E /* Globals.swift */, + A2F4E21B1EED80160011986E /* NotificationNames.swift */, + A2F4E21C1EED80160011986E /* UITextFieldExtension.swift */, + A2F4E21D1EED80160011986E /* Utils.swift */, + ); + name = Helpers; + sourceTree = ""; + }; A51B01737D08DB47BB58F85A /* Pods */ = { isa = PBXGroup; children = ( - 274CCFCF32444A2FF46BE7F4 /* Pods-pass.debug.xcconfig */, - AEAD6B31EAF5D061447A68CC /* Pods-pass.release.xcconfig */, + 7E088A9255B6CB576EF757C1 /* Pods-passKit.debug.xcconfig */, + CF68FFBE116027CB625ABD45 /* Pods-passKit.release.xcconfig */, + A02ACA4077630047EA669D05 /* Pods-pass.debug.xcconfig */, + E8E62D313271E34D1145C29D /* Pods-pass.release.xcconfig */, + 6A8CB4D4311C90B380B99491 /* Pods-passextension.debug.xcconfig */, + 37527F98FA7BD9E603FAB2BE /* Pods-passextension.release.xcconfig */, ); name = Pods; sourceTree = ""; @@ -293,12 +420,8 @@ DC19400D1E4B3A340077E0A3 /* Models */ = { isa = PBXGroup; children = ( - DC7E6EE91E432E48006C2443 /* Password.swift */, - DCFB77A01E4F68C8008DE471 /* PasswordEntity.swift */, - DCC408A31E2FCC9E00F29B0E /* PasswordStore.swift */, DC193FFF1E49E1A60077E0A3 /* PasscodeLockConfiguration.swift */, DC193FFD1E49E0760077E0A3 /* PasscodeLockRepository.swift */, - DCD9AD121EB678500093499A /* GitCredential.swift */, ); path = Models; sourceTree = ""; @@ -306,12 +429,7 @@ DC19400E1E4B3A610077E0A3 /* Helpers */ = { isa = PBXGroup; children = ( - DCA0499D1E33BAC100522E8F /* Globals.swift */, - DC4A746D1E30FBDE00E8EB18 /* Objective-CBridgingHeader.h */, - DCA049971E33586A00522E8F /* DefaultsKeys.swift */, - DC19400A1E4B36B60077E0A3 /* Utils.swift */, - A27424D81E7C35960093F436 /* NotificationNames.swift */, - A2A89D681E954698003FB2D3 /* UITextFieldExtension.swift */, + A2BC54C71EEE5669001FAFBD /* Objective-CBridgingHeader.h */, ); path = Helpers; sourceTree = ""; @@ -344,6 +462,8 @@ DC917BD51E2E8231000FDF54 /* pass */, DC13B14F1E8640810097803F /* passTests */, A26700251EEC466A00176B8A /* passextension */, + A26075791EEC6F34005DB03E /* passKit */, + A26075861EEC6F34005DB03E /* passKitTests */, DC917BD41E2E8231000FDF54 /* Products */, DC917BED1E2F38C4000FDF54 /* Frameworks */, A51B01737D08DB47BB58F85A /* Pods */, @@ -356,6 +476,8 @@ DC917BD31E2E8231000FDF54 /* pass.app */, DC13B14E1E8640810097803F /* passTests.xctest */, A26700241EEC466A00176B8A /* passextension.appex */, + A26075781EEC6F34005DB03E /* passKit.framework */, + A26075801EEC6F34005DB03E /* passKitTests.xctest */, ); name = Products; sourceTree = ""; @@ -366,7 +488,6 @@ A26700321EEC46C400176B8A /* pass.entitlements */, DC917BE21E2E8231000FDF54 /* Info.plist */, DC917BD61E2E8231000FDF54 /* AppDelegate.swift */, - DCD9AD141EB6829A0093499A /* AppError.swift */, DC19400D1E4B3A340077E0A3 /* Models */, DC19400C1E4B39400077E0A3 /* Controllers */, DC19400F1E4B3A9E0077E0A3 /* Views */, @@ -374,7 +495,6 @@ DC917BDD1E2E8231000FDF54 /* Assets.xcassets */, DC917BDF1E2E8231000FDF54 /* LaunchScreen.storyboard */, DC917BDA1E2E8231000FDF54 /* Main.storyboard */, - DCC408C81E30BA1300F29B0E /* pass.xcdatamodeld */, ); path = pass; sourceTree = ""; @@ -382,6 +502,15 @@ DC917BED1E2F38C4000FDF54 /* Frameworks */ = { isa = PBXGroup; children = ( + A2A61C101EEF8E3500CFE063 /* libPods-passKit.a */, + A2A61C0C1EEF8DFE00CFE063 /* libPods-passextension.a */, + A2227D541EEE5E78002A69A9 /* libObjectivePGP.a */, + A2227D551EEE5E78002A69A9 /* libPods-pass.a */, + A2227D561EEE5E78002A69A9 /* libPods-passKit.a */, + A2227D521EEE5E46002A69A9 /* libPods-pass.a */, + A2227D501EEE5E35002A69A9 /* libPods-passKit.a */, + A2227D4E1EEE5E31002A69A9 /* libPods-pass.a */, + A2227D4C1EEE5E25002A69A9 /* libObjectivePGP.a */, DCA671DE1E7A73B100D3ABE1 /* OneTimePassword.framework */, A262A58C1E68749C006B0890 /* Base32.framework */, DCA742D91E599ED400D54E16 /* KeychainAccess.framework */, @@ -390,21 +519,75 @@ DC1208571E35EBE60042942E /* ObjectiveGit.framework */, DCA049951E3357E000522E8F /* SwiftyUserDefaults.framework */, DCC408C61E307DBB00F29B0E /* SVProgressHUD.framework */, - ADCE7A5C3CCC67D7D21BB3C4 /* libPods-pass.a */, + 7592A214C22CEBBEF4596CC1 /* libPods-pass.a */, + 45BAA15189E80AA544EAF7AD /* libPods-passKit.a */, + 1B240CA444AC9172F3053651 /* libPods-passextension.a */, ); name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + A26075751EEC6F34005DB03E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + A260758A1EEC6F34005DB03E /* passKit.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ + A26075771EEC6F34005DB03E /* passKit */ = { + isa = PBXNativeTarget; + buildConfigurationList = A260758F1EEC6F34005DB03E /* Build configuration list for PBXNativeTarget "passKit" */; + buildPhases = ( + 736C6F64F90A20CB9A00B420 /* [CP] Check Pods Manifest.lock */, + A26075731EEC6F34005DB03E /* Sources */, + A26075741EEC6F34005DB03E /* Frameworks */, + A26075751EEC6F34005DB03E /* Headers */, + A26075761EEC6F34005DB03E /* Resources */, + FF64BAA847392A8690167C10 /* [CP] Copy Pods Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = passKit; + productName = passKit; + productReference = A26075781EEC6F34005DB03E /* passKit.framework */; + productType = "com.apple.product-type.framework"; + }; + A260757F1EEC6F34005DB03E /* passKitTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = A26075931EEC6F34005DB03E /* Build configuration list for PBXNativeTarget "passKitTests" */; + buildPhases = ( + A260757C1EEC6F34005DB03E /* Sources */, + A260757D1EEC6F34005DB03E /* Frameworks */, + A260757E1EEC6F34005DB03E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + A26075831EEC6F34005DB03E /* PBXTargetDependency */, + A26075851EEC6F34005DB03E /* PBXTargetDependency */, + ); + name = passKitTests; + productName = passKitTests; + productReference = A26075801EEC6F34005DB03E /* passKitTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; A26700231EEC466A00176B8A /* passextension */ = { isa = PBXNativeTarget; buildConfigurationList = A267002F1EEC466A00176B8A /* Build configuration list for PBXNativeTarget "passextension" */; buildPhases = ( + 833CCF07B581A19455BFF5A2 /* [CP] Check Pods Manifest.lock */, A26700201EEC466A00176B8A /* Sources */, A26700211EEC466A00176B8A /* Frameworks */, A26700221EEC466A00176B8A /* Resources */, + E5679233A0ECC12219075B5C /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -437,19 +620,21 @@ isa = PBXNativeTarget; buildConfigurationList = DC917BE51E2E8231000FDF54 /* Build configuration list for PBXNativeTarget "pass" */; buildPhases = ( - 68560E350F5EA82DA480749C /* [CP] Check Pods Manifest.lock */, + 3D4E80016BEE92B70CE75405 /* [CP] Check Pods Manifest.lock */, DC917BCF1E2E8231000FDF54 /* Sources */, DC917BD01E2E8231000FDF54 /* Frameworks */, DC917BD11E2E8231000FDF54 /* Resources */, DC917BEC1E2F3659000FDF54 /* Run Script */, - 58F20B5DB8A41D610AF2145E /* [CP] Embed Pods Frameworks */, - D5AA0953A6BB441CE2390DE3 /* [CP] Copy Pods Resources */, A26700191EEC450100176B8A /* Embed App Extensions */, + A26075921EEC6F34005DB03E /* Embed Frameworks */, + 3DF553C0C5F39FA193B9C51E /* [CP] Embed Pods Frameworks */, + 580D1C34CDA2A82CF3A4A987 /* [CP] Copy Pods Resources */, ); buildRules = ( ); dependencies = ( A267002D1EEC466A00176B8A /* PBXTargetDependency */, + A260758C1EEC6F34005DB03E /* PBXTargetDependency */, ); name = pass; productName = pass; @@ -466,6 +651,17 @@ LastUpgradeCheck = 0820; ORGANIZATIONNAME = "Bob Sun"; TargetAttributes = { + A26075771EEC6F34005DB03E = { + CreatedOnToolsVersion = 8.3.3; + DevelopmentTeam = 4WDM8E95VU; + LastSwiftMigration = 0830; + ProvisioningStyle = Automatic; + }; + A260757F1EEC6F34005DB03E = { + CreatedOnToolsVersion = 8.3.3; + ProvisioningStyle = Automatic; + TestTargetID = DC917BD21E2E8231000FDF54; + }; A26700231EEC466A00176B8A = { CreatedOnToolsVersion = 8.3.3; DevelopmentTeam = 4WDM8E95VU; @@ -510,11 +706,27 @@ DC917BD21E2E8231000FDF54 /* pass */, DC13B14D1E8640810097803F /* passTests */, A26700231EEC466A00176B8A /* passextension */, + A26075771EEC6F34005DB03E /* passKit */, + A260757F1EEC6F34005DB03E /* passKitTests */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ + A26075761EEC6F34005DB03E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A260757E1EEC6F34005DB03E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; A26700221EEC466A00176B8A /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -552,22 +764,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 58F20B5DB8A41D610AF2145E /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-pass/Pods-pass-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 68560E350F5EA82DA480749C /* [CP] Check Pods Manifest.lock */ = { + 3D4E80016BEE92B70CE75405 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -582,7 +779,22 @@ shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; showEnvVarsInLog = 0; }; - D5AA0953A6BB441CE2390DE3 /* [CP] Copy Pods Resources */ = { + 3DF553C0C5F39FA193B9C51E /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-pass/Pods-pass-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + 580D1C34CDA2A82CF3A4A987 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -597,6 +809,36 @@ shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-pass/Pods-pass-resources.sh\"\n"; showEnvVarsInLog = 0; }; + 736C6F64F90A20CB9A00B420 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; + 833CCF07B581A19455BFF5A2 /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + showEnvVarsInLog = 0; + }; DC917BEC1E2F3659000FDF54 /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 12; @@ -619,9 +861,65 @@ shellPath = /bin/sh; shellScript = "/usr/local/bin/carthage copy-frameworks"; }; + E5679233A0ECC12219075B5C /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-passextension/Pods-passextension-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; + FF64BAA847392A8690167C10 /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "[CP] Copy Pods Resources"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-passKit/Pods-passKit-resources.sh\"\n"; + showEnvVarsInLog = 0; + }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ + A26075731EEC6F34005DB03E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A2F4E2151EED800F0011986E /* Password.swift in Sources */, + A26075AD1EEC7125005DB03E /* pass.xcdatamodeld in Sources */, + A2F4E21E1EED80160011986E /* AppError.swift in Sources */, + A2F4E2171EED800F0011986E /* PasswordStore.swift in Sources */, + A2F4E2211EED80160011986E /* NotificationNames.swift in Sources */, + A2F4E2221EED80160011986E /* UITextFieldExtension.swift in Sources */, + A2F4E2201EED80160011986E /* Globals.swift in Sources */, + A2F4E2231EED80160011986E /* Utils.swift in Sources */, + A2F4E21F1EED80160011986E /* DefaultsKeys.swift in Sources */, + A2F4E2141EED800F0011986E /* GitCredential.swift in Sources */, + A2F4E2161EED800F0011986E /* PasswordEntity.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + A260757C1EEC6F34005DB03E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + A26075881EEC6F34005DB03E /* passKitTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; A26700201EEC466A00176B8A /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -642,29 +940,23 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - DCC408A41E2FCC9E00F29B0E /* PasswordStore.swift in Sources */, DC037CBF1E4ED4E100609409 /* TextViewTableViewCell.swift in Sources */, - DCD9AD151EB6829A0093499A /* AppError.swift in Sources */, DCC441541E916382008A90C4 /* GitSSHKeyArmorSettingTableViewController.swift in Sources */, DC8963C01E38EEB900828B09 /* SSHKeySettingTableViewController.swift in Sources */, DC193FFA1E49B4430077E0A3 /* AdvancedSettingsTableViewController.swift in Sources */, DCFB77AB1E503729008DE471 /* ContentTableViewCell.swift in Sources */, DCA0499C1E3362F400522E8F /* PGPKeySettingTableViewController.swift in Sources */, - DC7E6EEA1E432E48006C2443 /* Password.swift in Sources */, DC4914961E434301007FF592 /* LabelTableViewCell.swift in Sources */, DC5F385B1E56AADB00C69ACA /* PGPKeyArmorSettingTableViewController.swift in Sources */, - A27424D91E7C35960093F436 /* NotificationNames.swift in Sources */, DCAAF7451E2FA66800AB94BC /* SettingsTableViewController.swift in Sources */, A217ACE21E9AB17C00A1A6CF /* OTPScannerController.swift in Sources */, DCFB77A71E502DF9008DE471 /* EditPasswordTableViewController.swift in Sources */, DCA0499A1E335CC800522E8F /* GitServerSettingTableViewController.swift in Sources */, DCDDEAB31E4896BF00F68193 /* PasswordDetailTitleTableViewCell.swift in Sources */, A2A7813F1E97DBD9001311F5 /* QRScannerController.swift in Sources */, - DCC277D21E30D6EA00402246 /* pass.xcdatamodeld in Sources */, DC4914991E434600007FF592 /* PasswordDetailTableViewController.swift in Sources */, DC962CDF1E4B62C10033B5D8 /* AboutTableViewController.swift in Sources */, DC5734AE1E439AD400D09270 /* PasswordsViewController.swift in Sources */, - DCD9AD131EB678500093499A /* GitCredential.swift in Sources */, DC3E64E61E656F11009A83DE /* CommitLogsTableViewController.swift in Sources */, DC037CAA1E4B8EAE00609409 /* SpecialThanksTableViewController.swift in Sources */, DC037CA61E4B883900609409 /* OpenSourceComponentsTableViewController.swift in Sources */, @@ -679,13 +971,8 @@ DC1940001E49E1A60077E0A3 /* PasscodeLockConfiguration.swift in Sources */, DC917BD71E2E8231000FDF54 /* AppDelegate.swift in Sources */, DCFB779A1E4F3BCF008DE471 /* TitleTextFieldTableViewCell.swift in Sources */, - A2A89D691E954698003FB2D3 /* UITextFieldExtension.swift in Sources */, DC037CBB1E4DD47B00609409 /* TextFieldTableViewCell.swift in Sources */, DC193FFE1E49E0760077E0A3 /* PasscodeLockRepository.swift in Sources */, - DCA049981E33586A00522E8F /* DefaultsKeys.swift in Sources */, - DC19400B1E4B36B60077E0A3 /* Utils.swift in Sources */, - DCA0499E1E33BAC100522E8F /* Globals.swift in Sources */, - DCFB77A11E4F68C8008DE471 /* PasswordEntity.swift in Sources */, DCFB77A91E502FF6008DE471 /* PasswordEditorTableViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -693,6 +980,21 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ + A26075831EEC6F34005DB03E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A26075771EEC6F34005DB03E /* passKit */; + targetProxy = A26075821EEC6F34005DB03E /* PBXContainerItemProxy */; + }; + A26075851EEC6F34005DB03E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = DC917BD21E2E8231000FDF54 /* pass */; + targetProxy = A26075841EEC6F34005DB03E /* PBXContainerItemProxy */; + }; + A260758C1EEC6F34005DB03E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = A26075771EEC6F34005DB03E /* passKit */; + targetProxy = A260758B1EEC6F34005DB03E /* PBXContainerItemProxy */; + }; A267002D1EEC466A00176B8A /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A26700231EEC466A00176B8A /* passextension */; @@ -733,10 +1035,135 @@ /* End PBXVariantGroup section */ /* Begin XCBuildConfiguration section */ - A26700301EEC466A00176B8A /* Debug */ = { + A26075901EEC6F34005DB03E /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7E088A9255B6CB576EF757C1 /* Pods-passKit.debug.xcconfig */; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 4WDM8E95VU; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + HEADER_SEARCH_PATHS = ( + "${inherited}", + "$(SRCROOT)/Carthage/Build/iOS/ObjectiveGit.framework/Headers/", + ); + INFOPLIST_FILE = passKit/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/build/Debug-iphoneos/ObjectivePGP", + "$(PROJECT_DIR)/build/Debug-iphoneos", + ); + MODULEMAP_FILE = ""; + OTHER_LDFLAGS = "$(inherited)"; + PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passforios.passKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_INCLUDE_PATHS = ""; + SWIFT_OBJC_BRIDGING_HEADER = ""; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + A26075911EEC6F34005DB03E /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = CF68FFBE116027CB625ABD45 /* Pods-passKit.release.xcconfig */; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_ENABLE_MODULES = YES; + CODE_SIGN_IDENTITY = ""; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 4WDM8E95VU; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + HEADER_SEARCH_PATHS = ( + "${inherited}", + "$(SRCROOT)/Carthage/Build/iOS/ObjectiveGit.framework/Headers/", + ); + INFOPLIST_FILE = passKit/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 10.2; + LD_RUNPATH_SEARCH_PATHS = "$(inherited)"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/build/Debug-iphoneos/ObjectivePGP", + "$(PROJECT_DIR)/build/Debug-iphoneos", + ); + MODULEMAP_FILE = ""; + OTHER_LDFLAGS = "$(inherited)"; + PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passforios.passKit; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_INCLUDE_PATHS = ""; + SWIFT_OBJC_BRIDGING_HEADER = ""; + SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + A26075941EEC6F34005DB03E /* Debug */ = { isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + INFOPLIST_FILE = passKitTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passforios.passKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/pass.app/pass"; + }; + name = Debug; + }; + A26075951EEC6F34005DB03E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + INFOPLIST_FILE = passKitTests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passforios.passKitTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 3.0; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/pass.app/pass"; + }; + name = Release; + }; + A26700301EEC466A00176B8A /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 6A8CB4D4311C90B380B99491 /* Pods-passextension.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = passextension/passextension.entitlements; DEVELOPMENT_TEAM = 4WDM8E95VU; @@ -744,6 +1171,10 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); + HEADER_SEARCH_PATHS = ( + "${inherited}", + "$(SRCROOT)/Carthage/Build/iOS/ObjectiveGit.framework/Headers/", + ); INFOPLIST_FILE = passextension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; @@ -756,8 +1187,10 @@ }; A26700311EEC466A00176B8A /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 37527F98FA7BD9E603FAB2BE /* Pods-passextension.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CODE_SIGN_ENTITLEMENTS = passextension/passextension.entitlements; DEVELOPMENT_TEAM = 4WDM8E95VU; @@ -765,6 +1198,10 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); + HEADER_SEARCH_PATHS = ( + "${inherited}", + "$(SRCROOT)/Carthage/Build/iOS/ObjectiveGit.framework/Headers/", + ); INFOPLIST_FILE = passextension/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @executable_path/../../Frameworks"; @@ -900,10 +1337,11 @@ }; DC917BE61E2E8231000FDF54 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 274CCFCF32444A2FF46BE7F4 /* Pods-pass.debug.xcconfig */; + baseConfigurationReference = A02ACA4077630047EA669D05 /* Pods-pass.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CODE_SIGN_ENTITLEMENTS = pass/pass.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CURRENT_PROJECT_VERSION = 2; @@ -922,11 +1360,17 @@ ); INFOPLIST_FILE = pass/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$PODS_CONFIGURATION_BUILD_DIR/ObjectivePGP\"", + "\"${PODS_ROOT}/OpenSSL-Universal/lib-ios\"", + ); + OTHER_LDFLAGS = "${inherited}"; PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passforios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = "893c10b3-79b1-46f7-914a-e625bf10d665"; PROVISIONING_PROFILE_SPECIFIER = "match Development me.mssun.passforios"; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/pass/Helpers/Objective-CBridgingHeader.h"; + SWIFT_OBJC_BRIDGING_HEADER = "pass/Helpers/Objective-CBridgingHeader.h"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -935,10 +1379,11 @@ }; DC917BE71E2E8231000FDF54 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = AEAD6B31EAF5D061447A68CC /* Pods-pass.release.xcconfig */; + baseConfigurationReference = E8E62D313271E34D1145C29D /* Pods-pass.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = NO; CODE_SIGN_ENTITLEMENTS = pass/pass.entitlements; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; CURRENT_PROJECT_VERSION = 2; @@ -957,11 +1402,19 @@ ); INFOPLIST_FILE = pass/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "\"$PODS_CONFIGURATION_BUILD_DIR/ObjectivePGP\"", + "\"${PODS_ROOT}/OpenSSL-Universal/lib-ios\"", + "$(PROJECT_DIR)/build/Debug-iphoneos/ObjectivePGP", + "$(PROJECT_DIR)/build/Debug-iphoneos", + ); + OTHER_LDFLAGS = "${inherited}"; PRODUCT_BUNDLE_IDENTIFIER = me.mssun.passforios; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = "aefeea85-1194-4db2-9ce4-fb9995e2fdff"; PROVISIONING_PROFILE_SPECIFIER = "match AppStore me.mssun.passforios"; - SWIFT_OBJC_BRIDGING_HEADER = "$(SRCROOT)/pass/Helpers/Objective-CBridgingHeader.h"; + SWIFT_OBJC_BRIDGING_HEADER = "pass/Helpers/Objective-CBridgingHeader.h"; SWIFT_VERSION = 3.0; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; @@ -971,6 +1424,24 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ + A260758F1EEC6F34005DB03E /* Build configuration list for PBXNativeTarget "passKit" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A26075901EEC6F34005DB03E /* Debug */, + A26075911EEC6F34005DB03E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + A26075931EEC6F34005DB03E /* Build configuration list for PBXNativeTarget "passKitTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + A26075941EEC6F34005DB03E /* Debug */, + A26075951EEC6F34005DB03E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; A267002F1EEC466A00176B8A /* Build configuration list for PBXNativeTarget "passextension" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -1010,12 +1481,12 @@ /* End XCConfigurationList section */ /* Begin XCVersionGroup section */ - DCC408C81E30BA1300F29B0E /* pass.xcdatamodeld */ = { + A26075A51EEC7125005DB03E /* pass.xcdatamodeld */ = { isa = XCVersionGroup; children = ( - DCC408C91E30BA1300F29B0E /* pass.xcdatamodel */, + A26075A61EEC7125005DB03E /* pass.xcdatamodel */, ); - currentVersion = DCC408C91E30BA1300F29B0E /* pass.xcdatamodel */; + currentVersion = A26075A61EEC7125005DB03E /* pass.xcdatamodel */; path = pass.xcdatamodeld; sourceTree = ""; versionGroupType = wrapper.xcdatamodel; diff --git a/pass.xcodeproj/xcshareddata/xcschemes/pass.xcscheme b/pass.xcodeproj/xcshareddata/xcschemes/pass.xcscheme deleted file mode 100644 index 95834d6..0000000 --- a/pass.xcodeproj/xcshareddata/xcschemes/pass.xcscheme +++ /dev/null @@ -1,108 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pass/AppDelegate.swift b/pass/AppDelegate.swift index 23b2f09..0bc7b8a 100644 --- a/pass/AppDelegate.swift +++ b/pass/AppDelegate.swift @@ -10,6 +10,7 @@ import UIKit import CoreData import PasscodeLock import SVProgressHUD +import passKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { @@ -20,7 +21,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } lazy var passcodeLockPresenter: PasscodeLockPresenter = { - let presenter = PasscodeLockPresenter(mainWindow: self.window, configuration: Globals.passcodeConfiguration) + let presenter = PasscodeLockPresenter(mainWindow: self.window, configuration: PasscodeLockConfiguration.shared) return presenter }() @@ -29,9 +30,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { SVProgressHUD.setMinimumSize(CGSize(width: 150, height: 100)) passcodeLockPresenter.present() if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsKey.shortcutItem] as? UIApplicationShortcutItem { - var searchType = Bundle.main.bundleIdentifier! - searchType.append(".search") - if shortcutItem.type == searchType { + if shortcutItem.type == Globals.bundleIdentifier + ".search" { self.perform(#selector(postSearchNotification), with: nil, afterDelay: 0.4) } } @@ -44,9 +43,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { } func application(_ application: UIApplication, performActionFor shortcutItem: UIApplicationShortcutItem, completionHandler: @escaping (Bool) -> Void) { - var searchType = Bundle.main.bundleIdentifier! - searchType.append(".search") - if shortcutItem.type == searchType { + if shortcutItem.type == Globals.bundleIdentifier + ".search" { let tabBarController = self.window!.rootViewController as! UITabBarController tabBarController.selectedIndex = 0 let navigationController = tabBarController.selectedViewController as! UINavigationController @@ -112,9 +109,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate { application to it. This property is optional since there are legitimate error conditions that could cause the creation of the store to fail. */ - let container = NSPersistentContainer(name: "pass") - let description = NSPersistentStoreDescription(url: Globals.sharedContainerURL) - container.loadPersistentStores(completionHandler: { (description, error) in + let modelURL = Bundle(identifier: Globals.passKitBundleIdentifier)!.url(forResource: "pass", withExtension: "momd")! + let managedObjectModel = NSManagedObjectModel(contentsOf: modelURL) + let container = NSPersistentContainer(name: "pass", managedObjectModel: managedObjectModel!) + container.persistentStoreDescriptions = [NSPersistentStoreDescription(url: Globals.sharedContainerURL.appendingPathComponent("Documents/pass.sqlite"))] + container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. diff --git a/pass/Controllers/AboutRepositoryTableViewController.swift b/pass/Controllers/AboutRepositoryTableViewController.swift index f8ee300..6db2a4f 100644 --- a/pass/Controllers/AboutRepositoryTableViewController.swift +++ b/pass/Controllers/AboutRepositoryTableViewController.swift @@ -7,6 +7,7 @@ // import UIKit +import passKit class AboutRepositoryTableViewController: BasicStaticTableViewController { diff --git a/pass/Controllers/AddPasswordTableViewController.swift b/pass/Controllers/AddPasswordTableViewController.swift index 1569380..cc82e85 100644 --- a/pass/Controllers/AddPasswordTableViewController.swift +++ b/pass/Controllers/AddPasswordTableViewController.swift @@ -7,7 +7,7 @@ // import UIKit -import SwiftyUserDefaults +import passKit class AddPasswordTableViewController: PasswordEditorTableViewController { var tempContent: String = "" @@ -20,7 +20,7 @@ class AddPasswordTableViewController: PasswordEditorTableViewController { [[.type: PasswordEditorCellType.additionsCell, .title: "additions"]], [[.type: PasswordEditorCellType.scanQRCodeCell]] ] - if let lengthSetting = Globals.passwordDefaultLength[Defaults[.passwordGeneratorFlavor]], + if let lengthSetting = Globals.passwordDefaultLength[SharedDefaults[.passwordGeneratorFlavor]], lengthSetting.max > lengthSetting.min { tableData[1].append([.type: PasswordEditorCellType.passwordLengthCell, .title: "passwordlength"]) } diff --git a/pass/Controllers/AdvancedSettingsTableViewController.swift b/pass/Controllers/AdvancedSettingsTableViewController.swift index ee2fd8a..5f9e0e5 100644 --- a/pass/Controllers/AdvancedSettingsTableViewController.swift +++ b/pass/Controllers/AdvancedSettingsTableViewController.swift @@ -8,7 +8,7 @@ import UIKit import SVProgressHUD -import SwiftyUserDefaults +import passKit class AdvancedSettingsTableViewController: UITableViewController { @@ -28,7 +28,7 @@ class AdvancedSettingsTableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() - encryptInASCIIArmoredSwitch.isOn = Defaults[.encryptInArmored] + encryptInASCIIArmoredSwitch.isOn = SharedDefaults[.encryptInArmored] encryptInASCIIArmoredTableViewCell.accessoryView = encryptInASCIIArmoredSwitch encryptInASCIIArmoredTableViewCell.selectionStyle = .none setGitSignatureText() @@ -39,7 +39,7 @@ class AdvancedSettingsTableViewController: UITableViewController { let gitSignatureEmail = passwordStore.gitSignatureForNow.email! self.gitSignatureTableViewCell.detailTextLabel?.font = UIFont.systemFont(ofSize: 14) self.gitSignatureTableViewCell.detailTextLabel?.text = "\(gitSignatureName) <\(gitSignatureEmail)>" - if Defaults[.gitSignatureName] == nil && Defaults[.gitSignatureEmail] == nil { + if SharedDefaults[.gitSignatureName] == nil && SharedDefaults[.gitSignatureEmail] == nil { self.gitSignatureTableViewCell.detailTextLabel?.font = UIFont.systemFont(ofSize: 17) gitSignatureTableViewCell.detailTextLabel?.text = "Not Set" } @@ -85,7 +85,7 @@ class AdvancedSettingsTableViewController: UITableViewController { } func encryptInASCIIArmoredAction(_ sender: Any?) { - Defaults[.encryptInArmored] = encryptInASCIIArmoredSwitch.isOn + SharedDefaults[.encryptInArmored] = encryptInASCIIArmoredSwitch.isOn } @IBAction func cancelGitConfigSetting(segue: UIStoryboardSegue) { @@ -95,8 +95,8 @@ class AdvancedSettingsTableViewController: UITableViewController { if let controller = segue.source as? GitConfigSettingTableViewController { if let gitSignatureName = controller.nameTextField.text, let gitSignatureEmail = controller.emailTextField.text { - Defaults[.gitSignatureName] = gitSignatureName.isEmpty ? nil : gitSignatureName - Defaults[.gitSignatureEmail] = gitSignatureEmail.isEmpty ? nil : gitSignatureEmail + SharedDefaults[.gitSignatureName] = gitSignatureName.isEmpty ? nil : gitSignatureName + SharedDefaults[.gitSignatureEmail] = gitSignatureEmail.isEmpty ? nil : gitSignatureEmail } setGitSignatureText() } diff --git a/pass/Controllers/BasicStaticTableViewController.swift b/pass/Controllers/BasicStaticTableViewController.swift index 6e975ee..86512fc 100644 --- a/pass/Controllers/BasicStaticTableViewController.swift +++ b/pass/Controllers/BasicStaticTableViewController.swift @@ -9,6 +9,7 @@ import UIKit import SafariServices import MessageUI +import passKit enum CellDataType { diff --git a/pass/Controllers/CommitLogsTableViewController.swift b/pass/Controllers/CommitLogsTableViewController.swift index dbe90ce..7aa4c8b 100644 --- a/pass/Controllers/CommitLogsTableViewController.swift +++ b/pass/Controllers/CommitLogsTableViewController.swift @@ -8,6 +8,7 @@ import UIKit import ObjectiveGit +import passKit class CommitLogsTableViewController: UITableViewController { var commits: [GTCommit] = [] diff --git a/pass/Controllers/EditPasswordTableViewController.swift b/pass/Controllers/EditPasswordTableViewController.swift index 6deaae7..ade537b 100644 --- a/pass/Controllers/EditPasswordTableViewController.swift +++ b/pass/Controllers/EditPasswordTableViewController.swift @@ -7,7 +7,7 @@ // import UIKit -import SwiftyUserDefaults +import passKit class EditPasswordTableViewController: PasswordEditorTableViewController { override func viewDidLoad() { @@ -18,7 +18,7 @@ class EditPasswordTableViewController: PasswordEditorTableViewController { [[.type: PasswordEditorCellType.scanQRCodeCell], [.type: PasswordEditorCellType.deletePasswordCell]] ] - if let lengthSetting = Globals.passwordDefaultLength[Defaults[.passwordGeneratorFlavor]], + if let lengthSetting = Globals.passwordDefaultLength[SharedDefaults[.passwordGeneratorFlavor]], lengthSetting.max > lengthSetting.min { tableData[1].append([.type: PasswordEditorCellType.passwordLengthCell, .title: "passwordlength"]) } diff --git a/pass/Controllers/GeneralSettingsTableViewController.swift b/pass/Controllers/GeneralSettingsTableViewController.swift index 686fe1d..a299250 100644 --- a/pass/Controllers/GeneralSettingsTableViewController.swift +++ b/pass/Controllers/GeneralSettingsTableViewController.swift @@ -7,7 +7,7 @@ // import UIKit -import SwiftyUserDefaults +import passKit class GeneralSettingsTableViewController: BasicStaticTableViewController { let passwordStore = PasswordStore.shared @@ -33,7 +33,7 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { uiSwitch.onTintColor = Globals.blue uiSwitch.sizeToFit() uiSwitch.addTarget(self, action: #selector(rememberPassphraseSwitchAction(_:)), for: UIControlEvents.valueChanged) - uiSwitch.isOn = Defaults[.isRememberPassphraseOn] + uiSwitch.isOn = SharedDefaults[.isRememberPassphraseOn] return uiSwitch }() @@ -42,7 +42,7 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { uiSwitch.onTintColor = Globals.blue uiSwitch.sizeToFit() uiSwitch.addTarget(self, action: #selector(showFolderSwitchAction(_:)), for: UIControlEvents.valueChanged) - uiSwitch.isOn = Defaults[.isShowFolderOn] + uiSwitch.isOn = SharedDefaults[.isShowFolderOn] return uiSwitch }() @@ -85,7 +85,7 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { accessoryView.addSubview(hideUnknownSwitch) cell.accessoryView = accessoryView cell.selectionStyle = .none - hideUnknownSwitch.isOn = Defaults[.isHideUnknownOn] + hideUnknownSwitch.isOn = SharedDefaults[.isHideUnknownOn] case "Hide OTP Fields": cell.accessoryType = .none let detailButton = UIButton(type: .detailDisclosure) @@ -97,7 +97,7 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { accessoryView.addSubview(hideOTPSwitch) cell.accessoryView = accessoryView cell.selectionStyle = .none - hideOTPSwitch.isOn = Defaults[.isHideOTPOn] + hideOTPSwitch.isOn = SharedDefaults[.isHideOTPOn] case "Remember Passphrase": cell.accessoryType = .none cell.selectionStyle = .none @@ -108,7 +108,7 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { cell.accessoryView = showFolderSwitch case "Password Generator Flavor": cell.accessoryType = .disclosureIndicator - cell.detailTextLabel?.text = Defaults[.passwordGeneratorFlavor] + cell.detailTextLabel?.text = SharedDefaults[.passwordGeneratorFlavor] default: break } return cell @@ -127,7 +127,7 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) var randomFlavorActionTitle = "" var appleFlavorActionTitle = "" - if Defaults[.passwordGeneratorFlavor] == "Random" { + if SharedDefaults[.passwordGeneratorFlavor] == "Random" { randomFlavorActionTitle = "✓ Random String" appleFlavorActionTitle = "Apple's Keychain Style" } else { @@ -135,12 +135,12 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { appleFlavorActionTitle = "✓ Apple's Keychain Style" } let randomFlavorAction = UIAlertAction(title: randomFlavorActionTitle, style: .default) { _ in - Defaults[.passwordGeneratorFlavor] = "Random" + SharedDefaults[.passwordGeneratorFlavor] = "Random" sourceCell.detailTextLabel?.text = "Random" } let appleFlavorAction = UIAlertAction(title: appleFlavorActionTitle, style: .default) { _ in - Defaults[.passwordGeneratorFlavor] = "Apple" + SharedDefaults[.passwordGeneratorFlavor] = "Apple" sourceCell.detailTextLabel?.text = "Apple" } @@ -167,24 +167,24 @@ class GeneralSettingsTableViewController: BasicStaticTableViewController { } func hideUnknownSwitchAction(_ sender: Any?) { - Defaults[.isHideUnknownOn] = hideUnknownSwitch.isOn + SharedDefaults[.isHideUnknownOn] = hideUnknownSwitch.isOn NotificationCenter.default.post(name: .passwordDetailDisplaySettingChanged, object: nil) } func hideOTPSwitchAction(_ sender: Any?) { - Defaults[.isHideOTPOn] = hideOTPSwitch.isOn + SharedDefaults[.isHideOTPOn] = hideOTPSwitch.isOn NotificationCenter.default.post(name: .passwordDetailDisplaySettingChanged, object: nil) } func rememberPassphraseSwitchAction(_ sender: Any?) { - Defaults[.isRememberPassphraseOn] = rememberPassphraseSwitch.isOn + SharedDefaults[.isRememberPassphraseOn] = rememberPassphraseSwitch.isOn if rememberPassphraseSwitch.isOn == false { passwordStore.pgpKeyPassphrase = nil } } func showFolderSwitchAction(_ sender: Any?) { - Defaults[.isShowFolderOn] = showFolderSwitch.isOn + SharedDefaults[.isShowFolderOn] = showFolderSwitch.isOn NotificationCenter.default.post(name: .passwordDisplaySettingChanged, object: nil) } diff --git a/pass/Controllers/GitConfigSettingTableViewController.swift b/pass/Controllers/GitConfigSettingTableViewController.swift index cc7d23e..f0d0d5a 100644 --- a/pass/Controllers/GitConfigSettingTableViewController.swift +++ b/pass/Controllers/GitConfigSettingTableViewController.swift @@ -8,6 +8,7 @@ import UIKit import SwiftyUserDefaults +import passKit class GitConfigSettingTableViewController: UITableViewController { let passwordStore = PasswordStore.shared @@ -22,8 +23,8 @@ class GitConfigSettingTableViewController: UITableViewController { let signature = passwordStore.gitSignatureForNow nameTextField.placeholder = signature.name emailTextField.placeholder = signature.email - nameTextField.text = Defaults[.gitSignatureName] - emailTextField.text = Defaults[.gitSignatureEmail] + nameTextField.text = SharedDefaults[.gitSignatureName] + emailTextField.text = SharedDefaults[.gitSignatureEmail] } override func shouldPerformSegue(withIdentifier identifier: String, sender: Any?) -> Bool { diff --git a/pass/Controllers/GitSSHKeyArmorSettingTableViewController.swift b/pass/Controllers/GitSSHKeyArmorSettingTableViewController.swift index 3e4eb53..d6ebcb0 100644 --- a/pass/Controllers/GitSSHKeyArmorSettingTableViewController.swift +++ b/pass/Controllers/GitSSHKeyArmorSettingTableViewController.swift @@ -7,7 +7,7 @@ // import UIKit -import SwiftyUserDefaults +import passKit class GitSSHKeyArmorSettingTableViewController: UITableViewController, UITextViewDelegate, QRScannerControllerDelegate { @IBOutlet weak var armorPrivateKeyTextView: UITextView! @@ -73,7 +73,7 @@ class GitSSHKeyArmorSettingTableViewController: UITableViewController, UITextVie override func viewDidLoad() { super.viewDidLoad() - armorPrivateKeyTextView.text = Defaults[.gitSSHPrivateKeyArmor] + armorPrivateKeyTextView.text = SharedDefaults[.gitSSHPrivateKeyArmor] armorPrivateKeyTextView.delegate = self scanPrivateKeyCell?.textLabel?.text = "Scan Private Key QR Codes" @@ -83,13 +83,13 @@ class GitSSHKeyArmorSettingTableViewController: UITableViewController, UITextVie } @IBAction func doneButtonTapped(_ sender: Any) { - Defaults[.gitSSHPrivateKeyArmor] = armorPrivateKeyTextView.text + SharedDefaults[.gitSSHPrivateKeyArmor] = armorPrivateKeyTextView.text do { - try passwordStore.initGitSSHKey(with: armorPrivateKeyTextView.text, .secret) + try passwordStore.initGitSSHKey(with: armorPrivateKeyTextView.text) } catch { Utils.alert(title: "Cannot Save", message: "Cannot Save SSH Key", controller: self, completion: nil) } - Defaults[.gitSSHKeySource] = "armor" + SharedDefaults[.gitSSHKeySource] = "armor" self.navigationController!.popViewController(animated: true) } diff --git a/pass/Controllers/GitServerSettingTableViewController.swift b/pass/Controllers/GitServerSettingTableViewController.swift index 4dce38b..58c46b2 100644 --- a/pass/Controllers/GitServerSettingTableViewController.swift +++ b/pass/Controllers/GitServerSettingTableViewController.swift @@ -7,8 +7,8 @@ // import UIKit -import SwiftyUserDefaults import SVProgressHUD +import passKit class GitServerSettingTableViewController: UITableViewController { @@ -19,7 +19,7 @@ class GitServerSettingTableViewController: UITableViewController { let passwordStore = PasswordStore.shared var sshLabel: UILabel? = nil - var authenticationMethod = Defaults[.gitAuthenticationMethod] ?? "Password" + var authenticationMethod = SharedDefaults[.gitAuthenticationMethod] ?? "Password" private func checkAuthenticationMethod(method: String) { let passwordCheckView = authPasswordCell.viewWithTag(1001)! @@ -47,10 +47,10 @@ class GitServerSettingTableViewController: UITableViewController { } override func viewDidLoad() { super.viewDidLoad() - if let url = Defaults[.gitURL] { + if let url = SharedDefaults[.gitURL] { gitURLTextField.text = url.absoluteString } - usernameTextField.text = Defaults[.gitUsername] + usernameTextField.text = SharedDefaults[.gitUsername] sshLabel = authSSHKeyCell.subviews[0].subviews[0] as? UILabel checkAuthenticationMethod(method: authenticationMethod) authSSHKeyCell.accessoryType = .detailButton @@ -110,9 +110,9 @@ class GitServerSettingTableViewController: UITableViewController { } }) DispatchQueue.main.async { - Defaults[.gitURL] = URL(string: gitRepostiroyURL) - Defaults[.gitUsername] = username - Defaults[.gitAuthenticationMethod] = auth + SharedDefaults[.gitURL] = URL(string: gitRepostiroyURL) + SharedDefaults[.gitUsername] = username + SharedDefaults[.gitAuthenticationMethod] = auth SVProgressHUD.showSuccess(withStatus: "Done") SVProgressHUD.dismiss(withDelay: 1) self.performSegue(withIdentifier: "saveGitServerSettingSegue", sender: self) @@ -167,11 +167,11 @@ class GitServerSettingTableViewController: UITableViewController { var armorActionTitle = "ASCII-Armor Encrypted Key" var fileActionTitle = "Use Imported Keys" - if Defaults[.gitSSHKeySource] == "url" { + if SharedDefaults[.gitSSHKeySource] == "url" { urlActionTitle = "✓ \(urlActionTitle)" - } else if Defaults[.gitSSHKeySource] == "armor" { + } else if SharedDefaults[.gitSSHKeySource] == "armor" { armorActionTitle = "✓ \(armorActionTitle)" - } else if Defaults[.gitSSHKeySource] == "file" { + } else if SharedDefaults[.gitSSHKeySource] == "file" { fileActionTitle = "✓ \(fileActionTitle)" } let urlAction = UIAlertAction(title: urlActionTitle, style: .default) { _ in @@ -187,7 +187,7 @@ class GitServerSettingTableViewController: UITableViewController { if passwordStore.gitSSHKeyExists() { // might keys updated via iTunes, or downloaded/pasted inside the app let fileAction = UIAlertAction(title: fileActionTitle, style: .default) { _ in - Defaults[.gitSSHKeySource] = "file" + SharedDefaults[.gitSSHKeySource] = "file" } optionMenu.addAction(fileAction) } else { @@ -199,10 +199,10 @@ class GitServerSettingTableViewController: UITableViewController { optionMenu.addAction(fileAction) } - if Defaults[.gitSSHKeySource] != nil { + if SharedDefaults[.gitSSHKeySource] != nil { let deleteAction = UIAlertAction(title: "Remove Git SSH Keys", style: .destructive) { _ in self.passwordStore.removeGitSSHKeys() - Defaults[.gitSSHKeySource] = nil + SharedDefaults[.gitSSHKeySource] = nil if let sshLabel = self.sshLabel { sshLabel.isEnabled = false self.checkAuthenticationMethod(method: "Password") diff --git a/pass/Controllers/OTPScannerController.swift b/pass/Controllers/OTPScannerController.swift index 52bb9ec..e6c6829 100644 --- a/pass/Controllers/OTPScannerController.swift +++ b/pass/Controllers/OTPScannerController.swift @@ -8,6 +8,7 @@ import UIKit import AVFoundation +import passKit class OTPScannerController: QRScannerController { diff --git a/pass/Controllers/PGPKeyArmorSettingTableViewController.swift b/pass/Controllers/PGPKeyArmorSettingTableViewController.swift index 71f2a95..4aa883b 100644 --- a/pass/Controllers/PGPKeyArmorSettingTableViewController.swift +++ b/pass/Controllers/PGPKeyArmorSettingTableViewController.swift @@ -7,7 +7,7 @@ // import UIKit -import SwiftyUserDefaults +import passKit class PGPKeyArmorSettingTableViewController: UITableViewController, UITextViewDelegate, QRScannerControllerDelegate { @IBOutlet weak var armorPublicKeyTextView: UITextView! @@ -92,8 +92,8 @@ class PGPKeyArmorSettingTableViewController: UITableViewController, UITextViewDe override func viewDidLoad() { super.viewDidLoad() - armorPublicKeyTextView.text = Defaults[.pgpPublicKeyArmor] - armorPrivateKeyTextView.text = Defaults[.pgpPrivateKeyArmor] + armorPublicKeyTextView.text = SharedDefaults[.pgpPublicKeyArmor] + armorPrivateKeyTextView.text = SharedDefaults[.pgpPrivateKeyArmor] pgpPassphrase = passwordStore.pgpKeyPassphrase scanPublicKeyCell?.textLabel?.text = "Scan Public Key QR Codes" @@ -126,7 +126,7 @@ class PGPKeyArmorSettingTableViewController: UITableViewController, UITextViewDe // no savePassphraseAlert.addAction(UIAlertAction(title: "No", style: UIAlertActionStyle.default) { _ in self.pgpPassphrase = nil - Defaults[.isRememberPassphraseOn] = false + SharedDefaults[.isRememberPassphraseOn] = false self.performSegue(withIdentifier: "savePGPKeySegue", sender: self) }) // yes @@ -135,7 +135,7 @@ class PGPKeyArmorSettingTableViewController: UITableViewController, UITextViewDe let alert = UIAlertController(title: "Passphrase", message: "Please fill in the passphrase of your PGP secret key.", preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: {_ in self.pgpPassphrase = alert.textFields?.first?.text - Defaults[.isRememberPassphraseOn] = true + SharedDefaults[.isRememberPassphraseOn] = true self.performSegue(withIdentifier: "savePGPKeySegue", sender: self) })) alert.addTextField(configurationHandler: {(textField: UITextField!) in diff --git a/pass/Controllers/PGPKeySettingTableViewController.swift b/pass/Controllers/PGPKeySettingTableViewController.swift index d022f31..54dfa9e 100644 --- a/pass/Controllers/PGPKeySettingTableViewController.swift +++ b/pass/Controllers/PGPKeySettingTableViewController.swift @@ -7,7 +7,7 @@ // import UIKit -import SwiftyUserDefaults +import passKit class PGPKeySettingTableViewController: UITableViewController { @@ -19,8 +19,8 @@ class PGPKeySettingTableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() tableView.rowHeight = UITableViewAutomaticDimension - pgpPublicKeyURLTextField.text = Defaults[.pgpPublicKeyURL]?.absoluteString - pgpPrivateKeyURLTextField.text = Defaults[.pgpPrivateKeyURL]?.absoluteString + pgpPublicKeyURLTextField.text = SharedDefaults[.pgpPublicKeyURL]?.absoluteString + pgpPrivateKeyURLTextField.text = SharedDefaults[.pgpPrivateKeyURL]?.absoluteString pgpPassphrase = passwordStore.pgpKeyPassphrase } @@ -51,7 +51,7 @@ class PGPKeySettingTableViewController: UITableViewController { // no savePassphraseAlert.addAction(UIAlertAction(title: "No", style: UIAlertActionStyle.default) { _ in self.pgpPassphrase = nil - Defaults[.isRememberPassphraseOn] = false + SharedDefaults[.isRememberPassphraseOn] = false self.performSegue(withIdentifier: "savePGPKeySegue", sender: self) }) // yes @@ -60,7 +60,7 @@ class PGPKeySettingTableViewController: UITableViewController { let alert = UIAlertController(title: "Passphrase", message: "Please fill in the passphrase of your PGP secret key.", preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: {_ in self.pgpPassphrase = alert.textFields?.first?.text - Defaults[.isRememberPassphraseOn] = true + SharedDefaults[.isRememberPassphraseOn] = true self.performSegue(withIdentifier: "savePGPKeySegue", sender: self) })) alert.addTextField(configurationHandler: {(textField: UITextField!) in diff --git a/pass/Controllers/PasswordDetailTableViewController.swift b/pass/Controllers/PasswordDetailTableViewController.swift index 8459139..1bbe900 100644 --- a/pass/Controllers/PasswordDetailTableViewController.swift +++ b/pass/Controllers/PasswordDetailTableViewController.swift @@ -8,8 +8,8 @@ import UIKit import FavIcon -import SwiftyUserDefaults import SVProgressHUD +import passKit class PasswordDetailTableViewController: UITableViewController, UIGestureRecognizerDelegate { var passwordEntity: PasswordEntity? @@ -134,7 +134,7 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni self.present(alert, animated: true, completion: nil) } let _ = sem.wait(timeout: DispatchTime.distantFuture) - if Defaults[.isRememberPassphraseOn] { + if SharedDefaults[.isRememberPassphraseOn] { self.passwordStore.pgpKeyPassphrase = passphrase } return passphrase @@ -281,8 +281,8 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni let filteredAdditionKeys = password.additionKeys.filter { $0.lowercased() != "username" && $0.lowercased() != "password" && - (!$0.hasPrefix("unknown") || !Defaults[.isHideUnknownOn]) && - (!Password.otpKeywords.contains($0) || !Defaults[.isHideOTPOn]) } + (!$0.hasPrefix("unknown") || !SharedDefaults[.isHideUnknownOn]) && + (!Password.otpKeywords.contains($0) || !SharedDefaults[.isHideOTPOn]) } if filteredAdditionKeys.count > 0 { section = TableSection(type: .addition, header: "additions") diff --git a/pass/Controllers/PasswordEditorTableViewController.swift b/pass/Controllers/PasswordEditorTableViewController.swift index cd17f38..28992a5 100644 --- a/pass/Controllers/PasswordEditorTableViewController.swift +++ b/pass/Controllers/PasswordEditorTableViewController.swift @@ -7,8 +7,8 @@ // import UIKit -import SwiftyUserDefaults import OneTimePassword +import passKit enum PasswordEditorCellType { case nameCell, fillPasswordCell, passwordLengthCell, additionsCell, deletePasswordCell, scanQRCodeCell @@ -95,7 +95,7 @@ class PasswordEditorTableViewController: UITableViewController, FillPasswordTabl return fillPasswordCell! case .passwordLengthCell: passwordLengthCell = tableView.dequeueReusableCell(withIdentifier: "passwordLengthCell", for: indexPath) as? SliderTableViewCell - let lengthSetting = Globals.passwordDefaultLength[Defaults[.passwordGeneratorFlavor]] ?? + let lengthSetting = Globals.passwordDefaultLength[SharedDefaults[.passwordGeneratorFlavor]] ?? Globals.passwordDefaultLength["Random"] passwordLengthCell?.reset(title: "Length", minimumValue: lengthSetting?.min ?? 0, diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index 2d6a27a..148cabf 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -8,8 +8,7 @@ import UIKit import SVProgressHUD -import SwiftyUserDefaults -import PasscodeLock +import passKit fileprivate class PasswordsTableEntry : NSObject { var title: String @@ -87,7 +86,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV filteredPasswordsTableEntries.removeAll() var passwordEntities = [PasswordEntity]() var passwordAllEntities = [PasswordEntity]() - if Defaults[.isShowFolderOn] { + if SharedDefaults[.isShowFolderOn] { passwordEntities = self.passwordStore.fetchPasswordEntityCoreData(parent: parent) } else { passwordEntities = self.passwordStore.fetchPasswordEntityCoreData(withDir: false) @@ -139,12 +138,12 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV SVProgressHUD.show(withStatus: "Sync Password Store") let numberOfLocalCommits = self.passwordStore.numberOfLocalCommits() var gitCredential: GitCredential - if Defaults[.gitAuthenticationMethod] == "Password" { - gitCredential = GitCredential(credential: GitCredential.Credential.http(userName: Defaults[.gitUsername]!, controller: self)) + if SharedDefaults[.gitAuthenticationMethod] == "Password" { + gitCredential = GitCredential(credential: GitCredential.Credential.http(userName: SharedDefaults[.gitUsername]!, controller: self)) } else { gitCredential = GitCredential( credential: GitCredential.Credential.ssh( - userName: Defaults[.gitUsername]!, + userName: SharedDefaults[.gitUsername]!, privateKeyFile: Globals.gitSSHPrivateKeyURL, controller: self ) @@ -184,7 +183,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - if Defaults[.isShowFolderOn] { + if SharedDefaults[.isShowFolderOn] { searchController.searchBar.scopeButtonTitles = ["Current", "All"] } else { searchController.searchBar.scopeButtonTitles = nil @@ -238,7 +237,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let longPressGestureRecognizer = UILongPressGestureRecognizer(target: self, action: #selector(longPressAction(_:))) longPressGestureRecognizer.minimumPressDuration = 0.6 - if Defaults[.isShowFolderOn] && searchController.searchBar.selectedScopeButtonIndex == 0{ + if SharedDefaults[.isShowFolderOn] && searchController.searchBar.selectedScopeButtonIndex == 0{ let cell = tableView.dequeueReusableCell(withIdentifier: "passwordTableViewCell", for: indexPath) let entry = getPasswordEntry(by: indexPath) @@ -296,7 +295,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV } func backAction(_ sender: Any?) { - guard Defaults[.isShowFolderOn] else { return } + guard SharedDefaults[.isShowFolderOn] else { return } var anim: CATransition? = transitionFromLeft if parentPasswordEntity == nil { anim = nil @@ -363,7 +362,7 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV // bring back SVProgressHUD.show(withStatus: "Decrypting") } - if Defaults[.isRememberPassphraseOn] { + if SharedDefaults[.isRememberPassphraseOn] { self.passwordStore.pgpKeyPassphrase = passphrase } return passphrase diff --git a/pass/Controllers/RawPasswordViewController.swift b/pass/Controllers/RawPasswordViewController.swift index 78d9e98..171e95e 100644 --- a/pass/Controllers/RawPasswordViewController.swift +++ b/pass/Controllers/RawPasswordViewController.swift @@ -7,6 +7,7 @@ // import UIKit +import passKit class RawPasswordViewController: UIViewController { diff --git a/pass/Controllers/SSHKeySettingTableViewController.swift b/pass/Controllers/SSHKeySettingTableViewController.swift index 0af4f2a..f14702a 100644 --- a/pass/Controllers/SSHKeySettingTableViewController.swift +++ b/pass/Controllers/SSHKeySettingTableViewController.swift @@ -7,8 +7,8 @@ // import UIKit -import SwiftyUserDefaults import SVProgressHUD +import passKit class SSHKeySettingTableViewController: UITableViewController { @@ -17,7 +17,7 @@ class SSHKeySettingTableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() - privateKeyURLTextField.text = Defaults[.gitSSHPrivateKeyURL]?.absoluteString + privateKeyURLTextField.text = SharedDefaults[.gitSSHPrivateKeyURL]?.absoluteString } @@ -27,14 +27,14 @@ class SSHKeySettingTableViewController: UITableViewController { return } - Defaults[.gitSSHPrivateKeyURL] = privateKeyURL + SharedDefaults[.gitSSHPrivateKeyURL] = privateKeyURL do { try Data(contentsOf: privateKeyURL).write(to: URL(fileURLWithPath: Globals.gitSSHPrivateKeyPath), options: .atomic) } catch { Utils.alert(title: "Error", message: error.localizedDescription, controller: self, completion: nil) } - Defaults[.gitSSHKeySource] = "url" + SharedDefaults[.gitSSHKeySource] = "url" self.navigationController!.popViewController(animated: true) } diff --git a/pass/Controllers/SettingsTableViewController.swift b/pass/Controllers/SettingsTableViewController.swift index 2c8bf03..42b3dc5 100644 --- a/pass/Controllers/SettingsTableViewController.swift +++ b/pass/Controllers/SettingsTableViewController.swift @@ -9,9 +9,9 @@ import UIKit import SVProgressHUD import CoreData -import SwiftyUserDefaults import PasscodeLock import LocalAuthentication +import passKit class SettingsTableViewController: UITableViewController { @@ -27,26 +27,27 @@ class SettingsTableViewController: UITableViewController { @IBOutlet weak var passcodeTableViewCell: UITableViewCell! @IBOutlet weak var passwordRepositoryTableViewCell: UITableViewCell! let passwordStore = PasswordStore.shared + var passcodeLockConfig = PasscodeLockConfiguration.shared @IBAction func cancelPGPKey(segue: UIStoryboardSegue) { } @IBAction func savePGPKey(segue: UIStoryboardSegue) { if let controller = segue.source as? PGPKeySettingTableViewController { - Defaults[.pgpPrivateKeyURL] = URL(string: controller.pgpPrivateKeyURLTextField.text!) - Defaults[.pgpPublicKeyURL] = URL(string: controller.pgpPublicKeyURLTextField.text!) - if Defaults[.isRememberPassphraseOn] { + SharedDefaults[.pgpPrivateKeyURL] = URL(string: controller.pgpPrivateKeyURLTextField.text!) + SharedDefaults[.pgpPublicKeyURL] = URL(string: controller.pgpPublicKeyURLTextField.text!) + if SharedDefaults[.isRememberPassphraseOn] { self.passwordStore.pgpKeyPassphrase = controller.pgpPassphrase } - Defaults[.pgpKeySource] = "url" + SharedDefaults[.pgpKeySource] = "url" SVProgressHUD.setDefaultMaskType(.black) SVProgressHUD.setDefaultStyle(.light) SVProgressHUD.show(withStatus: "Fetching PGP Key") DispatchQueue.global(qos: .userInitiated).async { [unowned self] in do { - try self.passwordStore.initPGPKey(from: Defaults[.pgpPublicKeyURL]!, keyType: .public) - try self.passwordStore.initPGPKey(from: Defaults[.pgpPrivateKeyURL]!, keyType: .secret) + try self.passwordStore.initPGPKey(from: SharedDefaults[.pgpPublicKeyURL]!, keyType: .public) + try self.passwordStore.initPGPKey(from: SharedDefaults[.pgpPrivateKeyURL]!, keyType: .secret) DispatchQueue.main.async { self.pgpKeyTableViewCell.detailTextLabel?.text = self.passwordStore.pgpKeyID SVProgressHUD.showSuccess(withStatus: "Success") @@ -62,13 +63,13 @@ class SettingsTableViewController: UITableViewController { } } else if let controller = segue.source as? PGPKeyArmorSettingTableViewController { - Defaults[.pgpKeySource] = "armor" - if Defaults[.isRememberPassphraseOn] { + SharedDefaults[.pgpKeySource] = "armor" + if SharedDefaults[.isRememberPassphraseOn] { self.passwordStore.pgpKeyPassphrase = controller.pgpPassphrase } - Defaults[.pgpPublicKeyArmor] = controller.armorPublicKeyTextView.text! - Defaults[.pgpPrivateKeyArmor] = controller.armorPrivateKeyTextView.text! + SharedDefaults[.pgpPublicKeyArmor] = controller.armorPublicKeyTextView.text! + SharedDefaults[.pgpPrivateKeyArmor] = controller.armorPrivateKeyTextView.text! SVProgressHUD.setDefaultMaskType(.black) SVProgressHUD.setDefaultStyle(.light) @@ -94,7 +95,7 @@ class SettingsTableViewController: UITableViewController { private func saveImportedPGPKey() { // load keys - Defaults[.pgpKeySource] = "file" + SharedDefaults[.pgpKeySource] = "file" SVProgressHUD.setDefaultMaskType(.black) SVProgressHUD.setDefaultStyle(.light) @@ -120,7 +121,7 @@ class SettingsTableViewController: UITableViewController { } @IBAction func saveGitServerSetting(segue: UIStoryboardSegue) { - self.passwordRepositoryTableViewCell.detailTextLabel?.text = Defaults[.gitURL]?.host + self.passwordRepositoryTableViewCell.detailTextLabel?.text = SharedDefaults[.gitURL]?.host } override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { @@ -138,7 +139,7 @@ class SettingsTableViewController: UITableViewController { override func viewDidLoad() { super.viewDidLoad() NotificationCenter.default.addObserver(self, selector: #selector(SettingsTableViewController.actOnPasswordStoreErasedNotification), name: .passwordStoreErased, object: nil) - self.passwordRepositoryTableViewCell.detailTextLabel?.text = Defaults[.gitURL]?.host + self.passwordRepositoryTableViewCell.detailTextLabel?.text = SharedDefaults[.gitURL]?.host touchIDTableViewCell.accessoryView = touchIDSwitch setPGPKeyTableViewCellDetailText() setPasswordRepositoryTableViewCellDetailText() @@ -170,13 +171,13 @@ class SettingsTableViewController: UITableViewController { private func setPasscodeLockTouchIDCells() { if PasscodeLockRepository().hasPasscode { self.passcodeTableViewCell.detailTextLabel?.text = "On" - Globals.passcodeConfiguration.isTouchIDAllowed = true - touchIDSwitch.isOn = Defaults[.isTouchIDOn] + passcodeLockConfig.isTouchIDAllowed = true + touchIDSwitch.isOn = SharedDefaults[.isTouchIDOn] } else { self.passcodeTableViewCell.detailTextLabel?.text = "Off" - Globals.passcodeConfiguration.isTouchIDAllowed = false - Defaults[.isTouchIDOn] = false - touchIDSwitch.isOn = Defaults[.isTouchIDOn] + passcodeLockConfig.isTouchIDAllowed = false + SharedDefaults[.isTouchIDOn] = false + touchIDSwitch.isOn = SharedDefaults[.isTouchIDOn] } } @@ -189,10 +190,10 @@ class SettingsTableViewController: UITableViewController { } private func setPasswordRepositoryTableViewCellDetailText() { - if Defaults[.gitURL] == nil { + if SharedDefaults[.gitURL] == nil { passwordRepositoryTableViewCell.detailTextLabel?.text = "Not Set" } else { - passwordRepositoryTableViewCell.detailTextLabel?.text = Defaults[.gitURL]!.host + passwordRepositoryTableViewCell.detailTextLabel?.text = SharedDefaults[.gitURL]!.host } } @@ -202,12 +203,12 @@ class SettingsTableViewController: UITableViewController { setPasscodeLockTouchIDCells() let appDelegate = UIApplication.shared.delegate as! AppDelegate - appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: Globals.passcodeConfiguration) + appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: passcodeLockConfig) } override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { if tableView.cellForRow(at: indexPath) == passcodeTableViewCell { - if Defaults[.passcodeKey] != nil{ + if SharedDefaults[.passcodeKey] != nil{ showPasscodeActionSheet() } else { setPasscodeLock() @@ -219,17 +220,17 @@ class SettingsTableViewController: UITableViewController { } func touchIDSwitchAction(uiSwitch: UISwitch) { - if !Globals.passcodeConfiguration.isTouchIDAllowed || !isTouchIDEnabled() { + if !passcodeLockConfig.isTouchIDAllowed || !isTouchIDEnabled() { // switch off DispatchQueue.main.asyncAfter(deadline: .now() + .milliseconds(500)) { - uiSwitch.isOn = Defaults[.isTouchIDOn] // false + uiSwitch.isOn = SharedDefaults[.isTouchIDOn] // false Utils.alert(title: "Notice", message: "Please enable Touch ID and set the passcode lock first.", controller: self, completion: nil) } } else { - Defaults[.isTouchIDOn] = uiSwitch.isOn + SharedDefaults[.isTouchIDOn] = uiSwitch.isOn } let appDelegate = UIApplication.shared.delegate as! AppDelegate - appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: Globals.passcodeConfiguration) + appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: passcodeLockConfig) } func showPGPKeyActionSheet() { @@ -238,11 +239,11 @@ class SettingsTableViewController: UITableViewController { var armorActionTitle = "ASCII-Armor Encrypted Key" var fileActionTitle = "Use Imported Keys" - if Defaults[.pgpKeySource] == "url" { + if SharedDefaults[.pgpKeySource] == "url" { urlActionTitle = "✓ \(urlActionTitle)" - } else if Defaults[.pgpKeySource] == "armor" { + } else if SharedDefaults[.pgpKeySource] == "armor" { armorActionTitle = "✓ \(armorActionTitle)" - } else if Defaults[.pgpKeySource] == "file" { + } else if SharedDefaults[.pgpKeySource] == "file" { fileActionTitle = "✓ \(fileActionTitle)" } let urlAction = UIAlertAction(title: urlActionTitle, style: .default) { _ in @@ -262,7 +263,7 @@ class SettingsTableViewController: UITableViewController { // no savePassphraseAlert.addAction(UIAlertAction(title: "No", style: UIAlertActionStyle.default) { _ in self.passwordStore.pgpKeyPassphrase = nil - Defaults[.isRememberPassphraseOn] = false + SharedDefaults[.isRememberPassphraseOn] = false self.saveImportedPGPKey() }) // yes @@ -271,7 +272,7 @@ class SettingsTableViewController: UITableViewController { let alert = UIAlertController(title: "Passphrase", message: "Please fill in the passphrase of your PGP secret key.", preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: {_ in self.passwordStore.pgpKeyPassphrase = alert.textFields?.first?.text - Defaults[.isRememberPassphraseOn] = true + SharedDefaults[.isRememberPassphraseOn] = true self.saveImportedPGPKey() })) alert.addTextField(configurationHandler: {(textField: UITextField!) in @@ -293,7 +294,7 @@ class SettingsTableViewController: UITableViewController { } - if Defaults[.pgpKeySource] != nil { + if SharedDefaults[.pgpKeySource] != nil { let deleteAction = UIAlertAction(title: "Remove PGP Keys", style: .destructive) { _ in self.passwordStore.removePGPKeys() self.pgpKeyTableViewCell.detailTextLabel?.text = "Not Set" @@ -307,15 +308,15 @@ class SettingsTableViewController: UITableViewController { } func showPasscodeActionSheet() { - let passcodeChangeViewController = PasscodeLockViewController(state: .change, configuration: Globals.passcodeConfiguration) - let passcodeRemoveViewController = PasscodeLockViewController(state: .remove, configuration: Globals.passcodeConfiguration) + let passcodeChangeViewController = PasscodeLockViewController(state: .change, configuration: passcodeLockConfig) + let passcodeRemoveViewController = PasscodeLockViewController(state: .remove, configuration: passcodeLockConfig) let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) let removePasscodeAction = UIAlertAction(title: "Remove Passcode", style: .destructive) { [weak self] _ in passcodeRemoveViewController.successCallback = { _ in self?.setPasscodeLockTouchIDCells() let appDelegate = UIApplication.shared.delegate as! AppDelegate - appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: Globals.passcodeConfiguration) + appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: (self?.passcodeLockConfig)!) } self?.present(passcodeRemoveViewController, animated: true, completion: nil) } @@ -334,7 +335,7 @@ class SettingsTableViewController: UITableViewController { } func setPasscodeLock() { - let passcodeSetViewController = PasscodeLockViewController(state: .set, configuration: Globals.passcodeConfiguration) + let passcodeSetViewController = PasscodeLockViewController(state: .set, configuration: passcodeLockConfig) passcodeSetViewController.successCallback = { _ in self.setPasscodeLockTouchIDCells() } diff --git a/pass/Helpers/Globals.swift b/pass/Helpers/Globals.swift deleted file mode 100644 index 79ec43b..0000000 --- a/pass/Helpers/Globals.swift +++ /dev/null @@ -1,60 +0,0 @@ -// -// Globals.swift -// pass -// -// Created by Mingshen Sun on 21/1/2017. -// Copyright © 2017 Bob Sun. All rights reserved. -// - -import Foundation -import UIKit - -class Globals { - - // Legacy paths (not shared) - static let documentPathLegacy = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]; - static let libraryPathLegacy = NSSearchPathForDirectoriesInDomains(.libraryDirectory, .userDomainMask, true)[0]; - static let pgpPublicKeyPathLegacy = "\(documentPathLegacy)/gpg_key.pub" - static let pgpPrivateKeyPathLegacy = "\(documentPathLegacy)/gpg_key" - static let gitSSHPrivateKeyPathLegacy = "\(documentPathLegacy)/ssh_key" - static let gitSSHPrivateKeyURLLegacy = URL(fileURLWithPath: gitSSHPrivateKeyPathLegacy) - static let repositoryPathLegacy = "\(libraryPathLegacy)/password-store" - - static let groupIdentifier = "group." + Bundle.main.bundleIdentifier! - static let sharedContainerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupIdentifier)! - static let documentPath = sharedContainerURL.appendingPathComponent("Keys").path - static let libraryPath = sharedContainerURL.appendingPathComponent("Repository").path - static let pgpPublicKeyPath = documentPath + "/gpg_key.pub" - static let pgpPrivateKeyPath = documentPath + "/gpg_key" - static let gitSSHPrivateKeyPath = documentPath + "/ssh_key" - static let gitSSHPrivateKeyURL = URL(fileURLWithPath: gitSSHPrivateKeyPath) - static let repositoryPath = libraryPath + "/password-store" - - static var passcodeConfiguration = PasscodeLockConfiguration() - - static let passwordDefaultLength = ["Random": (min: 4, max: 64, def: 16), - "Apple": (min: 15, max: 15, def: 15)] - - static let gitSignatureDefaultName = "Pass for iOS" - static let gitSignatureDefaultEmail = "user@passforios" - - static let passwordDots = "••••••••••••" - static let oneTimePasswordDots = "••••••" - static let passwordFonts = "Menlo" - - // UI related - static let red = UIColor(red:1.00, green:0.23, blue:0.19, alpha:1.0) - static let blue = UIColor(red:0.00, green:0.48, blue:1.00, alpha:1.0) - static let tableCellButtonSize = CGFloat(20.0) - - private init() { } -} - -extension Bundle { - var releaseVersionNumber: String? { - return infoDictionary?["CFBundleShortVersionString"] as? String - } - var buildVersionNumber: String? { - return infoDictionary?["CFBundleVersion"] as? String - } -} diff --git a/pass/Helpers/Objective-CBridgingHeader.h b/pass/Helpers/Objective-CBridgingHeader.h index babc42b..e84e32a 100644 --- a/pass/Helpers/Objective-CBridgingHeader.h +++ b/pass/Helpers/Objective-CBridgingHeader.h @@ -9,7 +9,7 @@ #ifndef Objective_CBridgingHeader_h #define Objective_CBridgingHeader_h -#import +// #import #import #endif /* Objective_CBridgingHeader_h */ diff --git a/pass/Models/PasscodeLockConfiguration.swift b/pass/Models/PasscodeLockConfiguration.swift index 5f53692..72ccf5b 100644 --- a/pass/Models/PasscodeLockConfiguration.swift +++ b/pass/Models/PasscodeLockConfiguration.swift @@ -8,13 +8,15 @@ import Foundation import PasscodeLock -import SwiftyUserDefaults +import passKit struct PasscodeLockConfiguration: PasscodeLockConfigurationType { + static let shared = PasscodeLockConfiguration() + let repository: PasscodeRepositoryType let passcodeLength = 4 - var isTouchIDAllowed = Defaults[.isTouchIDOn] + var isTouchIDAllowed = SharedDefaults[.isTouchIDOn] let shouldRequestTouchIDImmediately = true let maximumInccorectPasscodeAttempts = 3 diff --git a/pass/Models/PasscodeLockRepository.swift b/pass/Models/PasscodeLockRepository.swift index 5f22218..300cb27 100644 --- a/pass/Models/PasscodeLockRepository.swift +++ b/pass/Models/PasscodeLockRepository.swift @@ -8,7 +8,7 @@ import Foundation import PasscodeLock -import SwiftyUserDefaults +import passKit public class PasscodeLockRepository: PasscodeRepositoryType { private let passcodeKey = "passcode.lock.passcode" @@ -23,11 +23,11 @@ public class PasscodeLockRepository: PasscodeRepositoryType { } private var passcode: String? { - return Defaults[.passcodeKey] + return SharedDefaults[.passcodeKey] } public func save(passcode: String) { - Defaults[.passcodeKey] = passcode + SharedDefaults[.passcodeKey] = passcode } public func check(passcode: String) -> Bool { @@ -35,6 +35,6 @@ public class PasscodeLockRepository: PasscodeRepositoryType { } public func delete() { - Defaults[.passcodeKey] = nil + SharedDefaults[.passcodeKey] = nil } } diff --git a/pass/Views/FillPasswordTableViewCell.swift b/pass/Views/FillPasswordTableViewCell.swift index 9861cae..97c702d 100644 --- a/pass/Views/FillPasswordTableViewCell.swift +++ b/pass/Views/FillPasswordTableViewCell.swift @@ -7,6 +7,7 @@ // import UIKit +import passKit protocol FillPasswordTableViewCellDelegate { func generateAndCopyPassword() diff --git a/pass/Views/LabelTableViewCell.swift b/pass/Views/LabelTableViewCell.swift index 3facc5a..12ac599 100644 --- a/pass/Views/LabelTableViewCell.swift +++ b/pass/Views/LabelTableViewCell.swift @@ -8,6 +8,7 @@ import UIKit import SVProgressHUD +import passKit struct LabelTableViewCellData { var title: String diff --git a/pass/AppError.swift b/passKit/Helpers/AppError.swift similarity index 100% rename from pass/AppError.swift rename to passKit/Helpers/AppError.swift diff --git a/pass/Helpers/DefaultsKeys.swift b/passKit/Helpers/DefaultsKeys.swift similarity index 94% rename from pass/Helpers/DefaultsKeys.swift rename to passKit/Helpers/DefaultsKeys.swift index e198c3c..5a4a597 100644 --- a/pass/Helpers/DefaultsKeys.swift +++ b/passKit/Helpers/DefaultsKeys.swift @@ -9,9 +9,9 @@ import Foundation import SwiftyUserDefaults -var Defaults = UserDefaults(suiteName: Globals.groupIdentifier)! +public var SharedDefaults = UserDefaults(suiteName: Globals.groupIdentifier)! -extension DefaultsKeys { +public extension DefaultsKeys { static let pgpKeySource = DefaultsKey("pgpKeySource") static let pgpPublicKeyURL = DefaultsKey("pgpPublicKeyURL") static let pgpPrivateKeyURL = DefaultsKey("pgpPrivateKeyURL") diff --git a/passKit/Helpers/Globals.swift b/passKit/Helpers/Globals.swift new file mode 100644 index 0000000..c798f0a --- /dev/null +++ b/passKit/Helpers/Globals.swift @@ -0,0 +1,61 @@ +// +// Globals.swift +// pass +// +// Created by Mingshen Sun on 21/1/2017. +// Copyright © 2017 Bob Sun. All rights reserved. +// + +import Foundation +import UIKit + +public class Globals { + + // Legacy paths (not shared) + public static let documentPathLegacy = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)[0]; + public static let libraryPathLegacy = NSSearchPathForDirectoriesInDomains(.libraryDirectory, .userDomainMask, true)[0]; + public static let pgpPublicKeyPathLegacy = "\(documentPathLegacy)/gpg_key.pub" + public static let pgpPrivateKeyPathLegacy = "\(documentPathLegacy)/gpg_key" + public static let gitSSHPrivateKeyPathLegacy = "\(documentPathLegacy)/ssh_key" + public static let gitSSHPrivateKeyURLLegacy = URL(fileURLWithPath: gitSSHPrivateKeyPathLegacy) + public static let repositoryPathLegacy = "\(libraryPathLegacy)/password-store" + + public static let bundleIdentifier = "me.mssun.passforios" + public static let groupIdentifier = "group." + bundleIdentifier + public static let passKitBundleIdentifier = bundleIdentifier + ".passKit" + + public static let sharedContainerURL = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupIdentifier)! + public static let documentPath = sharedContainerURL.appendingPathComponent("Documents").path + public static let libraryPath = sharedContainerURL.appendingPathComponent("Library").path + public static let pgpPublicKeyPath = documentPath + "/gpg_key.pub" + public static let pgpPrivateKeyPath = documentPath + "/gpg_key" + public static let gitSSHPrivateKeyPath = documentPath + "/ssh_key" + public static let gitSSHPrivateKeyURL = URL(fileURLWithPath: gitSSHPrivateKeyPath) + public static let repositoryPath = libraryPath + "/password-store" + + public static let passwordDefaultLength = ["Random": (min: 4, max: 64, def: 16), + "Apple": (min: 15, max: 15, def: 15)] + + public static let gitSignatureDefaultName = "Pass for iOS" + public static let gitSignatureDefaultEmail = "user@passforios" + + public static let passwordDots = "••••••••••••" + public static let oneTimePasswordDots = "••••••" + public static let passwordFonts = "Menlo" + + // UI related + public static let red = UIColor(red:1.00, green:0.23, blue:0.19, alpha:1.0) + public static let blue = UIColor(red:0.00, green:0.48, blue:1.00, alpha:1.0) + public static let tableCellButtonSize = CGFloat(20.0) + + private init() { } +} + +public extension Bundle { + var releaseVersionNumber: String? { + return infoDictionary?["CFBundleShortVersionString"] as? String + } + var buildVersionNumber: String? { + return infoDictionary?["CFBundleVersion"] as? String + } +} diff --git a/pass/Helpers/NotificationNames.swift b/passKit/Helpers/NotificationNames.swift similarity index 95% rename from pass/Helpers/NotificationNames.swift rename to passKit/Helpers/NotificationNames.swift index e59f843..aa7e7e3 100644 --- a/pass/Helpers/NotificationNames.swift +++ b/passKit/Helpers/NotificationNames.swift @@ -8,7 +8,7 @@ import Foundation -extension Notification.Name { +public extension Notification.Name { static let passwordStoreUpdated = Notification.Name("passwordStoreUpdated") static let passwordStoreErased = Notification.Name("passwordStoreErased") static let passwordStoreChangeDiscarded = Notification.Name("passwordStoreChangeDiscarded") diff --git a/pass/Helpers/UITextFieldExtension.swift b/passKit/Helpers/UITextFieldExtension.swift similarity index 100% rename from pass/Helpers/UITextFieldExtension.swift rename to passKit/Helpers/UITextFieldExtension.swift diff --git a/pass/Helpers/Utils.swift b/passKit/Helpers/Utils.swift similarity index 82% rename from pass/Helpers/Utils.swift rename to passKit/Helpers/Utils.swift index 8bd0be4..60ed403 100644 --- a/pass/Helpers/Utils.swift +++ b/passKit/Helpers/Utils.swift @@ -12,8 +12,8 @@ import KeychainAccess import UIKit import SVProgressHUD -class Utils { - static func removeFileIfExists(atPath path: String) { +public class Utils { + public static func removeFileIfExists(atPath path: String) { let fm = FileManager.default do { if fm.fileExists(atPath: path) { @@ -23,12 +23,12 @@ class Utils { print(error) } } - static func removeFileIfExists(at url: URL) { + public static func removeFileIfExists(at url: URL) { removeFileIfExists(atPath: url.path) } - - static func getLastSyncedTimeString() -> String { - guard let lastSyncedTime = Defaults[.lastSyncedTime] else { + + public static func getLastSyncedTimeString() -> String { + guard let lastSyncedTime = SharedDefaults[.lastSyncedTime] else { return "Oops! Sync again?" } let formatter = DateFormatter() @@ -37,8 +37,8 @@ class Utils { return formatter.string(from: lastSyncedTime) } - static func generatePassword(length: Int) -> String{ - switch Defaults[.passwordGeneratorFlavor] { + public static func generatePassword(length: Int) -> String{ + switch SharedDefaults[.passwordGeneratorFlavor] { case "Random": return randomString(length: length) case "Apple": @@ -48,7 +48,7 @@ class Utils { } } - static func randomString(length: Int) -> String { + public static func randomString(length: Int) -> String { let letters : NSString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*_+-=" let len = UInt32(letters.length) @@ -64,15 +64,15 @@ class Utils { return randomString } - static func alert(title: String, message: String, controller: UIViewController, handler: ((UIAlertAction) -> Void)? = nil, completion: (() -> Void)? = nil) { + public static func alert(title: String, message: String, controller: UIViewController, handler: ((UIAlertAction) -> Void)? = nil, completion: (() -> Void)? = nil) { SVProgressHUD.dismiss() let alert = UIAlertController(title: title, message: message, preferredStyle: UIAlertControllerStyle.alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: handler)) controller.present(alert, animated: true, completion: completion) } - static func getPasswordFromKeychain(name: String) -> String? { - let keychain = Keychain(service: Bundle.main.bundleIdentifier!) + public static func getPasswordFromKeychain(name: String) -> String? { + let keychain = Keychain(service: Globals.bundleIdentifier) do { return try keychain.getString(name) } catch { @@ -81,27 +81,27 @@ class Utils { return nil } - static func addPasswordToKeychain(name: String, password: String?) { - let keychain = Keychain(service: Bundle.main.bundleIdentifier!) + public static func addPasswordToKeychain(name: String, password: String?) { + let keychain = Keychain(service: Globals.bundleIdentifier) keychain[name] = password } - static func removeKeychain(name: String) { - let keychain = Keychain(service: Bundle.main.bundleIdentifier!) + public static func removeKeychain(name: String) { + let keychain = Keychain(service: Globals.bundleIdentifier) do { try keychain.remove(name) } catch { print(error) } } - static func removeAllKeychain() { - let keychain = Keychain(service: Bundle.main.bundleIdentifier!) + public static func removeAllKeychain() { + let keychain = Keychain(service: Globals.bundleIdentifier) do { try keychain.removeAll() } catch { print(error) } } - static func copyToPasteboard(textToCopy: String?, expirationTime: Double = 45) { + public static func copyToPasteboard(textToCopy: String?, expirationTime: Double = 45) { guard textToCopy != nil else { return } @@ -113,7 +113,7 @@ class Utils { } } } - static func attributedPassword(plainPassword: String) -> NSAttributedString{ + public static func attributedPassword(plainPassword: String) -> NSAttributedString{ let attributedPassword = NSMutableAttributedString.init(string: plainPassword) // draw all digits in the password into red // draw all punctuation characters in the password into blue @@ -126,15 +126,15 @@ class Utils { } return attributedPassword } - static func initDefaultKeys() { - if Defaults[.passwordGeneratorFlavor] == "" { - Defaults[.passwordGeneratorFlavor] = "Random" + public static func initDefaultKeys() { + if SharedDefaults[.passwordGeneratorFlavor] == "" { + SharedDefaults[.passwordGeneratorFlavor] = "Random" } } } // https://gist.github.com/NikolaiRuhe/eeb135d20c84a7097516 -extension FileManager { +public extension FileManager { /// This method calculates the accumulated size of a directory on the volume in bytes. /// @@ -217,7 +217,7 @@ extension FileManager { } } -extension String { +public extension String { func stringByAddingPercentEncodingForRFC3986() -> String? { let unreserved = "-._~/?" var allowed = CharacterSet.alphanumerics diff --git a/passKit/Info.plist b/passKit/Info.plist new file mode 100644 index 0000000..b7bfbec --- /dev/null +++ b/passKit/Info.plist @@ -0,0 +1,26 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + PassKit + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/pass/Models/GitCredential.swift b/passKit/Models/GitCredential.swift similarity index 94% rename from pass/Models/GitCredential.swift rename to passKit/Models/GitCredential.swift index 17274bb..13e07b4 100644 --- a/pass/Models/GitCredential.swift +++ b/passKit/Models/GitCredential.swift @@ -12,19 +12,19 @@ import SwiftyUserDefaults import ObjectiveGit import SVProgressHUD -struct GitCredential { - var credential: Credential +public struct GitCredential { + public var credential: Credential - enum Credential { + public enum Credential { case http(userName: String, controller: UIViewController) case ssh(userName: String, privateKeyFile: URL, controller: UIViewController) } - init(credential: Credential) { + public init(credential: Credential) { self.credential = credential } - func credentialProvider() throws -> GTCredentialProvider { + public func credentialProvider() throws -> GTCredentialProvider { var attempts = 0 var lastPassword: String? = nil return GTCredentialProvider { (_, _, _) -> (GTCredential?) in @@ -63,7 +63,7 @@ struct GitCredential { } } - func delete() { + public func delete() { switch credential { case .http: Utils.removeKeychain(name: "gitPassword") diff --git a/pass/Models/Password.swift b/passKit/Models/Password.swift similarity index 90% rename from pass/Models/Password.swift rename to passKit/Models/Password.swift index 2ac0896..78d4826 100644 --- a/pass/Models/Password.swift +++ b/passKit/Models/Password.swift @@ -22,12 +22,12 @@ enum PasswordChange: Int { case none = 0x00 } -class Password { - static let otpKeywords = ["otp_secret", "otp_type", "otp_algorithm", "otp_period", "otp_digits", "otp_counter", "otpauth"] +public class Password { + public static let otpKeywords = ["otp_secret", "otp_type", "otp_algorithm", "otp_period", "otp_digits", "otp_counter", "otpauth"] - var name = "" - var url: URL? - var namePath: String { + public var name = "" + public var url: URL? + public var namePath: String { get { if url == nil { return "" @@ -35,20 +35,20 @@ class Password { return url!.deletingPathExtension().path } } - var password = "" - var additions = [String: String]() - var additionKeys = [String]() - var changed: Int = 0 - var plainText = "" + public var password = "" + public var additions = [String: String]() + public var additionKeys = [String]() + public var changed: Int = 0 + public var plainText = "" private var firstLineIsOTPField = false private var otpToken: Token? - enum OtpType { + public enum OtpType { case totp, hotp, none } - var otpType: OtpType { + public var otpType: OtpType { get { guard let token = self.otpToken else { return OtpType.none @@ -62,11 +62,11 @@ class Password { } } - init(name: String, url: URL?, plainText: String) { + public init(name: String, url: URL?, plainText: String) { self.initEverything(name: name, url: url, plainText: plainText) } - func updatePassword(name: String, url: URL?, plainText: String) { + public func updatePassword(name: String, url: URL?, plainText: String) { if self.plainText != plainText || self.url != url { if self.plainText != plainText { changed = changed|PasswordChange.content.rawValue @@ -108,17 +108,17 @@ class Password { self.updateOtpToken() } - func getUsername() -> String? { + public func getUsername() -> String? { return getAdditionValue(withKey: "Username") ?? getAdditionValue(withKey: "username") } - func getURLString() -> String? { + public func getURLString() -> String? { return getAdditionValue(withKey: "URL") ?? getAdditionValue(withKey: "url") ?? getAdditionValue(withKey: "Url") } // return a key-value pair from the line // key might be nil, if there is no ":" in the line - static private func getKeyValuePair(from line: String) -> (key: String?, value: String) { + private static func getKeyValuePair(from line: String) -> (key: String?, value: String) { let items = line.components(separatedBy: ": ").map{String($0).trimmingCharacters(in: .whitespaces)} var key : String? = nil var value = "" @@ -138,7 +138,7 @@ class Password { return (key, value) } - static private func getAdditionFields(from additionFieldsPlainText: String) -> ([String: String], [String]){ + private static func getAdditionFields(from additionFieldsPlainText: String) -> ([String: String], [String]){ var additions = [String: String]() var additionKeys = [String]() var unknownIndex = 0 @@ -159,7 +159,7 @@ class Password { return (additions, additionKeys) } - func getAdditionsPlainText() -> String { + public func getAdditionsPlainText() -> String { // lines starting from the second let plainTextSplit = plainText.characters.split(maxSplits: 1, omittingEmptySubsequences: false) { $0 == "\n" || $0 == "\r\n" @@ -175,7 +175,7 @@ class Password { return self.plainText } - func getPlainData() -> Data { + public func getPlainData() -> Data { return getPlainText().data(using: .utf8)! } @@ -290,7 +290,7 @@ class Password { } // return the description and the password strings - func getOtpStrings() -> (description: String, otp: String)? { + public func getOtpStrings() -> (description: String, otp: String)? { guard let token = self.otpToken else { return nil } @@ -310,7 +310,7 @@ class Password { } // return the password strings - func getOtp() -> String? { + public func getOtp() -> String? { if let otp = self.otpToken?.currentPassword { return otp } else { @@ -320,7 +320,7 @@ class Password { // return the password strings // it is guaranteed that it is a HOTP password when we call this - func getNextHotp() -> String? { + public func getNextHotp() -> String? { // increase the counter otpToken = otpToken?.updatedToken() @@ -349,7 +349,7 @@ class Password { return self.otpToken?.currentPassword } - static func LooksLikeOTP(line: String) -> Bool { + public static func LooksLikeOTP(line: String) -> Bool { let (key, _) = getKeyValuePair(from: line) return Password.otpKeywords.contains(key ?? "") } diff --git a/pass/Models/PasswordEntity.swift b/passKit/Models/PasswordEntity.swift similarity index 88% rename from pass/Models/PasswordEntity.swift rename to passKit/Models/PasswordEntity.swift index cda8389..abc77fc 100644 --- a/pass/Models/PasswordEntity.swift +++ b/passKit/Models/PasswordEntity.swift @@ -11,7 +11,7 @@ import SwiftyUserDefaults extension PasswordEntity { - var nameWithCategory: String { + public var nameWithCategory: String { get { if let p = path, p.hasSuffix(".gpg") { return p.substring(to: p.index(p.endIndex, offsetBy: -4)) @@ -21,7 +21,7 @@ extension PasswordEntity { } } - func getCategoryText() -> String { + public func getCategoryText() -> String { var parentEntity = parent var passwordCategoryArray: [String] = [] while parentEntity != nil { @@ -32,7 +32,7 @@ extension PasswordEntity { return passwordCategoryArray.joined(separator: " > ") } - func getURL() -> URL? { + public func getURL() -> URL? { if let p = path { return URL(string: p.stringByAddingPercentEncodingForRFC3986()!) } diff --git a/pass/Models/PasswordStore.swift b/passKit/Models/PasswordStore.swift similarity index 88% rename from pass/Models/PasswordStore.swift rename to passKit/Models/PasswordStore.swift index ca80ffd..68bcc1b 100644 --- a/pass/Models/PasswordStore.swift +++ b/passKit/Models/PasswordStore.swift @@ -12,15 +12,16 @@ import UIKit import SwiftyUserDefaults import ObjectiveGit import SVProgressHUD +import ObjectivePGP -class PasswordStore { - static let shared = PasswordStore() - let storeURL = URL(fileURLWithPath: "\(Globals.repositoryPath)") - let tempStoreURL = URL(fileURLWithPath: "\(Globals.repositoryPath)-temp") +public class PasswordStore { + public static let shared = PasswordStore() + public let storeURL = URL(fileURLWithPath: "\(Globals.repositoryPath)") + public let tempStoreURL = URL(fileURLWithPath: "\(Globals.repositoryPath)-temp") - var storeRepository: GTRepository? - var pgpKeyID: String? - var publicKey: PGPKey? { + public var storeRepository: GTRepository? + public var pgpKeyID: String? + public var publicKey: PGPKey? { didSet { if publicKey != nil { pgpKeyID = publicKey!.keyID!.shortKeyString @@ -29,19 +30,19 @@ class PasswordStore { } } } - var privateKey: PGPKey? + public var privateKey: PGPKey? - var gitSignatureForNow: GTSignature { + public var gitSignatureForNow: GTSignature { get { - let gitSignatureName = Defaults[.gitSignatureName] ?? Globals.gitSignatureDefaultName - let gitSignatureEmail = Defaults[.gitSignatureEmail] ?? Globals.gitSignatureDefaultEmail + let gitSignatureName = SharedDefaults[.gitSignatureName] ?? Globals.gitSignatureDefaultName + let gitSignatureEmail = SharedDefaults[.gitSignatureEmail] ?? Globals.gitSignatureDefaultEmail return GTSignature(name: gitSignatureName, email: gitSignatureEmail, time: Date())! } } - var pgp: ObjectivePGP = ObjectivePGP() + public var pgp: ObjectivePGP = ObjectivePGP() - var pgpKeyPassphrase: String? { + public var pgpKeyPassphrase: String? { set { Utils.addPasswordToKeychain(name: "pgpKeyPassphrase", password: newValue) } @@ -50,7 +51,7 @@ class PasswordStore { } } - var gitPassword: String? { + public var gitPassword: String? { set { Utils.addPasswordToKeychain(name: "gitPassword", password: newValue) } @@ -59,7 +60,7 @@ class PasswordStore { } } - var gitSSHPrivateKeyPassphrase: String? { + public var gitSSHPrivateKeyPassphrase: String? { set { Utils.addPasswordToKeychain(name: "gitSSHPrivateKeyPassphrase", password: newValue) } @@ -68,17 +69,13 @@ class PasswordStore { } } - let fm = FileManager.default - lazy var context: NSManagedObjectContext = { - /* - The persistent container for the application. This implementation - creates and returns a container, having loaded the store for the - application to it. This property is optional since there are legitimate - error conditions that could cause the creation of the store to fail. - */ - let container = NSPersistentContainer(name: "pass") - let description = NSPersistentStoreDescription(url: Globals.sharedContainerURL) - container.loadPersistentStores(completionHandler: { (description, error) in + private let fm = FileManager.default + lazy private var context: NSManagedObjectContext = { + let modelURL = Bundle(identifier: Globals.passKitBundleIdentifier)!.url(forResource: "pass", withExtension: "momd")! + let managedObjectModel = NSManagedObjectModel(contentsOf: modelURL) + let container = NSPersistentContainer(name: "pass", managedObjectModel: managedObjectModel!) + container.persistentStoreDescriptions = [NSPersistentStoreDescription(url: Globals.sharedContainerURL.appendingPathComponent("Documents/pass.sqlite"))] + container.loadPersistentStores(completionHandler: { (storeDescription, error) in if let error = error as NSError? { // Replace this implementation with code to handle the error appropriately. // fatalError() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. @@ -97,11 +94,11 @@ class PasswordStore { return container.viewContext }() - var numberOfPasswords : Int { + public var numberOfPasswords : Int { return self.fetchPasswordEntityCoreData(withDir: false).count } - var sizeOfRepositoryByteCount : UInt64 { + public var sizeOfRepositoryByteCount : UInt64 { var size = UInt64(0) do { if fm.fileExists(atPath: self.storeURL.path) { @@ -116,8 +113,11 @@ class PasswordStore { private init() { // File migration to group + print(Globals.documentPath) + print(Globals.libraryPath) + print(Globals.documentPathLegacy) + print(Globals.libraryPathLegacy) migration() - do { if fm.fileExists(atPath: storeURL.path) { try storeRepository = GTRepository.init(url: storeURL) @@ -134,8 +134,9 @@ class PasswordStore { return } do { - try fm.copyItem(atPath: Globals.documentPathLegacy, toPath: Globals.documentPath) - try fm.copyItem(atPath: Globals.libraryPathLegacy, toPath: Globals.libraryPath) + try fm.moveItem(atPath: Globals.documentPathLegacy, toPath: Globals.documentPath) + try fm.moveItem(atPath: Globals.libraryPathLegacy, toPath: Globals.libraryPath) + SharedDefaults = Defaults } catch { print("Cannot migrate: \(error)") } @@ -146,10 +147,7 @@ class PasswordStore { case `public`, secret } - public func initGitSSHKey(with armorKey: String, _ keyType: SSHKeyType) throws { - guard keyType == .secret else { - return - } + public func initGitSSHKey(with armorKey: String) throws { let keyPath = Globals.gitSSHPrivateKeyPath try armorKey.write(toFile: keyPath, atomically: true, encoding: .ascii) } @@ -211,16 +209,16 @@ class PasswordStore { return nil } - func getPgpPrivateKey() -> PGPKey { + public func getPgpPrivateKey() -> PGPKey { return pgp.getKeysOf(.secret)[0] } - func repositoryExisted() -> Bool { + public func repositoryExisted() -> Bool { let fm = FileManager() return fm.fileExists(atPath: Globals.repositoryPath) } - func passwordExisted(password: Password) -> Bool { + public func passwordExisted(password: Password) -> Bool { let passwordEntityFetchRequest = NSFetchRequest(entityName: "PasswordEntity") do { passwordEntityFetchRequest.predicate = NSPredicate(format: "name = %@ and path = %@", password.name, password.url!.path) @@ -236,7 +234,7 @@ class PasswordStore { return true } - func passwordEntityExisted(path: String) -> Bool { + public func passwordEntityExisted(path: String) -> Bool { let passwordEntityFetchRequest = NSFetchRequest(entityName: "PasswordEntity") do { passwordEntityFetchRequest.predicate = NSPredicate(format: "path = %@", path) @@ -252,7 +250,7 @@ class PasswordStore { return true } - func getPasswordEntity(by path: String, isDir: Bool) -> PasswordEntity? { + public func getPasswordEntity(by path: String, isDir: Bool) -> PasswordEntity? { let passwordEntityFetchRequest = NSFetchRequest(entityName: "PasswordEntity") do { passwordEntityFetchRequest.predicate = NSPredicate(format: "path = %@ and isDir = %@", path, isDir.description) @@ -262,7 +260,7 @@ class PasswordStore { } } - func cloneRepository(remoteRepoURL: URL, + public func cloneRepository(remoteRepoURL: URL, credential: GitCredential, transferProgressBlock: @escaping (UnsafePointer, UnsafeMutablePointer) -> Void, checkoutProgressBlock: @escaping (String?, UInt, UInt) -> Void) throws { @@ -283,13 +281,13 @@ class PasswordStore { throw(error) } DispatchQueue.main.async { - Defaults[.lastSyncedTime] = Date() + SharedDefaults[.lastSyncedTime] = Date() self.updatePasswordEntityCoreData() NotificationCenter.default.post(name: .passwordStoreUpdated, object: nil) } } - func pullRepository(credential: GitCredential, transferProgressBlock: @escaping (UnsafePointer, UnsafeMutablePointer) -> Void) throws { + public func pullRepository(credential: GitCredential, transferProgressBlock: @escaping (UnsafePointer, UnsafeMutablePointer) -> Void) throws { guard let storeRepository = storeRepository else { throw AppError.RepositoryNotSetError } @@ -303,7 +301,7 @@ class PasswordStore { throw(error) } DispatchQueue.main.async { - Defaults[.lastSyncedTime] = Date() + SharedDefaults[.lastSyncedTime] = Date() self.setAllSynced() self.updatePasswordEntityCoreData() NotificationCenter.default.post(name: .passwordStoreUpdated, object: nil) @@ -364,7 +362,7 @@ class PasswordStore { } } - func getRecentCommits(count: Int) throws -> [GTCommit] { + public func getRecentCommits(count: Int) throws -> [GTCommit] { guard let storeRepository = storeRepository else { return [] } @@ -380,7 +378,7 @@ class PasswordStore { return commits } - func fetchPasswordEntityCoreData(parent: PasswordEntity?) -> [PasswordEntity] { + public func fetchPasswordEntityCoreData(parent: PasswordEntity?) -> [PasswordEntity] { let passwordEntityFetch = NSFetchRequest(entityName: "PasswordEntity") do { passwordEntityFetch.predicate = NSPredicate(format: "parent = %@", parent ?? 0) @@ -391,7 +389,7 @@ class PasswordStore { } } - func fetchPasswordEntityCoreData(withDir: Bool) -> [PasswordEntity] { + public func fetchPasswordEntityCoreData(withDir: Bool) -> [PasswordEntity] { let passwordEntityFetch = NSFetchRequest(entityName: "PasswordEntity") do { if !withDir { @@ -405,7 +403,7 @@ class PasswordStore { } - func fetchUnsyncedPasswords() -> [PasswordEntity] { + public func fetchUnsyncedPasswords() -> [PasswordEntity] { let passwordEntityFetchRequest = NSFetchRequest(entityName: "PasswordEntity") passwordEntityFetchRequest.predicate = NSPredicate(format: "synced = %i", 0) do { @@ -416,7 +414,7 @@ class PasswordStore { } } - func setAllSynced() { + public func setAllSynced() { let passwordEntities = fetchUnsyncedPasswords() for passwordEntity in passwordEntities { passwordEntity.synced = true @@ -430,7 +428,7 @@ class PasswordStore { } } - func getNumberOfUnsyncedPasswords() -> Int { + public func getNumberOfUnsyncedPasswords() -> Int { let passwordEntityFetchRequest = NSFetchRequest(entityName: "PasswordEntity") do { passwordEntityFetchRequest.predicate = NSPredicate(format: "synced = %i", 0) @@ -441,7 +439,7 @@ class PasswordStore { } - func getLatestUpdateInfo(filename: String) -> String { + public func getLatestUpdateInfo(filename: String) -> String { guard let storeRepository = storeRepository else { return "Unknown" } @@ -467,7 +465,7 @@ class PasswordStore { return autoFormattedDifference } - func updateRemoteRepo() { + public func updateRemoteRepo() { } private func gitAdd(path: String) throws { @@ -540,7 +538,7 @@ class PasswordStore { return branches.first } - func pushRepository(credential: GitCredential, transferProgressBlock: @escaping (UInt32, UInt32, Int, UnsafeMutablePointer) -> Void) throws { + public func pushRepository(credential: GitCredential, transferProgressBlock: @escaping (UInt32, UInt32, Int, UnsafeMutablePointer) -> Void) throws { guard let storeRepository = storeRepository else { throw AppError.RepositoryNotSetError } @@ -604,7 +602,7 @@ class PasswordStore { return ret } - func add(password: Password) throws -> PasswordEntity? { + public func add(password: Password) throws -> PasswordEntity? { try createDirectoryTree(at: password.url!) let newPasswordEntity = try addPasswordEntities(password: password) let saveURL = storeURL.appendingPathComponent(password.url!.path) @@ -624,7 +622,7 @@ class PasswordStore { NotificationCenter.default.post(name: .passwordStoreUpdated, object: nil) } - func edit(passwordEntity: PasswordEntity, password: Password) throws -> PasswordEntity? { + public func edit(passwordEntity: PasswordEntity, password: Password) throws -> PasswordEntity? { var newPasswordEntity: PasswordEntity? = passwordEntity if password.changed&PasswordChange.content.rawValue != 0 { @@ -670,7 +668,7 @@ class PasswordStore { } } - func saveUpdated(passwordEntity: PasswordEntity) { + public func saveUpdated(passwordEntity: PasswordEntity) { do { try context.save() } catch { @@ -678,7 +676,7 @@ class PasswordStore { } } - func deleteCoreData(entityName: String) { + public func deleteCoreData(entityName: String) { let deleteFetchRequest = NSFetchRequest(entityName: entityName) let deleteRequest = NSBatchDeleteRequest(fetchRequest: deleteFetchRequest) @@ -691,7 +689,7 @@ class PasswordStore { } } - func updateImage(passwordEntity: PasswordEntity, image: Data?) { + public func updateImage(passwordEntity: PasswordEntity, image: Data?) { guard let image = image else { return } @@ -714,7 +712,7 @@ class PasswordStore { } } - func erase() { + public func erase() { publicKey = nil privateKey = nil Utils.removeFileIfExists(at: storeURL) @@ -736,7 +734,7 @@ class PasswordStore { } // return the number of discarded commits - func reset() throws -> Int { + public func reset() throws -> Int { guard let storeRepository = storeRepository else { throw AppError.RepositoryNotSetError } @@ -761,7 +759,7 @@ class PasswordStore { } } - func numberOfLocalCommits() -> Int { + public func numberOfLocalCommits() -> Int { do { if let localCommits = try getLocalCommits() { return localCommits.count @@ -795,7 +793,7 @@ class PasswordStore { - func decrypt(passwordEntity: PasswordEntity, requestPGPKeyPassphrase: () -> String) throws -> Password? { + public func decrypt(passwordEntity: PasswordEntity, requestPGPKeyPassphrase: () -> String) throws -> Password? { let encryptedDataPath = storeURL.appendingPathComponent(passwordEntity.path!) let encryptedData = try Data(contentsOf: encryptedDataPath) var passphrase = self.pgpKeyPassphrase @@ -808,16 +806,16 @@ class PasswordStore { return Password(name: passwordEntity.name!, url: URL(string: escapedPath), plainText: plainText) } - func encrypt(password: Password) throws -> Data { + public func encrypt(password: Password) throws -> Data { guard let publicKey = pgp.getKeysOf(.public).first else { throw AppError.PGPPublicKeyNotExistError } let plainData = password.getPlainData() - let encryptedData = try pgp.encryptData(plainData, usingPublicKey: publicKey, armored: Defaults[.encryptInArmored]) + let encryptedData = try pgp.encryptData(plainData, usingPublicKey: publicKey, armored: SharedDefaults[.encryptInArmored]) return encryptedData } - func removePGPKeys() { + public func removePGPKeys() { Utils.removeFileIfExists(atPath: Globals.pgpPublicKeyPath) Utils.removeFileIfExists(atPath: Globals.pgpPrivateKeyPath) Defaults.remove(.pgpKeySource) @@ -831,18 +829,18 @@ class PasswordStore { privateKey = nil } - func removeGitSSHKeys() { + public func removeGitSSHKeys() { Utils.removeFileIfExists(atPath: Globals.gitSSHPrivateKeyPath) Defaults.remove(.gitSSHPrivateKeyArmor) Defaults.remove(.gitSSHPrivateKeyURL) Utils.removeKeychain(name: ".gitSSHPrivateKeyPassphrase") } - func gitSSHKeyExists() -> Bool { + public func gitSSHKeyExists() -> Bool { return fm.fileExists(atPath: Globals.gitSSHPrivateKeyPath) } - func pgpKeyExists() -> Bool { + public func pgpKeyExists() -> Bool { return fm.fileExists(atPath: Globals.pgpPublicKeyPath) && fm.fileExists(atPath: Globals.pgpPrivateKeyPath) } } diff --git a/pass/pass.xcdatamodeld/pass.xcdatamodel/contents b/passKit/pass.xcdatamodeld/pass.xcdatamodel/contents similarity index 88% rename from pass/pass.xcdatamodeld/pass.xcdatamodel/contents rename to passKit/pass.xcdatamodeld/pass.xcdatamodel/contents index 1a3b261..7b580bc 100644 --- a/pass/pass.xcdatamodeld/pass.xcdatamodel/contents +++ b/passKit/pass.xcdatamodeld/pass.xcdatamodel/contents @@ -1,5 +1,5 @@ - + diff --git a/passKit/passKit.h b/passKit/passKit.h new file mode 100644 index 0000000..cc3f069 --- /dev/null +++ b/passKit/passKit.h @@ -0,0 +1,15 @@ +// +// passKit.h +// passKit +// +// Created by Yishi Lin on 11/6/17. +// Copyright © 2017年 Bob Sun. All rights reserved. +// + +#import + +//! Project version number for passKit. +FOUNDATION_EXPORT double passKitVersionNumber; + +//! Project version string for passKit. +FOUNDATION_EXPORT const unsigned char passKitVersionString[]; diff --git a/passextension/ActionViewController.swift b/passextension/ActionViewController.swift index 2d25934..d4e17b7 100644 --- a/passextension/ActionViewController.swift +++ b/passextension/ActionViewController.swift @@ -8,10 +8,12 @@ import UIKit import MobileCoreServices +import passKit class ActionViewController: UIViewController { @IBOutlet weak var textView: UITextView! + let passwordStore = PasswordStore.shared override func viewDidLoad() { super.viewDidLoad() @@ -23,9 +25,32 @@ class ActionViewController: UIViewController { provider.loadItem(forTypeIdentifier: propertyList, options: nil, completionHandler: { (item, error) -> Void in let dictionary = item as! NSDictionary let results = dictionary[NSExtensionJavaScriptPreprocessingResultsKey] as! NSDictionary - let url = results["url"] as? String + let url = URL(string: (results["url"] as? String)!)?.host + + let numberFormatter = NumberFormatter() + numberFormatter.numberStyle = NumberFormatter.Style.decimal + + let numberOfPasswordsString = "Number of password:" + numberFormatter.string(from: NSNumber(value: self.passwordStore.numberOfPasswords))! + let sizeOfRepositoryString = "Size of repo:" + ByteCountFormatter.string(fromByteCount: Int64(self.passwordStore.sizeOfRepositoryByteCount), countStyle: ByteCountFormatter.CountStyle.file) + var numberOfCommits: UInt = 0 + + do { + if let _ = try self.passwordStore.storeRepository?.currentBranch().oid { + numberOfCommits = self.passwordStore.storeRepository?.numberOfCommits(inCurrentBranch: NSErrorPointer(nilLiteral: ())) ?? 0 + } + } catch { + print(error) + } + let numberOfCommitsString = "Number of commits:" + numberFormatter.string(from: NSNumber(value: numberOfCommits))! + + let gitURL = SharedDefaults[.gitURL]! + DispatchQueue.main.async { [weak self] in - self?.textView.text = url + self?.textView.text = url! + print(numberOfPasswordsString) + print(numberOfCommitsString) + print(sizeOfRepositoryString) + print(gitURL) } }) } else {