diff --git a/TrackIT-master/README.md b/TrackIT-master/README.md new file mode 100644 index 0000000..2f4bde7 --- /dev/null +++ b/TrackIT-master/README.md @@ -0,0 +1,12 @@ +# TrackIT +Open source mobile app to help track proximity contacts using powerful bluetooth technology + +### How does it work + +App uses bluetooth functionalities of your phone to scan as many devices in certain area as possible. When app scans the device it stores it into memory. + +App is saving scanned devices with their special id identifier. Identifier can be put as compromised by only officials who are conducting tests then notification arrives for the user who have been in close proximity of the infected identifier , saying that he needs to give all necessary contact information to officials and to stay home. + +If user is signed trough system as "isolated" and comes in proximity of other devices officials will be notified of that health breach. + + diff --git a/TrackIT-master/TrackIT.xcodeproj/project.pbxproj b/TrackIT-master/TrackIT.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ebc0915 --- /dev/null +++ b/TrackIT-master/TrackIT.xcodeproj/project.pbxproj @@ -0,0 +1,440 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 52; + objects = { + +/* Begin PBXBuildFile section */ + 84D7D868242D57D000B2710E /* Lottie in Frameworks */ = {isa = PBXBuildFile; productRef = 84D7D867242D57D000B2710E /* Lottie */; }; + 84D7D86C242D59CF00B2710E /* HexToString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84D7D86B242D59CF00B2710E /* HexToString.swift */; }; + E16EA159242D36C200B0BE1F /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E16EA158242D36C100B0BE1F /* SettingsViewController.swift */; }; + E1E55B58242C118B00FFAA8A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E55B57242C118B00FFAA8A /* AppDelegate.swift */; }; + E1E55B5A242C118B00FFAA8A /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E55B59242C118B00FFAA8A /* SceneDelegate.swift */; }; + E1E55B5C242C118B00FFAA8A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E1E55B5B242C118B00FFAA8A /* ViewController.swift */; }; + E1E55B5F242C118B00FFAA8A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E1E55B5D242C118B00FFAA8A /* Main.storyboard */; }; + E1E55B61242C119500FFAA8A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E1E55B60242C119500FFAA8A /* Assets.xcassets */; }; + E1E55B64242C119500FFAA8A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E1E55B62242C119500FFAA8A /* LaunchScreen.storyboard */; }; + E1E55B88242C121D00FFAA8A /* lf30_editor_SKZ870.json in Resources */ = {isa = PBXBuildFile; fileRef = E1E55B87242C121D00FFAA8A /* lf30_editor_SKZ870.json */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 84D7D862242D56B000B2710E /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 84D7D86B242D59CF00B2710E /* HexToString.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HexToString.swift; sourceTree = ""; }; + E16EA158242D36C100B0BE1F /* SettingsViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = ""; }; + E1E55B54242C118B00FFAA8A /* TrackIT.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TrackIT.app; sourceTree = BUILT_PRODUCTS_DIR; }; + E1E55B57242C118B00FFAA8A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + E1E55B59242C118B00FFAA8A /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; }; + E1E55B5B242C118B00FFAA8A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + E1E55B5E242C118B00FFAA8A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + E1E55B60242C119500FFAA8A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + E1E55B63242C119500FFAA8A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + E1E55B65242C119500FFAA8A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E1E55B87242C121D00FFAA8A /* lf30_editor_SKZ870.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = lf30_editor_SKZ870.json; sourceTree = ""; }; + E1E55B8E242C2C5A00FFAA8A /* TrackIT.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = TrackIT.entitlements; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + E1E55B51242C118B00FFAA8A /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 84D7D868242D57D000B2710E /* Lottie in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 84D7D869242D59A400B2710E /* helpers */ = { + isa = PBXGroup; + children = ( + 84D7D86A242D59AE00B2710E /* view */, + ); + path = helpers; + sourceTree = ""; + }; + 84D7D86A242D59AE00B2710E /* view */ = { + isa = PBXGroup; + children = ( + 84D7D86B242D59CF00B2710E /* HexToString.swift */, + ); + path = view; + sourceTree = ""; + }; + 84D7D86D242D59F500B2710E /* services */ = { + isa = PBXGroup; + children = ( + E1E55B59242C118B00FFAA8A /* SceneDelegate.swift */, + E1E55B57242C118B00FFAA8A /* AppDelegate.swift */, + ); + path = services; + sourceTree = ""; + }; + 84D7D86E242D5A3600B2710E /* controllers */ = { + isa = PBXGroup; + children = ( + E16EA158242D36C100B0BE1F /* SettingsViewController.swift */, + E1E55B5B242C118B00FFAA8A /* ViewController.swift */, + ); + path = controllers; + sourceTree = ""; + }; + 84D7D870242D5A8800B2710E /* view */ = { + isa = PBXGroup; + children = ( + E1E55B62242C119500FFAA8A /* LaunchScreen.storyboard */, + E1E55B5D242C118B00FFAA8A /* Main.storyboard */, + ); + path = view; + sourceTree = ""; + }; + E1E55B4B242C118A00FFAA8A = { + isa = PBXGroup; + children = ( + E1E55B56242C118B00FFAA8A /* TrackIT */, + E1E55B55242C118B00FFAA8A /* Products */, + ); + sourceTree = ""; + }; + E1E55B55242C118B00FFAA8A /* Products */ = { + isa = PBXGroup; + children = ( + E1E55B54242C118B00FFAA8A /* TrackIT.app */, + ); + name = Products; + sourceTree = ""; + }; + E1E55B56242C118B00FFAA8A /* TrackIT */ = { + isa = PBXGroup; + children = ( + E1E55B87242C121D00FFAA8A /* lf30_editor_SKZ870.json */, + E1E55B8E242C2C5A00FFAA8A /* TrackIT.entitlements */, + 84D7D869242D59A400B2710E /* helpers */, + 84D7D86D242D59F500B2710E /* services */, + 84D7D86E242D5A3600B2710E /* controllers */, + 84D7D870242D5A8800B2710E /* view */, + E1E55B60242C119500FFAA8A /* Assets.xcassets */, + E1E55B65242C119500FFAA8A /* Info.plist */, + ); + path = TrackIT; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + E1E55B53242C118B00FFAA8A /* TrackIT */ = { + isa = PBXNativeTarget; + buildConfigurationList = E1E55B7E242C119500FFAA8A /* Build configuration list for PBXNativeTarget "TrackIT" */; + buildPhases = ( + E1E55B50242C118B00FFAA8A /* Sources */, + E1E55B51242C118B00FFAA8A /* Frameworks */, + E1E55B52242C118B00FFAA8A /* Resources */, + 84D7D862242D56B000B2710E /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = TrackIT; + packageProductDependencies = ( + 84D7D867242D57D000B2710E /* Lottie */, + ); + productName = TrackIT; + productReference = E1E55B54242C118B00FFAA8A /* TrackIT.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + E1E55B4C242C118A00FFAA8A /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1130; + LastUpgradeCheck = 1130; + ORGANIZATIONNAME = "Steve Ink"; + TargetAttributes = { + E1E55B53242C118B00FFAA8A = { + CreatedOnToolsVersion = 11.3; + }; + }; + }; + buildConfigurationList = E1E55B4F242C118A00FFAA8A /* Build configuration list for PBXProject "TrackIT" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = E1E55B4B242C118A00FFAA8A; + packageReferences = ( + 84D7D866242D57D000B2710E /* XCRemoteSwiftPackageReference "lottie-ios" */, + ); + productRefGroup = E1E55B55242C118B00FFAA8A /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + E1E55B53242C118B00FFAA8A /* TrackIT */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + E1E55B52242C118B00FFAA8A /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E1E55B88242C121D00FFAA8A /* lf30_editor_SKZ870.json in Resources */, + E1E55B64242C119500FFAA8A /* LaunchScreen.storyboard in Resources */, + E1E55B61242C119500FFAA8A /* Assets.xcassets in Resources */, + E1E55B5F242C118B00FFAA8A /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + E1E55B50242C118B00FFAA8A /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E1E55B5C242C118B00FFAA8A /* ViewController.swift in Sources */, + E16EA159242D36C200B0BE1F /* SettingsViewController.swift in Sources */, + E1E55B58242C118B00FFAA8A /* AppDelegate.swift in Sources */, + 84D7D86C242D59CF00B2710E /* HexToString.swift in Sources */, + E1E55B5A242C118B00FFAA8A /* SceneDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + E1E55B5D242C118B00FFAA8A /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E1E55B5E242C118B00FFAA8A /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + E1E55B62242C119500FFAA8A /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + E1E55B63242C119500FFAA8A /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + E1E55B7C242C119500FFAA8A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = 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_DOCUMENTATION_COMMENTS = YES; + 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + E1E55B7D242C119500FFAA8A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = 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_DOCUMENTATION_COMMENTS = YES; + 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_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 13.2; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + E1E55B7F242C119500FFAA8A /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = TrackIT/TrackIT.entitlements; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = MC27HKM86M; + INFOPLIST_FILE = TrackIT/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.nedim; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + E1E55B80242C119500FFAA8A /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = TrackIT/TrackIT.entitlements; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = MC27HKM86M; + INFOPLIST_FILE = TrackIT/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.nedim; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + E1E55B4F242C118A00FFAA8A /* Build configuration list for PBXProject "TrackIT" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E1E55B7C242C119500FFAA8A /* Debug */, + E1E55B7D242C119500FFAA8A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + E1E55B7E242C119500FFAA8A /* Build configuration list for PBXNativeTarget "TrackIT" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E1E55B7F242C119500FFAA8A /* Debug */, + E1E55B80242C119500FFAA8A /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 84D7D866242D57D000B2710E /* XCRemoteSwiftPackageReference "lottie-ios" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/airbnb/lottie-ios.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 3.1.6; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 84D7D867242D57D000B2710E /* Lottie */ = { + isa = XCSwiftPackageProductDependency; + package = 84D7D866242D57D000B2710E /* XCRemoteSwiftPackageReference "lottie-ios" */; + productName = Lottie; + }; +/* End XCSwiftPackageProductDependency section */ + }; + rootObject = E1E55B4C242C118A00FFAA8A /* Project object */; +} diff --git a/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..23f5250 --- /dev/null +++ b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "Lottie", + "repositoryURL": "https://github.com/airbnb/lottie-ios.git", + "state": { + "branch": null, + "revision": "8f81de8d81da8631fd95ff81a9db133b76e13ea4", + "version": "3.1.6" + } + } + ] + }, + "version": 1 +} diff --git a/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0bfe6dc Binary files /dev/null and b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcuserdata/andreas.xcuserdatad/UserInterfaceState.xcuserstate b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcuserdata/andreas.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..ff01ecd Binary files /dev/null and b/TrackIT-master/TrackIT.xcodeproj/project.xcworkspace/xcuserdata/andreas.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TrackIT-master/TrackIT.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist b/TrackIT-master/TrackIT.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..fa5e3b2 --- /dev/null +++ b/TrackIT-master/TrackIT.xcodeproj/xcuserdata/admin.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + TrackIT.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/TrackIT-master/TrackIT.xcodeproj/xcuserdata/andreas.xcuserdatad/xcschemes/xcschememanagement.plist b/TrackIT-master/TrackIT.xcodeproj/xcuserdata/andreas.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..fa5e3b2 --- /dev/null +++ b/TrackIT-master/TrackIT.xcodeproj/xcuserdata/andreas.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + TrackIT.xcscheme_^#shared#^_ + + orderHint + 0 + + + + diff --git a/TrackIT-master/TrackIT.xcworkspace/contents.xcworkspacedata b/TrackIT-master/TrackIT.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..2ead5e4 --- /dev/null +++ b/TrackIT-master/TrackIT.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/TrackIT-master/TrackIT.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/TrackIT-master/TrackIT.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/TrackIT-master/TrackIT.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/TrackIT-master/TrackIT.xcworkspace/xcshareddata/swiftpm/Package.resolved b/TrackIT-master/TrackIT.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..23f5250 --- /dev/null +++ b/TrackIT-master/TrackIT.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,16 @@ +{ + "object": { + "pins": [ + { + "package": "Lottie", + "repositoryURL": "https://github.com/airbnb/lottie-ios.git", + "state": { + "branch": null, + "revision": "8f81de8d81da8631fd95ff81a9db133b76e13ea4", + "version": "3.1.6" + } + } + ] + }, + "version": 1 +} diff --git a/TrackIT-master/TrackIT.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate b/TrackIT-master/TrackIT.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..5b2f6fb Binary files /dev/null and b/TrackIT-master/TrackIT.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TrackIT-master/TrackIT.xcworkspace/xcuserdata/andreas.xcuserdatad/UserInterfaceState.xcuserstate b/TrackIT-master/TrackIT.xcworkspace/xcuserdata/andreas.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..714c6ac Binary files /dev/null and b/TrackIT-master/TrackIT.xcworkspace/xcuserdata/andreas.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TrackIT-master/TrackIT.xcworkspace/xcuserdata/andreas.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/TrackIT-master/TrackIT.xcworkspace/xcuserdata/andreas.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000..9eab65f --- /dev/null +++ b/TrackIT-master/TrackIT.xcworkspace/xcuserdata/andreas.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,6 @@ + + + diff --git a/TrackIT-master/TrackIT/Assets.xcassets/AppIcon.appiconset/Contents.json b/TrackIT-master/TrackIT/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/TrackIT-master/TrackIT/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TrackIT-master/TrackIT/Assets.xcassets/Contents.json b/TrackIT-master/TrackIT/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/TrackIT-master/TrackIT/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TrackIT-master/TrackIT/Assets.xcassets/Rectangle 7.imageset/Contents.json b/TrackIT-master/TrackIT/Assets.xcassets/Rectangle 7.imageset/Contents.json new file mode 100644 index 0000000..27f4621 --- /dev/null +++ b/TrackIT-master/TrackIT/Assets.xcassets/Rectangle 7.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Rectangle 7.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TrackIT-master/TrackIT/Assets.xcassets/Rectangle 7.imageset/Rectangle 7.png b/TrackIT-master/TrackIT/Assets.xcassets/Rectangle 7.imageset/Rectangle 7.png new file mode 100644 index 0000000..557e73d Binary files /dev/null and b/TrackIT-master/TrackIT/Assets.xcassets/Rectangle 7.imageset/Rectangle 7.png differ diff --git a/TrackIT-master/TrackIT/Assets.xcassets/home.imageset/69524 1.png b/TrackIT-master/TrackIT/Assets.xcassets/home.imageset/69524 1.png new file mode 100644 index 0000000..42bf33b Binary files /dev/null and b/TrackIT-master/TrackIT/Assets.xcassets/home.imageset/69524 1.png differ diff --git a/TrackIT-master/TrackIT/Assets.xcassets/home.imageset/Contents.json b/TrackIT-master/TrackIT/Assets.xcassets/home.imageset/Contents.json new file mode 100644 index 0000000..d6b711b --- /dev/null +++ b/TrackIT-master/TrackIT/Assets.xcassets/home.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "69524 1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TrackIT-master/TrackIT/Assets.xcassets/question.imageset/Contents.json b/TrackIT-master/TrackIT/Assets.xcassets/question.imageset/Contents.json new file mode 100644 index 0000000..e0f48d0 --- /dev/null +++ b/TrackIT-master/TrackIT/Assets.xcassets/question.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "PNG image-520FB3231A8C-1 1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TrackIT-master/TrackIT/Assets.xcassets/question.imageset/PNG image-520FB3231A8C-1 1.png b/TrackIT-master/TrackIT/Assets.xcassets/question.imageset/PNG image-520FB3231A8C-1 1.png new file mode 100644 index 0000000..d047c21 Binary files /dev/null and b/TrackIT-master/TrackIT/Assets.xcassets/question.imageset/PNG image-520FB3231A8C-1 1.png differ diff --git a/TrackIT-master/TrackIT/Assets.xcassets/settings.imageset/Contents.json b/TrackIT-master/TrackIT/Assets.xcassets/settings.imageset/Contents.json new file mode 100644 index 0000000..9632f73 --- /dev/null +++ b/TrackIT-master/TrackIT/Assets.xcassets/settings.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "PNG image-00F48C98FD47-1 1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TrackIT-master/TrackIT/Assets.xcassets/settings.imageset/PNG image-00F48C98FD47-1 1.png b/TrackIT-master/TrackIT/Assets.xcassets/settings.imageset/PNG image-00F48C98FD47-1 1.png new file mode 100644 index 0000000..28778b8 Binary files /dev/null and b/TrackIT-master/TrackIT/Assets.xcassets/settings.imageset/PNG image-00F48C98FD47-1 1.png differ diff --git a/TrackIT-master/TrackIT/Assets.xcassets/settings2.imageset/Contents.json b/TrackIT-master/TrackIT/Assets.xcassets/settings2.imageset/Contents.json new file mode 100644 index 0000000..9632f73 --- /dev/null +++ b/TrackIT-master/TrackIT/Assets.xcassets/settings2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "PNG image-00F48C98FD47-1 1.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TrackIT-master/TrackIT/Assets.xcassets/settings2.imageset/PNG image-00F48C98FD47-1 1.png b/TrackIT-master/TrackIT/Assets.xcassets/settings2.imageset/PNG image-00F48C98FD47-1 1.png new file mode 100644 index 0000000..06cadaf Binary files /dev/null and b/TrackIT-master/TrackIT/Assets.xcassets/settings2.imageset/PNG image-00F48C98FD47-1 1.png differ diff --git a/TrackIT-master/TrackIT/Info.plist b/TrackIT-master/TrackIT/Info.plist new file mode 100644 index 0000000..eb3c388 --- /dev/null +++ b/TrackIT-master/TrackIT/Info.plist @@ -0,0 +1,76 @@ + + + + + BGTaskSchedulerPermittedIdentifiers + + com.SO.apprefresh + com.SO.imagefetcher + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSBluetoothAlwaysUsageDescription + + NSBluetoothPeripheralUsageDescription + + UIApplicationSceneManifest + + UIApplicationSupportsMultipleScenes + + UISceneConfigurations + + UIWindowSceneSessionRoleApplication + + + UISceneConfigurationName + Default Configuration + UISceneDelegateClassName + $(PRODUCT_MODULE_NAME).SceneDelegate + UISceneStoryboardFile + Main + + + + + UIBackgroundModes + + fetch + processing + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/TrackIT-master/TrackIT/TrackIT.entitlements b/TrackIT-master/TrackIT/TrackIT.entitlements new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/TrackIT-master/TrackIT/TrackIT.entitlements @@ -0,0 +1,5 @@ + + + + + diff --git a/TrackIT-master/TrackIT/controllers/SettingsViewController.swift b/TrackIT-master/TrackIT/controllers/SettingsViewController.swift new file mode 100644 index 0000000..53acb3b --- /dev/null +++ b/TrackIT-master/TrackIT/controllers/SettingsViewController.swift @@ -0,0 +1,311 @@ +// +// settings.swift +// TrackIT +// +// Created by Laima Cernius-Ink on 3/25/20. +// Copyright © 2020 Steve Ink. All rights reserved. +// + +import UIKit +import CoreBluetooth +class settings: UIViewController { + + let home = UILabel() + let lbl = UILabel() + let lbl2 = UITextView() + let lbl3 = UILabel() + let screenSize: CGRect = UIScreen.main.bounds + let view1 = UIView() + + var peripharalManger: CBPeripheralManager! + private var service: CBUUID! + private let value = "AD34" + + var centralManager:CBCentralManager! + var periphiralDevice:CBPeripheral! + + var counter = 0 + var data = [String]() + var dicta = [String:String]() + var dict = [[String:String]]() + + + + override var prefersStatusBarHidden: Bool { + return true + } + + + override func viewDidLoad() { + super.viewDidLoad() + + centralManager = CBCentralManager(delegate: self, queue: nil) + + peripharalManger = CBPeripheralManager(delegate: self, queue: nil) + + let screenWidth = screenSize.width + let screenHeight = screenSize.height + + let color1 = hexStringToUIColor(hex: "#2792FF") + let color2 = hexStringToUIColor(hex: "#7EBFFF") + + + + home.text = "Settings" + home.textColor = .black + home.frame.size.width = 200 + home.frame.size.height = 75 + home.center.x = 130 + home.center.y = 105 + // home.font = UIFont(name: "Avenir Next", size: 60) + home.font = .boldSystemFont(ofSize: 45) + + + view.addSubview(home) + + let defaults = UserDefaults.standard + let name = defaults.string(forKey: "name") + let uuid = defaults.string(forKey: "uuid") + if uuid == nil { + defaults.set("unknown",forKey: "uuid") + } + lbl.text = "Name: " + "\(name ?? "Anonymous")" + lbl.font = .boldSystemFont(ofSize: 20) + + + lbl.frame.size.width = 300 + lbl.frame.size.height = 100 + lbl.center.x = view.center.x + lbl.center.y = home.center.y + 140 + lbl.textColor = .black + + view.addSubview(lbl) + print(uuid) + let uuid2 = uuid!.replacingOccurrences(of: "Optional(", with: "", options: NSString.CompareOptions.literal, range: nil) + let uuid3 = uuid2.replacingOccurrences(of: ")", with: "", options: NSString.CompareOptions.literal, range: nil) + lbl2.text = "Device uuid: " + "\(uuid3 ?? "unknown")" + lbl2.font = .boldSystemFont(ofSize: 20) + + + + lbl2.textColor = .black + lbl2.frame.size.width = 300 + lbl2.frame.size.height = 175 + lbl2.isEditable = false + lbl2.center.x = view.center.x + lbl2.center.y = lbl.center.y + 100 + view.addSubview(lbl2) + lbl.autoresizingMask = [.flexibleWidth, .flexibleHeight] + + lbl2.autoresizingMask = [.flexibleWidth, .flexibleHeight] + + lbl2.backgroundColor = .clear + view1.layer.cornerRadius = 20 + view1.frame.size.width = screenWidth - 60 + view1.frame.size.height = 100 + view1.center.x = view.center.x + view1.center.y = lbl2.center.y + 110 + view1.backgroundColor = color1 + view.addSubview(view1) + + lbl3.text = "Disable Background Refresh" + lbl3.font = .boldSystemFont(ofSize: 20) + + + + lbl3.textColor = .white + lbl3.frame.size.width = 300 + lbl3.frame.size.height = 100 + + lbl3.center.x = 167 + lbl3.center.y = 50 + view1.addSubview(lbl3) + + let tap = UITapGestureRecognizer(target: self, action: #selector(taped)) + + view1.addGestureRecognizer(tap) + } + + @objc func taped() { + + let defaults = UserDefaults.standard + let enabledBackground = defaults.bool(forKey: "enabledBackground") + + if enabledBackground == nil { + defaults.set(true,forKey: "enabledBackground") + lbl3.text = "Disable Background Refresh" + } + if enabledBackground == true { + defaults.set(false,forKey: "enabledBackground") + lbl3.text = "Disable Background Refresh" + } + if enabledBackground == false { + defaults.set(true,forKey: "enabledBackground") + lbl3.text = "Enable Background Refresh" + } + } + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +} + +extension settings: CBPeripheralManagerDelegate { + + func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) { + switch peripheral.state { + + case .unknown: + print("Bluetooth Device is UNKNOWN") + case .unsupported: + print("Bluetooth Device is UNSUPPORTED") + case .unauthorized: + print("Bluetooth Device is UNAUTHORIZED") + case .resetting: + print("Bluetooth Device is RESETTING") + case .poweredOff: + print("Bluetooth Device is POWERED OFF") + case .poweredOn: + print("Bluetooth Device is POWERED ON") + addServices() + @unknown default: + print("Unknown State") + } + } + + + + + func addServices() { + + let valueData = value.data(using: .utf8) + // 1. Create instance of CBMutableCharcateristic + let myChar1 = CBMutableCharacteristic(type: CBUUID(nsuuid: UUID()), properties: [.notify, .write, .read], value: nil, permissions: [.readable, .writeable]) + let myChar2 = CBMutableCharacteristic(type: CBUUID(nsuuid: UUID()), properties: [.read], value: valueData, permissions: [.readable]) + // 2. Create instance of CBMutableService + service = CBUUID(nsuuid: UUID()) + let myService = CBMutableService(type: service, primary: true) + // 3. Add characteristics to the service + myService.characteristics = [myChar1, myChar2] + // 4. Add service to peripheralManager + peripharalManger.add(myService) + // 5. Start advertising + + print("UUID service: \(service!)") + let defaults = UserDefaults.standard + + defaults.set("\(String(describing: service))",forKey: "uuid") + startAdvertising() + + } + + func startAdvertising() { + + + peripharalManger.startAdvertising([CBAdvertisementDataLocalNameKey : "BLE-APP-\(randomString(length: 10))", CBAdvertisementDataServiceUUIDsKey : [service]]) + print("Started Advertising") + + } +} + + +extension settings: CBCentralManagerDelegate { + + func centralManagerDidUpdateState(_ central: CBCentralManager) { + switch central.state { + + case .unknown: + print("Central code is unknown") + case .resetting: + print("Central code is resetting") + case .unsupported: + print("Central code is unsupported") + case .unauthorized: + print("Central code is unauthorized") + case .poweredOff: + print("Central code is powerdOff") + case .poweredOn: + print("Central code is powerOn") + + centralManager.scanForPeripherals(withServices: [CBUUID(string: "0000180F-0000-1000-8000-00805F9B34FB")], options: nil) + + + let timer = Timer.scheduledTimer(timeInterval: 3.0, + target: self, + selector: Selector(("scan")), + userInfo: nil, + repeats: true) + + timer.fire() + + + + @unknown default: + print("Default") + } + } + + @objc func scan(){ + centralManager.scanForPeripherals(withServices: nil) + + } + + func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, + advertisementData: [String: Any], rssi RSSI: NSNumber) { + periphiralDevice = peripheral + + let uuidString = periphiralDevice.identifier.uuidString + let peripharalName = periphiralDevice.name + + //Add scanned data to array and count data every 10 inputs + if !data.contains(uuidString){ + data.append(uuidString) + + dicta["name"] = peripharalName + dicta["uuid"] = uuidString + let defaults = UserDefaults.standard + let uuidContactWith = defaults.array(forKey: "uuidContactWith") + defaults.set([uuidString, uuidContactWith as Any],forKey: "uuidContactWith") + + print("Saved:" + "\(uuidContactWith)") + dict.append(dicta) + } + + if data.count >= 10 { + print("Data count \(data.count), ckeared") + data = [] + } + + print("As array \n") + print(data) + print("********************************** \n") + print("Print as array of dictionaries \n") + print(dict) + + + + print("\nName : \(peripheral.name ?? "(No name)")") + print("RSSI : \(RSSI)") + for ad in advertisementData { + print("AD Data: key \(ad.key) value: \(ad.value)") + } + + central.stopScan() + + + } + + func randomString(length: Int) -> String { + let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + return String((0.. 105 { + + + self.home.center.y = 105 + + + + } + + if self.home.center.y < -800 { + + + self.home.center.y = -700 + + + + } + } + + } + @objc func draggedView2(_ sender:UIPanGestureRecognizer){ + let screenWidth = screenSize.width + let screenHeight = screenSize.height + let timer = Timer.scheduledTimer(withTimeInterval: 0.01, repeats: true) { timer in + if self.home.center.y > 105 { + + + self.home.center.y = 105 + + + + } + + if self.home.center.y < -800 { + + + self.home.center.y = -700 + + + + } + } + //if viewDragLong == true { + //self.view.bringSubviewToFront(planet) + let translation = sender.translation(in: self.view) + // one.center = CGPoint(x: one.center.x, y: one.center.y + translation.y ) + sender.setTranslation(CGPoint.zero, in: self.view) + + UIView.animate(withDuration: 0.4, + delay: 0.0, + options: [], + animations: { [weak self] in + self!.home.center = CGPoint(x: self!.home.center.x, y: self!.home.center.y + translation.y * 1.7 ) + + + }, completion: nil) + + UIView.animate(withDuration: 0.4, + delay: 0.05, + options: [], + animations: { [weak self] in + self?.animationView.center.y = self!.home.center.y + 190 + self?.lbl.center.y = self!.home.center.y + 190 + + }, completion: nil) + + UIView.animate(withDuration: 0.3, + delay: 0.1, + options: [], + animations: { [weak self] in + self!.view1.center.y = ((self?.animationView.center.y)!) + 250 + + + }, completion: nil) + + + UIView.animate(withDuration: 0.4, + delay: 0.15, + options: [], + animations: { [weak self] in + self!.view2.center.y = self!.view1.center.y + 250 + + + }, completion: nil) + UIView.animate(withDuration: 0.4, + delay: 0.2, + options: [], + animations: { [weak self] in + self!.view3.center.y = self!.view2.center.y + 250 + + + }, completion: nil) + + UIView.animate(withDuration: 0.3, + delay: 0.25, + options: [], + animations: { [weak self] in + self!.view4.center.y = self!.view3.center.y + 250 + + + }, completion: nil) + + + + + + + // }/ + } +} + + +extension ViewController: CBPeripheralManagerDelegate { + + func peripheralManagerDidUpdateState(_ peripheral: CBPeripheralManager) { + switch peripheral.state { + + case .unknown: + print("Bluetooth Device is UNKNOWN") + case .unsupported: + print("Bluetooth Device is UNSUPPORTED") + case .unauthorized: + print("Bluetooth Device is UNAUTHORIZED") + case .resetting: + print("Bluetooth Device is RESETTING") + case .poweredOff: + print("Bluetooth Device is POWERED OFF") + case .poweredOn: + print("Bluetooth Device is POWERED ON") + addServices() + @unknown default: + print("Unknown State") + } + } + + + + + func addServices() { + + let valueData = value.data(using: .utf8) + // 1. Create instance of CBMutableCharcateristic + let myChar1 = CBMutableCharacteristic(type: CBUUID(nsuuid: UUID()), properties: [.notify, .write, .read], value: nil, permissions: [.readable, .writeable]) + let myChar2 = CBMutableCharacteristic(type: CBUUID(nsuuid: UUID()), properties: [.read], value: valueData, permissions: [.readable]) + // 2. Create instance of CBMutableService + service = CBUUID(nsuuid: UUID()) + let myService = CBMutableService(type: service, primary: true) + // 3. Add characteristics to the service + myService.characteristics = [myChar1, myChar2] + // 4. Add service to peripheralManager + peripharalManger.add(myService) + // 5. Start advertising + + print("UUID service: \(service!)") + startAdvertising() + + } + + func startAdvertising() { + peripharalManger.startAdvertising([CBAdvertisementDataLocalNameKey : "BLE-APP-\(randomString(length: 10))", CBAdvertisementDataServiceUUIDsKey : [service]]) + print("Started Advertising") + + } +} + + +extension ViewController: CBCentralManagerDelegate { + + func centralManagerDidUpdateState(_ central: CBCentralManager) { + switch central.state { + + case .unknown: + print("Central code is unknown") + case .resetting: + print("Central code is resetting") + case .unsupported: + print("Central code is unsupported") + case .unauthorized: + print("Central code is unauthorized") + case .poweredOff: + print("Central code is powerdOff") + case .poweredOn: + print("Central code is powerOn") + + centralManager.scanForPeripherals(withServices: [CBUUID(string: "0000180F-0000-1000-8000-00805F9B34FB")], options: nil) + + + let timer = Timer.scheduledTimer(timeInterval: 3.0, + target: self, + selector: Selector(("scan")), + userInfo: nil, + repeats: true) + + timer.fire() + + + + @unknown default: + print("Default") + } + } + + @objc func scan(){ + centralManager.scanForPeripherals(withServices: nil) + + } + + func centralManager(_ central: CBCentralManager, didDiscover peripheral: CBPeripheral, + advertisementData: [String: Any], rssi RSSI: NSNumber) { + periphiralDevice = peripheral + + let uuidString = periphiralDevice.identifier.uuidString + let peripharalName = periphiralDevice.name + + //Add scanned data to array and count data every 10 inputs + if !data.contains(uuidString){ + data.append(uuidString) + + dicta["name"] = peripharalName + dicta["uuid"] = uuidString + let defaults = UserDefaults.standard + let uuidContactWith = defaults.array(forKey: "uuidContactWith") + defaults.set([uuidString, uuidContactWith as Any ],forKey: "uuidContactWith") + + print("Saved:" + "\(uuidContactWith)") + dict.append(dicta) + } + + if data.count >= 10 { + print("Data count \(data.count), ckeared") + data = [] + } + + print("As array \n") + print(data) + print("********************************** \n") + print("Print as array of dictionaries \n") + print(dict) + + mLabelForUpdate.text = "\(dict)" + mLabelForUpdate.autoresizingMask = [.flexibleWidth, .flexibleHeight] + + print("\nName : \(peripheral.name ?? "(No name)")") + print("RSSI : \(RSSI)") + for ad in advertisementData { + print("AD Data: key \(ad.key) value: \(ad.value)") + } + + central.stopScan() + + + } + + func randomString(length: Int) -> String { + let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + return String((0.. UIColor { + var cString:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() + + if (cString.hasPrefix("#")) { + cString.remove(at: cString.startIndex) + } + + if ((cString.count) != 6) { + return UIColor.gray + } + + var rgbValue:UInt64 = 0 + Scanner(string: cString).scanHexInt64(&rgbValue) + + return UIColor( + red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, + green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, + blue: CGFloat(rgbValue & 0x0000FF) / 255.0, + alpha: CGFloat(1.0) + ) + } + +} +extension settings { + + func hexStringToUIColor (hex:String) -> UIColor { + var cString:String = hex.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() + + if (cString.hasPrefix("#")) { + cString.remove(at: cString.startIndex) + } + + if ((cString.count) != 6) { + return UIColor.gray + } + + var rgbValue:UInt64 = 0 + Scanner(string: cString).scanHexInt64(&rgbValue) + + return UIColor( + red: CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0, + green: CGFloat((rgbValue & 0x00FF00) >> 8) / 255.0, + blue: CGFloat(rgbValue & 0x0000FF) / 255.0, + alpha: CGFloat(1.0) + ) + } + +} diff --git a/TrackIT-master/TrackIT/lf30_editor_SKZ870.json b/TrackIT-master/TrackIT/lf30_editor_SKZ870.json new file mode 100644 index 0000000..c19a05b --- /dev/null +++ b/TrackIT-master/TrackIT/lf30_editor_SKZ870.json @@ -0,0 +1 @@ +{"v":"5.5.0","fr":29.9700012207031,"ip":0,"op":70.0000028511585,"w":250,"h":250,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":90,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[118.549,117.468,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,2.889]},"t":0,"s":[83.62,83.62,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.167,0.167,0.167],"y":[0.167,0.167,-0.549]},"t":27,"s":[105.62,105.62,100]},{"t":52.0000021180034,"s":[83.62,83.62,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[106.672,106.672],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.15294117647058825,0.5725490196078431,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[7.715,9.008],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":72.0000029326201,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"w1","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[100]},{"t":25.0000010182709,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[125.156,124.494,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[83.6,83.6,100]},{"t":25.0000010182709,"s":[234.048,234.048,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[69.508,69.508],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.3254901960784314,0.6549019607843137,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-0.187,0.605],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[139.443,139.443],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":70.0000028511585,"st":0,"bm":0},{"ddd":0,"ind":3,"ty":4,"nm":"w2","sr":1,"ks":{"o":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[100]},{"t":30.0000012219251,"s":[0]}],"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[125.326,124.285,0],"ix":2},"a":{"a":0,"k":[-44.248,-66.371,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"t":0,"s":[92.661,92.661,100]},{"t":30.0000012219251,"s":[229.892,229.892,100]}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"d":1,"ty":"el","s":{"a":0,"k":[86.801,86.801],"ix":2},"p":{"a":0,"k":[0,0],"ix":3},"nm":"Ellipse Path 1","mn":"ADBE Vector Shape - Ellipse","hd":false},{"ty":"fl","c":{"a":0,"k":[0.3254901960784314,0.6549019607843137,1,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"bm":0,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[-44.6,-65.6],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":70.0000028511585,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/TrackIT-master/TrackIT/services/AppDelegate.swift b/TrackIT-master/TrackIT/services/AppDelegate.swift new file mode 100644 index 0000000..fafe632 --- /dev/null +++ b/TrackIT-master/TrackIT/services/AppDelegate.swift @@ -0,0 +1,116 @@ +// +// AppDelegate.swift +// TrackIT +// +// Created by Laima Cernius-Ink on 3/25/20. +// Copyright © 2020 Steve Ink. All rights reserved. +// + + + + +import UIKit +import BackgroundTasks +import CoreBluetooth +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate,CBCentralManagerDelegate { + func centralManagerDidUpdateState(_ central: CBCentralManager) { + + } + + + private var centralManager : CBCentralManager! + func scheduleImagefetcher() { + let request = BGProcessingTaskRequest(identifier: "com.SO.imagefetcher") + request.requiresNetworkConnectivity = false // Need to true if your task need to network process. Defaults to false. + request.requiresExternalPower = false + //If we keep requiredExternalPower = true then it required device is connected to external power. + + request.earliestBeginDate = Date(timeIntervalSinceNow: 1 * 60) // fetch Image Count after 1 minute. + //Note :: EarliestBeginDate should not be set to too far into the future. + do { + try BGTaskScheduler.shared.submit(request) + } catch { + print("Could not schedule image fetch: (error)") + } + } + + func scheduleAppRefresh() { + + } + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + + let defaults = UserDefaults.standard + let uuidContactWith = defaults.array(forKey: "uuidContactWith") + + let uuid = defaults.string(forKey: "uuid") + if uuid == nil { + defaults.set("unknown",forKey: "uuid") + } + + if uuidContactWith == nil { + defaults.set(["none"],forKey: "uuidContactWith") + } + if UserDefaults.standard.integer(forKey: "use") < 0 { + + + UserDefaults.standard.set( UserDefaults.standard.integer(forKey: "use") + 1, forKey: "use") + print(UserDefaults.standard.integer(forKey: "use")) + UserDefaults.standard.set( UserDefaults.standard.integer(forKey: "use") + 1, forKey: "use") + } + + + registerBackgroundTaks() +centralManager = CBCentralManager(delegate: self, queue: nil, options: nil) + let center = UNUserNotificationCenter.current() + + center.requestAuthorization(options: [.alert, .sound]) { (granted, error) in + } + return true + } + + //MARK: Register BackGround Tasks + private func registerBackgroundTaks() { + + BGTaskScheduler.shared.register(forTaskWithIdentifier: "com.SO.imagefetcher", using: nil) { task in + //This task is cast with processing request (BGProcessingTask) + + let center = UNUserNotificationCenter.current() + // MARK: UISceneSession Lifecycle + let content = UNMutableNotificationContent() + content.title = "Hey I'm a notification!" + content.body = "Look at me!" + + // Step 3: Create the notification trigger + let date = Date().addingTimeInterval(10) + + let dateComponents = Calendar.current.dateComponents([.year, .month, .day, .hour, .minute, .second], from: date) + + let trigger = UNCalendarNotificationTrigger(dateMatching: dateComponents, repeats: false) + + // Step 4: Create the request + + let uuidString = UUID().uuidString + + let request = UNNotificationRequest(identifier: uuidString, content: content, trigger: trigger) + + // Step 5: Register the request + center.add(request) { (error) in + // Check the error parameter and handle any errors + } + } + + + func applicationDidEnterBackground(_ application: UIApplication) { + scheduleAppRefresh() + scheduleImagefetcher() + } + + + + func cancelAllPendingBGTask() { + BGTaskScheduler.shared.cancelAllTaskRequests() + } +} +} diff --git a/TrackIT-master/TrackIT/services/SceneDelegate.swift b/TrackIT-master/TrackIT/services/SceneDelegate.swift new file mode 100644 index 0000000..f1d27e5 --- /dev/null +++ b/TrackIT-master/TrackIT/services/SceneDelegate.swift @@ -0,0 +1,53 @@ +// +// SceneDelegate.swift +// TrackIT +// +// Created by Laima Cernius-Ink on 3/25/20. +// Copyright © 2020 Steve Ink. All rights reserved. +// + +import UIKit + +class SceneDelegate: UIResponder, UIWindowSceneDelegate { + + var window: UIWindow? + + + func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { + // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. + // If using a storyboard, the `window` property will automatically be initialized and attached to the scene. + // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). + guard let _ = (scene as? UIWindowScene) else { return } + } + + func sceneDidDisconnect(_ scene: UIScene) { + // Called as the scene is being released by the system. + // This occurs shortly after the scene enters the background, or when its session is discarded. + // Release any resources associated with this scene that can be re-created the next time the scene connects. + // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead). + } + + func sceneDidBecomeActive(_ scene: UIScene) { + // Called when the scene has moved from an inactive state to an active state. + // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive. + } + + func sceneWillResignActive(_ scene: UIScene) { + // Called when the scene will move from an active state to an inactive state. + // This may occur due to temporary interruptions (ex. an incoming phone call). + } + + func sceneWillEnterForeground(_ scene: UIScene) { + // Called as the scene transitions from the background to the foreground. + // Use this method to undo the changes made on entering the background. + } + + func sceneDidEnterBackground(_ scene: UIScene) { + // Called as the scene transitions from the foreground to the background. + // Use this method to save data, release shared resources, and store enough scene-specific state information + // to restore the scene back to its current state. + } + + +} + diff --git a/TrackIT-master/TrackIT/view/Base.lproj/LaunchScreen.storyboard b/TrackIT-master/TrackIT/view/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..865e932 --- /dev/null +++ b/TrackIT-master/TrackIT/view/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TrackIT-master/TrackIT/view/Base.lproj/Main.storyboard b/TrackIT-master/TrackIT/view/Base.lproj/Main.storyboard new file mode 100644 index 0000000..bd07e4a --- /dev/null +++ b/TrackIT-master/TrackIT/view/Base.lproj/Main.storyboard @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TrackIT-master/placeholder.txt b/TrackIT-master/placeholder.txt new file mode 100644 index 0000000..375f1d5 --- /dev/null +++ b/TrackIT-master/placeholder.txt @@ -0,0 +1 @@ +Placeholder text till we add files...