├── Cartfile
├── README.md
├── imgs
└── splash.png
├── share
├── icon.icns
├── share.entitlements
├── ShareViewController.swift
├── Info.plist
└── Base.lproj
│ └── ShareViewController.xib
├── bin
├── bootstrap
└── bootstrap-if-needed
├── Specht
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Icon-128.png
│ │ ├── Icon-16.png
│ │ ├── Icon-256.png
│ │ ├── Icon-32.png
│ │ ├── Icon-512.png
│ │ ├── Icon-16@2x.png
│ │ ├── Icon-32@2x.png
│ │ ├── Icon-128@2x.png
│ │ ├── Icon-256@2x.png
│ │ ├── Icon-512@2x.png
│ │ └── Contents.json
├── Specht-Bridging-Header.h
├── Specht.entitlements
├── MD5.swift
├── Base.lproj
│ └── MainMenu.xib
├── Info.plist
├── VPNManager.swift
└── AppDelegate.swift
├── Specht.xcworkspace
├── contents.xcworkspacedata
└── xcshareddata
│ └── Specht.xcscmblueprint
├── Specht.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── Specht.xcscmblueprint
├── xcshareddata
│ └── xcschemes
│ │ ├── Specht.xcscheme
│ │ └── SpechtTunnelPacketProvider.xcscheme
└── project.pbxproj
├── .travis.yml
├── Cartfile.resolved
├── SpechtTunnelPacketProvider
├── SpechtTunnelPacketProvider-Bridging-Header.h
├── SpechtTunnelPacketProvider.entitlements
├── Info.plist
└── PacketTunnelProvider.swift
├── .gitignore
└── LICENSE
/Cartfile:
--------------------------------------------------------------------------------
1 | github "zhuhaow/NEKit" "0.3.0"
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Specht
2 |
3 | Specht is archived as NEKit is deprecated.
4 |
--------------------------------------------------------------------------------
/imgs/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/imgs/splash.png
--------------------------------------------------------------------------------
/share/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/share/icon.icns
--------------------------------------------------------------------------------
/bin/bootstrap:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | carthage bootstrap --no-use-binaries --platform mac
4 | cp Cartfile.resolved Carthage
5 |
--------------------------------------------------------------------------------
/bin/bootstrap-if-needed:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if ! cmp -s Cartfile.resolved Carthage/Cartfile.resolved; then
4 | bin/bootstrap
5 | fi
6 |
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-128.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-16.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-256.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-32.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-512.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-16@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-16@2x.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-32@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-32@2x.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-128@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-128@2x.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-256@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-256@2x.png
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Icon-512@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zhuhaow/Specht/HEAD/Specht/Assets.xcassets/AppIcon.appiconset/Icon-512@2x.png
--------------------------------------------------------------------------------
/Specht.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Specht.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: objective-c
2 | osx_image: xcode7.3
3 | cache:
4 | directories:
5 | - Carthage
6 | install:
7 | - bin/bootstrap-if-needed
8 | script:
9 | - xctool -project Specht.xcodeproj -scheme "Specht" -sdk macosx10.11 -arch
10 | x86_64 build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
--------------------------------------------------------------------------------
/Specht/Specht-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // Specht-Bridging-Header.h
3 | // Specht
4 | //
5 | // Created by Zhuhao Wang on 3/26/16.
6 | // Copyright © 2016 Zhuhao Wang. All rights reserved.
7 | //
8 |
9 | #ifndef Specht_Bridging_Header_h
10 | #define Specht_Bridging_Header_h
11 |
12 | #endif /* Specht_Bridging_Header_h */
13 |
--------------------------------------------------------------------------------
/Cartfile.resolved:
--------------------------------------------------------------------------------
1 | github "robbiehanson/CocoaAsyncSocket" "7.5.0"
2 | github "CocoaLumberjack/CocoaLumberjack" "2.3.0"
3 | github "soffes/CommonCrypto" "v1.0"
4 | github "zhuhaow/MMDB-Swift" "v1.1.2"
5 | github "zhuhaow/Sodium-framework" "v1.0.10"
6 | github "behrang/YamlSwift" "1.4.3"
7 | github "zhuhaow/tun2socks" "0.3.0"
8 | github "zhuhaow/NEKit" "0.3.0"
9 |
--------------------------------------------------------------------------------
/share/share.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.files.user-selected.read-only
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/SpechtTunnelPacketProvider/SpechtTunnelPacketProvider-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | //
2 | // SpechtTunnelPacketProvider-Bridging-Header.h
3 | // Specht
4 | //
5 | // Created by Zhuhao Wang on 4/16/16.
6 | // Copyright © 2016 Zhuhao Wang. All rights reserved.
7 | //
8 |
9 | #ifndef SpechtTunnelPacketProvider_Bridging_Header_h
10 | #define SpechtTunnelPacketProvider_Bridging_Header_h
11 |
12 | #endif /* SpechtTunnelPacketProvider_Bridging_Header_h */
13 |
--------------------------------------------------------------------------------
/Specht/Specht.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.developer.networking.networkextension
6 |
7 | packet-tunnel-provider
8 |
9 | com.apple.developer.networking.vpn.api
10 |
11 | allow-vpn
12 |
13 | com.apple.security.app-sandbox
14 |
15 | com.apple.security.network.client
16 |
17 | com.apple.security.network.server
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/Specht/MD5.swift:
--------------------------------------------------------------------------------
1 | import Foundation
2 | import CommonCrypto
3 |
4 | class MD5 {
5 | static func string(s: String) -> String {
6 | let strData = s.dataUsingEncoding(NSUTF8StringEncoding)!
7 | let digestLen = Int(CC_MD5_DIGEST_LENGTH)
8 | var result = [UInt8](count: digestLen, repeatedValue: 0)
9 |
10 | CC_MD5(strData.bytes, CC_LONG(strData.length), &result)
11 |
12 | return hexString(result)
13 | }
14 |
15 | static func hexString(result: [UInt8]) -> String {
16 | let hash = NSMutableString(capacity: result.count * 2)
17 | for i in 0..
2 |
3 |
4 |
5 | com.apple.developer.networking.networkextension
6 |
7 | packet-tunnel-provider
8 |
9 | com.apple.developer.networking.vpn.api
10 |
11 | allow-vpn
12 |
13 | com.apple.security.app-sandbox
14 |
15 | com.apple.security.network.client
16 |
17 | com.apple.security.network.server
18 |
19 | keychain-access-groups
20 |
21 | com.apple.managed.vpn.shared
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/Specht/Base.lproj/MainMenu.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/Specht/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSApplicationCategoryType
26 | public.app-category.utilities
27 | LSMinimumSystemVersion
28 | $(MACOSX_DEPLOYMENT_TARGET)
29 | NSHumanReadableCopyright
30 | Copyright © 2016 Zhuhao Wang. All rights reserved.
31 | NSMainNibFile
32 | MainMenu
33 | NSPrincipalClass
34 | NSApplication
35 |
36 |
37 |
--------------------------------------------------------------------------------
/share/ShareViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ShareViewController.swift
3 | // share
4 | //
5 | // Created by Zhuhao Wang on 5/15/16.
6 | // Copyright © 2016 Zhuhao Wang. All rights reserved.
7 | //
8 |
9 | import Cocoa
10 |
11 | class ShareViewController: NSViewController {
12 |
13 | override var nibName: String? {
14 | return "ShareViewController"
15 | }
16 |
17 | override func loadView() {
18 | super.loadView()
19 |
20 | // Insert code here to customize the view
21 | let item = self.extensionContext!.inputItems[0] as! NSExtensionItem
22 | if let attachments = item.attachments {
23 | NSLog("Attachments = %@", attachments as NSArray)
24 | } else {
25 | NSLog("No Attachments")
26 | }
27 | }
28 |
29 | @IBAction func send(sender: AnyObject?) {
30 | let outputItem = NSExtensionItem()
31 | // Complete implementation by setting the appropriate value on the output item
32 |
33 | let outputItems = [outputItem]
34 | self.extensionContext!.completeRequestReturningItems(outputItems, completionHandler: nil)
35 | }
36 |
37 | @IBAction func cancel(sender: AnyObject?) {
38 | let cancelError = NSError(domain: NSCocoaErrorDomain, code: NSUserCancelledError, userInfo: nil)
39 | self.extensionContext!.cancelRequestWithError(cancelError)
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/SpechtTunnelPacketProvider/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | SpechtTunnelPacketProvider
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | XPC!
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | 1
25 | LSMinimumSystemVersion
26 | $(MACOSX_DEPLOYMENT_TARGET)
27 | NSExtension
28 |
29 | NSExtensionPointIdentifier
30 | com.apple.networkextension.packet-tunnel
31 | NSExtensionPrincipalClass
32 | $(PRODUCT_MODULE_NAME).PacketTunnelProvider
33 |
34 | NSHumanReadableCopyright
35 | Copyright © 2016 Zhuhao Wang. All rights reserved.
36 |
37 |
38 |
--------------------------------------------------------------------------------
/share/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | share
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIconFile
12 | icon
13 | CFBundleIdentifier
14 | $(PRODUCT_BUNDLE_IDENTIFIER)
15 | CFBundleInfoDictionaryVersion
16 | 6.0
17 | CFBundleName
18 | $(PRODUCT_NAME)
19 | CFBundlePackageType
20 | XPC!
21 | CFBundleShortVersionString
22 | 1.0
23 | CFBundleSignature
24 | ????
25 | CFBundleVersion
26 | 1
27 | LSMinimumSystemVersion
28 | $(MACOSX_DEPLOYMENT_TARGET)
29 | NSExtension
30 |
31 | NSExtensionAttributes
32 |
33 | NSExtensionActivationRule
34 | TRUEPREDICATE
35 |
36 | NSExtensionPointIdentifier
37 | com.apple.share-services
38 | NSExtensionPrincipalClass
39 | $(PRODUCT_MODULE_NAME).ShareViewController
40 |
41 | NSHumanReadableCopyright
42 | Copyright © 2016 Zhuhao Wang. All rights reserved.
43 |
44 |
45 |
--------------------------------------------------------------------------------
/Specht/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "Icon-16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "Icon-16@2x.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "Icon-32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "Icon-32@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "Icon-128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "Icon-128@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "Icon-256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "Icon-256@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "Icon-512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "Icon-512@2x.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
--------------------------------------------------------------------------------
/Specht.xcworkspace/xcshareddata/Specht.xcscmblueprint:
--------------------------------------------------------------------------------
1 | {
2 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
3 |
4 | },
5 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
6 | "B5295673D40444D86A0D76339F7E4FC3397BF632" : 0,
7 | "E7F16E682DEFAA475C57A9EB4974749FA6202939" : 0,
8 | "B97EEED760BDEDB08668E142659F81205FA7D2F5" : 0
9 | },
10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "204C69A1-4AAA-4BF2-B61E-E41623A8E687",
11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
12 | "B5295673D40444D86A0D76339F7E4FC3397BF632" : "Specht\/NEKit\/tun2socks\/tun2socks\/lwip\/",
13 | "E7F16E682DEFAA475C57A9EB4974749FA6202939" : "Specht\/NEKit\/",
14 | "B97EEED760BDEDB08668E142659F81205FA7D2F5" : "Specht\/NEKit\/tun2socks\/"
15 | },
16 | "DVTSourceControlWorkspaceBlueprintNameKey" : "Specht",
17 | "DVTSourceControlWorkspaceBlueprintVersion" : 204,
18 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Specht.xcworkspace",
19 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
20 | {
21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git:\/\/git.savannah.nongnu.org\/lwip.git",
22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
23 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B5295673D40444D86A0D76339F7E4FC3397BF632"
24 | },
25 | {
26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/zhuhaow\/tun2socks.git",
27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
28 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B97EEED760BDEDB08668E142659F81205FA7D2F5"
29 | },
30 | {
31 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/zhuhaow\/NEKit.git",
32 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
33 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E7F16E682DEFAA475C57A9EB4974749FA6202939"
34 | }
35 | ]
36 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | #### joe made this: http://goel.io/joe
2 |
3 | #####=== OSX ===#####
4 | .DS_Store
5 | .AppleDouble
6 | .LSOverride
7 |
8 | # Icon must end with two \r
9 | Icon
10 |
11 | # Thumbnails
12 | ._*
13 |
14 | # Files that might appear on external disk
15 | .Spotlight-V100
16 | .Trashes
17 |
18 | # Directories potentially created on remote AFP share
19 | .AppleDB
20 | .AppleDesktop
21 | Network Trash Folder
22 | Temporary Items
23 | .apdisk
24 |
25 | #####=== JetBrains ===#####
26 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm
27 |
28 | *.iml
29 |
30 | ## Directory-based project format:
31 | .idea/
32 | # if you remove the above rule, at least ignore the following:
33 |
34 | # User-specific stuff:
35 | # .idea/workspace.xml
36 | # .idea/tasks.xml
37 | # .idea/dictionaries
38 |
39 | # Sensitive or high-churn files:
40 | # .idea/dataSources.ids
41 | # .idea/dataSources.xml
42 | # .idea/sqlDataSources.xml
43 | # .idea/dynamic.xml
44 | # .idea/uiDesigner.xml
45 |
46 | # Gradle:
47 | # .idea/gradle.xml
48 | # .idea/libraries
49 |
50 | # Mongo Explorer plugin:
51 | # .idea/mongoSettings.xml
52 |
53 | ## File-based project format:
54 | *.ipr
55 | *.iws
56 |
57 | ## Plugin-specific files:
58 |
59 | # IntelliJ
60 | out/
61 |
62 | # mpeltonen/sbt-idea plugin
63 | .idea_modules/
64 |
65 | # JIRA plugin
66 | atlassian-ide-plugin.xml
67 |
68 | # Crashlytics plugin (for Android Studio and IntelliJ)
69 | com_crashlytics_export_strings.xml
70 | crashlytics.properties
71 | crashlytics-build.properties
72 |
73 | #### joe made this: http://goel.io/joe
74 |
75 | #####=== Xcode ===#####
76 | build/
77 | *.pbxuser
78 | !default.pbxuser
79 | *.mode1v3
80 | !default.mode1v3
81 | *.mode2v3
82 | !default.mode2v3
83 | *.perspectivev3
84 | !default.perspectivev3
85 | xcuserdata
86 | *.xccheckout
87 | *.moved-aside
88 | DerivedData
89 | *.xcuserstate
90 |
91 | #####=== Swift ===#####
92 |
93 | # Xcode
94 | #
95 | build/
96 | *.pbxuser
97 | !default.pbxuser
98 | *.mode1v3
99 | !default.mode1v3
100 | *.mode2v3
101 | !default.mode2v3
102 | *.perspectivev3
103 | !default.perspectivev3
104 | xcuserdata
105 | *.xccheckout
106 | *.moved-aside
107 | DerivedData
108 | *.hmap
109 | *.ipa
110 | *.xcuserstate
111 |
112 | # CocoaPods
113 | #
114 | # We recommend against adding the Pods directory to your .gitignore. However
115 | # you should judge for yourself, the pros and cons are mentioned at:
116 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
117 | #
118 | # Pods/
119 |
120 | #####=== Objective-C ===#####
121 |
122 | # Xcode
123 | #
124 | build/
125 | *.pbxuser
126 | !default.pbxuser
127 | *.mode1v3
128 | !default.mode1v3
129 | *.mode2v3
130 | !default.mode2v3
131 | *.perspectivev3
132 | !default.perspectivev3
133 | xcuserdata
134 | *.xccheckout
135 | *.moved-aside
136 | DerivedData
137 | *.hmap
138 | *.ipa
139 | *.xcuserstate
140 |
141 | # CocoaPods
142 | #
143 | # We recommend against adding the Pods directory to your .gitignore. However
144 | # you should judge for yourself, the pros and cons are mentioned at:
145 | # http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
146 | #
147 | # Pods/
148 |
149 | Carthage/
150 |
--------------------------------------------------------------------------------
/Specht.xcodeproj/project.xcworkspace/xcshareddata/Specht.xcscmblueprint:
--------------------------------------------------------------------------------
1 | {
2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "66CFDC272F76CD9338A9889E9A0BD12E7ECDD209+++50B2D3E",
3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
4 |
5 | },
6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
7 | "B97EEED760BDEDB08668E142659F81205FA7D2F5+++B9DC0C0" : 0,
8 | "B5295673D40444D86A0D76339F7E4FC3397BF632+++995A6E9" : 0,
9 | "E7F16E682DEFAA475C57A9EB4974749FA6202939+++1BD3DFE" : 0,
10 | "B97EEED760BDEDB08668E142659F81205FA7D2F5+++EAAE55D" : 0,
11 | "66CFDC272F76CD9338A9889E9A0BD12E7ECDD209+++50B2D3E" : 0,
12 | "B97EEED760BDEDB08668E142659F81205FA7D2F5+++E6FE76C" : 0
13 | },
14 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "D4C74621-FB5F-476C-B1E0-F04CF5196413",
15 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
16 | "B97EEED760BDEDB08668E142659F81205FA7D2F5+++B9DC0C0" : "Specht\/NEKit\/tun2socks\/tun2socks\/",
17 | "B5295673D40444D86A0D76339F7E4FC3397BF632+++995A6E9" : "Specht\/NEKit\/tun2socks\/tun2socks\/lwip\/",
18 | "E7F16E682DEFAA475C57A9EB4974749FA6202939+++1BD3DFE" : "Specht\/NEKit\/",
19 | "B97EEED760BDEDB08668E142659F81205FA7D2F5+++EAAE55D" : "Specht\/NEKit\/tun2socks\/tun2socks\/",
20 | "66CFDC272F76CD9338A9889E9A0BD12E7ECDD209+++50B2D3E" : "Specht\/",
21 | "B97EEED760BDEDB08668E142659F81205FA7D2F5+++E6FE76C" : "Specht\/NEKit\/tun2socks\/"
22 | },
23 | "DVTSourceControlWorkspaceBlueprintNameKey" : "Specht",
24 | "DVTSourceControlWorkspaceBlueprintVersion" : 204,
25 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Specht.xcodeproj",
26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
27 | {
28 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/zhuhaow\/Specht.git",
29 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
30 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "66CFDC272F76CD9338A9889E9A0BD12E7ECDD209+++50B2D3E"
31 | },
32 | {
33 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "git:\/\/git.savannah.nongnu.org\/lwip.git",
34 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
35 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B5295673D40444D86A0D76339F7E4FC3397BF632+++995A6E9"
36 | },
37 | {
38 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/zhuhaow\/tun2socks.git",
39 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
40 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B97EEED760BDEDB08668E142659F81205FA7D2F5+++B9DC0C0"
41 | },
42 | {
43 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/zhuhaow\/tun2socks.git",
44 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
45 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B97EEED760BDEDB08668E142659F81205FA7D2F5+++E6FE76C"
46 | },
47 | {
48 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/zhuhaow\/tun2socks.git",
49 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
50 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "B97EEED760BDEDB08668E142659F81205FA7D2F5+++EAAE55D"
51 | },
52 | {
53 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/zhuhaow\/NEKit.git",
54 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
55 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "E7F16E682DEFAA475C57A9EB4974749FA6202939+++1BD3DFE"
56 | }
57 | ]
58 | }
--------------------------------------------------------------------------------
/Specht.xcodeproj/xcshareddata/xcschemes/Specht.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/Specht.xcodeproj/xcshareddata/xcschemes/SpechtTunnelPacketProvider.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
6 |
9 |
10 |
16 |
22 |
23 |
24 |
30 |
36 |
37 |
38 |
39 |
40 |
45 |
46 |
47 |
48 |
54 |
55 |
56 |
57 |
58 |
59 |
70 |
72 |
78 |
79 |
80 |
81 |
85 |
86 |
87 |
88 |
95 |
97 |
103 |
104 |
105 |
106 |
108 |
109 |
112 |
113 |
114 |
--------------------------------------------------------------------------------
/Specht/VPNManager.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import NetworkExtension
3 | import NEKit
4 |
5 | class VPNManager {
6 | static var pendingAction: Int = 0
7 | static var appDelegate: AppDelegate {
8 | return NSApplication.sharedApplication().delegate! as! AppDelegate
9 | }
10 |
11 | static func removeAllManagers(completionHandler: () -> ()) {
12 | NETunnelProviderManager.loadAllFromPreferencesWithCompletionHandler { managers, error in
13 | guard let managers = managers else {
14 | appDelegate.alertError("Failed to load VPN settings from preferences due to \(error)")
15 | return
16 | }
17 |
18 | pendingAction = managers.count
19 |
20 | if pendingAction == 0 {
21 | completionHandler()
22 | return
23 | }
24 |
25 | for manager in managers {
26 | manager.removeFromPreferencesWithCompletionHandler { error in
27 | if error != nil {
28 | appDelegate.alertError("Failed to remove VPN settings from preferences due to \(error)")
29 | }
30 |
31 | pendingAction -= 1
32 | if pendingAction == 0 {
33 | completionHandler()
34 | }
35 | }
36 | }
37 | }
38 | }
39 |
40 | static func loadConfigFile(path: String, completionHandler: () -> ()) {
41 | let configuration = NETunnelProviderProtocol()
42 | configuration.providerConfiguration = ["configFileURL": path]
43 |
44 | do {
45 | let content = try String(contentsOfFile: path, encoding: NSUTF8StringEncoding)
46 | let config = Configuration()
47 | try config.load(fromConfigString: content)
48 | configuration.providerConfiguration!["config"] = content
49 | configuration.providerConfiguration!["hash"] = MD5.string(content)
50 | } catch let error {
51 | appDelegate.alertError("Error when loading config file: \(path). \(error)")
52 | completionHandler()
53 | return
54 | }
55 |
56 | let name = ((path as NSString).lastPathComponent as NSString).stringByDeletingPathExtension
57 |
58 | let manager = NETunnelProviderManager()
59 | manager.localizedDescription = name
60 | configuration.providerBundleIdentifier = "me.zhuhaow.osx.Specht.SpechtTunnelPacketProvider"
61 | configuration.serverAddress = "127.0.0.1"
62 | manager.protocolConfiguration = configuration
63 | manager.saveToPreferencesWithCompletionHandler { _ in
64 | completionHandler()
65 | }
66 | }
67 |
68 | static func loadAllConfigFiles(configFolder: String, completionHandler: () -> ()) {
69 | let paths = try! NSFileManager.defaultManager().contentsOfDirectoryAtPath(configFolder).filter {
70 | ($0 as NSString).pathExtension == "yaml"
71 | }
72 |
73 | pendingAction = paths.count
74 |
75 | if pendingAction == 0 {
76 | completionHandler()
77 | return
78 | }
79 |
80 | for path in paths {
81 | loadConfigFile((configFolder as NSString).stringByAppendingPathComponent(path)) {
82 | pendingAction -= 1
83 | if pendingAction == 0 {
84 | completionHandler()
85 | }
86 | }
87 | }
88 | }
89 |
90 | // static func reloadAllManagers() {
91 | // NETunnelProviderManager.loadAllFromPreferencesWithCompletionHandler() { managers, error in
92 | // guard let managers = managers else {
93 | // NSLog("Failed to load VPN settings from preferences. \(error)")
94 | // return
95 | // }
96 | //
97 | // for manager in managers {
98 | // self.reloadManager(manager)
99 | // }
100 | // }
101 | // }
102 | //
103 | // static func reloadManager(manager: NETunnelProviderManager) {
104 | // guard let configuration = manager.protocolConfiguration as? NETunnelProviderProtocol else {
105 | // manager.removeFromPreferencesWithCompletionHandler(nil)
106 | // return
107 | // }
108 | //
109 | // guard let configFileURL = configuration.providerConfiguration?["configFileURL"] as? String else {
110 | // manager.removeFromPreferencesWithCompletionHandler(nil)
111 | // return
112 | // }
113 | //
114 | // var isDirectory = ObjCBool(false)
115 | // guard NSFileManager.defaultManager().fileExistsAtPath(configFileURL, isDirectory: &isDirectory) && !isDirectory else {
116 | // manager.removeFromPreferencesWithCompletionHandler(nil)
117 | // return
118 | // }
119 | //
120 | // do {
121 | // let content = try String(contentsOfFile: configFileURL, encoding: NSUTF8StringEncoding)
122 | // let hash = MD5.string(content)
123 | // if hash != configuration.providerConfiguration!["hash"] as! String {
124 | // configuration.providerConfiguration!["config"] = content
125 | // configuration.providerConfiguration!["hash"] = hash
126 | // manager.saveToPreferencesWithCompletionHandler(nil)
127 | // }
128 | // } catch {
129 | // manager.removeFromPreferencesWithCompletionHandler(nil)
130 | // return
131 | // }
132 | // }
133 | }
134 |
--------------------------------------------------------------------------------
/SpechtTunnelPacketProvider/PacketTunnelProvider.swift:
--------------------------------------------------------------------------------
1 | import NetworkExtension
2 | import CocoaLumberjackSwift
3 | import NEKit
4 |
5 | class PacketTunnelProvider: NEPacketTunnelProvider {
6 | var interface: TUNInterface!
7 | // Since tun2socks is not stable, this is recommended to set to false
8 | var enablePacketProcessing = true
9 |
10 | var proxyPort: Int!
11 |
12 | var proxyServer: ProxyServer!
13 |
14 | override func startTunnelWithOptions(options: [String : NSObject]?, completionHandler: (NSError?) -> Void) {
15 | DDLog.removeAllLoggers()
16 | // warning: setting to .Debug level might be way too verbose.
17 | DDLog.addLogger(DDASLLogger.sharedInstance(), withLevel: DDLogLevel.Info)
18 |
19 | // Use the build-in debug observer.
20 | ObserverFactory.currentFactory = DebugObserverFactory()
21 |
22 | let configuration = Configuration()
23 | try! configuration.load(fromConfigString: (protocolConfiguration as! NETunnelProviderProtocol).providerConfiguration!["config"] as! String)
24 | RuleManager.currentManager = configuration.ruleManager
25 | proxyPort = configuration.proxyPort ?? 9090
26 |
27 | RawSocketFactory.TunnelProvider = self
28 |
29 | // the `tunnelRemoteAddress` is meaningless because we are not creating a tunnel.
30 | let networkSettings = NEPacketTunnelNetworkSettings(tunnelRemoteAddress: "8.8.8.8")
31 | networkSettings.MTU = 1500
32 |
33 | let ipv4Settings = NEIPv4Settings(addresses: ["192.169.89.1"], subnetMasks: ["255.255.255.0"])
34 | if enablePacketProcessing {
35 | ipv4Settings.includedRoutes = [NEIPv4Route.defaultRoute()]
36 | ipv4Settings.excludedRoutes = [
37 | NEIPv4Route(destinationAddress: "10.0.0.0", subnetMask: "255.0.0.0"),
38 | NEIPv4Route(destinationAddress: "100.64.0.0", subnetMask: "255.192.0.0"),
39 | NEIPv4Route(destinationAddress: "127.0.0.0", subnetMask: "255.0.0.0"),
40 | NEIPv4Route(destinationAddress: "169.254.0.0", subnetMask: "255.255.0.0"),
41 | NEIPv4Route(destinationAddress: "172.16.0.0", subnetMask: "255.240.0.0"),
42 | NEIPv4Route(destinationAddress: "192.168.0.0", subnetMask: "255.255.0.0"),
43 | ]
44 | }
45 | networkSettings.IPv4Settings = ipv4Settings
46 |
47 | let proxySettings = NEProxySettings()
48 | // proxySettings.autoProxyConfigurationEnabled = true
49 | // proxySettings.proxyAutoConfigurationJavaScript = "function FindProxyForURL(url, host) {return \"SOCKS 127.0.0.1:\(proxyPort)\";}"
50 | proxySettings.HTTPEnabled = true
51 | proxySettings.HTTPServer = NEProxyServer(address: "127.0.0.1", port: proxyPort)
52 | proxySettings.HTTPSEnabled = true
53 | proxySettings.HTTPSServer = NEProxyServer(address: "127.0.0.1", port: proxyPort)
54 | proxySettings.excludeSimpleHostnames = true
55 | // This will match all domains
56 | proxySettings.matchDomains = [""]
57 | networkSettings.proxySettings = proxySettings
58 |
59 | // the 198.18.0.0/15 is reserved for benchmark.
60 | if enablePacketProcessing {
61 | let DNSSettings = NEDNSSettings(servers: ["198.18.0.1"])
62 | DNSSettings.matchDomains = [""]
63 | DNSSettings.matchDomainsNoSearch = false
64 | networkSettings.DNSSettings = DNSSettings
65 | }
66 |
67 | setTunnelNetworkSettings(networkSettings) {
68 | error in
69 | guard error == nil else {
70 | DDLogError("Encountered an error setting up the network: \(error)")
71 | completionHandler(error)
72 | return
73 | }
74 |
75 | self.proxyServer = GCDHTTPProxyServer(address: IPv4Address(fromString: "127.0.0.1"), port: Port(port: UInt16(self.proxyPort)))
76 | try! self.proxyServer.start()
77 |
78 | completionHandler(nil)
79 |
80 | if self.enablePacketProcessing {
81 | self.interface = TUNInterface(packetFlow: self.packetFlow)
82 |
83 | let fakeIPPool = IPv4Pool(start: IPv4Address(fromString: "198.18.1.1")!, end: IPv4Address(fromString: "198.18.255.255")!)
84 | let dnsServer = DNSServer(address: IPv4Address(fromString: "198.18.0.1")!, port: Port(port: 53), fakeIPPool: fakeIPPool)
85 | let resolver = UDPDNSResolver(address: IPv4Address(fromString: "114.114.114.114")!, port: Port(port: 53))
86 | dnsServer.registerResolver(resolver)
87 | self.interface.registerStack(dnsServer)
88 | DNSServer.currentServer = dnsServer
89 |
90 | let udpStack = UDPDirectStack()
91 | self.interface.registerStack(udpStack)
92 |
93 | let tcpStack = TCPStack.stack
94 | tcpStack.proxyServer = self.proxyServer
95 | self.interface.registerStack(tcpStack)
96 | self.interface.start()
97 | }
98 | }
99 | }
100 |
101 | override func stopTunnelWithReason(reason: NEProviderStopReason, completionHandler: () -> Void) {
102 | if enablePacketProcessing {
103 | interface.stop()
104 | interface = nil
105 | DNSServer.currentServer = nil
106 | }
107 |
108 | proxyServer.stop()
109 | proxyServer = nil
110 | RawSocketFactory.TunnelProvider = nil
111 |
112 | completionHandler()
113 |
114 | // For unknown reason, the extension will be running for several extra seconds, which prevents us from starting another configuration immediately. So we crash the extension now.
115 | // I do not find any consequences.
116 | exit(EXIT_SUCCESS)
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/share/Base.lproj/ShareViewController.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
29 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/Specht/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import NetworkExtension
3 | import NEKit
4 |
5 | @NSApplicationMain
6 | class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
7 | var barItem: NSStatusItem!
8 | var managerMap: [String: NETunnelProviderManager]!
9 | var pendingAction = 0
10 |
11 | var configFolder: String {
12 | let path = (NSHomeDirectory() as NSString).stringByAppendingPathComponent(".Specht")
13 | var isDir: ObjCBool = false
14 | let exist = NSFileManager.defaultManager().fileExistsAtPath(path, isDirectory: &isDir)
15 | if exist && !isDir {
16 | try! NSFileManager.defaultManager().removeItemAtPath(path)
17 | try! NSFileManager.defaultManager().createDirectoryAtPath(path, withIntermediateDirectories: true, attributes: nil)
18 | }
19 | if !exist {
20 | try! NSFileManager.defaultManager().createDirectoryAtPath(path, withIntermediateDirectories: true, attributes: nil)
21 | }
22 | return path
23 | }
24 |
25 | func applicationDidFinishLaunching(aNotification: NSNotification) {
26 | reloadAllConfigurationFiles() {
27 | self.registerObserver()
28 | self.initMenuBar()
29 | }
30 | }
31 |
32 |
33 | func initManagerMap(completionHandler: () -> ()) {
34 | managerMap = [:]
35 |
36 | NETunnelProviderManager.loadAllFromPreferencesWithCompletionHandler { managers, error in
37 | guard managers != nil else {
38 | self.alertError("Failed to load VPN settings from preferences. \(error)")
39 | return
40 | }
41 |
42 | for manager in managers! {
43 | self.managerMap[manager.localizedDescription!] = manager
44 | }
45 |
46 | completionHandler()
47 | }
48 | }
49 |
50 | func initMenuBar() {
51 | barItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1)
52 | barItem.title = "Sp"
53 | barItem.menu = NSMenu()
54 | barItem.menu!.delegate = self
55 | }
56 |
57 | func registerObserver() {
58 | NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(AppDelegate.statusDidChange(_:)), name: NEVPNStatusDidChangeNotification, object: nil)
59 | NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(AppDelegate.configurationDidChange(_:)), name: NEVPNConfigurationChangeNotification, object: nil)
60 | }
61 |
62 | func statusDidChange(notification: NSNotification) {
63 | }
64 |
65 | func configurationDidChange(notification: NSNotification) {
66 | }
67 |
68 | func startConfiguration(sender: NSMenuItem) {
69 | let manager = managerMap[sender.title]!
70 | do {
71 | switch manager.connection.status {
72 | case .Disconnected:
73 | // disconnect()
74 | try (manager.connection as! NETunnelProviderSession).startTunnelWithOptions([:])
75 | case .Connected, .Connecting, .Reasserting:
76 | (manager.connection as! NETunnelProviderSession).stopTunnel()
77 | default:
78 | break
79 | }
80 | } catch let error {
81 | alertError("Failed to start VPN \(sender.title) due to: \(error)")
82 | }
83 | }
84 |
85 | func menuNeedsUpdate(menu: NSMenu) {
86 | menu.removeAllItems()
87 |
88 | let disableNonConnected = findConnectedManager() != nil
89 | for manager in managerMap.values {
90 | let item = buildMenuItemForManager(manager, disableNonConnected: disableNonConnected)
91 | menu.addItem(item)
92 | }
93 |
94 | menu.addItem(NSMenuItem.separatorItem())
95 | menu.addItemWithTitle("Disconnect", action: #selector(AppDelegate.disconnect(_:)), keyEquivalent: "d")
96 | menu.addItemWithTitle("Open config folder", action: #selector(AppDelegate.openConfigFolder(_:)), keyEquivalent: "c")
97 | menu.addItemWithTitle("Reload config", action: #selector(AppDelegate.reloadClicked(_:)), keyEquivalent: "r")
98 | menu.addItem(NSMenuItem.separatorItem())
99 | menu.addItemWithTitle("Exit", action: #selector(AppDelegate.terminate(_:)), keyEquivalent: "q")
100 | }
101 |
102 | func openConfigFolder(sender: AnyObject) {
103 | NSWorkspace.sharedWorkspace().openFile(configFolder)
104 | }
105 |
106 | func reloadClicked(sender: AnyObject) {
107 | reloadAllConfigurationFiles()
108 | }
109 |
110 | func reloadAllConfigurationFiles(completionHandler: (() -> ())? = nil) {
111 | VPNManager.removeAllManagers {
112 | VPNManager.loadAllConfigFiles(self.configFolder) {
113 | self.initManagerMap() {
114 | completionHandler?()
115 | }
116 | }
117 | }
118 | }
119 |
120 | func disconnect(sender: AnyObject? = nil) {
121 | for manager in managerMap.values {
122 | switch manager.connection.status {
123 | case .Connected, .Connecting:
124 | (manager.connection as! NETunnelProviderSession).stopTunnel()
125 | default:
126 | break
127 | }
128 | }
129 | }
130 |
131 | func findConnectedManager() -> NETunnelProviderManager? {
132 | for manager in managerMap.values {
133 | switch manager.connection.status {
134 | case .Connected, .Connecting, .Reasserting, .Disconnecting:
135 | return manager
136 | default:
137 | break
138 | }
139 | }
140 | return nil
141 | }
142 |
143 | func buildMenuItemForManager(manager: NETunnelProviderManager, disableNonConnected: Bool) -> NSMenuItem {
144 | let item = NSMenuItem(title: manager.localizedDescription!, action: #selector(AppDelegate.startConfiguration(_:)), keyEquivalent: "")
145 |
146 | switch manager.connection.status {
147 | case .Connected:
148 | item.state = NSOnState
149 | case .Connecting:
150 | item.title = item.title.stringByAppendingString("(Connecting)")
151 | case .Disconnecting:
152 | item.title = item.title.stringByAppendingString("(Disconnecting)")
153 | case .Reasserting:
154 | item.title = item.title.stringByAppendingString("(Reconnecting)")
155 | case .Disconnected:
156 | break
157 | case .Invalid:
158 | item.title = item.title.stringByAppendingString("(----)")
159 | }
160 |
161 | if disableNonConnected {
162 | switch manager.connection.status {
163 | case .Disconnected, .Invalid:
164 | item.action = nil
165 | default:
166 | break
167 | }
168 | }
169 | return item
170 | }
171 |
172 | func alertError(errorDescription: String) {
173 | let alert = NSAlert()
174 | alert.messageText = errorDescription
175 | alert.runModal()
176 | }
177 |
178 | func applicationWillTerminate(aNotification: NSNotification) {
179 | NSNotificationCenter.defaultCenter().removeObserver(self)
180 | }
181 |
182 | func terminate(sender: AnyObject) {
183 | NSApp.terminate(self)
184 | }
185 |
186 | }
187 |
--------------------------------------------------------------------------------
/Specht.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 47;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 360B584E1CE810910018784F /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 360B584C1CE810870018784F /* NetworkExtension.framework */; };
11 | 36164A561CE71F3F00BAC90A /* CommonCrypto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36DCE5D31CA6972400C61029 /* CommonCrypto.framework */; };
12 | 36164A5C1CE71F4000BAC90A /* MMDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A581CE71F4000BAC90A /* MMDB.framework */; };
13 | 36164A5D1CE71F4000BAC90A /* Sodium.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A591CE71F4000BAC90A /* Sodium.framework */; };
14 | 36164A5E1CE71F4000BAC90A /* Yaml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A5A1CE71F4000BAC90A /* Yaml.framework */; };
15 | 362A54401C9BD5E00056B653 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 362A543F1C9BD5E00056B653 /* AppDelegate.swift */; };
16 | 362A54421C9BD5E00056B653 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 362A54411C9BD5E00056B653 /* Assets.xcassets */; };
17 | 362A54451C9BD5E00056B653 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 362A54431C9BD5E00056B653 /* MainMenu.xib */; };
18 | 362A549A1C9CF0C30056B653 /* CocoaAsyncSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54961C9CF0B20056B653 /* CocoaAsyncSocket.framework */; };
19 | 362A549B1C9CF0C30056B653 /* CocoaAsyncSocket.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54961C9CF0B20056B653 /* CocoaAsyncSocket.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
20 | 362A54F11C9D056F0056B653 /* CocoaLumberjackSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54EF1C9D056F0056B653 /* CocoaLumberjackSwift.framework */; };
21 | 362A54F21C9D05760056B653 /* CocoaLumberjack.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54EE1C9D056F0056B653 /* CocoaLumberjack.framework */; };
22 | 362A54F31C9D05760056B653 /* CocoaLumberjack.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54EE1C9D056F0056B653 /* CocoaLumberjack.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
23 | 362A54F51C9D05780056B653 /* CocoaLumberjackSwift.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54EF1C9D056F0056B653 /* CocoaLumberjackSwift.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
24 | 3636DA511CE81D95007F9787 /* SpechtTunnelPacketProvider.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 3643CE141CC283BD005A9C4B /* SpechtTunnelPacketProvider.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
25 | 3643CE191CC283BD005A9C4B /* PacketTunnelProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3643CE181CC283BD005A9C4B /* PacketTunnelProvider.swift */; };
26 | 3643CE241CC28467005A9C4B /* CocoaLumberjack.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54EE1C9D056F0056B653 /* CocoaLumberjack.framework */; };
27 | 3643CE251CC28467005A9C4B /* CocoaLumberjackSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54EF1C9D056F0056B653 /* CocoaLumberjackSwift.framework */; };
28 | 3643CE481CC290AF005A9C4B /* CocoaAsyncSocket.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 362A54961C9CF0B20056B653 /* CocoaAsyncSocket.framework */; };
29 | 36A7194A1D5B539B00DC35F5 /* lwip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719471D5B539B00DC35F5 /* lwip.framework */; };
30 | 36A7194B1D5B539B00DC35F5 /* lwip.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719471D5B539B00DC35F5 /* lwip.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
31 | 36A7194C1D5B539B00DC35F5 /* NEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719481D5B539B00DC35F5 /* NEKit.framework */; };
32 | 36A7194D1D5B539B00DC35F5 /* NEKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719481D5B539B00DC35F5 /* NEKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
33 | 36A7194E1D5B539B00DC35F5 /* tun2socks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719491D5B539B00DC35F5 /* tun2socks.framework */; };
34 | 36A7194F1D5B539B00DC35F5 /* tun2socks.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719491D5B539B00DC35F5 /* tun2socks.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
35 | 36A719501D5B53A500DC35F5 /* lwip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719471D5B539B00DC35F5 /* lwip.framework */; };
36 | 36A719511D5B53A500DC35F5 /* NEKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719481D5B539B00DC35F5 /* NEKit.framework */; };
37 | 36A719521D5B53A500DC35F5 /* tun2socks.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36A719491D5B539B00DC35F5 /* tun2socks.framework */; };
38 | 36B366701D56C658003343AA /* VPNManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36B3666F1D56C658003343AA /* VPNManager.swift */; };
39 | 36B366741D56CB33003343AA /* MD5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 36B366731D56CB33003343AA /* MD5.swift */; };
40 | 36C3D42A1D6C114F003069F0 /* README.md in Sources */ = {isa = PBXBuildFile; fileRef = 36C3D4291D6C114F003069F0 /* README.md */; };
41 | 36DD363A1CE7366500537ACA /* MMDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A581CE71F4000BAC90A /* MMDB.framework */; };
42 | 36DD363B1CE7366500537ACA /* MMDB.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A581CE71F4000BAC90A /* MMDB.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
43 | 36DD363C1CE7366500537ACA /* Sodium.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A591CE71F4000BAC90A /* Sodium.framework */; };
44 | 36DD363D1CE7366500537ACA /* Sodium.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A591CE71F4000BAC90A /* Sodium.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
45 | 36DD363E1CE7366500537ACA /* Yaml.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A5A1CE71F4000BAC90A /* Yaml.framework */; };
46 | 36DD363F1CE7366500537ACA /* Yaml.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 36164A5A1CE71F4000BAC90A /* Yaml.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
47 | 36DD36441CE7366500537ACA /* CommonCrypto.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 36DCE5D31CA6972400C61029 /* CommonCrypto.framework */; };
48 | 36DD36451CE7366500537ACA /* CommonCrypto.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 36DCE5D31CA6972400C61029 /* CommonCrypto.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
49 | 36E44A2C1CF2FE3900185DBF /* NetworkExtension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 360B584C1CE810870018784F /* NetworkExtension.framework */; };
50 | /* End PBXBuildFile section */
51 |
52 | /* Begin PBXContainerItemProxy section */
53 | 3636DA521CE81D95007F9787 /* PBXContainerItemProxy */ = {
54 | isa = PBXContainerItemProxy;
55 | containerPortal = 362A54341C9BD5E00056B653 /* Project object */;
56 | proxyType = 1;
57 | remoteGlobalIDString = 3643CE131CC283BD005A9C4B;
58 | remoteInfo = SpechtTunnelPacketProvider;
59 | };
60 | /* End PBXContainerItemProxy section */
61 |
62 | /* Begin PBXCopyFilesBuildPhase section */
63 | 362A549C1C9CF0C30056B653 /* Embed Frameworks */ = {
64 | isa = PBXCopyFilesBuildPhase;
65 | buildActionMask = 2147483647;
66 | dstPath = "";
67 | dstSubfolderSpec = 10;
68 | files = (
69 | 36DD363B1CE7366500537ACA /* MMDB.framework in Embed Frameworks */,
70 | 36A7194D1D5B539B00DC35F5 /* NEKit.framework in Embed Frameworks */,
71 | 36DD363F1CE7366500537ACA /* Yaml.framework in Embed Frameworks */,
72 | 36DD363D1CE7366500537ACA /* Sodium.framework in Embed Frameworks */,
73 | 362A54F31C9D05760056B653 /* CocoaLumberjack.framework in Embed Frameworks */,
74 | 362A549B1C9CF0C30056B653 /* CocoaAsyncSocket.framework in Embed Frameworks */,
75 | 36DD36451CE7366500537ACA /* CommonCrypto.framework in Embed Frameworks */,
76 | 36A7194F1D5B539B00DC35F5 /* tun2socks.framework in Embed Frameworks */,
77 | 36A7194B1D5B539B00DC35F5 /* lwip.framework in Embed Frameworks */,
78 | 362A54F51C9D05780056B653 /* CocoaLumberjackSwift.framework in Embed Frameworks */,
79 | );
80 | name = "Embed Frameworks";
81 | runOnlyForDeploymentPostprocessing = 0;
82 | };
83 | 3636DA541CE81D96007F9787 /* Embed App Extensions */ = {
84 | isa = PBXCopyFilesBuildPhase;
85 | buildActionMask = 2147483647;
86 | dstPath = "";
87 | dstSubfolderSpec = 13;
88 | files = (
89 | 3636DA511CE81D95007F9787 /* SpechtTunnelPacketProvider.appex in Embed App Extensions */,
90 | );
91 | name = "Embed App Extensions";
92 | runOnlyForDeploymentPostprocessing = 0;
93 | };
94 | /* End PBXCopyFilesBuildPhase section */
95 |
96 | /* Begin PBXFileReference section */
97 | 360B584C1CE810870018784F /* NetworkExtension.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NetworkExtension.framework; path = System/Library/Frameworks/NetworkExtension.framework; sourceTree = SDKROOT; };
98 | 36164A581CE71F4000BAC90A /* MMDB.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MMDB.framework; path = Carthage/Build/Mac/MMDB.framework; sourceTree = ""; };
99 | 36164A591CE71F4000BAC90A /* Sodium.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sodium.framework; path = Carthage/Build/Mac/Sodium.framework; sourceTree = ""; };
100 | 36164A5A1CE71F4000BAC90A /* Yaml.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Yaml.framework; path = Carthage/Build/Mac/Yaml.framework; sourceTree = ""; };
101 | 362A543C1C9BD5E00056B653 /* Specht.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Specht.app; sourceTree = BUILT_PRODUCTS_DIR; };
102 | 362A543F1C9BD5E00056B653 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
103 | 362A54411C9BD5E00056B653 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
104 | 362A54441C9BD5E00056B653 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; };
105 | 362A54461C9BD5E00056B653 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
106 | 362A54951C9CE8130056B653 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = ""; };
107 | 362A54961C9CF0B20056B653 /* CocoaAsyncSocket.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaAsyncSocket.framework; path = Carthage/Build/Mac/CocoaAsyncSocket.framework; sourceTree = ""; };
108 | 362A54EE1C9D056F0056B653 /* CocoaLumberjack.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaLumberjack.framework; path = Carthage/Build/Mac/CocoaLumberjack.framework; sourceTree = ""; };
109 | 362A54EF1C9D056F0056B653 /* CocoaLumberjackSwift.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CocoaLumberjackSwift.framework; path = Carthage/Build/Mac/CocoaLumberjackSwift.framework; sourceTree = ""; };
110 | 3636D9B01CE81749007F9787 /* icon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = icon.icns; sourceTree = ""; };
111 | 3636D9B21CE81749007F9787 /* share.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = share.entitlements; sourceTree = ""; };
112 | 3636D9B31CE81749007F9787 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; };
113 | 3636D9B61CE81749007F9787 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ShareViewController.xib; sourceTree = ""; };
114 | 3636D9B81CE81749007F9787 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
115 | 3643CE141CC283BD005A9C4B /* SpechtTunnelPacketProvider.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SpechtTunnelPacketProvider.appex; sourceTree = BUILT_PRODUCTS_DIR; };
116 | 3643CE171CC283BD005A9C4B /* SpechtTunnelPacketProvider.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = SpechtTunnelPacketProvider.entitlements; sourceTree = ""; };
117 | 3643CE181CC283BD005A9C4B /* PacketTunnelProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PacketTunnelProvider.swift; sourceTree = ""; };
118 | 3643CE1A1CC283BD005A9C4B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
119 | 3643CE3F1CC285BF005A9C4B /* SpechtTunnelPacketProvider-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SpechtTunnelPacketProvider-Bridging-Header.h"; sourceTree = ""; };
120 | 3643CE4C1CC293D4005A9C4B /* Specht.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Specht.entitlements; sourceTree = ""; };
121 | 36A719471D5B539B00DC35F5 /* lwip.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = lwip.framework; path = Carthage/Build/Mac/lwip.framework; sourceTree = ""; };
122 | 36A719481D5B539B00DC35F5 /* NEKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = NEKit.framework; path = Carthage/Build/Mac/NEKit.framework; sourceTree = ""; };
123 | 36A719491D5B539B00DC35F5 /* tun2socks.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = tun2socks.framework; path = Carthage/Build/Mac/tun2socks.framework; sourceTree = ""; };
124 | 36B3666F1D56C658003343AA /* VPNManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VPNManager.swift; sourceTree = ""; };
125 | 36B366731D56CB33003343AA /* MD5.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MD5.swift; sourceTree = ""; };
126 | 36C3D4291D6C114F003069F0 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = SOURCE_ROOT; };
127 | 36DCE5D31CA6972400C61029 /* CommonCrypto.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CommonCrypto.framework; path = Carthage/Build/Mac/CommonCrypto.framework; sourceTree = ""; };
128 | 36DCE5DD1CA6997700C61029 /* Specht-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Specht-Bridging-Header.h"; sourceTree = ""; };
129 | /* End PBXFileReference section */
130 |
131 | /* Begin PBXFrameworksBuildPhase section */
132 | 362A54391C9BD5E00056B653 /* Frameworks */ = {
133 | isa = PBXFrameworksBuildPhase;
134 | buildActionMask = 2147483647;
135 | files = (
136 | 36A7194A1D5B539B00DC35F5 /* lwip.framework in Frameworks */,
137 | 362A54F21C9D05760056B653 /* CocoaLumberjack.framework in Frameworks */,
138 | 36A7194E1D5B539B00DC35F5 /* tun2socks.framework in Frameworks */,
139 | 36DD363C1CE7366500537ACA /* Sodium.framework in Frameworks */,
140 | 362A549A1C9CF0C30056B653 /* CocoaAsyncSocket.framework in Frameworks */,
141 | 36A7194C1D5B539B00DC35F5 /* NEKit.framework in Frameworks */,
142 | 36DD363E1CE7366500537ACA /* Yaml.framework in Frameworks */,
143 | 36DD363A1CE7366500537ACA /* MMDB.framework in Frameworks */,
144 | 36E44A2C1CF2FE3900185DBF /* NetworkExtension.framework in Frameworks */,
145 | 36DD36441CE7366500537ACA /* CommonCrypto.framework in Frameworks */,
146 | 362A54F11C9D056F0056B653 /* CocoaLumberjackSwift.framework in Frameworks */,
147 | );
148 | runOnlyForDeploymentPostprocessing = 0;
149 | };
150 | 3643CE111CC283BD005A9C4B /* Frameworks */ = {
151 | isa = PBXFrameworksBuildPhase;
152 | buildActionMask = 2147483647;
153 | files = (
154 | 360B584E1CE810910018784F /* NetworkExtension.framework in Frameworks */,
155 | 36164A5C1CE71F4000BAC90A /* MMDB.framework in Frameworks */,
156 | 36164A5D1CE71F4000BAC90A /* Sodium.framework in Frameworks */,
157 | 36164A5E1CE71F4000BAC90A /* Yaml.framework in Frameworks */,
158 | 3643CE481CC290AF005A9C4B /* CocoaAsyncSocket.framework in Frameworks */,
159 | 3643CE241CC28467005A9C4B /* CocoaLumberjack.framework in Frameworks */,
160 | 3643CE251CC28467005A9C4B /* CocoaLumberjackSwift.framework in Frameworks */,
161 | 36164A561CE71F3F00BAC90A /* CommonCrypto.framework in Frameworks */,
162 | 36A719501D5B53A500DC35F5 /* lwip.framework in Frameworks */,
163 | 36A719511D5B53A500DC35F5 /* NEKit.framework in Frameworks */,
164 | 36A719521D5B53A500DC35F5 /* tun2socks.framework in Frameworks */,
165 | );
166 | runOnlyForDeploymentPostprocessing = 0;
167 | };
168 | /* End PBXFrameworksBuildPhase section */
169 |
170 | /* Begin PBXGroup section */
171 | 362A54331C9BD5E00056B653 = {
172 | isa = PBXGroup;
173 | children = (
174 | 36C3D4291D6C114F003069F0 /* README.md */,
175 | 36A719531D5B543700DC35F5 /* Carthage */,
176 | 362A54951C9CE8130056B653 /* Cartfile */,
177 | 362A543E1C9BD5E00056B653 /* Specht */,
178 | 3643CE151CC283BD005A9C4B /* SpechtTunnelPacketProvider */,
179 | 3636D9AE1CE81749007F9787 /* share */,
180 | 362A543D1C9BD5E00056B653 /* Products */,
181 | );
182 | sourceTree = "";
183 | };
184 | 362A543D1C9BD5E00056B653 /* Products */ = {
185 | isa = PBXGroup;
186 | children = (
187 | 362A543C1C9BD5E00056B653 /* Specht.app */,
188 | 3643CE141CC283BD005A9C4B /* SpechtTunnelPacketProvider.appex */,
189 | );
190 | name = Products;
191 | sourceTree = "";
192 | };
193 | 362A543E1C9BD5E00056B653 /* Specht */ = {
194 | isa = PBXGroup;
195 | children = (
196 | 3643CE4C1CC293D4005A9C4B /* Specht.entitlements */,
197 | 36DCE5DD1CA6997700C61029 /* Specht-Bridging-Header.h */,
198 | 362A543F1C9BD5E00056B653 /* AppDelegate.swift */,
199 | 362A54411C9BD5E00056B653 /* Assets.xcassets */,
200 | 362A54431C9BD5E00056B653 /* MainMenu.xib */,
201 | 362A54461C9BD5E00056B653 /* Info.plist */,
202 | 36B3666F1D56C658003343AA /* VPNManager.swift */,
203 | 36B366731D56CB33003343AA /* MD5.swift */,
204 | );
205 | path = Specht;
206 | sourceTree = "";
207 | };
208 | 3636D9AE1CE81749007F9787 /* share */ = {
209 | isa = PBXGroup;
210 | children = (
211 | 3636D9B31CE81749007F9787 /* ShareViewController.swift */,
212 | 3636D9B51CE81749007F9787 /* ShareViewController.xib */,
213 | 3636D9B81CE81749007F9787 /* Info.plist */,
214 | 3636D9AF1CE81749007F9787 /* Supporting Files */,
215 | );
216 | path = share;
217 | sourceTree = "";
218 | };
219 | 3636D9AF1CE81749007F9787 /* Supporting Files */ = {
220 | isa = PBXGroup;
221 | children = (
222 | 3636D9B01CE81749007F9787 /* icon.icns */,
223 | 3636D9B21CE81749007F9787 /* share.entitlements */,
224 | );
225 | name = "Supporting Files";
226 | sourceTree = "";
227 | };
228 | 3643CE151CC283BD005A9C4B /* SpechtTunnelPacketProvider */ = {
229 | isa = PBXGroup;
230 | children = (
231 | 3643CE181CC283BD005A9C4B /* PacketTunnelProvider.swift */,
232 | 3643CE1A1CC283BD005A9C4B /* Info.plist */,
233 | 3643CE161CC283BD005A9C4B /* Supporting Files */,
234 | 3643CE3F1CC285BF005A9C4B /* SpechtTunnelPacketProvider-Bridging-Header.h */,
235 | );
236 | path = SpechtTunnelPacketProvider;
237 | sourceTree = "";
238 | };
239 | 3643CE161CC283BD005A9C4B /* Supporting Files */ = {
240 | isa = PBXGroup;
241 | children = (
242 | 3643CE171CC283BD005A9C4B /* SpechtTunnelPacketProvider.entitlements */,
243 | );
244 | name = "Supporting Files";
245 | sourceTree = "";
246 | };
247 | 36A719531D5B543700DC35F5 /* Carthage */ = {
248 | isa = PBXGroup;
249 | children = (
250 | 36A719471D5B539B00DC35F5 /* lwip.framework */,
251 | 36A719481D5B539B00DC35F5 /* NEKit.framework */,
252 | 36A719491D5B539B00DC35F5 /* tun2socks.framework */,
253 | 360B584C1CE810870018784F /* NetworkExtension.framework */,
254 | 36164A581CE71F4000BAC90A /* MMDB.framework */,
255 | 36164A591CE71F4000BAC90A /* Sodium.framework */,
256 | 36164A5A1CE71F4000BAC90A /* Yaml.framework */,
257 | 36DCE5D31CA6972400C61029 /* CommonCrypto.framework */,
258 | 362A54EE1C9D056F0056B653 /* CocoaLumberjack.framework */,
259 | 362A54EF1C9D056F0056B653 /* CocoaLumberjackSwift.framework */,
260 | 362A54961C9CF0B20056B653 /* CocoaAsyncSocket.framework */,
261 | );
262 | name = Carthage;
263 | sourceTree = "";
264 | };
265 | /* End PBXGroup section */
266 |
267 | /* Begin PBXNativeTarget section */
268 | 362A543B1C9BD5E00056B653 /* Specht */ = {
269 | isa = PBXNativeTarget;
270 | buildConfigurationList = 362A545F1C9BD5E10056B653 /* Build configuration list for PBXNativeTarget "Specht" */;
271 | buildPhases = (
272 | 362A54381C9BD5E00056B653 /* Sources */,
273 | 362A54391C9BD5E00056B653 /* Frameworks */,
274 | 362A543A1C9BD5E00056B653 /* Resources */,
275 | 362A549C1C9CF0C30056B653 /* Embed Frameworks */,
276 | 3636DA541CE81D96007F9787 /* Embed App Extensions */,
277 | );
278 | buildRules = (
279 | );
280 | dependencies = (
281 | 3636DA531CE81D95007F9787 /* PBXTargetDependency */,
282 | );
283 | name = Specht;
284 | productName = Specht;
285 | productReference = 362A543C1C9BD5E00056B653 /* Specht.app */;
286 | productType = "com.apple.product-type.application";
287 | };
288 | 3643CE131CC283BD005A9C4B /* SpechtTunnelPacketProvider */ = {
289 | isa = PBXNativeTarget;
290 | buildConfigurationList = 3643CE1E1CC283BD005A9C4B /* Build configuration list for PBXNativeTarget "SpechtTunnelPacketProvider" */;
291 | buildPhases = (
292 | 3643CE101CC283BD005A9C4B /* Sources */,
293 | 3643CE111CC283BD005A9C4B /* Frameworks */,
294 | 3643CE121CC283BD005A9C4B /* Resources */,
295 | );
296 | buildRules = (
297 | );
298 | dependencies = (
299 | );
300 | name = SpechtTunnelPacketProvider;
301 | productName = SpechtTunnelPacketProvider;
302 | productReference = 3643CE141CC283BD005A9C4B /* SpechtTunnelPacketProvider.appex */;
303 | productType = "com.apple.product-type.app-extension";
304 | };
305 | /* End PBXNativeTarget section */
306 |
307 | /* Begin PBXProject section */
308 | 362A54341C9BD5E00056B653 /* Project object */ = {
309 | isa = PBXProject;
310 | attributes = {
311 | LastSwiftUpdateCheck = 0730;
312 | LastUpgradeCheck = 0730;
313 | ORGANIZATIONNAME = "Zhuhao Wang";
314 | TargetAttributes = {
315 | 362A543B1C9BD5E00056B653 = {
316 | CreatedOnToolsVersion = 7.2.1;
317 | DevelopmentTeam = H5443445N6;
318 | SystemCapabilities = {
319 | com.apple.Sandbox = {
320 | enabled = 1;
321 | };
322 | com.apple.VPNLite = {
323 | enabled = 1;
324 | };
325 | };
326 | };
327 | 3643CE131CC283BD005A9C4B = {
328 | CreatedOnToolsVersion = 7.3;
329 | DevelopmentTeam = H5443445N6;
330 | SystemCapabilities = {
331 | com.apple.Sandbox = {
332 | enabled = 1;
333 | };
334 | com.apple.VPNLite = {
335 | enabled = 1;
336 | };
337 | };
338 | };
339 | };
340 | };
341 | buildConfigurationList = 362A54371C9BD5E00056B653 /* Build configuration list for PBXProject "Specht" */;
342 | compatibilityVersion = "Xcode 6.3";
343 | developmentRegion = English;
344 | hasScannedForEncodings = 0;
345 | knownRegions = (
346 | en,
347 | Base,
348 | );
349 | mainGroup = 362A54331C9BD5E00056B653;
350 | productRefGroup = 362A543D1C9BD5E00056B653 /* Products */;
351 | projectDirPath = "";
352 | projectRoot = "";
353 | targets = (
354 | 362A543B1C9BD5E00056B653 /* Specht */,
355 | 3643CE131CC283BD005A9C4B /* SpechtTunnelPacketProvider */,
356 | );
357 | };
358 | /* End PBXProject section */
359 |
360 | /* Begin PBXResourcesBuildPhase section */
361 | 362A543A1C9BD5E00056B653 /* Resources */ = {
362 | isa = PBXResourcesBuildPhase;
363 | buildActionMask = 2147483647;
364 | files = (
365 | 362A54421C9BD5E00056B653 /* Assets.xcassets in Resources */,
366 | 362A54451C9BD5E00056B653 /* MainMenu.xib in Resources */,
367 | );
368 | runOnlyForDeploymentPostprocessing = 0;
369 | };
370 | 3643CE121CC283BD005A9C4B /* Resources */ = {
371 | isa = PBXResourcesBuildPhase;
372 | buildActionMask = 2147483647;
373 | files = (
374 | );
375 | runOnlyForDeploymentPostprocessing = 0;
376 | };
377 | /* End PBXResourcesBuildPhase section */
378 |
379 | /* Begin PBXSourcesBuildPhase section */
380 | 362A54381C9BD5E00056B653 /* Sources */ = {
381 | isa = PBXSourcesBuildPhase;
382 | buildActionMask = 2147483647;
383 | files = (
384 | 36B366701D56C658003343AA /* VPNManager.swift in Sources */,
385 | 362A54401C9BD5E00056B653 /* AppDelegate.swift in Sources */,
386 | 36B366741D56CB33003343AA /* MD5.swift in Sources */,
387 | );
388 | runOnlyForDeploymentPostprocessing = 0;
389 | };
390 | 3643CE101CC283BD005A9C4B /* Sources */ = {
391 | isa = PBXSourcesBuildPhase;
392 | buildActionMask = 2147483647;
393 | files = (
394 | 36C3D42A1D6C114F003069F0 /* README.md in Sources */,
395 | 3643CE191CC283BD005A9C4B /* PacketTunnelProvider.swift in Sources */,
396 | );
397 | runOnlyForDeploymentPostprocessing = 0;
398 | };
399 | /* End PBXSourcesBuildPhase section */
400 |
401 | /* Begin PBXTargetDependency section */
402 | 3636DA531CE81D95007F9787 /* PBXTargetDependency */ = {
403 | isa = PBXTargetDependency;
404 | target = 3643CE131CC283BD005A9C4B /* SpechtTunnelPacketProvider */;
405 | targetProxy = 3636DA521CE81D95007F9787 /* PBXContainerItemProxy */;
406 | };
407 | /* End PBXTargetDependency section */
408 |
409 | /* Begin PBXVariantGroup section */
410 | 362A54431C9BD5E00056B653 /* MainMenu.xib */ = {
411 | isa = PBXVariantGroup;
412 | children = (
413 | 362A54441C9BD5E00056B653 /* Base */,
414 | );
415 | name = MainMenu.xib;
416 | sourceTree = "";
417 | };
418 | 3636D9B51CE81749007F9787 /* ShareViewController.xib */ = {
419 | isa = PBXVariantGroup;
420 | children = (
421 | 3636D9B61CE81749007F9787 /* Base */,
422 | );
423 | name = ShareViewController.xib;
424 | sourceTree = "";
425 | };
426 | /* End PBXVariantGroup section */
427 |
428 | /* Begin XCBuildConfiguration section */
429 | 362A545D1C9BD5E10056B653 /* Debug */ = {
430 | isa = XCBuildConfiguration;
431 | buildSettings = {
432 | ALWAYS_SEARCH_USER_PATHS = NO;
433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
434 | CLANG_CXX_LIBRARY = "libc++";
435 | CLANG_ENABLE_MODULES = YES;
436 | CLANG_ENABLE_OBJC_ARC = YES;
437 | CLANG_WARN_BOOL_CONVERSION = YES;
438 | CLANG_WARN_CONSTANT_CONVERSION = YES;
439 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
440 | CLANG_WARN_EMPTY_BODY = YES;
441 | CLANG_WARN_ENUM_CONVERSION = YES;
442 | CLANG_WARN_INT_CONVERSION = YES;
443 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
444 | CLANG_WARN_UNREACHABLE_CODE = YES;
445 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
446 | CODE_SIGN_IDENTITY = "-";
447 | COPY_PHASE_STRIP = NO;
448 | DEBUG_INFORMATION_FORMAT = dwarf;
449 | ENABLE_STRICT_OBJC_MSGSEND = YES;
450 | ENABLE_TESTABILITY = YES;
451 | GCC_C_LANGUAGE_STANDARD = gnu99;
452 | GCC_DYNAMIC_NO_PIC = NO;
453 | GCC_NO_COMMON_BLOCKS = YES;
454 | GCC_OPTIMIZATION_LEVEL = 0;
455 | GCC_PREPROCESSOR_DEFINITIONS = (
456 | "DEBUG=1",
457 | "$(inherited)",
458 | );
459 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
460 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
461 | GCC_WARN_UNDECLARED_SELECTOR = YES;
462 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
463 | GCC_WARN_UNUSED_FUNCTION = YES;
464 | GCC_WARN_UNUSED_VARIABLE = YES;
465 | MACOSX_DEPLOYMENT_TARGET = 10.11;
466 | MTL_ENABLE_DEBUG_INFO = YES;
467 | ONLY_ACTIVE_ARCH = YES;
468 | SDKROOT = macosx;
469 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
470 | };
471 | name = Debug;
472 | };
473 | 362A545E1C9BD5E10056B653 /* Release */ = {
474 | isa = XCBuildConfiguration;
475 | buildSettings = {
476 | ALWAYS_SEARCH_USER_PATHS = NO;
477 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
478 | CLANG_CXX_LIBRARY = "libc++";
479 | CLANG_ENABLE_MODULES = YES;
480 | CLANG_ENABLE_OBJC_ARC = YES;
481 | CLANG_WARN_BOOL_CONVERSION = YES;
482 | CLANG_WARN_CONSTANT_CONVERSION = YES;
483 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
484 | CLANG_WARN_EMPTY_BODY = YES;
485 | CLANG_WARN_ENUM_CONVERSION = YES;
486 | CLANG_WARN_INT_CONVERSION = YES;
487 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
488 | CLANG_WARN_UNREACHABLE_CODE = YES;
489 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
490 | CODE_SIGN_IDENTITY = "-";
491 | COPY_PHASE_STRIP = NO;
492 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
493 | ENABLE_NS_ASSERTIONS = NO;
494 | ENABLE_STRICT_OBJC_MSGSEND = YES;
495 | GCC_C_LANGUAGE_STANDARD = gnu99;
496 | GCC_NO_COMMON_BLOCKS = YES;
497 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
498 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
499 | GCC_WARN_UNDECLARED_SELECTOR = YES;
500 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
501 | GCC_WARN_UNUSED_FUNCTION = YES;
502 | GCC_WARN_UNUSED_VARIABLE = YES;
503 | MACOSX_DEPLOYMENT_TARGET = 10.11;
504 | MTL_ENABLE_DEBUG_INFO = NO;
505 | SDKROOT = macosx;
506 | };
507 | name = Release;
508 | };
509 | 362A54601C9BD5E10056B653 /* Debug */ = {
510 | isa = XCBuildConfiguration;
511 | buildSettings = {
512 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
513 | CODE_SIGN_ENTITLEMENTS = Specht/Specht.entitlements;
514 | CODE_SIGN_IDENTITY = "Mac Developer";
515 | COMBINE_HIDPI_IMAGES = YES;
516 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
517 | FRAMEWORK_SEARCH_PATHS = (
518 | "$(inherited)",
519 | "$(PROJECT_DIR)/Carthage/Build/Mac",
520 | "$(PROJECT_DIR)/NEKit/tun2socks/build/Debug",
521 | );
522 | INFOPLIST_FILE = Specht/Info.plist;
523 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks";
524 | PRODUCT_BUNDLE_IDENTIFIER = me.zhuhaow.osx.Specht;
525 | PRODUCT_NAME = "$(TARGET_NAME)";
526 | PROVISIONING_PROFILE = "30fcd81f-15a5-40a5-ada9-8d27995effd5";
527 | };
528 | name = Debug;
529 | };
530 | 362A54611C9BD5E10056B653 /* Release */ = {
531 | isa = XCBuildConfiguration;
532 | buildSettings = {
533 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
534 | CODE_SIGN_ENTITLEMENTS = Specht/Specht.entitlements;
535 | CODE_SIGN_IDENTITY = "Mac Developer";
536 | COMBINE_HIDPI_IMAGES = YES;
537 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES;
538 | FRAMEWORK_SEARCH_PATHS = (
539 | "$(inherited)",
540 | "$(PROJECT_DIR)/Carthage/Build/Mac",
541 | "$(PROJECT_DIR)/NEKit/tun2socks/build/Debug",
542 | );
543 | INFOPLIST_FILE = Specht/Info.plist;
544 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks";
545 | PRODUCT_BUNDLE_IDENTIFIER = me.zhuhaow.osx.Specht;
546 | PRODUCT_NAME = "$(TARGET_NAME)";
547 | };
548 | name = Release;
549 | };
550 | 3643CE1F1CC283BD005A9C4B /* Debug */ = {
551 | isa = XCBuildConfiguration;
552 | buildSettings = {
553 | CLANG_ANALYZER_NONNULL = YES;
554 | CODE_SIGN_ENTITLEMENTS = SpechtTunnelPacketProvider/SpechtTunnelPacketProvider.entitlements;
555 | CODE_SIGN_IDENTITY = "Mac Developer";
556 | COMBINE_HIDPI_IMAGES = YES;
557 | FRAMEWORK_SEARCH_PATHS = (
558 | "$(inherited)",
559 | "$(PROJECT_DIR)/Carthage/Build/Mac",
560 | );
561 | INFOPLIST_FILE = SpechtTunnelPacketProvider/Info.plist;
562 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @executable_path/../../../../Frameworks";
563 | MACOSX_DEPLOYMENT_TARGET = 10.11;
564 | PRODUCT_BUNDLE_IDENTIFIER = me.zhuhaow.osx.Specht.SpechtTunnelPacketProvider;
565 | PRODUCT_NAME = "$(TARGET_NAME)";
566 | PROVISIONING_PROFILE = "25a846a7-bdf1-45a4-a355-81653d0b718b";
567 | SDKROOT = macosx;
568 | SKIP_INSTALL = NO;
569 | };
570 | name = Debug;
571 | };
572 | 3643CE201CC283BD005A9C4B /* Release */ = {
573 | isa = XCBuildConfiguration;
574 | buildSettings = {
575 | CLANG_ANALYZER_NONNULL = YES;
576 | CODE_SIGN_ENTITLEMENTS = SpechtTunnelPacketProvider/SpechtTunnelPacketProvider.entitlements;
577 | CODE_SIGN_IDENTITY = "Mac Developer";
578 | COMBINE_HIDPI_IMAGES = YES;
579 | FRAMEWORK_SEARCH_PATHS = (
580 | "$(inherited)",
581 | "$(PROJECT_DIR)/Carthage/Build/Mac",
582 | );
583 | INFOPLIST_FILE = SpechtTunnelPacketProvider/Info.plist;
584 | LD_RUNPATH_SEARCH_PATHS = "@executable_path/../Frameworks @executable_path/../../../../Frameworks";
585 | MACOSX_DEPLOYMENT_TARGET = 10.11;
586 | PRODUCT_BUNDLE_IDENTIFIER = me.zhuhaow.osx.Specht.SpechtTunnelPacketProvider;
587 | PRODUCT_NAME = "$(TARGET_NAME)";
588 | SDKROOT = macosx;
589 | SKIP_INSTALL = NO;
590 | };
591 | name = Release;
592 | };
593 | /* End XCBuildConfiguration section */
594 |
595 | /* Begin XCConfigurationList section */
596 | 362A54371C9BD5E00056B653 /* Build configuration list for PBXProject "Specht" */ = {
597 | isa = XCConfigurationList;
598 | buildConfigurations = (
599 | 362A545D1C9BD5E10056B653 /* Debug */,
600 | 362A545E1C9BD5E10056B653 /* Release */,
601 | );
602 | defaultConfigurationIsVisible = 0;
603 | defaultConfigurationName = Release;
604 | };
605 | 362A545F1C9BD5E10056B653 /* Build configuration list for PBXNativeTarget "Specht" */ = {
606 | isa = XCConfigurationList;
607 | buildConfigurations = (
608 | 362A54601C9BD5E10056B653 /* Debug */,
609 | 362A54611C9BD5E10056B653 /* Release */,
610 | );
611 | defaultConfigurationIsVisible = 0;
612 | defaultConfigurationName = Release;
613 | };
614 | 3643CE1E1CC283BD005A9C4B /* Build configuration list for PBXNativeTarget "SpechtTunnelPacketProvider" */ = {
615 | isa = XCConfigurationList;
616 | buildConfigurations = (
617 | 3643CE1F1CC283BD005A9C4B /* Debug */,
618 | 3643CE201CC283BD005A9C4B /* Release */,
619 | );
620 | defaultConfigurationIsVisible = 0;
621 | defaultConfigurationName = Release;
622 | };
623 | /* End XCConfigurationList section */
624 | };
625 | rootObject = 362A54341C9BD5E00056B653 /* Project object */;
626 | }
627 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
--------------------------------------------------------------------------------