Skip to content

Commit

Permalink
fix kcp,fix ws
Browse files Browse the repository at this point in the history
  • Loading branch information
yanue committed Jun 7, 2019
1 parent 6591473 commit 9833d60
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 36 deletions.
Binary file added Build/V2rayUTool
Binary file not shown.
16 changes: 8 additions & 8 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
PODS:
- Alamofire (4.7.3)
- Alamofire (4.8.2)
- GCDWebServer (3.5.2):
- GCDWebServer/Core (= 3.5.2)
- GCDWebServer/Core (3.5.2)
- Preferences (0.3.0)
- QRCoder (1.0.0)
- Sparkle (1.20.0)
- SwiftyJSON (4.2.0)
- QRCoder (1.1.0)
- Sparkle (1.21.3)
- SwiftyJSON (5.0.0)

DEPENDENCIES:
- Alamofire
Expand Down Expand Up @@ -34,12 +34,12 @@ CHECKOUT OPTIONS:
:git: https://github.com/sindresorhus/Preferences.git

SPEC CHECKSUMS:
Alamofire: c7287b6e5d7da964a70935e5db17046b7fde6568
Alamofire: ae5c501addb7afdbb13687d7f2f722c78734c2d3
GCDWebServer: ead88cd14596dd4eae4f5830b8877c87c8728990
Preferences: 865793c3914c4de086c809a504a4157b8968cb90
QRCoder: 488f6869fb89ffcc3de3b4de2dabd200a6573f3c
Sparkle: 48999e7ee032f05ca05e28451eadf4af8ede6b44
SwiftyJSON: c4bcba26dd9ec7a027fc8eade48e2c911f229e96
QRCoder: cbd2bee531cc86d286df7942334cfed94c803ae4
Sparkle: 3f75576db8b0265adef36c43249d747f22d0b708
SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7

PODFILE CHECKSUM: 58098d0825211da73cdc15b835005b970bed1875

Expand Down
43 changes: 38 additions & 5 deletions V2rayU.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 50;
objects = {

/* Begin PBXBuildFile section */
Expand All @@ -24,13 +24,16 @@
664EB392216CA9E800B6AE0D /* ConfigWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 664EB390216CA9E800B6AE0D /* ConfigWindow.swift */; };
6650AAAD21771E11000909D8 /* unzip.sh in Resources */ = {isa = PBXBuildFile; fileRef = 6650AAAC21771E11000909D8 /* unzip.sh */; };
6650AAB021774A72000909D8 /* V2rayLaunch.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6650AAAF21774A72000909D8 /* V2rayLaunch.swift */; };
665DC9BB22A542F90062337B /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 665DC9BA22A542F90062337B /* AppKit.framework */; };
667029CA21AF8E7A0079EF41 /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 667029C921AF8E7A0079EF41 /* Sparkle.framework */; };
667029D321AFB86E0079EF41 /* QrcodeWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 667029D121AFB86E0079EF41 /* QrcodeWindow.xib */; };
66784AFC2170486D00AD307F /* Util.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66784AFB2170486D00AD307F /* Util.swift */; };
66784B0021704E1300AD307F /* V2rayCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66784AFF21704E1300AD307F /* V2rayCore.swift */; };
66973EB721797719001FEA1E /* ServiceManagement.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 66973EB621797719001FEA1E /* ServiceManagement.framework */; };
66ACB1A021757D5B005B5881 /* MainMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66ACB19F21757D5B005B5881 /* MainMenu.swift */; };
66BC2B89228C589E00FBB716 /* V2raySubscript.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66BC2B88228C589E00FBB716 /* V2raySubscript.swift */; };
66F3029A22AA9C0A00FCA4E2 /* V2rayUTool in Resources */ = {isa = PBXBuildFile; fileRef = 66F3029922AA9C0900FCA4E2 /* V2rayUTool */; };
66F3029B22AA9C1400FCA4E2 /* V2rayUTool in Copy Files */ = {isa = PBXBuildFile; fileRef = 66F3029922AA9C0900FCA4E2 /* V2rayUTool */; };
66F411B121CA49EE007AAC10 /* pac in Copy Files */ = {isa = PBXBuildFile; fileRef = 6683B1EA21C2AD1A004A1C5F /* pac */; };
66F411B221CA49F4007AAC10 /* v2ray-core in Copy Files */ = {isa = PBXBuildFile; fileRef = 667029CF21AFB5730079EF41 /* v2ray-core */; };
66F411B521CA8921007AAC10 /* cmd.sh in Resources */ = {isa = PBXBuildFile; fileRef = 66F411B421CA8921007AAC10 /* cmd.sh */; };
Expand Down Expand Up @@ -74,7 +77,7 @@
6646668E21CBC0860094F0B7 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstPath = /usr/share/man/man1;
dstSubfolderSpec = 0;
files = (
);
Expand All @@ -97,6 +100,7 @@
dstPath = "";
dstSubfolderSpec = 7;
files = (
66F3029B22AA9C1400FCA4E2 /* V2rayUTool in Copy Files */,
66F411B221CA49F4007AAC10 /* v2ray-core in Copy Files */,
66F411B121CA49EE007AAC10 /* pac in Copy Files */,
);
Expand Down Expand Up @@ -134,6 +138,7 @@
664FC05321A70C4300048FE3 /* build.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = build.plist; sourceTree = "<group>"; };
6650AAAC21771E11000909D8 /* unzip.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = unzip.sh; sourceTree = "<group>"; };
6650AAAF21774A72000909D8 /* V2rayLaunch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = V2rayLaunch.swift; sourceTree = "<group>"; };
665DC9BA22A542F90062337B /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
667029C921AF8E7A0079EF41 /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Sparkle.framework; path = "../../Downloads/Sparkle-1.21.0/Sparkle.framework"; sourceTree = "<group>"; };
667029CF21AFB5730079EF41 /* v2ray-core */ = {isa = PBXFileReference; lastKnownFileType = folder; name = "v2ray-core"; path = "Build/v2ray-core"; sourceTree = "<group>"; };
667029D221AFB86E0079EF41 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/QrcodeWindow.xib; sourceTree = "<group>"; };
Expand All @@ -144,6 +149,7 @@
66A5CE4521706B5A009B08B2 /* Pods_V2rayU.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Pods_V2rayU.framework; sourceTree = BUILT_PRODUCTS_DIR; };
66ACB19F21757D5B005B5881 /* MainMenu.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainMenu.swift; sourceTree = "<group>"; };
66BC2B88228C589E00FBB716 /* V2raySubscript.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = V2raySubscript.swift; sourceTree = "<group>"; };
66F3029922AA9C0900FCA4E2 /* V2rayUTool */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = V2rayUTool; sourceTree = "<group>"; };
66F411B421CA8921007AAC10 /* cmd.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = cmd.sh; sourceTree = "<group>"; };
66FEAD45217D75FC009DECF9 /* release.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = release.sh; sourceTree = "<group>"; };
66FEAD4F217EE14C009DECF9 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ConfigWindow.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -188,6 +194,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
665DC9BB22A542F90062337B /* AppKit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -303,6 +310,7 @@
66FEAD44217D75D7009DECF9 /* Build */ = {
isa = PBXGroup;
children = (
66F3029922AA9C0900FCA4E2 /* V2rayUTool */,
664FC05321A70C4300048FE3 /* build.plist */,
66FEAD45217D75FC009DECF9 /* release.sh */,
6D6DFD93CE866018306A090E /* pac */,
Expand Down Expand Up @@ -340,6 +348,7 @@
956412AC8DEB3D3D182A5D49 /* Frameworks */ = {
isa = PBXGroup;
children = (
665DC9BA22A542F90062337B /* AppKit.framework */,
664666A021CBD6C60094F0B7 /* libPods-V2rayUTool.a */,
667029C921AF8E7A0079EF41 /* Sparkle.framework */,
66973EB621797719001FEA1E /* ServiceManagement.framework */,
Expand Down Expand Up @@ -442,6 +451,7 @@
664EB369216C9A5E00B6AE0D /* Project object */ = {
isa = PBXProject;
attributes = {
CLASSPREFIX = "";
LastSwiftUpdateCheck = 1010;
LastUpgradeCheck = 1000;
ORGANIZATIONNAME = yanue;
Expand Down Expand Up @@ -470,7 +480,7 @@
};
};
buildConfigurationList = 664EB36C216C9A5E00B6AE0D /* Build configuration list for PBXProject "V2rayU" */;
compatibilityVersion = "Xcode 10.0";
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
Expand Down Expand Up @@ -518,6 +528,7 @@
66FEAD53217EE14C009DECF9 /* ConfigWindow.xib in Resources */,
6D6DF5F67A917F78FF652D45 /* .gitignore in Resources */,
6D6DFEA4ED44E1BE02451B6D /* PreferenceAbout.xib in Resources */,
66F3029A22AA9C0A00FCA4E2 /* V2rayUTool in Resources */,
6D6DF95B4749491F1D600B05 /* PreferenceAdvance.xib in Resources */,
6D6DFC1618D163A9DFE3B628 /* PreferenceGeneral.xib in Resources */,
6D6DFFD18860EBE148F6DF1F /* PreferencePac.xib in Resources */,
Expand All @@ -542,6 +553,7 @@
"${BUILT_PRODUCTS_DIR}/Preferences/Preferences.framework",
"${BUILT_PRODUCTS_DIR}/QRCoder/QRCoder.framework",
"${PODS_ROOT}/Sparkle/Sparkle.framework",
"${PODS_ROOT}/Sparkle/Sparkle.framework.dSYM",
"${BUILT_PRODUCTS_DIR}/SwiftyJSON/SwiftyJSON.framework",
);
name = "[CP] Embed Pods Frameworks";
Expand All @@ -553,6 +565,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Preferences.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/QRCoder.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Sparkle.framework",
"${DWARF_DSYM_FOLDER_PATH}/Sparkle.framework.dSYM",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyJSON.framework",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -813,10 +826,20 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
ALWAYS_SEARCH_USER_PATHS = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = RJYEH6TCJD;
LD_DYLIB_INSTALL_NAME = "@rpath/libswiftAppKit.dylib";
LD_RUNPATH_SEARCH_PATHS = (
"@executable_path/Frameworks",
"@executable_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
OTHER_LDFLAGS = (
"-rpath",
$DT_TOOLCHAIN_DIR/usr/lib/swift/macosx/,
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
Expand All @@ -827,10 +850,20 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_IDENTITY = "Mac Developer";
ALWAYS_SEARCH_USER_PATHS = YES;
CODE_SIGN_IDENTITY = "-";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = RJYEH6TCJD;
LD_DYLIB_INSTALL_NAME = "@rpath/libswiftAppKit.dylib";
LD_RUNPATH_SEARCH_PATHS = (
"@executable_path/Frameworks",
"@executable_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.12;
OTHER_LDFLAGS = (
"-rpath",
$DT_TOOLCHAIN_DIR/usr/lib/swift/macosx/,
);
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 4.2;
Expand Down
7 changes: 2 additions & 5 deletions V2rayU/Base.lproj/ConfigWindow.xib
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Gw
<font key="font" metaFont="system"/>
<tabViewItems>
<tabViewItem label="Import" identifier="Import" id="BS9-X1-ueN">
<view key="view" ambiguous="YES" id="Ab3-ML-cu8">
<view key="view" id="Ab3-ML-cu8">
<rect key="frame" x="10" y="33" width="394" height="491"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
Expand Down Expand Up @@ -274,7 +274,7 @@ Gw
</view>
</tabViewItem>
<tabViewItem label="Manual" identifier="Manual" id="qq1-yV-VsK">
<view key="view" id="YXI-Uw-7SR">
<view key="view" ambiguous="YES" id="YXI-Uw-7SR">
<rect key="frame" x="10" y="33" width="394" height="491"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
Expand Down Expand Up @@ -1186,9 +1186,6 @@ Gw
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="setV2rayLogLevel:" target="-2" id="zRi-fx-hzR"/>
</connections>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UE0-9A-TmE">
<rect key="frame" x="28" y="32" width="111" height="14"/>
Expand Down
12 changes: 0 additions & 12 deletions V2rayU/ConfigWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
@IBOutlet weak var configText: NSTextView!
@IBOutlet weak var serversTableView: NSTableView!
@IBOutlet weak var addRemoveButton: NSSegmentedControl!
@IBOutlet weak var logLevel: NSPopUpButton!
@IBOutlet weak var jsonUrl: NSTextField!
@IBOutlet weak var selectFileBtn: NSButton!
@IBOutlet weak var importBtn: NSButton!
Expand Down Expand Up @@ -339,7 +338,6 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
func bindDataToView() {
// ========================== base start =======================
// base
print("bindDataToView", v2rayConfig.httpPort, v2rayConfig.socksPort, v2rayConfig.dns)
self.httpPort.title = v2rayConfig.httpPort
self.sockPort.title = v2rayConfig.socksPort
self.enableUdp.intValue = v2rayConfig.enableUdp ? 1 : 0
Expand Down Expand Up @@ -498,16 +496,6 @@ class ConfigWindowController: NSWindowController, NSWindowDelegate, NSTabViewDel
}
}

@IBAction func setV2rayLogLevel(_ sender: NSPopUpButton) {
if let item = logLevel.selectedItem {
UserDefaults.set(forKey: .v2rayLogLevel, value: item.title)
// replace current
self.switchToImportView()
// restart service
menuController.startV2rayCore()
}
}

@IBAction func importConfig(_ sender: NSButton) {
self.configText.string = ""
if jsonUrl.stringValue.trimmingCharacters(in: .whitespaces) == "" {
Expand Down
2 changes: 1 addition & 1 deletion V2rayU/v2ray/V2rayConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ class V2rayConfig: NSObject {
if steamJson["wsSettings"].dictionaryValue.count > 0 {
var wsSettings = WsSettings()
wsSettings.path = steamJson["wsSettings"]["path"].stringValue
wsSettings.headers.host = steamJson["wsSettings"]["header"]["host"].stringValue
wsSettings.headers.host = steamJson["wsSettings"]["headers"]["host"].stringValue

stream.wsSettings = wsSettings
}
Expand Down
6 changes: 1 addition & 5 deletions V2rayUTool/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ class V2rayUTool: NSObject {

// backup system proxy
if mode == .backup {
do {
_ = (sets as! NSDictionary).write(toFile: SysProxyBackupPlist, atomically: true)
} catch {
print(error)
}
(sets as! NSDictionary).write(toFile: SysProxyBackupPlist, atomically: true)
return
}

Expand Down

0 comments on commit 9833d60

Please sign in to comment.