mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-10-20 14:34:30 +00:00
sync ssr-local for protocol method
1. 支持协议参数,为单端口多用户做好准备 2. 支持Group参数,可用于分组节点列表
This commit is contained in:
@@ -648,8 +648,37 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
if !p.isValid() {
|
||||
item.isEnabled = false
|
||||
}
|
||||
|
||||
item.action = #selector(AppDelegate.selectServer)
|
||||
|
||||
if !p.ssrGroup.isEmpty {
|
||||
if((serversMenuItem.submenu?.item(withTitle: p.ssrGroup)) == nil){
|
||||
let groupSubmenu = NSMenu()
|
||||
let groupSubmenuItem = NSMenuItem()
|
||||
groupSubmenuItem.title = p.ssrGroup
|
||||
//if i == 2 {// to delete
|
||||
serversMenuItem.submenu?.addItem(groupSubmenuItem)
|
||||
serversMenuItem.submenu?.setSubmenu(groupSubmenu, for: groupSubmenuItem)
|
||||
if mgr.activeProfileId == p.uuid {
|
||||
item.state = 1
|
||||
groupSubmenuItem.state = 1
|
||||
}
|
||||
groupSubmenuItem.submenu?.addItem(item)
|
||||
i += 1
|
||||
continue
|
||||
//}// to delete
|
||||
}
|
||||
else{
|
||||
if mgr.activeProfileId == p.uuid {
|
||||
item.state = 1
|
||||
serversMenuItem.submenu?.item(withTitle: p.ssrGroup)?.state = 1
|
||||
}
|
||||
serversMenuItem.submenu?.item(withTitle: p.ssrGroup)?.submenu?.addItem(item)
|
||||
i += 1
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
serversMenuItem.submenu?.addItem(item)
|
||||
i += 1
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D17a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
|
||||
<capability name="box content view" minToolsVersion="7.0"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="PreferencesWindowController" customModule="ShadowsocksX_NG" customModuleProvider="target">
|
||||
@@ -13,6 +15,7 @@
|
||||
<outlet property="ProtocolTextField" destination="CbS-wf-XMN" id="ZXD-Pp-1Gf"/>
|
||||
<outlet property="copyURLBtn" destination="6mK-sY-xoH" id="YIO-RO-CXs"/>
|
||||
<outlet property="duplicateProfileButton" destination="ZgM-eW-IFM" id="bbv-yc-5WJ"/>
|
||||
<outlet property="groupTextField" destination="P1H-Vl-P4W" id="xgB-St-g6r"/>
|
||||
<outlet property="hostTextField" destination="R4F-j7-GkK" id="a1I-WO-Qdj"/>
|
||||
<outlet property="methodTextField" destination="ef4-8J-eFn" id="OXd-fC-ICR"/>
|
||||
<outlet property="otaCheckBoxBtn" destination="9CP-zt-WuH" id="egZ-KB-iSv"/>
|
||||
@@ -30,20 +33,20 @@
|
||||
<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" miniaturizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="423" y="365" width="590" height="529"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
|
||||
<rect key="contentRect" x="423" y="365" width="590" height="572"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="878"/>
|
||||
<view key="contentView" id="se5-gp-TjO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="590" height="529"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="590" height="572"/>
|
||||
<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="79" width="223" height="430"/>
|
||||
<rect key="frame" x="20" y="81" width="223" height="471"/>
|
||||
<clipView key="contentView" focusRingType="none" id="1oC-7s-16v">
|
||||
<rect key="frame" x="1" y="1" width="221" height="428"/>
|
||||
<rect key="frame" x="1" y="1" width="221" height="469"/>
|
||||
<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="161" height="19"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="221" height="469"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<size key="intercellSpacing" width="3" height="2"/>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -78,7 +81,6 @@
|
||||
</connections>
|
||||
</tableView>
|
||||
</subviews>
|
||||
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="jTp-ja-h3t">
|
||||
<rect key="frame" x="1" y="206" width="163" height="15"/>
|
||||
@@ -90,13 +92,13 @@
|
||||
</scroller>
|
||||
</scrollView>
|
||||
<box borderType="line" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="oZ5-85-pwY">
|
||||
<rect key="frame" x="248" y="57" width="325" height="454"/>
|
||||
<rect key="frame" x="248" y="57" width="325" height="497"/>
|
||||
<view key="contentView" id="a3z-VL-3xV">
|
||||
<rect key="frame" x="1" y="1" width="323" height="452"/>
|
||||
<rect key="frame" x="1" y="1" width="323" height="495"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="HPg-NP-kjP">
|
||||
<rect key="frame" x="46" y="413" width="59" height="17"/>
|
||||
<rect key="frame" x="46" y="456" width="59" 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"/>
|
||||
@@ -104,7 +106,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Otb-CO-KUH">
|
||||
<rect key="frame" x="239" y="415" width="9" height="17"/>
|
||||
<rect key="frame" x="239" y="458" width="9" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="5" id="18z-gr-5d9"/>
|
||||
</constraints>
|
||||
@@ -115,7 +117,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lng-AE-g0J">
|
||||
<rect key="frame" x="253" y="410" width="46" height="22"/>
|
||||
<rect key="frame" x="253" y="453" width="46" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="46" id="oa0-9D-B5b"/>
|
||||
</constraints>
|
||||
@@ -132,7 +134,7 @@
|
||||
</connections>
|
||||
</textField>
|
||||
<comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ef4-8J-eFn">
|
||||
<rect key="frame" x="111" y="369" width="191" height="26"/>
|
||||
<rect key="frame" x="111" y="412" width="191" 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"/>
|
||||
@@ -140,7 +142,7 @@
|
||||
</comboBoxCell>
|
||||
</comboBox>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Kft-TG-O5S">
|
||||
<rect key="frame" x="30" y="376" width="75" height="17"/>
|
||||
<rect key="frame" x="30" y="419" width="75" 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"/>
|
||||
@@ -148,7 +150,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<secureTextField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZXA-oi-Zv3">
|
||||
<rect key="frame" x="111" y="330" width="188" height="22"/>
|
||||
<rect key="frame" x="111" y="373" width="188" height="22"/>
|
||||
<secureTextFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" usesSingleLineMode="YES" id="zuN-Jd-LeS">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -159,7 +161,7 @@
|
||||
</secureTextFieldCell>
|
||||
</secureTextField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Qfe-Ql-iCO">
|
||||
<rect key="frame" x="39" y="333" width="66" height="17"/>
|
||||
<rect key="frame" x="39" y="376" 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"/>
|
||||
@@ -167,7 +169,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="q3C-S0-iNn">
|
||||
<rect key="frame" x="111" y="288" width="188" height="22"/>
|
||||
<rect key="frame" x="111" y="331" width="188" 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"/>
|
||||
@@ -175,7 +177,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Baj-Yh-kmj">
|
||||
<rect key="frame" x="18" y="291" width="87" height="17"/>
|
||||
<rect key="frame" x="18" y="334" width="87" 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"/>
|
||||
@@ -183,7 +185,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6mK-sY-xoH">
|
||||
<rect key="frame" x="14" y="19" width="291" height="32"/>
|
||||
<rect key="frame" x="14" y="13" width="291" height="32"/>
|
||||
<buttonCell key="cell" type="push" title="Copy URL to Clipboard" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="t3T-Kd-5La">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -193,7 +195,7 @@
|
||||
</connections>
|
||||
</button>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="R4F-j7-GkK">
|
||||
<rect key="frame" x="111" y="410" width="122" height="22"/>
|
||||
<rect key="frame" x="111" y="453" width="122" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="MWO-hQ-nMt">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -208,7 +210,7 @@
|
||||
</buttonCell>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="o4d-yF-Vi8">
|
||||
<rect key="frame" x="7" y="251" width="308" height="17"/>
|
||||
<rect key="frame" x="7" y="294" width="308" height="17"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="304" id="K5Z-sq-BWj"/>
|
||||
</constraints>
|
||||
@@ -219,7 +221,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dl9-Pk-Krw">
|
||||
<rect key="frame" x="46" y="216" width="59" height="17"/>
|
||||
<rect key="frame" x="46" y="259" width="59" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Protocol:" id="nmk-Ue-wYb">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -227,7 +229,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="CbS-wf-XMN">
|
||||
<rect key="frame" x="111" y="210" width="191" height="26"/>
|
||||
<rect key="frame" x="111" y="253" width="191" height="26"/>
|
||||
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="6" id="dVc-vj-3MH">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -235,7 +237,7 @@
|
||||
</comboBoxCell>
|
||||
</comboBox>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5ze-PG-cOA">
|
||||
<rect key="frame" x="111" y="174" width="188" height="22"/>
|
||||
<rect key="frame" x="111" y="217" width="188" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="tIu-HJ-jTl">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -243,7 +245,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<comboBox verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ioe-Gj-Ufy">
|
||||
<rect key="frame" x="111" y="132" width="191" height="26"/>
|
||||
<rect key="frame" x="111" y="175" width="191" height="26"/>
|
||||
<comboBoxCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" drawsBackground="YES" completes="NO" numberOfVisibleItems="4" id="eme-XE-vv5">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -251,7 +253,7 @@
|
||||
</comboBoxCell>
|
||||
</comboBox>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KdT-hY-ALS">
|
||||
<rect key="frame" x="111" y="97" width="188" height="22"/>
|
||||
<rect key="frame" x="111" y="140" width="188" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="4ls-w1-tGj">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -259,7 +261,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6ha-OP-X4G">
|
||||
<rect key="frame" x="0.0" y="177" width="101" height="17"/>
|
||||
<rect key="frame" x="0.0" y="220" width="101" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Protocol Param:" id="dCk-qx-L1X">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -267,7 +269,7 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Hzl-09-lcK">
|
||||
<rect key="frame" x="64" y="138" width="37" height="17"/>
|
||||
<rect key="frame" x="64" y="181" width="37" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Obfs:" id="aQj-D7-XWZ">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
@@ -275,21 +277,39 @@
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="EgC-0w-FPq">
|
||||
<rect key="frame" x="22" y="100" width="79" height="17"/>
|
||||
<rect key="frame" x="22" y="143" width="79" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Obfs Param:" id="g7c-fW-7J4">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="P1H-Vl-P4W">
|
||||
<rect key="frame" x="111" y="100" width="188" height="22"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="5KQ-wP-oVO">
|
||||
<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="NO" translatesAutoresizingMaskIntoConstraints="NO" id="8zX-44-xj8">
|
||||
<rect key="frame" x="55" y="105" width="46" height="17"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Group:" id="j0N-8s-9Z3">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="ef4-8J-eFn" firstAttribute="trailing" secondItem="ZXA-oi-Zv3" secondAttribute="trailing" id="0zF-f1-SSA"/>
|
||||
<constraint firstItem="6mK-sY-xoH" firstAttribute="top" secondItem="9CP-zt-WuH" secondAttribute="bottom" constant="14" id="57J-fU-kGS"/>
|
||||
<constraint firstItem="6mK-sY-xoH" firstAttribute="top" secondItem="9CP-zt-WuH" secondAttribute="bottom" constant="20" id="57J-fU-kGS"/>
|
||||
<constraint firstItem="ioe-Gj-Ufy" firstAttribute="leading" secondItem="CbS-wf-XMN" secondAttribute="leading" id="5ss-uH-XtS"/>
|
||||
<constraint firstItem="ioe-Gj-Ufy" firstAttribute="top" secondItem="5ze-PG-cOA" secondAttribute="bottom" constant="18" id="7Q9-g4-mNf"/>
|
||||
<constraint firstItem="KdT-hY-ALS" firstAttribute="leading" secondItem="CbS-wf-XMN" secondAttribute="leading" id="7wS-bA-EZx"/>
|
||||
<constraint firstItem="R4F-j7-GkK" firstAttribute="leading" secondItem="ef4-8J-eFn" secondAttribute="leading" id="8H4-fq-Si2"/>
|
||||
<constraint firstItem="P1H-Vl-P4W" firstAttribute="leading" secondItem="8zX-44-xj8" secondAttribute="trailing" constant="12" id="9Nc-BF-7f1"/>
|
||||
<constraint firstItem="8zX-44-xj8" firstAttribute="top" secondItem="EgC-0w-FPq" secondAttribute="bottom" constant="21" id="E6W-yf-hGQ"/>
|
||||
<constraint firstItem="q3C-S0-iNn" firstAttribute="top" secondItem="ZXA-oi-Zv3" secondAttribute="bottom" constant="20" id="FEG-Xh-U87"/>
|
||||
<constraint firstItem="6ha-OP-X4G" firstAttribute="top" secondItem="dl9-Pk-Krw" secondAttribute="bottom" constant="22" id="FMk-4S-m3v"/>
|
||||
<constraint firstItem="CbS-wf-XMN" firstAttribute="leading" secondItem="q3C-S0-iNn" secondAttribute="leading" id="FNr-O1-HJY"/>
|
||||
@@ -302,13 +322,16 @@
|
||||
<constraint firstItem="CbS-wf-XMN" firstAttribute="centerY" secondItem="dl9-Pk-Krw" secondAttribute="centerY" id="KUM-fp-RMb"/>
|
||||
<constraint firstItem="HPg-NP-kjP" firstAttribute="baseline" secondItem="R4F-j7-GkK" secondAttribute="baseline" id="LDT-au-LL7"/>
|
||||
<constraint firstItem="HPg-NP-kjP" firstAttribute="leading" secondItem="a3z-VL-3xV" secondAttribute="leading" constant="48" id="M6O-wa-cXy"/>
|
||||
<constraint firstItem="8zX-44-xj8" firstAttribute="trailing" secondItem="EgC-0w-FPq" secondAttribute="trailing" id="MAL-Id-AN0"/>
|
||||
<constraint firstItem="q3C-S0-iNn" firstAttribute="leading" secondItem="Baj-Yh-kmj" secondAttribute="trailing" constant="8" symbolic="YES" id="MSO-ZP-L4p"/>
|
||||
<constraint firstItem="lng-AE-g0J" firstAttribute="leading" secondItem="Otb-CO-KUH" secondAttribute="trailing" constant="7" id="MoN-nP-zoX"/>
|
||||
<constraint firstItem="KdT-hY-ALS" firstAttribute="trailing" secondItem="CbS-wf-XMN" secondAttribute="trailing" id="Nkz-we-OMC"/>
|
||||
<constraint firstItem="6ha-OP-X4G" firstAttribute="trailing" secondItem="dl9-Pk-Krw" secondAttribute="trailing" constant="-4" id="OTx-aD-YQ3"/>
|
||||
<constraint firstItem="dl9-Pk-Krw" firstAttribute="top" secondItem="o4d-yF-Vi8" secondAttribute="bottom" constant="18" id="PwO-jq-20h"/>
|
||||
<constraint firstItem="P1H-Vl-P4W" firstAttribute="trailing" secondItem="9CP-zt-WuH" secondAttribute="trailing" id="QGr-BM-E7I"/>
|
||||
<constraint firstItem="ZXA-oi-Zv3" firstAttribute="trailing" secondItem="q3C-S0-iNn" secondAttribute="trailing" id="QwO-x4-05P"/>
|
||||
<constraint firstItem="5ze-PG-cOA" firstAttribute="trailing" secondItem="CbS-wf-XMN" secondAttribute="trailing" id="Riv-KQ-heB"/>
|
||||
<constraint firstItem="8zX-44-xj8" firstAttribute="bottom" secondItem="P1H-Vl-P4W" secondAttribute="bottom" constant="-5" id="SiB-oY-d4m"/>
|
||||
<constraint firstItem="ZXA-oi-Zv3" firstAttribute="leading" secondItem="Qfe-Ql-iCO" secondAttribute="trailing" constant="8" symbolic="YES" id="ThC-cn-3Ti"/>
|
||||
<constraint firstItem="5ze-PG-cOA" firstAttribute="leading" secondItem="CbS-wf-XMN" secondAttribute="leading" id="WQF-hJ-RpZ"/>
|
||||
<constraint firstItem="Qfe-Ql-iCO" firstAttribute="baseline" secondItem="ZXA-oi-Zv3" secondAttribute="baseline" id="WTh-JA-YlZ"/>
|
||||
@@ -326,7 +349,7 @@
|
||||
<constraint firstItem="Qfe-Ql-iCO" firstAttribute="leading" secondItem="Baj-Yh-kmj" secondAttribute="leading" constant="21" id="rpw-Lk-g7f"/>
|
||||
<constraint firstItem="6mK-sY-xoH" firstAttribute="leading" secondItem="a3z-VL-3xV" secondAttribute="leading" constant="20" symbolic="YES" id="s84-n6-iwB"/>
|
||||
<constraint firstItem="5ze-PG-cOA" firstAttribute="baseline" secondItem="6ha-OP-X4G" secondAttribute="baseline" id="sdb-UT-yAg"/>
|
||||
<constraint firstItem="6mK-sY-xoH" firstAttribute="top" secondItem="Baj-Yh-kmj" secondAttribute="bottom" constant="244" id="tKZ-MS-UxB"/>
|
||||
<constraint firstItem="6mK-sY-xoH" firstAttribute="top" secondItem="Baj-Yh-kmj" secondAttribute="bottom" constant="293" id="tKZ-MS-UxB"/>
|
||||
<constraint firstItem="ZXA-oi-Zv3" firstAttribute="leading" secondItem="q3C-S0-iNn" secondAttribute="leading" id="uCr-j6-ZK1"/>
|
||||
<constraint firstItem="dl9-Pk-Krw" firstAttribute="trailing" secondItem="Baj-Yh-kmj" secondAttribute="trailing" id="ucF-35-SAM"/>
|
||||
<constraint firstItem="Baj-Yh-kmj" firstAttribute="bottom" secondItem="q3C-S0-iNn" secondAttribute="bottom" constant="-3" id="uqB-vu-m2s"/>
|
||||
@@ -341,8 +364,6 @@
|
||||
<constraint firstItem="EgC-0w-FPq" firstAttribute="trailing" secondItem="Hzl-09-lcK" secondAttribute="trailing" id="ytg-Zs-bNC"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
||||
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
|
||||
</box>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="yyD-qq-aSk">
|
||||
<rect key="frame" x="495" y="13" width="81" height="32"/>
|
||||
@@ -376,14 +397,14 @@ Gw
|
||||
<action selector="cancel:" target="-2" id="514-4D-a6S"/>
|
||||
</connections>
|
||||
</button>
|
||||
<box title="Box" boxType="custom" borderType="none" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="Gqv-5O-Wwf">
|
||||
<rect key="frame" x="20" y="61" width="223" height="19"/>
|
||||
<box boxType="custom" borderType="none" title="Box" titlePosition="noTitle" translatesAutoresizingMaskIntoConstraints="NO" id="Gqv-5O-Wwf">
|
||||
<rect key="frame" x="20" y="61" width="223" height="20"/>
|
||||
<view key="contentView" id="MbP-FS-YEs">
|
||||
<rect key="frame" x="0.0" y="0.0" width="223" height="19"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="223" height="20"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="4ig-lF-m2R">
|
||||
<rect key="frame" x="0.0" y="-1" width="22" height="21"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="22" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="22" id="1Jv-ey-d2X"/>
|
||||
</constraints>
|
||||
@@ -396,7 +417,7 @@ Gw
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="3ei-2f-kHB">
|
||||
<rect key="frame" x="40" y="-1" width="22" height="21"/>
|
||||
<rect key="frame" x="41" y="0.0" width="22" height="21"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="22" id="8fD-Yn-ZEW"/>
|
||||
</constraints>
|
||||
@@ -409,7 +430,7 @@ Gw
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ZgM-eW-IFM">
|
||||
<rect key="frame" x="20" y="-1" width="22" height="21"/>
|
||||
<rect key="frame" x="20" y="0.0" width="22" height="21"/>
|
||||
<buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="copyV1" imagePosition="overlaps" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="s5r-hM-4Gh">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
@@ -421,7 +442,7 @@ Gw
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="3ei-2f-kHB" firstAttribute="height" secondItem="4ig-lF-m2R" secondAttribute="height" id="0uh-OE-iAW"/>
|
||||
<constraint firstItem="3ei-2f-kHB" firstAttribute="leading" secondItem="MbP-FS-YEs" secondAttribute="leading" constant="40" id="2tu-rA-iFm"/>
|
||||
<constraint firstItem="3ei-2f-kHB" firstAttribute="leading" secondItem="MbP-FS-YEs" secondAttribute="leading" constant="41" id="2tu-rA-iFm"/>
|
||||
<constraint firstItem="ZgM-eW-IFM" firstAttribute="leading" secondItem="MbP-FS-YEs" secondAttribute="leading" constant="20" symbolic="YES" id="Kg3-fv-mbA"/>
|
||||
<constraint firstItem="4ig-lF-m2R" firstAttribute="leading" secondItem="MbP-FS-YEs" secondAttribute="leading" id="V4f-n1-fqZ"/>
|
||||
<constraint firstItem="ZgM-eW-IFM" firstAttribute="height" secondItem="4ig-lF-m2R" secondAttribute="height" id="YgL-Jc-poy"/>
|
||||
@@ -432,7 +453,6 @@ Gw
|
||||
<constraint firstItem="4ig-lF-m2R" firstAttribute="top" secondItem="MbP-FS-YEs" secondAttribute="top" id="xee-9x-wEB"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
|
||||
<color key="fillColor" red="1" green="1" blue="1" alpha="0.59999999999999998" colorSpace="calibratedRGB"/>
|
||||
</box>
|
||||
</subviews>
|
||||
@@ -443,8 +463,8 @@ Gw
|
||||
<constraint firstItem="yyD-qq-aSk" firstAttribute="leading" secondItem="kGm-Zm-ipY" secondAttribute="trailing" constant="12" symbolic="YES" id="EGq-gP-YUt"/>
|
||||
<constraint firstAttribute="bottom" secondItem="kGm-Zm-ipY" secondAttribute="bottom" constant="20" symbolic="YES" id="FYH-8M-te7"/>
|
||||
<constraint firstItem="oZ5-85-pwY" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="251" id="JxK-S6-yOS"/>
|
||||
<constraint firstItem="Gqv-5O-Wwf" firstAttribute="top" secondItem="u4U-Ju-FJV" secondAttribute="bottom" constant="-1" id="LJq-QU-Vhw"/>
|
||||
<constraint firstItem="Gqv-5O-Wwf" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="449" id="PxF-wu-Hfs"/>
|
||||
<constraint firstItem="Gqv-5O-Wwf" firstAttribute="top" secondItem="u4U-Ju-FJV" secondAttribute="bottom" id="LJq-QU-Vhw"/>
|
||||
<constraint firstItem="Gqv-5O-Wwf" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="491" id="PxF-wu-Hfs"/>
|
||||
<constraint firstAttribute="trailing" secondItem="oZ5-85-pwY" secondAttribute="trailing" constant="20" symbolic="YES" id="RnM-Z9-kYW"/>
|
||||
<constraint firstItem="u4U-Ju-FJV" firstAttribute="top" secondItem="oZ5-85-pwY" secondAttribute="top" id="YHq-MK-f01"/>
|
||||
<constraint firstItem="Gqv-5O-Wwf" firstAttribute="bottom" secondItem="oZ5-85-pwY" secondAttribute="bottom" id="Z3L-Aj-b7H"/>
|
||||
@@ -459,7 +479,7 @@ Gw
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="412" y="321.5"/>
|
||||
<point key="canvasLocation" x="412" y="343"/>
|
||||
</window>
|
||||
<numberFormatter formatterBehavior="default10_4" usesGroupingSeparator="NO" groupingSize="0" minimumIntegerDigits="0" maximumIntegerDigits="42" id="QZc-kt-D7Z" userLabel="Port Number Formatter">
|
||||
<real key="minimum" value="1"/>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.3.8-R8</string>
|
||||
<string>1.3.9-R8</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
@@ -48,7 +48,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>6</string>
|
||||
<string>1</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
import Foundation
|
||||
|
||||
let SS_LOCAL_VERSION = "2.5.6.static"
|
||||
let SS_LOCAL_VERSION = "2.5.6.1.static"
|
||||
let PRIVOXY_VERSION = "3.0.26.static"
|
||||
let APP_SUPPORT_DIR = "/Library/Application Support/ShadowsocksX-NG/"
|
||||
let LAUNCH_AGENT_DIR = "/Library/LaunchAgents/"
|
||||
|
||||
@@ -27,6 +27,7 @@ class PreferencesWindowController: NSWindowController
|
||||
@IBOutlet weak var duplicateProfileButton: NSButton!
|
||||
@IBOutlet weak var passwordTextField: NSTextField!
|
||||
@IBOutlet weak var remarkTextField: NSTextField!
|
||||
@IBOutlet weak var groupTextField: NSTextField!
|
||||
|
||||
@IBOutlet weak var otaCheckBoxBtn: NSButton!
|
||||
|
||||
@@ -231,6 +232,7 @@ class PreferencesWindowController: NSWindowController
|
||||
ObfsTextField.bind("value", to: editingProfile, withKeyPath: "ssrObfs", options: [NSContinuouslyUpdatesValueBindingOption: true])
|
||||
|
||||
ObfsParamTextField.bind("value", to: editingProfile, withKeyPath: "ssrObfsParam", options: [NSContinuouslyUpdatesValueBindingOption: true])
|
||||
groupTextField.bind("value", to: editingProfile, withKeyPath: "ssrGroup", options: [NSContinuouslyUpdatesValueBindingOption: true])
|
||||
|
||||
otaCheckBoxBtn.bind("value", to: editingProfile, withKeyPath: "ota"
|
||||
, options: [NSContinuouslyUpdatesValueBindingOption: true])
|
||||
|
||||
@@ -24,6 +24,7 @@ class ServerProfile: NSObject {
|
||||
var ssrProtocolParam:String = ""
|
||||
var ssrObfs:String = "plain"
|
||||
var ssrObfsParam:String = ""
|
||||
var ssrGroup: String = ""
|
||||
|
||||
var latency:String?
|
||||
|
||||
@@ -61,6 +62,9 @@ class ServerProfile: NSObject {
|
||||
if let ssrProtocolParam = data["ssrProtocolParam"]{
|
||||
profile.ssrProtocolParam = ssrProtocolParam as! String
|
||||
}
|
||||
if let ssrGroup = data["ssrGroup"]{
|
||||
profile.ssrGroup = ssrGroup as! String
|
||||
}
|
||||
}
|
||||
|
||||
if let id = data["Id"] as? String {
|
||||
@@ -87,10 +91,12 @@ class ServerProfile: NSObject {
|
||||
d["ssrProtocolParam"] = ssrProtocolParam as AnyObject?
|
||||
d["ssrObfs"] = ssrObfs as AnyObject?
|
||||
d["ssrObfsParam"] = ssrObfsParam as AnyObject?
|
||||
d["ssrGroup"] = ssrGroup as AnyObject?
|
||||
return d
|
||||
}
|
||||
|
||||
func toJsonConfig() -> [String: AnyObject] {
|
||||
// supply json file for ss-local only export vital param
|
||||
var conf: [String: AnyObject] = ["server": serverHost as AnyObject,
|
||||
"server_port": NSNumber(value: serverPort as UInt16),
|
||||
"password": password as AnyObject,
|
||||
@@ -104,7 +110,7 @@ class ServerProfile: NSObject {
|
||||
|
||||
if(!ssrObfs.isEmpty){
|
||||
conf["protocol"] = ssrProtocol as AnyObject?
|
||||
conf["protocol_param"] = ssrProtocolParam as AnyObject?
|
||||
conf["protocol_param"] = ssrProtocolParam as AnyObject?// do not muta here
|
||||
conf["obfs"] = ssrObfs as AnyObject?
|
||||
conf["obfs_param"] = ssrObfsParam as AnyObject?
|
||||
}
|
||||
@@ -167,17 +173,22 @@ class ServerProfile: NSObject {
|
||||
}else{
|
||||
let firstParts = "\(serverHost):\(serverPort):\(ssrProtocol):\(method):\(ssrObfs):"
|
||||
let secondParts = "\(password)"
|
||||
//base64(abc.xyz:12345:auth_sha1_v2:rc4-md5:tls1.2_ticket_auth:{base64(password)}/?obfsparam={base64(混淆参数(网址))}&remarks={base64(节点名称)})
|
||||
// ssr:// + base64(abc.xyz:12345:auth_sha1_v2:rc4-md5:tls1.2_ticket_auth:{base64(password)}/?obfsparam={base64(混淆参数(网址))}&protoparam={base64(混淆协议)}&remarks={base64(节点名称)}&group={base64(分组名)})
|
||||
let base64PasswordString = secondParts.data(using: String.Encoding.utf8)?
|
||||
.base64EncodedString(options: NSData.Base64EncodingOptions())
|
||||
|
||||
let base64ssrObfsParamString = ssrObfsParam.data(using: String.Encoding.utf8)?
|
||||
.base64EncodedString(options: NSData.Base64EncodingOptions())
|
||||
|
||||
let base64ssrProtocolParamString = ssrProtocolParam.data(using: String.Encoding.utf8)?
|
||||
.base64EncodedString(options: NSData.Base64EncodingOptions())
|
||||
|
||||
let base64RemarkString = remark.data(using: String.Encoding.utf8)?
|
||||
.base64EncodedString(options: NSData.Base64EncodingOptions())
|
||||
|
||||
var s = firstParts + base64PasswordString! + "/?" + "obfsparam=" + base64ssrObfsParamString! + "&remarks=" + base64RemarkString!
|
||||
let base64GroupString = ssrGroup.data(using: String.Encoding.utf8)?.base64EncodedString(options: NSData.Base64EncodingOptions())
|
||||
|
||||
var s = firstParts + base64PasswordString! + "/?" + "obfsparam=" + base64ssrObfsParamString! + "&protoparam=" + base64ssrProtocolParamString! + "&remarks=" + base64RemarkString! + "&group=" + base64GroupString!
|
||||
s = (s.data(using: String.Encoding.utf8)?
|
||||
.base64EncodedString(options: NSData.Base64EncodingOptions()))!
|
||||
return Foundation.URL(string: "ssr://\(s)")
|
||||
|
||||
@@ -80,6 +80,7 @@ class ServerProfileManager: NSObject {
|
||||
openPanel.canChooseFiles = true
|
||||
openPanel.becomeKey()
|
||||
openPanel.begin { (result) -> Void in
|
||||
// TODO not freeze the screen when running import process
|
||||
if (result == NSFileHandlingPanelOKButton && (openPanel.url) != nil) {
|
||||
let fileManager = FileManager.default
|
||||
let filePath:String = (openPanel.url?.path)!
|
||||
@@ -97,14 +98,17 @@ class ServerProfileManager: NSObject {
|
||||
profile.method = item["method"] as! String
|
||||
profile.password = item["password"] as! String
|
||||
profile.remark = item["remarks"] as! String
|
||||
if(item["group"] != nil){
|
||||
profile.ssrGroup = item["group"] as! String
|
||||
}
|
||||
if (item["obfs"] != nil) {
|
||||
profile.ssrObfs = item["obfs"] as! String
|
||||
profile.ssrProtocol = item["protocol"] as! String
|
||||
if (item["obfsparam"] != nil){
|
||||
profile.ssrObfsParam = item["obfsparam"] as! String
|
||||
}
|
||||
if (item["protocolparam"] != nil){
|
||||
profile.ssrProtocolParam = item["protocolparam"] as! String
|
||||
if (item["protoparam"] != nil){
|
||||
profile.ssrProtocolParam = item["protoparam"] as! String
|
||||
}
|
||||
}
|
||||
self.profiles.append(profile)
|
||||
@@ -159,9 +163,12 @@ class ServerProfileManager: NSObject {
|
||||
configProfile.setValue(profile.ssrObfsParam, forKey: "obfsparam")
|
||||
}
|
||||
if profile.ssrProtocolParam != "" {
|
||||
configProfile.setValue(profile.ssrProtocolParam, forKey: "protoclparam")
|
||||
configProfile.setValue(profile.ssrProtocolParam, forKey: "protoparam")
|
||||
}
|
||||
}
|
||||
if profile.ssrGroup != "" {
|
||||
configProfile.setValue(profile.ssrGroup, forKey: "group")
|
||||
}
|
||||
configsArray.add(configProfile)
|
||||
}
|
||||
jsonArr1.setValue(configsArray, forKey: "configs")
|
||||
|
||||
@@ -136,7 +136,7 @@ NSDictionary<NSString *, id>* ParseSSURL(NSURL* url) {
|
||||
}
|
||||
|
||||
}else if ([urlString hasPrefix:@"ssr://"]){
|
||||
// ssr:// + base64(abc.xyz:12345:auth_sha1_v2:rc4-md5:tls1.2_ticket_auth:{base64(password)}/?obfsparam={base64(混淆参数(网址))}&remarks={base64(节点名称)})
|
||||
// ssr:// + base64(abc.xyz:12345:auth_sha1_v2:rc4-md5:tls1.2_ticket_auth:{base64(password)}/?obfsparam={base64(混淆参数(网址))}&protoparam={base64(混淆协议)}&remarks={base64(节点名称)}&group={base64(分组名)})
|
||||
|
||||
|
||||
urlString = [urlString stringByReplacingOccurrencesOfString:@"ssr://" withString:@"" options:NSAnchoredSearch range:NSMakeRange(0, urlString.length)];
|
||||
@@ -210,14 +210,17 @@ NSDictionary<NSString *, id>* ParseSSURL(NSURL* url) {
|
||||
NSString *ssrObfsParam = @"";
|
||||
NSString *remarks = @"";
|
||||
NSString *ssrProtocolParam = @"";
|
||||
NSString *ssrGroup = @"";
|
||||
for (NSString *key in parserLastParamDict) {
|
||||
NSLog(@"key: %@ value: %@", key, parserLastParamDict[key]);
|
||||
if ([key isEqual: @"obfsparam"]) {
|
||||
ssrObfsParam = parserLastParamDict[key];
|
||||
} else if ([key isEqual: @"remarks"]) {
|
||||
remarks = parserLastParamDict[key];
|
||||
} else if([key isEqual:@"protocolparam"]){
|
||||
} else if([key isEqual:@"protoparam"]){
|
||||
ssrProtocolParam = parserLastParamDict[key];
|
||||
} else if([key isEqual:@"group"]){
|
||||
ssrGroup = parserLastParamDict[key];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -230,6 +233,7 @@ NSDictionary<NSString *, id>* ParseSSURL(NSURL* url) {
|
||||
@"ssrProtocol":ssrProtocol,
|
||||
@"ssrProtocolParam":ssrProtocolParam,
|
||||
@"Remark":remarks,
|
||||
@"Group":ssrGroup,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
|
||||
cd `dirname "${BASH_SOURCE[0]}"`
|
||||
ssLocalVersion=2.5.6.static
|
||||
ssLocalVersion=2.5.6.1.static
|
||||
mkdir -p "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local-$ssLocalVersion"
|
||||
cp -f ss-local "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local-$ssLocalVersion/"
|
||||
rm -f "$HOME/Library/Application Support/ShadowsocksX-NG/ss-local"
|
||||
|
||||
Binary file not shown.
@@ -61,4 +61,6 @@
|
||||
|
||||
/* Class = "NSTextFieldCell"; title = "obfs-param:"; ObjectID = "aQv-HP-iKY"; */
|
||||
"aQv-HP-iKY.title" = "混淆参数:";
|
||||
/**/
|
||||
"j0N-8s-9Z3.title" = "分组:"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user