aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-11-02 15:39:03 +0530
committerRoopesh Chander <roop@roopc.net>2018-11-02 15:39:10 +0530
commit969e0bda1075399bc7b1a509a130f4a494460ab1 (patch)
tree831232b18bafd7aefffcef15a49568054850d009
parentHandle cell reuse in showing delete buttons in red (diff)
downloadwireguard-apple-969e0bda1075399bc7b1a509a130f4a494460ab1.tar.xz
wireguard-apple-969e0bda1075399bc7b1a509a130f4a494460ab1.zip
Remove files we don't need
Signed-off-by: Roopesh Chander <roop@roopc.net>
-rw-r--r--Resources/Settings.bundle/Acknowledgements.plist5
-rw-r--r--Resources/Settings.bundle/Root.plist53
-rw-r--r--Resources/Settings.bundle/en.lproj/Root.strings5
-rw-r--r--Resources/Settings.bundle/nl.lproj/Root.strings6
-rw-r--r--Resources/icon_20pt.pngbin730 -> 0 bytes
-rw-r--r--Resources/icon_20pt@3x.pngbin2318 -> 0 bytes
-rwxr-xr-xScripts/extract_wireguard_go_version.sh23
-rwxr-xr-xScripts/set_build_number.sh35
-rw-r--r--Shared/ExtensionMessage.swift25
-rw-r--r--Shared/ProviderConfigurationKeys.swift9
-rw-r--r--Shared/Validators.swift180
-rw-r--r--designs/WireGuard-app-icon.sketchbin1900627 -> 0 bytes
-rw-r--r--icon_20pt.pngbin730 -> 0 bytes
13 files changed, 0 insertions, 341 deletions
diff --git a/Resources/Settings.bundle/Acknowledgements.plist b/Resources/Settings.bundle/Acknowledgements.plist
deleted file mode 100644
index 7c82be4..0000000
--- a/Resources/Settings.bundle/Acknowledgements.plist
+++ /dev/null
@@ -1,5 +0,0 @@
-<?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">
-<string></string>
-</plist>
diff --git a/Resources/Settings.bundle/Root.plist b/Resources/Settings.bundle/Root.plist
deleted file mode 100644
index 5bac309..0000000
--- a/Resources/Settings.bundle/Root.plist
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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>PreferenceSpecifiers</key>
- <array>
- <dict>
- <key>Type</key>
- <string>PSGroupSpecifier</string>
- <key>Title</key>
- <string>Version Info</string>
- </dict>
- <dict>
- <key>DefaultValue</key>
- <string>Set at build time.</string>
- <key>Key</key>
- <string>version_preference</string>
- <key>Title</key>
- <string>WireGuard iOS</string>
- <key>Type</key>
- <string>PSTitleValueSpecifier</string>
- </dict>
- <dict>
- <key>DefaultValue</key>
- <string>Set at build time.</string>
- <key>Key</key>
- <string>wireguard_version_preference</string>
- <key>Title</key>
- <string>WireGuard Go</string>
- <key>Type</key>
- <string>PSTitleValueSpecifier</string>
- </dict>
- <dict>
- <key>Type</key>
- <string>PSGroupSpecifier</string>
- <key>FooterText</key>
- <string>Apple Acknowledgement</string>
- </dict>
- <dict>
- <key>Type</key>
- <string>PSChildPaneSpecifier</string>
- <key>Title</key>
- <string>Acknowledgements</string>
- <key>File</key>
- <string>Acknowledgements</string>
- </dict>
- </array>
- <key>StringsTable</key>
- <string>Root</string>
- <key>Title</key>
- <string></string>
-</dict>
-</plist>
diff --git a/Resources/Settings.bundle/en.lproj/Root.strings b/Resources/Settings.bundle/en.lproj/Root.strings
deleted file mode 100644
index 11ce8e4..0000000
--- a/Resources/Settings.bundle/en.lproj/Root.strings
+++ /dev/null
@@ -1,5 +0,0 @@
-/* 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";
-"Apple Acknowledgement" = "This app contains code derived from Apple sample code: https://developer.apple.com/library/archive/samplecode/SimpleTunnel/Introduction/Intro.html";
diff --git a/Resources/Settings.bundle/nl.lproj/Root.strings b/Resources/Settings.bundle/nl.lproj/Root.strings
deleted file mode 100644
index 306b7d1..0000000
--- a/Resources/Settings.bundle/nl.lproj/Root.strings
+++ /dev/null
@@ -1,6 +0,0 @@
-/* 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";
-"Apple Acknowledgement" = "Deze app bevat code afgeleid van Apple voorbeeld code: https://developer.apple.com/library/archive/samplecode/SimpleTunnel/Introduction/Intro.html";
-
diff --git a/Resources/icon_20pt.png b/Resources/icon_20pt.png
deleted file mode 100644
index 78f0792..0000000
--- a/Resources/icon_20pt.png
+++ /dev/null
Binary files differ
diff --git a/Resources/icon_20pt@3x.png b/Resources/icon_20pt@3x.png
deleted file mode 100644
index f7b6c66..0000000
--- a/Resources/icon_20pt@3x.png
+++ /dev/null
Binary files differ
diff --git a/Scripts/extract_wireguard_go_version.sh b/Scripts/extract_wireguard_go_version.sh
deleted file mode 100755
index 7a5153c..0000000
--- a/Scripts/extract_wireguard_go_version.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-sed=$(sh /etc/profile; which sed)
-wireguard_go_version=$("$sed" -n 's/.*WireGuardGoVersion = "\(.*\)\".*/\1/p' wireguard-go/version.go)
-
-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
- echo $wireguard_go_version
- /usr/libexec/PlistBuddy -c "Set :WireGuardGoVersion $wireguard_go_version" "$plist"
- fi
-done
-
-settings_root_plist="$TARGET_BUILD_DIR/WireGuard.app/Settings.bundle/Root.plist"
-
-if [ -f "$settings_root_plist" ]; then
- /usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:2:DefaultValue $wireguard_go_version" "$settings_root_plist"
-else
- echo "Could not find: $settings_root_plist"
- exit 1
-fi
diff --git a/Scripts/set_build_number.sh b/Scripts/set_build_number.sh
deleted file mode 100755
index 1c49437..0000000
--- a/Scripts/set_build_number.sh
+++ /dev/null
@@ -1,35 +0,0 @@
-#!/bin/bash
-
-git=$(sh /etc/profile; which git)
-date=$(sh /etc/profile; which date)
-
-number_of_commits=$("$git" rev-list HEAD --count)
-date_timestamp=$("$date" +%Y%m%d)
-
-target_plist="$TARGET_BUILD_DIR/$INFOPLIST_PATH"
-echo $target_plist
-dsym_plist="$DWARF_DSYM_FOLDER_PATH/$DWARF_DSYM_FILE_NAME/Contents/Info.plist"
-echo $dsym_plist
-
-for plist in "$target_plist" "$dsym_plist"; do
- if [ -f "$plist" ]; then
- echo $date_timestamp
- echo $plist
- echo $number_of_commits
- /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $number_of_commits" "$plist"
- /usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString 0.0.$date_timestamp" "$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"
- /usr/libexec/PlistBuddy -c "Set :PreferenceSpecifiers:1:DefaultValue 0.0.$date_timestamp" "$settings_root_plist"
-else
- echo "Could not find: $settings_root_plist"
- exit 1
-fi
-
diff --git a/Shared/ExtensionMessage.swift b/Shared/ExtensionMessage.swift
deleted file mode 100644
index e45ed7a..0000000
--- a/Shared/ExtensionMessage.swift
+++ /dev/null
@@ -1,25 +0,0 @@
-//
-// Copyright © 2018 WireGuard LLC. All Rights Reserved.
-//
-
-import Foundation
-
-public class ExtensionMessage: Equatable {
-
- public static let requestVersion = ExtensionMessage(0xff)
-
- public let data: Data
-
- private init(_ byte: UInt8) {
- data = Data(bytes: [byte])
- }
-
- init(_ data: Data) {
- self.data = data
- }
-
- // MARK: Equatable
- public static func == (lhs: ExtensionMessage, rhs: ExtensionMessage) -> Bool {
- return (lhs.data == rhs.data)
- }
-}
diff --git a/Shared/ProviderConfigurationKeys.swift b/Shared/ProviderConfigurationKeys.swift
deleted file mode 100644
index 6213165..0000000
--- a/Shared/ProviderConfigurationKeys.swift
+++ /dev/null
@@ -1,9 +0,0 @@
-//
-// Copyright © 2018 WireGuard LLC. All Rights Reserved.
-//
-
-import Foundation
-
-enum PCKeys: String {
- case title, tunnelIdentifier, endpoints, dns, addresses, mtu, settings
-}
diff --git a/Shared/Validators.swift b/Shared/Validators.swift
deleted file mode 100644
index 0e227aa..0000000
--- a/Shared/Validators.swift
+++ /dev/null
@@ -1,180 +0,0 @@
-//
-// Copyright © 2018 WireGuard LLC. All Rights Reserved.
-//
-
-import Foundation
-
-enum AddressType {
- case IPv6, IPv4, other
-}
-
-public enum EndpointValidationError: Error {
- case noIpAndPort(String)
- case invalidIP(String)
- case invalidPort(String)
-
- var localizedDescription: String {
- switch self {
- case .noIpAndPort:
- return NSLocalizedString("EndpointValidationError.noIpAndPort", comment: "Error message for malformed endpoint.")
- case .invalidIP:
- return NSLocalizedString("EndpointValidationError.invalidIP", comment: "Error message for invalid endpoint ip.")
- case .invalidPort:
- return NSLocalizedString("EndpointValidationError.invalidPort", comment: "Error message invalid endpoint port.")
- }
- }
-}
-
-struct Endpoint {
- var ipAddress: String
- var port: Int32?
- var addressType: AddressType
-
- init?(endpointString: String, needsPort: Bool = true) throws {
- var hostString: String
- if needsPort {
- guard let range = endpointString.range(of: ":", options: .backwards, range: nil, locale: nil) else {
- throw EndpointValidationError.noIpAndPort(endpointString)
- }
- hostString = String(endpointString[..<range.lowerBound])
-
- let portString = endpointString[range.upperBound...]
-
- guard let port = Int32(portString), port > 0 else {
- throw EndpointValidationError.invalidPort(String(portString/*parts[1]*/))
- }
- self.port = port
- } else {
- hostString = endpointString
- }
-
- hostString = hostString.replacingOccurrences(of: "[", with: "").replacingOccurrences(of: "]", with: "")
- var addressType = validateIpAddress(ipToValidate: hostString)
- let ipString: String
- if addressType == .other {
- ipString = convertToipAddress(from: hostString)
- } else {
- ipString = hostString
- }
-
- ipAddress = String(ipString)
- addressType = validateIpAddress(ipToValidate: ipAddress)
- guard addressType == .IPv4 || addressType == .IPv6 else {
- throw EndpointValidationError.invalidIP(ipAddress)
- }
- self.addressType = addressType
- }
-}
-
-private func convertToipAddress(from hostname: String) -> String {
- let host = CFHostCreateWithName(nil, hostname as CFString).takeRetainedValue()
- CFHostStartInfoResolution(host, .addresses, nil)
- var success: DarwinBoolean = false
- if let addresses = CFHostGetAddressing(host, &success)?.takeUnretainedValue() as NSArray?,
- let theAddress = addresses.firstObject as? NSData {
- var hostname = [CChar](repeating: 0, count: Int(NI_MAXHOST))
- if getnameinfo(theAddress.bytes.assumingMemoryBound(to: sockaddr.self), socklen_t(theAddress.length),
- &hostname, socklen_t(hostname.count), nil, 0, NI_NUMERICHOST) == 0 {
- let numAddress = String(cString: hostname)
- return numAddress
- }
- }
- return hostname
-}
-
-func validateIpAddress(ipToValidate: String) -> AddressType {
-
- var sin = sockaddr_in()
- if ipToValidate.withCString({ cstring in inet_pton(AF_INET, cstring, &sin.sin_addr) }) == 1 {
- // IPv4 peer.
- return .IPv4
- }
-
- var sin6 = sockaddr_in6()
- if ipToValidate.withCString({ cstring in inet_pton(AF_INET6, cstring, &sin6.sin6_addr) }) == 1 {
- // IPv6 peer.
- return .IPv6
- }
-
- return .other
-}
-
-public enum CIDRAddressValidationError: Error {
- case noIpAndSubnet(String)
- case invalidIP(String)
- case invalidSubnet(String)
-
- var localizedDescription: String {
- switch self {
- case .noIpAndSubnet:
- return NSLocalizedString("CIDRAddressValidationError", comment: "Error message for malformed CIDR address.")
- case .invalidIP:
- return NSLocalizedString("CIDRAddressValidationError", comment: "Error message for invalid address ip.")
- case .invalidSubnet:
- return NSLocalizedString("CIDRAddressValidationError", comment: "Error message invalid address subnet.")
- }
- }
-}
-
-struct CIDRAddress {
- var ipAddress: String
- var subnet: Int32
- var addressType: AddressType
-
- init?(stringRepresentation: String) throws {
- let subnetString: String.SubSequence
- if let range = stringRepresentation.range(of: "/", options: .backwards, range: nil, locale: nil) {
- let ipString = stringRepresentation[..<range.lowerBound].replacingOccurrences(of: "[", with: "").replacingOccurrences(of: "]", with: "")
- ipAddress = String(ipString)
- subnetString = stringRepresentation[range.upperBound...]
- } else {
- let ipString = stringRepresentation
- ipAddress = String(ipString)
- subnetString = ""
- }
-
- let addressType = validateIpAddress(ipToValidate: ipAddress)
- guard addressType == .IPv4 || addressType == .IPv6 else {
- throw CIDRAddressValidationError.invalidIP(ipAddress)
- }
- self.addressType = addressType
-
- if let subnet = Int32(subnetString) {
- switch addressType {
- case .IPv6:
- self.subnet = subnet > 128 ? 128 : subnet
- case .IPv4:
- self.subnet = subnet > 32 ? 32 : subnet
- case .other:
- self.subnet = subnet
- }
- } else {
- switch addressType {
- case .IPv4:
- subnet = 32
- case .IPv6:
- subnet = 128
- case .other:
- throw CIDRAddressValidationError.invalidSubnet(String(subnetString))
- }
- }
- }
-
- var subnetString: String {
- // We could calculate these.
-
- var bitMask: UInt32 = 0b11111111111111111111111111111111
- bitMask = bitMask << (32 - subnet)
-
- let first = UInt8(truncatingIfNeeded: bitMask >> 24)
- let second = UInt8(truncatingIfNeeded: bitMask >> 16 )
- let third = UInt8(truncatingIfNeeded: bitMask >> 8)
- let fourth = UInt8(truncatingIfNeeded: bitMask)
-
- return "\(first).\(second).\(third).\(fourth)"
- }
-
- var stringRepresentation: String {
- return "\(ipAddress)/\(subnet)"
- }
-}
diff --git a/designs/WireGuard-app-icon.sketch b/designs/WireGuard-app-icon.sketch
deleted file mode 100644
index d247a6c..0000000
--- a/designs/WireGuard-app-icon.sketch
+++ /dev/null
Binary files differ
diff --git a/icon_20pt.png b/icon_20pt.png
deleted file mode 100644
index 78f0792..0000000
--- a/icon_20pt.png
+++ /dev/null
Binary files differ