diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-03-19 15:30:13 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-03-27 14:15:53 +0100 |
| commit | 1ec0e389301a11bc18426ce2bf1d81aa28792e97 (patch) | |
| tree | fa55ffdf7475abfc444813e58780724a4fc87dcc /ios/PacketTunnel | |
| parent | 89b45be8f6159cfb23071c5fd241edb1ff41921c (diff) | |
| download | mullvadvpn-1ec0e389301a11bc18426ce2bf1d81aa28792e97.tar.xz mullvadvpn-1ec0e389301a11bc18426ce2bf1d81aa28792e97.zip | |
Bootstrap iOS app
Diffstat (limited to 'ios/PacketTunnel')
| -rw-r--r-- | ios/PacketTunnel/Info.plist | 31 | ||||
| -rw-r--r-- | ios/PacketTunnel/PacketTunnel.entitlements | 10 | ||||
| -rw-r--r-- | ios/PacketTunnel/PacketTunnelProvider.swift | 37 |
3 files changed, 78 insertions, 0 deletions
diff --git a/ios/PacketTunnel/Info.plist b/ios/PacketTunnel/Info.plist new file mode 100644 index 0000000000..368f1046e1 --- /dev/null +++ b/ios/PacketTunnel/Info.plist @@ -0,0 +1,31 @@ +<?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>CFBundleDevelopmentRegion</key> + <string>$(DEVELOPMENT_LANGUAGE)</string> + <key>CFBundleDisplayName</key> + <string>PacketTunnel</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>1.0</string> + <key>CFBundleVersion</key> + <string>1</string> + <key>NSExtension</key> + <dict> + <key>NSExtensionPointIdentifier</key> + <string>com.apple.networkextension.packet-tunnel</string> + <key>NSExtensionPrincipalClass</key> + <string>$(PRODUCT_MODULE_NAME).PacketTunnelProvider</string> + </dict> +</dict> +</plist> diff --git a/ios/PacketTunnel/PacketTunnel.entitlements b/ios/PacketTunnel/PacketTunnel.entitlements new file mode 100644 index 0000000000..a8a939a254 --- /dev/null +++ b/ios/PacketTunnel/PacketTunnel.entitlements @@ -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.net.mullvad.MullvadVPN</string> + </array> +</dict> +</plist> diff --git a/ios/PacketTunnel/PacketTunnelProvider.swift b/ios/PacketTunnel/PacketTunnelProvider.swift new file mode 100644 index 0000000000..914bce9c2c --- /dev/null +++ b/ios/PacketTunnel/PacketTunnelProvider.swift @@ -0,0 +1,37 @@ +// +// PacketTunnelProvider.swift +// PacketTunnel +// +// Created by pronebird on 19/03/2019. +// Copyright © 2019 Amagicom AB. All rights reserved. +// + +import NetworkExtension + +class PacketTunnelProvider: NEPacketTunnelProvider { + + override func startTunnel(options: [String : NSObject]?, completionHandler: @escaping (Error?) -> Void) { + // Add code here to start the process of connecting the tunnel. + } + + override func stopTunnel(with reason: NEProviderStopReason, completionHandler: @escaping () -> Void) { + // Add code here to start the process of stopping the tunnel. + completionHandler() + } + + override func handleAppMessage(_ messageData: Data, completionHandler: ((Data?) -> Void)?) { + // Add code here to handle the message. + if let handler = completionHandler { + handler(messageData) + } + } + + override func sleep(completionHandler: @escaping () -> Void) { + // Add code here to get ready to sleep. + completionHandler() + } + + override func wake() { + // Add code here to wake up. + } +} |
