Merge branch 'timothyqiu-simple-obfs' into develop

This commit is contained in:
Qiu Yuzhou
2018-02-06 15:19:31 +08:00
9 changed files with 174 additions and 23 deletions

View File

@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
08FCA0FF1E24BE1A0070984F /* example-gui-config.json in Resources */ = {isa = PBXBuildFile; fileRef = 08FCA0FE1E24BE1A0070984F /* example-gui-config.json */; };
1C82DBA81FA96C7500B32551 /* obfs-local in Resources */ = {isa = PBXBuildFile; fileRef = 1C82DBA51FA96C7400B32551 /* obfs-local */; };
1C82DBAA1FA96FB600B32551 /* install_simple_obfs.sh in Resources */ = {isa = PBXBuildFile; fileRef = 1C82DBA91FA96F0300B32551 /* install_simple_obfs.sh */; };
258E511BA910B0521B24DAB8 /* Pods_ShadowsocksX_NG.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 283ED1A8E9B711AC65670031 /* Pods_ShadowsocksX_NG.framework */; };
9B07EFA71D048BBB0052D9DF /* ss-local in Resources */ = {isa = PBXBuildFile; fileRef = 9B07EFA61D048BBB0052D9DF /* ss-local */; };
9B07EFAC1D048E880052D9DF /* menu_icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9B07EFA81D048E880052D9DF /* menu_icon@2x.png */; };
@ -136,6 +138,8 @@
/* Begin PBXFileReference section */
08FCA0FE1E24BE1A0070984F /* example-gui-config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "example-gui-config.json"; sourceTree = "<group>"; };
19083CFCED87354F006967FF /* Pods_ShadowsocksX_NGUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ShadowsocksX_NGUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1C82DBA51FA96C7400B32551 /* obfs-local */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; path = "obfs-local"; sourceTree = "<group>"; };
1C82DBA91FA96F0300B32551 /* install_simple_obfs.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = install_simple_obfs.sh; sourceTree = "<group>"; };
1E7783AEDB4A3BDDC9FF16AC /* libPods-proxy_conf_helper.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-proxy_conf_helper.a"; sourceTree = BUILT_PRODUCTS_DIR; };
283ED1A8E9B711AC65670031 /* Pods_ShadowsocksX_NG.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ShadowsocksX_NG.framework; sourceTree = BUILT_PRODUCTS_DIR; };
297AF069022A197FD8E9D226 /* Pods-proxy_conf_helper.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-proxy_conf_helper.release.xcconfig"; path = "Pods/Target Support Files/Pods-proxy_conf_helper/Pods-proxy_conf_helper.release.xcconfig"; sourceTree = "<group>"; };
@ -274,6 +278,15 @@
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1C82DBA31FA96C7400B32551 /* simple-obfs */ = {
isa = PBXGroup;
children = (
1C82DBA51FA96C7400B32551 /* obfs-local */,
1C82DBA91FA96F0300B32551 /* install_simple_obfs.sh */,
);
path = "simple-obfs";
sourceTree = "<group>";
};
33F4F299F89330966F4526E4 /* Pods */ = {
isa = PBXGroup;
children = (
@ -292,6 +305,7 @@
9B07EFB01D048E900052D9DF /* Support Files */ = {
isa = PBXGroup;
children = (
1C82DBA31FA96C7400B32551 /* simple-obfs */,
9B16E5991F99FD0700E54DC5 /* icons8-Blind Filled-50.png */,
9B16E5971F99FD0700E54DC5 /* icons8-Eye Filled-50.png */,
9B938D931E864B38005F5636 /* menu_g_icon.png */,
@ -588,6 +602,7 @@
files = (
9BBE7B751F508A0E00E8FFE5 /* fix_dir_owner.sh in Resources */,
9B3F7BFF1E82BF5B00C68B75 /* libev.4.dylib in Resources */,
1C82DBAA1FA96FB600B32551 /* install_simple_obfs.sh in Resources */,
9B3F7C001E82BF5B00C68B75 /* libmbedcrypto.2.4.2.dylib in Resources */,
9B3F7C011E82BF5B00C68B75 /* libsodium.18.dylib in Resources */,
9B3F7C021E82BF5B00C68B75 /* libudns.0.dylib in Resources */,
@ -620,6 +635,7 @@
9BAFE2E21E83ED7F00F71CCE /* PreferencesWinController.xib in Resources */,
9B0BFFEB1D0460A70040E62B /* Assets.xcassets in Resources */,
08FCA0FF1E24BE1A0070984F /* example-gui-config.json in Resources */,
1C82DBA81FA96C7500B32551 /* obfs-local in Resources */,
9B938D9D1E864B38005F5636 /* menu_p_icon.png in Resources */,
9B938D9B1E864B38005F5636 /* menu_m_icon.png in Resources */,
9B3FFF271D0898EB0019A709 /* gfwlist.txt in Resources */,
@ -1018,6 +1034,7 @@
"$(inherited)",
"$(SDKROOT)/usr/lib/system",
"$(PROJECT_DIR)/ShadowsocksX-NG",
"$(PROJECT_DIR)/ShadowsocksX-NG/simple-obfs",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "com.qiuyuzhou.ShadowsocksX-NG";
@ -1047,6 +1064,7 @@
"$(inherited)",
"$(SDKROOT)/usr/lib/system",
"$(PROJECT_DIR)/ShadowsocksX-NG",
"$(PROJECT_DIR)/ShadowsocksX-NG/simple-obfs",
);
MACOSX_DEPLOYMENT_TARGET = 10.11;
PRODUCT_BUNDLE_IDENTIFIER = "com.qiuyuzhou.ShadowsocksX-NG";

View File

@ -82,6 +82,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
InstallSSLocal()
InstallKcptunClient()
InstallPrivoxy()
InstallSimpleObfs()
// Prepare defaults
let defaults = UserDefaults.standard
defaults.register(defaults: [

View File

@ -26,6 +26,8 @@
<outlet property="passwordSecureTextField" destination="ZXA-oi-Zv3" id="ZMF-s4-w53"/>
<outlet property="passwordTabView" destination="DHz-Hx-kZ5" id="8W3-H3-Ezq"/>
<outlet property="passwordTextField" destination="3Ad-X4-DBi" id="FHf-t3-D8t"/>
<outlet property="pluginOptionsTextField" destination="5eh-s9-YH8" id="k4c-c6-OIq"/>
<outlet property="pluginTextField" destination="0PP-Ng-z0v" id="Dif-aD-nRE"/>
<outlet property="portTextField" destination="lng-AE-g0J" id="7b1-ox-WSL"/>
<outlet property="profileBox" destination="oZ5-85-pwY" id="D19-PQ-X7E"/>
<outlet property="profilesTableView" destination="r91-ho-Lum" id="TNk-f6-Vgo"/>
@ -39,20 +41,20 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Server Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" oneShot="NO" animationBehavior="default" id="F0z-JX-Cv5">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<rect key="contentRect" x="423" y="365" width="590" height="504"/>
<rect key="contentRect" x="423" y="365" width="590" height="564"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1057"/>
<view key="contentView" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="590" height="504"/>
<rect key="frame" x="0.0" y="0.0" width="590" height="564"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<scrollView focusRingType="none" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="u4U-Ju-FJV">
<rect key="frame" x="20" y="80" width="233" height="404"/>
<rect key="frame" x="20" y="80" width="233" height="464"/>
<clipView key="contentView" focusRingType="none" id="1oC-7s-16v">
<rect key="frame" x="1" y="1" width="231" height="402"/>
<rect key="frame" x="1" y="1" width="231" height="462"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnReordering="NO" columnSelection="YES" multipleSelection="NO" emptySelection="NO" autosaveColumns="NO" id="r91-ho-Lum">
<rect key="frame" x="0.0" y="0.0" width="231" height="402"/>
<rect key="frame" x="0.0" y="0.0" width="231" height="462"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@ -99,13 +101,13 @@
</scroller>
</scrollView>
<box boxType="custom" borderType="none" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="oZ5-85-pwY">
<rect key="frame" x="273" y="61" width="297" height="423"/>
<rect key="frame" x="273" y="61" width="297" height="483"/>
<view key="contentView" id="a3z-VL-3xV">
<rect key="frame" x="0.0" y="0.0" width="297" height="423"/>
<rect key="frame" x="0.0" y="0.0" width="297" height="483"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="HPg-NP-kjP">
<rect key="frame" x="46" y="384" width="58" height="17"/>
<rect key="frame" x="46" y="444" width="58" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Address:" id="yHs-XE-XEB">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -113,7 +115,7 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Otb-CO-KUH">
<rect key="frame" x="212" y="386" width="9" height="17"/>
<rect key="frame" x="212" y="446" width="9" height="17"/>
<constraints>
<constraint firstAttribute="width" constant="5" id="JAU-I8-jVc"/>
</constraints>
@ -124,7 +126,7 @@
</textFieldCell>
</textField>
<comboBox verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ef4-8J-eFn">
<rect key="frame" x="110" y="349" width="166" height="26"/>
<rect key="frame" x="110" y="409" width="166" height="26"/>
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="11" id="5Qb-ey-uS5">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -132,7 +134,7 @@
</comboBoxCell>
</comboBox>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Kft-TG-O5S">
<rect key="frame" x="30" y="354" width="74" height="17"/>
<rect key="frame" x="30" y="414" width="74" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Encryption:" id="mOh-nD-7EX">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -140,23 +142,47 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="q3C-S0-iNn">
<rect key="frame" x="110" y="291" width="170" height="22"/>
<rect key="frame" x="110" y="287" width="170" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="oxu-qq-MGC">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5eh-s9-YH8">
<rect key="frame" x="110" y="319" width="170" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="dtO-2M-4yX">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0PP-Ng-z0v">
<rect key="frame" x="110" y="351" width="170" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="IGs-KE-ySP">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Baj-Yh-kmj">
<rect key="frame" x="43" y="294" width="61" height="17"/>
<rect key="frame" x="43" y="290" width="61" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Remarks:" id="MiN-VE-FtC">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DGz-Sq-t0c">
<rect key="frame" x="58" y="354" width="46" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Plugin:" id="gDt-yZ-Mqs">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="R4F-j7-GkK">
<rect key="frame" x="110" y="381" width="96" height="22"/>
<rect key="frame" x="110" y="441" width="96" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="IP" drawsBackground="YES" id="MWO-hQ-nMt">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
@ -164,23 +190,23 @@
</textFieldCell>
</textField>
<button translatesAutoresizingMaskIntoConstraints="NO" id="9CP-zt-WuH">
<rect key="frame" x="83" y="267" width="174" height="18"/>
<rect key="frame" x="83" y="263" width="174" height="18"/>
<buttonCell key="cell" type="check" title="Enable OTA (deprecated)" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="hRZ-Rp-I5e">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<button translatesAutoresizingMaskIntoConstraints="NO" id="Zgs-86-BfH">
<rect key="frame" x="83" y="247" width="138" height="18"/>
<rect key="frame" x="83" y="243" width="138" height="18"/>
<buttonCell key="cell" type="check" title="Enable over kcptun" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="jNm-rQ-3wm">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
</button>
<box boxType="secondary" borderType="none" title="Kcptun" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="WE7-7J-vda">
<rect key="frame" x="-3" y="-4" width="303" height="239"/>
<rect key="frame" x="-3" y="-4" width="303" height="235"/>
<view key="contentView" id="rqF-7k-7qO">
<rect key="frame" x="0.0" y="0.0" width="303" height="239"/>
<rect key="frame" x="0.0" y="0.0" width="303" height="235"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="8lc-dc-PSG">
@ -401,7 +427,7 @@
</view>
</box>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="lng-AE-g0J">
<rect key="frame" x="223" y="381" width="50" height="22"/>
<rect key="frame" x="223" y="441" width="50" height="22"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="Port" drawsBackground="YES" id="e1F-jd-e0J">
<font key="font" metaFont="system"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
@ -415,7 +441,7 @@
</connections>
</textField>
<tabView focusRingType="none" drawsBackground="NO" type="noTabsNoBorder" initialItem="aRD-sh-uEl" translatesAutoresizingMaskIntoConstraints="NO" id="DHz-Hx-kZ5">
<rect key="frame" x="110" y="323" width="135" height="22"/>
<rect key="frame" x="110" y="383" width="135" height="22"/>
<font key="font" metaFont="system"/>
<tabViewItems>
<tabViewItem label="Secure" identifier="secure" id="aRD-sh-uEl">
@ -466,7 +492,7 @@
</tabViewItems>
</tabView>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="jDI-cn-wYa">
<rect key="frame" x="254" y="321" width="26" height="25"/>
<rect key="frame" x="254" y="381" width="26" height="25"/>
<constraints>
<constraint firstAttribute="width" constant="26" id="vGB-iL-nWP"/>
</constraints>
@ -479,34 +505,48 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Qfe-Ql-iCO">
<rect key="frame" x="38" y="325" width="66" height="17"/>
<rect key="frame" x="38" y="385" width="66" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Password:" id="kil-xC-HPD">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="4LD-CD-u7b">
<rect key="frame" x="26" y="321" width="78" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Plugin Opts:" id="orT-7j-dxE">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="Baj-Yh-kmj" firstAttribute="baseline" secondItem="q3C-S0-iNn" secondAttribute="baseline" id="0Fs-Yi-WBo"/>
<constraint firstItem="lng-AE-g0J" firstAttribute="leading" secondItem="Otb-CO-KUH" secondAttribute="trailing" constant="4" id="0bx-FE-Nqz"/>
<constraint firstItem="R4F-j7-GkK" firstAttribute="baseline" secondItem="lng-AE-g0J" secondAttribute="baseline" id="0dG-a6-exG"/>
<constraint firstItem="5eh-s9-YH8" firstAttribute="top" secondItem="0PP-Ng-z0v" secondAttribute="bottom" constant="10" symbolic="YES" id="1aa-nq-sFq"/>
<constraint firstItem="DHz-Hx-kZ5" firstAttribute="leading" secondItem="Qfe-Ql-iCO" secondAttribute="trailing" constant="8" symbolic="YES" id="1bR-S3-Tdq"/>
<constraint firstItem="ef4-8J-eFn" firstAttribute="top" secondItem="R4F-j7-GkK" secondAttribute="bottom" constant="8" symbolic="YES" id="41P-Ix-it2"/>
<constraint firstItem="jDI-cn-wYa" firstAttribute="trailing" secondItem="0PP-Ng-z0v" secondAttribute="trailing" id="5DS-4j-Cr9"/>
<constraint firstAttribute="trailing" secondItem="lng-AE-g0J" secondAttribute="trailing" constant="24" id="6W3-BA-gYo"/>
<constraint firstItem="Otb-CO-KUH" firstAttribute="trailing" secondItem="Zgs-86-BfH" secondAttribute="trailing" id="8Pl-xV-uvr"/>
<constraint firstItem="9CP-zt-WuH" firstAttribute="leading" secondItem="Zgs-86-BfH" secondAttribute="leading" id="8r8-GD-9Z3"/>
<constraint firstItem="0PP-Ng-z0v" firstAttribute="centerY" secondItem="DGz-Sq-t0c" secondAttribute="centerY" id="99Q-Zk-mdj"/>
<constraint firstItem="R4F-j7-GkK" firstAttribute="top" secondItem="a3z-VL-3xV" secondAttribute="top" constant="20" symbolic="YES" id="Dkz-UA-ymg"/>
<constraint firstItem="0PP-Ng-z0v" firstAttribute="top" secondItem="DHz-Hx-kZ5" secondAttribute="bottom" constant="10" id="Fwl-Mu-bKH"/>
<constraint firstItem="Zgs-86-BfH" firstAttribute="top" secondItem="9CP-zt-WuH" secondAttribute="bottom" constant="6" symbolic="YES" id="Gvl-Fp-l23"/>
<constraint firstItem="DHz-Hx-kZ5" firstAttribute="top" secondItem="ef4-8J-eFn" secondAttribute="bottom" constant="8" symbolic="YES" id="I7k-9o-SLi"/>
<constraint firstItem="jDI-cn-wYa" firstAttribute="leading" secondItem="DHz-Hx-kZ5" secondAttribute="trailing" constant="9" id="IMV-t5-Set"/>
<constraint firstItem="jDI-cn-wYa" firstAttribute="trailing" secondItem="q3C-S0-iNn" secondAttribute="trailing" id="Idl-zd-MSU"/>
<constraint firstItem="5eh-s9-YH8" firstAttribute="centerY" secondItem="4LD-CD-u7b" secondAttribute="centerY" id="Ik2-zM-uly"/>
<constraint firstItem="DHz-Hx-kZ5" firstAttribute="leading" secondItem="q3C-S0-iNn" secondAttribute="leading" id="JBi-Dy-gPS"/>
<constraint firstAttribute="trailing" secondItem="jDI-cn-wYa" secondAttribute="trailing" constant="17" id="JSl-uN-iMh"/>
<constraint firstItem="ef4-8J-eFn" firstAttribute="leading" secondItem="DHz-Hx-kZ5" secondAttribute="leading" id="L85-np-Xpn"/>
<constraint firstItem="q3C-S0-iNn" firstAttribute="leading" secondItem="Baj-Yh-kmj" secondAttribute="trailing" constant="8" symbolic="YES" id="LTy-e7-h27"/>
<constraint firstItem="9CP-zt-WuH" firstAttribute="top" secondItem="q3C-S0-iNn" secondAttribute="bottom" constant="8" symbolic="YES" id="M5Z-aD-cu9"/>
<constraint firstAttribute="bottom" secondItem="WE7-7J-vda" secondAttribute="bottom" id="MTo-dp-G2o"/>
<constraint firstItem="q3C-S0-iNn" firstAttribute="top" secondItem="5eh-s9-YH8" secondAttribute="bottom" constant="10" symbolic="YES" id="ORc-LV-dNZ"/>
<constraint firstItem="DHz-Hx-kZ5" firstAttribute="bottom" secondItem="jDI-cn-wYa" secondAttribute="bottom" id="RM1-vq-zAm"/>
<constraint firstItem="Kft-TG-O5S" firstAttribute="centerY" secondItem="ef4-8J-eFn" secondAttribute="centerY" id="RYD-o2-vjB"/>
<constraint firstItem="Kft-TG-O5S" firstAttribute="leading" secondItem="a3z-VL-3xV" secondAttribute="leading" constant="32" id="TsS-51-KLG"/>
@ -520,11 +560,15 @@
<constraint firstItem="Qfe-Ql-iCO" firstAttribute="leading" secondItem="a3z-VL-3xV" secondAttribute="leading" constant="40" id="fw1-Zg-LaZ"/>
<constraint firstItem="lng-AE-g0J" firstAttribute="trailing" secondItem="ef4-8J-eFn" secondAttribute="trailing" id="gxe-uL-y5w"/>
<constraint firstItem="R4F-j7-GkK" firstAttribute="leading" secondItem="HPg-NP-kjP" secondAttribute="trailing" constant="8" symbolic="YES" id="hKJ-ZW-uLY"/>
<constraint firstItem="jDI-cn-wYa" firstAttribute="trailing" secondItem="5eh-s9-YH8" secondAttribute="trailing" id="jLS-U1-IJa"/>
<constraint firstItem="0PP-Ng-z0v" firstAttribute="leading" secondItem="DHz-Hx-kZ5" secondAttribute="leading" id="kEJ-EJ-v0T"/>
<constraint firstItem="Otb-CO-KUH" firstAttribute="top" secondItem="lng-AE-g0J" secondAttribute="top" id="kLj-6Z-ZDw"/>
<constraint firstItem="5eh-s9-YH8" firstAttribute="leading" secondItem="DHz-Hx-kZ5" secondAttribute="leading" id="kXe-DX-Fsi"/>
<constraint firstItem="0PP-Ng-z0v" firstAttribute="leading" secondItem="DGz-Sq-t0c" secondAttribute="trailing" constant="8" symbolic="YES" id="mcp-te-11z"/>
<constraint firstItem="R4F-j7-GkK" firstAttribute="leading" secondItem="ef4-8J-eFn" secondAttribute="leading" id="opP-Lo-SO0"/>
<constraint firstItem="5eh-s9-YH8" firstAttribute="leading" secondItem="4LD-CD-u7b" secondAttribute="trailing" constant="8" symbolic="YES" id="uFv-U2-g2d"/>
<constraint firstItem="9CP-zt-WuH" firstAttribute="leading" secondItem="a3z-VL-3xV" secondAttribute="leading" constant="85" id="vYk-bK-2hT"/>
<constraint firstItem="Qfe-Ql-iCO" firstAttribute="centerY" secondItem="DHz-Hx-kZ5" secondAttribute="centerY" id="wKU-B5-A3m"/>
<constraint firstItem="q3C-S0-iNn" firstAttribute="top" secondItem="DHz-Hx-kZ5" secondAttribute="bottom" constant="10" id="xYz-0i-U6W"/>
</constraints>
</view>
<color key="fillColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>

View File

@ -11,6 +11,7 @@ import Foundation
let SS_LOCAL_VERSION = "3.0.5"
let KCPTUN_CLIENT_VERSION = "20170322"
let PRIVOXY_VERSION = "3.0.26.static"
let SIMPLE_OBFS_VERSION = "0.0.2"
let APP_SUPPORT_DIR = "/Library/Application Support/ShadowsocksX-NG/"
let LAUNCH_AGENT_DIR = "/Library/LaunchAgents/"
let LAUNCH_AGENT_CONF_SSLOCAL_NAME = "com.qiuyuzhou.shadowsocksX-NG.local.plist"
@ -180,6 +181,27 @@ func SyncSSLocal() {
SyncKcptun()
}
// --------------------------------------------------------------------------------
// MARK: simple-obfs
func InstallSimpleObfs() {
let fileMgr = FileManager.default
let homeDir = NSHomeDirectory()
let appSupportDir = homeDir + APP_SUPPORT_DIR
if !fileMgr.fileExists(atPath: appSupportDir + "simple-obfs-\(SIMPLE_OBFS_VERSION)/obfs-local")
|| !fileMgr.fileExists(atPath: appSupportDir + "plugins/obfs-local") {
let bundle = Bundle.main
let installerPath = bundle.path(forResource: "install_simple_obfs.sh", ofType: nil)
let task = Process.launchedProcess(launchPath: "/bin/sh", arguments: [installerPath!])
task.waitUntilExit()
if task.terminationStatus == 0 {
NSLog("Install simple-obfs succeeded.")
} else {
NSLog("Install simple-obfs failed.")
}
}
}
// --------------------------------------------------------------------------------
// MARK: privoxy

View File

@ -27,6 +27,8 @@ class PreferencesWindowController: NSWindowController
@IBOutlet weak var passwordTextField: NSTextField!
@IBOutlet weak var passwordSecureTextField: NSSecureTextField!
@IBOutlet weak var togglePasswordVisibleButton: NSButton!
@IBOutlet weak var pluginTextField: NSTextField!
@IBOutlet weak var pluginOptionsTextField: NSTextField!
@IBOutlet weak var remarkTextField: NSTextField!
@ -264,6 +266,11 @@ class PreferencesWindowController: NSWindowController
, options: [NSBindingOption.continuouslyUpdatesValue: true])
passwordSecureTextField.bind(NSBindingName(rawValue: "value"), to: editingProfile, withKeyPath: "password"
, options: [NSBindingOption.continuouslyUpdatesValue: true])
pluginTextField.bind(NSBindingName(rawValue: "value"), to: editingProfile, withKeyPath: "plugin"
, options: [NSBindingOption.continuouslyUpdatesValue: true])
pluginOptionsTextField.bind(NSBindingName(rawValue: "value"), to: editingProfile, withKeyPath: "pluginOptions"
, options: [NSBindingOption.continuouslyUpdatesValue: true])
remarkTextField.bind(NSBindingName(rawValue: "value"), to: editingProfile, withKeyPath: "remark"
, options: [NSBindingOption.continuouslyUpdatesValue: true])

View File

@ -23,6 +23,10 @@ class ServerProfile: NSObject, NSCopying {
@objc var enabledKcptun: Bool = false
@objc var kcptunProfile = KcptunProfile()
// SIP003 Plugin
@objc var plugin: String = "" // empty string disables plugin
@objc var pluginOptions: String = ""
override init() {
uuid = UUID().uuidString
}
@ -113,6 +117,15 @@ class ServerProfile: NSObject, NSCopying {
self.kcptunProfile.loadUrlQueryItems(items: items)
}
}
if let pluginStr = parsedUrl.queryItems?
.filter({ $0.name == "plugin" }).first?.value {
let parts = pluginStr.split(separator: ";", maxSplits: 1)
if parts.count == 2 {
plugin = String(parts[0])
pluginOptions = String(parts[1])
}
}
}
public func copy(with zone: NSZone? = nil) -> Any {
@ -126,6 +139,8 @@ class ServerProfile: NSObject, NSCopying {
copy.enabledKcptun = self.enabledKcptun
copy.kcptunProfile = self.kcptunProfile.copy() as! KcptunProfile
copy.plugin = self.plugin
copy.pluginOptions = self.pluginOptions
return copy;
}
@ -148,6 +163,12 @@ class ServerProfile: NSObject, NSCopying {
if let kcptunData = data["KcptunProfile"] {
profile.kcptunProfile = KcptunProfile.fromDictionary(kcptunData as! [String:Any?])
}
if let plugin = data["Plugin"] as? String {
profile.plugin = plugin
}
if let pluginOptions = data["PluginOptions"] as? String {
profile.pluginOptions = pluginOptions
}
}
if let id = data["Id"] as? String {
@ -172,6 +193,8 @@ class ServerProfile: NSObject, NSCopying {
d["OTA"] = ota as AnyObject?
d["EnabledKcptun"] = NSNumber(value: enabledKcptun)
d["KcptunProfile"] = kcptunProfile.toDictionary() as AnyObject
d["Plugin"] = plugin as AnyObject
d["PluginOptions"] = pluginOptions as AnyObject
return d
}
@ -198,6 +221,13 @@ class ServerProfile: NSObject, NSCopying {
conf["server_port"] = NSNumber(value: serverPort as UInt16)
}
if !plugin.isEmpty {
// all plugin binaries should be located in the plugins dir
// so that we don't have to mess up with PATH envvars
conf["plugin"] = "plugins/\(plugin)" as AnyObject
conf["plugin_opts"] = pluginOptions as AnyObject
}
return conf
}
@ -298,6 +328,10 @@ class ServerProfile: NSObject, NSCopying {
items.append(URLQueryItem(name: "Kcptun", value: enabledKcptun.description))
items.append(contentsOf: kcptunProfile.urlQueryItems())
}
if !plugin.isEmpty {
let value = "\(plugin);\(pluginOptions)"
items.append(URLQueryItem(name: "plugin", value: value))
}
var comps = URLComponents()

View File

@ -0,0 +1,19 @@
#!/bin/sh
FILE_DIR=`dirname "${BASH_SOURCE[0]}"`
cd "$FILE_DIR"
NGDir="$HOME/Library/Application Support/ShadowsocksX-NG"
TargetDir="$NGDir/simple-obfs-0.0.2"
PluginDir="$NGDir/plugins"
echo ngdir: ${NGDir}
mkdir -p "$TargetDir"
mkdir -p "$PluginDir"
cp -f obfs-local "$TargetDir"
ln -sfh "$TargetDir/obfs-local" "$PluginDir"
echo done

Binary file not shown.

View File

@ -37,3 +37,9 @@
/* Class = "NSMenuItem"; title = "Clone"; ObjectID = "bl9-lq-u9V"; */
"bl9-lq-u9V.title" = "克隆";
/* Class = "NSTextFieldCell"; title = "Plugin:"; ObjectID = "gDt-yZ-Mqs"; */
"gDt-yZ-Mqs.title" = "插件:";
/* Class = "NSTextFieldCell"; title = "Plugin Opts:"; ObjectID = "orT-7j-dxE"; */
"orT-7j-dxE.title" = "插件选项:";