diff --git a/ClashX.xcodeproj/project.pbxproj b/ClashX.xcodeproj/project.pbxproj index 447783e..f94a686 100644 --- a/ClashX.xcodeproj/project.pbxproj +++ b/ClashX.xcodeproj/project.pbxproj @@ -158,6 +158,7 @@ 4981C88C216BAE4A008CC14A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; 4981C88E216BAE4D008CC14A /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 49862F9F218418C600A1D5EC /* ClashRule.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClashRule.swift; sourceTree = ""; }; + 498960722340F21C00AFB7EC /* com.west2online.ClashX.ProxyConfigHelper.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = com.west2online.ClashX.ProxyConfigHelper.entitlements; sourceTree = ""; }; 4989F98320D02D200001E564 /* Country.mmdb */ = {isa = PBXFileReference; lastKnownFileType = file; path = Country.mmdb; sourceTree = ""; }; 4989F98D20D0AE990001E564 /* sampleConfig.yaml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; path = sampleConfig.yaml; sourceTree = ""; }; 4997732320D251A60009B136 /* SWBApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWBApplication.m; sourceTree = ""; }; @@ -440,6 +441,7 @@ F9A7C06A2306E874007163C7 /* ProxyConfigHelper */ = { isa = PBXGroup; children = ( + 498960722340F21C00AFB7EC /* com.west2online.ClashX.ProxyConfigHelper.entitlements */, F9A7C06B2306E874007163C7 /* main.m */, F935B2F12307C802009E4D33 /* Helper-Launchd.plist */, F935B2EA2307B6BA009E4D33 /* Helper-Info.plist */, @@ -994,11 +996,14 @@ F9A7C06E2306E874007163C7 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_ENTITLEMENTS = ProxyConfigHelper/com.west2online.ClashX.ProxyConfigHelper.entitlements; CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = MEWHFZ92DY; + ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "$(SRCROOT)/ProxyConfigHelper/Helper-Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 1.2; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; OTHER_LDFLAGS = ( @@ -1020,11 +1025,14 @@ F9A7C06F2306E874007163C7 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_ENTITLEMENTS = ProxyConfigHelper/com.west2online.ClashX.ProxyConfigHelper.entitlements; CODE_SIGN_IDENTITY = "Developer ID Application"; CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = MEWHFZ92DY; + ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "$(SRCROOT)/ProxyConfigHelper/Helper-Info.plist"; MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 1.2; MTL_FAST_MATH = YES; OTHER_LDFLAGS = ( "-sectcreate", diff --git a/Podfile b/Podfile index 35396f8..b044359 100644 --- a/Podfile +++ b/Podfile @@ -21,7 +21,7 @@ target 'ClashX' do pod 'CocoaLumberjack/Swift' pod 'WebViewJavascriptBridge' pod 'Yams' - pod 'Starscream', '~> 3.0.2' + pod 'Starscream',:git=>'https://github.com/daltoniam/Starscream.git', :branch => 'master' pod 'Fabric' pod 'Crashlytics' diff --git a/Podfile.lock b/Podfile.lock index 821c10b..7492459 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -13,7 +13,7 @@ PODS: - RxRelay (5.0.0): - RxSwift (~> 5) - RxSwift (5.0.0) - - Starscream (3.0.6) + - Starscream (3.1.0) - SwiftyJSON (5.0.0) - WebViewJavascriptBridge (6.0.3) - Yams (2.0.0) @@ -26,7 +26,7 @@ DEPENDENCIES: - LetsMove - RxCocoa - RxSwift - - Starscream (~> 3.0.2) + - Starscream (from `https://github.com/daltoniam/Starscream.git`, branch `master`) - SwiftyJSON - WebViewJavascriptBridge - Yams @@ -41,11 +41,20 @@ SPEC REPOS: - RxCocoa - RxRelay - RxSwift - - Starscream - SwiftyJSON - WebViewJavascriptBridge - Yams +EXTERNAL SOURCES: + Starscream: + :branch: master + :git: https://github.com/daltoniam/Starscream.git + +CHECKOUT OPTIONS: + Starscream: + :commit: a2ed45c0b2f996cb8c335c4f270ecc68c3bd4c0f + :git: https://github.com/daltoniam/Starscream.git + SPEC CHECKSUMS: Alamofire: f9450d3c7f6bea2ad62e7a541c3e9b186c7991d6 CocoaLumberjack: 2f44e60eb91c176d471fdba43b9e3eae6a721947 @@ -55,11 +64,11 @@ SPEC CHECKSUMS: RxCocoa: fcf32050ac00d801f34a7f71d5e8e7f23026dcd8 RxRelay: 4f7409406a51a55cd88483f21ed898c234d60f18 RxSwift: 8b0671caa829a763bbce7271095859121cbd895f - Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5 + Starscream: 5cbf3d36bf5af6906d1362bba4ce326bb011d4cc SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7 WebViewJavascriptBridge: 7f5bc4d3581e672e8f32bd0f812d54bc69bb8e29 Yams: cb96472112d99e4b368f8dae9ab62e8a3eb8a3f9 -PODFILE CHECKSUM: 71df0e7274f61bf9b1045f3f9117edbb65ed746a +PODFILE CHECKSUM: fc789f2f0510efcbeb2cbc20a292a19ff82d9c60 COCOAPODS: 1.7.5 diff --git a/Pods/Local Podspecs/Starscream.podspec.json b/Pods/Local Podspecs/Starscream.podspec.json new file mode 100644 index 0000000..474d686 --- /dev/null +++ b/Pods/Local Podspecs/Starscream.podspec.json @@ -0,0 +1,25 @@ +{ + "name": "Starscream", + "version": "3.1.0", + "summary": "A conforming WebSocket RFC 6455 client library in Swift.", + "homepage": "https://github.com/daltoniam/Starscream", + "license": "Apache License, Version 2.0", + "authors": { + "Dalton Cherry": "http://daltoniam.com", + "Austin Cherry": "http://austincherry.me" + }, + "source": { + "git": "https://github.com/daltoniam/Starscream.git", + "tag": "3.1.0" + }, + "social_media_url": "http://twitter.com/daltoniam", + "platforms": { + "ios": "8.0", + "osx": "10.10", + "tvos": "9.0", + "watchos": "2.0" + }, + "source_files": "Sources/**/*.swift", + "swift_versions": "5.0", + "swift_version": "5.0" +} diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 821c10b..7492459 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -13,7 +13,7 @@ PODS: - RxRelay (5.0.0): - RxSwift (~> 5) - RxSwift (5.0.0) - - Starscream (3.0.6) + - Starscream (3.1.0) - SwiftyJSON (5.0.0) - WebViewJavascriptBridge (6.0.3) - Yams (2.0.0) @@ -26,7 +26,7 @@ DEPENDENCIES: - LetsMove - RxCocoa - RxSwift - - Starscream (~> 3.0.2) + - Starscream (from `https://github.com/daltoniam/Starscream.git`, branch `master`) - SwiftyJSON - WebViewJavascriptBridge - Yams @@ -41,11 +41,20 @@ SPEC REPOS: - RxCocoa - RxRelay - RxSwift - - Starscream - SwiftyJSON - WebViewJavascriptBridge - Yams +EXTERNAL SOURCES: + Starscream: + :branch: master + :git: https://github.com/daltoniam/Starscream.git + +CHECKOUT OPTIONS: + Starscream: + :commit: a2ed45c0b2f996cb8c335c4f270ecc68c3bd4c0f + :git: https://github.com/daltoniam/Starscream.git + SPEC CHECKSUMS: Alamofire: f9450d3c7f6bea2ad62e7a541c3e9b186c7991d6 CocoaLumberjack: 2f44e60eb91c176d471fdba43b9e3eae6a721947 @@ -55,11 +64,11 @@ SPEC CHECKSUMS: RxCocoa: fcf32050ac00d801f34a7f71d5e8e7f23026dcd8 RxRelay: 4f7409406a51a55cd88483f21ed898c234d60f18 RxSwift: 8b0671caa829a763bbce7271095859121cbd895f - Starscream: ef3ece99d765eeccb67de105bfa143f929026cf5 + Starscream: 5cbf3d36bf5af6906d1362bba4ce326bb011d4cc SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7 WebViewJavascriptBridge: 7f5bc4d3581e672e8f32bd0f812d54bc69bb8e29 Yams: cb96472112d99e4b368f8dae9ab62e8a3eb8a3f9 -PODFILE CHECKSUM: 71df0e7274f61bf9b1045f3f9117edbb65ed746a +PODFILE CHECKSUM: fc789f2f0510efcbeb2cbc20a292a19ff82d9c60 COCOAPODS: 1.7.5 diff --git a/Pods/Pods.xcodeproj/project.pbxproj b/Pods/Pods.xcodeproj/project.pbxproj index 031ed7a..5fa6785 100644 --- a/Pods/Pods.xcodeproj/project.pbxproj +++ b/Pods/Pods.xcodeproj/project.pbxproj @@ -3207,7 +3207,7 @@ }; name = Release; }; - 2DBC401072E6A755AEB99CD100042416 /* Debug */ = { + 31F51B2907001BB396582CC610E0DCFB /* Debug */ = { isa = XCBuildConfiguration; baseConfigurationReference = D1CEF0227E8F30D655ADB74E7BF2C12E /* Starscream.xcconfig */; buildSettings = { @@ -3239,7 +3239,7 @@ SDKROOT = macosx; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 4.2; + SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -3738,44 +3738,6 @@ }; name = Debug; }; - 924BBDF28F7D59024EBFCC2EC98D711D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = D1CEF0227E8F30D655ADB74E7BF2C12E /* Starscream.xcconfig */; - buildSettings = { - ARCHS = "$(ARCHS_STANDARD_64_BIT)"; - CLANG_ENABLE_OBJC_WEAK = NO; - CODE_SIGN_IDENTITY = ""; - "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; - COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1; - DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - FRAMEWORK_VERSION = A; - GCC_PREFIX_HEADER = "Target Support Files/Starscream/Starscream-prefix.pch"; - INFOPLIST_FILE = "Target Support Files/Starscream/Starscream-Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - "@loader_path/Frameworks", - ); - MACOSX_DEPLOYMENT_TARGET = 10.10; - MODULEMAP_FILE = "Target Support Files/Starscream/Starscream.modulemap"; - PRODUCT_MODULE_NAME = Starscream; - PRODUCT_NAME = Starscream; - SDKROOT = macosx; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; - SWIFT_VERSION = 4.2; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; AF406933D427D9AE231B34EC374A1567 /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 1D891C4053BD93D2C467B6D4122BF57E /* LetsMove.xcconfig */; @@ -3964,6 +3926,44 @@ }; name = Debug; }; + DBE5625922C7A4D341A212402EB255F2 /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = D1CEF0227E8F30D655ADB74E7BF2C12E /* Starscream.xcconfig */; + buildSettings = { + ARCHS = "$(ARCHS_STANDARD_64_BIT)"; + CLANG_ENABLE_OBJC_WEAK = NO; + CODE_SIGN_IDENTITY = ""; + "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_VERSION = A; + GCC_PREFIX_HEADER = "Target Support Files/Starscream/Starscream-prefix.pch"; + INFOPLIST_FILE = "Target Support Files/Starscream/Starscream-Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.10; + MODULEMAP_FILE = "Target Support Files/Starscream/Starscream.modulemap"; + PRODUCT_MODULE_NAME = Starscream; + PRODUCT_NAME = Starscream; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) "; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; EADBE94060815557A311FFD4FEE1046C /* Release */ = { isa = XCBuildConfiguration; baseConfigurationReference = 4B0212A63C916B5675093E3820E057F6 /* RxRelay.xcconfig */; @@ -4180,8 +4180,8 @@ ED5C15C705AB67930733A7E237A0A33A /* Build configuration list for PBXNativeTarget "Starscream" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2DBC401072E6A755AEB99CD100042416 /* Debug */, - 924BBDF28F7D59024EBFCC2EC98D711D /* Release */, + 31F51B2907001BB396582CC610E0DCFB /* Debug */, + DBE5625922C7A4D341A212402EB255F2 /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Pods/Starscream/README.md b/Pods/Starscream/README.md index 4d28297..90a7e0e 100644 --- a/Pods/Starscream/README.md +++ b/Pods/Starscream/README.md @@ -311,6 +311,29 @@ To integrate Starscream into your Xcode project using Carthage, specify it in yo github "daltoniam/Starscream" >= 3.0.2 ``` +### Accio + +Check out the [Accio](https://github.com/JamitLabs/Accio) docs on how to add a install. + +Add the following to your Package.swift: + +```swift +.package(url: "https://github.com/daltoniam/Starscream.git", .upToNextMajor(from: "3.1.0")), +``` + +Next, add `Starscream` to your App targets dependencies like so: + +```swift +.target( + name: "App", + dependencies: [ + "Starscream", + ] +), +``` + +Then run `accio update`. + ### Rogue First see the [installation docs](https://github.com/acmacalister/Rogue) for how to install Rogue. @@ -385,6 +408,10 @@ func websocketHttpUpgrade(socket: WebSocketClient, response: CFHTTPMessage) { } ``` +## Swift versions + +* Swift 4.2 - 3.0.6 + ## KNOWN ISSUES - WatchOS does not have the the CFNetwork String constants to modify the stream's SSL behavior. It will be the default Foundation SSL behavior. This means watchOS CANNOT use `SSLCiphers`, `disableSSLCertValidation`, or SSL pinning. All these values set on watchOS will do nothing. - Linux does not have the security framework, so it CANNOT use SSL pinning or `SSLCiphers` either. diff --git a/Pods/Starscream/Sources/Starscream/WebSocket.swift b/Pods/Starscream/Sources/Starscream/WebSocket.swift index 4101c5a..7d48a20 100644 --- a/Pods/Starscream/Sources/Starscream/WebSocket.swift +++ b/Pods/Starscream/Sources/Starscream/WebSocket.swift @@ -135,7 +135,7 @@ public protocol WSStream { } open class FoundationStream : NSObject, WSStream, StreamDelegate { - private static let sharedWorkQueue = DispatchQueue(label: "com.vluxe.starscream.websocket", attributes: []) + private let workQueue = DispatchQueue(label: "com.vluxe.starscream.websocket", attributes: []) private var inputStream: InputStream? private var outputStream: OutputStream? public weak var delegate: WSStreamDelegate? @@ -210,13 +210,13 @@ open class FoundationStream : NSObject, WSStream, StreamDelegate { #endif } - CFReadStreamSetDispatchQueue(inStream, FoundationStream.sharedWorkQueue) - CFWriteStreamSetDispatchQueue(outStream, FoundationStream.sharedWorkQueue) + CFReadStreamSetDispatchQueue(inStream, workQueue) + CFWriteStreamSetDispatchQueue(outStream, workQueue) inStream.open() outStream.open() var out = timeout// wait X seconds before giving up - FoundationStream.sharedWorkQueue.async { [weak self] in + workQueue.async { [weak self] in while !outStream.hasSpaceAvailable { usleep(100) // wait until the socket is ready out -= 100 @@ -475,7 +475,7 @@ open class WebSocket : NSObject, StreamDelegate, WebSocketClient, WSStreamDelega } self.request.setValue(origin, forHTTPHeaderField: headerOriginName) } - if let protocols = protocols { + if let protocols = protocols, !protocols.isEmpty { self.request.setValue(protocols.joined(separator: ","), forHTTPHeaderField: headerWSProtocolName) } writeQueue.maxConcurrentOperationCount = 1 diff --git a/Pods/Target Support Files/Starscream/Starscream-Info.plist b/Pods/Target Support Files/Starscream/Starscream-Info.plist index e822e16..90db36a 100644 --- a/Pods/Target Support Files/Starscream/Starscream-Info.plist +++ b/Pods/Target Support Files/Starscream/Starscream-Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.0.6 + 3.1.0 CFBundleSignature ???? CFBundleVersion diff --git a/ProxyConfigHelper/Helper-Info.plist b/ProxyConfigHelper/Helper-Info.plist index fac7e65..2d79717 100755 --- a/ProxyConfigHelper/Helper-Info.plist +++ b/ProxyConfigHelper/Helper-Info.plist @@ -9,7 +9,7 @@ CFBundleName com.west2online.ClashX.ProxyConfigHelper CFBundleShortVersionString - 1.1 + $(MARKETING_VERSION) CFBundleVersion 2 SMAuthorizedClients diff --git a/ProxyConfigHelper/com.west2online.ClashX.ProxyConfigHelper.entitlements b/ProxyConfigHelper/com.west2online.ClashX.ProxyConfigHelper.entitlements new file mode 100644 index 0000000..0c67376 --- /dev/null +++ b/ProxyConfigHelper/com.west2online.ClashX.ProxyConfigHelper.entitlements @@ -0,0 +1,5 @@ + + + + +