mirror of
https://github.com/qinyuhang/ShadowsocksX-NG-R.git
synced 2026-10-20 06:24:32 +00:00
新增ACL自动模式 和 回国模式(Proxy Back China)
回国模式必须搭配一个回国的SS才可使用。原理为仅代理国内IP
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
08BDBB481E2361BD00C4BBC2 /* VersionChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08BDBB471E2361BD00C4BBC2 /* VersionChecker.swift */; };
|
||||
08CF21461E2A730E008F235D /* LICENSE in Resources */ = {isa = PBXBuildFile; fileRef = 08CF21451E2A730E008F235D /* LICENSE */; };
|
||||
08F162BE1EBEDF0100C52869 /* chn.acl in Resources */ = {isa = PBXBuildFile; fileRef = 08F162BD1EBEDF0100C52869 /* chn.acl */; };
|
||||
08F162C01EBEE6F800C52869 /* backchn.acl in Resources */ = {isa = PBXBuildFile; fileRef = 08F162BF1EBEE6F800C52869 /* backchn.acl */; };
|
||||
08F162C21EBEEC0F00C52869 /* gfwlist.acl in Resources */ = {isa = PBXBuildFile; fileRef = 08F162C11EBEEC0F00C52869 /* gfwlist.acl */; };
|
||||
08FFAC621E437F6E00BDF137 /* PingTest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 08FFAC611E437F6E00BDF137 /* PingTest.swift */; };
|
||||
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 */; };
|
||||
@@ -119,6 +121,8 @@
|
||||
08BDBB471E2361BD00C4BBC2 /* VersionChecker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VersionChecker.swift; sourceTree = "<group>"; };
|
||||
08CF21451E2A730E008F235D /* LICENSE */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LICENSE; sourceTree = SOURCE_ROOT; };
|
||||
08F162BD1EBEDF0100C52869 /* chn.acl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = chn.acl; sourceTree = "<group>"; };
|
||||
08F162BF1EBEE6F800C52869 /* backchn.acl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = backchn.acl; sourceTree = "<group>"; };
|
||||
08F162C11EBEEC0F00C52869 /* gfwlist.acl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = gfwlist.acl; sourceTree = "<group>"; };
|
||||
08FFAC611E437F6E00BDF137 /* PingTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PingTest.swift; sourceTree = "<group>"; };
|
||||
19083CFCED87354F006967FF /* Pods_ShadowsocksX_NGUITests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ShadowsocksX_NGUITests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
1E7783AEDB4A3BDDC9FF16AC /* libPods-proxy_conf_helper.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-proxy_conf_helper.a"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
@@ -272,8 +276,10 @@
|
||||
0880CE3F1D6FE6D900BD39E2 /* example-gui-config.json */,
|
||||
9B3FFF281D08A1DF0019A709 /* user-rule.txt */,
|
||||
08F162BD1EBEDF0100C52869 /* chn.acl */,
|
||||
08F162BF1EBEE6F800C52869 /* backchn.acl */,
|
||||
088EC3961D5F5B8600E40791 /* whitelist.pac */,
|
||||
088EC3981D5F5BA300E40791 /* whiteiplist.pac */,
|
||||
08F162C11EBEEC0F00C52869 /* gfwlist.acl */,
|
||||
9B3FFF261D0898EB0019A709 /* gfwlist.txt */,
|
||||
9B3FFF221D088E8D0019A709 /* abp.js */,
|
||||
9B07EFA61D048BBB0052D9DF /* ss-local */,
|
||||
@@ -537,6 +543,8 @@
|
||||
9BEEF06C1D04D4D500FC52B3 /* reload_conf_ss_local.sh in Resources */,
|
||||
9B3FFF231D088E8D0019A709 /* abp.js in Resources */,
|
||||
9B07EFAD1D048E880052D9DF /* menu_icon.png in Resources */,
|
||||
08F162C21EBEEC0F00C52869 /* gfwlist.acl in Resources */,
|
||||
08F162C01EBEE6F800C52869 /* backchn.acl in Resources */,
|
||||
C6D429951DA75988002A5711 /* reload_conf_privoxy.sh in Resources */,
|
||||
9B0BFFEB1D0460A70040E62B /* Assets.xcassets in Resources */,
|
||||
9B2491B71D0ACC3E003BBECC /* AdvPreferencesWindowController.xib in Resources */,
|
||||
|
||||
@@ -33,8 +33,9 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
@IBOutlet weak var globalModeMenuItem: NSMenuItem!
|
||||
@IBOutlet weak var manualModeMenuItem: NSMenuItem!
|
||||
@IBOutlet weak var whiteListModeMenuItem: NSMenuItem!
|
||||
// @IBOutlet weak var whiteListMenuItem: NSMenuItem!
|
||||
// @IBOutlet weak var whiteListIPMenuItem: NSMenuItem!
|
||||
@IBOutlet weak var ACLModeMenuItem: NSMenuItem!
|
||||
@IBOutlet weak var ACLAutoModeMenuItem: NSMenuItem!
|
||||
@IBOutlet weak var ACLBackChinaMenuItem: NSMenuItem!
|
||||
|
||||
@IBOutlet weak var serversMenuItem: NSMenuItem!
|
||||
@IBOutlet var pingserverMenuItem: NSMenuItem!
|
||||
@@ -364,15 +365,23 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
applyConfig()
|
||||
}
|
||||
@IBAction func selectACLAutoMode(_ sender: NSMenuItem) {
|
||||
|
||||
let defaults = UserDefaults.standard
|
||||
defaults.setValue("whiteList", forKey: "ShadowsocksRunningMode")
|
||||
defaults.setValue("gfw.acl", forKey: "ACLPath")
|
||||
updateRunningModeMenu()
|
||||
applyConfig()
|
||||
}
|
||||
@IBAction func selectACLWhiteListMode(_ sender: NSMenuItem) {
|
||||
|
||||
@IBAction func selectACLBackCHNMode(_ sender: NSMenuItem) {
|
||||
let defaults = UserDefaults.standard
|
||||
defaults.setValue("whiteList", forKey: "ShadowsocksRunningMode")
|
||||
defaults.setValue("backchn.acl", forKey: "ACLPath")
|
||||
updateRunningModeMenu()
|
||||
applyConfig()
|
||||
}
|
||||
@IBAction func selectWhiteListMode(_ sender: NSMenuItem) {
|
||||
let defaults = UserDefaults.standard
|
||||
defaults.setValue("whiteList", forKey: "ShadowsocksRunningMode")
|
||||
defaults.setValue("ACLPath", forKey: "chn.acl")
|
||||
defaults.setValue("chn.acl", forKey: "ACLPath")
|
||||
updateRunningModeMenu()
|
||||
applyConfig()
|
||||
}
|
||||
@@ -507,17 +516,29 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
||||
manualModeMenuItem.state = 0
|
||||
whiteListModeMenuItem.state = 0
|
||||
if mode == "auto" {
|
||||
proxyMenuItem.title = "Proxy - Auto By PAC".localized
|
||||
autoModeMenuItem.state = 1
|
||||
} else if mode == "global" {
|
||||
proxyMenuItem.title = "Proxy - Global".localized
|
||||
globalModeMenuItem.state = 1
|
||||
} else if mode == "manual" {
|
||||
proxyMenuItem.title = "Proxy - Manual".localized
|
||||
manualModeMenuItem.state = 1
|
||||
} else if mode == "whiteList" {
|
||||
proxyMenuItem.title = "Proxy - White List".localized
|
||||
whiteListModeMenuItem.state = 1
|
||||
ACLModeMenuItem.state = 0
|
||||
whiteListModeMenuItem.state = 0
|
||||
ACLBackChinaMenuItem.state = 0
|
||||
ACLAutoModeMenuItem.state = 0
|
||||
let aclMode = defaults.value(forKey: "ACLPath") as! String
|
||||
switch aclMode {
|
||||
case "backchn.acl":
|
||||
ACLModeMenuItem.state = 1
|
||||
ACLBackChinaMenuItem.state = 1
|
||||
break
|
||||
case "gfw.acl":
|
||||
ACLModeMenuItem.state = 1
|
||||
ACLAutoModeMenuItem.state = 1
|
||||
break
|
||||
default:
|
||||
whiteListModeMenuItem.state = 1
|
||||
}
|
||||
}
|
||||
updateStatusItemUI()
|
||||
}
|
||||
|
||||
@@ -14,6 +14,9 @@
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="ShadowsocksX_NG" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="ACLAutoModeMenuItem" destination="sDG-YV-yuQ" id="kIE-Ua-zvx"/>
|
||||
<outlet property="ACLBackChinaMenuItem" destination="lam-el-r4I" id="O41-Lr-e0h"/>
|
||||
<outlet property="ACLModeMenuItem" destination="Yub-b0-bni" id="e0w-Td-aE9"/>
|
||||
<outlet property="RunningStatusMenuItem" destination="fzk-mE-CEV" id="R4x-gK-Qcw"/>
|
||||
<outlet property="ShowNetworkSpeedItem" destination="a3h-uQ-DuO" id="OLq-K8-rEO"/>
|
||||
<outlet property="autoModeMenuItem" destination="r07-Gu-aEz" id="9aH-pQ-Rgi"/>
|
||||
@@ -75,6 +78,25 @@
|
||||
<action selector="selectManualMode:" target="Voe-Tx-rLC" id="Xxb-28-6fi"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="ACL Mode" id="Yub-b0-bni">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="ACL Mode" id="tEB-59-fCx">
|
||||
<items>
|
||||
<menuItem title="Auto" id="sDG-YV-yuQ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="selectACLAutoMode:" target="Voe-Tx-rLC" id="0PY-wQ-9KI"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Proxy Back China" state="on" id="lam-el-r4I">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="selectACLBackCHNMode:" target="Voe-Tx-rLC" id="ZK2-2R-g2C"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Proxy Settings" id="diI-fB-Rss">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Proxy Settings" id="YZp-bf-L40">
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?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">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="12120" systemVersion="16F71b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12120"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
|
||||
@@ -46,7 +46,6 @@ func generateSSLocalLauchAgentPlist() -> Bool {
|
||||
let enableUdpRelay = defaults.bool(forKey: "LocalSocks5.EnableUDPRelay")
|
||||
let enableVerboseMode = defaults.bool(forKey: "LocalSocks5.EnableVerboseMode")
|
||||
let enabelWhiteListMode = defaults.value(forKey: "ShadowsocksRunningMode") as! String
|
||||
print(enabelWhiteListMode )
|
||||
|
||||
var arguments = [sslocalPath, "-c", "ss-local-config.json"]
|
||||
if enableUdpRelay {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user