├── Android
└── Cerradura
│ ├── .idea
│ ├── .name
│ ├── copyright
│ │ └── profiles_settings.xml
│ ├── encodings.xml
│ ├── vcs.xml
│ ├── inspectionProfiles
│ │ ├── profiles_settings.xml
│ │ └── Project_Default.xml
│ ├── modules.xml
│ ├── runConfigurations.xml
│ ├── compiler.xml
│ ├── gradle.xml
│ └── misc.xml
│ ├── app
│ ├── .gitignore
│ ├── src
│ │ ├── main
│ │ │ ├── res
│ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ └── ic_launcher.png
│ │ │ │ ├── values
│ │ │ │ │ ├── colors.xml
│ │ │ │ │ ├── dimens.xml
│ │ │ │ │ ├── strings.xml
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── values-v21
│ │ │ │ │ └── styles.xml
│ │ │ │ ├── values-w820dp
│ │ │ │ │ └── dimens.xml
│ │ │ │ ├── menu
│ │ │ │ │ └── menu_main.xml
│ │ │ │ └── layout
│ │ │ │ │ ├── fragment_main.xml
│ │ │ │ │ ├── fragment_near_lock.xml
│ │ │ │ │ ├── content_near_lock.xml
│ │ │ │ │ ├── activity_near_lock.xml
│ │ │ │ │ └── activity_main.xml
│ │ │ ├── AndroidManifest.xml
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── colemancda
│ │ │ │ └── cerradura
│ │ │ │ └── GATTProfile.java
│ │ ├── test
│ │ │ └── java
│ │ │ │ └── com
│ │ │ │ └── colemancda
│ │ │ │ └── cerradura
│ │ │ │ └── ExampleUnitTest.java
│ │ └── androidTest
│ │ │ └── java
│ │ │ └── com
│ │ │ └── colemancda
│ │ │ └── cerradura
│ │ │ └── ApplicationTest.java
│ ├── proguard-rules.pro
│ └── build.gradle
│ ├── settings.gradle
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── .gitignore
│ ├── build.gradle
│ ├── gradle.properties
│ └── gradlew.bat
├── README.md
├── ._.DS_Store
├── Sketch.sketch
├── ._Package.swift
├── Tests
├── .DS_Store
├── ._.DS_Store
├── ._LinuxMain.swift
├── UnitTests
│ ├── ._GATTProfileTests.swift
│ ├── SerializationTests.swift
│ └── CryptoTests.swift
└── LinuxMain.swift
├── PaintCode
└── StyleKit.pcvd
├── debianpackage
├── repo
│ └── conf
│ │ └── distributions
├── package.sh
├── swift.sh
├── lockd
│ ├── DEBIAN
│ │ └── control
│ └── etc
│ │ └── init.d
│ │ └── lockd
└── build.sh
├── Xcode
├── Cerradura
│ ├── eKeyDocument.pdf
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── Activity
│ │ │ ├── Contents.json
│ │ │ ├── activityDelete.imageset
│ │ │ │ ├── Delete.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── activityNewKey.imageset
│ │ │ │ ├── NewKey.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── activityRename.imageset
│ │ │ │ ├── Rename.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── activityUpdate.imageset
│ │ │ │ ├── Update.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── activityHomeKit.imageset
│ │ │ │ ├── HomeKit.pdf
│ │ │ │ └── Contents.json
│ │ │ └── activityManageKeys.imageset
│ │ │ │ ├── AccessList.pdf
│ │ │ │ └── Contents.json
│ │ ├── KeysVC
│ │ │ ├── Contents.json
│ │ │ ├── permissionBadgeAdmin.imageset
│ │ │ │ ├── permissionBadgeAdmin.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── permissionBadgeOwner.imageset
│ │ │ │ ├── permissionBadgeOwner.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── permissionBadgeAnytime.imageset
│ │ │ │ ├── permissionBadgeAnytime.pdf
│ │ │ │ └── Contents.json
│ │ │ └── permissionBadgeScheduled.imageset
│ │ │ │ ├── permissionBadgeScheduled.pdf
│ │ │ │ └── Contents.json
│ │ ├── Near Me
│ │ │ ├── Contents.json
│ │ │ ├── scan1.imageset
│ │ │ │ ├── scan1.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── scan2.imageset
│ │ │ │ ├── scan2.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── scan3.imageset
│ │ │ │ ├── scan3.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── scan4.imageset
│ │ │ │ ├── scan4.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── setupLock.imageset
│ │ │ │ ├── setupLock.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── unlockButton.imageset
│ │ │ │ ├── unlockButton.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── bluetoothLogo.imageset
│ │ │ │ ├── bluetoothLogo.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── setupLockSelected.imageset
│ │ │ │ ├── setupLockSelected.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── bluetoothLogoDisabled.imageset
│ │ │ │ ├── bluetoothLogoDisabled.pdf
│ │ │ │ └── Contents.json
│ │ │ └── unlockButtonSelected.imageset
│ │ │ │ ├── unlockButtonSelected.pdf
│ │ │ │ └── Contents.json
│ │ ├── Tab Bar Icons
│ │ │ ├── Contents.json
│ │ │ ├── Near.imageset
│ │ │ │ ├── Near.png
│ │ │ │ ├── Near@2x.png
│ │ │ │ ├── Near@3x.png
│ │ │ │ └── Contents.json
│ │ │ ├── NearSelected.imageset
│ │ │ │ ├── NearSelected.png
│ │ │ │ ├── NearSelected@2x.png
│ │ │ │ ├── NearSelected@3x.png
│ │ │ │ └── Contents.json
│ │ │ ├── SettingsTabBarIcon.imageset
│ │ │ │ ├── Settings.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── LockTabBarIcon.imageset
│ │ │ │ ├── lockTabBarIcon.pdf
│ │ │ │ └── Contents.json
│ │ │ ├── LockTabBarIconSelected.imageset
│ │ │ │ ├── lockTabBarIconSelected.pdf
│ │ │ │ └── Contents.json
│ │ │ └── SettingsTabBarIconSelected.imageset
│ │ │ │ ├── SettingsTabBarIconSelected.pdf
│ │ │ │ └── Contents.json
│ │ ├── AppIcon.appiconset
│ │ │ ├── iPadIcon.png
│ │ │ ├── Icon-Small.png
│ │ │ ├── iPadIcon@2x.png
│ │ │ ├── Icon-Small@2x.png
│ │ │ ├── Icon-Small@3x.png
│ │ │ ├── iPhoneIcon@2x.png
│ │ │ ├── iPhoneIcon@3x.png
│ │ │ ├── Icon-Small@2x-1.png
│ │ │ ├── Icon-iPadPro@2x.png
│ │ │ ├── Icon-Spotlight-40.png
│ │ │ ├── Icon-Spotlight-40@2x.png
│ │ │ ├── Icon-Spotlight-40@3x.png
│ │ │ ├── Icon-Spotlight-40@2x-1.png
│ │ │ └── Contents.json
│ │ └── Brand Assets.launchimage
│ │ │ └── Contents.json
│ ├── NewKeyScheduleViewController.swift
│ ├── Error.swift
│ ├── Cerradura.entitlements
│ ├── Constants.swift
│ ├── Async.swift
│ ├── LockTableViewCell.swift
│ ├── Preferences.swift
│ ├── CoreDataEncodable.swift
│ ├── ActivityIndicatorViewController.swift
│ ├── PresentPopover.swift
│ ├── Model.xcdatamodeld
│ │ └── Model.xcdatamodel
│ │ │ └── contents
│ ├── CoreDataDecodable.swift
│ ├── ErrorAlert.swift
│ ├── Base.lproj
│ │ └── LaunchScreen.storyboard
│ ├── EmptyTableView.swift
│ ├── NewKeyParentViewController.swift
│ ├── Info.plist
│ ├── CoreDataExtensions.swift
│ ├── BeaconController.swift
│ └── LockCache.swift
├── CerraduraWatch
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── ActivityIndicator
│ │ │ ├── Contents.json
│ │ │ ├── Activity1.imageset
│ │ │ │ ├── Activity1@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity2.imageset
│ │ │ │ ├── Activity2@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity3.imageset
│ │ │ │ ├── Activity3@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity4.imageset
│ │ │ │ ├── Activity4@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity5.imageset
│ │ │ │ ├── Activity5@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity6.imageset
│ │ │ │ ├── Activity6@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity7.imageset
│ │ │ │ ├── Activity7@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity8.imageset
│ │ │ │ ├── Activity8@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity9.imageset
│ │ │ │ ├── Activity9@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity10.imageset
│ │ │ │ ├── Activity10@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity11.imageset
│ │ │ │ ├── Activity11@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity12.imageset
│ │ │ │ ├── Activity12@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity13.imageset
│ │ │ │ ├── Activity13@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity14.imageset
│ │ │ │ ├── Activity14@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity15.imageset
│ │ │ │ ├── Activity15@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity16.imageset
│ │ │ │ ├── Activity16@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity17.imageset
│ │ │ │ ├── Activity17@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity18.imageset
│ │ │ │ ├── Activity18@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity19.imageset
│ │ │ │ ├── Activity19@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity20.imageset
│ │ │ │ ├── Activity20@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity21.imageset
│ │ │ │ ├── Activity21@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity22.imageset
│ │ │ │ ├── Activity22@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity23.imageset
│ │ │ │ ├── Activity23@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity24.imageset
│ │ │ │ ├── Activity24@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity25.imageset
│ │ │ │ ├── Activity25@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity26.imageset
│ │ │ │ ├── Activity26@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity27.imageset
│ │ │ │ ├── Activity27@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity28.imageset
│ │ │ │ ├── Activity28@2x.png
│ │ │ │ └── Contents.json
│ │ │ ├── Activity29.imageset
│ │ │ │ ├── Activity29@2x.png
│ │ │ │ └── Contents.json
│ │ │ └── Activity30.imageset
│ │ │ │ ├── Activity30@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppIcon.appiconset
│ │ │ ├── Icon-24@2x.png
│ │ │ ├── Icon-29@2x.png
│ │ │ ├── Icon-29@3x.png
│ │ │ ├── Icon-40@2x.png
│ │ │ ├── Icon-44@2x.png
│ │ │ ├── Icon-86@2x.png
│ │ │ ├── Icon-98@2x.png
│ │ │ ├── Icon-27_5@2x.png
│ │ │ └── Contents.json
│ │ ├── watchScan1.imageset
│ │ │ ├── watchScan1.pdf
│ │ │ └── Contents.json
│ │ ├── watchScan2.imageset
│ │ │ ├── watchScan2.pdf
│ │ │ └── Contents.json
│ │ ├── watchScan3.imageset
│ │ │ ├── watchScan3.pdf
│ │ │ └── Contents.json
│ │ └── watchScan4.imageset
│ │ │ ├── watchScan4.pdf
│ │ │ └── Contents.json
│ ├── CerraduraWatch.entitlements
│ └── Info.plist
├── CerraduraWatch Extension
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ ├── watchAdmin.imageset
│ │ │ ├── watchAdmin.pdf
│ │ │ └── Contents.json
│ │ ├── watchOwner.imageset
│ │ │ ├── watchOwner.pdf
│ │ │ └── Contents.json
│ │ ├── watchAnytime.imageset
│ │ │ ├── watchAnytime.pdf
│ │ │ └── Contents.json
│ │ ├── watchScheduled.imageset
│ │ │ ├── watchScheduled.pdf
│ │ │ └── Contents.json
│ │ ├── modularSmallAdmin.imageset
│ │ │ ├── modularSmallAdmin38.pdf
│ │ │ ├── modularSmallAdmin42.pdf
│ │ │ └── Contents.json
│ │ └── PlaceholderComplication.complicationset
│ │ │ ├── Extra Large.imageset
│ │ │ └── Contents.json
│ │ │ ├── PlaceholderModular.imageset
│ │ │ ├── modularSmallAdmin38.pdf
│ │ │ ├── modularSmallAdmin42.pdf
│ │ │ └── Contents.json
│ │ │ ├── Circular.imageset
│ │ │ └── Contents.json
│ │ │ ├── Utilitarian.imageset
│ │ │ └── Contents.json
│ │ │ └── Contents.json
│ ├── CerraduraWatch Extension.entitlements
│ ├── Context.swift
│ ├── ErrorAlert.swift
│ ├── Info.plist
│ ├── ExtensionDelegate.swift
│ ├── AnimatedButtonController.swift
│ ├── LockInterfaceController.swift
│ └── ComplicationController.swift
├── Lock.xcodeproj
│ ├── project.xcworkspace
│ │ └── contents.xcworkspacedata
│ ├── xcuserdata
│ │ └── coleman.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ └── xcshareddata
│ │ └── xcschemes
│ │ ├── CoreLock iOS.xcscheme
│ │ ├── LockDaemon.xcscheme
│ │ └── Cerradura.xcscheme
├── CoreLock
│ ├── CoreLock.h
│ └── Info.plist
├── CerraduraTodayExtension
│ ├── CerraduraTodayExtension.entitlements
│ └── Info.plist
├── CoreLockTests
│ └── Info.plist
└── LockDaemon
│ └── Info.plist
├── Cartfile
├── Sources
├── CoreLock
│ ├── Beacon.swift
│ ├── Secrets.swift.xctemplate
│ ├── Version.swift
│ ├── Model.swift
│ ├── Integer.swift
│ ├── Status.swift
│ ├── Bool.swift
│ ├── Crypto.swift
│ ├── NewKeyInvitation.swift
│ ├── Observable.swift
│ ├── SecureData.swift
│ ├── POSIXTime.swift
│ └── NewKey.swift
└── lockd
│ ├── main.swift
│ ├── Command.swift
│ ├── File.swift
│ ├── GPIO.swift
│ ├── SunXi.swift
│ └── Configuration.swift
├── .gitignore
├── Cartfile.resolved
├── Package.swift
└── Package.pins
/Android/Cerradura/.idea/.name:
--------------------------------------------------------------------------------
1 | Cerradura
--------------------------------------------------------------------------------
/Android/Cerradura/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Lock
2 | Smart Lock controller
3 |
--------------------------------------------------------------------------------
/Android/Cerradura/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
--------------------------------------------------------------------------------
/._.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/._.DS_Store
--------------------------------------------------------------------------------
/Sketch.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Sketch.sketch
--------------------------------------------------------------------------------
/._Package.swift:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/._Package.swift
--------------------------------------------------------------------------------
/Tests/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Tests/.DS_Store
--------------------------------------------------------------------------------
/Tests/._.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Tests/._.DS_Store
--------------------------------------------------------------------------------
/PaintCode/StyleKit.pcvd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/PaintCode/StyleKit.pcvd
--------------------------------------------------------------------------------
/Tests/._LinuxMain.swift:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Tests/._LinuxMain.swift
--------------------------------------------------------------------------------
/debianpackage/repo/conf/distributions:
--------------------------------------------------------------------------------
1 | Codename: jessie
2 | Components: main
3 | Architectures: armhf
4 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/eKeyDocument.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/eKeyDocument.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Tests/UnitTests/._GATTProfileTests.swift:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Tests/UnitTests/._GATTProfileTests.swift
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Android/Cerradura/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Android/Cerradura/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/Android/Cerradura/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Android/Cerradura/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Android/Cerradura/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Android/Cerradura/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/iPadIcon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/iPadIcon.png
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Android/Cerradura/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Android/Cerradura/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Small.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/iPadIcon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/iPadIcon@2x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/scan1.imageset/scan1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/scan1.imageset/scan1.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/scan2.imageset/scan2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/scan2.imageset/scan2.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/scan3.imageset/scan3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/scan3.imageset/scan3.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/scan4.imageset/scan4.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/scan4.imageset/scan4.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Small@3x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/iPhoneIcon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/iPhoneIcon@2x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/iPhoneIcon@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/iPhoneIcon@3x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/Near.imageset/Near.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/Near.imageset/Near.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Small@2x-1.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-iPadPro@2x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/Near.imageset/Near@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/Near.imageset/Near@2x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/Near.imageset/Near@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/Near.imageset/Near@3x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-24@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-24@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-29@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-29@3x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-40@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-44@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-44@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-86@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-86@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-98@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-98@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/watchScan1.imageset/watchScan1.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/watchScan1.imageset/watchScan1.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/watchScan2.imageset/watchScan2.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/watchScan2.imageset/watchScan2.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/watchScan3.imageset/watchScan3.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/watchScan3.imageset/watchScan3.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/watchScan4.imageset/watchScan4.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/watchScan4.imageset/watchScan4.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/setupLock.imageset/setupLock.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/setupLock.imageset/setupLock.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-27_5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Icon-27_5@2x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityDelete.imageset/Delete.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Activity/activityDelete.imageset/Delete.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityNewKey.imageset/NewKey.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Activity/activityNewKey.imageset/NewKey.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityRename.imageset/Rename.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Activity/activityRename.imageset/Rename.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityUpdate.imageset/Update.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Activity/activityUpdate.imageset/Update.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@3x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityHomeKit.imageset/HomeKit.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Activity/activityHomeKit.imageset/HomeKit.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Icon-Spotlight-40@2x-1.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/unlockButton.imageset/unlockButton.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/unlockButton.imageset/unlockButton.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/bluetoothLogo.imageset/bluetoothLogo.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/bluetoothLogo.imageset/bluetoothLogo.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/watchAdmin.imageset/watchAdmin.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch Extension/Assets.xcassets/watchAdmin.imageset/watchAdmin.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/watchOwner.imageset/watchOwner.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch Extension/Assets.xcassets/watchOwner.imageset/watchOwner.pdf
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityManageKeys.imageset/AccessList.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Activity/activityManageKeys.imageset/AccessList.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/NearSelected.imageset/NearSelected.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/NearSelected.imageset/NearSelected.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/SettingsTabBarIcon.imageset/Settings.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/SettingsTabBarIcon.imageset/Settings.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/watchAnytime.imageset/watchAnytime.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch Extension/Assets.xcassets/watchAnytime.imageset/watchAnytime.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/setupLockSelected.imageset/setupLockSelected.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/setupLockSelected.imageset/setupLockSelected.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/LockTabBarIcon.imageset/lockTabBarIcon.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/LockTabBarIcon.imageset/lockTabBarIcon.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/NearSelected.imageset/NearSelected@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/NearSelected.imageset/NearSelected@2x.png
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/NearSelected.imageset/NearSelected@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/NearSelected.imageset/NearSelected@3x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/watchScheduled.imageset/watchScheduled.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch Extension/Assets.xcassets/watchScheduled.imageset/watchScheduled.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity1.imageset/Activity1@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity1.imageset/Activity1@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity2.imageset/Activity2@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity2.imageset/Activity2@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity3.imageset/Activity3@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity3.imageset/Activity3@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity4.imageset/Activity4@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity4.imageset/Activity4@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity5.imageset/Activity5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity5.imageset/Activity5@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity6.imageset/Activity6@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity6.imageset/Activity6@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity7.imageset/Activity7@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity7.imageset/Activity7@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity8.imageset/Activity8@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity8.imageset/Activity8@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity9.imageset/Activity9@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity9.imageset/Activity9@2x.png
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeAdmin.imageset/permissionBadgeAdmin.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeAdmin.imageset/permissionBadgeAdmin.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeOwner.imageset/permissionBadgeOwner.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeOwner.imageset/permissionBadgeOwner.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity10.imageset/Activity10@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity10.imageset/Activity10@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity11.imageset/Activity11@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity11.imageset/Activity11@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity12.imageset/Activity12@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity12.imageset/Activity12@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity13.imageset/Activity13@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity13.imageset/Activity13@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity14.imageset/Activity14@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity14.imageset/Activity14@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity15.imageset/Activity15@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity15.imageset/Activity15@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity16.imageset/Activity16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity16.imageset/Activity16@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity17.imageset/Activity17@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity17.imageset/Activity17@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity18.imageset/Activity18@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity18.imageset/Activity18@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity19.imageset/Activity19@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity19.imageset/Activity19@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity20.imageset/Activity20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity20.imageset/Activity20@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity21.imageset/Activity21@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity21.imageset/Activity21@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity22.imageset/Activity22@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity22.imageset/Activity22@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity23.imageset/Activity23@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity23.imageset/Activity23@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity24.imageset/Activity24@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity24.imageset/Activity24@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity25.imageset/Activity25@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity25.imageset/Activity25@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity26.imageset/Activity26@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity26.imageset/Activity26@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity27.imageset/Activity27@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity27.imageset/Activity27@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity28.imageset/Activity28@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity28.imageset/Activity28@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity29.imageset/Activity29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity29.imageset/Activity29@2x.png
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity30.imageset/Activity30@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity30.imageset/Activity30@2x.png
--------------------------------------------------------------------------------
/Cartfile:
--------------------------------------------------------------------------------
1 | github "PureSwift/GATT" "master"
2 | github "PureSwift/JSON" "master"
3 | github "krzyzanowskim/CryptoSwift"
4 | github "kishikawakatsumi/KeychainAccess"
5 | github "JonasGessner/JGProgressHUD"
6 | github "ColemanCDA/BSON" "bson4"
7 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/bluetoothLogoDisabled.imageset/bluetoothLogoDisabled.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/bluetoothLogoDisabled.imageset/bluetoothLogoDisabled.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/unlockButtonSelected.imageset/unlockButtonSelected.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Near Me/unlockButtonSelected.imageset/unlockButtonSelected.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeAnytime.imageset/permissionBadgeAnytime.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeAnytime.imageset/permissionBadgeAnytime.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/modularSmallAdmin.imageset/modularSmallAdmin38.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch Extension/Assets.xcassets/modularSmallAdmin.imageset/modularSmallAdmin38.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/modularSmallAdmin.imageset/modularSmallAdmin42.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch Extension/Assets.xcassets/modularSmallAdmin.imageset/modularSmallAdmin42.pdf
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeScheduled.imageset/permissionBadgeScheduled.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeScheduled.imageset/permissionBadgeScheduled.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/CerraduraWatch.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/LockTabBarIconSelected.imageset/lockTabBarIconSelected.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/LockTabBarIconSelected.imageset/lockTabBarIconSelected.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/CerraduraWatch Extension.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/scan1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "scan1.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/scan2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "scan2.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/scan3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "scan3.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/scan4.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "scan4.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/SettingsTabBarIconSelected.imageset/SettingsTabBarIconSelected.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/SettingsTabBarIconSelected.imageset/SettingsTabBarIconSelected.pdf
--------------------------------------------------------------------------------
/Xcode/Lock.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #3F51B5
4 | #303F9F
5 | #FF4081
6 |
7 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/watchScan1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watchScan1.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/watchScan2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watchScan2.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/watchScan3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watchScan3.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/watchScan4.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watchScan4.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityDelete.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Delete.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityHomeKit.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "HomeKit.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityRename.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Rename.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityUpdate.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Update.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityManageKeys.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "AccessList.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/bluetoothLogo.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bluetoothLogo.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/watchAdmin.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watchAdmin.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/watchOwner.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watchOwner.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/LockTabBarIcon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "lockTabBarIcon.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/SettingsTabBarIcon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Settings.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/watchAnytime.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watchAnytime.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/watchScheduled.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "watchScheduled.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeAdmin.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "permissionBadgeAdmin.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeOwner.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "permissionBadgeOwner.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Android/Cerradura/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Mon Dec 28 10:00:20 PST 2015
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
7 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeAnytime.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "permissionBadgeAnytime.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/bluetoothLogoDisabled.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "bluetoothLogoDisabled.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/KeysVC/permissionBadgeScheduled.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "permissionBadgeScheduled.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/LockTabBarIconSelected.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "lockTabBarIconSelected.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/Extra Large.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "watch",
5 | "scale" : "2x"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/debianpackage/package.sh:
--------------------------------------------------------------------------------
1 | echo "Building Debian package"
2 | dpkg-deb -b lockd lockd.deb
3 |
4 | echo "Creating static repo"
5 | reprepro -b ./repo includedeb jessie ./lockd.deb
6 |
7 | echo "Uploading to S3"
8 | s3cmd --verbose --acl-public --delete-removed sync ~/debianpackage/repo/ s3://cerraduraupdates/
9 |
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/debianpackage/swift.sh:
--------------------------------------------------------------------------------
1 | # Set Swift Path
2 | export PATH=/opt/colemancda/swift/usr/bin:"${PATH}"
3 |
4 | # Install Swift
5 | tar xvf swift.tar
6 | rm -rf /opt/colemancda/swift/*
7 | cp -rf ./usr /opt/colemancda/swift/
8 | rm -rf ./lockd/opt/colemancda/swift/*
9 | cp -rf ./usr ./lockd/opt/colemancda/swift/
10 |
--------------------------------------------------------------------------------
/Sources/CoreLock/Beacon.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Beacon.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 6/12/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | public let LockBeaconUUID = UUID(rawValue: "5109BE6D-3918-43FE-A629-CB2E0707EA5F")!
12 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/SettingsTabBarIconSelected.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "SettingsTabBarIconSelected.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | }
12 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/PlaceholderModular.imageset/modularSmallAdmin38.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/PlaceholderModular.imageset/modularSmallAdmin38.pdf
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/PlaceholderModular.imageset/modularSmallAdmin42.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/colemancda/Lock/HEAD/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/PlaceholderModular.imageset/modularSmallAdmin42.pdf
--------------------------------------------------------------------------------
/debianpackage/lockd/DEBIAN/control:
--------------------------------------------------------------------------------
1 | Package: lockd
2 | Version: 1.0.4
3 | Architecture: armhf
4 | Essential: no
5 | Section: dev
6 | Priority: required
7 | Depends: uuid-dev,bluez,avahi-daemon,avahi-discover,libnss-mdns,libavahi-compat-libdnssd-dev
8 | Maintainer: Alsey Coleman Miller
9 | Installed-Size: 900000
10 | Description: Lock Deamon
11 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Activity/activityNewKey.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "NewKey.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | },
12 | "properties" : {
13 | "compression-type" : "lossless"
14 | }
15 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/setupLock.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "setupLock.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | },
12 | "properties" : {
13 | "template-rendering-intent" : "template"
14 | }
15 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/unlockButton.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "unlockButton.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | },
12 | "properties" : {
13 | "template-rendering-intent" : "template"
14 | }
15 | }
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 | 16dp
6 | 8dp
7 |
8 |
--------------------------------------------------------------------------------
/Sources/CoreLock/Secrets.swift.xctemplate:
--------------------------------------------------------------------------------
1 | //
2 | // Secrets.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/28/17.
6 | // Copyright © 2017 ColemanCDA. All rights reserved.
7 | //
8 |
9 | /// The salt used for initial setup of the lock.
10 | internal let SetupSalt = KeyData(data: "256 bit secret / 32 character random string".toUTF8Data())!
11 |
--------------------------------------------------------------------------------
/debianpackage/build.sh:
--------------------------------------------------------------------------------
1 | # Set Swift Path
2 | export PATH=/opt/colemancda/swift/usr/bin:"${PATH}"
3 |
4 | # Build
5 | echo "Building lockd"
6 | cd ../
7 | rm -rf .build
8 | swift build --configuration debug
9 |
10 | # Package
11 | echo "Creating Debian package"
12 | cp -rf .build/debug/lockd ./debianpackage/lockd/usr/bin/
13 | cd ./debianpackage
14 | ./package.sh
15 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/setupLockSelected.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "setupLockSelected.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | },
12 | "properties" : {
13 | "template-rendering-intent" : "template"
14 | }
15 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Near Me/unlockButtonSelected.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "unlockButtonSelected.pdf"
6 | }
7 | ],
8 | "info" : {
9 | "version" : 1,
10 | "author" : "xcode"
11 | },
12 | "properties" : {
13 | "template-rendering-intent" : "template"
14 | }
15 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/NewKeyScheduleViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NewKeyScheduleViewController.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/26/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 |
12 | final class NewKeyScheduleViewController: UITableViewController {
13 |
14 |
15 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Context.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Context.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/9/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | final class LockContext {
10 |
11 | let lock: LockCache
12 |
13 | init(lock: LockCache) {
14 |
15 | self.lock = lock
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Sources/CoreLock/Version.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Version.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/17/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | /// CoreLock version
10 | public let CoreLockVersion: UInt64 = 1
11 |
12 | /// Version of the linux Debian Package
13 | public let LinuxPackageVersion: (UInt16, UInt16, UInt16) = (1, 0, 3)
14 |
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Sources/lockd/main.swift:
--------------------------------------------------------------------------------
1 | //
2 | // main.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/16/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import GATT
11 | import CoreLock
12 | import Foundation
13 |
14 | print("Starting Lock Daemon \(LinuxPackageVersion)...")
15 |
16 | let _ = LockController.shared
17 |
18 | while true { }
19 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/values-v21/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
9 |
10 |
--------------------------------------------------------------------------------
/Sources/lockd/Command.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Command.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/3/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | struct Command {
10 |
11 | static let reboot = "reboot"
12 |
13 | static let updatePackageList = "apt-get update"
14 |
15 | static let updateLock = "apt-get install -q -y --force-yes lockd"
16 | }
17 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/values-w820dp/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 | 64dp
6 |
7 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Error.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Error.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/1/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | /// Cerrdaura errors
10 | enum AppError: Swift.Error {
11 |
12 | case bluetoothDisabled
13 | case lockNotInRange
14 |
15 | /// The lock was deleted from the users local database.
16 | case lockDeleted
17 | }
18 |
--------------------------------------------------------------------------------
/Xcode/CoreLock/CoreLock.h:
--------------------------------------------------------------------------------
1 | //
2 | // CoreLock.h
3 | // CoreLock
4 | //
5 | // Created by Alsey Coleman Miller on 4/16/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | @import Foundation;
10 |
11 | //! Project version number for CoreLock.
12 | FOUNDATION_EXPORT double CoreLockVersionNumber;
13 |
14 | //! Project version string for CoreLock.
15 | FOUNDATION_EXPORT const unsigned char CoreLockVersionString[];
16 |
17 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/test/java/com/colemancda/cerradura/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.colemancda.cerradura;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * To work on unit tests, switch the Test Artifact in the Build Variants view.
9 | */
10 | public class ExampleUnitTest {
11 | @Test
12 | public void addition_isCorrect() throws Exception {
13 | assertEquals(4, 2 + 2);
14 | }
15 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity1@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity2.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity2@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity3.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity3@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity4.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity4@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity5.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity5@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity6.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity6@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity7.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity7@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity8.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity8@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity9.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity9@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity10.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity10@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity11.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity11@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity12.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity12@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity13.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity13@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity14.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity14@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity15.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity15@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity16.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity16@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity17.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity17@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity18.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity18@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity19.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity19@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity20.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity20@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity21.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity21@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity22.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity22@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity23.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity23@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity24.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity24@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity25.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity25@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity26.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity26@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity27.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity27@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity28.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity28@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity29.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity29@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/ActivityIndicator/Activity30.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "Activity30@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/androidTest/java/com/colemancda/cerradura/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.colemancda.cerradura;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/Sources/CoreLock/Model.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Model.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/17/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | /// Lock hardware model.
10 | public enum Model: UInt8 {
11 |
12 | case orangePiOne = 1
13 | }
14 |
15 | public extension Model {
16 |
17 | var name: String {
18 |
19 | switch self {
20 | case .orangePiOne: return "Classic"
21 | }
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/menu/menu_main.xml:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | Carthage
2 | .build
3 | Packages
4 | Xcode/Lock.xcodeproj/project.xcworkspace/xcuserdata
5 | Xcode/Lock.xcodeproj/xcuserdata
6 |
7 | Android/com.colemancda.Cerradura/bin
8 | Android/com.colemancda.Cerradura/obj
9 |
10 | .DS_Store
11 | ._
12 | *.db
13 |
14 | *.gz
15 |
16 | debianpackage/lockd/usr/bin/lockd
17 |
18 | debianpackage/repo/dists/jessie/Release
19 |
20 | debianpackage/repo/dists/jessie/main/binary-armhf/Release
21 |
22 | debianpackage/repo/db/version
23 |
24 | Sources/CoreLock/Secrets.swift
25 |
--------------------------------------------------------------------------------
/Cartfile.resolved:
--------------------------------------------------------------------------------
1 | github "ColemanCDA/BSON" "2266ac44f3503d5c9c6fec97c8fc98376071a768"
2 | github "PureSwift/Bluetooth" "19b30bf34419e24f537d1ea77e6ddfc51e97296b"
3 | github "krzyzanowskim/CryptoSwift" "0.6.8"
4 | github "JonasGessner/JGProgressHUD" "v1.4.1"
5 | github "PureSwift/JSON" "77d6203771ad21b1af3e10f7bb5ced109ee505ea"
6 | github "kishikawakatsumi/KeychainAccess" "v3.0.2"
7 | github "PureSwift/BluetoothLinux" "faaa9bd133d6fb1267e3f210a42813b327e06362"
8 | github "PureSwift/GATT" "3f244065f19af6b989200852a962b050dab78407"
9 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/modularSmallAdmin.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "watch"
5 | },
6 | {
7 | "idiom" : "watch",
8 | "filename" : "modularSmallAdmin38.pdf",
9 | "screen-width" : "<=145"
10 | },
11 | {
12 | "idiom" : "watch",
13 | "filename" : "modularSmallAdmin42.pdf",
14 | "screen-width" : ">145"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Cerradura.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.application-groups
6 |
7 | group.com.colemancda.Cerradura
8 |
9 | keychain-access-groups
10 |
11 | $(AppIdentifierPrefix)group.com.colemancda.Cerradura
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | Cerradura
3 | Settings
4 | Hello World from section: %1$d
5 | Near Lock
6 | Lock Image
7 |
8 |
9 | Hello blank fragment
10 |
11 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/Circular.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "watch",
5 | "scale" : "2x"
6 | },
7 | {
8 | "idiom" : "watch",
9 | "scale" : "2x",
10 | "screen-width" : "<=145"
11 | },
12 | {
13 | "idiom" : "watch",
14 | "scale" : "2x",
15 | "screen-width" : ">145"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/Utilitarian.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "watch",
5 | "scale" : "2x"
6 | },
7 | {
8 | "idiom" : "watch",
9 | "scale" : "2x",
10 | "screen-width" : "<=145"
11 | },
12 | {
13 | "idiom" : "watch",
14 | "scale" : "2x",
15 | "screen-width" : ">145"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Brand Assets.launchimage/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "orientation" : "portrait",
5 | "idiom" : "iphone",
6 | "minimum-system-version" : "7.0",
7 | "scale" : "2x"
8 | },
9 | {
10 | "orientation" : "portrait",
11 | "idiom" : "iphone",
12 | "minimum-system-version" : "7.0",
13 | "subtype" : "retina4",
14 | "scale" : "2x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/Near.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "Near.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "Near@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "Near@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraTodayExtension/CerraduraTodayExtension.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.application-groups
6 |
7 | group.com.colemancda.Cerradura
8 |
9 | keychain-access-groups
10 |
11 | $(AppIdentifierPrefix)group.com.colemancda.Cerradura
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Sources/lockd/File.swift:
--------------------------------------------------------------------------------
1 | //
2 | // File.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 6/8/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | struct File {
10 |
11 | static let store = "/opt/colemancda/lockd/data.json"
12 |
13 | static let configuration = "/opt/colemancda/lockd/config.json"
14 |
15 | static let homeKitDaemon = "/opt/colemancda/HAP-NodeJS/Core.js"
16 |
17 | static let homeKitData = "/persist"
18 |
19 | static let nodejs = "/usr/bin/node"
20 | }
21 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/Tab Bar Icons/NearSelected.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "NearSelected.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "NearSelected@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "NearSelected@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/Constants.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Version.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/1/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation.NSBundle
10 |
11 | /// Version of the app.
12 | public let AppVersion = Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String
13 |
14 | /// Build of the app.
15 | public let AppBuild = Bundle.main.infoDictionary!["CFBundleVersion"] as! String
16 |
17 | /// The App Group of Cerradura.
18 | public let AppGroup = "group.com.colemancda.Cerradura"
19 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Async.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Async.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 6/12/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | func mainQueue(_ block: @escaping () -> ()) {
12 |
13 | OperationQueue.main.addOperation(block)
14 | }
15 |
16 | /// Perform a task on the internal queue.
17 | @inline(__always)
18 | func async(_ block: @escaping () -> ()) {
19 |
20 | queue.async { block() }
21 | }
22 |
23 | let queue = DispatchQueue(label: "Cerradura Queue", attributes: [])
24 |
--------------------------------------------------------------------------------
/Sources/CoreLock/Integer.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Integer.swift
3 | // SwiftFoundation
4 | //
5 | // Created by Alsey Coleman Miller on 8/24/15.
6 | // Copyright © 2015 PureSwift. All rights reserved.
7 | //
8 |
9 | public extension UInt16 {
10 |
11 | /// Initializes value from two bytes.
12 | public init(bytes: (UInt8, UInt8)) {
13 |
14 | self = unsafeBitCast(bytes, to: UInt16.self)
15 | }
16 |
17 | /// Converts to two bytes.
18 | public var bytes: (UInt8, UInt8) {
19 |
20 | return unsafeBitCast(self, to: (UInt8, UInt8).self)
21 | }
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/ErrorAlert.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ErrorAlert.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/8/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import WatchKit
11 |
12 | extension WKInterfaceController {
13 |
14 | func showError(_ error: String) {
15 |
16 | let action = WKAlertAction(title: "OK", style: WKAlertActionStyle.`default`) { }
17 |
18 | self.presentAlert(withTitle: "Error", message: error, preferredStyle: .actionSheet, actions: [action])
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/Android/Cerradura/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.1.0'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | jcenter()
18 | }
19 | }
20 |
21 | task clean(type: Delete) {
22 | delete rootProject.buildDir
23 | }
24 |
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/PlaceholderModular.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "watch",
5 | "scale" : "2x"
6 | },
7 | {
8 | "idiom" : "watch",
9 | "filename" : "modularSmallAdmin38.pdf",
10 | "screen-width" : "<=145",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "watch",
15 | "filename" : "modularSmallAdmin42.pdf",
16 | "screen-width" : ">145",
17 | "scale" : "2x"
18 | }
19 | ],
20 | "info" : {
21 | "version" : 1,
22 | "author" : "xcode"
23 | },
24 | "properties" : {
25 | "template-rendering-intent" : "original"
26 | }
27 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/LockTableViewCell.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LockTableViewCell.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/1/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | final class LockTableViewCell: UITableViewCell {
12 |
13 | // MARK: - Class Properties
14 |
15 | static let reuseIdentifier = "LockTableViewCell"
16 |
17 | static let nib = UINib(nibName: "LockTableViewCell", bundle: nil)
18 |
19 | // MARK: - IB Outlets
20 |
21 | @IBOutlet weak var lockImageView: UIImageView!
22 |
23 | @IBOutlet weak var lockTitleLabel: UILabel!
24 |
25 | @IBOutlet weak var lockDetailLabel: UILabel!
26 | }
27 |
--------------------------------------------------------------------------------
/Package.swift:
--------------------------------------------------------------------------------
1 | import PackageDescription
2 |
3 | let package = Package(
4 | name: "Lock",
5 | targets: [
6 | Target(
7 | name: "lockd",
8 | dependencies: [.Target(name: "CoreLock")]
9 | ),
10 | Target(
11 | name: "CoreLock"
12 | )
13 | ],
14 | dependencies: [
15 | .Package(url: "https://github.com/PureSwift/GATT", majorVersion: 1),
16 | .Package(url: "https://github.com/PureSwift/JSON", majorVersion: 1),
17 | .Package(url: "https://github.com/krzyzanowskim/CryptoSwift", majorVersion: 0),
18 | .Package(url: "https://github.com/ColemanCDA/BSON", majorVersion: 4)
19 | ],
20 | exclude: ["Xcode", "Android"]
21 | )
22 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Assets.xcassets/PlaceholderComplication.complicationset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "assets" : [
3 | {
4 | "idiom" : "watch",
5 | "filename" : "Circular.imageset",
6 | "role" : "circular"
7 | },
8 | {
9 | "idiom" : "watch",
10 | "filename" : "Extra Large.imageset",
11 | "role" : "extra-large"
12 | },
13 | {
14 | "idiom" : "watch",
15 | "filename" : "PlaceholderModular.imageset",
16 | "role" : "modular"
17 | },
18 | {
19 | "idiom" : "watch",
20 | "filename" : "Utilitarian.imageset",
21 | "role" : "utilitarian"
22 | }
23 | ],
24 | "info" : {
25 | "version" : 1,
26 | "author" : "xcode"
27 | }
28 | }
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # By default, the flags in this file are appended to flags specified
3 | # in /Users/coleman/Library/Android/sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
--------------------------------------------------------------------------------
/Tests/LinuxMain.swift:
--------------------------------------------------------------------------------
1 | //
2 | // main.swift
3 | // GATT
4 | //
5 | // Created by Alsey Coleman Miller on 4/14/16.
6 | // Copyright © 2016 PureSwift. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import CoreLock
11 | @testable import UnitTests
12 |
13 | #if os(OSX) || os(iOS) || os(watchOS)
14 | func XCTMain(_ testCases: [XCTestCaseEntry]) { fatalError("Not Implemented. Linux only") }
15 |
16 | func testCase(_ allTests: [(String, (T) -> () throws -> Void)]) -> XCTestCaseEntry { fatalError("Not Implemented. Linux only") }
17 |
18 | struct XCTestCaseEntry { }
19 | #endif
20 |
21 | XCTMain([testCase(CryptoTests.allTests),
22 | testCase(GATTProfileTests.allTests),
23 | testCase(SerializationTests.allTests)])
24 |
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/compiler.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Sources/CoreLock/Status.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Status.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/16/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | /// Lock status
12 | public enum Status: UInt8 {
13 |
14 | /// Initial Status
15 | case setup
16 |
17 | /// Idle / Unlock Mode
18 | case unlock
19 | }
20 |
21 | // MARK: - DataConvertible
22 |
23 | public extension Status {
24 |
25 | public init?(data: Data) {
26 |
27 | guard data.count == 1
28 | else { return nil }
29 |
30 | self.init(rawValue: data.bytes[0])
31 | }
32 |
33 | public func toData() -> Data {
34 |
35 | return Data(bytes: [rawValue])
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/layout/fragment_main.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Preferences.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Preferences.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/3/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | final class Preferences {
12 |
13 | static let shared = Preferences()
14 |
15 | let userDefaults = UserDefaults.standard
16 |
17 | // MARK:
18 |
19 | var isAppInstalled: Bool {
20 |
21 | get { return userDefaults.bool(forKey: Key.isAppInstalled.rawValue) }
22 |
23 | set { userDefaults.set(newValue, forKey: Key.isAppInstalled.rawValue) }
24 | }
25 | }
26 |
27 | // MARK: - Keys
28 |
29 | extension Preferences {
30 |
31 | enum Key: String {
32 |
33 | case isAppInstalled
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/Tests/UnitTests/SerializationTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SerializationTests.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/3/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | import Foundation
11 | @testable import CoreLock
12 |
13 | final class SerializationTests: XCTestCase {
14 |
15 | static let allTests: [(String, (SerializationTests) -> () throws -> Void)] = [("keyJSON", keyJSON)]
16 |
17 | func keyJSON() {
18 |
19 | let key = Key(identifier: UUID(), name: Key.Name(rawValue: "New Key")!, data: KeyData(), permission: .admin)
20 |
21 | guard let decodedKey = Key(JSONValue: key.toJSON())
22 | else { XCTFail(); return }
23 |
24 | XCTAssert(key == decodedKey)
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Xcode/CoreLockTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 23
5 | buildToolsVersion "23.0.3"
6 |
7 | defaultConfig {
8 | applicationId "com.colemancda.cerradura"
9 | minSdkVersion 18
10 | targetSdkVersion 23
11 | versionCode 1
12 | versionName "1.0"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 | }
21 |
22 | dependencies {
23 | compile fileTree(dir: 'libs', include: ['*.jar'])
24 | testCompile 'junit:junit:4.12'
25 | compile 'com.android.support:appcompat-v7:23.3.0'
26 | compile 'com.android.support:design:23.3.0'
27 | compile 'com.google.android.gms:play-services-appindexing:8.1.0'
28 | compile 'com.android.support:support-v4:23.3.0'
29 | }
30 |
--------------------------------------------------------------------------------
/Android/Cerradura/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 |
3 | # IDE (e.g. Android Studio) users:
4 | # Gradle settings configured through the IDE *will override*
5 | # any settings specified in this file.
6 |
7 | # For more details on how to configure your build environment visit
8 | # http://www.gradle.org/docs/current/userguide/build_environment.html
9 |
10 | # Specifies the JVM arguments used for the daemon process.
11 | # The setting is particularly useful for tweaking memory settings.
12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m
13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
14 |
15 | # When configured, Gradle will run in incubating parallel mode.
16 | # This option should only be used with decoupled projects. More details, visit
17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
18 | # org.gradle.parallel=true
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/layout/fragment_near_lock.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
12 |
13 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/CoreDataEncodable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Encode.swift
3 | // CoreDataStruct
4 | //
5 | // Created by Alsey Coleman Miller on 11/5/15.
6 | // Copyright © 2015 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreData
11 |
12 | /// Specifies how a type can be encoded to be stored with Core Data.
13 | public protocol CoreDataEncodable {
14 |
15 | func save(context: NSManagedObjectContext) throws -> NSManagedObject
16 | }
17 |
18 | public extension Collection where Iterator.Element: CoreDataEncodable {
19 |
20 | func save(context: NSManagedObjectContext) throws -> [NSManagedObject] {
21 |
22 | var managedObjects = [NSManagedObject]()
23 |
24 | for element in self {
25 |
26 | let managedObject = try element.save(context: context)
27 |
28 | managedObjects.append(managedObject)
29 | }
30 |
31 | return managedObjects
32 | }
33 | }
--------------------------------------------------------------------------------
/Xcode/CoreLock/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(CURRENT_PROJECT_VERSION)
23 | NSHumanReadableCopyright
24 | Copyright © 2016 ColemanCDA. All rights reserved.
25 | NSPrincipalClass
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/ActivityIndicatorViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ActivityIndicatorViewController.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 9/25/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 | import JGProgressHUD
12 |
13 | protocol ActivityIndicatorViewController: class {
14 |
15 | var view: UIView! { get }
16 |
17 | var navigationItem: UINavigationItem { get }
18 |
19 | var progressHUD: JGProgressHUD { get }
20 |
21 | func showProgressHUD()
22 |
23 | func dismissProgressHUD(_ animated: Bool)
24 | }
25 |
26 | extension ActivityIndicatorViewController {
27 |
28 | func showProgressHUD() {
29 |
30 | self.view.isUserInteractionEnabled = false
31 |
32 | progressHUD.show(in: self.view)
33 | }
34 |
35 | func dismissProgressHUD(_ animated: Bool = true) {
36 |
37 | self.view.isUserInteractionEnabled = true
38 |
39 | progressHUD.dismiss(animated: animated)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/layout/content_near_lock.xml:
--------------------------------------------------------------------------------
1 |
2 |
14 |
15 |
22 |
23 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/PresentPopover.swift:
--------------------------------------------------------------------------------
1 | //
2 | // PresentPopover.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 2/7/17.
6 | // Copyright © 2017 OpenStack. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 |
12 | extension UIViewController {
13 |
14 | func present(_ viewController: UIViewController, animated: Bool = true, completion: (() -> Void)? = nil, sender: PopoverPresentingView) {
15 |
16 | switch sender {
17 |
18 | case let .view(view):
19 |
20 | viewController.popoverPresentationController?.sourceRect = view.bounds
21 | viewController.popoverPresentationController?.sourceView = view
22 |
23 | case let .barButtonItem(tabBarItem):
24 |
25 | viewController.popoverPresentationController?.barButtonItem = tabBarItem
26 | }
27 |
28 | self.present(viewController, animated: animated, completion: completion)
29 | }
30 | }
31 |
32 | // MARK: - Supporting Types
33 |
34 | enum PopoverPresentingView {
35 |
36 | case view(UIView)
37 | case barButtonItem(UIBarButtonItem)
38 | }
39 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Model.xcdatamodeld/Model.xcdatamodel/contents:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/layout/activity_near_lock.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Xcode/LockDaemon/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSHumanReadableCopyright
28 | Copyright © 2016 ColemanCDA. All rights reserved.
29 | NSMainStoryboardFile
30 | Main
31 | NSPrincipalClass
32 | NSApplication
33 |
34 |
35 |
--------------------------------------------------------------------------------
/Xcode/CerraduraTodayExtension/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Cerradura
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIcons
12 |
13 | CFBundleIcons~ipad
14 |
15 | CFBundleIdentifier
16 | $(PRODUCT_BUNDLE_IDENTIFIER)
17 | CFBundleInfoDictionaryVersion
18 | 6.0
19 | CFBundleName
20 | $(PRODUCT_NAME)
21 | CFBundlePackageType
22 | XPC!
23 | CFBundleShortVersionString
24 | 1.0
25 | CFBundleSignature
26 | ????
27 | CFBundleVersion
28 | 1
29 | NSExtension
30 |
31 | NSExtensionMainStoryboard
32 | MainInterface
33 | NSExtensionPointIdentifier
34 | com.apple.widget-extension
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/Sources/lockd/GPIO.swift:
--------------------------------------------------------------------------------
1 | //
2 | // GPIO.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 6/5/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | #if os(Linux)
10 | import Glibc
11 | #elseif os(macOS)
12 | import Darwin.C
13 | #endif
14 |
15 | // MARK: - Unlocking
16 |
17 | let UnlockGPIO: GPIO = {
18 |
19 | let gpio = GPIO(sunXi: SunXiGPIO(letter: .A, pin: 6))
20 |
21 | gpio.direction = .OUT
22 |
23 | gpio.value = 1
24 |
25 | return gpio
26 | }()
27 |
28 | func UnlockIO() {
29 |
30 | #if arch(arm)
31 |
32 | UnlockGPIO.value = 0
33 |
34 | sleep(1)
35 |
36 | UnlockGPIO.value = 1
37 |
38 | #else
39 |
40 | print("No GPIO on this hardware")
41 |
42 | #endif
43 | }
44 |
45 | // MARK: - App LED
46 |
47 | let AppLED: GPIO = {
48 |
49 | let gpio = GPIO(sunXi: SunXiGPIO(letter: .A, pin: 1))
50 |
51 | gpio.direction = .OUT
52 |
53 | return gpio
54 | }()
55 |
56 | // MARK: - Reset Swift
57 |
58 | let ResetSwitch: GPIO = {
59 |
60 | let gpio = GPIO(sunXi: SunXiGPIO(letter: .G, pin: 7))
61 |
62 | gpio.direction = .IN
63 |
64 | return gpio
65 | }()
66 |
67 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | Cerradura
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | GitVersion
25 | UISupportedInterfaceOrientations
26 |
27 | UIInterfaceOrientationPortrait
28 | UIInterfaceOrientationPortraitUpsideDown
29 |
30 | WKCompanionAppBundleIdentifier
31 | com.colemancda.Cerradura
32 | WKWatchKitApp
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/Package.pins:
--------------------------------------------------------------------------------
1 | {
2 | "autoPin": true,
3 | "pins": [
4 | {
5 | "package": "Bluetooth",
6 | "reason": null,
7 | "repositoryURL": "https://github.com/PureSwift/Bluetooth.git",
8 | "version": "1.2.2"
9 | },
10 | {
11 | "package": "BluetoothLinux",
12 | "reason": null,
13 | "repositoryURL": "https://github.com/PureSwift/BluetoothLinux.git",
14 | "version": "2.4.2"
15 | },
16 | {
17 | "package": "BSON",
18 | "reason": null,
19 | "repositoryURL": "https://github.com/ColemanCDA/BSON",
20 | "version": "4.1.4"
21 | },
22 | {
23 | "package": "CryptoSwift",
24 | "reason": null,
25 | "repositoryURL": "https://github.com/krzyzanowskim/CryptoSwift",
26 | "version": "0.6.8"
27 | },
28 | {
29 | "package": "CSwiftBluetoothLinux",
30 | "reason": null,
31 | "repositoryURL": "https://github.com/PureSwift/CSwiftBluetoothLinux.git",
32 | "version": "1.1.0"
33 | },
34 | {
35 | "package": "GATT",
36 | "reason": null,
37 | "repositoryURL": "https://github.com/PureSwift/GATT",
38 | "version": "1.3.2"
39 | },
40 | {
41 | "package": "JSON",
42 | "reason": null,
43 | "repositoryURL": "https://github.com/PureSwift/JSON",
44 | "version": "1.0.0"
45 | }
46 | ],
47 | "version": 1
48 | }
--------------------------------------------------------------------------------
/Xcode/Cerradura/CoreDataDecodable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Decode.swift
3 | // CoreDataStruct
4 | //
5 | // Created by Alsey Coleman Miller on 11/5/15.
6 | // Copyright © 2015 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreData
11 |
12 | /// Specifies how a type can be decoded from Core Data.
13 | public protocol CoreDataDecodable {
14 |
15 | init(managedObject: NSManagedObject)
16 | }
17 |
18 | public extension NSManagedObjectContext {
19 |
20 | /// Executes a fetch request and returns ```CoreDataDecodable``` types.
21 | func fetch(_ fetchRequest: NSFetchRequest) throws -> [T] {
22 |
23 | guard fetchRequest.resultType == NSFetchRequestResultType(rawValue: 0x00)
24 | else { fatalError("Method only supports fetch requests with NSFetchRequestManagedObjectResultType") }
25 |
26 | let managedObjects = try self.fetch(fetchRequest)
27 |
28 | let decodables = managedObjects.map { (element) -> T in T.init(managedObject: element) }
29 |
30 | return decodables
31 | }
32 | }
33 |
34 | public extension CoreDataDecodable {
35 |
36 | static func from(managedObjects: [NSManagedObject]) -> [Self] {
37 |
38 | return managedObjects.map { (managedObject) in return self.init(managedObject: managedObject) }
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
23 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/Sources/CoreLock/Bool.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Bool.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/16/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | /// Boolean value that can be transmitted over Bluetooth GATT.
12 | public struct BluetoothBool: ExpressibleByBooleanLiteral {
13 |
14 | public var boolValue: Bool
15 |
16 | public init(booleanLiteral value: Bool) {
17 |
18 | self.boolValue = value
19 | }
20 |
21 | public init(_ boolValue: Bool) {
22 |
23 | self.boolValue = boolValue
24 | }
25 | }
26 |
27 | extension BluetoothBool: RawRepresentable {
28 |
29 | public init?(rawValue: UInt8) {
30 |
31 | switch rawValue {
32 | case 0x00: self.boolValue = false
33 | case 0x01: self.boolValue = true
34 | default: return nil
35 | }
36 | }
37 |
38 | public var rawValue: UInt8 {
39 |
40 | if boolValue {
41 |
42 | return 0x01
43 |
44 | } else {
45 |
46 | return 0x00
47 | }
48 | }
49 | }
50 |
51 | extension BluetoothBool {
52 |
53 | public init?(data: Data) {
54 |
55 | guard data.count == 1
56 | else { return nil }
57 |
58 | self.init(rawValue: data[0])
59 | }
60 |
61 | public func toData() -> Data {
62 |
63 | return Data(bytes: [rawValue])
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/ErrorAlert.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ErrorAlert.swift
3 | //
4 | // Created by Alsey Coleman Miller on 10/22/15.
5 | // Copyright © 2015 ColemanCDA. All rights reserved.
6 | //
7 |
8 | import Foundation
9 | import UIKit
10 |
11 | public extension UIViewController {
12 |
13 | /** Presents an error alert controller with the specified completion handlers. */
14 | func showErrorAlert(_ localizedText: String, okHandler: (() -> ())? = nil, retryHandler: (()-> ())? = nil) {
15 |
16 | let alert = UIAlertController(title: NSLocalizedString("Error", comment: "Error"),
17 | message: localizedText,
18 | preferredStyle: UIAlertControllerStyle.alert)
19 |
20 | alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "OK"), style: UIAlertActionStyle.`default`, handler: { (UIAlertAction) in
21 |
22 | okHandler?()
23 |
24 | alert.dismiss(animated: true, completion: nil)
25 | }))
26 |
27 | // optionally add retry button
28 |
29 | if retryHandler != nil {
30 |
31 | alert.addAction(UIAlertAction(title: NSLocalizedString("Retry", comment: "Retry"), style: UIAlertActionStyle.`default`, handler: { (UIAlertAction) in
32 |
33 | retryHandler!()
34 |
35 | alert.dismiss(animated: true, completion: nil)
36 | }))
37 | }
38 |
39 | self.present(alert, animated: true, completion: nil)
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Sources/CoreLock/Crypto.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Crypto.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/17/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CryptoSwift
11 |
12 | /// Generate random data with the specified size.
13 | public func random(_ size: Int) -> Data {
14 |
15 | let bytes = AES.randomIV(size)
16 |
17 | return Data(bytes: bytes)
18 | }
19 |
20 | public let HMACSize = 64
21 |
22 | /// Performs HMAC with the specified key and message.
23 | @inline(__always)
24 | public func HMAC(key: KeyData, message: Nonce) -> Data {
25 |
26 | let hmac = try! CryptoSwift.HMAC(key: key.data.bytes, variant: .sha512).authenticate(message.data.bytes)
27 |
28 | assert(hmac.count == HMACSize)
29 |
30 | return Data(bytes: hmac)
31 | }
32 |
33 | public let IVSize = AES.blockSize
34 |
35 | /// Encrypt data
36 | public func encrypt(key: Data, data: Data) -> (encrypted: Data, iv: InitializationVector) {
37 |
38 | let iv = InitializationVector()
39 |
40 | let crypto = try! AES(key: key.bytes, iv: iv.data.bytes)
41 |
42 | let byteValue = try! crypto.encrypt(data.bytes)
43 |
44 | return (Data(bytes: byteValue), iv)
45 | }
46 |
47 | /// Decrypt data
48 | public func decrypt(key: Data, iv: InitializationVector, data: Data) -> Data {
49 |
50 | assert(iv.data.count == IVSize)
51 |
52 | let crypto = try! AES(key: key.bytes, iv: iv.data.bytes)
53 |
54 | let byteValue = try! crypto.decrypt(data.bytes)
55 |
56 | return Data(bytes: byteValue)
57 | }
58 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "24x24",
5 | "idiom" : "watch",
6 | "filename" : "Icon-24@2x.png",
7 | "scale" : "2x",
8 | "role" : "notificationCenter",
9 | "subtype" : "38mm"
10 | },
11 | {
12 | "size" : "27.5x27.5",
13 | "idiom" : "watch",
14 | "filename" : "Icon-27_5@2x.png",
15 | "scale" : "2x",
16 | "role" : "notificationCenter",
17 | "subtype" : "42mm"
18 | },
19 | {
20 | "size" : "29x29",
21 | "idiom" : "watch",
22 | "filename" : "Icon-29@2x.png",
23 | "role" : "companionSettings",
24 | "scale" : "2x"
25 | },
26 | {
27 | "size" : "29x29",
28 | "idiom" : "watch",
29 | "filename" : "Icon-29@3x.png",
30 | "role" : "companionSettings",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "watch",
36 | "filename" : "Icon-40@2x.png",
37 | "scale" : "2x",
38 | "role" : "appLauncher",
39 | "subtype" : "38mm"
40 | },
41 | {
42 | "size" : "86x86",
43 | "idiom" : "watch",
44 | "filename" : "Icon-86@2x.png",
45 | "scale" : "2x",
46 | "role" : "quickLook",
47 | "subtype" : "38mm"
48 | },
49 | {
50 | "size" : "98x98",
51 | "idiom" : "watch",
52 | "filename" : "Icon-98@2x.png",
53 | "scale" : "2x",
54 | "role" : "quickLook",
55 | "subtype" : "42mm"
56 | }
57 | ],
58 | "info" : {
59 | "version" : 1,
60 | "author" : "xcode"
61 | }
62 | }
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | CerraduraWatch Extension
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | XPC!
19 | CFBundleShortVersionString
20 | 1.0.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | GitVersion
25 | CLKComplicationPrincipalClass
26 | $(PRODUCT_MODULE_NAME).ComplicationController
27 | CLKComplicationSupportedFamilies
28 |
29 | CLKComplicationFamilyModularSmall
30 |
31 | NSExtension
32 |
33 | NSExtensionAttributes
34 |
35 | WKAppBundleIdentifier
36 | com.colemancda.Cerradura.watchkitapp
37 |
38 | NSExtensionPointIdentifier
39 | com.apple.watchkit
40 |
41 | WKExtensionDelegateClassName
42 | $(PRODUCT_MODULE_NAME).ExtensionDelegate
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/ExtensionDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ExtensionDelegate.swift
3 | // CerraduraWatch Extension
4 | //
5 | // Created by Alsey Coleman Miller on 4/30/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import WatchKit
10 |
11 | final class ExtensionDelegate: NSObject, WKExtensionDelegate {
12 |
13 | func applicationDidFinishLaunching() {
14 | // Perform any final initialization of your application.
15 |
16 | // print app info
17 | print("Launching Cerradura Watch v\(AppVersion) Build \(AppBuild)")
18 |
19 | // set SessionController log
20 | SessionController.shared.log = { print("SessionController: " + $0) }
21 | }
22 |
23 | func applicationDidBecomeActive() {
24 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
25 |
26 | // reactivate
27 | async {
28 |
29 | if SessionController.shared.session.activationState != .activated {
30 |
31 | do { try SessionController.shared.activate() } catch { }
32 | }
33 | }
34 | }
35 |
36 | func applicationWillResignActive() {
37 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
38 | // Use this method to pause ongoing tasks, disable timers, etc.
39 | }
40 |
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/java/com/colemancda/cerradura/GATTProfile.java:
--------------------------------------------------------------------------------
1 | package com.colemancda.cerradura;
2 |
3 | import java.util.UUID;
4 | import java.nio.ByteBuffer;
5 |
6 | /**
7 | * Created by coleman on 6/16/16.
8 | */
9 |
10 | interface GATTProfileService {
11 |
12 | static UUID UUID = null;
13 | }
14 |
15 | interface GATTProfileCharacteristic {
16 |
17 | static UUID UUID = null;
18 | }
19 |
20 | final class LockService implements GATTProfileService {
21 |
22 | static final UUID UUID = java.util.UUID.fromString("D5373D28-044C-11E6-B3C2-09AB70D5A8C7");
23 | }
24 |
25 | final class LockIdentifier implements GATTProfileCharacteristic {
26 |
27 | static final UUID UUID = java.util.UUID.fromString("EB1BA354-044C-11E6-BDFD-09AB70D5A8C7");
28 |
29 | final UUID value;
30 |
31 | LockIdentifier(byte[] bytes) {
32 |
33 | ByteBuffer buffer = ByteBuffer.wrap(bytes);
34 |
35 | long msb = buffer.getLong();
36 | long lsb = buffer.getLong();
37 |
38 | this.value = new UUID(msb, lsb);
39 | }
40 | }
41 |
42 | final class LockStatus implements GATTProfileCharacteristic {
43 |
44 | static final UUID UUID = java.util.UUID.fromString("F868B290-044C-11E6-BD3B-09AB70D5A8C7");
45 | }
46 |
47 | final class LockModel implements GATTProfileCharacteristic {
48 |
49 | static final UUID UUID = java.util.UUID.fromString("AD96F330-0497-11E6-9EB3-E72D62A5198D");
50 | }
51 |
52 | final class LockVersion implements GATTProfileCharacteristic {
53 |
54 | static final UUID UUID = java.util.UUID.fromString("F28A0E1E-044C-11E6-9032-09AB70D5A8C7");
55 | }
56 |
57 | final class LockSetup implements GATTProfileCharacteristic {
58 |
59 | static final UUID UUID = java.util.UUID.fromString("129E401C-044D-11E6-8FA9-09AB70D5A8C7");
60 | }
61 |
--------------------------------------------------------------------------------
/Sources/CoreLock/NewKeyInvitation.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NewKeyInvitation.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/10/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import JSON
11 |
12 | /// Exportable new key invitation.
13 | public struct NewKeyInvitation: Equatable, JSONEncodable, JSONDecodable {
14 |
15 | public let lock: UUID
16 |
17 | public let key: NewKey
18 |
19 | public init(lock: UUID, key: NewKey) {
20 |
21 | self.lock = lock
22 | self.key = key
23 | }
24 | }
25 |
26 | // MARK: - Equatable
27 |
28 | public func == (lhs: NewKeyInvitation, rhs: NewKeyInvitation) -> Bool {
29 |
30 | return lhs.lock == rhs.lock
31 | && lhs.key == rhs.key
32 | }
33 |
34 | // MARK: - JSON
35 |
36 | public extension NewKeyInvitation {
37 |
38 | enum JSONKey: String {
39 |
40 | case lock, key
41 | }
42 |
43 | init?(JSONValue: JSON.Value) {
44 |
45 | guard let JSONObject = JSONValue.objectValue,
46 | let identifierString = JSONObject[JSONKey.lock.rawValue]?.stringValue,
47 | let identifier = UUID(rawValue: identifierString),
48 | let newKeyJSON = JSONObject[JSONKey.key.rawValue],
49 | let newKey = NewKey(JSONValue: newKeyJSON)
50 | else { return nil }
51 |
52 | self.lock = identifier
53 | self.key = newKey
54 | }
55 |
56 | func toJSON() -> JSON.Value {
57 |
58 | var jsonObject = JSON.Object(minimumCapacity: 2)
59 |
60 | jsonObject[JSONKey.lock.rawValue] = lock.toJSON()
61 |
62 | jsonObject[JSONKey.key.rawValue] = key.toJSON()
63 |
64 | return .object(jsonObject)
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/AnimatedButtonController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AnimatedButtonController.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 5/1/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import WatchKit
11 |
12 | public final class AnimatedButtonController {
13 |
14 | /// The names of the sequence of images to animate.
15 | public let images: [String]
16 |
17 | /// The interval between images.
18 | public let interval: TimeInterval
19 |
20 | public weak var target: WKInterfaceButton?
21 |
22 | private var currentImageIndex = 0
23 |
24 | private var timer: Timer?
25 |
26 | deinit { stopAnimating() }
27 |
28 | public init(images: [String], interval: TimeInterval, target: WKInterfaceButton?) {
29 |
30 | assert(images.count >= 2, "Must provide at least two images")
31 |
32 | self.images = images
33 | self.interval = interval
34 | self.target = target
35 | }
36 |
37 | // MARK: - Methods
38 |
39 | public func startAnimating() {
40 |
41 | guard timer == nil else { return }
42 |
43 | currentImageIndex = 0
44 |
45 | updateImage()
46 |
47 | self.timer = Timer.scheduledTimer(timeInterval: interval, target: self, selector: #selector(updateImage), userInfo: nil, repeats: true)
48 | }
49 |
50 | public func stopAnimating() {
51 |
52 | timer?.invalidate()
53 |
54 | timer = nil
55 | }
56 |
57 | // MARK: - Private Methods
58 |
59 | @objc private func updateImage() {
60 |
61 | let imageName = images[currentImageIndex]
62 |
63 | target?.setBackgroundImageNamed(imageName)
64 |
65 | currentImageIndex += 1
66 |
67 | // reset index to 0
68 | if currentImageIndex == images.count {
69 |
70 | currentImageIndex = 0
71 | }
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Sources/CoreLock/Observable.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Observable.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/30/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | public final class Observable {
10 |
11 | // MARK: - Properties
12 |
13 | public internal(set) var value: Value {
14 |
15 | didSet {
16 |
17 | for observer in observers {
18 |
19 | observer.callback(value)
20 | }
21 | }
22 | }
23 |
24 | // MARK: - Private Properties
25 |
26 | private var observers = [Observer]()
27 |
28 | private var nextID = 1
29 |
30 | // MARK: - Initialization
31 |
32 | public init(_ value: Value) {
33 |
34 | self.value = value
35 | }
36 |
37 | // MARK: - Methods
38 |
39 | public func observe(_ observer: @escaping (Value) -> ()) -> Int {
40 |
41 | let identifier = nextID
42 |
43 | // create notification
44 | let observer = Observer(identifier: identifier, callback: observer)
45 |
46 | // increment ID
47 | nextID += 1
48 |
49 | // add to queue
50 | observers.append(observer)
51 |
52 | return identifier
53 | }
54 |
55 | @discardableResult
56 | public func remove(observer: Int) -> Bool {
57 |
58 | guard let index = observers.index(where: { $0.identifier == observer })
59 | else { return false }
60 |
61 | observers.remove(at: index)
62 |
63 | return true
64 | }
65 | }
66 |
67 | public extension Observable where Value: ExpressibleByNilLiteral {
68 |
69 | convenience init() { self.init(nil) }
70 | }
71 |
72 | private struct Observer {
73 |
74 | let identifier: Int
75 |
76 | let callback: (Value) -> ()
77 |
78 | init(identifier: Int, callback: @escaping (Value) -> ()) {
79 |
80 | self.identifier = identifier
81 | self.callback = callback
82 | }
83 | }
84 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/EmptyTableView.swift:
--------------------------------------------------------------------------------
1 | //
2 | // EmptyTableView.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/1/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | /// View for the empty state of a table view.
12 | final class EmptyTableView: UIView {
13 |
14 | // MARK: - IB Outlets
15 |
16 | @IBOutlet weak var imageView: UIImageView!
17 |
18 | @IBOutlet weak var label: UILabel!
19 |
20 | // MARK: - Initialization
21 |
22 | static func loadFromNib() -> EmptyTableView {
23 |
24 | let nib = UINib(nibName: "EmptyTableView", bundle: nil)
25 |
26 | return nib.instantiate(withOwner: nil, options: nil).first as! EmptyTableView
27 | }
28 | }
29 |
30 | // MARK: - Protocol
31 |
32 | @objc protocol EmptyTableViewController: class {
33 |
34 | var tableView: UITableView! { get }
35 |
36 | var emptyTableView: EmptyTableView? { get set }
37 | }
38 |
39 | extension EmptyTableViewController {
40 |
41 | func showEmptyTableView() {
42 |
43 | guard self.emptyTableView == nil else { return }
44 |
45 | self.tableView.setContentOffset(CGPoint.zero, animated: false)
46 |
47 | self.tableView.tableFooterView = UIView()
48 |
49 | self.tableView.isScrollEnabled = false
50 |
51 | let emptyTableView = EmptyTableView.loadFromNib()
52 |
53 | emptyTableView.frame = self.tableView.bounds
54 |
55 | emptyTableView.autoresizingMask = [.flexibleHeight, .flexibleWidth]
56 |
57 | emptyTableView.translatesAutoresizingMaskIntoConstraints = true
58 |
59 | self.tableView.addSubview(emptyTableView)
60 |
61 | self.emptyTableView = emptyTableView
62 | }
63 |
64 | func hideEmptyTableView() {
65 |
66 | self.tableView.isScrollEnabled = true
67 |
68 | self.emptyTableView?.removeFromSuperview()
69 |
70 | self.emptyTableView = nil
71 |
72 | tableView.tableFooterView = nil
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/Sources/CoreLock/SecureData.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SecureData.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/16/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 |
11 | /// Secure Data Protocol.
12 | public protocol SecureData: Equatable {
13 |
14 | /// The data length.
15 | static var length: Int { get }
16 |
17 | /// The data.
18 | var data: Data { get }
19 |
20 | /// Initialize with data.
21 | init?(data: Data)
22 |
23 | /// Initialize with random value.
24 | init()
25 | }
26 |
27 | public func == (lhs: T, rhs: T) -> Bool {
28 |
29 | return lhs.data == rhs.data
30 | }
31 |
32 | /// A lock's key used for unlocking and actions.
33 | public struct KeyData: SecureData {
34 |
35 | public static let length = 256 / 8 // 32
36 |
37 | public let data: Data
38 |
39 | public init?(data: Data) {
40 |
41 | guard data.count == type(of: self).length
42 | else { return nil }
43 |
44 | self.data = data
45 | }
46 |
47 | /// Initializes a `Key` with a random value.
48 | public init() {
49 |
50 | self.data = random(type(of: self).length)
51 | }
52 | }
53 |
54 | /// Cryptographic nonce
55 | public struct Nonce: SecureData {
56 |
57 | public static let length = 16
58 |
59 | public let data: Data
60 |
61 | public init?(data: Data) {
62 |
63 | guard data.count == type(of: self).length
64 | else { return nil }
65 |
66 | self.data = data
67 | }
68 |
69 | public init() {
70 |
71 | self.data = random(type(of: self).length)
72 | }
73 | }
74 |
75 | public struct InitializationVector: SecureData {
76 |
77 | public static let length = IVSize
78 |
79 | public let data: Data
80 |
81 | public init?(data: Data) {
82 |
83 | guard data.count == type(of: self).length
84 | else { return nil }
85 |
86 | self.data = data
87 | }
88 |
89 | public init() {
90 |
91 | self.data = random(type(of: self).length)
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/Xcode/Lock.xcodeproj/xcuserdata/coleman.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Cerradura.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 1
11 |
12 | CerraduraSpotlightIndex.xcscheme
13 |
14 | orderHint
15 | 6
16 |
17 | CerraduraTodayExtension.xcscheme
18 |
19 | orderHint
20 | 5
21 |
22 | CerraduraWatch.xcscheme
23 |
24 | orderHint
25 | 4
26 |
27 | CoreLock OS X.xcscheme_^#shared#^_
28 |
29 | orderHint
30 | 2
31 |
32 | CoreLock iOS.xcscheme_^#shared#^_
33 |
34 | orderHint
35 | 3
36 |
37 | LockDaemon.xcscheme_^#shared#^_
38 |
39 | orderHint
40 | 0
41 |
42 |
43 | SuppressBuildableAutocreation
44 |
45 | 6E0429DA1D0FA3AA005AF969
46 |
47 | primary
48 |
49 |
50 | 6E729C531CC3BC030018A848
51 |
52 | primary
53 |
54 |
55 | 6E778D961CD5B70300AED11E
56 |
57 | primary
58 |
59 |
60 | 6EDCE1E51D0F34A200C3D3DC
61 |
62 | primary
63 |
64 |
65 | 6EE605911CC21941008EF0EE
66 |
67 | primary
68 |
69 |
70 | 6EE605A71CC21C1A008EF0EE
71 |
72 | primary
73 |
74 |
75 | 6EE605BE1CC21C81008EF0EE
76 |
77 | primary
78 |
79 |
80 | 6EF45F8F1CC6CAF9001F7A39
81 |
82 | primary
83 |
84 |
85 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/Android/Cerradura/app/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
17 |
18 |
25 |
26 |
27 |
28 |
32 |
33 |
34 |
35 |
40 |
41 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/LockInterfaceController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LockInterfaceController.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/9/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import WatchKit
11 |
12 | final class LockInterfaceController: WKInterfaceController {
13 |
14 | // MARK: - IB Outlets
15 |
16 | @IBOutlet weak var button: WKInterfaceButton!
17 |
18 | @IBOutlet weak var imageView: WKInterfaceImage!
19 |
20 | // MARK: - Properties
21 |
22 | var lock: LockCache!
23 |
24 | // MARK: - Loading
25 |
26 | override func awake(withContext context: Any?) {
27 | super.awake(withContext: context)
28 |
29 | lock = (context as! LockContext).lock
30 |
31 | updateUI()
32 | }
33 |
34 | override func willActivate() {
35 | // This method is called when watch view controller is about to be visible to user
36 | super.willActivate()
37 |
38 |
39 | }
40 |
41 | override func didDeactivate() {
42 | // This method is called when watch view controller is no longer visible
43 | super.didDeactivate()
44 | }
45 |
46 | // MARK: - Actions
47 |
48 | @IBAction func unlock(_ sender: WKInterfaceButton) {
49 |
50 | async { [weak self] in
51 |
52 | guard let controller = self else { return }
53 |
54 | do { try SessionController.shared.unlock(controller.lock.identifier) }
55 |
56 | catch { mainQueue { controller.showError("\(error)"); return } }
57 | }
58 | }
59 |
60 | // MARK: - Private Methods
61 |
62 | private func updateUI() {
63 |
64 | setTitle(lock.name)
65 |
66 | let buttonImage: UIImage
67 |
68 | switch lock.permission {
69 | case .owner: buttonImage = #imageLiteral(resourceName: "watchOwner")
70 | case .admin: buttonImage = #imageLiteral(resourceName: "watchAdmin")
71 | case .anytime: buttonImage = #imageLiteral(resourceName: "watchAnytime")
72 | case .scheduled: buttonImage = #imageLiteral(resourceName: "watchScheduled")
73 | }
74 |
75 | imageView.setImage(buttonImage)
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/Android/Cerradura/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "size" : "29x29",
15 | "idiom" : "iphone",
16 | "filename" : "Icon-Small@2x-1.png",
17 | "scale" : "2x"
18 | },
19 | {
20 | "size" : "29x29",
21 | "idiom" : "iphone",
22 | "filename" : "Icon-Small@3x.png",
23 | "scale" : "3x"
24 | },
25 | {
26 | "size" : "40x40",
27 | "idiom" : "iphone",
28 | "filename" : "Icon-Spotlight-40@2x.png",
29 | "scale" : "2x"
30 | },
31 | {
32 | "size" : "40x40",
33 | "idiom" : "iphone",
34 | "filename" : "Icon-Spotlight-40@3x.png",
35 | "scale" : "3x"
36 | },
37 | {
38 | "size" : "60x60",
39 | "idiom" : "iphone",
40 | "filename" : "iPhoneIcon@2x.png",
41 | "scale" : "2x"
42 | },
43 | {
44 | "size" : "60x60",
45 | "idiom" : "iphone",
46 | "filename" : "iPhoneIcon@3x.png",
47 | "scale" : "3x"
48 | },
49 | {
50 | "idiom" : "ipad",
51 | "size" : "20x20",
52 | "scale" : "1x"
53 | },
54 | {
55 | "idiom" : "ipad",
56 | "size" : "20x20",
57 | "scale" : "2x"
58 | },
59 | {
60 | "size" : "29x29",
61 | "idiom" : "ipad",
62 | "filename" : "Icon-Small.png",
63 | "scale" : "1x"
64 | },
65 | {
66 | "size" : "29x29",
67 | "idiom" : "ipad",
68 | "filename" : "Icon-Small@2x.png",
69 | "scale" : "2x"
70 | },
71 | {
72 | "size" : "40x40",
73 | "idiom" : "ipad",
74 | "filename" : "Icon-Spotlight-40.png",
75 | "scale" : "1x"
76 | },
77 | {
78 | "size" : "40x40",
79 | "idiom" : "ipad",
80 | "filename" : "Icon-Spotlight-40@2x-1.png",
81 | "scale" : "2x"
82 | },
83 | {
84 | "size" : "76x76",
85 | "idiom" : "ipad",
86 | "filename" : "iPadIcon.png",
87 | "scale" : "1x"
88 | },
89 | {
90 | "size" : "76x76",
91 | "idiom" : "ipad",
92 | "filename" : "iPadIcon@2x.png",
93 | "scale" : "2x"
94 | },
95 | {
96 | "size" : "83.5x83.5",
97 | "idiom" : "ipad",
98 | "filename" : "Icon-iPadPro@2x.png",
99 | "scale" : "2x"
100 | }
101 | ],
102 | "info" : {
103 | "version" : 1,
104 | "author" : "xcode"
105 | }
106 | }
--------------------------------------------------------------------------------
/Tests/UnitTests/CryptoTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CryptoTests.swift
3 | // CoreLockTests
4 | //
5 | // Created by Alsey Coleman Miller on 4/17/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | import Foundation
11 | import CryptoSwift
12 | @testable import CoreLock
13 |
14 | final class CryptoTests: XCTestCase {
15 |
16 | static let allTests: [(String, (CryptoTests) -> () throws -> Void)] = [("testHMAC", testHMAC), ("testEncrypt", testEncrypt), ("testFailEncrypt", testFailEncrypt), ("testEncryptKeyData", testEncryptKeyData)]
17 |
18 | func testHMAC() {
19 |
20 | let key = KeyData()
21 |
22 | let nonce = Nonce()
23 |
24 | let hmac = HMAC(key: key, message: nonce)
25 |
26 | XCTAssert(hmac == HMAC(key: key, message: nonce))
27 | }
28 |
29 | func testEncrypt() {
30 |
31 | let key = KeyData()
32 |
33 | let nonce = Nonce()
34 |
35 | let (encryptedData, iv) = encrypt(key: key.data, data: nonce.data)
36 |
37 | let decryptedData = decrypt(key: key.data, iv: iv, data: encryptedData)
38 |
39 | XCTAssert(nonce.data == decryptedData)
40 | }
41 |
42 | func testFailEncrypt() {
43 |
44 | let key = KeyData()
45 |
46 | let key2 = KeyData()
47 |
48 | let nonce = Nonce()
49 |
50 | let (encryptedData, iv) = encrypt(key: key.data, data: nonce.data)
51 |
52 | let decryptedData = decrypt(key: key2.data, iv: iv, data: encryptedData)
53 |
54 | XCTAssert(nonce.data != decryptedData)
55 | }
56 |
57 | func testEncryptKeyData() {
58 |
59 | let key = KeyData()
60 |
61 | let salt = KeyData()
62 |
63 | let (encryptedData, iv) = encrypt(key: salt.data, data: key.data)
64 |
65 | print("Encrypted key is \(encryptedData.count) bytes")
66 |
67 | let decryptedData = decrypt(key: salt.data, iv: iv, data: encryptedData)
68 |
69 | XCTAssert(decryptedData == key.data)
70 | }
71 |
72 | func testEncryptKeyList() {
73 |
74 | let keys = UUID().toBigEndian() + UUID().toBigEndian() + UUID().toBigEndian()
75 |
76 | let salt = KeyData()
77 |
78 | let (encryptedData, iv) = encrypt(key: salt.data, data: keys)
79 |
80 | print("Encrypted key list is \(encryptedData.count) bytes")
81 |
82 | let _ = decrypt(key: salt.data, iv: iv, data: encryptedData)
83 |
84 | //XCTAssert(decryptedData == key.data)
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/debianpackage/lockd/etc/init.d/lockd:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | ### BEGIN INIT INFO
3 | # Provides: lockd
4 | # Required-Start: networking
5 | # Required-Stop:
6 | # Default-Start: 2 3 4 5
7 | # Default-Stop: 0 1 6
8 | # Short-Description: Lock Daemon
9 | # Description: Lock Daemon
10 | ### END INIT INFO
11 |
12 | # Using the lsb functions to perform the operations.
13 | . /lib/lsb/init-functions
14 | # Process name ( For display )
15 | NAME=lockd
16 | # Daemon name, where is the actual executable
17 | DAEMON=/usr/bin/lockd
18 | # pid file for the daemon
19 | PIDFILE=/var/run/lockd.pid
20 |
21 | # If the daemon is not there, then exit.
22 | test -x $DAEMON || exit 5
23 |
24 | case $1 in
25 | start)
26 | # Checked the PID file exists and check the actual status of process
27 | if [ -e $PIDFILE ]; then
28 | status_of_proc -p $PIDFILE $DAEMON "$NAME process" && status="0" || status="$?"
29 | # If the status is SUCCESS then don't need to start again.
30 | if [ $status = "0" ]; then
31 | exit # Exit
32 | fi
33 | fi
34 | # Start the daemon.
35 | log_daemon_msg "Starting the process" "$NAME"
36 | # Start the daemon with the help of start-stop-daemon
37 | # Log the message appropriately
38 | hciconfig hci0 up
39 | if start-stop-daemon --start --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON ; then
40 | log_end_msg 0
41 | else
42 | log_end_msg 1
43 | fi
44 | ;;
45 | stop)
46 | # Stop the daemon.
47 | if [ -e $PIDFILE ]; then
48 | status_of_proc -p $PIDFILE $DAEMON "Stoppping the $NAME process" && status="0" || status="$?"
49 | if [ "$status" = 0 ]; then
50 | start-stop-daemon --stop --quiet --oknodo --pidfile $PIDFILE
51 | /bin/rm -rf $PIDFILE
52 | fi
53 | else
54 | log_daemon_msg "$NAME process is not running"
55 | log_end_msg 0
56 | fi
57 | ;;
58 | restart)
59 | # Restart the daemon.
60 | $0 stop && sleep 2 && $0 start
61 | ;;
62 | status)
63 | # Check the status of the process.
64 | if [ -e $PIDFILE ]; then
65 | status_of_proc -p $PIDFILE $DAEMON "$NAME process" && exit 0 || exit $?
66 | else
67 | log_daemon_msg "$NAME Process is not running"
68 | log_end_msg 0
69 | fi
70 | ;;
71 | reload)
72 | # Reload the process. Basically sending some signal to a daemon to reload
73 | # it configurations.
74 | if [ -e $PIDFILE ]; then
75 | start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE --name $NAME
76 | log_success_msg "$NAME process reloaded successfully"
77 | else
78 | log_failure_msg "$PIDFILE does not exists"
79 | fi
80 | ;;
81 | *)
82 | # For invalid arguments, print the usage message.
83 | echo "Usage: $0 {start|stop|restart|reload|status}"
84 | exit 2
85 | ;;
86 | esac
--------------------------------------------------------------------------------
/Sources/lockd/SunXi.swift:
--------------------------------------------------------------------------------
1 | /*
2 | SwiftyGPIO
3 |
4 | Copyright (c) 2016 Umberto Raimondi
5 | Licensed under the MIT license, as follows:
6 |
7 | Permission is hereby granted, free of charge, to any person obtaining a copy
8 | of this software and associated documentation files (the "Software"), to deal
9 | in the Software without restriction, including without limitation the rights
10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 | copies of the Software, and to permit persons to whom the Software is
12 | furnished to do so, subject to the following conditions:
13 |
14 | The above copyright notice and this permission notice shall be included in all
15 | copies or substantial portions of the Software.
16 |
17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 | SOFTWARE.)
24 | */
25 |
26 | /// GPIO for SunXi (e.g. OrangePi) hardware.
27 | ///
28 | /// - SeeAlso: [SunXi Wiki](http://linux-sunxi.org/GPIO)
29 |
30 | public struct SunXiGPIO: CustomStringConvertible, Equatable {
31 |
32 | // MARK: - Properties
33 |
34 | public var letter: Letter
35 |
36 | public var pin: UInt
37 |
38 | // MARK: - Initialization
39 |
40 | public init(letter: Letter, pin: UInt) {
41 |
42 | self.letter = letter
43 | self.pin = pin
44 | }
45 |
46 | // MARK: - Computed Properties
47 |
48 | public var description: String {
49 |
50 | return pinName
51 | }
52 |
53 | public var pinName: String {
54 |
55 | return "P" + "\(letter)" + "\(pin)"
56 | }
57 |
58 | public var gpioPin: Int {
59 |
60 | return (letter.rawValue * 32) + Int(pin)
61 | }
62 | }
63 |
64 | // MARK: - Equatable
65 |
66 | public func == (lhs: SunXiGPIO, rhs: SunXiGPIO) -> Bool {
67 |
68 | return lhs.letter == rhs.letter && lhs.pin == rhs.pin
69 | }
70 |
71 | // MARK: - Supporting Types
72 |
73 | public extension SunXiGPIO {
74 |
75 | public enum Letter: Int {
76 |
77 | case A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z
78 | }
79 | }
80 |
81 | // MARK: - Extensions
82 |
83 | public extension GPIO {
84 |
85 | convenience init(sunXi: SunXiGPIO) {
86 |
87 | self.init(name: sunXi.pinName, id: sunXi.gpioPin)
88 | }
89 | }
90 |
--------------------------------------------------------------------------------
/Android/Cerradura/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/Xcode/CerraduraWatch Extension/ComplicationController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ComplicationController.swift
3 | // CerraduraWatch WatchKit Extension
4 | //
5 | // Created by Alsey Coleman Miller on 5/1/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import ClockKit
10 |
11 | final class ComplicationController: NSObject, CLKComplicationDataSource {
12 |
13 | override init() {
14 | super.init()
15 |
16 | print("Initialized \(type(of: self))")
17 | }
18 |
19 | let blueTintColor = UIColor(red: CGFloat(0.278), green: CGFloat(0.506), blue: CGFloat(0.976), alpha: CGFloat(1.000))
20 |
21 | // MARK: - Timeline Configuration
22 |
23 | func getSupportedTimeTravelDirections(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimeTravelDirections) -> ()) {
24 |
25 | handler([])
26 | }
27 |
28 | func getPrivacyBehavior(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationPrivacyBehavior) -> ()) {
29 |
30 | handler(.showOnLockScreen)
31 | }
32 |
33 | func getCurrentTimelineEntry(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTimelineEntry?) -> ()) {
34 |
35 | print("Providing current timeline entry for complication")
36 |
37 | let template = self.template(for: complication)
38 |
39 | let entry = CLKComplicationTimelineEntry(date: Date(), complicationTemplate: template)
40 |
41 | handler(entry)
42 | }
43 |
44 | func getPlaceholderTemplate(for complication: CLKComplication, withHandler handler: @escaping (CLKComplicationTemplate?) -> ()) {
45 | // This method will be called once per supported complication, and the results will be cached
46 |
47 | print("Providing placeholder template for complication")
48 |
49 | let template = self.template(for: complication)
50 |
51 | handler(template)
52 | }
53 |
54 | // MARK: - Private Methods
55 |
56 | private func template(for complication: CLKComplication) -> CLKComplicationTemplate {
57 |
58 | switch complication.family {
59 |
60 | case .modularSmall:
61 |
62 | let image = #imageLiteral(resourceName: "modularSmallAdmin")
63 |
64 | let complicationTemplate = CLKComplicationTemplateModularSmallSimpleImage()
65 |
66 | let imageProvider = CLKImageProvider(onePieceImage: image)
67 |
68 | imageProvider.tintColor = blueTintColor
69 |
70 | complicationTemplate.imageProvider = imageProvider
71 |
72 | return complicationTemplate
73 |
74 | default: fatalError("Complication family \(complication.family.rawValue) not supported")
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/NewKeyParentViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NewKeyParentViewController.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/26/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import UIKit
11 | import CoreBluetooth
12 | import Foundation
13 | import GATT
14 | import CoreLock
15 |
16 | final class NewKeyParentViewController: UIViewController {
17 |
18 | // MARK: - IB Outlets
19 |
20 | @IBOutlet weak var activityIndicatorView: UIActivityIndicatorView!
21 |
22 | @IBOutlet weak var codeLabel: UILabel!
23 |
24 | @IBOutlet weak var doneBarItem: UIBarButtonItem!
25 |
26 | // MARK: - Properties
27 |
28 | var completion: ((Bool) -> ())?
29 |
30 | var newKey: (identifier: UUID, permission: Permission)!
31 |
32 | // MARK: - Loading
33 |
34 | override func viewDidLoad() {
35 | super.viewDidLoad()
36 |
37 | guard newKey != nil else { fatalError("Controller not configured") }
38 |
39 | self.navigationItem.hidesBackButton = true
40 |
41 | doneBarItem.isEnabled = false
42 |
43 | setupNewKey()
44 | }
45 |
46 | // MARK: - Actions
47 |
48 | @IBAction func done(_ sender: AnyObject?) {
49 |
50 | let completion = self.completion // for ARC
51 |
52 | self.dismiss(animated: true) { completion?(true) }
53 | }
54 |
55 | // MARK: - Methods
56 |
57 | private func setupNewKey() {
58 |
59 | guard let (lockCache, parentKeyData) = Store.shared[newKey.identifier]
60 | else { newKeyError("The key for the specified lock has been deleted from the database."); return }
61 |
62 | let parentKey = (lockCache.keyIdentifier, parentKeyData)
63 |
64 | print("Setting up new key for lock \(newKey.identifier)...")
65 |
66 | let sharedSecret = SharedSecret()
67 |
68 | async {
69 |
70 | // write to parent new key characteristic
71 |
72 | do { try LockManager.shared.createNewKey(self.newKey.identifier, permission: self.newKey.permission, parentKey: parentKey, sharedSecret: sharedSecret) }
73 |
74 | catch { mainQueue { self.newKeyError("Could not create new key. (\(error))") }; return }
75 |
76 | print("Successfully put lock \(self.newKey.identifier) in new key mode")
77 |
78 | mainQueue {
79 |
80 | self.doneBarItem.isEnabled = true
81 | self.codeLabel.isHidden = false
82 | self.codeLabel.text = "\(sharedSecret)"
83 | self.activityIndicatorView.stopAnimating()
84 | }
85 | }
86 | }
87 |
88 | private func newKeyError(_ error: String) {
89 |
90 | self.showErrorAlert(error, okHandler: { self.dismiss(animated: true, completion: nil) })
91 | }
92 | }
93 |
--------------------------------------------------------------------------------
/Xcode/Lock.xcodeproj/xcshareddata/xcschemes/CoreLock iOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/Sources/lockd/Configuration.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Configuration.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 4/16/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreLock
11 | import JSON
12 |
13 | struct Configuration: JSONEncodable, JSONDecodable {
14 |
15 | /// The lock's identifier.
16 | let identifier: UUID
17 |
18 | /// Whether HomeKit support is enabled.
19 | var isHomeKitEnabled: Bool = false
20 |
21 | /// Initializes a new `Configuration`.
22 | init() { identifier = UUID() }
23 | }
24 |
25 | // MARK: - JSON
26 |
27 | extension Configuration {
28 |
29 | enum JSONKey: String {
30 |
31 | case identifier, homekit
32 | }
33 |
34 | init?(JSONValue: JSON.Value) {
35 |
36 | guard let JSONObject = JSONValue.objectValue,
37 | let identifierString = JSONObject[JSONKey.identifier.rawValue]?.rawValue as? String,
38 | let identifier = UUID(rawValue: identifierString),
39 | let isHomeKitEnabled = JSONObject[JSONKey.homekit.rawValue]?.rawValue as? Bool
40 | else { return nil }
41 |
42 | self.identifier = identifier
43 | self.isHomeKitEnabled = isHomeKitEnabled
44 | }
45 |
46 | func toJSON() -> JSON.Value {
47 |
48 | return .object([JSONKey.identifier.rawValue: .string(identifier.rawValue),
49 | JSONKey.homekit.rawValue: .boolean(isHomeKitEnabled)])
50 | }
51 | }
52 |
53 | // MARK: - Loading and Saving
54 |
55 | extension Configuration {
56 |
57 | init?(filename: String) {
58 |
59 | let fileManager = FileManager.default
60 |
61 | // load existing
62 | guard fileManager.fileExists(atPath: filename) else { return nil }
63 |
64 | guard let jsonData = fileManager.contents(atPath: filename),
65 | let jsonString = String(UTF8Data: jsonData),
66 | let jsonValue = try? JSON.Value(string: jsonString),
67 | let configuration = Configuration(JSONValue: jsonValue)
68 | else { return nil }
69 |
70 | self = configuration
71 | }
72 |
73 | func save(_ filename: String) throws {
74 |
75 | let data = try! self.toJSON().toString(options: .prettyPrint).toUTF8Data()
76 |
77 | let fileManager = FileManager.default
78 |
79 | // create file if not created
80 | if fileManager.fileExists(atPath: filename) == false {
81 |
82 | fileManager.createFile(atPath: filename, contents: nil)
83 | }
84 |
85 | try data.write(to: URL(fileURLWithPath: filename))
86 | }
87 |
88 | static func load(_ filename: String) throws -> Configuration {
89 |
90 | if let configuration = Configuration(filename: filename) {
91 |
92 | return configuration
93 | }
94 |
95 | let newConfiguration = Configuration()
96 |
97 | try newConfiguration.save(filename)
98 |
99 | return newConfiguration
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDocumentTypes
8 |
9 |
10 | CFBundleTypeIconFiles
11 |
12 | eKeyDocument
13 | eKeyDocument
14 |
15 | CFBundleTypeName
16 | Cerradura eKey File
17 | CFBundleTypeRole
18 | Viewer
19 | LSHandlerRank
20 | Owner
21 | LSItemContentTypes
22 |
23 | com.colemancda.cerradura.ekey
24 |
25 |
26 |
27 | CFBundleExecutable
28 | $(EXECUTABLE_NAME)
29 | CFBundleIdentifier
30 | $(PRODUCT_BUNDLE_IDENTIFIER)
31 | CFBundleInfoDictionaryVersion
32 | 6.0
33 | CFBundleName
34 | $(PRODUCT_NAME)
35 | CFBundlePackageType
36 | APPL
37 | CFBundleShortVersionString
38 | 1.0.0
39 | CFBundleSignature
40 | ????
41 | CFBundleVersion
42 | GitVersion
43 | LSRequiresIPhoneOS
44 |
45 | NSLocationAlwaysUsageDescription
46 | Your location is needed to search for nearby locks.
47 | UIBackgroundModes
48 |
49 | bluetooth-central
50 | location
51 |
52 | UILaunchStoryboardName
53 | LaunchScreen
54 | UIMainStoryboardFile
55 | Main
56 | UIRequiredDeviceCapabilities
57 |
58 | armv7
59 |
60 | UISupportedInterfaceOrientations
61 |
62 | UIInterfaceOrientationPortrait
63 |
64 | UISupportedInterfaceOrientations~ipad
65 |
66 | UIInterfaceOrientationPortrait
67 | UIInterfaceOrientationPortraitUpsideDown
68 | UIInterfaceOrientationLandscapeLeft
69 | UIInterfaceOrientationLandscapeRight
70 |
71 | UTExportedTypeDeclarations
72 |
73 |
74 | UTTypeConformsTo
75 |
76 | public.json
77 |
78 | UTTypeDescription
79 | Cerradura eKey File
80 | UTTypeIdentifier
81 | com.colemancda.cerradura.ekey
82 | UTTypeSize320IconFile
83 | eKeyDocument
84 | UTTypeSize64IconFile
85 | eKeyDocument
86 | UTTypeTagSpecification
87 |
88 | public.filename-extension
89 | ekey
90 | public.mime-type
91 | cerradura/x-ekey
92 |
93 |
94 |
95 | NSBluetoothPeripheralUsageDescription
96 | This app uses Bluetooth to communicate with nearby smart locks.
97 |
98 |
99 |
--------------------------------------------------------------------------------
/Sources/CoreLock/POSIXTime.swift:
--------------------------------------------------------------------------------
1 | //
2 | // POSIXTime.swift
3 | // SwiftFoundation
4 | //
5 | // Created by Alsey Coleman Miller on 7/19/15.
6 | // Copyright © 2015 PureSwift. All rights reserved.
7 | //
8 |
9 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
10 | import Darwin.C
11 | #elseif os(Linux)
12 | import Glibc
13 | #endif
14 |
15 | import typealias Foundation.TimeInterval
16 |
17 | public extension timeval {
18 |
19 | static func timeOfDay() -> timeval {
20 |
21 | var timeStamp = timeval()
22 |
23 | guard gettimeofday(&timeStamp, nil) == 0
24 | else { fatalError("gettimeofday() failed") }
25 |
26 | return timeStamp
27 | }
28 |
29 | init(timeInterval: TimeInterval) {
30 |
31 | let (integerValue, decimalValue) = modf(timeInterval)
32 |
33 | let million: TimeInterval = 1000000.0
34 |
35 | let microseconds = decimalValue * million
36 |
37 | self.init(tv_sec: Int(integerValue), tv_usec: POSIXMicroseconds(microseconds))
38 | }
39 |
40 | var timeInterval: TimeInterval {
41 |
42 | let secondsSince1970 = TimeInterval(self.tv_sec)
43 |
44 | let million: TimeInterval = 1000000.0
45 |
46 | let microseconds = TimeInterval(self.tv_usec) / million
47 |
48 | return secondsSince1970 + microseconds
49 | }
50 | }
51 |
52 | public extension timespec {
53 |
54 | init(timeInterval: TimeInterval) {
55 |
56 | let (integerValue, decimalValue) = modf(timeInterval)
57 |
58 | let billion: TimeInterval = 1000000000.0
59 |
60 | let nanoseconds = decimalValue * billion
61 |
62 | self.init(tv_sec: Int(integerValue), tv_nsec: Int(nanoseconds))
63 | }
64 |
65 | var timeInterval: TimeInterval {
66 |
67 | let secondsSince1970 = TimeInterval(self.tv_sec)
68 |
69 | let billion: TimeInterval = 1000000000.0
70 |
71 | let nanoseconds = TimeInterval(self.tv_nsec) / billion
72 |
73 | return secondsSince1970 + nanoseconds
74 | }
75 | }
76 |
77 | public extension tm {
78 |
79 | init(UTCSecondsSince1970: time_t) {
80 |
81 | var seconds = UTCSecondsSince1970
82 |
83 | // don't free!
84 | // The return value points to a statically allocated struct which might be overwritten by subsequent calls to any of the date and time functions.
85 | // http://linux.die.net/man/3/gmtime
86 | let timePointer = gmtime(&seconds)!
87 |
88 | self = timePointer.pointee
89 | }
90 | }
91 |
92 | // MARK: - Cross-Platform Support
93 |
94 | #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS)
95 |
96 | public typealias POSIXMicroseconds = __darwin_suseconds_t
97 |
98 | #elseif os(Linux)
99 |
100 | public typealias POSIXMicroseconds = __suseconds_t
101 |
102 | public func modf(value: Double) -> (Double, Double) {
103 |
104 | var integerValue: Double = 0
105 |
106 | let decimalValue = modf(value, &integerValue)
107 |
108 | return (decimalValue, integerValue)
109 | }
110 |
111 | #endif
112 |
--------------------------------------------------------------------------------
/Sources/CoreLock/NewKey.swift:
--------------------------------------------------------------------------------
1 | //
2 | // NewKey.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 7/10/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import JSON
11 |
12 | /// Temporary new key. (non-owner)
13 | public struct NewKey: Equatable, JSONEncodable, JSONDecodable {
14 |
15 | public let identifier: UUID
16 |
17 | public let sharedSecret: KeyData
18 |
19 | public let permission: Permission
20 |
21 | public let date: Date
22 |
23 | public var name: Key.Name
24 |
25 | public init(identifier: UUID, date: Date = Date(), name: Key.Name, sharedSecret: KeyData, permission: Permission) {
26 |
27 | assert(permission != .owner, "Cannot create owner new key")
28 |
29 | self.identifier = identifier
30 | self.name = name
31 | self.sharedSecret = sharedSecret
32 | self.permission = permission
33 | self.date = date
34 | }
35 | }
36 |
37 | // MARK: - Equatable
38 |
39 | public func == (lhs: NewKey, rhs: NewKey) -> Bool {
40 |
41 | return lhs.identifier == rhs.identifier
42 | && lhs.sharedSecret == rhs.sharedSecret
43 | && lhs.permission == rhs.permission
44 | && lhs.name == rhs.name
45 | && lhs.date == rhs.date
46 | }
47 |
48 | // MARK: - JSON
49 |
50 | public extension NewKey {
51 |
52 | enum JSONKey: String {
53 |
54 | case identifier, sharedSecret, permission, name, date
55 | }
56 |
57 | init?(JSONValue: JSON.Value) {
58 |
59 | guard let JSONObject = JSONValue.objectValue,
60 | let identifierString = JSONObject[JSONKey.identifier.rawValue]?.stringValue,
61 | let identifier = UUID(rawValue: identifierString),
62 | let dataString = JSONObject[JSONKey.sharedSecret.rawValue]?.stringValue,
63 | let data = Data(base64Encoded: dataString),
64 | let keyData = KeyData(data: data),
65 | let permissionDataString = JSONObject[JSONKey.permission.rawValue]?.stringValue,
66 | let permissionData = Data(base64Encoded: permissionDataString),
67 | let permission = Permission(bigEndian: permissionData),
68 | let date = JSONObject[JSONKey.date.rawValue]?.doubleValue,
69 | let name = JSONObject[JSONKey.name.rawValue]?.stringValue,
70 | let keyName = Key.Name(rawValue: name)
71 | else { return nil }
72 |
73 | self.identifier = identifier
74 | self.sharedSecret = keyData
75 | self.permission = permission
76 | self.name = keyName
77 | self.date = Date(timeIntervalSince1970: date)
78 | }
79 |
80 | func toJSON() -> JSON.Value {
81 |
82 | var jsonObject = JSON.Object(minimumCapacity: 5)
83 |
84 | jsonObject[JSONKey.identifier.rawValue] = .string(identifier.rawValue)
85 |
86 | jsonObject[JSONKey.sharedSecret.rawValue] = .string(sharedSecret.data.base64EncodedString())
87 |
88 | jsonObject[JSONKey.permission.rawValue] = .string(permission.toBigEndian().base64EncodedString())
89 |
90 | jsonObject[JSONKey.name.rawValue] = .string(name.rawValue)
91 |
92 | jsonObject[JSONKey.date.rawValue] = .double(date.timeIntervalSince1970)
93 |
94 | return .object(jsonObject)
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/CoreDataExtensions.swift:
--------------------------------------------------------------------------------
1 | //
2 | // CoreDataExtensions.swift
3 | // CoreVistage
4 | //
5 | // Created by Alsey Coleman Miller on 10/6/15.
6 | // Copyright © 2015 Vistage. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreData
11 |
12 | public extension NSManagedObjectContext {
13 |
14 | /// Wraps the block to allow for error throwing.
15 | @available(OSX 10.7, *)
16 | func performErrorBlockAndWait(_ block: @escaping () throws -> ()) throws {
17 |
18 | var blockError: Swift.Error?
19 |
20 | self.performAndWait {
21 |
22 | do { try block() }
23 |
24 | catch { blockError = error }
25 |
26 | return
27 | }
28 |
29 | if let error = blockError {
30 |
31 | throw error
32 | }
33 |
34 | return
35 | }
36 |
37 | func findOrCreate(entity: NSEntityDescription, resourceID: String, identifierProperty: String) throws -> T {
38 |
39 | // get cached resource...
40 |
41 | let fetchRequest = NSFetchRequest(entityName: entity.name!)
42 |
43 | fetchRequest.fetchLimit = 1
44 |
45 | fetchRequest.includesSubentities = false
46 |
47 | // create predicate
48 |
49 | fetchRequest.predicate = NSComparisonPredicate(leftExpression: NSExpression(forKeyPath: identifierProperty), rightExpression: NSExpression(forConstantValue: resourceID), modifier: NSComparisonPredicate.Modifier.direct, type: NSComparisonPredicate.Operator.equalTo, options: NSComparisonPredicate.Options.normalized)
50 |
51 | fetchRequest.returnsObjectsAsFaults = false
52 |
53 | // fetch
54 |
55 | let results = try self.fetch(fetchRequest)
56 |
57 | let resource: T
58 |
59 | if let firstResult = results.first {
60 |
61 | resource = firstResult
62 | }
63 |
64 | // create cached resource if not found
65 | else {
66 |
67 | // create a new entity
68 | let newManagedObject = NSEntityDescription.insertNewObject(forEntityName: entity.name!, into: self)
69 |
70 | // set resource ID
71 | (newManagedObject).setValue(resourceID, forKey: identifierProperty)
72 |
73 | resource = newManagedObject as! T
74 | }
75 |
76 | return resource
77 | }
78 |
79 | func find(entity: NSEntityDescription, resourceID: String, identifierProperty: String) throws -> T? {
80 |
81 | // get cached resource...
82 |
83 | let fetchRequest = NSFetchRequest(entityName: entity.name!)
84 |
85 | fetchRequest.fetchLimit = 1
86 |
87 | fetchRequest.includesSubentities = false
88 |
89 | // create predicate
90 |
91 | fetchRequest.predicate = NSComparisonPredicate(leftExpression: NSExpression(forKeyPath: identifierProperty), rightExpression: NSExpression(forConstantValue: resourceID), modifier: NSComparisonPredicate.Modifier.direct, type: NSComparisonPredicate.Operator.equalTo, options: NSComparisonPredicate.Options.normalized)
92 |
93 | fetchRequest.returnsObjectsAsFaults = false
94 |
95 | // fetch
96 |
97 | return try self.fetch(fetchRequest).first
98 | }
99 | }
100 |
--------------------------------------------------------------------------------
/Xcode/Lock.xcodeproj/xcshareddata/xcschemes/LockDaemon.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
55 |
61 |
62 |
63 |
64 |
65 |
66 |
72 |
74 |
80 |
81 |
82 |
83 |
85 |
86 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/Xcode/Lock.xcodeproj/xcshareddata/xcschemes/Cerradura.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/BeaconController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // BeaconController.swift
3 | // Lock
4 | //
5 | // Created by Alsey Coleman Miller on 6/12/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreLock
11 | import CoreLocation
12 | import UIKit
13 |
14 | final class BeaconController: NSObject, CLLocationManagerDelegate {
15 |
16 | static let shared = BeaconController()
17 |
18 | // MARK: - Properties
19 |
20 | static let region: CLBeaconRegion = {
21 |
22 | let region = CLBeaconRegion(proximityUUID: LockBeaconUUID, major: 0, minor: 0, identifier: BeaconIdentifier)
23 |
24 | region.notifyEntryStateOnDisplay = true
25 |
26 | return region
27 | }()
28 |
29 | var log: ((String) -> ())?
30 |
31 | private(set) var regionState: CLRegionState = .unknown
32 |
33 | private lazy var locationManager: CLLocationManager = {
34 |
35 | let location = CLLocationManager()
36 |
37 | location.delegate = self
38 |
39 | return location
40 | }()
41 |
42 | // MARK: - Methods
43 |
44 | /// Starts monitoring.
45 | func start() {
46 |
47 | locationManager.requestAlwaysAuthorization()
48 |
49 | locationManager.startMonitoring(for: BeaconController.region)
50 | }
51 |
52 | func stop() {
53 |
54 | locationManager.stopMonitoring(for: BeaconController.region)
55 | }
56 |
57 | // MARK: - CLLocationManagerDelegate
58 |
59 | func locationManager(_ manager: CLLocationManager, didStartMonitoringFor region: CLRegion) {
60 |
61 | log?("Started iBeacon monitoring")
62 | }
63 |
64 | func locationManager(_ manager: CLLocationManager, monitoringDidFailFor region: CLRegion?, withError error: Error) {
65 |
66 | log?("Could not start iBeacon monitoring. (\(error))")
67 | }
68 |
69 | func locationManager(_ manager: CLLocationManager, didDetermineState state: CLRegionState, for region: CLRegion) {
70 |
71 | guard regionState != state else {
72 |
73 | log?("Region state: \(state.rawValue)")
74 |
75 | return
76 | }
77 |
78 | log?("Region state changed: \(state.rawValue)")
79 |
80 | // state changed
81 | regionState = state
82 |
83 | /*
84 | if state == .inside {
85 |
86 | // dont scan if already scanning
87 | guard LockManager.shared.scanning.value == false
88 | && LockManager.shared.state.value == .poweredOn
89 | else { return }
90 |
91 | async {
92 |
93 | do { try LockManager.shared.scan(duration: 2) }
94 |
95 | catch { self.log?("Scan failed: \(error)") }
96 | }
97 |
98 | } else {
99 |
100 | LockManager.shared.clear()
101 | }
102 | */
103 | }
104 |
105 | /*
106 | func locationManager(_ manager: CLLocationManager, didEnterRegion region: CLRegion) {
107 |
108 | log?("Did enter region")
109 |
110 |
111 | }
112 |
113 | func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion) {
114 |
115 | log?("Did exit region")
116 | }*/
117 |
118 | }
119 |
120 | // MARK: - Private
121 |
122 | let BeaconIdentifier = "LockBeacon"
123 |
124 | let UnlockActionIdentifier = "UnlockAction"
125 |
126 | let UnlockNotification = "UnlockNotification"
127 |
128 | let LockCategory = "LockCategory"
129 |
--------------------------------------------------------------------------------
/Xcode/Cerradura/LockCache.swift:
--------------------------------------------------------------------------------
1 | //
2 | // LockCache.swift
3 | // LockCache
4 | //
5 | // Created by Alsey Coleman Miller on 4/22/16.
6 | // Copyright © 2016 ColemanCDA. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import CoreLock
11 | import CoreData
12 |
13 | /// Cached lock information.
14 | struct LockCache: CoreDataEncodable, CoreDataDecodable {
15 |
16 | let identifier: UUID
17 |
18 | var name: String
19 |
20 | let model: Model
21 |
22 | let permission: Permission
23 |
24 | let keyIdentifier: UUID
25 |
26 | var version: UInt64
27 |
28 | var packageVersion: (UInt16, UInt16, UInt16)?
29 | }
30 |
31 | // MARK: - CoreData
32 |
33 | extension LockCache {
34 |
35 | static var entityName: String { return "Lock" }
36 |
37 | enum Property: String {
38 |
39 | case identifier, name, model, version, packageVersion, permission, keyIdentifier
40 | }
41 |
42 | @discardableResult
43 | func save(context: NSManagedObjectContext) throws -> NSManagedObject {
44 |
45 | let entity = context.persistentStoreCoordinator!.managedObjectModel.entitiesByName[LockCache.entityName]!
46 |
47 | let managedObject = try context.findOrCreate(entity: entity, resourceID: self.identifier.rawValue, identifierProperty: Property.identifier.rawValue)
48 |
49 | managedObject.setValue(name, forKey: Property.name.rawValue)
50 | managedObject.setValue(NSNumber(value: model.rawValue), forKey: Property.model.rawValue)
51 | managedObject.setValue(NSNumber(value: version), forKey: Property.version.rawValue)
52 | managedObject.setValue(permission.toBigEndian(), forKey: Property.permission.rawValue)
53 | managedObject.setValue(keyIdentifier.rawValue, forKey: Property.keyIdentifier.rawValue)
54 |
55 | let packageVersionData: Data?
56 |
57 | if let packageVersion = self.packageVersion {
58 |
59 | packageVersionData = LockService.PackageVersion(value: packageVersion).toBigEndian()
60 |
61 | } else {
62 |
63 | packageVersionData = nil
64 | }
65 |
66 | managedObject.setValue(packageVersionData, forKey: Property.packageVersion.rawValue)
67 |
68 | try context.save()
69 |
70 | return managedObject
71 | }
72 |
73 | init(managedObject: NSManagedObject) {
74 |
75 | guard managedObject.entity.name == LockCache.entityName else { fatalError("Invalid Entity") }
76 |
77 | let identifierString = managedObject.value(forKey: Property.identifier.rawValue) as! String
78 | self.identifier = UUID(rawValue: identifierString)!
79 |
80 | self.name = managedObject.value(forKey: Property.name.rawValue) as! String
81 |
82 | let modelValue = managedObject.value(forKey: Property.model.rawValue) as! NSNumber
83 | self.model = Model(rawValue: modelValue.uint8Value)!
84 |
85 | self.version = (managedObject.value(forKey: Property.version.rawValue) as! NSNumber).uint64Value
86 |
87 | if let packageVersionData = managedObject.value(forKey: Property.packageVersion.rawValue) as? Data {
88 |
89 | self.packageVersion = LockService.PackageVersion(bigEndian: packageVersionData)!.value
90 |
91 | } else {
92 |
93 | self.packageVersion = nil
94 | }
95 |
96 | let permissionData = managedObject.value(forKey: Property.permission.rawValue) as! Data
97 | self.permission = Permission(bigEndian: permissionData)!
98 |
99 | let keyIdentifierString = managedObject.value(forKey: Property.keyIdentifier.rawValue) as! String
100 | self.keyIdentifier = UUID(rawValue: keyIdentifierString)!
101 | }
102 | }
103 |
--------------------------------------------------------------------------------