From ae73b78935bf26515eccd1609bcf5bea43cb8451 Mon Sep 17 00:00:00 2001 From: Jeroen Leenarts Date: Wed, 23 May 2018 21:49:10 +0200 Subject: [PATCH] Initial project setup. Signed-off-by: Jason A. Donenfeld --- .gitignore | 55 ++ .swiftlint.yml | 12 + Podfile | 25 + Podfile.lock | 66 ++ README.md | 6 +- .../Settings.bundle/Acknowledgements.plist | 351 ++++++++++ Resources/Settings.bundle/Root.plist | 39 ++ .../Settings.bundle/en.lproj/Root.strings | 4 + .../Settings.bundle/nl.lproj/Root.strings | 5 + Scripts/set_build_number.sh | 23 + Wireguard.xcodeproj/project.pbxproj | 660 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../contents.xcworkspacedata | 10 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + Wireguard/AppDelegate.swift | 25 + .../AppIcon.appiconset/Contents.json | 98 +++ Wireguard/Assets.xcassets/Contents.json | 6 + Wireguard/Base.lproj/LaunchScreen.storyboard | 25 + Wireguard/Base.lproj/Main.storyboard | 41 ++ Wireguard/Coordinators/AppCoordinator.swift | 102 +++ Wireguard/Coordinators/Coordinator.swift | 34 + Wireguard/Coordinators/RootCoordinator.swift | 19 + Wireguard/Info.plist | 43 ++ Wireguard/Models/Profile+CoreDataClass.swift | 16 + .../Models/Profile+CoreDataProperties.swift | 19 + .../Wireguard.xcdatamodel/contents | 7 + .../ConnectionsTableViewController.swift | 38 + Wireguard/ViewControllers/Identifyable.swift | 27 + WireguardTests/Info.plist | 22 + WireguardTests/WireguardTests.swift | 36 + 31 files changed, 1836 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100644 .swiftlint.yml create mode 100644 Podfile create mode 100644 Podfile.lock create mode 100644 Resources/Settings.bundle/Acknowledgements.plist create mode 100644 Resources/Settings.bundle/Root.plist create mode 100644 Resources/Settings.bundle/en.lproj/Root.strings create mode 100644 Resources/Settings.bundle/nl.lproj/Root.strings create mode 100755 Scripts/set_build_number.sh create mode 100644 Wireguard.xcodeproj/project.pbxproj create mode 100644 Wireguard.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 Wireguard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Wireguard.xcworkspace/contents.xcworkspacedata create mode 100644 Wireguard.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Wireguard/AppDelegate.swift create mode 100644 Wireguard/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 Wireguard/Assets.xcassets/Contents.json create mode 100644 Wireguard/Base.lproj/LaunchScreen.storyboard create mode 100644 Wireguard/Base.lproj/Main.storyboard create mode 100644 Wireguard/Coordinators/AppCoordinator.swift create mode 100644 Wireguard/Coordinators/Coordinator.swift create mode 100644 Wireguard/Coordinators/RootCoordinator.swift create mode 100644 Wireguard/Info.plist create mode 100644 Wireguard/Models/Profile+CoreDataClass.swift create mode 100644 Wireguard/Models/Profile+CoreDataProperties.swift create mode 100644 Wireguard/Models/Wireguard.xcdatamodeld/Wireguard.xcdatamodel/contents create mode 100644 Wireguard/ViewControllers/ConnectionsTableViewController.swift create mode 100644 Wireguard/ViewControllers/Identifyable.swift create mode 100644 WireguardTests/Info.plist create mode 100644 WireguardTests/WireguardTests.swift diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b70dc04 --- /dev/null +++ b/.gitignore @@ -0,0 +1,55 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +.DS_Store +.idea + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control +# +Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# Fastlane +*.app.dSYM.zip +*.mobileprovision +fastlane/report.xml +fastlane/screenshots +fastlane/test_output +Preview.html +output \ No newline at end of file diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000..df5ce7d --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,12 @@ +disabled_rules: + - line_length + - trailing_comma +excluded: + - Pods +file_length: + warning: 500 +type_name: + min_length: 2 # only warning + max_length: # warning and error + warning: 50 + error: 60 diff --git a/Podfile b/Podfile new file mode 100644 index 0000000..093d695 --- /dev/null +++ b/Podfile @@ -0,0 +1,25 @@ +platform :ios, '10.0' + +use_frameworks! + +swift_version = "4.0" + +target 'Wireguard' do + pod 'Fabric' + pod 'Crashlytics' + pod 'SwiftLint' + pod 'PromiseKit/CorePromise' + pod 'KeychainSwift' + pod 'Moya' + pod 'Disk' + pod 'AlamofireImage' + pod 'BNRCoreDataStack' + pod 'NVActivityIndicatorView' + + post_install do | installer | + require 'fileutils' + FileUtils.cp_r('Pods/Target Support Files/Pods-Wireguard/Pods-Wireguard-Acknowledgements.plist', 'Resources/Settings.bundle/Acknowledgements.plist', :remove_destination => true) + + end +end + diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..c820824 --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,66 @@ +PODS: + - Alamofire (4.7.2) + - AlamofireImage (3.3.1): + - Alamofire (~> 4.5) + - BNRCoreDataStack (2.3.1) + - Crashlytics (3.10.1): + - Fabric (~> 1.7.5) + - Disk (0.3.3) + - Fabric (1.7.6) + - KeychainSwift (11.0.0) + - Moya (11.0.2): + - Moya/Core (= 11.0.2) + - Moya/Core (11.0.2): + - Alamofire (~> 4.1) + - Result (~> 3.0) + - NVActivityIndicatorView (4.2.1): + - NVActivityIndicatorView/Presenter (= 4.2.1) + - NVActivityIndicatorView/Presenter (4.2.1) + - PromiseKit/CorePromise (6.2.7) + - Result (3.2.4) + - SwiftLint (0.25.1) + +DEPENDENCIES: + - AlamofireImage + - BNRCoreDataStack + - Crashlytics + - Disk + - Fabric + - KeychainSwift + - Moya + - NVActivityIndicatorView + - PromiseKit/CorePromise + - SwiftLint + +SPEC REPOS: + https://github.com/cocoapods/specs.git: + - Alamofire + - AlamofireImage + - BNRCoreDataStack + - Crashlytics + - Disk + - Fabric + - KeychainSwift + - Moya + - NVActivityIndicatorView + - PromiseKit + - Result + - SwiftLint + +SPEC CHECKSUMS: + Alamofire: e4fa87002c137ba2d8d634d2c51fabcda0d5c223 + AlamofireImage: 3b35b586853abaf94ca1250f4e94cff3c21a4c0d + BNRCoreDataStack: d9d7d0ed1afd27dca5a903dde1250aa4c6dbc3f5 + Crashlytics: aee1a064cbbf99b32efa3f056a5f458d846bc8ff + Disk: d1f55cd61f6ca20f368232d0c6e37e3c3dfcb63e + Fabric: f8d42c893bb187326a7968b62abe55c36a987a46 + KeychainSwift: bea6bd9f98af7b8d7ca4aa79fe105c00fab532db + Moya: a725035953bc1c0eb1be505ab903984501d82440 + NVActivityIndicatorView: 8068ba3ad39cb44cbaab25d89ff2546b3f092681 + PromiseKit: 12b9d87748b170714247d8b2677146ca57e488f2 + Result: d2d07204ce72856f1fd9130bbe42c35a7b0fea10 + SwiftLint: ce933681be10c3266e82576dad676fa815a602e9 + +PODFILE CHECKSUM: e6b0defd47762f4f7dcf816ebbed47976b3ad2e0 + +COCOAPODS: 1.5.2 diff --git a/README.md b/README.md index 6bfce90..754c301 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # [WireGuard](https://www.wireguard.com/) for iOS -Nothing to see here yet. Come back later. +To get started... + +- Clone this repo. +- Run `pod install` +- Open `Wireguard.xcworkspace` ## License diff --git a/Resources/Settings.bundle/Acknowledgements.plist b/Resources/Settings.bundle/Acknowledgements.plist new file mode 100644 index 0000000..5bc067f --- /dev/null +++ b/Resources/Settings.bundle/Acknowledgements.plist @@ -0,0 +1,351 @@ + + + + + PreferenceSpecifiers + + + FooterText + This application makes use of the following third party libraries: + Title + Acknowledgements + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2014-2018 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + Alamofire + Type + PSGroupSpecifier + + + FooterText + Copyright (c) 2015-2018 Alamofire Software Foundation (http://alamofire.org/) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + AlamofireImage + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2015 Big Nerd Ranch, LLC + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + License + MIT + Title + BNRCoreDataStack + Type + PSGroupSpecifier + + + FooterText + Fabric: Copyright 2018 Google, Inc. All Rights Reserved. Use of this software is subject to the terms and conditions of the Fabric Software and Services Agreement located at https://fabric.io/terms. Crashlytics Kit: Copyright 2018 Crashlytics, Inc. All Rights Reserved. Use of this software is subject to the terms and conditions of the Crashlytics Terms of Service located at http://try.crashlytics.com/terms/terms-of-service.pdf and the Crashlytics Privacy Policy located at http://try.crashlytics.com/terms/privacy-policy.pdf. OSS: http://get.fabric.io/terms/opensource.txt + License + Commercial + Title + Crashlytics + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2017 Saoud Rizwan <hello@saoudmr.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + License + MIT + Title + Disk + Type + PSGroupSpecifier + + + FooterText + Fabric: Copyright 2018 Google, Inc. All Rights Reserved. Use of this software is subject to the terms and conditions of the Fabric Software and Services Agreement located at https://fabric.io/terms. OSS: http://get.fabric.io/terms/opensource.txt + License + Commercial + Title + Fabric + Type + PSGroupSpecifier + + + FooterText + The MIT License + +Copyright (c) 2015 Marketplacer + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + License + MIT + Title + KeychainSwift + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2014-present Artsy, Ash Furrow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + License + MIT + Title + Moya + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2016 Vinh Nguyen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + License + MIT + Title + NVActivityIndicatorView + Type + PSGroupSpecifier + + + FooterText + Copyright 2016-present, Max Howell; mxcl@me.com + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + License + MIT + Title + PromiseKit + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2014 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + License + MIT + Title + Result + Type + PSGroupSpecifier + + + FooterText + The MIT License (MIT) + +Copyright (c) 2015 Realm Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + + License + MIT + Title + SwiftLint + Type + PSGroupSpecifier + + + FooterText + Generated by CocoaPods - https://cocoapods.org + Title + + Type + PSGroupSpecifier + + + StringsTable + Acknowledgements + Title + Acknowledgements + + diff --git a/Resources/Settings.bundle/Root.plist b/Resources/Settings.bundle/Root.plist new file mode 100644 index 0000000..cb169f8 --- /dev/null +++ b/Resources/Settings.bundle/Root.plist @@ -0,0 +1,39 @@ + + + + + PreferenceSpecifiers + + + Type + PSGroupSpecifier + + + DefaultValue + Set at build time. + Key + version_preference + Title + Version Info + Type + PSTitleValueSpecifier + + + Type + PSGroupSpecifier + + + Type + PSChildPaneSpecifier + Title + Acknowledgements + File + Acknowledgements + + + StringsTable + Root + Title + + + diff --git a/Resources/Settings.bundle/en.lproj/Root.strings b/Resources/Settings.bundle/en.lproj/Root.strings new file mode 100644 index 0000000..89eed99 --- /dev/null +++ b/Resources/Settings.bundle/en.lproj/Root.strings @@ -0,0 +1,4 @@ +/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */ + +"Version Info" = "Version Info"; +"Acknowledgements" = "Acknowledgements"; diff --git a/Resources/Settings.bundle/nl.lproj/Root.strings b/Resources/Settings.bundle/nl.lproj/Root.strings new file mode 100644 index 0000000..c805216 --- /dev/null +++ b/Resources/Settings.bundle/nl.lproj/Root.strings @@ -0,0 +1,5 @@ +/* A single strings file, whose title is specified in your preferences schema. The strings files provide the localized content to display to the user for each of your preferences. */ + +"Version Info" = "Versie informatie"; +"Acknowledgements" = "Licenties"; + diff --git a/Scripts/set_build_number.sh b/Scripts/set_build_number.sh new file mode 100755 index 0000000..888075a --- /dev/null +++ b/Scripts/set_build_number.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +git=$(sh /etc/profile; which git) +number_of_commits=$("$git" rev-list HEAD --count) + +target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH" +dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist" + +for plist in "$target_plist" "$dsym_plist"; do + if [ -f "$plist" ]; then + /usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${number_of_commits}" "$plist" + fi +done + +settings_root_plist="$TARGET_BUILD_DIR/Wireguard.app/Settings.bundle/Root.plist" + +if [ -f "$settings_root_plist" ]; then + settingsVersion="`agvtool what-marketing-version -terse1`(${number_of_commits})" + /usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue $settingsVersion" "$settings_root_plist" +else + echo "Could not find: $settings_root_plist" + exit 1 +fi \ No newline at end of file diff --git a/Wireguard.xcodeproj/project.pbxproj b/Wireguard.xcodeproj/project.pbxproj new file mode 100644 index 0000000..349e152 --- /dev/null +++ b/Wireguard.xcodeproj/project.pbxproj @@ -0,0 +1,660 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 4A4BACE620B5F1BF00F12B28 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BACE520B5F1BF00F12B28 /* AppDelegate.swift */; }; + 4A4BACE820B5F1BF00F12B28 /* ConnectionsTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BACE720B5F1BF00F12B28 /* ConnectionsTableViewController.swift */; }; + 4A4BACEB20B5F1BF00F12B28 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A4BACE920B5F1BF00F12B28 /* Main.storyboard */; }; + 4A4BACED20B5F1C100F12B28 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4A4BACEC20B5F1C100F12B28 /* Assets.xcassets */; }; + 4A4BACF020B5F1C100F12B28 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A4BACEE20B5F1C100F12B28 /* LaunchScreen.storyboard */; }; + 4A4BACFB20B5F1C100F12B28 /* WireguardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BACFA20B5F1C100F12B28 /* WireguardTests.swift */; }; + 4A4BAD0620B5F4B500F12B28 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 4A4BAD0520B5F4B500F12B28 /* Settings.bundle */; }; + 4A4BAD0C20B5F6AA00F12B28 /* AppCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BAD0B20B5F6AA00F12B28 /* AppCoordinator.swift */; }; + 4A4BAD0E20B5F6C300F12B28 /* Coordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BAD0D20B5F6C300F12B28 /* Coordinator.swift */; }; + 4A4BAD1020B5F6EC00F12B28 /* RootCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BAD0F20B5F6EC00F12B28 /* RootCoordinator.swift */; }; + 4A4BAD1320B5F82400F12B28 /* Identifyable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BAD1220B5F82400F12B28 /* Identifyable.swift */; }; + 4A4BAD1720B5F8DE00F12B28 /* Wireguard.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BAD1520B5F8DE00F12B28 /* Wireguard.xcdatamodeld */; }; + 4A4BAD1A20B5F8FF00F12B28 /* Profile+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BAD1820B5F8FF00F12B28 /* Profile+CoreDataClass.swift */; }; + 4A4BAD1B20B5F8FF00F12B28 /* Profile+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4A4BAD1920B5F8FF00F12B28 /* Profile+CoreDataProperties.swift */; }; + DA734B3636730B94E9C22F47 /* Pods_Wireguard.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8BF50C7EC60CD91BBA05E51F /* Pods_Wireguard.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 4A4BACF720B5F1C100F12B28 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4A4BACDA20B5F1BF00F12B28 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 4A4BACE120B5F1BF00F12B28; + remoteInfo = Wireguard; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 4A4BACE220B5F1BF00F12B28 /* Wireguard.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Wireguard.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 4A4BACE520B5F1BF00F12B28 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 4A4BACE720B5F1BF00F12B28 /* ConnectionsTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConnectionsTableViewController.swift; sourceTree = ""; }; + 4A4BACEA20B5F1BF00F12B28 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 4A4BACEC20B5F1C100F12B28 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 4A4BACEF20B5F1C100F12B28 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 4A4BACF120B5F1C100F12B28 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4A4BACF620B5F1C100F12B28 /* WireguardTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = WireguardTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 4A4BACFA20B5F1C100F12B28 /* WireguardTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WireguardTests.swift; sourceTree = ""; }; + 4A4BACFC20B5F1C100F12B28 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 4A4BAD0520B5F4B500F12B28 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = Settings.bundle; sourceTree = ""; }; + 4A4BAD0B20B5F6AA00F12B28 /* AppCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCoordinator.swift; sourceTree = ""; }; + 4A4BAD0D20B5F6C300F12B28 /* Coordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Coordinator.swift; sourceTree = ""; }; + 4A4BAD0F20B5F6EC00F12B28 /* RootCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootCoordinator.swift; sourceTree = ""; }; + 4A4BAD1220B5F82400F12B28 /* Identifyable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Identifyable.swift; sourceTree = ""; }; + 4A4BAD1620B5F8DE00F12B28 /* Wireguard.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Wireguard.xcdatamodel; sourceTree = ""; }; + 4A4BAD1820B5F8FF00F12B28 /* Profile+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Profile+CoreDataClass.swift"; sourceTree = ""; }; + 4A4BAD1920B5F8FF00F12B28 /* Profile+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Profile+CoreDataProperties.swift"; sourceTree = ""; }; + 82069F3AE97A82448F990CFB /* Pods-Wireguard.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Wireguard.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Wireguard/Pods-Wireguard.debug.xcconfig"; sourceTree = ""; }; + 8BF50C7EC60CD91BBA05E51F /* Pods_Wireguard.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Wireguard.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + FB0ABC1036F5A16B24286D3C /* Pods-Wireguard.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Wireguard.release.xcconfig"; path = "Pods/Target Support Files/Pods-Wireguard/Pods-Wireguard.release.xcconfig"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 4A4BACDF20B5F1BF00F12B28 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + DA734B3636730B94E9C22F47 /* Pods_Wireguard.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4A4BACF320B5F1C100F12B28 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 4A4BACD920B5F1BF00F12B28 = { + isa = PBXGroup; + children = ( + 4A4BAD0720B5F4BC00F12B28 /* Resources */, + 4A4BACE420B5F1BF00F12B28 /* Wireguard */, + 4A4BACF920B5F1C100F12B28 /* WireguardTests */, + 4A4BACE320B5F1BF00F12B28 /* Products */, + 87B9E27C2D1820573644527C /* Pods */, + A447093459F091F4358E843F /* Frameworks */, + ); + sourceTree = ""; + }; + 4A4BACE320B5F1BF00F12B28 /* Products */ = { + isa = PBXGroup; + children = ( + 4A4BACE220B5F1BF00F12B28 /* Wireguard.app */, + 4A4BACF620B5F1C100F12B28 /* WireguardTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 4A4BACE420B5F1BF00F12B28 /* Wireguard */ = { + isa = PBXGroup; + children = ( + 4A4BAD1420B5F8C000F12B28 /* Models */, + 4A4BAD1120B5F7A000F12B28 /* ViewControllers */, + 4A4BAD0A20B5F65800F12B28 /* Coordinators */, + 4A4BACE520B5F1BF00F12B28 /* AppDelegate.swift */, + 4A4BACE920B5F1BF00F12B28 /* Main.storyboard */, + 4A4BACEC20B5F1C100F12B28 /* Assets.xcassets */, + 4A4BACEE20B5F1C100F12B28 /* LaunchScreen.storyboard */, + 4A4BACF120B5F1C100F12B28 /* Info.plist */, + ); + path = Wireguard; + sourceTree = ""; + }; + 4A4BACF920B5F1C100F12B28 /* WireguardTests */ = { + isa = PBXGroup; + children = ( + 4A4BACFA20B5F1C100F12B28 /* WireguardTests.swift */, + 4A4BACFC20B5F1C100F12B28 /* Info.plist */, + ); + path = WireguardTests; + sourceTree = ""; + }; + 4A4BAD0720B5F4BC00F12B28 /* Resources */ = { + isa = PBXGroup; + children = ( + 4A4BAD0520B5F4B500F12B28 /* Settings.bundle */, + ); + path = Resources; + sourceTree = ""; + }; + 4A4BAD0A20B5F65800F12B28 /* Coordinators */ = { + isa = PBXGroup; + children = ( + 4A4BAD0D20B5F6C300F12B28 /* Coordinator.swift */, + 4A4BAD0F20B5F6EC00F12B28 /* RootCoordinator.swift */, + 4A4BAD0B20B5F6AA00F12B28 /* AppCoordinator.swift */, + ); + path = Coordinators; + sourceTree = ""; + }; + 4A4BAD1120B5F7A000F12B28 /* ViewControllers */ = { + isa = PBXGroup; + children = ( + 4A4BAD1220B5F82400F12B28 /* Identifyable.swift */, + 4A4BACE720B5F1BF00F12B28 /* ConnectionsTableViewController.swift */, + ); + path = ViewControllers; + sourceTree = ""; + }; + 4A4BAD1420B5F8C000F12B28 /* Models */ = { + isa = PBXGroup; + children = ( + 4A4BAD1820B5F8FF00F12B28 /* Profile+CoreDataClass.swift */, + 4A4BAD1920B5F8FF00F12B28 /* Profile+CoreDataProperties.swift */, + 4A4BAD1520B5F8DE00F12B28 /* Wireguard.xcdatamodeld */, + ); + path = Models; + sourceTree = ""; + }; + 87B9E27C2D1820573644527C /* Pods */ = { + isa = PBXGroup; + children = ( + 82069F3AE97A82448F990CFB /* Pods-Wireguard.debug.xcconfig */, + FB0ABC1036F5A16B24286D3C /* Pods-Wireguard.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; + A447093459F091F4358E843F /* Frameworks */ = { + isa = PBXGroup; + children = ( + 8BF50C7EC60CD91BBA05E51F /* Pods_Wireguard.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 4A4BACE120B5F1BF00F12B28 /* Wireguard */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4A4BACFF20B5F1C100F12B28 /* Build configuration list for PBXNativeTarget "Wireguard" */; + buildPhases = ( + C9A2E84E53AF419288C5C4BE /* [CP] Check Pods Manifest.lock */, + 4A4BAD0820B5F53900F12B28 /* Swiftlint */, + 4A4BACDE20B5F1BF00F12B28 /* Sources */, + 4A4BACDF20B5F1BF00F12B28 /* Frameworks */, + 4A4BACE020B5F1BF00F12B28 /* Resources */, + 4A4BAD0920B5F56200F12B28 /* Set build number */, + 6F743EFD0F63EA8C605CE349 /* [CP] Embed Pods Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Wireguard; + productName = Wireguard; + productReference = 4A4BACE220B5F1BF00F12B28 /* Wireguard.app */; + productType = "com.apple.product-type.application"; + }; + 4A4BACF520B5F1C100F12B28 /* WireguardTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 4A4BAD0220B5F1C100F12B28 /* Build configuration list for PBXNativeTarget "WireguardTests" */; + buildPhases = ( + 4A4BACF220B5F1C100F12B28 /* Sources */, + 4A4BACF320B5F1C100F12B28 /* Frameworks */, + 4A4BACF420B5F1C100F12B28 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 4A4BACF820B5F1C100F12B28 /* PBXTargetDependency */, + ); + name = WireguardTests; + productName = WireguardTests; + productReference = 4A4BACF620B5F1C100F12B28 /* WireguardTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 4A4BACDA20B5F1BF00F12B28 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0930; + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = Wireguard; + TargetAttributes = { + 4A4BACE120B5F1BF00F12B28 = { + CreatedOnToolsVersion = 9.3.1; + }; + 4A4BACF520B5F1C100F12B28 = { + CreatedOnToolsVersion = 9.3.1; + TestTargetID = 4A4BACE120B5F1BF00F12B28; + }; + }; + }; + buildConfigurationList = 4A4BACDD20B5F1BF00F12B28 /* Build configuration list for PBXProject "Wireguard" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 4A4BACD920B5F1BF00F12B28; + productRefGroup = 4A4BACE320B5F1BF00F12B28 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 4A4BACE120B5F1BF00F12B28 /* Wireguard */, + 4A4BACF520B5F1C100F12B28 /* WireguardTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 4A4BACE020B5F1BF00F12B28 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4A4BAD0620B5F4B500F12B28 /* Settings.bundle in Resources */, + 4A4BACF020B5F1C100F12B28 /* LaunchScreen.storyboard in Resources */, + 4A4BACED20B5F1C100F12B28 /* Assets.xcassets in Resources */, + 4A4BACEB20B5F1BF00F12B28 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4A4BACF420B5F1C100F12B28 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 4A4BAD0820B5F53900F12B28 /* Swiftlint */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = Swiftlint; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "${PODS_ROOT}/SwiftLint/swiftlint autocorrect\n${PODS_ROOT}/SwiftLint/swiftlint"; + }; + 4A4BAD0920B5F56200F12B28 /* Set build number */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Set build number"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = $SRCROOT/Scripts/set_build_number.sh; + }; + 6F743EFD0F63EA8C605CE349 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-Wireguard/Pods-Wireguard-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/Alamofire/Alamofire.framework", + "${BUILT_PRODUCTS_DIR}/AlamofireImage/AlamofireImage.framework", + "${BUILT_PRODUCTS_DIR}/BNRCoreDataStack/BNRCoreDataStack.framework", + "${BUILT_PRODUCTS_DIR}/Disk/Disk.framework", + "${BUILT_PRODUCTS_DIR}/KeychainSwift/KeychainSwift.framework", + "${BUILT_PRODUCTS_DIR}/Moya/Moya.framework", + "${BUILT_PRODUCTS_DIR}/NVActivityIndicatorView/NVActivityIndicatorView.framework", + "${BUILT_PRODUCTS_DIR}/PromiseKit/PromiseKit.framework", + "${BUILT_PRODUCTS_DIR}/Result/Result.framework", + ); + name = "[CP] Embed Pods Frameworks"; + outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Alamofire.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/AlamofireImage.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/BNRCoreDataStack.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Disk.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/KeychainSwift.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Moya.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/NVActivityIndicatorView.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PromiseKit.framework", + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Result.framework", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-Wireguard/Pods-Wireguard-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; + C9A2E84E53AF419288C5C4BE /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Wireguard-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + 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; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 4A4BACDE20B5F1BF00F12B28 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4A4BAD0C20B5F6AA00F12B28 /* AppCoordinator.swift in Sources */, + 4A4BAD1320B5F82400F12B28 /* Identifyable.swift in Sources */, + 4A4BAD1720B5F8DE00F12B28 /* Wireguard.xcdatamodeld in Sources */, + 4A4BAD1A20B5F8FF00F12B28 /* Profile+CoreDataClass.swift in Sources */, + 4A4BACE820B5F1BF00F12B28 /* ConnectionsTableViewController.swift in Sources */, + 4A4BAD1020B5F6EC00F12B28 /* RootCoordinator.swift in Sources */, + 4A4BAD0E20B5F6C300F12B28 /* Coordinator.swift in Sources */, + 4A4BAD1B20B5F8FF00F12B28 /* Profile+CoreDataProperties.swift in Sources */, + 4A4BACE620B5F1BF00F12B28 /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 4A4BACF220B5F1C100F12B28 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 4A4BACFB20B5F1C100F12B28 /* WireguardTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 4A4BACF820B5F1C100F12B28 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 4A4BACE120B5F1BF00F12B28 /* Wireguard */; + targetProxy = 4A4BACF720B5F1C100F12B28 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 4A4BACE920B5F1BF00F12B28 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4A4BACEA20B5F1BF00F12B28 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 4A4BACEE20B5F1C100F12B28 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 4A4BACEF20B5F1C100F12B28 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 4A4BACFD20B5F1C100F12B28 /* 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; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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 = 10.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 4A4BACFE20B5F1C100F12B28 /* 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; + CODE_SIGN_IDENTITY = "iPhone Developer"; + 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 = 10.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 4A4BAD0020B5F1C100F12B28 /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 82069F3AE97A82448F990CFB /* Pods-Wireguard.debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = Wireguard/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.wireguard.ios.Wireguard; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 4A4BAD0120B5F1C100F12B28 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = FB0ABC1036F5A16B24286D3C /* Pods-Wireguard.release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Manual; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = Wireguard/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 10.3; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.wireguard.ios.Wireguard; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 4A4BAD0320B5F1C100F12B28 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = WireguardTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.wireguard.ios.WireguardTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Wireguard.app/Wireguard"; + }; + name = Debug; + }; + 4A4BAD0420B5F1C100F12B28 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = WireguardTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = com.wireguard.ios.WireguardTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Wireguard.app/Wireguard"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 4A4BACDD20B5F1BF00F12B28 /* Build configuration list for PBXProject "Wireguard" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4A4BACFD20B5F1C100F12B28 /* Debug */, + 4A4BACFE20B5F1C100F12B28 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4A4BACFF20B5F1C100F12B28 /* Build configuration list for PBXNativeTarget "Wireguard" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4A4BAD0020B5F1C100F12B28 /* Debug */, + 4A4BAD0120B5F1C100F12B28 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 4A4BAD0220B5F1C100F12B28 /* Build configuration list for PBXNativeTarget "WireguardTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 4A4BAD0320B5F1C100F12B28 /* Debug */, + 4A4BAD0420B5F1C100F12B28 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + 4A4BAD1520B5F8DE00F12B28 /* Wireguard.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + 4A4BAD1620B5F8DE00F12B28 /* Wireguard.xcdatamodel */, + ); + currentVersion = 4A4BAD1620B5F8DE00F12B28 /* Wireguard.xcdatamodel */; + path = Wireguard.xcdatamodeld; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ + }; + rootObject = 4A4BACDA20B5F1BF00F12B28 /* Project object */; +} diff --git a/Wireguard.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Wireguard.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..c323f27 --- /dev/null +++ b/Wireguard.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Wireguard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Wireguard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Wireguard.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Wireguard.xcworkspace/contents.xcworkspacedata b/Wireguard.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..7a555e1 --- /dev/null +++ b/Wireguard.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/Wireguard.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Wireguard.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Wireguard.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Wireguard/AppDelegate.swift b/Wireguard/AppDelegate.swift new file mode 100644 index 0000000..4c399e5 --- /dev/null +++ b/Wireguard/AppDelegate.swift @@ -0,0 +1,25 @@ +// +// AppDelegate.swift +// Wireguard +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + var appCoordinator: AppCoordinator! + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + + self.window = UIWindow(frame: UIScreen.main.bounds) + self.appCoordinator = AppCoordinator(window: self.window!) + self.appCoordinator.start() + + return true + } +} diff --git a/Wireguard/Assets.xcassets/AppIcon.appiconset/Contents.json b/Wireguard/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/Wireguard/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/Wireguard/Assets.xcassets/Contents.json b/Wireguard/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Wireguard/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Wireguard/Base.lproj/LaunchScreen.storyboard b/Wireguard/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/Wireguard/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wireguard/Base.lproj/Main.storyboard b/Wireguard/Base.lproj/Main.storyboard new file mode 100644 index 0000000..5703677 --- /dev/null +++ b/Wireguard/Base.lproj/Main.storyboard @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Wireguard/Coordinators/AppCoordinator.swift b/Wireguard/Coordinators/AppCoordinator.swift new file mode 100644 index 0000000..d1fd520 --- /dev/null +++ b/Wireguard/Coordinators/AppCoordinator.swift @@ -0,0 +1,102 @@ +// +// AppCoordinator.swift +// Wireguard +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// + +import Foundation + +import CoreData +import BNRCoreDataStack + +class AppCoordinator: RootViewCoordinator { + + let persistentContainer = NSPersistentContainer(name: "Wireguard") + let storyboard = UIStoryboard(name: "Main", bundle: nil) + + // MARK: - Properties + + var childCoordinators: [Coordinator] = [] + + var rootViewController: UIViewController { + return self.connectionsTableViewController + } + + var connectionsTableViewController: ConnectionsTableViewController! + + /// Window to manage + let window: UIWindow + + let navigationController: UINavigationController = { + let navController = UINavigationController() + return navController + }() + + // MARK: - Init + public init(window: UIWindow) { + self.window = window + + self.window.rootViewController = self.navigationController + self.window.makeKeyAndVisible() + } + + // MARK: - Functions + + /// Starts the coordinator + public func start() { + persistentContainer.viewContext.automaticallyMergesChangesFromParent = true + persistentContainer.loadPersistentStores { [weak self] (_, error) in + if let error = error { + print("Unable to Load Persistent Store. \(error), \(error.localizedDescription)") + + } else { + DispatchQueue.main.async { + //start + if let connectionsTableViewController = self?.storyboard.instantiateViewController(type: ConnectionsTableViewController.self) { + self?.connectionsTableViewController = connectionsTableViewController + self?.connectionsTableViewController.viewContext = self?.persistentContainer.viewContext + self?.connectionsTableViewController.delegate = self + self?.navigationController.viewControllers = [connectionsTableViewController] + do { + if let context = self?.persistentContainer.viewContext, try Profile.countInContext(context) == 0 { + print("No profiles ... yet") + } + } catch { + self?.showError(error) + } + } + } + } + } + } + + public func showError(_ error: Error) { + showAlert(title: NSLocalizedString("Error", comment: "Error alert title"), message: error.localizedDescription) + } + + private func showAlert(title: String, message: String) { + let alert = UIAlertController(title: title, message: message, preferredStyle: .alert) + alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: "OK button"), style: .default)) + self.navigationController.present(alert, animated: true) + } +} + +extension AppCoordinator: ConnectionsTableViewControllerDelegate { + func addProvider(connectionsTableViewController: ConnectionsTableViewController) { + // TODO implement + } + + func settings(connectionsTableViewController: ConnectionsTableViewController) { + // TODO implement + } + + func connect(profile: Profile) { + // TODO implement + } + + func delete(profile: Profile) { + // TODO implement + } +} diff --git a/Wireguard/Coordinators/Coordinator.swift b/Wireguard/Coordinators/Coordinator.swift new file mode 100644 index 0000000..d1075a3 --- /dev/null +++ b/Wireguard/Coordinators/Coordinator.swift @@ -0,0 +1,34 @@ +// +// Coordinator.swift +// Wireguard +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// + +import Foundation + +/// The Coordinator protocol +public protocol Coordinator: class { + + /// Starts the coordinator + func start() + + /// The array containing any child Coordinators + var childCoordinators: [Coordinator] { get set } + +} + +public extension Coordinator { + + /// Add a child coordinator to the parent + public func addChildCoordinator(_ childCoordinator: Coordinator) { + self.childCoordinators.append(childCoordinator) + } + + /// Remove a child coordinator from the parent + public func removeChildCoordinator(_ childCoordinator: Coordinator) { + self.childCoordinators = self.childCoordinators.filter { $0 !== childCoordinator } + } + +} diff --git a/Wireguard/Coordinators/RootCoordinator.swift b/Wireguard/Coordinators/RootCoordinator.swift new file mode 100644 index 0000000..0319fef --- /dev/null +++ b/Wireguard/Coordinators/RootCoordinator.swift @@ -0,0 +1,19 @@ +// +// RootCoordinator.swift +// Wireguard +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// + +import Foundation +import UIKit + +public protocol RootViewControllerProvider: class { + // The coordinators 'rootViewController'. It helps to think of this as the view + // controller that can be used to dismiss the coordinator from the view hierarchy. + var rootViewController: UIViewController { get } +} + +/// A Coordinator type that provides a root UIViewController +public typealias RootViewCoordinator = Coordinator & RootViewControllerProvider diff --git a/Wireguard/Info.plist b/Wireguard/Info.plist new file mode 100644 index 0000000..5d036c8 --- /dev/null +++ b/Wireguard/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + auto-generated + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Wireguard/Models/Profile+CoreDataClass.swift b/Wireguard/Models/Profile+CoreDataClass.swift new file mode 100644 index 0000000..ab7c2aa --- /dev/null +++ b/Wireguard/Models/Profile+CoreDataClass.swift @@ -0,0 +1,16 @@ +// +// Profile+CoreDataClass.swift +// Wireguard +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// +// + +import Foundation +import CoreData + +@objc(Profile) +public class Profile: NSManagedObject { + +} diff --git a/Wireguard/Models/Profile+CoreDataProperties.swift b/Wireguard/Models/Profile+CoreDataProperties.swift new file mode 100644 index 0000000..8e99ac2 --- /dev/null +++ b/Wireguard/Models/Profile+CoreDataProperties.swift @@ -0,0 +1,19 @@ +// +// Profile+CoreDataProperties.swift +// Wireguard +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// +// + +import Foundation +import CoreData + +extension Profile { + + @nonobjc public class func fetchRequest() -> NSFetchRequest { + return NSFetchRequest(entityName: "Profile") + } + +} diff --git a/Wireguard/Models/Wireguard.xcdatamodeld/Wireguard.xcdatamodel/contents b/Wireguard/Models/Wireguard.xcdatamodeld/Wireguard.xcdatamodel/contents new file mode 100644 index 0000000..7bced00 --- /dev/null +++ b/Wireguard/Models/Wireguard.xcdatamodeld/Wireguard.xcdatamodel/contents @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Wireguard/ViewControllers/ConnectionsTableViewController.swift b/Wireguard/ViewControllers/ConnectionsTableViewController.swift new file mode 100644 index 0000000..38c0955 --- /dev/null +++ b/Wireguard/ViewControllers/ConnectionsTableViewController.swift @@ -0,0 +1,38 @@ +// +// ConnectionsTableViewController.swift +// Wireguard +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// + +import UIKit + +import CoreData +import BNRCoreDataStack + +protocol ConnectionsTableViewControllerDelegate: class { + func addProvider(connectionsTableViewController: ConnectionsTableViewController) + func settings(connectionsTableViewController: ConnectionsTableViewController) + func connect(profile: Profile) + func delete(profile: Profile) +} + +class ConnectionsTableViewController: UITableViewController { + weak var delegate: ConnectionsTableViewControllerDelegate? + + var viewContext: NSManagedObjectContext! + + override func viewDidLoad() { + super.viewDidLoad() + // Do any additional setup after loading the view, typically from a nib. + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + // Dispose of any resources that can be recreated. + } + +} + +extension ConnectionsTableViewController: Identifyable {} diff --git a/Wireguard/ViewControllers/Identifyable.swift b/Wireguard/ViewControllers/Identifyable.swift new file mode 100644 index 0000000..9312afe --- /dev/null +++ b/Wireguard/ViewControllers/Identifyable.swift @@ -0,0 +1,27 @@ +// +// Identifyable.swift +// Wireguard +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// + +import Foundation +import UIKit + +public protocol Identifyable: class { + static var identifier: String { get } +} + +public extension Identifyable { + static var identifier: String { + return String(describing: Self.self) + } +} + +extension UIStoryboard { + + public func instantiateViewController(type: T.Type) -> T where T: UIViewController { + return self.instantiateViewController(withIdentifier: type.identifier) as! T // swiftlint:disable:this force_cast + } +} diff --git a/WireguardTests/Info.plist b/WireguardTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/WireguardTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/WireguardTests/WireguardTests.swift b/WireguardTests/WireguardTests.swift new file mode 100644 index 0000000..50448b6 --- /dev/null +++ b/WireguardTests/WireguardTests.swift @@ -0,0 +1,36 @@ +// +// WireguardTests.swift +// WireguardTests +// +// Created by Jeroen Leenarts on 23-05-18. +// Copyright © 2018 Wireguard. All rights reserved. +// + +import XCTest +@testable import Wireguard + +class WireguardTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +}