├── .gitignore ├── .gitmodules ├── .swiftlint.yml ├── Documents ├── rvcmac-icon.pdf ├── rvcmac-icon.png ├── rvcmac-status-item.pdf ├── rvcmac.pdf ├── rvcmac.png ├── rvcmac.sketch ├── rvcmac2.pdf ├── rvcmac2.sketch ├── rvcmac3.sketch ├── settings.pdf └── settings.sketch ├── Podfile ├── Podfile.lock ├── Pods ├── CocoaLumberjack │ ├── Classes │ │ ├── CocoaLumberjack.h │ │ ├── CocoaLumberjack.swift │ │ ├── DDASLLogCapture.h │ │ ├── DDASLLogCapture.m │ │ ├── DDASLLogger.h │ │ ├── DDASLLogger.m │ │ ├── DDAbstractDatabaseLogger.h │ │ ├── DDAbstractDatabaseLogger.m │ │ ├── DDAssertMacros.h │ │ ├── DDFileLogger.h │ │ ├── DDFileLogger.m │ │ ├── DDLegacyMacros.h │ │ ├── DDLog+LOGV.h │ │ ├── DDLog.h │ │ ├── DDLog.m │ │ ├── DDLogMacros.h │ │ ├── DDOSLogger.h │ │ ├── DDOSLogger.m │ │ ├── DDTTYLogger.h │ │ └── DDTTYLogger.m │ ├── LICENSE.txt │ └── README.md ├── Decodable │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── Castable.swift │ │ ├── Decodable.h │ │ ├── Decodable.swift │ │ ├── Decoders.swift │ │ ├── DecodingError.swift │ │ ├── KeyPath.swift │ │ ├── NSValueCastable.swift │ │ ├── Operators.swift │ │ ├── OptionalKeyPath.swift │ │ ├── Overloads.swift │ │ ├── Parse.swift │ │ └── RawRepresentableDecodable.swift ├── Manifest.lock ├── Pods.xcodeproj │ └── project.pbxproj ├── SwiftHEXColors │ ├── LICENSE │ ├── README.md │ └── Sources │ │ ├── SwiftHEXColors.h │ │ └── SwiftHEXColors.swift ├── SwiftLint │ ├── LICENSE │ ├── SwiftLintFramework.framework │ │ ├── Resources │ │ ├── SwiftLintFramework │ │ └── Versions │ │ │ ├── A │ │ │ ├── Frameworks │ │ │ │ ├── Commandant.framework │ │ │ │ │ ├── Commandant │ │ │ │ │ ├── Resources │ │ │ │ │ └── Versions │ │ │ │ │ │ ├── A │ │ │ │ │ │ ├── Commandant │ │ │ │ │ │ └── Resources │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ │ └── Current │ │ │ │ ├── Result.framework │ │ │ │ │ ├── Resources │ │ │ │ │ ├── Result │ │ │ │ │ └── Versions │ │ │ │ │ │ ├── A │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ │ └── Result │ │ │ │ │ │ └── Current │ │ │ │ ├── SWXMLHash.framework │ │ │ │ │ ├── Resources │ │ │ │ │ ├── SWXMLHash │ │ │ │ │ └── Versions │ │ │ │ │ │ ├── A │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ │ └── SWXMLHash │ │ │ │ │ │ └── Current │ │ │ │ ├── SourceKittenFramework.framework │ │ │ │ │ ├── Resources │ │ │ │ │ ├── SourceKittenFramework │ │ │ │ │ └── Versions │ │ │ │ │ │ ├── A │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ │ └── SourceKittenFramework │ │ │ │ │ │ └── Current │ │ │ │ ├── SwiftyTextTable.framework │ │ │ │ │ ├── Resources │ │ │ │ │ ├── SwiftyTextTable │ │ │ │ │ └── Versions │ │ │ │ │ │ ├── A │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ │ └── SwiftyTextTable │ │ │ │ │ │ └── Current │ │ │ │ ├── Yams.framework │ │ │ │ │ ├── Resources │ │ │ │ │ ├── Versions │ │ │ │ │ │ ├── A │ │ │ │ │ │ │ ├── Resources │ │ │ │ │ │ │ │ └── Info.plist │ │ │ │ │ │ │ └── Yams │ │ │ │ │ │ └── Current │ │ │ │ │ └── Yams │ │ │ │ ├── libswiftCore.dylib │ │ │ │ ├── libswiftCoreGraphics.dylib │ │ │ │ ├── libswiftDarwin.dylib │ │ │ │ ├── libswiftDispatch.dylib │ │ │ │ ├── libswiftFoundation.dylib │ │ │ │ ├── libswiftIOKit.dylib │ │ │ │ └── libswiftObjectiveC.dylib │ │ │ ├── Resources │ │ │ │ └── Info.plist │ │ │ └── SwiftLintFramework │ │ │ └── Current │ └── swiftlint └── Target Support Files │ ├── CocoaLumberjack │ ├── CocoaLumberjack-dummy.m │ ├── CocoaLumberjack-prefix.pch │ ├── CocoaLumberjack-umbrella.h │ ├── CocoaLumberjack.modulemap │ ├── CocoaLumberjack.xcconfig │ └── Info.plist │ ├── Decodable │ ├── Decodable-dummy.m │ ├── Decodable-prefix.pch │ ├── Decodable-umbrella.h │ ├── Decodable.modulemap │ ├── Decodable.xcconfig │ └── Info.plist │ ├── Pods-rvcmac │ ├── Info.plist │ ├── Pods-rvcmac-acknowledgements.markdown │ ├── Pods-rvcmac-acknowledgements.plist │ ├── Pods-rvcmac-dummy.m │ ├── Pods-rvcmac-frameworks.sh │ ├── Pods-rvcmac-resources.sh │ ├── Pods-rvcmac-umbrella.h │ ├── Pods-rvcmac.debug.xcconfig │ ├── Pods-rvcmac.modulemap │ └── Pods-rvcmac.release.xcconfig │ ├── Pods-rvcmacTests │ ├── Info.plist │ ├── Pods-rvcmacTests-acknowledgements.markdown │ ├── Pods-rvcmacTests-acknowledgements.plist │ ├── Pods-rvcmacTests-dummy.m │ ├── Pods-rvcmacTests-frameworks.sh │ ├── Pods-rvcmacTests-resources.sh │ ├── Pods-rvcmacTests-umbrella.h │ ├── Pods-rvcmacTests.debug.xcconfig │ ├── Pods-rvcmacTests.modulemap │ └── Pods-rvcmacTests.release.xcconfig │ ├── Pods-rvcmacUITests │ ├── Info.plist │ ├── Pods-rvcmacUITests-acknowledgements.markdown │ ├── Pods-rvcmacUITests-acknowledgements.plist │ ├── Pods-rvcmacUITests-dummy.m │ ├── Pods-rvcmacUITests-frameworks.sh │ ├── Pods-rvcmacUITests-resources.sh │ ├── Pods-rvcmacUITests-umbrella.h │ ├── Pods-rvcmacUITests.debug.xcconfig │ ├── Pods-rvcmacUITests.modulemap │ └── Pods-rvcmacUITests.release.xcconfig │ └── SwiftHEXColors │ ├── Info.plist │ ├── SwiftHEXColors-dummy.m │ ├── SwiftHEXColors-prefix.pch │ ├── SwiftHEXColors-umbrella.h │ ├── SwiftHEXColors.modulemap │ └── SwiftHEXColors.xcconfig ├── README.md ├── deps └── .gitkeep ├── fastlane ├── .gitignore ├── Appfile ├── Fastfile └── README.md ├── rvcmac.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ └── rvcmac.xcscheme ├── rvcmac.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── rvcmac.xcscmblueprint ├── rvcmac ├── AppDelegate.swift ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── icon_128x128.png │ │ ├── icon_128x128@2x.png │ │ ├── icon_16x16.png │ │ ├── icon_16x16@2x.png │ │ ├── icon_256x256.png │ │ ├── icon_256x256@2x.png │ │ ├── icon_32x32.png │ │ ├── icon_32x32@2x.png │ │ ├── icon_512x512.png │ │ └── icon_512x512@2x.png │ ├── Contents.json │ ├── rvcmac-status-item.imageset │ │ ├── Contents.json │ │ └── rvcmac-status-item.pdf │ └── settings.imageset │ │ ├── Contents.json │ │ └── settings.pdf ├── Base.lproj │ └── Main.storyboard ├── Controller │ ├── .gitkeep │ ├── VpnCollectionViewController.swift │ ├── VpnCollectionViewDataSource.swift │ ├── VpnCollectionViewDelegate.swift │ ├── VpnCollectionViewFlowLayout.swift │ ├── VpnCollectionViewItem.swift │ ├── VpnCollectionViewItem.xib │ ├── VpnContainerViewController.swift │ ├── VpnPopover.swift │ └── VpnWindowController.swift ├── Info.plist ├── Model │ ├── .gitkeep │ ├── Connection+CoreDataClass.swift │ ├── Connection+CoreDataProperties.swift │ ├── Defaults.swift │ ├── RvcConnection.swift │ └── RvcStatus.swift ├── Resources │ └── .gitkeep ├── Service │ ├── .gitkeep │ ├── Database.swift │ ├── RvcWrapper.swift │ ├── RvdClient.swift │ └── Storage.swift ├── Util │ ├── .gitkeep │ ├── LoginItemsController.swift │ ├── NSColor+Ribose.swift │ ├── NSView+BackgroundColor.swift │ └── NSViewController+Identifier.swift ├── View │ ├── .gitkeep │ ├── CircleView.swift │ ├── FooterView.swift │ ├── HeaderView.swift │ ├── ImageButton.swift │ ├── TextButton.swift │ ├── VpnButton.swift │ ├── VpnCollectionView.swift │ ├── VpnContainerView.swift │ └── VpnWindow.swift ├── Viewmodel │ └── .gitkeep ├── bridging_header.h └── rvcmac.xcdatamodeld │ └── rvcmac.xcdatamodel │ └── contents ├── rvcmacTests ├── Info.plist └── rvcmacTests.swift ├── rvcmacUITests ├── Info.plist └── rvcmacUITests.swift ├── rvcmachelper └── rvcmachelper │ ├── HelperAppDelegate.h │ ├── HelperAppDelegate.m │ ├── Info.plist │ └── main.m └── update_submodules.sh /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "deps/rvc"] 2 | path = deps/rvc 3 | url = https://github.com/riboseinc/rvc.git 4 | branch = master 5 | -------------------------------------------------------------------------------- /.swiftlint.yml: -------------------------------------------------------------------------------- 1 | disabled_rules: # rule identifiers to exclude from running 2 | - trailing_whitespace 3 | - implicit_getter 4 | - line_length 5 | - force_cast 6 | - force_try 7 | - identifier_name 8 | - weak_delegate 9 | opt_in_rules: 10 | included: # paths to include during linting. `--path` is ignored if present. 11 | - rvcmac 12 | - rvcmacTests 13 | - rvcmacUITests 14 | excluded: 15 | -------------------------------------------------------------------------------- /Documents/rvcmac-icon.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac-icon.pdf -------------------------------------------------------------------------------- /Documents/rvcmac-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac-icon.png -------------------------------------------------------------------------------- /Documents/rvcmac-status-item.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac-status-item.pdf -------------------------------------------------------------------------------- /Documents/rvcmac.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac.pdf -------------------------------------------------------------------------------- /Documents/rvcmac.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac.png -------------------------------------------------------------------------------- /Documents/rvcmac.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac.sketch -------------------------------------------------------------------------------- /Documents/rvcmac2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac2.pdf -------------------------------------------------------------------------------- /Documents/rvcmac2.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac2.sketch -------------------------------------------------------------------------------- /Documents/rvcmac3.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/rvcmac3.sketch -------------------------------------------------------------------------------- /Documents/settings.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/settings.pdf -------------------------------------------------------------------------------- /Documents/settings.sketch: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Documents/settings.sketch -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.12' 2 | 3 | target 'rvcmac' do 4 | use_frameworks! 5 | 6 | # Pods for rvcmac 7 | pod 'SwiftLint' 8 | pod 'CocoaLumberjack/Swift' 9 | pod 'Decodable', '~> 0.5' 10 | pod 'SwiftHEXColors', '~> 1.1.0' 11 | 12 | target 'rvcmacTests' do 13 | inherit! :search_paths 14 | # Pods for testing 15 | end 16 | 17 | target 'rvcmacUITests' do 18 | inherit! :search_paths 19 | # Pods for testing 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack/Default (3.2.1) 3 | - CocoaLumberjack/Swift (3.2.1): 4 | - CocoaLumberjack/Default 5 | - Decodable (0.6.0) 6 | - SwiftHEXColors (1.1.0) 7 | - SwiftLint (0.22.0) 8 | 9 | DEPENDENCIES: 10 | - CocoaLumberjack/Swift 11 | - Decodable (~> 0.5) 12 | - SwiftHEXColors (~> 1.1.0) 13 | - SwiftLint 14 | 15 | SPEC CHECKSUMS: 16 | CocoaLumberjack: 2800c03334042fe80589423c8d80e582dcaec482 17 | Decodable: f0b95fa2fcf8633dd097aa8f7f09838ab3524f5d 18 | SwiftHEXColors: 8f7e364df7929e32cff9f9eeb044bb215167d6be 19 | SwiftLint: 1134786caedd2caab0560d2f36b76414a5a56808 20 | 21 | PODFILE CHECKSUM: b5f3058ed2fa5be83d5a554f464ec58ff384d047 22 | 23 | COCOAPODS: 1.3.1 24 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/CocoaLumberjack.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * Welcome to CocoaLumberjack! 18 | * 19 | * The project page has a wealth of documentation if you have any questions. 20 | * https://github.com/CocoaLumberjack/CocoaLumberjack 21 | * 22 | * If you're new to the project you may wish to read "Getting Started" at: 23 | * Documentation/GettingStarted.md 24 | * 25 | * Otherwise, here is a quick refresher. 26 | * There are three steps to using the macros: 27 | * 28 | * Step 1: 29 | * Import the header in your implementation or prefix file: 30 | * 31 | * #import 32 | * 33 | * Step 2: 34 | * Define your logging level in your implementation file: 35 | * 36 | * // Log levels: off, error, warn, info, verbose 37 | * static const DDLogLevel ddLogLevel = DDLogLevelVerbose; 38 | * 39 | * Step 2 [3rd party frameworks]: 40 | * 41 | * Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel: 42 | * 43 | * // #undef LOG_LEVEL_DEF // Undefine first only if needed 44 | * #define LOG_LEVEL_DEF myLibLogLevel 45 | * 46 | * Define your logging level in your implementation file: 47 | * 48 | * // Log levels: off, error, warn, info, verbose 49 | * static const DDLogLevel myLibLogLevel = DDLogLevelVerbose; 50 | * 51 | * Step 3: 52 | * Replace your NSLog statements with DDLog statements according to the severity of the message. 53 | * 54 | * NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!"); 55 | * 56 | * DDLog works exactly the same as NSLog. 57 | * This means you can pass it multiple variables just like NSLog. 58 | **/ 59 | 60 | #import 61 | 62 | // Disable legacy macros 63 | #ifndef DD_LEGACY_MACROS 64 | #define DD_LEGACY_MACROS 0 65 | #endif 66 | 67 | // Core 68 | #import "DDLog.h" 69 | 70 | // Main macros 71 | #import "DDLogMacros.h" 72 | #import "DDAssertMacros.h" 73 | 74 | // Capture ASL 75 | #import "DDASLLogCapture.h" 76 | 77 | // Loggers 78 | #import "DDTTYLogger.h" 79 | #import "DDASLLogger.h" 80 | #import "DDFileLogger.h" 81 | #import "DDOSLogger.h" 82 | 83 | // CLI 84 | #if __has_include("CLIColor.h") && TARGET_OS_OSX 85 | #import "CLIColor.h" 86 | #endif 87 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDASLLogCapture.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDASLLogger.h" 17 | 18 | @protocol DDLogger; 19 | 20 | /** 21 | * This class provides the ability to capture the ASL (Apple System Logs) 22 | */ 23 | @interface DDASLLogCapture : NSObject 24 | 25 | /** 26 | * Start capturing logs 27 | */ 28 | + (void)start; 29 | 30 | /** 31 | * Stop capturing logs 32 | */ 33 | + (void)stop; 34 | 35 | /** 36 | * The current capture level. 37 | * @note Default log level: DDLogLevelVerbose (i.e. capture all ASL messages). 38 | */ 39 | @property (class) DDLogLevel captureLevel; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDASLLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import "DDLog.h" 24 | 25 | // Custom key set on messages sent to ASL 26 | extern const char* const kDDASLKeyDDLog; 27 | 28 | // Value set for kDDASLKeyDDLog 29 | extern const char* const kDDASLDDLogValue; 30 | 31 | /** 32 | * This class provides a logger for the Apple System Log facility. 33 | * 34 | * As described in the "Getting Started" page, 35 | * the traditional NSLog() function directs its output to two places: 36 | * 37 | * - Apple System Log 38 | * - StdErr (if stderr is a TTY) so log statements show up in Xcode console 39 | * 40 | * To duplicate NSLog() functionality you can simply add this logger and a tty logger. 41 | * However, if you instead choose to use file logging (for faster performance), 42 | * you may choose to use a file logger and a tty logger. 43 | **/ 44 | @interface DDASLLogger : DDAbstractLogger 45 | 46 | /** 47 | * Singleton method 48 | * 49 | * @return the shared instance 50 | */ 51 | @property (class, readonly, strong) DDASLLogger *sharedInstance; 52 | 53 | // Inherited from DDAbstractLogger 54 | 55 | // - (id )logFormatter; 56 | // - (void)setLogFormatter:(id )formatter; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDASLLogger.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDASLLogger.h" 17 | #import 18 | 19 | #if !__has_feature(objc_arc) 20 | #error This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC). 21 | #endif 22 | 23 | const char* const kDDASLKeyDDLog = "DDLog"; 24 | 25 | const char* const kDDASLDDLogValue = "1"; 26 | 27 | static DDASLLogger *sharedInstance; 28 | 29 | @interface DDASLLogger () { 30 | aslclient _client; 31 | } 32 | 33 | @end 34 | 35 | 36 | @implementation DDASLLogger 37 | 38 | + (instancetype)sharedInstance { 39 | static dispatch_once_t DDASLLoggerOnceToken; 40 | 41 | dispatch_once(&DDASLLoggerOnceToken, ^{ 42 | sharedInstance = [[[self class] alloc] init]; 43 | }); 44 | 45 | return sharedInstance; 46 | } 47 | 48 | - (instancetype)init { 49 | if (sharedInstance != nil) { 50 | return nil; 51 | } 52 | 53 | if ((self = [super init])) { 54 | // A default asl client is provided for the main thread, 55 | // but background threads need to create their own client. 56 | 57 | _client = asl_open(NULL, "com.apple.console", 0); 58 | } 59 | 60 | return self; 61 | } 62 | 63 | - (void)logMessage:(DDLogMessage *)logMessage { 64 | // Skip captured log messages 65 | if ([logMessage->_fileName isEqualToString:@"DDASLLogCapture"]) { 66 | return; 67 | } 68 | 69 | NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message; 70 | 71 | if (message) { 72 | const char *msg = [message UTF8String]; 73 | 74 | size_t aslLogLevel; 75 | switch (logMessage->_flag) { 76 | // Note: By default ASL will filter anything above level 5 (Notice). 77 | // So our mappings shouldn't go above that level. 78 | case DDLogFlagError : aslLogLevel = ASL_LEVEL_CRIT; break; 79 | case DDLogFlagWarning : aslLogLevel = ASL_LEVEL_ERR; break; 80 | case DDLogFlagInfo : aslLogLevel = ASL_LEVEL_WARNING; break; // Regular NSLog's level 81 | case DDLogFlagDebug : 82 | case DDLogFlagVerbose : 83 | default : aslLogLevel = ASL_LEVEL_NOTICE; break; 84 | } 85 | 86 | static char const *const level_strings[] = { "0", "1", "2", "3", "4", "5", "6", "7" }; 87 | 88 | // NSLog uses the current euid to set the ASL_KEY_READ_UID. 89 | uid_t const readUID = geteuid(); 90 | 91 | char readUIDString[16]; 92 | #ifndef NS_BLOCK_ASSERTIONS 93 | size_t l = snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 94 | #else 95 | snprintf(readUIDString, sizeof(readUIDString), "%d", readUID); 96 | #endif 97 | 98 | NSAssert(l < sizeof(readUIDString), 99 | @"Formatted euid is too long."); 100 | NSAssert(aslLogLevel < (sizeof(level_strings) / sizeof(level_strings[0])), 101 | @"Unhandled ASL log level."); 102 | 103 | aslmsg m = asl_new(ASL_TYPE_MSG); 104 | if (m != NULL) { 105 | if (asl_set(m, ASL_KEY_LEVEL, level_strings[aslLogLevel]) == 0 && 106 | asl_set(m, ASL_KEY_MSG, msg) == 0 && 107 | asl_set(m, ASL_KEY_READ_UID, readUIDString) == 0 && 108 | asl_set(m, kDDASLKeyDDLog, kDDASLDDLogValue) == 0) { 109 | asl_send(_client, m); 110 | } 111 | asl_free(m); 112 | } 113 | //TODO handle asl_* failures non-silently? 114 | } 115 | } 116 | 117 | - (NSString *)loggerName { 118 | return @"cocoa.lumberjack.aslLogger"; 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDAbstractDatabaseLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | // Disable legacy macros 17 | #ifndef DD_LEGACY_MACROS 18 | #define DD_LEGACY_MACROS 0 19 | #endif 20 | 21 | #import "DDLog.h" 22 | 23 | /** 24 | * This class provides an abstract implementation of a database logger. 25 | * 26 | * That is, it provides the base implementation for a database logger to build atop of. 27 | * All that is needed for a concrete database logger is to extend this class 28 | * and override the methods in the implementation file that are prefixed with "db_". 29 | **/ 30 | @interface DDAbstractDatabaseLogger : DDAbstractLogger { 31 | 32 | @protected 33 | NSUInteger _saveThreshold; 34 | NSTimeInterval _saveInterval; 35 | NSTimeInterval _maxAge; 36 | NSTimeInterval _deleteInterval; 37 | BOOL _deleteOnEverySave; 38 | 39 | BOOL _saveTimerSuspended; 40 | NSUInteger _unsavedCount; 41 | dispatch_time_t _unsavedTime; 42 | dispatch_source_t _saveTimer; 43 | dispatch_time_t _lastDeleteTime; 44 | dispatch_source_t _deleteTimer; 45 | } 46 | 47 | /** 48 | * Specifies how often to save the data to disk. 49 | * Since saving is an expensive operation (disk io) it is not done after every log statement. 50 | * These properties allow you to configure how/when the logger saves to disk. 51 | * 52 | * A save is done when either (whichever happens first): 53 | * 54 | * - The number of unsaved log entries reaches saveThreshold 55 | * - The amount of time since the oldest unsaved log entry was created reaches saveInterval 56 | * 57 | * You can optionally disable the saveThreshold by setting it to zero. 58 | * If you disable the saveThreshold you are entirely dependent on the saveInterval. 59 | * 60 | * You can optionally disable the saveInterval by setting it to zero (or a negative value). 61 | * If you disable the saveInterval you are entirely dependent on the saveThreshold. 62 | * 63 | * It's not wise to disable both saveThreshold and saveInterval. 64 | * 65 | * The default saveThreshold is 500. 66 | * The default saveInterval is 60 seconds. 67 | **/ 68 | @property (assign, readwrite) NSUInteger saveThreshold; 69 | 70 | /** 71 | * See the description for the `saveThreshold` property 72 | */ 73 | @property (assign, readwrite) NSTimeInterval saveInterval; 74 | 75 | /** 76 | * It is likely you don't want the log entries to persist forever. 77 | * Doing so would allow the database to grow infinitely large over time. 78 | * 79 | * The maxAge property provides a way to specify how old a log statement can get 80 | * before it should get deleted from the database. 81 | * 82 | * The deleteInterval specifies how often to sweep for old log entries. 83 | * Since deleting is an expensive operation (disk io) is is done on a fixed interval. 84 | * 85 | * An alternative to the deleteInterval is the deleteOnEverySave option. 86 | * This specifies that old log entries should be deleted during every save operation. 87 | * 88 | * You can optionally disable the maxAge by setting it to zero (or a negative value). 89 | * If you disable the maxAge then old log statements are not deleted. 90 | * 91 | * You can optionally disable the deleteInterval by setting it to zero (or a negative value). 92 | * 93 | * If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted. 94 | * 95 | * It's not wise to enable both deleteInterval and deleteOnEverySave. 96 | * 97 | * The default maxAge is 7 days. 98 | * The default deleteInterval is 5 minutes. 99 | * The default deleteOnEverySave is NO. 100 | **/ 101 | @property (assign, readwrite) NSTimeInterval maxAge; 102 | 103 | /** 104 | * See the description for the `maxAge` property 105 | */ 106 | @property (assign, readwrite) NSTimeInterval deleteInterval; 107 | 108 | /** 109 | * See the description for the `maxAge` property 110 | */ 111 | @property (assign, readwrite) BOOL deleteOnEverySave; 112 | 113 | /** 114 | * Forces a save of any pending log entries (flushes log entries to disk). 115 | **/ 116 | - (void)savePendingLogEntries; 117 | 118 | /** 119 | * Removes any log entries that are older than maxAge. 120 | **/ 121 | - (void)deleteOldLogEntries; 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDAssertMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * NSAsset replacement that will output a log message even when assertions are disabled. 18 | **/ 19 | #define DDAssert(condition, frmt, ...) \ 20 | if (!(condition)) { \ 21 | NSString *description = [NSString stringWithFormat:frmt, ## __VA_ARGS__]; \ 22 | DDLogError(@"%@", description); \ 23 | NSAssert(NO, description); \ 24 | } 25 | #define DDAssertCondition(condition) DDAssert(condition, @"Condition not satisfied: %s", #condition) 26 | 27 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDLegacyMacros.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | /** 17 | * Legacy macros used for 1.9.x backwards compatibility. 18 | * 19 | * Imported by default when importing a DDLog.h directly and DD_LEGACY_MACROS is not defined and set to 0. 20 | **/ 21 | #if DD_LEGACY_MACROS 22 | 23 | #warning CocoaLumberjack 1.9.x legacy macros enabled. \ 24 | Disable legacy macros by importing CocoaLumberjack.h or DDLogMacros.h instead of DDLog.h or add `#define DD_LEGACY_MACROS 0` before importing DDLog.h. 25 | 26 | #ifndef LOG_LEVEL_DEF 27 | #define LOG_LEVEL_DEF ddLogLevel 28 | #endif 29 | 30 | #define LOG_FLAG_ERROR DDLogFlagError 31 | #define LOG_FLAG_WARN DDLogFlagWarning 32 | #define LOG_FLAG_INFO DDLogFlagInfo 33 | #define LOG_FLAG_DEBUG DDLogFlagDebug 34 | #define LOG_FLAG_VERBOSE DDLogFlagVerbose 35 | 36 | #define LOG_LEVEL_OFF DDLogLevelOff 37 | #define LOG_LEVEL_ERROR DDLogLevelError 38 | #define LOG_LEVEL_WARN DDLogLevelWarning 39 | #define LOG_LEVEL_INFO DDLogLevelInfo 40 | #define LOG_LEVEL_DEBUG DDLogLevelDebug 41 | #define LOG_LEVEL_VERBOSE DDLogLevelVerbose 42 | #define LOG_LEVEL_ALL DDLogLevelAll 43 | 44 | #define LOG_ASYNC_ENABLED YES 45 | 46 | #define LOG_ASYNC_ERROR ( NO && LOG_ASYNC_ENABLED) 47 | #define LOG_ASYNC_WARN (YES && LOG_ASYNC_ENABLED) 48 | #define LOG_ASYNC_INFO (YES && LOG_ASYNC_ENABLED) 49 | #define LOG_ASYNC_DEBUG (YES && LOG_ASYNC_ENABLED) 50 | #define LOG_ASYNC_VERBOSE (YES && LOG_ASYNC_ENABLED) 51 | 52 | #define LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \ 53 | [DDLog log : isAsynchronous \ 54 | level : lvl \ 55 | flag : flg \ 56 | context : ctx \ 57 | file : __FILE__ \ 58 | function : fnct \ 59 | line : __LINE__ \ 60 | tag : atag \ 61 | format : (frmt), ## __VA_ARGS__] 62 | 63 | #define LOG_MAYBE(async, lvl, flg, ctx, fnct, frmt, ...) \ 64 | do { if(lvl & flg) LOG_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, ##__VA_ARGS__); } while(0) 65 | 66 | #define LOG_OBJC_MAYBE(async, lvl, flg, ctx, frmt, ...) \ 67 | LOG_MAYBE(async, lvl, flg, ctx, __PRETTY_FUNCTION__, frmt, ## __VA_ARGS__) 68 | 69 | #define DDLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, LOG_LEVEL_DEF, LOG_FLAG_ERROR, 0, frmt, ##__VA_ARGS__) 70 | #define DDLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, LOG_LEVEL_DEF, LOG_FLAG_WARN, 0, frmt, ##__VA_ARGS__) 71 | #define DDLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, LOG_LEVEL_DEF, LOG_FLAG_INFO, 0, frmt, ##__VA_ARGS__) 72 | #define DDLogDebug(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_DEBUG, LOG_LEVEL_DEF, LOG_FLAG_DEBUG, 0, frmt, ##__VA_ARGS__) 73 | #define DDLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, LOG_LEVEL_DEF, LOG_FLAG_VERBOSE, 0, frmt, ##__VA_ARGS__) 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDLog+LOGV.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | // Disable legacy macros 17 | #ifndef DD_LEGACY_MACROS 18 | #define DD_LEGACY_MACROS 0 19 | #endif 20 | 21 | #import "DDLog.h" 22 | 23 | /** 24 | * The constant/variable/method responsible for controlling the current log level. 25 | **/ 26 | #ifndef LOG_LEVEL_DEF 27 | #define LOG_LEVEL_DEF ddLogLevel 28 | #endif 29 | 30 | /** 31 | * Whether async should be used by log messages, excluding error messages that are always sent sync. 32 | **/ 33 | #ifndef LOG_ASYNC_ENABLED 34 | #define LOG_ASYNC_ENABLED YES 35 | #endif 36 | 37 | /** 38 | * This is the single macro that all other macros below compile into. 39 | * This big multiline macro makes all the other macros easier to read. 40 | **/ 41 | #define LOGV_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, avalist) \ 42 | [DDLog log : isAsynchronous \ 43 | level : lvl \ 44 | flag : flg \ 45 | context : ctx \ 46 | file : __FILE__ \ 47 | function : fnct \ 48 | line : __LINE__ \ 49 | tag : atag \ 50 | format : frmt \ 51 | args : avalist] 52 | 53 | /** 54 | * Define version of the macro that only execute if the log level is above the threshold. 55 | * The compiled versions essentially look like this: 56 | * 57 | * if (logFlagForThisLogMsg & ddLogLevel) { execute log message } 58 | * 59 | * When LOG_LEVEL_DEF is defined as ddLogLevel. 60 | * 61 | * As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels. 62 | * This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques. 63 | * 64 | * Note that when compiler optimizations are enabled (as they are for your release builds), 65 | * the log messages above your logging threshold will automatically be compiled out. 66 | * 67 | * (If the compiler sees LOG_LEVEL_DEF/ddLogLevel declared as a constant, the compiler simply checks to see 68 | * if the 'if' statement would execute, and if not it strips it from the binary.) 69 | * 70 | * We also define shorthand versions for asynchronous and synchronous logging. 71 | **/ 72 | #define LOGV_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, avalist) \ 73 | do { if(lvl & flg) LOGV_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, avalist); } while(0) 74 | 75 | /** 76 | * Ready to use log macros with no context or tag. 77 | **/ 78 | #define DDLogVError(frmt, avalist) LOGV_MAYBE(NO, LOG_LEVEL_DEF, DDLogFlagError, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 79 | #define DDLogVWarn(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagWarning, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 80 | #define DDLogVInfo(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagInfo, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 81 | #define DDLogVDebug(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagDebug, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 82 | #define DDLogVVerbose(frmt, avalist) LOGV_MAYBE(LOG_ASYNC_ENABLED, LOG_LEVEL_DEF, DDLogFlagVerbose, 0, nil, __PRETTY_FUNCTION__, frmt, avalist) 83 | 84 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDOSLogger.h: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import 17 | 18 | // Disable legacy macros 19 | #ifndef DD_LEGACY_MACROS 20 | #define DD_LEGACY_MACROS 0 21 | #endif 22 | 23 | #import "DDLog.h" 24 | 25 | /** 26 | * This class provides a logger for the Apple os_log facility. 27 | **/ 28 | API_AVAILABLE(ios(10.0), macos(10.12), tvos(10.0), watchos(3.0)) 29 | @interface DDOSLogger : DDAbstractLogger 30 | 31 | /** 32 | * Singleton method 33 | * 34 | * @return the shared instance 35 | */ 36 | @property (class, readonly, strong) DDOSLogger *sharedInstance; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/Classes/DDOSLogger.m: -------------------------------------------------------------------------------- 1 | // Software License Agreement (BSD License) 2 | // 3 | // Copyright (c) 2010-2016, Deusty, LLC 4 | // All rights reserved. 5 | // 6 | // Redistribution and use of this software in source and binary forms, 7 | // with or without modification, are permitted provided that the following conditions are met: 8 | // 9 | // * Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // * Neither the name of Deusty nor the names of its contributors may be used 13 | // to endorse or promote products derived from this software without specific 14 | // prior written permission of Deusty, LLC. 15 | 16 | #import "DDOSLogger.h" 17 | #import 18 | 19 | static DDOSLogger *sharedInstance; 20 | 21 | @implementation DDOSLogger 22 | 23 | + (instancetype)sharedInstance { 24 | static dispatch_once_t DDOSLoggerOnceToken; 25 | 26 | dispatch_once(&DDOSLoggerOnceToken, ^{ 27 | sharedInstance = [[[self class] alloc] init]; 28 | }); 29 | 30 | return sharedInstance; 31 | } 32 | 33 | - (instancetype)init { 34 | if (sharedInstance != nil) { 35 | return nil; 36 | } 37 | 38 | if (self = [super init]) { 39 | return self; 40 | } 41 | 42 | return nil; 43 | } 44 | 45 | - (void)logMessage:(DDLogMessage *)logMessage { 46 | // Skip captured log messages 47 | if ([logMessage->_fileName isEqualToString:@"DDASLLogCapture"]) { 48 | return; 49 | } 50 | 51 | NSString * message = _logFormatter ? [_logFormatter formatLogMessage:logMessage] : logMessage->_message; 52 | 53 | if (message) { 54 | const char *msg = [message UTF8String]; 55 | 56 | switch (logMessage->_flag) { 57 | case DDLogFlagError : 58 | os_log_error(OS_LOG_DEFAULT, "%{public}s", msg); 59 | break; 60 | case DDLogFlagWarning : 61 | case DDLogFlagInfo : 62 | os_log_info(OS_LOG_DEFAULT, "%{public}s", msg); 63 | break; 64 | case DDLogFlagDebug : 65 | case DDLogFlagVerbose : 66 | default : 67 | os_log_debug(OS_LOG_DEFAULT, "%{public}s", msg); 68 | break; 69 | } 70 | } 71 | } 72 | 73 | - (NSString *)loggerName { 74 | return @"cocoa.lumberjack.osLogger"; 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Pods/CocoaLumberjack/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2010-2016, Deusty, LLC 4 | All rights reserved. 5 | 6 | Redistribution and use of this software in source and binary forms, 7 | with or without modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above 10 | copyright notice, this list of conditions and the 11 | following disclaimer. 12 | 13 | * Neither the name of Deusty nor the names of its 14 | contributors may be used to endorse or promote products 15 | derived from this software without specific prior 16 | written permission of Deusty, LLC. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Pods/Decodable/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Johannes Lund 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/Castable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Castable.swift 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2015-09-25. 6 | // Copyright © 2015 anviking. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// Attempt to cast an `Any` to `T` or throw 12 | /// 13 | /// - throws: `DecodingError.typeMismatch(expected, actual, metadata)` 14 | public func cast(_ object: Any) throws -> T { 15 | guard let result = object as? T else { 16 | let metadata = DecodingError.Metadata(object: object) 17 | throw DecodingError.typeMismatch(expected: T.self, actual: type(of: object), metadata) 18 | } 19 | return result 20 | } 21 | 22 | /// Allows overriding default `decode` function from your app. 23 | /// 24 | /// You likely don't want to conform to this yourself. 25 | public protocol DynamicDecodable { 26 | associatedtype DecodedType 27 | 28 | /// A closure describing how this type should be decoded 29 | /// 30 | /// Types also conforming to `Decodable` call this closure 31 | /// from their `decode` function. 32 | /// 33 | /// - note: This is intended as a set-once thing. 34 | static var decoder: (Any) throws -> DecodedType {get set} 35 | } 36 | 37 | extension Decodable where Self: DynamicDecodable, Self.DecodedType == Self { 38 | public static func decode(_ json: Any) throws -> Self { 39 | return try decoder(json) 40 | 41 | } 42 | } 43 | 44 | extension String: Decodable, DynamicDecodable { 45 | public static var decoder: (Any) throws -> String = { try cast($0) } 46 | } 47 | extension Int: Decodable, DynamicDecodable { 48 | public static var decoder: (Any) throws -> Int = { try cast($0) } 49 | } 50 | extension Double: Decodable, DynamicDecodable { 51 | public static var decoder: (Any) throws -> Double = { try cast($0) } 52 | } 53 | extension Bool: Decodable, DynamicDecodable { 54 | public static var decoder: (Any) throws -> Bool = { try cast($0) } 55 | } 56 | 57 | private let iso8601DateFormatter: DateFormatter = { 58 | let formatter = DateFormatter() 59 | formatter.locale = Locale(identifier: "en_US_POSIX") 60 | formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ssZZZZZ" 61 | return formatter 62 | }() 63 | 64 | extension Date: Decodable, DynamicDecodable { 65 | /// Default decoder is `Date.decoder(using: iso8601DateFormatter)` 66 | public static var decoder: (Any) throws -> Date = Date.decoder(using: iso8601DateFormatter) 67 | 68 | /// Create a decode closure using a given formatter 69 | /// 70 | /// Example usage: 71 | /// ``` 72 | /// let formatter = DateFormatter(...) 73 | /// Date.decoder = Date.decoder(using: formatter) 74 | /// ``` 75 | public static func decoder(using formatter: DateFormatter) -> (Any) throws -> Date { 76 | return { object in 77 | let string = try String.decode(object) 78 | guard let date = formatter.date(from: string) else { 79 | let metadata = DecodingError.Metadata(object: object) 80 | throw DecodingError.rawRepresentableInitializationError(rawValue: string, metadata) 81 | } 82 | return date 83 | } 84 | } 85 | 86 | } 87 | 88 | extension NSDictionary: Decodable { 89 | public static func decode(_ json: Any) throws -> Self { 90 | return try cast(json) 91 | } 92 | } 93 | 94 | extension NSArray: DynamicDecodable { 95 | public static var decoder: (Any) throws -> NSArray = { try cast($0) } 96 | public static func decode(_ json: Any) throws -> NSArray { 97 | return try decoder(json) 98 | } 99 | 100 | } 101 | 102 | 103 | extension URL: DynamicDecodable, Decodable { 104 | public static var decoder: (Any) throws -> URL = { object in 105 | let string = try String.decode(object) 106 | guard let url = URL(string: string) else { 107 | let metadata = DecodingError.Metadata(object: object) 108 | throw DecodingError.rawRepresentableInitializationError(rawValue: string, metadata) 109 | } 110 | return url 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/Decodable.h: -------------------------------------------------------------------------------- 1 | // 2 | // Decodable.h 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2015-07-08. 6 | // Copyright © 2015 anviking. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Decodable. 12 | FOUNDATION_EXPORT double DecodableVersionNumber; 13 | 14 | //! Project version string for Decodable. 15 | FOUNDATION_EXPORT const unsigned char DecodableVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/Decodable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Decodable.swift 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2015-07-07. 6 | // Copyright © 2015 anviking. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | public protocol Decodable { 12 | static func decode(_ json: Any) throws -> Self 13 | } 14 | 15 | 16 | extension Dictionary where Key: Decodable, Value: Decodable { 17 | public static func decode(_ j: Any) throws -> Dictionary { 18 | return try Dictionary.decoder(key: Key.decode, value: Value.decode)(j) 19 | } 20 | } 21 | 22 | /* FIXME: this causes ambiguity issues, in the meantime resort to `Dictionary.decoder` 23 | https://github.com/Anviking/Decodable/issues/120 24 | 25 | extension Dictionary where Key: Decodable, Value: Any { 26 | 27 | public static func decode(_ j: Any) throws -> Dictionary { 28 | let valueDecoder: (Any) throws -> Value = { try cast($0) } 29 | return try Dictionary.decoder(key: Key.decode, value: valueDecoder)(j) 30 | } 31 | } 32 | */ 33 | 34 | extension Array where Element: Decodable { 35 | public static func decode(_ j: Any, ignoreInvalidObjects: Bool = false) throws -> [Element] { 36 | if ignoreInvalidObjects { 37 | return try [Element?].decoder { try? Element.decode($0) }(j).flatMap {$0} 38 | } else { 39 | return try Array.decoder(Element.decode)(j) 40 | } 41 | } 42 | } 43 | 44 | 45 | 46 | 47 | // MARK: Helpers 48 | 49 | /// Attempt to decode one of multiple objects in order until: A: we get a positive match, B: we throw an exception if the last object does not decode 50 | public func decodeAsOneOf(_ json: Any, objectTypes: Decodable.Type...) throws -> Decodable { 51 | for decodable in objectTypes.dropLast() { 52 | if let decoded = try? decodable.decode(json) { 53 | return decoded 54 | } 55 | } 56 | return try objectTypes.last!.decode(json) 57 | } 58 | 59 | /// Attempt to decode one of multiple objects in order until: A: we get a positive match, B: we throw an exception if the last object does not decode 60 | public func decodeArrayAsOneOf(_ json: Any, objectTypes: Decodable.Type...) throws -> [Decodable] { 61 | return try NSArray.decode(json).map { 62 | for decodable in objectTypes.dropLast() { 63 | if let decoded = try? decodable.decode($0) { 64 | return decoded 65 | } 66 | } 67 | return try objectTypes.last!.decode($0) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/Decoders.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Closure.swift 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2016-07-10. 6 | // Copyright © 2016 anviking. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Optional { 12 | 13 | /// Creates an optional decoder from a decoder of the Wrapped type 14 | /// 15 | /// This function is used by `=>` and `=>?` overloads when decoding `T?` 16 | /// 17 | /// - parameter wrappedDecoder: A decoder (decode closure) for the wrapped type 18 | /// - returns: A closure takes an JSON object, checks it's `NSNull`, if so returns `nil`, otherwise calls the wrapped decode closure. 19 | static func decoder(_ wrappedDecoder: @escaping (Any) throws -> Wrapped) -> (Any) throws -> Wrapped? { 20 | return { json in 21 | if json is NSNull { 22 | return nil 23 | } else { 24 | return try wrappedDecoder(json) 25 | } 26 | } 27 | } 28 | } 29 | 30 | extension Array { 31 | 32 | /// Creates an array decoder from an element decoder 33 | /// 34 | /// This function is used by `=>` and `=>?` overloads when decoding `[T]` 35 | /// 36 | /// - parameter elementDecoder: A decoder (decode closure) for the `Element` type 37 | /// - throws: if `NSArray.decode` throws or any element decode closure throws 38 | /// - returns: A closure that takes an `NSArray` and maps it using the element decode closure 39 | public static func decoder(_ elementDecoder: @escaping (Any) throws -> Element) -> (Any) throws -> Array { 40 | return { json in 41 | return try NSArray.decode(json).map { try elementDecoder($0) } 42 | } 43 | } 44 | } 45 | 46 | extension Dictionary { 47 | /// Create a dictionary decoder from key- and value- decoders 48 | /// 49 | /// This function is used by `=>` and `=>?` overloads when decoding `[K: V]` 50 | /// 51 | /// - parameter key: A decoder (decode closure) for the `Key` type 52 | /// - parameter value: A decoder (decode closure) for the `Value` type 53 | /// - returns: A closure that takes a `NSDictionary` and "maps" it using key and value decode closures 54 | public static func decoder(key keyDecoder: @escaping (Any) throws -> Key, value valueDecoder: @escaping (Any) throws -> Value) -> (Any) throws -> Dictionary { 55 | return { json in 56 | var dict = Dictionary() 57 | for (key, value) in try NSDictionary.decode(json) { 58 | try dict[keyDecoder(key)] = valueDecoder(value) 59 | } 60 | return dict 61 | } 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/KeyPath.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyPath.swift 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2016-07-09. 6 | // Copyright © 2016 anviking. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// `KeyPath` represents the path to a specific node in a tree of nested dictionaries. 12 | /// 13 | /// Can be created from string and array literals and can be joined by the `=>` operator. 14 | /// ``` 15 | /// let a: KeyPath = "a" 16 | /// let b: KeyPath = ["a", "b"] 17 | /// let c: KeyPath = "a" => "b" => "c" 18 | /// ``` 19 | 20 | public struct KeyPath { 21 | public var keys: [String] 22 | 23 | public init(_ keys: [String]) { 24 | self.keys = keys 25 | } 26 | 27 | public init(_ key: String) { 28 | self.keys = [key] 29 | } 30 | 31 | } 32 | 33 | extension KeyPath: ExpressibleByStringLiteral { 34 | public init(stringLiteral value: String) { 35 | self.keys = [value] 36 | } 37 | 38 | public init(extendedGraphemeClusterLiteral value: String) { 39 | self.keys = [value] 40 | } 41 | 42 | public init(unicodeScalarLiteral value: String) { 43 | self.keys = [value] 44 | } 45 | } 46 | 47 | extension KeyPath: ExpressibleByArrayLiteral { 48 | public init(arrayLiteral elements: String...) { 49 | self.keys = elements 50 | } 51 | } 52 | 53 | extension KeyPath: Equatable { } 54 | public func ==(lhs: KeyPath, rhs: KeyPath) -> Bool { 55 | return lhs.keys == rhs.keys 56 | } 57 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/NSValueCastable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSValueCastable.swift 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2016-01-06. 6 | // Copyright © 2016 anviking. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | extension Int64: NSNumberCastable { 12 | public static func convertFrom(_ n: NSNumber) -> Int64 { return n.int64Value } 13 | } 14 | extension Int32: NSNumberCastable { 15 | public static func convertFrom(_ n: NSNumber) -> Int32 { return n.int32Value } 16 | } 17 | extension Int16: NSNumberCastable { 18 | public static func convertFrom(_ n: NSNumber) -> Int16 { return n.int16Value } 19 | } 20 | extension Int8: NSNumberCastable { 21 | public static func convertFrom(_ n: NSNumber) -> Int8 { return n.int8Value } 22 | } 23 | extension UInt64: NSNumberCastable { 24 | public static func convertFrom(_ n: NSNumber) -> UInt64 { return n.uint64Value } 25 | } 26 | extension UInt32: NSNumberCastable { 27 | public static func convertFrom(_ n: NSNumber) -> UInt32 { return n.uint32Value } 28 | } 29 | extension UInt16: NSNumberCastable { 30 | public static func convertFrom(_ n: NSNumber) -> UInt16 { return n.uint16Value } 31 | } 32 | extension UInt8: NSNumberCastable { 33 | public static func convertFrom(_ n: NSNumber) -> UInt8 { return n.uint8Value } 34 | } 35 | 36 | /// Provides a default implementation of decode() which casts the object to a NSValue and unsafely casts its value as Self. 37 | public protocol NSValueCastable: Decodable {} 38 | 39 | /// Used to enable decoding to different IntegerTypes from NSNumber. 40 | public protocol NSNumberCastable: NSValueCastable { 41 | static func convertFrom(_ n: NSNumber) -> Self 42 | } 43 | 44 | extension NSValueCastable { 45 | private typealias PointerOfSelf = UnsafeMutablePointer // Why do we have to do this? 46 | public static func decode(_ j: Any) throws -> Self { 47 | let value: NSValue = try cast(j) 48 | let pointer = PointerOfSelf.allocate(capacity: 1) 49 | defer { pointer.deallocate(capacity: 1) } 50 | value.getValue(pointer) 51 | return pointer.move() 52 | } 53 | } 54 | 55 | extension NSNumberCastable { 56 | public static func decode(_ json: Any) throws -> Self { 57 | return try convertFrom(cast(json)) 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/Operators.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Operators.swift 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2015-07-08. 6 | // Copyright © 2015 anviking. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // MARK: - Operators 12 | 13 | precedencegroup DecodingPrecedence { 14 | associativity: right 15 | higherThan: CastingPrecedence 16 | } 17 | 18 | infix operator => : DecodingPrecedence 19 | infix operator =>? : DecodingPrecedence 20 | 21 | public func => (lhs: Any, rhs: KeyPath) throws -> Any { 22 | return try parse(lhs, keyPath: rhs, decoder: { $0 }) 23 | } 24 | 25 | 26 | public func =>? (lhs: Any, rhs: OptionalKeyPath) throws -> Any? { 27 | return try parse(lhs, keyPath: rhs, decoder: Optional.decoder({$0})) 28 | } 29 | 30 | // MARK: - JSONPath 31 | 32 | /// Enables parsing nested objects e.g json => "a" => "b" 33 | 34 | public func => (lhs: KeyPath, rhs: KeyPath) -> KeyPath { 35 | return KeyPath(lhs.keys + rhs.keys) 36 | } 37 | 38 | public func => (lhs: OptionalKeyPath, rhs: OptionalKeyPath) -> OptionalKeyPath { 39 | return OptionalKeyPath(keys: lhs.keys + rhs.markingFirst(required: true).keys) 40 | } 41 | 42 | public func =>? (lhs: OptionalKeyPath, rhs: OptionalKeyPath) -> OptionalKeyPath { 43 | return OptionalKeyPath(keys: lhs.keys + rhs.keys) 44 | } 45 | 46 | public func => (lhs: OptionalKeyPath, rhs: KeyPath) -> OptionalKeyPath { 47 | return OptionalKeyPath(keys: lhs.keys + rhs.keys.map { OptionalKey(key: $0, isRequired: true) }) 48 | } 49 | 50 | 51 | public func =>? (lhs: KeyPath, rhs: OptionalKeyPath) -> OptionalKeyPath { 52 | return OptionalKeyPath(keys: lhs.keys.map { OptionalKey(key: $0, isRequired: true) } + rhs.keys ) 53 | } 54 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/OptionalKeyPath.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OptionalKeyPath.swift 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2016-07-09. 6 | // Copyright © 2016 anviking. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | /// A key in a keyPath that may or may not be required. 12 | /// 13 | /// Trying to access a invalid key in a dictionary with an `OptionalKey` will usually result 14 | /// in a nil return value instead of a thrown error. Unless `isRequired` is `true`, in which 15 | /// it behaves as a "normal" `String` inside a "normal" `KeyPath`. 16 | public struct OptionalKey { 17 | public var key: String 18 | public var isRequired: Bool 19 | } 20 | 21 | extension OptionalKey: CustomStringConvertible { 22 | public var description: String { 23 | return key + (isRequired ? "" : "?") 24 | } 25 | } 26 | 27 | /// `OptionalKeyPath` represents the path to a specific node in a tree of nested dictionaries. 28 | /// 29 | /// Can be created from string and array literals and can be joined by the `=>?` operator. 30 | /// ``` 31 | /// let a: OptionalKeyPath = "a" 32 | /// let b: OptionalKeyPath = ["a", "b"] 33 | /// let c: OptionalKeyPath = "a" =>? "b" =>? "c" 34 | /// ``` 35 | /// Unlike `KeyPath`, `OptionalKeyPath` allows each key to be either required or optional. 36 | ///`isRequired` is `false` by default. 37 | /// 38 | /// When a `KeyPath` is converted to a OptionalKeyPath, `isRequired` is set to `true`. 39 | /// ``` 40 | /// let c: OptionalKeyPath = "a" =>? "b" => "c" 41 | /// ^^ 42 | /// isRequired=true 43 | /// ``` 44 | /// In the above example `"c"` is inferred as `KeyPath`, then converted to `OptionalKeyPath` 45 | /// with `isRequired = true` 46 | 47 | public struct OptionalKeyPath { 48 | public var keys: [OptionalKey] 49 | mutating func markFirst(required: Bool) { 50 | if var first = keys.first { 51 | first.isRequired = required 52 | keys[0] = first 53 | } 54 | } 55 | 56 | func markingFirst(required: Bool) -> OptionalKeyPath { 57 | var new = self 58 | if var first = keys.first { 59 | first.isRequired = required 60 | new.keys[0] = first 61 | } 62 | return new 63 | } 64 | } 65 | 66 | extension OptionalKeyPath: ExpressibleByStringLiteral { 67 | public init(stringLiteral value: String) { 68 | self.keys = [OptionalKey(key: value, isRequired: false)] 69 | } 70 | 71 | public init(extendedGraphemeClusterLiteral value: String) { 72 | self.keys = [OptionalKey(key: value, isRequired: false)] 73 | } 74 | 75 | public init(unicodeScalarLiteral value: String) { 76 | self.keys = [OptionalKey(key: value, isRequired: false)] 77 | } 78 | } 79 | 80 | extension OptionalKeyPath: ExpressibleByArrayLiteral { 81 | public init(arrayLiteral elements: String...) { 82 | self.keys = elements.map { OptionalKey(key: $0, isRequired: false) } 83 | } 84 | } 85 | 86 | // MARK: Equality 87 | 88 | extension OptionalKey: Equatable {} 89 | public func == (lhs: OptionalKey, rhs: OptionalKey) -> Bool { 90 | return lhs.key == rhs.key && lhs.isRequired == rhs.isRequired 91 | } 92 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/Parse.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Parse.swift 3 | // Decodable 4 | // 5 | // Created by Johannes Lund on 2015-08-13. 6 | // Copyright © 2015 anviking. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | func parse(_ json: Any, _ keyPath: KeyPath) throws -> Any { 12 | var currentDict = json 13 | 14 | for (index, key) in keyPath.keys.enumerated() { 15 | guard let result = try NSDictionary.decode(currentDict)[key] else { 16 | let currentPath = keyPath.keys[0 ..< index] 17 | let metadata = DecodingError.Metadata(path: Array(currentPath), object: currentDict, rootObject: json) 18 | throw DecodingError.missingKey(key, metadata) 19 | } 20 | 21 | currentDict = result 22 | } 23 | 24 | return currentDict 25 | } 26 | 27 | func parse(_ json: Any, _ path: OptionalKeyPath) throws -> Any? { 28 | var currentDict = json 29 | 30 | for (index, key) in path.keys.enumerated() { 31 | guard let result = try NSDictionary.decode(currentDict)[key.key] else { 32 | if key.isRequired { 33 | let currentPath = path.keys[0 ..< index].map { $0.key } 34 | let metadata = DecodingError.Metadata(path: currentPath, object: currentDict, rootObject: json) 35 | throw DecodingError.missingKey(key.key, metadata) 36 | } else { 37 | return nil 38 | } 39 | } 40 | currentDict = result 41 | } 42 | 43 | return currentDict 44 | } 45 | public func parse(_ json: Any, keyPath: KeyPath, decoder: ((Any) throws -> T)) throws -> T { 46 | let object = try parse(json, keyPath) 47 | return try catchAndRethrow(json, keyPath) { try decoder(object) } 48 | } 49 | 50 | // FIXME: Should perhaps not return T?, but this way we don't have to flatMap in certain overloads 51 | public func parse(_ json: Any, keyPath: OptionalKeyPath, decoder: ((Any) throws -> T?)) throws -> T? { 52 | guard let object = try parse(json, keyPath) else { return nil } 53 | return try catchAndRethrow(json, keyPath) { try decoder(object) } 54 | } 55 | 56 | 57 | // MARK: - Helpers 58 | 59 | func catchMissingKeyAndReturnNil(_ closure: () throws -> T) throws -> T? { 60 | do { 61 | return try closure() 62 | } catch DecodingError.missingKey { 63 | return nil 64 | } 65 | } 66 | 67 | func catchAndRethrow(_ json: Any, _ keyPath: KeyPath, block: () throws -> T) throws -> T { 68 | do { 69 | return try block() 70 | } catch let error as DecodingError { 71 | var error = error 72 | error.metadata.path = keyPath.keys + error.metadata.path 73 | error.metadata.rootObject = json 74 | throw error 75 | } catch let error { 76 | throw error 77 | } 78 | } 79 | 80 | func catchAndRethrow(_ json: Any, _ keyPath: OptionalKeyPath, block: () throws -> T) throws -> T { 81 | do { 82 | return try block() 83 | } catch let error as DecodingError { 84 | var error = error 85 | error.metadata.path = keyPath.keys.map{$0.key} + error.metadata.path 86 | error.metadata.rootObject = json 87 | throw error 88 | } catch let error { 89 | throw error 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Pods/Decodable/Sources/RawRepresentableDecodable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RawRepresentableDecodable.swift 3 | // Decodable 4 | // 5 | // Created by Daniel Garbień on 06/11/15. 6 | // Copyright © 2015 anviking. All rights reserved. 7 | // 8 | 9 | /** 10 | * Extends all RawRepresentables (enums) which are also Decodable with decode implementation. 11 | * 12 | * I could not find a way to implicitly declare RawRepresentable conforming to Decodable, what would make all enums Decodable automatically. 13 | * Because of that for an enum to be compatible with Decodable operators it must be declared as implementing Decodable protocol. 14 | */ 15 | public extension RawRepresentable where RawValue: Decodable, Self: Decodable { 16 | 17 | static func decode(_ json: Any) throws -> Self { 18 | let rawValue = try RawValue.decode(json) 19 | guard let rawRepresentable = Self(rawValue: rawValue) else { 20 | let metadata = DecodingError.Metadata(object: json) 21 | throw DecodingError.rawRepresentableInitializationError(rawValue: rawValue, metadata) 22 | } 23 | return rawRepresentable 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - CocoaLumberjack/Default (3.2.1) 3 | - CocoaLumberjack/Swift (3.2.1): 4 | - CocoaLumberjack/Default 5 | - Decodable (0.6.0) 6 | - SwiftHEXColors (1.1.0) 7 | - SwiftLint (0.22.0) 8 | 9 | DEPENDENCIES: 10 | - CocoaLumberjack/Swift 11 | - Decodable (~> 0.5) 12 | - SwiftHEXColors (~> 1.1.0) 13 | - SwiftLint 14 | 15 | SPEC CHECKSUMS: 16 | CocoaLumberjack: 2800c03334042fe80589423c8d80e582dcaec482 17 | Decodable: f0b95fa2fcf8633dd097aa8f7f09838ab3524f5d 18 | SwiftHEXColors: 8f7e364df7929e32cff9f9eeb044bb215167d6be 19 | SwiftLint: 1134786caedd2caab0560d2f36b76414a5a56808 20 | 21 | PODFILE CHECKSUM: b5f3058ed2fa5be83d5a554f464ec58ff384d047 22 | 23 | COCOAPODS: 1.3.1 24 | -------------------------------------------------------------------------------- /Pods/SwiftHEXColors/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Doan Truong Thi 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Pods/SwiftHEXColors/README.md: -------------------------------------------------------------------------------- 1 | SwiftHEXColors 2 | =========== 3 | 4 | [![Build Status](http://img.shields.io/travis/thii/SwiftHEXColors.svg?style=flat)](https://travis-ci.org/thii/SwiftHEXColors) 5 | [![Swift Package Manager Compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-4BC51D.svg?style=flat)](https://github.com/apple/swift-package-manager) 6 | [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/SwiftHEXColors.svg)](https://img.shields.io/cocoapods/v/SwiftHEXColors.svg) 7 | [![Docs](https://img.shields.io/cocoapods/metrics/doc-percent/SwiftColors.svg)](http://cocoadocs.org/docsets/SwiftHEXColors) 8 | [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) 9 | [![Platform](https://img.shields.io/cocoapods/p/SwiftHEXColors.svg?style=flat)](http://cocoadocs.org/docsets/SwiftHEXColors) 10 | [![License](https://img.shields.io/cocoapods/l/SwiftHEXColors.svg)](https://raw.githubusercontent.com/thii/SwiftHEXColors/master/LICENSE) 11 | 12 | HEX color handling as an extension for UIColor. Written in Swift. 13 | 14 | ## Examples 15 | ### iOS 16 | ``` swift 17 | // With hash 18 | let color: UIColor = UIColor(hexString: "#ff8942") 19 | 20 | // Without hash, with alpha 21 | let secondColor: UIColor = UIColor(hexString: "ff8942", alpha: 0.5) 22 | 23 | // Short handling 24 | let shortColorWithHex: UIColor = UIColor(hexString: "fff") 25 | ``` 26 | 27 | For those who don't want to type the double quotation, you can init a color from a real hex value (an `Int`) 28 | 29 | ```swift 30 | // With hash 31 | let color: UIColor = UIColor(hex: 0xff8942) 32 | 33 | // Without hash, with alpha 34 | let secondColor: UIColor = UIColor(hex: 0xff8942, alpha: 0.5) 35 | ``` 36 | 37 | ### OSX 38 | ``` swift 39 | // With hash 40 | let color: NSColor = NSColor(hexString: "#ff8942") 41 | 42 | // Without hash, with alpha 43 | let secondColor: NSColor = NSColor(hexString: "ff8942", alpha: 0.5) 44 | 45 | // Short handling 46 | let shortColorWithHex: NSColor = NSColor(hexString: "fff") 47 | 48 | // From a real hex value (an `Int`) 49 | // With hash 50 | let color: NSColor = NSColor(hex: 0xff8942) 51 | 52 | // Without hash, with alpha 53 | let secondColor: NSColor = NSColor(hex: 0xff8942, alpha: 0.5) 54 | ``` 55 | 56 | ## Installation 57 | 58 | ### Swift Package Manager 59 | 60 | Add this as a dependency in your `Package.swift`: 61 | 62 | ```swift 63 | import PackageDescription 64 | 65 | let package = Package( 66 | name: "MyPackage", 67 | dependencies: [ 68 | // Other dependencies 69 | .Package(url: "https://github.com/thii/SwiftHEXColors.git", majorVersion: 1) 70 | ] 71 | ) 72 | ``` 73 | 74 | ### CocoaPods 75 | 76 | To integrate SwiftHEXColors into your Xcode project using CocoaPods, specify it in your `Podfile`: 77 | 78 | ```ruby 79 | source 'https://github.com/CocoaPods/Specs.git' 80 | platform :ios, '8.0' 81 | use_frameworks! 82 | 83 | pod 'SwiftHEXColors' 84 | ``` 85 | 86 | Then, run the following command: 87 | 88 | ```bash 89 | $ pod install 90 | ``` 91 | 92 | And add `import SwiftHEXColors` to the top of the files using SwiftHEXColors. 93 | 94 | ### Carthage 95 | 96 | [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. 97 | 98 | You can install Carthage with [Homebrew](http://brew.sh/) using the following command: 99 | 100 | ```bash 101 | $ brew update 102 | $ brew install carthage 103 | ``` 104 | 105 | To integrate SwiftHEXColors into your Xcode project using Carthage, specify it in your `Cartfile`: 106 | 107 | ```ogdl 108 | github "thii/SwiftHEXColors" 109 | ``` 110 | 111 | Run `carthage update` to build the framework and drag the built `SwiftHEXColors.framework` into your Xcode project. 112 | 113 | ### Manually 114 | - Drag and drop `SwiftHEXColors.swift` file into your project 115 | 116 | # Requirements 117 | - Swift 3 118 | - iOS 8.0 or above. 119 | 120 | # License 121 | [MIT](http://thi.mit-license.org/) 122 | -------------------------------------------------------------------------------- /Pods/SwiftHEXColors/Sources/SwiftHEXColors.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | //! Project version number for SwiftHEXColors. 4 | FOUNDATION_EXPORT double SwiftHEXColorsVersionNumber; 5 | 6 | //! Project version string for SwiftHEXColors. 7 | FOUNDATION_EXPORT const unsigned char SwiftHEXColorsVersionString[]; 8 | -------------------------------------------------------------------------------- /Pods/SwiftHEXColors/Sources/SwiftHEXColors.swift: -------------------------------------------------------------------------------- 1 | // SwiftHEXColors.swift 2 | // 3 | // Copyright (c) 2014 Doan Truong Thi 4 | // 5 | // Permission is hereby granted, free of charge, to any person obtaining a copy 6 | // of this software and associated documentation files (the "Software"), to deal 7 | // in the Software without restriction, including without limitation the rights 8 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | // copies of the Software, and to permit persons to whom the Software is 10 | // furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in 13 | // all copies or substantial portions of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | // THE SOFTWARE. 22 | 23 | #if os(iOS) || os(tvOS) 24 | import UIKit 25 | typealias SWColor = UIColor 26 | #else 27 | import Cocoa 28 | typealias SWColor = NSColor 29 | #endif 30 | 31 | private extension Int { 32 | func duplicate4bits() -> Int { 33 | return (self << 4) + self 34 | } 35 | } 36 | 37 | /// An extension of UIColor (on iOS) or NSColor (on OSX) providing HEX color handling. 38 | public extension SWColor { 39 | /** 40 | Create non-autoreleased color with in the given hex string. Alpha will be set as 1 by default. 41 | 42 | - parameter hexString: The hex string, with or without the hash character. 43 | - returns: A color with the given hex string. 44 | */ 45 | public convenience init?(hexString: String) { 46 | self.init(hexString: hexString, alpha: 1.0) 47 | } 48 | 49 | fileprivate convenience init?(hex3: Int, alpha: Float) { 50 | self.init(red: CGFloat( ((hex3 & 0xF00) >> 8).duplicate4bits() ) / 255.0, 51 | green: CGFloat( ((hex3 & 0x0F0) >> 4).duplicate4bits() ) / 255.0, 52 | blue: CGFloat( ((hex3 & 0x00F) >> 0).duplicate4bits() ) / 255.0, alpha: CGFloat(alpha)) 53 | } 54 | 55 | fileprivate convenience init?(hex6: Int, alpha: Float) { 56 | self.init(red: CGFloat( (hex6 & 0xFF0000) >> 16 ) / 255.0, 57 | green: CGFloat( (hex6 & 0x00FF00) >> 8 ) / 255.0, 58 | blue: CGFloat( (hex6 & 0x0000FF) >> 0 ) / 255.0, alpha: CGFloat(alpha)) 59 | } 60 | 61 | /** 62 | Create non-autoreleased color with in the given hex string and alpha. 63 | 64 | - parameter hexString: The hex string, with or without the hash character. 65 | - parameter alpha: The alpha value, a floating value between 0 and 1. 66 | - returns: A color with the given hex string and alpha. 67 | */ 68 | public convenience init?(hexString: String, alpha: Float) { 69 | var hex = hexString 70 | 71 | // Check for hash and remove the hash 72 | if hex.hasPrefix("#") { 73 | hex = hex.substring(from: hex.index(hex.startIndex, offsetBy: 1)) 74 | } 75 | 76 | guard let hexVal = Int(hex, radix: 16) else { 77 | self.init() 78 | return nil 79 | } 80 | 81 | switch hex.characters.count { 82 | case 3: 83 | self.init(hex3: hexVal, alpha: alpha) 84 | case 6: 85 | self.init(hex6: hexVal, alpha: alpha) 86 | default: 87 | // Note: 88 | // The swift 1.1 compiler is currently unable to destroy partially initialized classes in all cases, 89 | // so it disallows formation of a situation where it would have to. We consider this a bug to be fixed 90 | // in future releases, not a feature. -- Apple Forum 91 | self.init() 92 | return nil 93 | } 94 | } 95 | 96 | /** 97 | Create non-autoreleased color with in the given hex value. Alpha will be set as 1 by default. 98 | 99 | - parameter hex: The hex value. For example: 0xff8942 (no quotation). 100 | - returns: A color with the given hex value 101 | */ 102 | public convenience init?(hex: Int) { 103 | self.init(hex: hex, alpha: 1.0) 104 | } 105 | 106 | /** 107 | Create non-autoreleased color with in the given hex value and alpha 108 | 109 | - parameter hex: The hex value. For example: 0xff8942 (no quotation). 110 | - parameter alpha: The alpha value, a floating value between 0 and 1. 111 | - returns: color with the given hex value and alpha 112 | */ 113 | public convenience init?(hex: Int, alpha: Float) { 114 | if (0x000000 ... 0xFFFFFF) ~= hex { 115 | self.init(hex6: hex , alpha: alpha) 116 | } else { 117 | self.init() 118 | return nil 119 | } 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /Pods/SwiftLint/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Realm Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/SwiftLintFramework: -------------------------------------------------------------------------------- 1 | Versions/Current/SwiftLintFramework -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Commandant.framework/Commandant: -------------------------------------------------------------------------------- 1 | Versions/Current/Commandant -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Commandant.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Commandant.framework/Versions/A/Commandant: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Commandant.framework/Versions/A/Commandant -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Commandant.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G29 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Commandant 11 | CFBundleIdentifier 12 | org.carthage.Commandant 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Commandant 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.12.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E3004b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0833 41 | DTXcodeBuild 42 | 8E3004b 43 | NSHumanReadableCopyright 44 | Copyright © 2014 Carthage. All rights reserved. 45 | 46 | 47 | -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Commandant.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Result.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Result.framework/Result: -------------------------------------------------------------------------------- 1 | Versions/Current/Result -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Result.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G29 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Result 11 | CFBundleIdentifier 12 | com.antitypical.Result 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Result 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 3.2.3 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E3004b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0833 41 | DTXcodeBuild 42 | 8E3004b 43 | NSHumanReadableCopyright 44 | Copyright © 2015 Rob Rix. All rights reserved. 45 | 46 | 47 | -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Result.framework/Versions/A/Result: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Result.framework/Versions/A/Result -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Result.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/SWXMLHash: -------------------------------------------------------------------------------- 1 | Versions/Current/SWXMLHash -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G29 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SWXMLHash 11 | CFBundleIdentifier 12 | drmohundro.SWXMLHash 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SWXMLHash 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 2.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E3004b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0833 41 | DTXcodeBuild 42 | 8E3004b 43 | UIDeviceFamily 44 | 45 | 1 46 | 2 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/SWXMLHash: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/A/SWXMLHash -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SWXMLHash.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework/SourceKittenFramework: -------------------------------------------------------------------------------- 1 | Versions/Current/SourceKittenFramework -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G29 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SourceKittenFramework 11 | CFBundleIdentifier 12 | com.sourcekitten.SourceKittenFramework 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SourceKittenFramework 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.18.1 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E3004b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0833 41 | DTXcodeBuild 42 | 8E3004b 43 | NSHumanReadableCopyright 44 | Copyright © 2015 SourceKitten. All rights reserved. 45 | 46 | 47 | -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework/Versions/A/SourceKittenFramework: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework/Versions/A/SourceKittenFramework -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SourceKittenFramework.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SwiftyTextTable.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SwiftyTextTable.framework/SwiftyTextTable: -------------------------------------------------------------------------------- 1 | Versions/Current/SwiftyTextTable -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SwiftyTextTable.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G29 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SwiftyTextTable 11 | CFBundleIdentifier 12 | com.scotthoyt.SwiftyTextTable 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SwiftyTextTable 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E3004b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0833 41 | DTXcodeBuild 42 | 8E3004b 43 | NSHumanReadableCopyright 44 | Copyright © 2016 Scott Hoyt. All rights reserved. 45 | 46 | 47 | -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SwiftyTextTable.framework/Versions/A/SwiftyTextTable: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SwiftyTextTable.framework/Versions/A/SwiftyTextTable -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/SwiftyTextTable.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Yams.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Yams.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G29 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | Yams 11 | CFBundleIdentifier 12 | Yams 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Yams 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.3.5 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E3004b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0833 41 | DTXcodeBuild 42 | 8E3004b 43 | 44 | 45 | -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Yams.framework/Versions/A/Yams: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Yams.framework/Versions/A/Yams -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Yams.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/Yams.framework/Yams: -------------------------------------------------------------------------------- 1 | Versions/Current/Yams -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftCore.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftCore.dylib -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftCoreGraphics.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftCoreGraphics.dylib -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftDarwin.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftDarwin.dylib -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftDispatch.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftDispatch.dylib -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftFoundation.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftFoundation.dylib -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftIOKit.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftIOKit.dylib -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftObjectiveC.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Frameworks/libswiftObjectiveC.dylib -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 16G29 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | SwiftLintFramework 11 | CFBundleIdentifier 12 | io.realm.SwiftLintFramework 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | SwiftLintFramework 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 0.22.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1 29 | DTCompiler 30 | com.apple.compilers.llvm.clang.1_0 31 | DTPlatformBuild 32 | 8E3004b 33 | DTPlatformVersion 34 | GM 35 | DTSDKBuild 36 | 16E185 37 | DTSDKName 38 | macosx10.12 39 | DTXcode 40 | 0833 41 | DTXcodeBuild 42 | 8E3004b 43 | NSHumanReadableCopyright 44 | Copyright © 2015 Realm. All rights reserved. 45 | 46 | 47 | -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/SwiftLintFramework: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/SwiftLintFramework.framework/Versions/A/SwiftLintFramework -------------------------------------------------------------------------------- /Pods/SwiftLint/SwiftLintFramework.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /Pods/SwiftLint/swiftlint: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/Pods/SwiftLint/swiftlint -------------------------------------------------------------------------------- /Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_CocoaLumberjack : NSObject 3 | @end 4 | @implementation PodsDummy_CocoaLumberjack 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "CocoaLumberjack.h" 14 | #import "DDAbstractDatabaseLogger.h" 15 | #import "DDASLLogCapture.h" 16 | #import "DDASLLogger.h" 17 | #import "DDAssertMacros.h" 18 | #import "DDFileLogger.h" 19 | #import "DDLegacyMacros.h" 20 | #import "DDLog+LOGV.h" 21 | #import "DDLog.h" 22 | #import "DDLogMacros.h" 23 | #import "DDOSLogger.h" 24 | #import "DDTTYLogger.h" 25 | 26 | FOUNDATION_EXPORT double CocoaLumberjackVersionNumber; 27 | FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[]; 28 | 29 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack.modulemap: -------------------------------------------------------------------------------- 1 | framework module CocoaLumberjack { 2 | umbrella header "CocoaLumberjack-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CocoaLumberjack/CocoaLumberjack.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/CocoaLumberjack 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/CocoaLumberjack/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 | 3.2.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Decodable/Decodable-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Decodable : NSObject 3 | @end 4 | @implementation PodsDummy_Decodable 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Decodable/Decodable-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Decodable/Decodable-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "Decodable.h" 14 | 15 | FOUNDATION_EXPORT double DecodableVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char DecodableVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Decodable/Decodable.modulemap: -------------------------------------------------------------------------------- 1 | framework module Decodable { 2 | umbrella header "Decodable-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Decodable/Decodable.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Decodable 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Decodable 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Decodable/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 | 0.6.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmac/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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmac/Pods-rvcmac-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## CocoaLumberjack 5 | 6 | Software License Agreement (BSD License) 7 | 8 | Copyright (c) 2010-2016, Deusty, LLC 9 | All rights reserved. 10 | 11 | Redistribution and use of this software in source and binary forms, 12 | with or without modification, are permitted provided that the following conditions are met: 13 | 14 | * Redistributions of source code must retain the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer. 17 | 18 | * Neither the name of Deusty nor the names of its 19 | contributors may be used to endorse or promote products 20 | derived from this software without specific prior 21 | written permission of Deusty, LLC. 22 | 23 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | 25 | ## Decodable 26 | 27 | The MIT License (MIT) 28 | 29 | Copyright (c) 2015 Johannes Lund 30 | 31 | Permission is hereby granted, free of charge, to any person obtaining a copy 32 | of this software and associated documentation files (the "Software"), to deal 33 | in the Software without restriction, including without limitation the rights 34 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 35 | copies of the Software, and to permit persons to whom the Software is 36 | furnished to do so, subject to the following conditions: 37 | 38 | The above copyright notice and this permission notice shall be included in all 39 | copies or substantial portions of the Software. 40 | 41 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 42 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 43 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 45 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 46 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 47 | SOFTWARE. 48 | 49 | 50 | 51 | ## SwiftHEXColors 52 | 53 | Copyright (c) 2014 Doan Truong Thi 54 | 55 | Permission is hereby granted, free of charge, to any person obtaining a copy 56 | of this software and associated documentation files (the "Software"), to deal 57 | in the Software without restriction, including without limitation the rights 58 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 59 | copies of the Software, and to permit persons to whom the Software is 60 | furnished to do so, subject to the following conditions: 61 | 62 | The above copyright notice and this permission notice shall be included in 63 | all copies or substantial portions of the Software. 64 | 65 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 66 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 67 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 68 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 69 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 70 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 71 | THE SOFTWARE. 72 | 73 | 74 | ## SwiftLint 75 | 76 | The MIT License (MIT) 77 | 78 | Copyright (c) 2015 Realm Inc. 79 | 80 | Permission is hereby granted, free of charge, to any person obtaining a copy 81 | of this software and associated documentation files (the "Software"), to deal 82 | in the Software without restriction, including without limitation the rights 83 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 84 | copies of the Software, and to permit persons to whom the Software is 85 | furnished to do so, subject to the following conditions: 86 | 87 | The above copyright notice and this permission notice shall be included in all 88 | copies or substantial portions of the Software. 89 | 90 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 91 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 92 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 93 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 94 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 95 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 96 | SOFTWARE. 97 | 98 | Generated by CocoaPods - https://cocoapods.org 99 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmac/Pods-rvcmac-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_rvcmac : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_rvcmac 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmac/Pods-rvcmac-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_rvcmacVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_rvcmacVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmac/Pods-rvcmac.debug.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CODE_SIGN_IDENTITY = 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/Decodable" "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 7 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack/CocoaLumberjack.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Decodable/Decodable.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors/SwiftHEXColors.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint" 8 | OTHER_LDFLAGS = $(inherited) -framework "CocoaLumberjack" -framework "Decodable" -framework "SwiftHEXColors" 9 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 10 | PODS_BUILD_DIR = $BUILD_DIR 11 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmac/Pods-rvcmac.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_rvcmac { 2 | umbrella header "Pods-rvcmac-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmac/Pods-rvcmac.release.xcconfig: -------------------------------------------------------------------------------- 1 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES 2 | CODE_SIGN_IDENTITY = 3 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/Decodable" "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors" 4 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 5 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 6 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/Frameworks' 7 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack/CocoaLumberjack.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Decodable/Decodable.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors/SwiftHEXColors.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint" 8 | OTHER_LDFLAGS = $(inherited) -framework "CocoaLumberjack" -framework "Decodable" -framework "SwiftHEXColors" 9 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 10 | PODS_BUILD_DIR = $BUILD_DIR 11 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 12 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 13 | PODS_ROOT = ${SRCROOT}/Pods 14 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/Pods-rvcmacTests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/Pods-rvcmacTests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/Pods-rvcmacTests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_rvcmacTests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_rvcmacTests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/Pods-rvcmacTests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 10 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 11 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 12 | 13 | install_framework() 14 | { 15 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 16 | local source="${BUILT_PRODUCTS_DIR}/$1" 17 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 18 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 19 | elif [ -r "$1" ]; then 20 | local source="$1" 21 | fi 22 | 23 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | 25 | if [ -L "${source}" ]; then 26 | echo "Symlinked..." 27 | source="$(readlink "${source}")" 28 | fi 29 | 30 | # Use filter instead of exclude so missing patterns don't throw errors. 31 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 32 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 33 | 34 | local basename 35 | basename="$(basename -s .framework "$1")" 36 | binary="${destination}/${basename}.framework/${basename}" 37 | if ! [ -r "$binary" ]; then 38 | binary="${destination}/${basename}" 39 | fi 40 | 41 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 42 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 43 | strip_invalid_archs "$binary" 44 | fi 45 | 46 | # Resign the code if required by the build settings to avoid unstable apps 47 | code_sign_if_enabled "${destination}/$(basename "$1")" 48 | 49 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 50 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 51 | local swift_runtime_libs 52 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 53 | for lib in $swift_runtime_libs; do 54 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 55 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 56 | code_sign_if_enabled "${destination}/${lib}" 57 | done 58 | fi 59 | } 60 | 61 | # Copies the dSYM of a vendored framework 62 | install_dsym() { 63 | local source="$1" 64 | if [ -r "$source" ]; then 65 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 66 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 67 | fi 68 | } 69 | 70 | # Signs a framework with the provided identity 71 | code_sign_if_enabled() { 72 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 73 | # Use the current code_sign_identitiy 74 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 75 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 76 | 77 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 78 | code_sign_cmd="$code_sign_cmd &" 79 | fi 80 | echo "$code_sign_cmd" 81 | eval "$code_sign_cmd" 82 | fi 83 | } 84 | 85 | # Strip invalid architectures 86 | strip_invalid_archs() { 87 | binary="$1" 88 | # Get architectures for current file 89 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 90 | stripped="" 91 | for arch in $archs; do 92 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 93 | # Strip non-valid architectures in-place 94 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 95 | stripped="$stripped $arch" 96 | fi 97 | done 98 | if [[ "$stripped" ]]; then 99 | echo "Stripped $binary of architectures:$stripped" 100 | fi 101 | } 102 | 103 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 104 | wait 105 | fi 106 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/Pods-rvcmacTests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_rvcmacTestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_rvcmacTestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/Pods-rvcmacTests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/Decodable" "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack/CocoaLumberjack.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Decodable/Decodable.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors/SwiftHEXColors.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/Pods-rvcmacTests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_rvcmacTests { 2 | umbrella header "Pods-rvcmacTests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacTests/Pods-rvcmacTests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/Decodable" "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack/CocoaLumberjack.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Decodable/Decodable.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors/SwiftHEXColors.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/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.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/Pods-rvcmacUITests-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | Generated by CocoaPods - https://cocoapods.org 4 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/Pods-rvcmacUITests-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Generated by CocoaPods - https://cocoapods.org 18 | Title 19 | 20 | Type 21 | PSGroupSpecifier 22 | 23 | 24 | StringsTable 25 | Acknowledgements 26 | Title 27 | Acknowledgements 28 | 29 | 30 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/Pods-rvcmacUITests-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_rvcmacUITests : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_rvcmacUITests 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/Pods-rvcmacUITests-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 5 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 6 | 7 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 8 | 9 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 10 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 11 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 12 | 13 | install_framework() 14 | { 15 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 16 | local source="${BUILT_PRODUCTS_DIR}/$1" 17 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 18 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 19 | elif [ -r "$1" ]; then 20 | local source="$1" 21 | fi 22 | 23 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 24 | 25 | if [ -L "${source}" ]; then 26 | echo "Symlinked..." 27 | source="$(readlink "${source}")" 28 | fi 29 | 30 | # Use filter instead of exclude so missing patterns don't throw errors. 31 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 32 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 33 | 34 | local basename 35 | basename="$(basename -s .framework "$1")" 36 | binary="${destination}/${basename}.framework/${basename}" 37 | if ! [ -r "$binary" ]; then 38 | binary="${destination}/${basename}" 39 | fi 40 | 41 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 42 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 43 | strip_invalid_archs "$binary" 44 | fi 45 | 46 | # Resign the code if required by the build settings to avoid unstable apps 47 | code_sign_if_enabled "${destination}/$(basename "$1")" 48 | 49 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 50 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 51 | local swift_runtime_libs 52 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u && exit ${PIPESTATUS[0]}) 53 | for lib in $swift_runtime_libs; do 54 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 55 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 56 | code_sign_if_enabled "${destination}/${lib}" 57 | done 58 | fi 59 | } 60 | 61 | # Copies the dSYM of a vendored framework 62 | install_dsym() { 63 | local source="$1" 64 | if [ -r "$source" ]; then 65 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DWARF_DSYM_FOLDER_PATH}\"" 66 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DWARF_DSYM_FOLDER_PATH}" 67 | fi 68 | } 69 | 70 | # Signs a framework with the provided identity 71 | code_sign_if_enabled() { 72 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY}" -a "${CODE_SIGNING_REQUIRED}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 73 | # Use the current code_sign_identitiy 74 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 75 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS} --preserve-metadata=identifier,entitlements '$1'" 76 | 77 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 78 | code_sign_cmd="$code_sign_cmd &" 79 | fi 80 | echo "$code_sign_cmd" 81 | eval "$code_sign_cmd" 82 | fi 83 | } 84 | 85 | # Strip invalid architectures 86 | strip_invalid_archs() { 87 | binary="$1" 88 | # Get architectures for current file 89 | archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | rev)" 90 | stripped="" 91 | for arch in $archs; do 92 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 93 | # Strip non-valid architectures in-place 94 | lipo -remove "$arch" -output "$binary" "$binary" || exit 1 95 | stripped="$stripped $arch" 96 | fi 97 | done 98 | if [[ "$stripped" ]]; then 99 | echo "Stripped $binary of architectures:$stripped" 100 | fi 101 | } 102 | 103 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 104 | wait 105 | fi 106 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/Pods-rvcmacUITests-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_rvcmacUITestsVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_rvcmacUITestsVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/Pods-rvcmacUITests.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/Decodable" "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack/CocoaLumberjack.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Decodable/Decodable.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors/SwiftHEXColors.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/Pods-rvcmacUITests.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_rvcmacUITests { 2 | umbrella header "Pods-rvcmacUITests-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-rvcmacUITests/Pods-rvcmacUITests.release.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack" "$PODS_CONFIGURATION_BUILD_DIR/Decodable" "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 5 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/../Frameworks' '@loader_path/../Frameworks' 6 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/CocoaLumberjack/CocoaLumberjack.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Decodable/Decodable.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors/SwiftHEXColors.framework/Headers" -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 10 | PODS_ROOT = ${SRCROOT}/Pods 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftHEXColors/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.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftHEXColors/SwiftHEXColors-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SwiftHEXColors : NSObject 3 | @end 4 | @implementation PodsDummy_SwiftHEXColors 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftHEXColors/SwiftHEXColors-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftHEXColors/SwiftHEXColors-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "SwiftHEXColors.h" 14 | 15 | FOUNDATION_EXPORT double SwiftHEXColorsVersionNumber; 16 | FOUNDATION_EXPORT const unsigned char SwiftHEXColorsVersionString[]; 17 | 18 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftHEXColors/SwiftHEXColors.modulemap: -------------------------------------------------------------------------------- 1 | framework module SwiftHEXColors { 2 | umbrella header "SwiftHEXColors-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SwiftHEXColors/SwiftHEXColors.xcconfig: -------------------------------------------------------------------------------- 1 | CODE_SIGN_IDENTITY = 2 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SwiftHEXColors 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SwiftLint" 5 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_ROOT = ${SRCROOT} 9 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SwiftHEXColors 10 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 11 | SKIP_INSTALL = YES 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rvc-mac 2 | 3 | GUI for `rvd` daemon. 4 | 5 | ## Build instructions 6 | 7 | 1. Install development environment: 8 | 9 | `brew install json-c` 10 | 11 | 2. Fetch submodules: 12 | 13 | `git submodule update --init --recursive` 14 | 15 | 3. Open `rvcmac.xcworkspace` 16 | 4. Press `cmd+R` 17 | 18 | ## Updating submodules 19 | 20 | 1. `git submodule update --recursive --remote` 21 | 22 | -------------------------------------------------------------------------------- /deps/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/deps/.gitkeep -------------------------------------------------------------------------------- /fastlane/.gitignore: -------------------------------------------------------------------------------- 1 | installer/ 2 | -------------------------------------------------------------------------------- /fastlane/Appfile: -------------------------------------------------------------------------------- 1 | # The Appfile can be used to specify information that's used across all fastlane 2 | # tools, like your username or the app's bundle identifier. 3 | # 4 | # For more details, check out the documentation at: 5 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Appfile.md 6 | 7 | app_identifier "com.ribose.rvcmac" # the bundle identifier of your app 8 | apple_id ENV["APPLE_ID"] # Your Apple ID 9 | -------------------------------------------------------------------------------- /fastlane/Fastfile: -------------------------------------------------------------------------------- 1 | # More documentation about how to customize your build 2 | # can be found here: 3 | # https://docs.fastlane.tools 4 | fastlane_version "1.109.0" 5 | 6 | # This value helps us track success metrics for Fastfiles 7 | # we automatically generate. Feel free to remove this line 8 | # once you get things running smoothly! 9 | generated_fastfile_id "aadd3440-8763-4c29-bac1-fa01a0494656" 10 | 11 | default_platform :mac 12 | 13 | lane :adhoc do 14 | # build your macOS app 15 | gym( 16 | scheme: "rvcmac", 17 | export_method: "ad-hoc" 18 | ) 19 | end 20 | -------------------------------------------------------------------------------- /fastlane/README.md: -------------------------------------------------------------------------------- 1 | fastlane documentation 2 | ================ 3 | # Installation 4 | 5 | Make sure you have the latest version of the Xcode command line tools installed: 6 | 7 | ``` 8 | xcode-select --install 9 | ``` 10 | 11 | ## Choose your installation method: 12 | 13 | 14 | 15 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |
Homebrew 16 | Installer Script 17 | Rubygems 18 |
macOSmacOSmacOS or Linux with Ruby 2.0.0 or above
brew cask install fastlaneDownload the zip file. Then double click on the install script (or run it in a terminal window).sudo gem install fastlane -NV
30 | 31 | # Available Actions 32 | ### adhoc 33 | ``` 34 | fastlane adhoc 35 | ``` 36 | 37 | 38 | ---- 39 | 40 | This README.md is auto-generated and will be re-generated every time [fastlane](https://fastlane.tools) is run. 41 | More information about fastlane can be found on [fastlane.tools](https://fastlane.tools). 42 | The documentation of fastlane can be found on [docs.fastlane.tools](https://docs.fastlane.tools). 43 | -------------------------------------------------------------------------------- /rvcmac.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /rvcmac.xcodeproj/xcshareddata/xcschemes/rvcmac.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 44 | 50 | 51 | 52 | 53 | 54 | 60 | 61 | 62 | 63 | 64 | 65 | 76 | 78 | 84 | 85 | 86 | 87 | 91 | 92 | 93 | 94 | 95 | 96 | 102 | 104 | 110 | 111 | 112 | 113 | 115 | 116 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /rvcmac.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /rvcmac.xcworkspace/xcshareddata/rvcmac.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "92879F58A1B89541926F60DFC73862173C28D491", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "7B499D4C33E52EF5B8A63C08C0CA7F9628C9EEAC" : 9223372036854775807, 8 | "92879F58A1B89541926F60DFC73862173C28D491" : 9223372036854775807 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "BC0F8005-CBDE-4B13-9F6F-68E80A3F416F", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "7B499D4C33E52EF5B8A63C08C0CA7F9628C9EEAC" : "rvcmac\/deps\/rvc\/", 13 | "92879F58A1B89541926F60DFC73862173C28D491" : "rvcmac\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "rvcmac", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "rvcmac.xcworkspace", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/riboseinc\/rvc.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "7B499D4C33E52EF5B8A63C08C0CA7F9628C9EEAC" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:riboseinc\/rvc-mac.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "92879F58A1B89541926F60DFC73862173C28D491" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | }, 6 | "images" : [ 7 | { 8 | "filename" : "icon_16x16.png", 9 | "size" : "16x16", 10 | "idiom" : "mac", 11 | "scale" : "1x" 12 | }, 13 | { 14 | "filename" : "icon_16x16@2x.png", 15 | "size" : "16x16", 16 | "idiom" : "mac", 17 | "scale" : "2x" 18 | }, 19 | { 20 | "filename" : "icon_32x32.png", 21 | "size" : "32x32", 22 | "idiom" : "mac", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "filename" : "icon_32x32@2x.png", 27 | "size" : "32x32", 28 | "idiom" : "mac", 29 | "scale" : "2x" 30 | }, 31 | { 32 | "filename" : "icon_128x128.png", 33 | "size" : "128x128", 34 | "idiom" : "mac", 35 | "scale" : "1x" 36 | }, 37 | { 38 | "filename" : "icon_128x128@2x.png", 39 | "size" : "128x128", 40 | "idiom" : "mac", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "filename" : "icon_256x256.png", 45 | "size" : "256x256", 46 | "idiom" : "mac", 47 | "scale" : "1x" 48 | }, 49 | { 50 | "filename" : "icon_256x256@2x.png", 51 | "size" : "256x256", 52 | "idiom" : "mac", 53 | "scale" : "2x" 54 | }, 55 | { 56 | "filename" : "icon_512x512.png", 57 | "size" : "512x512", 58 | "idiom" : "mac", 59 | "scale" : "1x" 60 | }, 61 | { 62 | "filename" : "icon_512x512@2x.png", 63 | "size" : "512x512", 64 | "idiom" : "mac", 65 | "scale" : "2x" 66 | } 67 | ] 68 | } -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_128x128.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_16x16.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_16x16@2x.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_256x256.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_256x256@2x.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_32x32.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_32x32@2x.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_512x512.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/rvcmac-status-item.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "rvcmac-status-item.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | }, 21 | "properties" : { 22 | "template-rendering-intent" : "template" 23 | } 24 | } -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/rvcmac-status-item.imageset/rvcmac-status-item.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/rvcmac-status-item.imageset/rvcmac-status-item.pdf -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/settings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "filename" : "settings.pdf", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x" 11 | } 12 | ], 13 | "info" : { 14 | "version" : 1, 15 | "author" : "xcode" 16 | } 17 | } -------------------------------------------------------------------------------- /rvcmac/Assets.xcassets/settings.imageset/settings.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Assets.xcassets/settings.imageset/settings.pdf -------------------------------------------------------------------------------- /rvcmac/Controller/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Controller/.gitkeep -------------------------------------------------------------------------------- /rvcmac/Controller/VpnCollectionViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnCollectionViewController.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class VpnCollectionViewController: NSViewController { 12 | 13 | @IBOutlet weak var collectionView: VpnCollectionView! 14 | @IBOutlet var collectionViewDataSource: VpnCollectionViewDataSource! 15 | @IBOutlet var collectionViewDelegate: VpnCollectionViewDelegate! 16 | 17 | static func instantiate() -> VpnCollectionViewController { 18 | let sb = NSStoryboard(name: .main, bundle: nil) 19 | return sb.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: self.identifier())) as! VpnCollectionViewController 20 | } 21 | 22 | deinit { 23 | NotificationCenter.default.removeObserver(collectionView) 24 | } 25 | 26 | func assertCheck() { 27 | assert(collectionView != nil) 28 | assert(collectionViewDataSource != nil) 29 | assert(collectionViewDelegate != nil) 30 | assert(collectionView.dataSource != nil) 31 | assert(collectionView.delegate != nil) 32 | } 33 | 34 | let padding: CGFloat = 30 35 | 36 | override func viewDidLoad() { 37 | func subscribe() { 38 | NotificationCenter.default.addObserver(collectionView, selector: #selector(collectionView.reloadData), name: .RvcConnectionInserted, object: nil) 39 | NotificationCenter.default.addObserver(collectionView, selector: #selector(collectionView.reloadData), name: .RvcConnectionDeleted, object: nil) 40 | } 41 | super.viewDidLoad() 42 | assertCheck() 43 | collectionViewDataSource.RvdClient = AppDelegate.shared.rvdClient 44 | collectionView.register(NSNib(nibNamed: NSNib.Name(rawValue: self.collectionViewDataSource.itemIdentifier), bundle: nil)!, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: self.collectionViewDataSource.itemIdentifier)) 45 | collectionView.enclosingScrollView!.automaticallyAdjustsContentInsets = false 46 | collectionView.enclosingScrollView!.contentInsets = NSEdgeInsets(top: padding, left: 0, bottom: padding, right: 0) 47 | subscribe() 48 | } 49 | 50 | var shouldScroll = true 51 | 52 | override func viewWillAppear() { 53 | let w = view.window!.minSize.width 54 | let h = self.collectionView.minItemSize.height 55 | collectionView.minItemSize = NSSize(width: w, height: h) 56 | if shouldScroll { 57 | collectionView.enclosingScrollView!.contentView.scroll(NSPoint(x: 0, y: -padding)) 58 | shouldScroll = false 59 | } 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /rvcmac/Controller/VpnCollectionViewDataSource.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnCollectionViewDataSource.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class VpnCollectionViewDataSource: NSObject, NSCollectionViewDataSource { 12 | 13 | let itemIdentifier = VpnCollectionViewItem.identifier() 14 | 15 | var RvdClient: RvdClient! 16 | 17 | func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int { 18 | return RvdClient.storage.connections.count 19 | } 20 | 21 | func item(at index: Int) -> RvcStatus { 22 | let key = Array(RvdClient.storage.connections.keys)[index] 23 | let value = RvdClient.storage.connections[key]! 24 | return value 25 | } 26 | 27 | func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem { 28 | 29 | let collectionViewItem = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: self.itemIdentifier), for: indexPath) as! VpnCollectionViewItem 30 | collectionViewItem.item = item(at: indexPath.item) 31 | 32 | return collectionViewItem 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /rvcmac/Controller/VpnCollectionViewDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnCollectionViewDelegate.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class VpnCollectionViewDelegate: NSObject, NSCollectionViewDelegate, NSCollectionViewDelegateFlowLayout { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /rvcmac/Controller/VpnCollectionViewFlowLayout.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnCollectionViewFlowLayout.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class VpnCollectionViewFlowLayout: NSCollectionViewFlowLayout { 12 | 13 | required init?(coder aDecoder: NSCoder) { 14 | super.init(coder: aDecoder) 15 | self.minimumInteritemSpacing = CGFloat.greatestFiniteMagnitude 16 | self.sectionInset = NSEdgeInsetsZero 17 | self.estimatedItemSize = itemSize 18 | } 19 | 20 | override func shouldInvalidateLayout(forBoundsChange newBounds: NSRect) -> Bool { 21 | return true 22 | } 23 | 24 | override func layoutAttributesForElements(in rect: NSRect) -> [NSCollectionViewLayoutAttributes] { 25 | let xs = super.layoutAttributesForElements(in: rect) 26 | for x in xs { 27 | self.modifyAttributes(x) 28 | } 29 | return xs 30 | } 31 | 32 | override func layoutAttributesForItem(at indexPath: IndexPath) -> NSCollectionViewLayoutAttributes? { 33 | guard let x = super.layoutAttributesForItem(at: indexPath) else { 34 | return nil 35 | } 36 | self.modifyAttributes(x) 37 | return x 38 | } 39 | 40 | private func modifyAttributes(_ a: NSCollectionViewLayoutAttributes) { 41 | if let c = collectionView { 42 | let x = CGFloat(0) 43 | let y = a.frame.origin.y 44 | 45 | let s = (c.collectionViewLayout as? NSCollectionViewFlowLayout)!.sectionInset 46 | 47 | let w = c.frame.size.width - (s.left + s.right) 48 | let h = a.frame.size.height 49 | 50 | let r = NSRectToCGRect(NSRect(x: x, y: y, width: w, height: h)) 51 | a.frame = r 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /rvcmac/Controller/VpnCollectionViewItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnCollectionViewItem.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import CocoaLumberjack 11 | 12 | class VpnCollectionViewItem: NSCollectionViewItem { 13 | 14 | private var observerContext = 0 15 | 16 | @IBOutlet weak var statusView: NSView! 17 | @IBOutlet weak var checkBoxButton: NSButton! 18 | @IBOutlet weak var titleTextField: NSTextField! 19 | @IBOutlet weak var toggleButton: TextButton! 20 | 21 | var statusToken: NSKeyValueObservation? 22 | 23 | func assertCheck() { 24 | assert(statusView != nil) 25 | 26 | assert(checkBoxButton != nil) 27 | assert(checkBoxButton.target != nil) 28 | assert(checkBoxButton.action != nil) 29 | 30 | assert(titleTextField != nil) 31 | 32 | assert(toggleButton != nil) 33 | assert(toggleButton.target != nil) 34 | assert(toggleButton.action != nil) 35 | } 36 | 37 | override func awakeFromNib() { 38 | super.awakeFromNib() 39 | assertCheck() 40 | prepareForReuse() 41 | } 42 | 43 | override func prepareForReuse() { 44 | // super.prepareForReuse() leads to a crash 45 | statusToken?.invalidate() 46 | statusView.backgroundColor = NSColor.ribose.disconnected 47 | titleTextField.stringValue = "" 48 | checkBoxButton.state = .off 49 | } 50 | 51 | var item: RvcStatus! { 52 | didSet { 53 | pullStatus() 54 | pullState() 55 | pullTitle() 56 | statusToken = item.observe(\.status) { _, _ in 57 | self.pullStatus() 58 | } 59 | } 60 | } 61 | 62 | // MARK: - UI 63 | 64 | private func pullStatus() { 65 | switch item.status { 66 | case "DISCONNECTED": 67 | statusView.backgroundColor = NSColor.ribose.disconnected 68 | toggleButton.text = "Connect" 69 | toggleButton.isEnabled = true 70 | case "CONNECTING": 71 | statusView.backgroundColor = NSColor.ribose.connecting 72 | toggleButton.text = "Connecting..." 73 | toggleButton.isEnabled = false 74 | case "CONNECTED": 75 | statusView.backgroundColor = NSColor.ribose.connected 76 | toggleButton.text = "Disconnect" 77 | toggleButton.isEnabled = true 78 | case "DISCONNECTING": 79 | statusView.backgroundColor = NSColor.ribose.connecting 80 | toggleButton.text = "Disconnecting..." 81 | toggleButton.isEnabled = false 82 | case "ERROR": 83 | statusView.backgroundColor = NSColor.ribose.error 84 | toggleButton.text = "Connect" 85 | toggleButton.isEnabled = true 86 | default: 87 | statusView.backgroundColor = NSColor.ribose.disconnected 88 | } 89 | } 90 | 91 | private func pullState() { 92 | checkBoxButton.state = item.isSelected ? .on : .off 93 | } 94 | 95 | private func pullTitle() { 96 | titleTextField.stringValue = item.name 97 | } 98 | 99 | // MARK: - Actions 100 | 101 | @IBAction func actionCheckBoxButtonPressed(_ sender: Any) { 102 | DDLogInfo("\(#function)") 103 | switch self.checkBoxButton.state { 104 | case .on: 105 | DDLogInfo("on") 106 | item.isSelected = true 107 | default: 108 | DDLogInfo("off") 109 | item.isSelected = false 110 | } 111 | } 112 | 113 | @IBAction func actionToggleButtonPressed(_ sender: Any) { 114 | DDLogInfo("\(#function)") 115 | if item.isConnected { 116 | AppDelegate.shared.rvdClient.disconnect(item) 117 | } else { 118 | AppDelegate.shared.rvdClient.connect(item) 119 | } 120 | } 121 | 122 | // MARK: - Core Data 123 | } 124 | -------------------------------------------------------------------------------- /rvcmac/Controller/VpnContainerViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnContainerViewController.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import CocoaLumberjack 11 | 12 | class VpnContainerViewController: NSViewController { 13 | 14 | let collection = VpnCollectionViewController.instantiate() 15 | 16 | @IBOutlet weak var headerView: NSVisualEffectView! 17 | @IBOutlet var menuRef: NSMenu! 18 | @IBOutlet weak var menuButton: NSButton! 19 | @IBOutlet weak var connectAllButton: NSButton! 20 | @IBOutlet weak var disconnectAllButton: NSButton! 21 | @IBOutlet weak var containerView: NSView! 22 | 23 | static func instantiate() -> VpnContainerViewController { 24 | let sb = NSStoryboard(name: .main, bundle: nil) 25 | return sb.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: self.identifier())) as! VpnContainerViewController 26 | } 27 | 28 | func assertCheck() { 29 | assert(headerView != nil) 30 | 31 | assert(menuRef != nil) 32 | 33 | assert(menuButton != nil) 34 | assert(menuButton.target != nil) 35 | assert(menuButton.action != nil) 36 | 37 | assert(connectAllButton != nil) 38 | assert(connectAllButton.action != nil) 39 | assert(connectAllButton.target != nil) 40 | 41 | assert(disconnectAllButton != nil) 42 | assert(disconnectAllButton.target != nil) 43 | assert(disconnectAllButton.action != nil) 44 | 45 | assert(containerView != nil) 46 | } 47 | 48 | override func viewDidLoad() { 49 | super.viewDidLoad() 50 | assertCheck() 51 | collection.view.frame = containerView.bounds 52 | containerView.addSubview(collection.view, positioned: .below, relativeTo: headerView) 53 | } 54 | 55 | // MARK: - Actions 56 | 57 | @IBAction func actionMenu(_ sender: Any) { 58 | DDLogInfo("\(#function)") 59 | menuRef.popUp(positioning: nil, at: NSPoint(x: menuButton.bounds.midX + 4, y: 34), in: menuButton) 60 | } 61 | 62 | @IBAction func actionQuit(_ sender: Any) { 63 | DDLogInfo("\(#function)") 64 | NSApp.terminate(self) 65 | } 66 | 67 | @IBAction func actionConnectAll(_ sender: Any) { 68 | DDLogInfo("\(#function)") 69 | AppDelegate.shared.rvdClient.connectAll() 70 | } 71 | 72 | @IBAction func actoinDisconnectAll(_ sender: Any) { 73 | DDLogInfo("\(#function)") 74 | AppDelegate.shared.rvdClient.disconnectAll() 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /rvcmac/Controller/VpnPopover.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnPopover.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class VpnPopover: NSPopover { 12 | 13 | override init() { 14 | super.init() 15 | animates = false 16 | appearance = NSAppearance(named: .aqua) 17 | // contentSize = NSSize(width: 320, height: 120) 18 | } 19 | 20 | required init?(coder: NSCoder) { 21 | super.init(coder: coder) 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /rvcmac/Controller/VpnWindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnWindowController.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import CocoaLumberjack 11 | 12 | extension NSStoryboard.Name { 13 | public static let main = NSStoryboard.Name(rawValue: "Main") 14 | } 15 | 16 | class VpnWindowController: NSWindowController, NSWindowDelegate { 17 | 18 | static func instantiate() -> VpnWindowController { 19 | let sb = NSStoryboard(name: .main, bundle: nil) 20 | return sb.instantiateController(withIdentifier: NSStoryboard.SceneIdentifier(rawValue: self.identifier())) as! VpnWindowController 21 | } 22 | 23 | override func windowDidLoad() { 24 | super.windowDidLoad() 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /rvcmac/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.1 21 | CFBundleVersion 22 | 1 23 | LSApplicationCategoryType 24 | public.app-category.utilities 25 | LSMinimumSystemVersion 26 | $(MACOSX_DEPLOYMENT_TARGET) 27 | LSUIElement 28 | 29 | NSHumanReadableCopyright 30 | Copyright © 2017 Ribose. All rights reserved. 31 | NSMainStoryboardFile 32 | Main 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /rvcmac/Model/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Model/.gitkeep -------------------------------------------------------------------------------- /rvcmac/Model/Connection+CoreDataClass.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Connection+CoreDataClass.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 24/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | // 9 | 10 | import Foundation 11 | import CoreData 12 | import CocoaLumberjack 13 | 14 | @objc(Connection) 15 | public class Connection: NSManagedObject { 16 | 17 | public func save() { 18 | do { 19 | try managedObjectContext?.save() 20 | DDLogInfo("Saved item=\(self)") 21 | } catch let error { 22 | DDLogError("Could not save item=\(self), error=\(error.localizedDescription)") 23 | } 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /rvcmac/Model/Connection+CoreDataProperties.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Connection+CoreDataProperties.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 24/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | // 9 | 10 | import Foundation 11 | import CoreData 12 | 13 | extension Connection { 14 | 15 | @nonobjc public class func fetchRequest() -> NSFetchRequest { 16 | return NSFetchRequest(entityName: "Connection") 17 | } 18 | 19 | @NSManaged public var name: String? 20 | @NSManaged public var isSelected: Bool 21 | 22 | } 23 | -------------------------------------------------------------------------------- /rvcmac/Model/Defaults.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Defaults.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 24/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import AppKit 10 | 11 | private let KEY_IS_SET_UP = "isSetUp" 12 | 13 | class Defaults { 14 | static var shared = Defaults() 15 | 16 | private let userDefaults: UserDefaults 17 | 18 | init() { 19 | self.userDefaults = UserDefaults.standard 20 | self.userDefaults.register(defaults: [KEY_IS_SET_UP: false]) 21 | } 22 | 23 | var isSetUp: Bool { 24 | get { 25 | return userDefaults.bool(forKey: KEY_IS_SET_UP) 26 | } 27 | set { 28 | userDefaults.set(newValue, forKey: KEY_IS_SET_UP) 29 | userDefaults.synchronize() 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /rvcmac/Model/RvcConnection.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RvcConnection.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 17/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import protocol Decodable.Decodable 11 | import enum Decodable.DecodingError 12 | import Decodable 13 | import CocoaLumberjack 14 | 15 | // Vpn connection from `rvc list --json` 16 | // Response sample: 17 | //{ 18 | // "code":0, 19 | // "data":[ 20 | // { 21 | // "name":"nmtitov", 22 | // "profile":"\/Users\/nt\/.rvc\/nmtitov.ovpn", 23 | // "auto-connect":false, 24 | // "pre-exec-cmd":"\/usr\/bin\/echo nmtitov" 25 | // } 26 | // ] 27 | //} 28 | 29 | class RvcConnection: Decodable { 30 | 31 | let name: String 32 | let profile: String 33 | let autoConnect: Bool 34 | let preExecCmd: String 35 | 36 | required init(name: String, profile: String, autoConnect: Bool, preExecCmd: String) { 37 | self.name = name 38 | self.profile = profile 39 | self.autoConnect = autoConnect 40 | self.preExecCmd = preExecCmd 41 | } 42 | 43 | static func decode(_ json: Any) throws -> Self { 44 | return try self.init( 45 | name: json => "name", 46 | profile: json => "profile", 47 | autoConnect: json => "auto-connect", 48 | preExecCmd: json => "pre-exec-cmd" 49 | ) 50 | } 51 | 52 | } 53 | 54 | class RvcConnectionEnvelope: Decodable { 55 | 56 | let code: Int 57 | let data: [RvcConnection] 58 | 59 | required init(code: Int, data: [RvcConnection]) { 60 | self.code = code 61 | self.data = data 62 | } 63 | 64 | static func decode(_ json: Any) throws -> Self { 65 | return try self.init( 66 | code: json => "code", 67 | data: json => "data" 68 | ) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /rvcmac/Model/RvcStatus.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RvcStatus.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 18/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import protocol Decodable.Decodable 11 | import enum Decodable.DecodingError 12 | import Decodable 13 | import CoreData 14 | import CocoaLumberjack 15 | 16 | // Vpn connection status from `rvc status nmtitov --json` 17 | // Response sample: 18 | //{ 19 | // "code":0, 20 | // "data":{ 21 | // "name":"nmtitov", 22 | // "status":"DISCONNECTED", 23 | // "ovpn-status":"DISCONNECTED", 24 | // "in-total":0, 25 | // "out-total":0, 26 | // "timestamp":1505687032 27 | // } 28 | //} 29 | 30 | class RvcStatus: NSObject, Decodable { 31 | 32 | let name: String 33 | @objc dynamic var status: String 34 | @objc dynamic var ovpnStatus: String 35 | @objc dynamic var inTotal: Int 36 | @objc dynamic var outTotal: Int 37 | @objc dynamic var timestamp: Int 38 | 39 | var connection: Connection? 40 | private var _isSelected = false 41 | var isSelected: Bool { 42 | get { 43 | if let connection = connection { 44 | return connection.isSelected 45 | } else { 46 | return _isSelected 47 | } 48 | } 49 | set { 50 | if let connection = connection { 51 | connection.isSelected = newValue 52 | connection.save() 53 | } else { 54 | _isSelected = newValue 55 | } 56 | } 57 | } 58 | 59 | var isConnected: Bool { 60 | get { 61 | return status == "CONNECTED" 62 | } 63 | } 64 | 65 | required init(name: String, status: String, ovpnStatus: String, inTotal: Int, outTotal: Int, timestamp: Int) { 66 | self.name = name 67 | self.status = status 68 | self.ovpnStatus = ovpnStatus 69 | self.inTotal = inTotal 70 | self.outTotal = outTotal 71 | self.timestamp = timestamp 72 | } 73 | 74 | static func decode(_ json: Any) throws -> Self { 75 | return try self.init( 76 | name: json => "name", 77 | status: json => "status", 78 | ovpnStatus: json => "ovpn-status", 79 | inTotal: json => "in-total", 80 | outTotal: json => "out-total", 81 | timestamp: json => "timestamp" 82 | ) 83 | } 84 | 85 | } 86 | 87 | class RvcStatusEnvelope: Decodable { 88 | 89 | let code: Int 90 | let data: RvcStatus 91 | 92 | required init(code: Int, data: RvcStatus) { 93 | self.code = code 94 | self.data = data 95 | } 96 | 97 | static func decode(_ json: Any) throws -> Self { 98 | return try self.init( 99 | code: json => "code", 100 | data: json => "data" 101 | ) 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /rvcmac/Resources/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Resources/.gitkeep -------------------------------------------------------------------------------- /rvcmac/Service/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Service/.gitkeep -------------------------------------------------------------------------------- /rvcmac/Service/Database.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Database.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 24/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreData 11 | import CocoaLumberjack 12 | 13 | class Database { 14 | 15 | let context: NSManagedObjectContext 16 | 17 | required init(context: NSManagedObjectContext) { 18 | self.context = context 19 | } 20 | 21 | func getConnection(name: String) -> Connection? { 22 | if let connection = self.selectConnection(name: name) { 23 | return connection 24 | } 25 | return insertConnection(name: name) 26 | } 27 | 28 | func selectConnection(name: String) -> Connection? { 29 | let fetchRequest: NSFetchRequest = Connection.fetchRequest() 30 | let predicate = NSPredicate(format: "name = %@", name) 31 | fetchRequest.predicate = predicate 32 | fetchRequest.fetchLimit = 1 33 | let items = try? context.fetch(fetchRequest) 34 | let item = items?.first 35 | if let item = item { 36 | DDLogInfo("Selected connection=\(item)") 37 | } else { 38 | DDLogInfo("Could not selected connection with name=\(name)") 39 | } 40 | return item 41 | } 42 | 43 | func insertConnection(name: String) -> Connection? { 44 | let item = Connection(context: context) 45 | item.name = name 46 | item.isSelected = false 47 | do { 48 | try context.save() 49 | DDLogInfo("Inserted connection=\(item)") 50 | return item 51 | } catch let error { 52 | DDLogError("Could not insert connection with name=\(name) error=\(error.localizedDescription)") 53 | } 54 | return nil 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /rvcmac/Service/RvcWrapper.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RvcWrapper.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 23/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CoreData 11 | 12 | // Swift wrappers for C library functions. 13 | // Once C functions become mature enough and will do their own parsing from json string to data structures these wrappers could be eliminated. 14 | 15 | class RvcWrapper { 16 | 17 | let database: Database 18 | 19 | required init(database: Database) { 20 | self.database = database 21 | } 22 | 23 | func list() -> [RvcConnection] { 24 | let response = libraryCall {rvc_get_status("all", 1, $0)} 25 | if let response = response, let json = jsonObject(response), let envelope = try? RvcConnectionEnvelope.decode(json), envelope.code == 0 { 26 | return envelope.data 27 | } 28 | return [RvcConnection]() 29 | } 30 | 31 | func status(_ name: String) -> RvcStatus? { 32 | let name = name.cString(using: .utf8)! 33 | let response = libraryCall {rvc_get_status(name, 1, $0)} 34 | return createStatus(response) 35 | } 36 | 37 | func connect(_ name: String) -> RvcStatus? { 38 | let name = name.cString(using: .utf8)! 39 | let response = libraryCall {rvc_connect(name, 1, $0)} 40 | return createStatus(response) 41 | } 42 | 43 | func disconnect(_ name: String) -> RvcStatus? { 44 | let name = name.cString(using: .utf8)! 45 | let response = libraryCall {rvc_disconnect(name, 1, $0)} 46 | return createStatus(response) 47 | } 48 | 49 | private func libraryCall(_ block: (UnsafeMutablePointer>) -> Int32) -> String? { 50 | var buffer = [Int8]() 51 | var response: String? 52 | buffer.withUnsafeMutableBufferPointer { bptr in 53 | var ptr = bptr.baseAddress! 54 | let ret = block(&ptr) 55 | if ret != 0 { 56 | return 57 | } 58 | response = String(cString: ptr) 59 | } 60 | return response 61 | } 62 | 63 | private func createStatus(_ response: String?) -> RvcStatus? { 64 | guard let response = response, let json = jsonObject(response), let envelope = try? RvcStatusEnvelope.decode(json), envelope.code == 0 else { 65 | return nil 66 | } 67 | let status = envelope.data 68 | status.connection = database.getConnection(name: status.name) 69 | return status 70 | } 71 | 72 | private func jsonObject(_ string: String) -> Any? { 73 | let data = string.data(using: .utf8)! 74 | return try? JSONSerialization.jsonObject(with: data, options: []) 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /rvcmac/Service/RvdClient.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RvdClient.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 17/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import CocoaLumberjack 11 | 12 | class RvdClient { 13 | 14 | let storage: Storage 15 | let wrapper: RvcWrapper 16 | var timer: Timer? 17 | 18 | deinit { 19 | timer?.invalidate() 20 | } 21 | 22 | required init(storage: Storage, wrapper: RvcWrapper) { 23 | self.storage = storage 24 | self.wrapper = wrapper 25 | } 26 | 27 | func startPooling() { 28 | tick() 29 | } 30 | 31 | private let dt: TimeInterval = 1 / 30 32 | private static let poolCooldownDefault: TimeInterval = 1 33 | private var poolCooldown: TimeInterval = 0 34 | 35 | func schedule(_ delay: TimeInterval) { 36 | if let timer = timer { 37 | timer.invalidate() 38 | } 39 | let t = Timer.scheduledTimer(timeInterval: delay, target: self, selector: #selector(tick), userInfo: nil, repeats: false) 40 | RunLoop.current.add(t, forMode: .commonModes) 41 | timer = t 42 | } 43 | 44 | @objc private func tick() { 45 | let t1 = Date().timeIntervalSinceNow 46 | poolCooldown -= dt 47 | if poolCooldown < 0 { 48 | pool() 49 | } 50 | let t2 = Date().timeIntervalSinceNow 51 | let diff = t2 - t1 52 | let delay = dt - diff 53 | let limitedDelay = max(0, delay) 54 | 55 | // DDLogInfo("t1: \(t1)") 56 | // DDLogInfo("t2: \(t1)") 57 | // DDLogInfo("diff: \(diff)") 58 | // DDLogInfo("delay: \(delay)") 59 | // DDLogInfo("limitedDelay: \(limitedDelay)") 60 | 61 | schedule(limitedDelay) 62 | } 63 | 64 | private func pool() { 65 | poolCooldown = RvdClient.poolCooldownDefault 66 | 67 | let connections = wrapper.list() 68 | connections.flatMap {wrapper.status($0.name)}.forEach(storage.put(_:)) 69 | storage.delete(ifMissingIn: Set(connections.map {$0.name})) 70 | DDLogInfo("Stored connections: \(storage.connections)") 71 | } 72 | 73 | func connect(_ connection: RvcStatus) { 74 | if let newConnection = wrapper.connect(connection.name) { 75 | storage.put(newConnection) 76 | } 77 | } 78 | 79 | func disconnect(_ connection: RvcStatus) { 80 | if let newConnection = wrapper.disconnect(connection.name) { 81 | storage.put(newConnection) 82 | } 83 | } 84 | 85 | func connectAll() { 86 | DDLogInfo("\(#function)") 87 | storage.connections.values.filter {$0.isSelected && !$0.isConnected}.forEach(connect(_:)) 88 | } 89 | 90 | func disconnectAll() { 91 | DDLogInfo("\(#function)") 92 | storage.connections.values.filter {$0.isSelected && $0.isConnected}.forEach(disconnect(_:)) 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /rvcmac/Service/Storage.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Storage.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 23/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | // Storage is a simple dict wrapper 12 | // It behaves like a set 13 | // For each mutable operation it posts a notificaion 14 | // so that observers could update UI 15 | 16 | extension NSNotification.Name { 17 | public static let RvcConnectionInserted = NSNotification.Name(rawValue: "RvcConnectionInserted") 18 | public static let RvcConnectionDeleted = NSNotification.Name(rawValue: "RvcConnectionDeleted") 19 | } 20 | 21 | class Storage { 22 | private var _connections = [String: RvcStatus]() 23 | 24 | var connections: [String: RvcStatus] { 25 | get { 26 | return _connections 27 | } 28 | } 29 | 30 | func put(_ connection: RvcStatus) { 31 | if !contains(connection.name) { 32 | insert(connection) 33 | } else { 34 | update(connection) 35 | } 36 | } 37 | 38 | func delete(_ key: String) { 39 | if let connection = _connections.removeValue(forKey: key) { 40 | NotificationCenter.default.post(name: .RvcConnectionDeleted, object: connection) 41 | } 42 | } 43 | 44 | func delete(ifMissingIn keys: Set) { 45 | if connections.isEmpty { 46 | return 47 | } 48 | Set(connections.keys).symmetricDifference(keys).forEach(delete(_:)) 49 | } 50 | 51 | private func insert(_ connection: RvcStatus) { 52 | let key = connection.name 53 | _connections[key] = connection 54 | NotificationCenter.default.post(name: .RvcConnectionInserted, object: connection) 55 | } 56 | 57 | private func update(_ newConnection: RvcStatus) { 58 | let connection = connections[newConnection.name]! 59 | 60 | if connection.status != newConnection.status { 61 | connection.status = newConnection.status 62 | } 63 | if connection.ovpnStatus != newConnection.ovpnStatus { 64 | connection.ovpnStatus = newConnection.ovpnStatus 65 | } 66 | if connection.inTotal != newConnection.inTotal { 67 | connection.inTotal = newConnection.inTotal 68 | } 69 | if connection.outTotal != newConnection.outTotal { 70 | connection.outTotal = newConnection.outTotal 71 | } 72 | if connection.timestamp != newConnection.timestamp { 73 | connection.timestamp = newConnection.timestamp 74 | } 75 | } 76 | 77 | private func contains(_ key: String) -> Bool { 78 | return _connections.keys.contains(key) 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /rvcmac/Util/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Util/.gitkeep -------------------------------------------------------------------------------- /rvcmac/Util/LoginItemsController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // LoginItemsController.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 25/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | 11 | class LoginItemsController { 12 | 13 | var appUrl: NSURL { 14 | get { 15 | return NSURL(fileURLWithPath: Bundle.main.bundlePath) 16 | } 17 | } 18 | 19 | func add() { 20 | add(appUrl) 21 | } 22 | 23 | func remove() { 24 | remove(appUrl) 25 | } 26 | 27 | func exists() -> Bool { 28 | return exists(appUrl) 29 | } 30 | 31 | // MARK: - Util 32 | 33 | private func loginItems() -> LSSharedFileList? { 34 | let allocator: CFAllocator! = CFAllocatorGetDefault().takeUnretainedValue() 35 | let kLoginItems: CFString! = kLSSharedFileListSessionLoginItems.takeUnretainedValue() 36 | let list = LSSharedFileListCreate(allocator, kLoginItems, nil) 37 | return list?.takeRetainedValue() 38 | } 39 | 40 | private func existingItem(_ url: NSURL) -> LSSharedFileListItem? { 41 | guard let loginItems = loginItems() else { 42 | return nil 43 | } 44 | 45 | var seed: UInt32 = 0 46 | let currentItems = LSSharedFileListCopySnapshot(loginItems, &seed).takeRetainedValue() as NSArray 47 | 48 | for case let item as LSSharedFileListItem in currentItems { 49 | if let itemUrl = LSSharedFileListItemCopyResolvedURL(item, UInt32(kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes), nil)?.takeRetainedValue() as? NSURL, itemUrl.isEqual(url) { 50 | return item 51 | } 52 | } 53 | 54 | return nil 55 | } 56 | 57 | private func exists(_ url: NSURL) -> Bool { 58 | return existingItem(url) != nil 59 | } 60 | 61 | private func add(_ url: NSURL) { 62 | guard let loginItems = loginItems() else { 63 | return 64 | } 65 | if existingItem(url) != nil { 66 | return 67 | } 68 | LSSharedFileListInsertItemURL(loginItems, kLSSharedFileListItemBeforeFirst.takeUnretainedValue(), nil, nil, url as CFURL, nil, nil) 69 | } 70 | 71 | private func remove(_ url: NSURL) { 72 | guard let loginItems = loginItems() else { 73 | return 74 | } 75 | guard let item = existingItem(url) else { 76 | return 77 | } 78 | LSSharedFileListItemRemove(loginItems, item) 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /rvcmac/Util/NSColor+Ribose.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSColor+Ribose.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Foundation 10 | import AppKit 11 | import SwiftHEXColors 12 | 13 | extension NSColor: RiboseExtensionsProvider {} 14 | 15 | extension Ribose where Base: NSColor { 16 | 17 | static var disconnected: NSColor { 18 | return NSColor(hexString: "e0ffff", alpha: 0.5)! 19 | } 20 | 21 | static var connecting: NSColor { 22 | return NSColor(hexString: "ffff33")! 23 | } 24 | 25 | static var connected: NSColor { 26 | return NSColor(hexString: "50c878")! 27 | } 28 | 29 | static var error: NSColor { 30 | return NSColor(hexString: "d10047")! 31 | } 32 | 33 | static var buttonTextNormal: NSColor { 34 | return NSColor.darkGray 35 | } 36 | 37 | static var buttonTextHighlighted: NSColor { 38 | return NSColor.black 39 | } 40 | 41 | static var buttonImageNormal: NSColor { 42 | return NSColor.darkGray 43 | } 44 | 45 | static var buttonImageHighlighted: NSColor { 46 | return NSColor.black 47 | } 48 | 49 | static var shadow: NSColor { 50 | return NSColor.lightGray 51 | } 52 | 53 | static var popover: NSColor { 54 | return NSColor(hexString: "eeeeee")! 55 | } 56 | 57 | } 58 | 59 | /// Extenstion proxy inspired by ReactiveCocoa sources 60 | /// Following code copy pasted from ReactiveCocoa4 61 | 62 | /// Describes a provider of reactive extensions. 63 | /// 64 | /// - note: `RiboseExtensionsProvider` is intended for extensions to types that are not owned 65 | /// by the module in order to avoid name collisions and return type 66 | /// ambiguities. 67 | protocol RiboseExtensionsProvider: class {} 68 | 69 | extension RiboseExtensionsProvider { 70 | /// A proxy which hosts reactive extensions for `self`. 71 | var ribose: Ribose { 72 | return Ribose(self) 73 | } 74 | 75 | /// A proxy which hosts static reactive extensions for the type of `self`. 76 | static var ribose: Ribose.Type { 77 | return Ribose.self 78 | } 79 | } 80 | 81 | /// A proxy which hosts Ribose extensions of `Base`. 82 | struct Ribose { 83 | /// The `Base` instance the extensions would be invoked with. 84 | let base: Base 85 | 86 | /// Construct a proxy 87 | /// 88 | /// - parameters: 89 | /// - base: The object to be proxied. 90 | fileprivate init(_ base: Base) { 91 | self.base = base 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /rvcmac/Util/NSView+BackgroundColor.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSView+BackgroundColor.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import AppKit 10 | 11 | extension NSView { 12 | 13 | var backgroundColor: NSColor? { 14 | get { 15 | if let colorRef = self.layer?.backgroundColor { 16 | return NSColor(cgColor: colorRef) 17 | } else { 18 | return nil 19 | } 20 | } 21 | set { 22 | self.wantsLayer = true 23 | self.layer?.backgroundColor = newValue?.cgColor 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rvcmac/Util/NSViewController+Identifier.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NSViewController+Identifier.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import AppKit 10 | 11 | extension NSViewController { 12 | class func identifier() -> String { 13 | return String(describing: self) 14 | } 15 | } 16 | 17 | extension NSWindowController { 18 | class func identifier() -> String { 19 | return String(describing: self) 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /rvcmac/View/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/View/.gitkeep -------------------------------------------------------------------------------- /rvcmac/View/CircleView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CircleView.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 05/08/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class CircleView: NSView { 12 | 13 | override func awakeFromNib() { 14 | super.awakeFromNib() 15 | wantsLayer = true 16 | layer!.cornerRadius = bounds.width / 2 17 | layer!.masksToBounds = true 18 | } 19 | 20 | override var wantsDefaultClipping: Bool { 21 | return true 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /rvcmac/View/FooterView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FooterView.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 29/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class FooterView: NSVisualEffectView { 12 | 13 | func configure() { 14 | wantsLayer = true 15 | layer!.shadowColor = NSColor.ribose.shadow.cgColor 16 | layer!.shadowOffset = CGSize(width: 0, height: 1) 17 | layer!.shadowRadius = 0 18 | layer!.shadowOpacity = 0.9 19 | layer!.masksToBounds = false 20 | } 21 | 22 | override func awakeFromNib() { 23 | super.awakeFromNib() 24 | configure() 25 | } 26 | 27 | override var wantsDefaultClipping: Bool { 28 | return false 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /rvcmac/View/HeaderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HeaderView.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 29/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class HeaderView: NSVisualEffectView { 12 | 13 | func configure() { 14 | wantsLayer = true 15 | layer!.shadowColor = NSColor.ribose.shadow.cgColor 16 | layer!.shadowOffset = CGSize(width: 0, height: -1) 17 | layer!.shadowRadius = 0 18 | layer!.shadowOpacity = 0.9 19 | layer!.masksToBounds = false 20 | } 21 | 22 | override func awakeFromNib() { 23 | super.awakeFromNib() 24 | configure() 25 | } 26 | 27 | override var wantsDefaultClipping: Bool { 28 | return false 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /rvcmac/View/ImageButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ImageButton.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 28/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import CocoaLumberjack 11 | 12 | class ImageButton: VpnButton { 13 | 14 | @IBInspectable var displayImage: NSImage! 15 | 16 | var view: NSView! 17 | var imageView: NSImageView! 18 | 19 | override func configure() { 20 | super.configure() 21 | 22 | view = { 23 | let view = NSView(frame: bounds) 24 | addSubview(view) 25 | 26 | self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-0-[view]-0-|", options: [], metrics: nil, views: [ 27 | "view": view 28 | ])) 29 | self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|-0-[view]-0-|", options: [], metrics: nil, views: [ 30 | "view": view 31 | ])) 32 | return view 33 | }() 34 | 35 | imageView = { 36 | let imageView = NSImageView(image: displayImage.tinted(NSColor.ribose.buttonImageNormal)) 37 | imageView.frame = view.bounds 38 | imageView.translatesAutoresizingMaskIntoConstraints = false 39 | view.addSubview(imageView) 40 | 41 | view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .width, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 18)) 42 | view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .height, relatedBy: .equal, toItem: nil, attribute: .notAnAttribute, multiplier: 1.0, constant: 18)) 43 | view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .centerX, relatedBy: .equal, toItem: view, attribute: .centerX, multiplier: 1.0, constant: 0)) 44 | view.addConstraint(NSLayoutConstraint(item: imageView, attribute: .centerY, relatedBy: .equal, toItem: view, attribute: .centerY, multiplier: 1.0, constant: 0)) 45 | 46 | return imageView 47 | }() 48 | } 49 | 50 | override var isPressed: Bool { 51 | get { 52 | return super.isPressed 53 | } 54 | set { 55 | super.isPressed = newValue 56 | if newValue { 57 | DDLogInfo("Set highlighted") 58 | imageView.image = displayImage.tinted(NSColor.ribose.buttonImageHighlighted) 59 | } else { 60 | DDLogInfo("Set normal") 61 | imageView.image = displayImage.tinted(NSColor.ribose.buttonImageNormal) 62 | } 63 | } 64 | } 65 | 66 | } 67 | 68 | extension NSImage { 69 | func tinted(_ color: NSColor) -> NSImage { 70 | let tinted = self.copy() as! NSImage 71 | tinted.lockFocus() 72 | color.set() 73 | 74 | let imageRect = NSRect(origin: .zero, size: tinted.size) 75 | imageRect.fill(using: .sourceAtop) 76 | 77 | tinted.unlockFocus() 78 | return tinted 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /rvcmac/View/TextButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TextButton.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 28/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class TextButton: VpnButton { 12 | 13 | @IBInspectable var text: String! { 14 | didSet { 15 | textField?.stringValue = text 16 | } 17 | } 18 | 19 | var view: NSView! 20 | var textField: NSTextField! 21 | 22 | override func configure() { 23 | super.configure() 24 | 25 | view = { 26 | let view = NSView(frame: bounds) 27 | addSubview(view) 28 | 29 | self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "H:|-0-[view]-0-|", options: [], metrics: nil, views: [ 30 | "view": view 31 | ])) 32 | self.addConstraints(NSLayoutConstraint.constraints(withVisualFormat: "V:|-0-[view]-0-|", options: [], metrics: nil, views: [ 33 | "view": view 34 | ])) 35 | return view 36 | }() 37 | 38 | textField = { 39 | let textField = NSTextField(labelWithString: text) 40 | textField.font = NSFont.systemFont(ofSize: 11) 41 | textField.textColor = NSColor.ribose.buttonTextNormal 42 | textField.translatesAutoresizingMaskIntoConstraints = false 43 | view.addSubview(textField) 44 | 45 | view.addConstraint(NSLayoutConstraint(item: textField, attribute: .centerX, relatedBy: .equal, toItem: view, attribute: .centerX, multiplier: 1.0, constant: 0)) 46 | view.addConstraint(NSLayoutConstraint(item: textField, attribute: .centerY, relatedBy: .equal, toItem: view, attribute: .centerY, multiplier: 1.0, constant: 0)) 47 | 48 | return textField 49 | }() 50 | } 51 | 52 | override var isPressed: Bool { 53 | get { 54 | return super.isPressed 55 | } 56 | set { 57 | super.isPressed = newValue 58 | if isPressed { 59 | textField.textColor = NSColor.ribose.buttonTextHighlighted 60 | } else { 61 | textField.textColor = NSColor.ribose.buttonTextNormal 62 | } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /rvcmac/View/VpnButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnButton.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 28/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import CocoaLumberjack 11 | 12 | class VpnButton: NSButton { 13 | 14 | func configure() { 15 | DDLogInfo("\(#function)") 16 | } 17 | 18 | override init(frame frameRect: NSRect) { 19 | super.init(frame: frameRect) 20 | configure() 21 | } 22 | 23 | required init?(coder: NSCoder) { 24 | super.init(coder: coder) 25 | } 26 | 27 | override func awakeFromNib() { 28 | super.awakeFromNib() 29 | configure() 30 | } 31 | 32 | var isPressed = false 33 | 34 | override func mouseDown(with event: NSEvent) { 35 | DDLogInfo("\(#function) down") 36 | isPressed = true 37 | super.mouseDown(with: event) 38 | DDLogInfo("\(#function) up") 39 | isPressed = false 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /rvcmac/View/VpnCollectionView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnCollectionView.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class VpnCollectionView: NSCollectionView { 12 | 13 | override func awakeFromNib() { 14 | super.awakeFromNib() 15 | self.minItemSize = NSSize(width: 0, height: 0) 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /rvcmac/View/VpnContainerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnContainerView.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 29/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class VpnContainerView: NSView { 12 | 13 | override func viewDidMoveToWindow() { 14 | guard let frameView = window?.contentView?.superview else { 15 | return 16 | } 17 | 18 | let backgroundView = NSView(frame: frameView.bounds) 19 | backgroundView.wantsLayer = true 20 | backgroundView.layer?.backgroundColor = NSColor.ribose.popover.cgColor 21 | backgroundView.autoresizingMask = [.width, .height] 22 | backgroundView.translatesAutoresizingMaskIntoConstraints = true 23 | 24 | frameView.addSubview(backgroundView, positioned: .below, relativeTo: frameView) 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /rvcmac/View/VpnWindow.swift: -------------------------------------------------------------------------------- 1 | // 2 | // VpnWindow.swift 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | class VpnWindow: NSWindow { 12 | 13 | override func awakeFromNib() { 14 | super.awakeFromNib() 15 | self.titleVisibility = .hidden 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /rvcmac/Viewmodel/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riboseinc/cryptode-mac/1aba9865ea9d9507782767d537991e92bf03f08b/rvcmac/Viewmodel/.gitkeep -------------------------------------------------------------------------------- /rvcmac/bridging_header.h: -------------------------------------------------------------------------------- 1 | // 2 | // bridging_header.h 3 | // rvcmac 4 | // 5 | // Created by Nikita Titov on 14/09/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | #ifndef bridging_header_h 10 | #define bridging_header_h 11 | 12 | #include 13 | #include "common.h" 14 | #include "rvc_shared.h" 15 | 16 | int rvc_get_status(const char * _Nonnull, int, char * _Nonnull * _Nonnull); 17 | int rvc_connect(const char * _Nonnull, int, char * _Nonnull * _Nonnull); 18 | int rvc_disconnect(const char * _Nonnull, int, char * _Nonnull * _Nonnull); 19 | 20 | #endif /* bridging_header_h */ 21 | -------------------------------------------------------------------------------- /rvcmac/rvcmac.xcdatamodeld/rvcmac.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /rvcmacTests/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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /rvcmacTests/rvcmacTests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // rvcmacTests.swift 3 | // rvcmacTests 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | @testable import rvcmac 11 | 12 | class RvcmacTests: XCTestCase { 13 | 14 | override func setUp() { 15 | super.setUp() 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | } 18 | 19 | override func tearDown() { 20 | // Put teardown code here. This method is called after the invocation of each test method in the class. 21 | super.tearDown() 22 | } 23 | 24 | func testExample() { 25 | // This is an example of a functional test case. 26 | // Use XCTAssert and related functions to verify your tests produce the correct results. 27 | } 28 | 29 | func testPerformanceExample() { 30 | // This is an example of a performance test case. 31 | self.measure { 32 | // Put the code you want to measure the time of here. 33 | } 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /rvcmacUITests/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 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /rvcmacUITests/rvcmacUITests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // rvcmacUITests.swift 3 | // rvcmacUITests 4 | // 5 | // Created by Nikita Titov on 22/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | import XCTest 10 | 11 | class RvcmacUITests: XCTestCase { 12 | 13 | override func setUp() { 14 | super.setUp() 15 | 16 | // Put setup code here. This method is called before the invocation of each test method in the class. 17 | 18 | // In UI tests it is usually best to stop immediately when a failure occurs. 19 | continueAfterFailure = false 20 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 21 | XCUIApplication().launch() 22 | 23 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 24 | } 25 | 26 | override func tearDown() { 27 | // Put teardown code here. This method is called after the invocation of each test method in the class. 28 | super.tearDown() 29 | } 30 | 31 | func testExample() { 32 | // Use recording to get started writing UI tests. 33 | // Use XCTAssert and related functions to verify your tests produce the correct results. 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /rvcmachelper/rvcmachelper/HelperAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // HelperAppDelegate.h 3 | // rvcmachelper 4 | // 5 | // Created by Nikita Titov on 24/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // This autostart method is not used at the moment. 12 | // See ../../rvcmac/Util/LoginItemsController.swift 13 | @interface HelperAppDelegate : NSObject 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /rvcmachelper/rvcmachelper/HelperAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // HelperAppDelegate.m 3 | // rvcmachelper 4 | // 5 | // Created by Nikita Titov on 24/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | #import "HelperAppDelegate.h" 10 | 11 | // This autostart method is not used at the moment. 12 | // See ../../rvcmac/Util/LoginItemsController.swift 13 | @interface HelperAppDelegate () 14 | 15 | @end 16 | 17 | @implementation HelperAppDelegate 18 | 19 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { 20 | 21 | for (NSRunningApplication *running in NSWorkspace.sharedWorkspace.runningApplications) { 22 | if ([@"com.ribose.rvcmac" isEqualToString:running.bundleIdentifier]) { 23 | NSLog(@"rvcmac is already running"); 24 | [NSApp terminate:nil]; 25 | return; 26 | } 27 | } 28 | 29 | NSMutableArray *pathComponents = NSBundle.mainBundle.bundlePath.pathComponents.mutableCopy; 30 | [pathComponents removeLastObject]; 31 | [pathComponents removeLastObject]; 32 | [pathComponents removeLastObject]; 33 | [pathComponents addObject:@"MacOS"]; 34 | [pathComponents addObject:@"rvcmac"]; 35 | NSString *path = [NSString pathWithComponents:pathComponents]; 36 | NSURL *url = [NSURL fileURLWithPath:path]; 37 | 38 | NSError *error; 39 | if (![NSWorkspace.sharedWorkspace launchApplicationAtURL:url 40 | options:kNilOptions 41 | configuration:@{NSWorkspaceLaunchConfigurationArguments: @[@"autoload"]} 42 | error:&error]) { 43 | NSLog(@"Could not load application: %@", error.localizedDescription); 44 | } 45 | 46 | [NSApp terminate:nil]; 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /rvcmachelper/rvcmachelper/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 | CFBundleVersion 22 | 1 23 | LSApplicationCategoryType 24 | public.app-category.utilities 25 | LSBackgroundOnly 26 | 27 | LSMinimumSystemVersion 28 | $(MACOSX_DEPLOYMENT_TARGET) 29 | NSHumanReadableCopyright 30 | Copyright © 2017 Ribose. All rights reserved. 31 | NSPrincipalClass 32 | NSApplication 33 | 34 | 35 | -------------------------------------------------------------------------------- /rvcmachelper/rvcmachelper/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // rvcmachelper 4 | // 5 | // Created by Nikita Titov on 24/07/2017. 6 | // Copyright © 2017 Ribose. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "HelperAppDelegate.h" 11 | 12 | // This autostart method is not used at the moment. 13 | // See ../../rvcmac/Util/LoginItemsController.swift 14 | int main(int argc, const char * argv[]) { 15 | NSApplication *application = NSApplication.sharedApplication; 16 | HelperAppDelegate *delegate = [[HelperAppDelegate alloc] init]; 17 | application.delegate = delegate; 18 | return NSApplicationMain(argc, argv); 19 | } 20 | -------------------------------------------------------------------------------- /update_submodules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | git submodule update --recursive --remote 3 | 4 | --------------------------------------------------------------------------------