]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
project: Added WireGuardIntentsExtensioniOS target and Siri capability
authorAlessio Nossa <alessio.nossa@gmail.com>
Fri, 28 Jan 2022 20:37:06 +0000 (21:37 +0100)
committerAlessio Nossa <alessio.nossa@gmail.com>
Tue, 1 Feb 2022 19:11:33 +0000 (20:11 +0100)
Signed-off-by: Alessio Nossa <alessio.nossa@gmail.com>
Sources/WireGuardApp/UI/iOS/WireGuard.entitlements
Sources/WireGuardIntentsExtension/Info.plist [new file with mode: 0644]
Sources/WireGuardIntentsExtension/IntentHandler.swift [new file with mode: 0644]
Sources/WireGuardIntentsExtension/WireGuardIntentsExtension-Bridging-Header.h [new file with mode: 0644]
Sources/WireGuardIntentsExtension/WireGuardIntentsExtension_iOS.entitlements [new file with mode: 0644]
WireGuard.xcodeproj/project.pbxproj

index 93c72493639cf64a2dd7454a88e8ebb8bc500dc9..60d6ee42930805881ef91d54460ffdd037b76074 100644 (file)
@@ -8,6 +8,8 @@
        </array>
        <key>com.apple.developer.networking.wifi-info</key>
        <true/>
+       <key>com.apple.developer.siri</key>
+       <true/>
        <key>com.apple.security.application-groups</key>
        <array>
                <string>group.$(APP_ID_IOS)</string>
diff --git a/Sources/WireGuardIntentsExtension/Info.plist b/Sources/WireGuardIntentsExtension/Info.plist
new file mode 100644 (file)
index 0000000..dac8df5
--- /dev/null
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>ITSAppUsesNonExemptEncryption</key>
+       <false/>
+       <key>CFBundleDevelopmentRegion</key>
+       <string>$(DEVELOPMENT_LANGUAGE)</string>
+       <key>CFBundleDisplayName</key>
+       <string>WireGuardIntentsExtension</string>
+       <key>CFBundleExecutable</key>
+       <string>$(EXECUTABLE_NAME)</string>
+       <key>CFBundleIdentifier</key>
+       <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+       <key>CFBundleInfoDictionaryVersion</key>
+       <string>6.0</string>
+       <key>CFBundleName</key>
+       <string>$(PRODUCT_NAME)</string>
+       <key>CFBundlePackageType</key>
+       <string>XPC!</string>
+       <key>CFBundleShortVersionString</key>
+       <string>$(VERSION_NAME)</string>
+       <key>CFBundleVersion</key>
+       <string>$(VERSION_ID)</string>
+       <key>NSExtension</key>
+       <dict>
+               <key>NSExtensionAttributes</key>
+               <dict>
+                       <key>IntentsRestrictedWhileLocked</key>
+                       <array/>
+                       <key>IntentsSupported</key>
+                       <array/>
+               </dict>
+               <key>NSExtensionPointIdentifier</key>
+               <string>com.apple.intents-service</string>
+               <key>NSExtensionPrincipalClass</key>
+               <string>$(PRODUCT_MODULE_NAME).IntentHandler</string>
+       </dict>
+       <key>com.wireguard.ios.app_group_id</key>
+       <string>group.$(APP_ID_IOS)</string>
+       <key>LSMinimumSystemVersion</key>
+       <string>$(MACOSX_DEPLOYMENT_TARGET)</string>
+       <key>com.wireguard.macos.app_group_id</key>
+       <string>$(DEVELOPMENT_TEAM).group.$(APP_ID_MACOS)</string>
+</dict>
+</plist>
diff --git a/Sources/WireGuardIntentsExtension/IntentHandler.swift b/Sources/WireGuardIntentsExtension/IntentHandler.swift
new file mode 100644 (file)
index 0000000..fc4899c
--- /dev/null
@@ -0,0 +1,15 @@
+// SPDX-License-Identifier: MIT
+// Copyright © 2018-2021 WireGuard LLC. All Rights Reserved.
+
+import Intents
+
+class IntentHandler: INExtension {
+
+    override func handler(for intent: INIntent) -> Any {
+        // This is the default implementation.  If you want different objects to handle different intents,
+        // you can override this and return the handler you want for that particular intent.
+
+        return self
+    }
+
+}
diff --git a/Sources/WireGuardIntentsExtension/WireGuardIntentsExtension-Bridging-Header.h b/Sources/WireGuardIntentsExtension/WireGuardIntentsExtension-Bridging-Header.h
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
diff --git a/Sources/WireGuardIntentsExtension/WireGuardIntentsExtension_iOS.entitlements b/Sources/WireGuardIntentsExtension/WireGuardIntentsExtension_iOS.entitlements
new file mode 100644 (file)
index 0000000..75c276b
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+       <key>com.apple.security.application-groups</key>
+       <array>
+               <string>group.$(APP_ID_IOS)</string>
+       </array>
+</dict>
+</plist>
index 25016cd188b9df4f890b755597e1f12a45aacb9a..5ed7ad0d43df7d7af0c8235665cf929bf5dcd445 100644 (file)
                6FFA5DA021958ECC0001E2F7 /* ErrorNotifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FFA5D9F21958ECC0001E2F7 /* ErrorNotifier.swift */; };
                6FFA5DA42197085D0001E2F7 /* ActivateOnDemandOption.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FFA5DA32197085D0001E2F7 /* ActivateOnDemandOption.swift */; };
                6FFACD2021E4D8D500E9A2A5 /* ParseError+WireGuardAppError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FFACD1E21E4D89600E9A2A5 /* ParseError+WireGuardAppError.swift */; };
+               A6B8051C27A44F770088E750 /* Intents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A6B8051B27A44F770088E750 /* Intents.framework */; };
+               A6B8051F27A44F770088E750 /* IntentHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6B8051E27A44F770088E750 /* IntentHandler.swift */; };
+               A6B8052327A44F770088E750 /* WireGuardIntentsExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = A6B8051A27A44F770088E750 /* WireGuardIntentsExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
                        remoteGlobalIDString = 6FDEF7DD21846BC100D8FBF6;
                        remoteInfo = WireGuardGoBridge;
                };
+               A6B8052127A44F770088E750 /* PBXContainerItemProxy */ = {
+                       isa = PBXContainerItemProxy;
+                       containerPortal = 6FF4AC0C211EC46F002C96EB /* Project object */;
+                       proxyType = 1;
+                       remoteGlobalIDString = A6B8051927A44F770088E750;
+                       remoteInfo = WireGuardIntentsExtensioniOS;
+               };
 /* End PBXContainerItemProxy section */
 
 /* Begin PBXCopyFilesBuildPhase section */
                        dstSubfolderSpec = 13;
                        files = (
                                6F5D0C22218352EF000F85AD /* WireGuardNetworkExtension.appex in Embed App Extensions */,
+                               A6B8052327A44F770088E750 /* WireGuardIntentsExtension.appex in Embed App Extensions */,
                        );
                        name = "Embed App Extensions";
                        runOnlyForDeploymentPostprocessing = 0;
                6FFA5D9F21958ECC0001E2F7 /* ErrorNotifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ErrorNotifier.swift; sourceTree = "<group>"; };
                6FFA5DA32197085D0001E2F7 /* ActivateOnDemandOption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivateOnDemandOption.swift; sourceTree = "<group>"; };
                6FFACD1E21E4D89600E9A2A5 /* ParseError+WireGuardAppError.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ParseError+WireGuardAppError.swift"; sourceTree = "<group>"; };
+               A64A79D727A462FC00F15B34 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+               A64A79D827A48A8E00F15B34 /* WireGuardIntentsExtension-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "WireGuardIntentsExtension-Bridging-Header.h"; sourceTree = "<group>"; };
+               A6B8051A27A44F770088E750 /* WireGuardIntentsExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = WireGuardIntentsExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; };
+               A6B8051B27A44F770088E750 /* Intents.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Intents.framework; path = System/Library/Frameworks/Intents.framework; sourceTree = SDKROOT; };
+               A6B8051E27A44F770088E750 /* IntentHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IntentHandler.swift; sourceTree = "<group>"; };
+               A6B8052727A454150088E750 /* WireGuardIntentsExtension_iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WireGuardIntentsExtension_iOS.entitlements; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               A6B8051727A44F770088E750 /* Frameworks */ = {
+                       isa = PBXFrameworksBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               A6B8051C27A44F770088E750 /* Intents.framework in Frameworks */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
                                6F5D0C432183B4A4000F85AD /* Shared */,
                                6FF4AC16211EC46F002C96EB /* WireGuardApp */,
                                6F5D0C1B218352EF000F85AD /* WireGuardNetworkExtension */,
+                               A6B8051D27A44F770088E750 /* WireGuardIntentsExtension */,
                                585B10452577E293004F691E /* WireGuardKit */,
                                585B10532577E293004F691E /* WireGuardKitC */,
                                6FF4AC15211EC46F002C96EB /* Products */,
                                6FB1BD5D21D2607A00A991BF /* WireGuard.app */,
                                6FB1BD9121D4BFE600A991BF /* WireGuardNetworkExtension.appex */,
                                6F70E22922106A2D008BDFB4 /* WireGuardLoginItemHelper.app */,
+                               A6B8051A27A44F770088E750 /* WireGuardIntentsExtension.appex */,
                        );
                        name = Products;
                        sourceTree = "<group>";
                                58DB6CD52577F95D00FB6B73 /* libwg-go.a */,
                                6FB1BDB621D4F8B800A991BF /* NetworkExtension.framework */,
                                6FF4AC462120B9E0002C96EB /* NetworkExtension.framework */,
+                               A6B8051B27A44F770088E750 /* Intents.framework */,
                        );
                        name = Frameworks;
                        sourceTree = "<group>";
                };
+               A6B8051D27A44F770088E750 /* WireGuardIntentsExtension */ = {
+                       isa = PBXGroup;
+                       children = (
+                               A64A79D727A462FC00F15B34 /* Info.plist */,
+                               A6B8052727A454150088E750 /* WireGuardIntentsExtension_iOS.entitlements */,
+                               A64A79D827A48A8E00F15B34 /* WireGuardIntentsExtension-Bridging-Header.h */,
+                               A6B8051E27A44F770088E750 /* IntentHandler.swift */,
+                       );
+                       name = WireGuardIntentsExtension;
+                       path = Sources/WireGuardIntentsExtension;
+                       sourceTree = "<group>";
+               };
 /* End PBXGroup section */
 
 /* Begin PBXLegacyTarget section */
                        );
                        dependencies = (
                                6F5D0C21218352EF000F85AD /* PBXTargetDependency */,
+                               A6B8052227A44F770088E750 /* PBXTargetDependency */,
                        );
                        name = WireGuardiOS;
                        packageProductDependencies = (
                        productReference = 6FF4AC14211EC46F002C96EB /* WireGuard.app */;
                        productType = "com.apple.product-type.application";
                };
+               A6B8051927A44F770088E750 /* WireGuardIntentsExtensioniOS */ = {
+                       isa = PBXNativeTarget;
+                       buildConfigurationList = A6B8052427A44F770088E750 /* Build configuration list for PBXNativeTarget "WireGuardIntentsExtensioniOS" */;
+                       buildPhases = (
+                               A6B8051627A44F770088E750 /* Sources */,
+                               A6B8051727A44F770088E750 /* Frameworks */,
+                               A6B8051827A44F770088E750 /* Resources */,
+                       );
+                       buildRules = (
+                       );
+                       dependencies = (
+                       );
+                       name = WireGuardIntentsExtensioniOS;
+                       productName = WireGuardIntentsExtensioniOS;
+                       productReference = A6B8051A27A44F770088E750 /* WireGuardIntentsExtension.appex */;
+                       productType = "com.apple.product-type.app-extension";
+               };
 /* End PBXNativeTarget section */
 
 /* Begin PBXProject section */
                6FF4AC0C211EC46F002C96EB /* Project object */ = {
                        isa = PBXProject;
                        attributes = {
-                               LastSwiftUpdateCheck = 1010;
+                               LastSwiftUpdateCheck = 1320;
                                LastUpgradeCheck = 1010;
                                ORGANIZATIONNAME = "WireGuard LLC";
                                TargetAttributes = {
                                                        };
                                                };
                                        };
+                                       A6B8051927A44F770088E750 = {
+                                               CreatedOnToolsVersion = 13.2.1;
+                                       };
                                };
                        };
                        buildConfigurationList = 6FF4AC0F211EC46F002C96EB /* Build configuration list for PBXProject "WireGuard" */;
                        targets = (
                                6FF4AC13211EC46F002C96EB /* WireGuardiOS */,
                                6F5D0C19218352EF000F85AD /* WireGuardNetworkExtensioniOS */,
+                               A6B8051927A44F770088E750 /* WireGuardIntentsExtensioniOS */,
                                6FDEF7DD21846BC100D8FBF6 /* WireGuardGoBridgeiOS */,
                                6FB1BD5C21D2607A00A991BF /* WireGuardmacOS */,
                                6FB1BD9021D4BFE600A991BF /* WireGuardNetworkExtensionmacOS */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               A6B8051827A44F770088E750 /* Resources */ = {
+                       isa = PBXResourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
+               A6B8051627A44F770088E750 /* Sources */ = {
+                       isa = PBXSourcesBuildPhase;
+                       buildActionMask = 2147483647;
+                       files = (
+                               A6B8051F27A44F770088E750 /* IntentHandler.swift in Sources */,
+                       );
+                       runOnlyForDeploymentPostprocessing = 0;
+               };
 /* End PBXSourcesBuildPhase section */
 
 /* Begin PBXTargetDependency section */
                        target = 6FDEF7DD21846BC100D8FBF6 /* WireGuardGoBridgeiOS */;
                        targetProxy = 6FDEF7E121846C0000D8FBF6 /* PBXContainerItemProxy */;
                };
+               A6B8052227A44F770088E750 /* PBXTargetDependency */ = {
+                       isa = PBXTargetDependency;
+                       target = A6B8051927A44F770088E750 /* WireGuardIntentsExtensioniOS */;
+                       targetProxy = A6B8052127A44F770088E750 /* PBXContainerItemProxy */;
+               };
 /* End PBXTargetDependency section */
 
 /* Begin PBXVariantGroup section */
                        };
                        name = Release;
                };
+               A6B8052527A44F770088E750 /* Debug */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
+                               CLANG_ENABLE_MODULES = YES;
+                               CODE_SIGN_ENTITLEMENTS = Sources/WireGuardIntentsExtension/WireGuardIntentsExtension_iOS.entitlements;
+                               CODE_SIGN_IDENTITY = "iPhone Developer";
+                               ENABLE_BITCODE = NO;
+                               INFOPLIST_FILE = Sources/WireGuardIntentsExtension/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "@executable_path/Frameworks",
+                                       "@executable_path/../../Frameworks",
+                               );
+                               MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+                               PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID_IOS).intents-extension";
+                               PRODUCT_NAME = WireGuardIntentsExtension;
+                               SKIP_INSTALL = YES;
+                               SWIFT_OBJC_BRIDGING_HEADER = "Sources/WireGuardIntentsExtension/WireGuardIntentsExtension-Bridging-Header.h";
+                               SWIFT_VERSION = 5.0;
+                       };
+                       name = Debug;
+               };
+               A6B8052627A44F770088E750 /* Release */ = {
+                       isa = XCBuildConfiguration;
+                       buildSettings = {
+                               ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO;
+                               CLANG_ENABLE_MODULES = YES;
+                               CODE_SIGN_ENTITLEMENTS = Sources/WireGuardIntentsExtension/WireGuardIntentsExtension_iOS.entitlements;
+                               CODE_SIGN_IDENTITY = "iPhone Developer";
+                               ENABLE_BITCODE = NO;
+                               INFOPLIST_FILE = Sources/WireGuardIntentsExtension/Info.plist;
+                               LD_RUNPATH_SEARCH_PATHS = (
+                                       "$(inherited)",
+                                       "@executable_path/Frameworks",
+                                       "@executable_path/../../Frameworks",
+                               );
+                               PRODUCT_BUNDLE_IDENTIFIER = "$(APP_ID_IOS).intents-extension";
+                               PRODUCT_NAME = WireGuardIntentsExtension;
+                               SKIP_INSTALL = YES;
+                               SWIFT_OBJC_BRIDGING_HEADER = "Sources/WireGuardIntentsExtension/WireGuardIntentsExtension-Bridging-Header.h";
+                               SWIFT_VERSION = 5.0;
+                       };
+                       name = Release;
+               };
 /* End XCBuildConfiguration section */
 
 /* Begin XCConfigurationList section */
                        defaultConfigurationIsVisible = 0;
                        defaultConfigurationName = Release;
                };
+               A6B8052427A44F770088E750 /* Build configuration list for PBXNativeTarget "WireGuardIntentsExtensioniOS" */ = {
+                       isa = XCConfigurationList;
+                       buildConfigurations = (
+                               A6B8052527A44F770088E750 /* Debug */,
+                               A6B8052627A44F770088E750 /* Release */,
+                       );
+                       defaultConfigurationIsVisible = 0;
+                       defaultConfigurationName = Release;
+               };
 /* End XCConfigurationList section */
        };
        rootObject = 6FF4AC0C211EC46F002C96EB /* Project object */;