minor changes

This commit is contained in:
Dawid Kubicki 2018-11-19 15:09:22 +01:00
parent 1a500db453
commit 8aabac2404
76 changed files with 681 additions and 5092 deletions

View File

@ -7,7 +7,6 @@
objects = {
/* Begin PBXBuildFile section */
1271B2B6219AE272008108A5 /* BiometricTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1271B2B5219AE272008108A5 /* BiometricTest.swift */; };
18F5657D204DD7AF00F128ED /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 18F5657C204DD7AF00F128ED /* LaunchScreen.storyboard */; };
48DC83E42012A5D600F82C5D /* FriendCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 48DC83E22012A5D600F82C5D /* FriendCell.swift */; };
48DC83E52012A5D600F82C5D /* FriendCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 48DC83E32012A5D600F82C5D /* FriendCell.xib */; };
@ -29,11 +28,10 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1271B2B5219AE272008108A5 /* BiometricTest.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BiometricTest.swift; sourceTree = "<group>"; };
18F5657C204DD7AF00F128ED /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
48DC83E22012A5D600F82C5D /* FriendCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FriendCell.swift; sourceTree = "<group>"; };
48DC83E32012A5D600F82C5D /* FriendCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = FriendCell.xib; sourceTree = "<group>"; };
48EA9ABD200FC22200146CF7 /* bsmZadanie.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = bsmZadanie.app; sourceTree = BUILT_PRODUCTS_DIR; };
48EA9ABD200FC22200146CF7 /* Friendvatars.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Friendvatars.app; sourceTree = BUILT_PRODUCTS_DIR; };
48EA9AC0200FC22200146CF7 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
48EA9AC7200FC22200146CF7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
48EA9ACC200FC22200146CF7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@ -98,7 +96,7 @@
48EA9ABE200FC22200146CF7 /* Products */ = {
isa = PBXGroup;
children = (
48EA9ABD200FC22200146CF7 /* bsmZadanie.app */,
48EA9ABD200FC22200146CF7 /* Friendvatars.app */,
);
name = Products;
sourceTree = "<group>";
@ -131,7 +129,6 @@
isa = PBXGroup;
children = (
48EA9AE5201116B600146CF7 /* AuthViewController.swift */,
1271B2B5219AE272008108A5 /* BiometricTest.swift */,
48EA9AE6201116B600146CF7 /* AuthViewController.xib */,
48EA9AEE20117C6000146CF7 /* FriendsViewController.swift */,
48EA9AF020117C9000146CF7 /* NavigationController.swift */,
@ -188,23 +185,24 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
48EA9ABC200FC22200146CF7 /* bsmZadanie */ = {
48EA9ABC200FC22200146CF7 /* Friendvatars */ = {
isa = PBXNativeTarget;
buildConfigurationList = 48EA9ACF200FC22200146CF7 /* Build configuration list for PBXNativeTarget "bsmZadanie" */;
buildConfigurationList = 48EA9ACF200FC22200146CF7 /* Build configuration list for PBXNativeTarget "Friendvatars" */;
buildPhases = (
BD297E65C87DF0CC9A83FD57 /* [CP] Check Pods Manifest.lock */,
48EA9AB9200FC22200146CF7 /* Sources */,
48EA9ABA200FC22200146CF7 /* Frameworks */,
48EA9ABB200FC22200146CF7 /* Resources */,
52B361095004F9533772F347 /* [CP] Embed Pods Frameworks */,
CCE08048E2F58DCDD1B52E7E /* [CP] Copy Pods Resources */,
);
buildRules = (
);
dependencies = (
);
name = bsmZadanie;
name = Friendvatars;
productName = Friendvatars;
productReference = 48EA9ABD200FC22200146CF7 /* bsmZadanie.app */;
productReference = 48EA9ABD200FC22200146CF7 /* Friendvatars.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@ -223,7 +221,7 @@
};
};
};
buildConfigurationList = 48EA9AB8200FC22200146CF7 /* Build configuration list for PBXProject "bsmZadanie" */;
buildConfigurationList = 48EA9AB8200FC22200146CF7 /* Build configuration list for PBXProject "Friendvatars" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
@ -236,7 +234,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
48EA9ABC200FC22200146CF7 /* bsmZadanie */,
48EA9ABC200FC22200146CF7 /* Friendvatars */,
);
};
/* End PBXProject section */
@ -264,12 +262,10 @@
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-Friendvatars/Pods-Friendvatars-frameworks.sh",
"${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework",
"${BUILT_PRODUCTS_DIR}/KeychainAccess/KeychainAccess.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/CryptoSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainAccess.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
@ -294,6 +290,21 @@
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/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# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
CCE08048E2F58DCDD1B52E7E /* [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-Friendvatars/Pods-Friendvatars-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
@ -303,7 +314,6 @@
files = (
48EA9ADD20110EEE00146CF7 /* KeychainPasswordItem.swift in Sources */,
48EA9AF120117C9000146CF7 /* NavigationController.swift in Sources */,
1271B2B6219AE272008108A5 /* BiometricTest.swift in Sources */,
48EA9AED20117BFC00146CF7 /* UIColor+Additions.swift in Sources */,
48EA9AD4200FC48100146CF7 /* SplashViewController.swift in Sources */,
48EA9AE020110F2800146CF7 /* User.swift in Sources */,
@ -437,7 +447,7 @@
DEVELOPMENT_TEAM = WGZDF6CP4P;
INFOPLIST_FILE = Friendvatars/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.zadanie.bsm;
PRODUCT_BUNDLE_IDENTIFIER = com.dawidkubicki.Friendvatars;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
@ -453,7 +463,7 @@
DEVELOPMENT_TEAM = WGZDF6CP4P;
INFOPLIST_FILE = Friendvatars/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = com.zadanie.bsm;
PRODUCT_BUNDLE_IDENTIFIER = com.dawidkubicki.Friendvatars;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
@ -463,7 +473,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
48EA9AB8200FC22200146CF7 /* Build configuration list for PBXProject "bsmZadanie" */ = {
48EA9AB8200FC22200146CF7 /* Build configuration list for PBXProject "Friendvatars" */ = {
isa = XCConfigurationList;
buildConfigurations = (
48EA9ACD200FC22200146CF7 /* Debug */,
@ -472,7 +482,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
48EA9ACF200FC22200146CF7 /* Build configuration list for PBXNativeTarget "bsmZadanie" */ = {
48EA9ACF200FC22200146CF7 /* Build configuration list for PBXNativeTarget "Friendvatars" */ = {
isa = XCConfigurationList;
buildConfigurations = (
48EA9AD0200FC22200146CF7 /* Debug */,

View File

@ -7,12 +7,7 @@
<key>Friendvatars.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>bsmZadanie.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
<integer>0</integer>
</dict>
</dict>
</dict>

View File

@ -2,9 +2,9 @@
<Workspace
version = "1.0">
<FileRef
location = "group:Pods/Pods.xcodeproj">
location = "group:Friendvatars.xcodeproj">
</FileRef>
<FileRef
location = "group:/Users/dawidkubicki/Documents/uczelnia/bsm/bsm-project/bsmZadanie.xcodeproj">
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>

View File

@ -1,4 +1,3 @@
import UIKit
final class AppController {

View File

@ -1,5 +1,3 @@
import UIKit
@UIApplicationMain

View File

@ -1,182 +1,116 @@
{
"images":[
{
"idiom":"iphone",
"size":"20x20",
"scale":"2x",
"filename":"Icon-App-20x20@2x.png"
},
{
"idiom":"iphone",
"size":"20x20",
"scale":"3x",
"filename":"Icon-App-20x20@3x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"1x",
"filename":"Icon-App-29x29@1x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"2x",
"filename":"Icon-App-29x29@2x.png"
},
{
"idiom":"iphone",
"size":"29x29",
"scale":"3x",
"filename":"Icon-App-29x29@3x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"1x",
"filename":"Icon-App-40x40@1x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"2x",
"filename":"Icon-App-40x40@2x.png"
},
{
"idiom":"iphone",
"size":"40x40",
"scale":"3x",
"filename":"Icon-App-40x40@3x.png"
},
{
"idiom":"iphone",
"size":"57x57",
"scale":"1x",
"filename":"Icon-App-57x57@1x.png"
},
{
"idiom":"iphone",
"size":"57x57",
"scale":"2x",
"filename":"Icon-App-57x57@2x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"1x",
"filename":"Icon-App-60x60@1x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"2x",
"filename":"Icon-App-60x60@2x.png"
},
{
"idiom":"iphone",
"size":"60x60",
"scale":"3x",
"filename":"Icon-App-60x60@3x.png"
},
{
"idiom":"iphone",
"size":"76x76",
"scale":"1x",
"filename":"Icon-App-76x76@1x.png"
},
{
"idiom":"ipad",
"size":"20x20",
"scale":"1x",
"filename":"Icon-App-20x20@1x.png"
},
{
"idiom":"ipad",
"size":"20x20",
"scale":"2x",
"filename":"Icon-App-20x20@2x.png"
},
{
"idiom":"ipad",
"size":"29x29",
"scale":"1x",
"filename":"Icon-App-29x29@1x.png"
},
{
"idiom":"ipad",
"size":"29x29",
"scale":"2x",
"filename":"Icon-App-29x29@2x.png"
},
{
"idiom":"ipad",
"size":"40x40",
"scale":"1x",
"filename":"Icon-App-40x40@1x.png"
},
{
"idiom":"ipad",
"size":"40x40",
"scale":"2x",
"filename":"Icon-App-40x40@2x.png"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "Icon-Small-50x50@1x.png",
"scale" : "1x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "Icon-Small-50x50@2x.png",
"scale" : "2x"
},
{
"idiom":"ipad",
"size":"72x72",
"scale":"1x",
"filename":"Icon-App-72x72@1x.png"
},
{
"idiom":"ipad",
"size":"72x72",
"scale":"2x",
"filename":"Icon-App-72x72@2x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"1x",
"filename":"Icon-App-76x76@1x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"2x",
"filename":"Icon-App-76x76@2x.png"
},
{
"idiom":"ipad",
"size":"76x76",
"scale":"3x",
"filename":"Icon-App-76x76@3x.png"
},
{
"idiom":"ipad",
"size":"83.5x83.5",
"scale":"2x",
"filename":"Icon-App-83.5x83.5@2x.png"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "ItunesArtwork@2x.png",
"scale" : "1x"
}
],
"info":{
"version":1,
"author":"makeappicon"
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon-app-20@2x.png",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "icon-app-20@3x.png",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-app-29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "icon-app-29@3x copy.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon-app-40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "icon-app-40@3x.png",
"scale" : "3x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon-app-60@2x.png",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "icon-app-60@3x.png",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon20.png",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "Icon20@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon29.png",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "Icon29@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon40.png",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "Icon40@2x.png",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon76.png",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "Icon76@2x.png",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "Icon83.5@2x.png",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "Icon1024.png",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

@ -1,6 +0,0 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}

View File

@ -1,21 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "FaceID.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -1,21 +0,0 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "TouchID.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 415 KiB

After

Width:  |  Height:  |  Size: 260 KiB

View File

@ -1,4 +1,3 @@
import Foundation
import CryptoSwift

View File

@ -1,6 +1,4 @@
import UIKit
import KeychainAccess
final class AuthViewController: UIViewController {
@ -13,9 +11,6 @@ final class AuthViewController: UIViewController {
case password
}
@IBOutlet weak var txtSecret: UITextField!
@IBOutlet weak var imgBio: UIImageView!
@IBOutlet weak var lblSecret: UILabel!
@IBOutlet weak var containerView: UIView!
@IBOutlet weak var emailField: UITextField!
@IBOutlet weak var passwordField: UITextField!
@ -23,19 +18,9 @@ final class AuthViewController: UIViewController {
@IBOutlet weak var signInButton: UIButton!
@IBOutlet weak var bottomConstraint: NSLayoutConstraint!
let keychain = Keychain(service: "com.zadanie.bsm")
override func viewDidLoad() {
super.viewDidLoad()
if(biometricType == .touchID) {
imgBio.image = UIImage(named: "TouchID")
} else if(biometricType == .faceID) {
imgBio.image = UIImage(named: "FaceID")
} else if(biometricType == .none) {
print("Nie ma biometrycznego czytnika")
}
containerView.transform = CGAffineTransform(scaleX: 0, y: 0)
containerView.backgroundColor = .rwGreen
containerView.layer.cornerRadius = 7
@ -60,32 +45,6 @@ final class AuthViewController: UIViewController {
registerForKeyboardNotifications()
}
@IBAction func storeSecret(_ sender: Any) {
DispatchQueue.global().async {
do {
try self.keychain
.accessibility(.whenPasscodeSetThisDeviceOnly, authenticationPolicy: .userPresence)
.set(self.txtSecret.text!, key: "secret")
} catch let error {
print(error)
}
}
}
@IBAction func getSecret(_ sender: Any) {
DispatchQueue.global().async {
do {
let secret = try self.keychain
.authenticationPrompt("Użyj czynnika biometrycznego, żeby zobaczyć sekret")
.get("secret")
self.lblSecret.text = "Sekret to \(secret!)"
} catch let error {
print(error)
}
}
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)

View File

@ -15,12 +15,9 @@
<outlet property="bottomConstraint" destination="nvR-sM-xyu" id="sfO-yG-bij"/>
<outlet property="containerView" destination="fIM-wX-ThP" id="MCr-wf-hth"/>
<outlet property="emailField" destination="vrM-BE-Sxz" id="yN0-VF-tnI"/>
<outlet property="imgBio" destination="aiB-UR-Quk" id="Rf6-w3-c9d"/>
<outlet property="lblSecret" destination="SIk-oO-kOD" id="8c0-hE-Wb2"/>
<outlet property="passwordField" destination="XnE-em-cB7" id="I2k-JM-vRu"/>
<outlet property="signInButton" destination="hSR-Ry-zgR" id="67R-L3-h8e"/>
<outlet property="titleLabel" destination="WHD-fd-dhU" id="y4p-7Q-Mwd"/>
<outlet property="txtSecret" destination="NYv-x5-X0G" id="967-mt-IUu"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
@ -32,39 +29,19 @@
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="rwdevcon-bg" translatesAutoresizingMaskIntoConstraints="NO" id="tFe-fM-7UZ">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="UKRYTE WIADOMOŚCI" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WHD-fd-dhU">
<rect key="frame" x="32" y="69" width="311" height="31.5"/>
<constraints>
<constraint firstAttribute="height" constant="31.5" id="Hl5-V5-oUY"/>
<constraint firstAttribute="width" constant="311" id="O3M-ll-ype"/>
</constraints>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="NYv-x5-X0G">
<rect key="frame" x="83.5" y="400" width="208" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="Kc5-kK-ceQ"/>
<constraint firstAttribute="width" constant="208" id="Z2q-C8-b0N"/>
</constraints>
<nil key="textColor"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<textInputTraits key="textInputTraits"/>
</textField>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="fIM-wX-ThP">
<rect key="frame" x="32" y="112.5" width="311" height="256"/>
<rect key="frame" x="32" y="205.5" width="311" height="256"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" distribution="fillEqually" spacing="8" translatesAutoresizingMaskIntoConstraints="NO" id="47J-gQ-72v">
<rect key="frame" x="12" y="12" width="287" height="232"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" text="Login lub mail" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jBg-ue-wfi">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="249" text="Login" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jBg-ue-wfi">
<rect key="frame" x="0.0" y="0.0" width="287" height="40"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Podaj swoj login/hasło" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="vrM-BE-Sxz">
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Podaj swój login" borderStyle="roundedRect" placeholder="Enter your email" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="vrM-BE-Sxz">
<rect key="frame" x="0.0" y="48" width="287" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="o9g-dR-A9f"/>
@ -79,7 +56,7 @@
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="roundedRect" placeholder="Podaj swoje hasło" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="XnE-em-cB7">
<textField opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" text="Podaj hasło" borderStyle="roundedRect" placeholder="Enter your password" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="XnE-em-cB7">
<rect key="frame" x="0.0" y="144" width="287" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="r71-Sl-CjK"/>
@ -91,7 +68,7 @@
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hSR-Ry-zgR">
<rect key="frame" x="0.0" y="192" width="287" height="40"/>
<fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/>
<state key="normal" title="Zobacz zaszyfrowaną wiadomość">
<state key="normal" title="Zobacz notatkę">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
@ -109,56 +86,16 @@
</subviews>
<color key="backgroundColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
<constraints>
<constraint firstAttribute="height" constant="256" id="7Lf-Jc-Y1f"/>
<constraint firstAttribute="trailing" secondItem="47J-gQ-72v" secondAttribute="trailing" constant="12" id="WkR-AZ-hfk"/>
<constraint firstItem="47J-gQ-72v" firstAttribute="centerY" secondItem="fIM-wX-ThP" secondAttribute="centerY" id="Yml-f5-C1g"/>
<constraint firstAttribute="width" constant="311" id="eHP-rK-M2p"/>
<constraint firstItem="47J-gQ-72v" firstAttribute="top" secondItem="fIM-wX-ThP" secondAttribute="top" constant="12" id="lYI-As-5gY"/>
<constraint firstAttribute="bottom" secondItem="47J-gQ-72v" secondAttribute="bottom" constant="12" id="pTj-6w-3fL"/>
<constraint firstItem="47J-gQ-72v" firstAttribute="leading" secondItem="fIM-wX-ThP" secondAttribute="leading" constant="12" id="tLY-wi-TIE"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="eHu-E9-yMk">
<rect key="frame" x="141" y="438" width="93" height="30"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<constraints>
<constraint firstAttribute="width" constant="93" id="WtV-69-tY5"/>
<constraint firstAttribute="height" constant="30" id="pYP-ke-zF0"/>
</constraints>
<state key="normal" title="Zapisz sekret">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="storeSecret:" destination="-1" eventType="touchUpInside" id="sVO-a8-q7z"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="0xi-uO-9hm">
<rect key="frame" x="143.5" y="476" width="88" height="30"/>
<color key="backgroundColor" cocoaTouchSystemColor="darkTextColor"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="sbM-9x-AyV"/>
<constraint firstAttribute="width" constant="88" id="uiH-pa-VyX"/>
</constraints>
<state key="normal" title="Pokaż sekret">
<color key="titleColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="getSecret:" destination="-1" eventType="touchUpInside" id="cye-aX-2am"/>
</connections>
</button>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="aiB-UR-Quk">
<rect key="frame" x="152.5" y="514" width="70" height="70"/>
<constraints>
<constraint firstAttribute="height" constant="70" id="B0t-Rd-p9j"/>
<constraint firstAttribute="width" constant="70" id="LJW-QK-sy1"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="SIk-oO-kOD">
<rect key="frame" x="32" y="620" width="311" height="0.0"/>
<constraints>
<constraint firstAttribute="width" constant="311" id="KVE-6x-sQC"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="BSM ZADANIE" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="WHD-fd-dhU">
<rect key="frame" x="32" y="162" width="311" height="31.5"/>
<fontDescription key="fontDescription" style="UICTFontTextStyleTitle1"/>
<color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
@ -166,36 +103,21 @@
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="fIM-wX-ThP" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="32" id="0Uu-L2-f41"/>
<constraint firstItem="fIM-wX-ThP" firstAttribute="top" secondItem="WHD-fd-dhU" secondAttribute="bottom" constant="7.5" id="0zh-0H-6hl"/>
<constraint firstItem="fIM-wX-ThP" firstAttribute="centerY" relation="lessThanOrEqual" secondItem="i5M-Pr-FkT" secondAttribute="centerY" id="6Ln-YA-ghi"/>
<constraint firstItem="NYv-x5-X0G" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="9SD-Fn-k8d"/>
<constraint firstItem="0xi-uO-9hm" firstAttribute="top" secondItem="eHu-E9-yMk" secondAttribute="bottom" constant="8" id="Q8W-5c-khU"/>
<constraint firstItem="SIk-oO-kOD" firstAttribute="top" secondItem="aiB-UR-Quk" secondAttribute="bottom" constant="36" id="QFy-ww-vht"/>
<constraint firstItem="SIk-oO-kOD" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="QgF-DT-GKx"/>
<constraint firstItem="0xi-uO-9hm" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="UeN-Ml-sk1"/>
<constraint firstItem="aiB-UR-Quk" firstAttribute="top" secondItem="0xi-uO-9hm" secondAttribute="bottom" constant="8" id="WKd-0t-34H"/>
<constraint firstItem="fIM-wX-ThP" firstAttribute="top" secondItem="WHD-fd-dhU" secondAttribute="bottom" constant="12" id="aP2-gg-QM4"/>
<constraint firstItem="WHD-fd-dhU" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" constant="49" id="buf-vK-MV1"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="fIM-wX-ThP" secondAttribute="trailing" constant="32" id="eeV-zF-hQt"/>
<constraint firstItem="tFe-fM-7UZ" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="feS-0C-4ss"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="bottom" secondItem="SIk-oO-kOD" secondAttribute="bottom" constant="47" id="gPG-53-d0t"/>
<constraint firstAttribute="bottom" secondItem="tFe-fM-7UZ" secondAttribute="bottom" id="lKC-qE-CTz"/>
<constraint firstItem="WHD-fd-dhU" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="mjr-Xm-Z79"/>
<constraint firstItem="WHD-fd-dhU" firstAttribute="leading" secondItem="fIM-wX-ThP" secondAttribute="leading" id="n92-TL-EOh"/>
<constraint firstAttribute="bottom" secondItem="fIM-wX-ThP" secondAttribute="bottom" priority="750" constant="100" id="nvR-sM-xyu"/>
<constraint firstItem="fIM-wX-ThP" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="pxi-l5-vSk"/>
<constraint firstItem="tFe-fM-7UZ" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="qHd-7e-hwP"/>
<constraint firstItem="aiB-UR-Quk" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="rok-Oz-Hfe"/>
<constraint firstItem="eHu-E9-yMk" firstAttribute="top" secondItem="NYv-x5-X0G" secondAttribute="bottom" constant="8" id="sHf-0Z-bMJ"/>
<constraint firstItem="WHD-fd-dhU" firstAttribute="trailing" secondItem="fIM-wX-ThP" secondAttribute="trailing" id="sMj-GC-DPU"/>
<constraint firstItem="eHu-E9-yMk" firstAttribute="centerX" secondItem="i5M-Pr-FkT" secondAttribute="centerX" id="tmc-q1-o9K"/>
<constraint firstAttribute="trailing" secondItem="tFe-fM-7UZ" secondAttribute="trailing" id="zYh-8O-PJL"/>
</constraints>
<viewLayoutGuide key="safeArea" id="fnl-2z-Ty3"/>
<point key="canvasLocation" x="138.40000000000001" y="152.47376311844079"/>
</view>
</objects>
<resources>
<image name="rwdevcon-bg" width="1440" height="2880"/>
<image name="rwdevcon-bg" width="312" height="310.32000732421875"/>
</resources>
</document>

View File

@ -1,9 +0,0 @@
import Foundation
import LocalAuthentication
var biometricType: LABiometryType {
let authContext = LAContext()
return authContext.biometryType
}

View File

@ -1,4 +1,3 @@
import Foundation
extension DispatchQueue {

View File

@ -1,4 +1,3 @@
import UIKit
class FriendCell: UITableViewCell {

View File

@ -1,4 +1,3 @@
import UIKit
import CryptoSwift
@ -18,7 +17,7 @@ final class FriendsViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
title = "Zabezpieczona wiadomość"
title = "BSM ZADANIE"
let reuseIdentifier = String(describing: FriendCell.self)
tableView.register(
@ -34,10 +33,7 @@ final class FriendsViewController: UITableViewController {
)
friends = [
User(name: "Zakodowana1", email: "ukryty tekst1"),
User(name: "Zakodowana2", email: "ukryty tekst2"),
User(name: "Zakodowana3", email: "ukryty tekst3"),
User(name: "Zakodowana4", email: "ukryty tekst4")
User(name: "Bob Appleseed", email: "ryha26+bob@gmail.com")
]
}
@ -60,7 +56,7 @@ final class FriendsViewController: UITableViewController {
}
override func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
return section == 0 ? "Ja" : "Ukryte wiadomości"
return section == 0 ? "Me" : "Friends"
}
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
@ -76,7 +72,7 @@ final class FriendsViewController: UITableViewController {
} else {
let emailHash = user.email.trimmingCharacters(in: .whitespacesAndNewlines)
.lowercased()
.sha1()
.md5()
if let url = URL(string: "https://www.gravatar.com/avatar/" + emailHash) {
URLSession.shared.dataTask(with: url) { data, response, error in

View File

@ -1,4 +1,3 @@
import UIKit
final class NavigationController: UINavigationController {

View File

@ -1,5 +1,3 @@
import Foundation
final class Settings {

View File

@ -1,4 +1,3 @@
import UIKit
final class SplashViewController: UIViewController {

View File

@ -1,8 +1,7 @@
import UIKit
extension UIColor {
static let rwGreen = UIColor(red: 0.0/255.0, green: 104.0/255.0, blue: 55.0/255.0, alpha: 1.0)
static let rwGreen = UIColor(red: 13.0/255.0, green: 12.0/255.0, blue: 29.0/255.0, alpha: 1.0)
}

View File

@ -1,4 +1,3 @@
import Foundation
struct User: Codable {

View File

@ -3,5 +3,4 @@ use_frameworks!
target 'Friendvatars' do
pod 'CryptoSwift'
pod 'KeychainAccess'
end

View File

@ -1,20 +1,12 @@
PODS:
- CryptoSwift (0.8.1)
- KeychainAccess (3.1.2)
DEPENDENCIES:
- CryptoSwift
- KeychainAccess
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- CryptoSwift
- KeychainAccess
SPEC CHECKSUMS:
CryptoSwift: 4b07d5b508c1eb67bfa314a727b705f8048a85de
KeychainAccess: b3816fddcf28aa29d94b10ec305cd52be14c472b
PODFILE CHECKSUM: 2ccd80ba9984103c7eb7f1175a88d0a90df6c731
PODFILE CHECKSUM: bbf4ad9f3f2f1429ecda282ecb446c084363a23f
COCOAPODS: 1.5.3
COCOAPODS: 1.3.1

View File

@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2014 kishikawa katsumi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

File diff suppressed because it is too large Load Diff

View File

@ -1,602 +0,0 @@
# KeychainAccess
[![CI Status](http://img.shields.io/travis/kishikawakatsumi/KeychainAccess.svg)](https://travis-ci.org/kishikawakatsumi/KeychainAccess)
[![codecov](https://codecov.io/gh/kishikawakatsumi/KeychainAccess/branch/master/graph/badge.svg)](https://codecov.io/gh/kishikawakatsumi/KeychainAccess)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![Version](https://img.shields.io/cocoapods/v/KeychainAccess.svg)](http://cocoadocs.org/docsets/KeychainAccess)
[![Platform](https://img.shields.io/cocoapods/p/KeychainAccess.svg)](http://cocoadocs.org/docsets/KeychainAccess)
[![Swift 3.x](https://img.shields.io/badge/Swift-3.x-orange.svg?style=flat)](https://swift.org/)
[![Swift 4.0](https://img.shields.io/badge/Swift-4.0-orange.svg?style=flat)](https://swift.org/)
[![Swift 4.1](https://img.shields.io/badge/Swift-4.1-orange.svg?style=flat)](https://swift.org/)
[![Swift 4.2](https://img.shields.io/badge/Swift-4.2-orange.svg?style=flat)](https://swift.org/)
KeychainAccess is a simple Swift wrapper for Keychain that works on iOS and OS X. Makes using Keychain APIs extremely easy and much more palatable to use in Swift.
<img src="https://raw.githubusercontent.com/kishikawakatsumi/KeychainAccess/master/Screenshots/01.png" width="320px" />
<img src="https://raw.githubusercontent.com/kishikawakatsumi/KeychainAccess/master/Screenshots/02.png" width="320px" />
<img src="https://raw.githubusercontent.com/kishikawakatsumi/KeychainAccess/master/Screenshots/03.png" width="320px" />
## :bulb: Features
- Simple interface
- Support access group
- [Support accessibility](#accessibility)
- [Support iCloud sharing](#icloud_sharing)
- **[Support TouchID and Keychain integration (iOS 8+)](#touch_id_integration)**
- **[Support Shared Web Credentials (iOS 8+)](#shared_web_credentials)**
- [Works on both iOS & OS X](#requirements)
- [watchOS and tvOS are supported](#requirements)
- **[Swift 4 & Swift 3 compatible](#requirements)**
## :book: Usage
##### :eyes: See also:
- [:link: iOS Example Project](https://github.com/kishikawakatsumi/KeychainAccess/tree/master/Examples/Example-iOS)
### :key: Basics
#### Saving Application Password
```swift
let keychain = Keychain(service: "com.example.github-token")
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
#### Saving Internet Password
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .https)
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
### :key: Instantiation
#### Create Keychain for Application Password
```swift
let keychain = Keychain(service: "com.example.github-token")
```
```swift
let keychain = Keychain(service: "com.example.github-token", accessGroup: "12ABCD3E4F.shared")
```
#### Create Keychain for Internet Password
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .https)
```
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .https, authenticationType: .htmlForm)
```
### :key: Adding an item
#### subscripting
##### for String
```swift
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
```swift
keychain[string: "kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
##### for NSData
```swift
keychain[data: "secret"] = NSData(contentsOfFile: "secret.bin")
```
#### set method
```swift
keychain.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
```
#### error handling
```swift
do {
try keychain.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
}
catch let error {
print(error)
}
```
### :key: Obtaining an item
#### subscripting
##### for String (If the value is NSData, attempt to convert to String)
```swift
let token = keychain["kishikawakatsumi"]
```
```swift
let token = keychain[string: "kishikawakatsumi"]
```
##### for NSData
```swift
let secretData = keychain[data: "secret"]
```
#### get methods
##### as String
```swift
let token = try? keychain.get("kishikawakatsumi")
```
```swift
let token = try? keychain.getString("kishikawakatsumi")
```
##### as NSData
```swift
let data = try? keychain.getData("kishikawakatsumi")
```
### :key: Removing an item
#### subscripting
```swift
keychain["kishikawakatsumi"] = nil
```
#### remove method
```swift
do {
try keychain.remove("kishikawakatsumi")
} catch let error {
print("error: \(error)")
}
```
### :key: Set Label and Comment
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .https)
do {
try keychain
.label("github.com (kishikawakatsumi)")
.comment("github access token")
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
print("error: \(error)")
}
```
### :key: Obtaining Other Attributes
#### PersistentRef
```swift
let keychain = Keychain()
let persistentRef = keychain[attributes: "kishikawakatsumi"].persistentRef
...
```
#### Creation Date
```swift
let keychain = Keychain()
let creationDate = keychain[attributes: "kishikawakatsumi"].creationDate
...
```
#### All Attributes
```swift
let keychain = Keychain()
do {
let attributes = try keychain.get("kishikawakatsumi") { $0 }
print(attributes.comment)
print(attributes.label)
print(attributes.creator)
...
} catch let error {
print("error: \(error)")
}
```
##### subscripting
```swift
let keychain = Keychain()
let attributes = keychain[attributes: "kishikawakatsumi"]
print(attributes.comment)
print(attributes.label)
print(attributes.creator)
```
### :key: Configuration (Accessibility, Sharing, iCloud Sync)
**Provides fluent interfaces**
```swift
let keychain = Keychain(service: "com.example.github-token")
.label("github.com (kishikawakatsumi)")
.synchronizable(true)
.accessibility(.afterFirstUnlock)
```
#### <a name="accessibility"> Accessibility
##### Default accessibility matches background application (=kSecAttrAccessibleAfterFirstUnlock)
```swift
let keychain = Keychain(service: "com.example.github-token")
```
##### For background application
###### Creating instance
```swift
let keychain = Keychain(service: "com.example.github-token")
.accessibility(.afterFirstUnlock)
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
###### One-shot
```swift
let keychain = Keychain(service: "com.example.github-token")
do {
try keychain
.accessibility(.afterFirstUnlock)
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
print("error: \(error)")
}
```
##### For foreground application
###### Creating instance
```swift
let keychain = Keychain(service: "com.example.github-token")
.accessibility(.whenUnlocked)
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
###### One-shot
```swift
let keychain = Keychain(service: "com.example.github-token")
do {
try keychain
.accessibility(.whenUnlocked)
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
print("error: \(error)")
}
```
#### :couple: Sharing Keychain items
```swift
let keychain = Keychain(service: "com.example.github-token", accessGroup: "12ABCD3E4F.shared")
```
#### <a name="icloud_sharing"> :arrows_counterclockwise: Synchronizing Keychain items with iCloud
###### Creating instance
```swift
let keychain = Keychain(service: "com.example.github-token")
.synchronizable(true)
keychain["kishikawakatsumi"] = "01234567-89ab-cdef-0123-456789abcdef"
```
###### One-shot
```swift
let keychain = Keychain(service: "com.example.github-token")
do {
try keychain
.synchronizable(true)
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
print("error: \(error)")
}
```
### <a name="touch_id_integration"> :fu: Touch ID integration
**Any Operation that require authentication must be run in the background thread.**
**If you run in the main thread, UI thread will lock for the system to try to display the authentication dialog.**
#### :closed_lock_with_key: Adding a Touch ID protected item
If you want to store the Touch ID protected Keychain item, specify `accessibility` and `authenticationPolicy` attributes.
```swift
let keychain = Keychain(service: "com.example.github-token")
DispatchQueue.global().async {
do {
// Should be the secret invalidated when passcode is removed? If not then use `.WhenUnlocked`
try keychain
.accessibility(.whenPasscodeSetThisDeviceOnly, authenticationPolicy: .userPresence)
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
// Error handling if needed...
}
}
```
#### :closed_lock_with_key: Updating a Touch ID protected item
The same way as when adding.
**Do not run in the main thread if there is a possibility that the item you are trying to add already exists, and protected.**
**Because updating protected items requires authentication.**
Additionally, you want to show custom authentication prompt message when updating, specify an `authenticationPrompt` attribute.
If the item not protected, the `authenticationPrompt` parameter just be ignored.
```swift
let keychain = Keychain(service: "com.example.github-token")
DispatchQueue.global().async {
do {
// Should be the secret invalidated when passcode is removed? If not then use `.WhenUnlocked`
try keychain
.accessibility(.whenPasscodeSetThisDeviceOnly, authenticationPolicy: .userPresence)
.authenticationPrompt("Authenticate to update your access token")
.set("01234567-89ab-cdef-0123-456789abcdef", key: "kishikawakatsumi")
} catch let error {
// Error handling if needed...
}
}
```
#### :closed_lock_with_key: Obtaining a Touch ID protected item
The same way as when you get a normal item. It will be displayed automatically Touch ID or passcode authentication If the item you try to get is protected.
If you want to show custom authentication prompt message, specify an `authenticationPrompt` attribute.
If the item not protected, the `authenticationPrompt` parameter just be ignored.
```swift
let keychain = Keychain(service: "com.example.github-token")
DispatchQueue.global().async {
do {
let password = try keychain
.authenticationPrompt("Authenticate to login to server")
.get("kishikawakatsumi")
print("password: \(password)")
} catch let error {
// Error handling if needed...
}
}
```
#### :closed_lock_with_key: Removing a Touch ID protected item
The same way as when you remove a normal item.
There is no way to show Touch ID or passcode authentication when removing Keychain items.
```swift
let keychain = Keychain(service: "com.example.github-token")
do {
try keychain.remove("kishikawakatsumi")
} catch let error {
// Error handling if needed...
}
```
### <a name="shared_web_credentials"> :key: Shared Web Credentials
> Shared web credentials is a programming interface that enables native iOS apps to share credentials with their website counterparts. For example, a user may log in to a website in Safari, entering a user name and password, and save those credentials using the iCloud Keychain. Later, the user may run a native app from the same developer, and instead of the app requiring the user to reenter a user name and password, shared web credentials gives it access to the credentials that were entered earlier in Safari. The user can also create new accounts, update passwords, or delete her account from within the app. These changes are then saved and used by Safari.
<https://developer.apple.com/library/ios/documentation/Security/Reference/SharedWebCredentialsRef/>
```swift
let keychain = Keychain(server: "https://www.kishikawakatsumi.com", protocolType: .HTTPS)
let username = "kishikawakatsumi@mac.com"
// First, check the credential in the app's Keychain
if let password = try? keychain.get(username) {
// If found password in the Keychain,
// then log into the server
} else {
// If not found password in the Keychain,
// try to read from Shared Web Credentials
keychain.getSharedPassword(username) { (password, error) -> () in
if password != nil {
// If found password in the Shared Web Credentials,
// then log into the server
// and save the password to the Keychain
keychain[username] = password
} else {
// If not found password either in the Keychain also Shared Web Credentials,
// prompt for username and password
// Log into server
// If the login is successful,
// save the credentials to both the Keychain and the Shared Web Credentials.
keychain[username] = inputPassword
keychain.setSharedPassword(inputPassword, account: username)
}
}
}
```
#### Request all associated domain's credentials
```swift
Keychain.requestSharedWebCredential { (credentials, error) -> () in
}
```
#### Generate strong random password
Generate strong random password that is in the same format used by Safari autofill (xxx-xxx-xxx-xxx).
```swift
let password = Keychain.generatePassword() // => Nhu-GKm-s3n-pMx
```
#### How to set up Shared Web Credentials
> 1. Add a com.apple.developer.associated-domains entitlement to your app. This entitlement must include all the domains with which you want to share credentials.
> 2. Add an apple-app-site-association file to your website. This file must include application identifiers for all the apps with which the site wants to share credentials, and it must be properly signed.
> 3. When the app is installed, the system downloads and verifies the site association file for each of its associated domains. If the verification is successful, the app is associated with the domain.
**More details:**
<https://developer.apple.com/library/ios/documentation/Security/Reference/SharedWebCredentialsRef/>
### :key: Debugging
#### Display all stored items if print keychain object
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .https)
print("\(keychain)")
```
```
=>
[
[authenticationType: default, key: kishikawakatsumi, server: github.com, class: internetPassword, protocol: https]
[authenticationType: default, key: hirohamada, server: github.com, class: internetPassword, protocol: https]
[authenticationType: default, key: honeylemon, server: github.com, class: internetPassword, protocol: https]
]
```
#### Obtaining all stored keys
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .https)
let keys = keychain.allKeys()
for key in keys {
print("key: \(key)")
}
```
```
=>
key: kishikawakatsumi
key: hirohamada
key: honeylemon
```
#### Obtaining all stored items
```swift
let keychain = Keychain(server: "https://github.com", protocolType: .https)
let items = keychain.allItems()
for item in items {
print("item: \(item)")
}
```
```
=>
item: [authenticationType: Default, key: kishikawakatsumi, server: github.com, class: InternetPassword, protocol: https]
item: [authenticationType: Default, key: hirohamada, server: github.com, class: InternetPassword, protocol: https]
item: [authenticationType: Default, key: honeylemon, server: github.com, class: InternetPassword, protocol: https]
```
## Requirements
| | OS | Swift |
|------------|----------------------------------------|---------------|
| **v1.1.x** | iOS 7+, OSX 10.9+ | 1.1 |
| **v1.2.x** | iOS 7+, OSX 10.9+ | 1.2 |
| **v2.0.x** | iOS 7+, OSX 10.9+, watchOS 2+ | 2.0 |
| **v2.1.x** | iOS 7+, OSX 10.9+, watchOS 2+ | 2.0 |
| **v2.2.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.0, 2.1 |
| **v2.3.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.0, 2.1, 2.2 |
| **v2.4.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 2.2, 2.3 |
| **v3.0.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 3.x |
| **v3.1.x** | iOS 8+, OSX 10.9+, watchOS 2+, tvOS 9+ | 4.0, 4.1, 4.2 |
## Installation
### CocoaPods
KeychainAccess is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following lines to your Podfile:
```ruby
use_frameworks!
pod 'KeychainAccess'
```
### Carthage
KeychainAccess is available through [Carthage](https://github.com/Carthage/Carthage). To install
it, simply add the following line to your Cartfile:
`github "kishikawakatsumi/KeychainAccess"`
### Swift Package Manager
KeychainAccess is also available through [Swift Package Manager](https://github.com/apple/swift-package-manager/).
First, create `Package.swift` that its package declaration includes:
```swift
import PackageDescription
let package = Package(
dependencies: [
.Package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", majorVersion: 2)
]
)
```
Then, type
```shell
$ swift build
```
### To manually add to your project
1. Add `Lib/KeychainAccess.xcodeproj` to your project
2. Link `KeychainAccess.framework` with your target
3. Add `Copy Files Build Phase` to include the framework to your application bundle
_See [iOS Example Project](https://github.com/kishikawakatsumi/KeychainAccess/tree/master/Examples/Example-iOS) as reference._
<img src="https://raw.githubusercontent.com/kishikawakatsumi/KeychainAccess/master/Screenshots/Installation.png" width="800px" />
## Author
kishikawa katsumi, kishikawakatsumi@mac.com
## License
KeychainAccess is available under the MIT license. See the LICENSE file for more info.

12
Pods/Manifest.lock generated
View File

@ -1,20 +1,12 @@
PODS:
- CryptoSwift (0.8.1)
- KeychainAccess (3.1.2)
DEPENDENCIES:
- CryptoSwift
- KeychainAccess
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- CryptoSwift
- KeychainAccess
SPEC CHECKSUMS:
CryptoSwift: 4b07d5b508c1eb67bfa314a727b705f8048a85de
KeychainAccess: b3816fddcf28aa29d94b10ec305cd52be14c472b
PODFILE CHECKSUM: 2ccd80ba9984103c7eb7f1175a88d0a90df6c731
PODFILE CHECKSUM: bbf4ad9f3f2f1429ecda282ecb446c084363a23f
COCOAPODS: 1.5.3
COCOAPODS: 1.3.1

File diff suppressed because it is too large Load Diff

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "16F79934C9B37C10283012C65CA992AB"
BlueprintName = "CryptoSwift"
ReferencedContainer = "container:Pods.xcodeproj"
BuildableName = "CryptoSwift.framework">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,60 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForAnalyzing = "YES"
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1630C0AC0CCE2704C3F517D1DFD56586"
BlueprintName = "KeychainAccess"
ReferencedContainer = "container:Pods.xcodeproj"
BuildableName = "KeychainAccess.framework">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
buildConfiguration = "Debug"
allowLocationSimulation = "YES">
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "93927B2E03466C85C8B18A3BA96CAE46"
BuildableName = "Pods_Friendvatars.framework"
BlueprintName = "Pods-Friendvatars"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "93927B2E03466C85C8B18A3BA96CAE46"
BuildableName = "Pods_Friendvatars.framework"
BlueprintName = "Pods-Friendvatars"
ReferencedContainer = "container:Pods.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -4,29 +4,16 @@
<dict>
<key>SchemeUserState</key>
<dict>
<key>CryptoSwift.xcscheme</key>
<key>CryptoSwift.xcscheme_^#shared#^_</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>0</integer>
</dict>
<key>KeychainAccess.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>Pods-Friendvatars.xcscheme</key>
<key>Pods-Friendvatars.xcscheme_^#shared#^_</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict/>
</dict>
</plist>

View File

@ -1,9 +1,10 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift
CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/CryptoSwift
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
GCC_UNROLL_LOOPS = YES
HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/CryptoSwift
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>3.1.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -1,5 +0,0 @@
#import <Foundation/Foundation.h>
@interface PodsDummy_KeychainAccess : NSObject
@end
@implementation PodsDummy_KeychainAccess
@end

View File

@ -1,12 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif

View File

@ -1,16 +0,0 @@
#ifdef __OBJC__
#import <UIKit/UIKit.h>
#else
#ifndef FOUNDATION_EXPORT
#if defined(__cplusplus)
#define FOUNDATION_EXPORT extern "C"
#else
#define FOUNDATION_EXPORT extern
#endif
#endif
#endif
FOUNDATION_EXPORT double KeychainAccessVersionNumber;
FOUNDATION_EXPORT const unsigned char KeychainAccessVersionString[];

View File

@ -1,6 +0,0 @@
framework module KeychainAccess {
umbrella header "KeychainAccess-umbrella.h"
export *
module * { export * }
}

View File

@ -1,9 +0,0 @@
CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/KeychainAccess
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_ROOT = ${SRCROOT}
PODS_TARGET_SRCROOT = ${PODS_ROOT}/KeychainAccess
PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier}
SKIP_INSTALL = YES

View File

@ -14,30 +14,4 @@ Permission is granted to anyone to use this software for any purpose,including c
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
- This notice may not be removed or altered from any source or binary distribution.
## KeychainAccess
The MIT License (MIT)
Copyright (c) 2014 kishikawa katsumi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Generated by CocoaPods - https://cocoapods.org

View File

@ -32,38 +32,6 @@ Permission is granted to anyone to use this software for any purpose,including c
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>The MIT License (MIT)
Copyright (c) 2014 kishikawa katsumi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
</string>
<key>License</key>
<string>MIT</string>
<key>Title</key>
<string>KeychainAccess</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>FooterText</key>
<string>Generated by CocoaPods - https://cocoapods.org</string>

View File

@ -1,28 +1,15 @@
#!/bin/sh
set -e
set -u
set -o pipefail
if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then
# If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy
# frameworks to, so exit 0 (signalling the script phase was successful).
exit 0
fi
echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}"
SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}"
# Used as a return value for each invocation of `strip_invalid_archs` function.
STRIP_BINARY_RETVAL=0
# This protects against multiple targets copying the same framework dependency at the same time. The solution
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
# Copies and strips a vendored framework
install_framework()
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
@ -71,40 +58,21 @@ install_framework()
fi
}
# Copies and strips a vendored dSYM
# Copies the dSYM of a vendored framework
install_dsym() {
local source="$1"
if [ -r "$source" ]; then
# Copy the dSYM into a the targets temp dir.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}"
local basename
basename="$(basename -s .framework.dSYM "$source")"
binary="${DERIVED_FILES_DIR}/${basename}.framework.dSYM/Contents/Resources/DWARF/${basename}"
# Strip invalid architectures so "fat" simulator / device frameworks work on device
if [[ "$(file "$binary")" == *"Mach-O dSYM companion"* ]]; then
strip_invalid_archs "$binary"
fi
if [[ $STRIP_BINARY_RETVAL == 1 ]]; then
# Move the stripped file into its final destination.
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.framework.dSYM" "${DWARF_DSYM_FOLDER_PATH}"
else
# The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing.
touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.framework.dSYM"
fi
echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\""
rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}"
fi
}
# Signs a framework with the provided identity
code_sign_if_enabled() {
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then
# Use the current code_sign_identitiy
echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'"
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
code_sign_cmd="$code_sign_cmd &"
@ -117,18 +85,10 @@ code_sign_if_enabled() {
# Strip invalid architectures
strip_invalid_archs() {
binary="$1"
# Get architectures for current target binary
binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)"
# Intersect them with the architectures we are building for
intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)"
# If there are no archs supported by this binary then warn the user
if [[ -z "$intersected_archs" ]]; then
echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)."
STRIP_BINARY_RETVAL=0
return
fi
# Get architectures for current file
archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)"
stripped=""
for arch in $binary_archs; do
for arch in $archs; do
if ! [[ "${ARCHS}" == *"$arch"* ]]; then
# Strip non-valid architectures in-place
lipo -remove "$arch" -output "$binary" "$binary" || exit 1
@ -138,17 +98,14 @@ strip_invalid_archs() {
if [[ "$stripped" ]]; then
echo "Stripped $binary of architectures:$stripped"
fi
STRIP_BINARY_RETVAL=1
}
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework"
install_framework "${BUILT_PRODUCTS_DIR}/KeychainAccess/KeychainAccess.framework"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_framework "${BUILT_PRODUCTS_DIR}/CryptoSwift/CryptoSwift.framework"
install_framework "${BUILT_PRODUCTS_DIR}/KeychainAccess/KeychainAccess.framework"
fi
if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then
wait

View File

@ -1,13 +1,5 @@
#!/bin/sh
set -e
set -u
set -o pipefail
if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then
# If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy
# resources to, so exit 0 (signalling the script phase was successful).
exit 0
fi
mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
@ -20,7 +12,7 @@ XCASSET_FILES=()
# was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html
RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????")
case "${TARGETED_DEVICE_FAMILY:-}" in
case "${TARGETED_DEVICE_FAMILY}" in
1,2)
TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone"
;;
@ -100,7 +92,7 @@ if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then
fi
rm -f "$RESOURCES_TO_COPY"
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ]
if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "$XCASSET_FILES" ]
then
# Find all other xcassets (this unfortunately includes those of path pods and other targets).
OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d)
@ -110,9 +102,5 @@ then
fi
done <<<"$OTHER_XCASSETS"
if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
else
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_TEMP_DIR}/assetcatalog_generated_info_cocoapods.plist"
fi
printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

View File

@ -1,11 +1,11 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" "${PODS_CONFIGURATION_BUILD_DIR}/KeychainAccess"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CryptoSwift"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/KeychainAccess/KeychainAccess.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "CryptoSwift" -framework "KeychainAccess"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CryptoSwift/CryptoSwift.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "CryptoSwift"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods

View File

@ -1,11 +1,11 @@
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES
FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift" "${PODS_CONFIGURATION_BUILD_DIR}/KeychainAccess"
FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CryptoSwift"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks'
OTHER_CFLAGS = $(inherited) -iquote "${PODS_CONFIGURATION_BUILD_DIR}/CryptoSwift/CryptoSwift.framework/Headers" -iquote "${PODS_CONFIGURATION_BUILD_DIR}/KeychainAccess/KeychainAccess.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "CryptoSwift" -framework "KeychainAccess"
OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CryptoSwift/CryptoSwift.framework/Headers"
OTHER_LDFLAGS = $(inherited) -framework "CryptoSwift"
OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS"
PODS_BUILD_DIR = ${BUILD_DIR}
PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_BUILD_DIR = $BUILD_DIR
PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
PODS_ROOT = ${SRCROOT}/Pods