From f6772dc3536698c7d1484ccf5811a4e3dd07ab8c Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Tue, 25 Dec 2018 18:33:28 +0530 Subject: [PATCH] macOS: Add WireGuardmacOS target Signed-off-by: Roopesh Chander --- WireGuard/WireGuard.xcodeproj/project.pbxproj | 138 +++- WireGuard/WireGuardmacOS/AppDelegate.swift | 22 + .../AppIcon.appiconset/Contents.json | 58 ++ .../Assets.xcassets/Contents.json | 6 + .../WireGuardmacOS/Base.lproj/MainMenu.xib | 692 ++++++++++++++++++ WireGuard/WireGuardmacOS/Info.plist | 32 + .../WireGuardmacOS.entitlements | 10 + 7 files changed, 957 insertions(+), 1 deletion(-) create mode 100644 WireGuard/WireGuardmacOS/AppDelegate.swift create mode 100644 WireGuard/WireGuardmacOS/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 WireGuard/WireGuardmacOS/Assets.xcassets/Contents.json create mode 100644 WireGuard/WireGuardmacOS/Base.lproj/MainMenu.xib create mode 100644 WireGuard/WireGuardmacOS/Info.plist create mode 100644 WireGuard/WireGuardmacOS/WireGuardmacOS.entitlements diff --git a/WireGuard/WireGuard.xcodeproj/project.pbxproj b/WireGuard/WireGuard.xcodeproj/project.pbxproj index 0393133..b19a492 100644 --- a/WireGuard/WireGuard.xcodeproj/project.pbxproj +++ b/WireGuard/WireGuard.xcodeproj/project.pbxproj @@ -52,6 +52,9 @@ 6F919EDB218C65C50023B400 /* wireguard_doc_logo_64x64.png in Resources */ = {isa = PBXBuildFile; fileRef = 6F919ED7218C65C50023B400 /* wireguard_doc_logo_64x64.png */; }; 6F919EDC218C65C50023B400 /* wireguard_doc_logo_320x320.png in Resources */ = {isa = PBXBuildFile; fileRef = 6F919ED8218C65C50023B400 /* wireguard_doc_logo_320x320.png */; }; 6FB1017921C57DE600766195 /* MockTunnels.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FB1017821C57DE600766195 /* MockTunnels.swift */; }; + 6FB1BD6021D2607A00A991BF /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FB1BD5F21D2607A00A991BF /* AppDelegate.swift */; }; + 6FB1BD6221D2607E00A991BF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6FB1BD6121D2607E00A991BF /* Assets.xcassets */; }; + 6FB1BD6521D2607E00A991BF /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6FB1BD6321D2607E00A991BF /* MainMenu.xib */; }; 6FDEF7E421846C1A00D8FBF6 /* libwg-go.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6FDEF7E321846C1A00D8FBF6 /* libwg-go.a */; }; 6FDEF7E62185EFB200D8FBF6 /* QRScanViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FDEF7E52185EFAF00D8FBF6 /* QRScanViewController.swift */; }; 6FDEF7FB21863B6100D8FBF6 /* unzip.c in Sources */ = {isa = PBXBuildFile; fileRef = 6FDEF7F621863B6100D8FBF6 /* unzip.c */; }; @@ -159,6 +162,12 @@ 6F919ED7218C65C50023B400 /* wireguard_doc_logo_64x64.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wireguard_doc_logo_64x64.png; sourceTree = ""; }; 6F919ED8218C65C50023B400 /* wireguard_doc_logo_320x320.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wireguard_doc_logo_320x320.png; sourceTree = ""; }; 6FB1017821C57DE600766195 /* MockTunnels.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockTunnels.swift; sourceTree = ""; }; + 6FB1BD5D21D2607A00A991BF /* WireGuardmacOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = WireGuardmacOS.app; path = WireGuard.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 6FB1BD5F21D2607A00A991BF /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 6FB1BD6121D2607E00A991BF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 6FB1BD6421D2607E00A991BF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; + 6FB1BD6621D2607E00A991BF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 6FB1BD6721D2607E00A991BF /* WireGuardmacOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WireGuardmacOS.entitlements; sourceTree = ""; }; 6FDEF7E321846C1A00D8FBF6 /* libwg-go.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libwg-go.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 6FDEF7E52185EFAF00D8FBF6 /* QRScanViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QRScanViewController.swift; sourceTree = ""; }; 6FDEF7F621863B6100D8FBF6 /* unzip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = unzip.c; sourceTree = ""; }; @@ -197,6 +206,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6FB1BD5A21D2607A00A991BF /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6FF4AC11211EC46F002C96EB /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -339,6 +355,18 @@ path = DocumentIcons; sourceTree = ""; }; + 6FB1BD5E21D2607A00A991BF /* WireGuardmacOS */ = { + isa = PBXGroup; + children = ( + 6FB1BD5F21D2607A00A991BF /* AppDelegate.swift */, + 6FB1BD6121D2607E00A991BF /* Assets.xcassets */, + 6FB1BD6321D2607E00A991BF /* MainMenu.xib */, + 6FB1BD6621D2607E00A991BF /* Info.plist */, + 6FB1BD6721D2607E00A991BF /* WireGuardmacOS.entitlements */, + ); + path = WireGuardmacOS; + sourceTree = ""; + }; 6FDEF7E72186320E00D8FBF6 /* ZipArchive */ = { isa = PBXGroup; children = ( @@ -388,6 +416,7 @@ 6F5D0C432183B4A4000F85AD /* Shared */, 6FF4AC16211EC46F002C96EB /* WireGuard */, 6F5D0C1B218352EF000F85AD /* WireGuardNetworkExtension */, + 6FB1BD5E21D2607A00A991BF /* WireGuardmacOS */, 6FF4AC15211EC46F002C96EB /* Products */, 6FF4AC452120B9E0002C96EB /* Frameworks */, ); @@ -398,6 +427,7 @@ children = ( 6FF4AC14211EC46F002C96EB /* WireGuardiOS.app */, 6F5D0C1A218352EF000F85AD /* WireGuardNetworkExtensioniOS.appex */, + 6FB1BD5D21D2607A00A991BF /* WireGuardmacOS.app */, ); name = Products; sourceTree = ""; @@ -484,6 +514,23 @@ productReference = 6F5D0C1A218352EF000F85AD /* WireGuardNetworkExtensioniOS.appex */; productType = "com.apple.product-type.app-extension"; }; + 6FB1BD5C21D2607A00A991BF /* WireGuardmacOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = 6FB1BD6A21D2607E00A991BF /* Build configuration list for PBXNativeTarget "WireGuardmacOS" */; + buildPhases = ( + 6FB1BD5921D2607A00A991BF /* Sources */, + 6FB1BD5A21D2607A00A991BF /* Frameworks */, + 6FB1BD5B21D2607A00A991BF /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = WireGuardmacOS; + productName = WireGuardmacOS; + productReference = 6FB1BD5D21D2607A00A991BF /* WireGuardmacOS.app */; + productType = "com.apple.product-type.application"; + }; 6FF4AC13211EC46F002C96EB /* WireGuardiOS */ = { isa = PBXNativeTarget; buildConfigurationList = 6FF4AC26211EC472002C96EB /* Build configuration list for PBXNativeTarget "WireGuardiOS" */; @@ -512,7 +559,7 @@ 6FF4AC0C211EC46F002C96EB /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1000; + LastSwiftUpdateCheck = 1010; LastUpgradeCheck = 1010; ORGANIZATIONNAME = "WireGuard LLC"; TargetAttributes = { @@ -520,6 +567,9 @@ CreatedOnToolsVersion = 10.0; LastSwiftMigration = 1000; }; + 6FB1BD5C21D2607A00A991BF = { + CreatedOnToolsVersion = 10.1; + }; 6FDEF7DD21846BC100D8FBF6 = { CreatedOnToolsVersion = 10.0; }; @@ -553,6 +603,7 @@ 6FF4AC13211EC46F002C96EB /* WireGuardiOS */, 6F5D0C19218352EF000F85AD /* WireGuardNetworkExtensioniOS */, 6FDEF7DD21846BC100D8FBF6 /* WireGuardGoBridgeiOS */, + 6FB1BD5C21D2607A00A991BF /* WireGuardmacOS */, 6FDAA03421CE69D000FA6925 /* WireGuardGoBridgemacOS */, ); }; @@ -566,6 +617,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6FB1BD5B21D2607A00A991BF /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6FB1BD6221D2607E00A991BF /* Assets.xcassets in Resources */, + 6FB1BD6521D2607E00A991BF /* MainMenu.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6FF4AC12211EC46F002C96EB /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -702,6 +762,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 6FB1BD5921D2607A00A991BF /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 6FB1BD6021D2607A00A991BF /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 6FF4AC10211EC46F002C96EB /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -771,6 +839,14 @@ /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ + 6FB1BD6321D2607E00A991BF /* MainMenu.xib */ = { + isa = PBXVariantGroup; + children = ( + 6FB1BD6421D2607E00A991BF /* Base */, + ); + name = MainMenu.xib; + sourceTree = ""; + }; 6FE1765421C90BBE002690EA /* Localizable.strings */ = { isa = PBXVariantGroup; children = ( @@ -835,6 +911,57 @@ }; name = Release; }; + 6FB1BD6821D2607E00A991BF /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_ENTITLEMENTS = WireGuardmacOS/WireGuardmacOS.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + INFOPLIST_FILE = WireGuardmacOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID_MACOS)"; + PRODUCT_NAME = WireGuard; + SDKROOT = macosx; + SWIFT_VERSION = 4.2; + }; + name = Debug; + }; + 6FB1BD6921D2607E00A991BF /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_WARN_UNREACHABLE_CODE = YES; + CODE_SIGN_ENTITLEMENTS = WireGuardmacOS/WireGuardmacOS.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer"; + CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + INFOPLIST_FILE = WireGuardmacOS/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID_MACOS)"; + PRODUCT_NAME = WireGuard; + SDKROOT = macosx; + SWIFT_VERSION = 4.2; + }; + name = Release; + }; 6FDAA03621CE69D000FA6925 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1057,6 +1184,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 6FB1BD6A21D2607E00A991BF /* Build configuration list for PBXNativeTarget "WireGuardmacOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 6FB1BD6821D2607E00A991BF /* Debug */, + 6FB1BD6921D2607E00A991BF /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; 6FDAA03521CE69D000FA6925 /* Build configuration list for PBXLegacyTarget "WireGuardGoBridgemacOS" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/WireGuard/WireGuardmacOS/AppDelegate.swift b/WireGuard/WireGuardmacOS/AppDelegate.swift new file mode 100644 index 0000000..fb0094d --- /dev/null +++ b/WireGuard/WireGuardmacOS/AppDelegate.swift @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: MIT +// Copyright © 2018 WireGuard LLC. All Rights Reserved. + +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + @IBOutlet weak var window: NSWindow! + + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + +} + diff --git a/WireGuard/WireGuardmacOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/WireGuard/WireGuardmacOS/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2db2b1c --- /dev/null +++ b/WireGuard/WireGuardmacOS/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,58 @@ +{ + "images" : [ + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "16x16", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "32x32", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "128x128", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "256x256", + "scale" : "2x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "1x" + }, + { + "idiom" : "mac", + "size" : "512x512", + "scale" : "2x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/WireGuard/WireGuardmacOS/Assets.xcassets/Contents.json b/WireGuard/WireGuardmacOS/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/WireGuard/WireGuardmacOS/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/WireGuard/WireGuardmacOS/Base.lproj/MainMenu.xib b/WireGuard/WireGuardmacOS/Base.lproj/MainMenu.xib new file mode 100644 index 0000000..47e4888 --- /dev/null +++ b/WireGuard/WireGuardmacOS/Base.lproj/MainMenu.xib @@ -0,0 +1,692 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + Default + + + + + + + Left to Right + + + + + + + Right to Left + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WireGuard/WireGuardmacOS/Info.plist b/WireGuard/WireGuardmacOS/Info.plist new file mode 100644 index 0000000..c7a6901 --- /dev/null +++ b/WireGuard/WireGuardmacOS/Info.plist @@ -0,0 +1,32 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIconFile + + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2018 WireGuard LLC. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + + diff --git a/WireGuard/WireGuardmacOS/WireGuardmacOS.entitlements b/WireGuard/WireGuardmacOS/WireGuardmacOS.entitlements new file mode 100644 index 0000000..f2ef3ae --- /dev/null +++ b/WireGuard/WireGuardmacOS/WireGuardmacOS.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected.read-only + + +