diff --git a/.gitignore b/.gitignore index 98e6ef67f..a373c8ce3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ *.db +xcuserdata +Pods/ diff --git a/apps/ios/DuoApp/DuoApp.xcodeproj/project.pbxproj b/apps/ios/DuoApp/DuoApp.xcodeproj/project.pbxproj index d45f5be6e..f6992e551 100644 --- a/apps/ios/DuoApp/DuoApp.xcodeproj/project.pbxproj +++ b/apps/ios/DuoApp/DuoApp.xcodeproj/project.pbxproj @@ -48,6 +48,7 @@ /* Begin PBXFileReference section */ 0F1DB515EE056F0A63BADC95 /* Pods_RedBear_Duo.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RedBear_Duo.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 323FE57F1B24FBA4CDBA837C /* Pods-RedBear Duo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RedBear Duo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RedBear Duo/Pods-RedBear Duo.debug.xcconfig"; sourceTree = ""; }; + 3CC27F78232B247F00821917 /* RedBear Duo.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "RedBear Duo.entitlements"; sourceTree = ""; }; A11192BB9B67DB6D79B23387 /* Pods-RedBear Duo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RedBear Duo.release.xcconfig"; path = "Pods/Target Support Files/Pods-RedBear Duo/Pods-RedBear Duo.release.xcconfig"; sourceTree = ""; }; A30638AC1D3BC236005499B0 /* AccessPoint.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccessPoint.swift; sourceTree = ""; }; A30638AE1D3CA928005499B0 /* RBDuoNavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RBDuoNavigationController.swift; sourceTree = ""; }; @@ -134,6 +135,7 @@ A31761911D38D76100C52912 = { isa = PBXGroup; children = ( + 3CC27F78232B247F00821917 /* RedBear Duo.entitlements */, A317619C1D38D76100C52912 /* DuoApp */, A317619B1D38D76100C52912 /* Products */, FAF04A82E8E7E4BE0976664F /* Frameworks */, @@ -258,7 +260,6 @@ A31761981D38D76100C52912 /* Resources */, A3AE6D921D559F450019913A /* ShellScript */, 69B916691F3E890858106E78 /* [CP] Embed Pods Frameworks */, - 2D3AB72E9F0196B41EC3D5CB /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -275,13 +276,17 @@ A31761921D38D76100C52912 /* Project object */ = { isa = PBXProject; attributes = { + KnownAssetTags = ( + 123, + 321, + ); LastSwiftUpdateCheck = 0730; - LastUpgradeCheck = 0810; + LastUpgradeCheck = 1100; ORGANIZATIONNAME = RedBear; TargetAttributes = { A31761991D38D76100C52912 = { CreatedOnToolsVersion = 7.3.1; - DevelopmentTeam = GLKR323QE8; + DevelopmentTeam = 3UDY2NT62F; LastSwiftMigration = 0810; SystemCapabilities = { com.apple.BackgroundModes = { @@ -293,7 +298,7 @@ }; buildConfigurationList = A31761951D38D76100C52912 /* Build configuration list for PBXProject "DuoApp" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -334,28 +339,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RedBear Duo-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; - showEnvVarsInLog = 0; - }; - 2D3AB72E9F0196B41EC3D5CB /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RedBear Duo/Pods-RedBear Duo-resources.sh\"\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 69B916691F3E890858106E78 /* [CP] Embed Pods Frameworks */ = { @@ -364,13 +357,26 @@ files = ( ); inputPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RedBear Duo/Pods-RedBear Duo-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/1PasswordExtension/OnePasswordExtension.framework", + "${BUILT_PRODUCTS_DIR}/AFNetworking/AFNetworking.framework", + "${BUILT_PRODUCTS_DIR}/RWDropdownMenu/RWDropdownMenu.framework", + "${BUILT_PRODUCTS_DIR}/SSZipArchive/SSZipArchive.framework", + "${BUILT_PRODUCTS_DIR}/Spark-SDK/Spark_SDK.framework", + "${BUILT_PRODUCTS_DIR}/SparkSetup/SparkSetup.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/OnePasswordExtension.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AFNetworking.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RWDropdownMenu.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SSZipArchive.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Spark_SDK.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SparkSetup.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RedBear Duo/Pods-RedBear Duo-frameworks.sh\"\n"; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RedBear Duo/Pods-RedBear Duo-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; A3AE6D921D559F450019913A /* ShellScript */ = { @@ -384,7 +390,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Fabric/run\" c7de6906d4936ce6c4c811e60089d5ee0b544e0a c36bc2c5bd0fac54716fdec96fc7e077b316be54487f79815b5426e883cb9f74"; + shellScript = "\"${PODS_ROOT}/Fabric/run\" c7de6906d4936ce6c4c811e60089d5ee0b544e0a c36bc2c5bd0fac54716fdec96fc7e077b316be54487f79815b5426e883cb9f74\n"; }; /* End PBXShellScriptBuildPhase section */ @@ -468,20 +474,28 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -503,6 +517,7 @@ ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; @@ -517,14 +532,22 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -545,6 +568,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -556,17 +580,18 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = "RedBear Duo.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + DEVELOPMENT_TEAM = 3UDY2NT62F; INFOPLIST_FILE = DuoApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = cc.redbear.product.duo; + PRODUCT_BUNDLE_IDENTIFIER = adorkable.cc.redbear.product.duo; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "DuoApp/RedBear Duo-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 3.0; }; name = Debug; }; @@ -576,16 +601,16 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = "RedBear Duo.entitlements"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; INFOPLIST_FILE = DuoApp/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.3; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = cc.redbear.product.duo; + PRODUCT_BUNDLE_IDENTIFIER = adorkable.cc.redbear.product.duo; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE = ""; SWIFT_OBJC_BRIDGING_HEADER = "DuoApp/RedBear Duo-Bridging-Header.h"; - SWIFT_VERSION = 3.0; }; name = Release; }; diff --git a/apps/ios/DuoApp/DuoApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/apps/ios/DuoApp/DuoApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 000000000..18d981003 --- /dev/null +++ b/apps/ios/DuoApp/DuoApp.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/apps/ios/DuoApp/DuoApp/AppDelegate.swift b/apps/ios/DuoApp/DuoApp/AppDelegate.swift index db2d5189b..1665daa67 100644 --- a/apps/ios/DuoApp/DuoApp/AppDelegate.swift +++ b/apps/ios/DuoApp/DuoApp/AppDelegate.swift @@ -16,7 +16,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. application.registerUserNotificationSettings(UIUserNotificationSettings(types: [.sound , .badge , .alert], categories: nil)) diff --git a/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Contents.json index 13929fcb3..4da71348b 100644 --- a/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,8 +1,9 @@ { "images" : [ { - "idiom" : "iphone", "size" : "20x20", + "idiom" : "iphone", + "filename" : "Icon-App-20x20@2x-1.png", "scale" : "2x" }, { @@ -58,8 +59,9 @@ "scale" : "1x" }, { - "idiom" : "ipad", "size" : "20x20", + "idiom" : "ipad", + "filename" : "Icon-App-20x20@2x-2.png", "scale" : "2x" }, { @@ -77,7 +79,7 @@ { "size" : "40x40", "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", + "filename" : "Icon-App-40x40@1x-1.png", "scale" : "1x" }, { @@ -104,6 +106,11 @@ "filename" : "Icon-App-83.5x83.5@2x.png", "scale" : "2x" }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + }, { "size" : "40x40", "idiom" : "iphone", diff --git a/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png new file mode 100644 index 000000000..de5956161 Binary files /dev/null and b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-1.png differ diff --git a/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-2.png b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-2.png new file mode 100644 index 000000000..de5956161 Binary files /dev/null and b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x-2.png differ diff --git a/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png new file mode 100644 index 000000000..de5956161 Binary files /dev/null and b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png differ diff --git a/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x-1.png b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x-1.png new file mode 100644 index 000000000..de5956161 Binary files /dev/null and b/apps/ios/DuoApp/DuoApp/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x-1.png differ diff --git a/apps/ios/DuoApp/DuoApp/BLEFramework/BLE/BLE.swift b/apps/ios/DuoApp/DuoApp/BLEFramework/BLE/BLE.swift index f0694e001..c78e5b3f0 100755 --- a/apps/ios/DuoApp/DuoApp/BLEFramework/BLE/BLE.swift +++ b/apps/ios/DuoApp/DuoApp/BLEFramework/BLE/BLE.swift @@ -93,7 +93,7 @@ class BLE: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate { centralManager?.scanForPeripherals(withServices: services, options: nil) } } - func stopScan() { + @objc func stopScan() { print("Stop Scanning") centralManager?.stopScan() isScanning = false @@ -132,8 +132,8 @@ class BLE: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate { print("Set AP Info") var buff = [UInt8]() - let passLen = password.characters.count - let len:UInt8 = 9 + UInt8(passLen) + UInt8(ap.ssid.characters.count) + let passLen = password.count + let len:UInt8 = 9 + UInt8(passLen) + UInt8(ap.ssid.count) buff += [len, BLE_PROVISION_COMMAND_CONFIG_AP, ap.channel] @@ -141,12 +141,12 @@ class BLE: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate { buff += [UInt8(ap.security & 0xff), UInt8((ap.security & 0xff00) >> 8), UInt8((ap.security & 0xff0000) >> 16), UInt8((ap.security >> 24) & 0xff)] // ssid length - buff += [UInt8(ap.ssid.characters.count)] + buff += [UInt8(ap.ssid.count)] // ssid buff += ap.ssid.utf8 // password - buff += [UInt8(password.characters.count)] + buff += [UInt8(password.count)] buff += password.utf8 let data = Data.init(bytes: UnsafePointer(buff),count: buff.count) @@ -204,7 +204,7 @@ class BLE: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate { func peripheral(_ peripheral: CBPeripheral, didUpdateNotificationStateFor characteristic: CBCharacteristic, error: Error?) { - print(error) + print("\(String(describing: error))") // if characteristic.isNotifying { // activePeripheral!.readValueForCharacteristic(characteristic) // } @@ -218,7 +218,7 @@ class BLE: NSObject, CBCentralManagerDelegate, CBPeripheralDelegate { } let data = characteristic.value - print("\(data)") + print("\(String(describing: data))") let resultBytes:[UInt8] = Array(UnsafeBufferPointer(start: (data! as NSData).bytes.bindMemory(to: UInt8.self, capacity: data!.count), count: data!.count)) diff --git a/apps/ios/DuoApp/DuoApp/Base.lproj/Main.storyboard b/apps/ios/DuoApp/DuoApp/Base.lproj/Main.storyboard index 1a22e8319..debfe27af 100644 --- a/apps/ios/DuoApp/DuoApp/Base.lproj/Main.storyboard +++ b/apps/ios/DuoApp/DuoApp/Base.lproj/Main.storyboard @@ -1,10 +1,10 @@ - - + + + - - - + + @@ -17,43 +17,43 @@ - + - - + + - + - + - + - + @@ -444,52 +444,52 @@ - + - + - + - + - + - + - + - - - + + + @@ -501,13 +501,13 @@ - + @@ -549,13 +549,13 @@