Advance preference for proxy.
Manual spesify network services which would be configure.
This commit is contained in:
@ -38,6 +38,9 @@
|
|||||||
9B3FFF4C1D09D8F70019A709 /* install_helper.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9B3FFF4B1D09D8F70019A709 /* install_helper.sh */; };
|
9B3FFF4C1D09D8F70019A709 /* install_helper.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9B3FFF4B1D09D8F70019A709 /* install_helper.sh */; };
|
||||||
9B3FFF4F1D09D9D50019A709 /* ProxyConfHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */; };
|
9B3FFF4F1D09D9D50019A709 /* ProxyConfHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */; };
|
||||||
9B3FFF541D09E2D10019A709 /* proxy_conf_helper in Resources */ = {isa = PBXBuildFile; fileRef = 9B3FFF441D09CD3B0019A709 /* proxy_conf_helper */; };
|
9B3FFF541D09E2D10019A709 /* proxy_conf_helper in Resources */ = {isa = PBXBuildFile; fileRef = 9B3FFF441D09CD3B0019A709 /* proxy_conf_helper */; };
|
||||||
|
9BA04B231D23D5A5005AAD7F /* ProxyConfTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BA04B221D23D5A5005AAD7F /* ProxyConfTool.m */; };
|
||||||
|
9BA04B261D24044D005AAD7F /* ProxyPreferencesController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA04B241D24044D005AAD7F /* ProxyPreferencesController.swift */; };
|
||||||
|
9BA04B271D24044D005AAD7F /* ProxyPreferencesController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9BA04B251D24044D005AAD7F /* ProxyPreferencesController.xib */; };
|
||||||
9BB706A71D1B982300551F0E /* SWBApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB706A51D1B982300551F0E /* SWBApplication.m */; };
|
9BB706A71D1B982300551F0E /* SWBApplication.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB706A51D1B982300551F0E /* SWBApplication.m */; };
|
||||||
9BE8FBBF1D0B211600CAFD01 /* libcrypto.1.0.0.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 9BE8FBBD1D0B1FB900CAFD01 /* libcrypto.1.0.0.dylib */; };
|
9BE8FBBF1D0B211600CAFD01 /* libcrypto.1.0.0.dylib in Resources */ = {isa = PBXBuildFile; fileRef = 9BE8FBBD1D0B1FB900CAFD01 /* libcrypto.1.0.0.dylib */; };
|
||||||
9BEEF0691D04D4D500FC52B3 /* install_ss_local.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9BEEF0651D04CB8500FC52B3 /* install_ss_local.sh */; };
|
9BEEF0691D04D4D500FC52B3 /* install_ss_local.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9BEEF0651D04CB8500FC52B3 /* install_ss_local.sh */; };
|
||||||
@ -137,6 +140,10 @@
|
|||||||
9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyConfHelper.m; sourceTree = "<group>"; };
|
9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyConfHelper.m; sourceTree = "<group>"; };
|
||||||
9B3FFF501D09DAEA0019A709 /* proxy_conf_helper_version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = proxy_conf_helper_version.h; sourceTree = "<group>"; };
|
9B3FFF501D09DAEA0019A709 /* proxy_conf_helper_version.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = proxy_conf_helper_version.h; sourceTree = "<group>"; };
|
||||||
9B3FFF511D09DBA20019A709 /* ShadowsocksX-NG-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ShadowsocksX-NG-Bridging-Header.h"; sourceTree = "<group>"; };
|
9B3FFF511D09DBA20019A709 /* ShadowsocksX-NG-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ShadowsocksX-NG-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
|
9BA04B211D23D5A5005AAD7F /* ProxyConfTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyConfTool.h; sourceTree = "<group>"; };
|
||||||
|
9BA04B221D23D5A5005AAD7F /* ProxyConfTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ProxyConfTool.m; sourceTree = "<group>"; };
|
||||||
|
9BA04B241D24044D005AAD7F /* ProxyPreferencesController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProxyPreferencesController.swift; sourceTree = "<group>"; };
|
||||||
|
9BA04B251D24044D005AAD7F /* ProxyPreferencesController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ProxyPreferencesController.xib; sourceTree = "<group>"; };
|
||||||
9BB706A51D1B982300551F0E /* SWBApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWBApplication.m; sourceTree = "<group>"; };
|
9BB706A51D1B982300551F0E /* SWBApplication.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SWBApplication.m; sourceTree = "<group>"; };
|
||||||
9BB706A61D1B982300551F0E /* SWBApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWBApplication.h; sourceTree = "<group>"; };
|
9BB706A61D1B982300551F0E /* SWBApplication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SWBApplication.h; sourceTree = "<group>"; };
|
||||||
9BE8FBBD1D0B1FB900CAFD01 /* libcrypto.1.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libcrypto.1.0.0.dylib; sourceTree = "<group>"; };
|
9BE8FBBD1D0B1FB900CAFD01 /* libcrypto.1.0.0.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libcrypto.1.0.0.dylib; sourceTree = "<group>"; };
|
||||||
@ -272,6 +279,8 @@
|
|||||||
9B3FFF4D1D09D9D50019A709 /* ProxyConfHelper.h */,
|
9B3FFF4D1D09D9D50019A709 /* ProxyConfHelper.h */,
|
||||||
9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */,
|
9B3FFF4E1D09D9D50019A709 /* ProxyConfHelper.m */,
|
||||||
9B3FFF501D09DAEA0019A709 /* proxy_conf_helper_version.h */,
|
9B3FFF501D09DAEA0019A709 /* proxy_conf_helper_version.h */,
|
||||||
|
9BA04B211D23D5A5005AAD7F /* ProxyConfTool.h */,
|
||||||
|
9BA04B221D23D5A5005AAD7F /* ProxyConfTool.m */,
|
||||||
);
|
);
|
||||||
path = "ShadowsocksX-NG";
|
path = "ShadowsocksX-NG";
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -295,6 +304,8 @@
|
|||||||
9B2491B61D0ACC3A003BBECC /* PreferencesWindowController.xib */,
|
9B2491B61D0ACC3A003BBECC /* PreferencesWindowController.xib */,
|
||||||
9BEEF0791D05631500FC52B3 /* AdvPreferencesWindowController.swift */,
|
9BEEF0791D05631500FC52B3 /* AdvPreferencesWindowController.swift */,
|
||||||
9B2491B91D0ACC3E003BBECC /* AdvPreferencesWindowController.xib */,
|
9B2491B91D0ACC3E003BBECC /* AdvPreferencesWindowController.xib */,
|
||||||
|
9BA04B241D24044D005AAD7F /* ProxyPreferencesController.swift */,
|
||||||
|
9BA04B251D24044D005AAD7F /* ProxyPreferencesController.xib */,
|
||||||
);
|
);
|
||||||
name = UI;
|
name = UI;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -436,6 +447,7 @@
|
|||||||
9B3FFF541D09E2D10019A709 /* proxy_conf_helper in Resources */,
|
9B3FFF541D09E2D10019A709 /* proxy_conf_helper in Resources */,
|
||||||
9BEEF0691D04D4D500FC52B3 /* install_ss_local.sh in Resources */,
|
9BEEF0691D04D4D500FC52B3 /* install_ss_local.sh in Resources */,
|
||||||
9B172A6A1D0ADDDD00B87B9A /* Localizable.strings in Resources */,
|
9B172A6A1D0ADDDD00B87B9A /* Localizable.strings in Resources */,
|
||||||
|
9BA04B271D24044D005AAD7F /* ProxyPreferencesController.xib in Resources */,
|
||||||
9B2491B41D0ACC3A003BBECC /* PreferencesWindowController.xib in Resources */,
|
9B2491B41D0ACC3A003BBECC /* PreferencesWindowController.xib in Resources */,
|
||||||
9B3FFF291D08A1DF0019A709 /* user-rule.txt in Resources */,
|
9B3FFF291D08A1DF0019A709 /* user-rule.txt in Resources */,
|
||||||
9BEEF06A1D04D4D500FC52B3 /* start_ss_local.sh in Resources */,
|
9BEEF06A1D04D4D500FC52B3 /* start_ss_local.sh in Resources */,
|
||||||
@ -602,6 +614,7 @@
|
|||||||
9B3FFF1E1D0732660019A709 /* Utils.m in Sources */,
|
9B3FFF1E1D0732660019A709 /* Utils.m in Sources */,
|
||||||
9B3FFF321D08CEE40019A709 /* SWBQRCodeWindowController.m in Sources */,
|
9B3FFF321D08CEE40019A709 /* SWBQRCodeWindowController.m in Sources */,
|
||||||
9B3FFF211D08826E0019A709 /* PACUtils.swift in Sources */,
|
9B3FFF211D08826E0019A709 /* PACUtils.swift in Sources */,
|
||||||
|
9BA04B261D24044D005AAD7F /* ProxyPreferencesController.swift in Sources */,
|
||||||
9B3FFF141D0705810019A709 /* Notifications.swift in Sources */,
|
9B3FFF141D0705810019A709 /* Notifications.swift in Sources */,
|
||||||
9BEEF0701D04DDB100FC52B3 /* ServerProfileManager.swift in Sources */,
|
9BEEF0701D04DDB100FC52B3 /* ServerProfileManager.swift in Sources */,
|
||||||
9BEEF07B1D05631500FC52B3 /* AdvPreferencesWindowController.swift in Sources */,
|
9BEEF07B1D05631500FC52B3 /* AdvPreferencesWindowController.swift in Sources */,
|
||||||
@ -609,6 +622,7 @@
|
|||||||
9B3FFF0D1D05FEB30019A709 /* Utils.swift in Sources */,
|
9B3FFF0D1D05FEB30019A709 /* Utils.swift in Sources */,
|
||||||
9BEEF0751D04EF3E00FC52B3 /* PreferencesWindowController.swift in Sources */,
|
9BEEF0751D04EF3E00FC52B3 /* PreferencesWindowController.swift in Sources */,
|
||||||
9B0BFFE91D0460A70040E62B /* AppDelegate.swift in Sources */,
|
9B0BFFE91D0460A70040E62B /* AppDelegate.swift in Sources */,
|
||||||
|
9BA04B231D23D5A5005AAD7F /* ProxyConfTool.m in Sources */,
|
||||||
9BEEF0781D04FE8A00FC52B3 /* LaunchAgentUtils.swift in Sources */,
|
9BEEF0781D04FE8A00FC52B3 /* LaunchAgentUtils.swift in Sources */,
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
@ -15,6 +15,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
var qrcodeWinCtrl: SWBQRCodeWindowController!
|
var qrcodeWinCtrl: SWBQRCodeWindowController!
|
||||||
var preferencesWinCtrl: PreferencesWindowController!
|
var preferencesWinCtrl: PreferencesWindowController!
|
||||||
var advPreferencesWinCtrl: AdvPreferencesWindowController!
|
var advPreferencesWinCtrl: AdvPreferencesWindowController!
|
||||||
|
var proxyPreferencesWinCtrl: ProxyPreferencesController!
|
||||||
|
|
||||||
var launchAtLoginController: LaunchAtLoginController = LaunchAtLoginController()
|
var launchAtLoginController: LaunchAtLoginController = LaunchAtLoginController()
|
||||||
|
|
||||||
@ -52,7 +53,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
"LocalSocks5.Timeout": NSNumber(unsignedInteger: 60),
|
"LocalSocks5.Timeout": NSNumber(unsignedInteger: 60),
|
||||||
"LocalSocks5.EnableUDPRelay": NSNumber(bool: false),
|
"LocalSocks5.EnableUDPRelay": NSNumber(bool: false),
|
||||||
"LocalSocks5.EnableVerboseMode": NSNumber(bool: false),
|
"LocalSocks5.EnableVerboseMode": NSNumber(bool: false),
|
||||||
"GFWListURL": "https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt"
|
"GFWListURL": "https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt",
|
||||||
|
"AutoConfigureNetworkServices": NSNumber(bool: true)
|
||||||
])
|
])
|
||||||
|
|
||||||
statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(20)
|
statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(20)
|
||||||
@ -63,6 +65,12 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
|
|
||||||
|
|
||||||
let notifyCenter = NSNotificationCenter.defaultCenter()
|
let notifyCenter = NSNotificationCenter.defaultCenter()
|
||||||
|
notifyCenter.addObserverForName(NOTIFY_ADV_PROXY_CONF_CHANGED, object: nil, queue: nil
|
||||||
|
, usingBlock: {
|
||||||
|
(note) in
|
||||||
|
self.applyConfig()
|
||||||
|
}
|
||||||
|
)
|
||||||
notifyCenter.addObserverForName(NOTIFY_SERVER_PROFILES_CHANGED, object: nil, queue: nil
|
notifyCenter.addObserverForName(NOTIFY_SERVER_PROFILES_CHANGED, object: nil, queue: nil
|
||||||
, usingBlock: {
|
, usingBlock: {
|
||||||
(note) in
|
(note) in
|
||||||
@ -272,6 +280,16 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserNotificationCenterDele
|
|||||||
ctrl.window?.makeKeyAndOrderFront(self)
|
ctrl.window?.makeKeyAndOrderFront(self)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@IBAction func editProxyPreferences(sender: NSObject) {
|
||||||
|
if proxyPreferencesWinCtrl != nil {
|
||||||
|
proxyPreferencesWinCtrl.close()
|
||||||
|
}
|
||||||
|
proxyPreferencesWinCtrl = ProxyPreferencesController(windowNibName: "ProxyPreferencesController")
|
||||||
|
proxyPreferencesWinCtrl.showWindow(self)
|
||||||
|
NSApp.activateIgnoringOtherApps(true)
|
||||||
|
proxyPreferencesWinCtrl.window?.makeKeyAndOrderFront(self)
|
||||||
|
}
|
||||||
|
|
||||||
@IBAction func selectServer(sender: NSMenuItem) {
|
@IBAction func selectServer(sender: NSMenuItem) {
|
||||||
let index = sender.tag
|
let index = sender.tag
|
||||||
let spMgr = ServerProfileManager.instance
|
let spMgr = ServerProfileManager.instance
|
||||||
|
@ -14,10 +14,10 @@
|
|||||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="ShadowsocksX_NG" customModuleProvider="target">
|
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="ShadowsocksX_NG" customModuleProvider="target">
|
||||||
<connections>
|
<connections>
|
||||||
<outlet property="RunningStatusMenuItem" destination="fzk-mE-CEV" id="R4x-gK-Qcw"/>
|
<outlet property="RunningStatusMenuItem" destination="fzk-mE-CEV" id="R4x-gK-Qcw"/>
|
||||||
<outlet property="autoModeMenuItem" destination="hOa-5N-3ik" id="en3-ni-jqC"/>
|
<outlet property="autoModeMenuItem" destination="r07-Gu-aEz" id="9aH-pQ-Rgi"/>
|
||||||
<outlet property="globalModeMenuItem" destination="3Sa-e9-VXX" id="UKI-yu-DEK"/>
|
<outlet property="globalModeMenuItem" destination="Mw3-Jm-eXA" id="ar5-Yx-3ze"/>
|
||||||
<outlet property="lanchAtLoginMenuItem" destination="eUq-p7-ICK" id="w4p-0c-DZn"/>
|
<outlet property="lanchAtLoginMenuItem" destination="eUq-p7-ICK" id="w4p-0c-DZn"/>
|
||||||
<outlet property="manualModeMenuItem" destination="vRc-N6-z1e" id="jp0-vj-pTX"/>
|
<outlet property="manualModeMenuItem" destination="8PR-gs-c5N" id="9qz-mU-5kt"/>
|
||||||
<outlet property="runningStatusMenuItem" destination="fzk-mE-CEV" id="Vwm-Rg-Ykn"/>
|
<outlet property="runningStatusMenuItem" destination="fzk-mE-CEV" id="Vwm-Rg-Ykn"/>
|
||||||
<outlet property="serversMenuItem" destination="u5M-hQ-VSc" id="8gp-SY-Y4U"/>
|
<outlet property="serversMenuItem" destination="u5M-hQ-VSc" id="8gp-SY-Y4U"/>
|
||||||
<outlet property="serversPreferencesMenuItem" destination="M5r-E7-44f" id="voe-SX-k6a"/>
|
<outlet property="serversPreferencesMenuItem" destination="M5r-E7-44f" id="voe-SX-k6a"/>
|
||||||
@ -38,23 +38,37 @@
|
|||||||
</connections>
|
</connections>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem isSeparatorItem="YES" id="LXP-yK-yQu"/>
|
<menuItem isSeparatorItem="YES" id="LXP-yK-yQu"/>
|
||||||
<menuItem title="Auto Mode By PAC" id="hOa-5N-3ik">
|
<menuItem title="Proxy" id="diI-fB-Rss">
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
<connections>
|
<menu key="submenu" title="Proxy" id="YZp-bf-L40">
|
||||||
<action selector="selectPACMode:" target="Voe-Tx-rLC" id="OwN-Md-pIC"/>
|
<items>
|
||||||
</connections>
|
<menuItem title="Auto Mode By PAC" id="r07-Gu-aEz">
|
||||||
</menuItem>
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
<menuItem title="Global Mode" id="3Sa-e9-VXX">
|
<connections>
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
<action selector="selectPACMode:" target="Voe-Tx-rLC" id="l36-cd-xl7"/>
|
||||||
<connections>
|
</connections>
|
||||||
<action selector="selectGlobalMode:" target="Voe-Tx-rLC" id="l4X-GP-hlH"/>
|
</menuItem>
|
||||||
</connections>
|
<menuItem title="Global Mode" id="Mw3-Jm-eXA">
|
||||||
</menuItem>
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
<menuItem title="Manual Mode" id="vRc-N6-z1e">
|
<connections>
|
||||||
<modifierMask key="keyEquivalentModifierMask"/>
|
<action selector="selectGlobalMode:" target="Voe-Tx-rLC" id="7QH-HB-B2e"/>
|
||||||
<connections>
|
</connections>
|
||||||
<action selector="selectManualMode:" target="Voe-Tx-rLC" id="vNk-P9-UQj"/>
|
</menuItem>
|
||||||
</connections>
|
<menuItem title="Manual Mode" id="8PR-gs-c5N">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="selectManualMode:" target="Voe-Tx-rLC" id="Xxb-28-6fi"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
<menuItem isSeparatorItem="YES" id="bMX-qn-Qwi"/>
|
||||||
|
<menuItem title="Advance Proxy Preference..." id="sbx-yz-3lO">
|
||||||
|
<modifierMask key="keyEquivalentModifierMask"/>
|
||||||
|
<connections>
|
||||||
|
<action selector="editProxyPreferences:" target="Voe-Tx-rLC" id="Jji-Ea-Sy8"/>
|
||||||
|
</connections>
|
||||||
|
</menuItem>
|
||||||
|
</items>
|
||||||
|
</menu>
|
||||||
</menuItem>
|
</menuItem>
|
||||||
<menuItem isSeparatorItem="YES" id="kkf-gh-O8t"/>
|
<menuItem isSeparatorItem="YES" id="kkf-gh-O8t"/>
|
||||||
<menuItem title="Servers" id="u5M-hQ-VSc">
|
<menuItem title="Servers" id="u5M-hQ-VSc">
|
||||||
|
@ -9,4 +9,5 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
let NOTIFY_SERVER_PROFILES_CHANGED = "NOTIFY_SERVER_PROFILES_CHANGED"
|
let NOTIFY_SERVER_PROFILES_CHANGED = "NOTIFY_SERVER_PROFILES_CHANGED"
|
||||||
|
let NOTIFY_ADV_PROXY_CONF_CHANGED = "NOTIFY_ADV_PROXY_CONF_CHANGED"
|
||||||
let NOTIFY_ADV_CONF_CHANGED = "NOTIFY_ADV_CONF_CHANGED"
|
let NOTIFY_ADV_CONF_CHANGED = "NOTIFY_ADV_CONF_CHANGED"
|
@ -99,19 +99,46 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
+ (void)addArguments4ManualSpecifyNetworkServices:(NSMutableArray*) args {
|
||||||
|
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
|
||||||
|
|
||||||
|
if (![defaults boolForKey:@"AutoConfigureNetworkServices"]) {
|
||||||
|
NSArray* serviceKeys = [defaults arrayForKey:@"Proxy4NetworkServices"];
|
||||||
|
if (serviceKeys) {
|
||||||
|
for (NSString* key in serviceKeys) {
|
||||||
|
[args addObject:@"--network-service"];
|
||||||
|
[args addObject:key];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+ (void)enablePACProxy {
|
+ (void)enablePACProxy {
|
||||||
NSString* urlString = [NSString stringWithFormat:@"%@/.ShadowsocksX-NG/gfwlist.js", NSHomeDirectory()];
|
NSString* urlString = [NSString stringWithFormat:@"%@/.ShadowsocksX-NG/gfwlist.js", NSHomeDirectory()];
|
||||||
NSURL* url = [NSURL fileURLWithPath:urlString];
|
NSURL* url = [NSURL fileURLWithPath:urlString];
|
||||||
[self callHelper:@[@"--mode", @"auto", @"--pac-url", [url absoluteString]]];
|
|
||||||
|
NSMutableArray* args = [@[@"--mode", @"auto", @"--pac-url", [url absoluteString]]mutableCopy];
|
||||||
|
|
||||||
|
[self addArguments4ManualSpecifyNetworkServices:args];
|
||||||
|
|
||||||
|
[self callHelper:args];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)enableGlobalProxy {
|
+ (void)enableGlobalProxy {
|
||||||
NSUInteger port = [[NSUserDefaults standardUserDefaults]integerForKey:@"LocalSocks5.ListenPort"];
|
NSUInteger port = [[NSUserDefaults standardUserDefaults]integerForKey:@"LocalSocks5.ListenPort"];
|
||||||
[self callHelper:@[@"--mode", @"global", @"--port", [NSString stringWithFormat:@"%lu", (unsigned long)port] ]];
|
|
||||||
|
NSMutableArray* args = [@[@"--mode", @"global", @"--port"
|
||||||
|
, [NSString stringWithFormat:@"%lu", (unsigned long)port]]mutableCopy];
|
||||||
|
|
||||||
|
[self addArguments4ManualSpecifyNetworkServices:args];
|
||||||
|
|
||||||
|
[self callHelper:args];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (void)disableProxy {
|
+ (void)disableProxy {
|
||||||
[self callHelper:@[@"--mode", @"off"]];
|
NSMutableArray* args = [@[@"--mode", @"off"]mutableCopy];
|
||||||
|
[self addArguments4ManualSpecifyNetworkServices:args];
|
||||||
|
[self callHelper:args];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
16
ShadowsocksX-NG/ProxyConfTool.h
Normal file
16
ShadowsocksX-NG/ProxyConfTool.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
//
|
||||||
|
// ProxyConfTool.h
|
||||||
|
// ShadowsocksX-NG
|
||||||
|
//
|
||||||
|
// Created by 邱宇舟 on 16/6/29.
|
||||||
|
// Copyright © 2016年 qiuyuzhou. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
|
||||||
|
|
||||||
|
@interface ProxyConfTool : NSObject
|
||||||
|
|
||||||
|
+(NSArray*)networkServicesList;
|
||||||
|
|
||||||
|
@end
|
52
ShadowsocksX-NG/ProxyConfTool.m
Normal file
52
ShadowsocksX-NG/ProxyConfTool.m
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
//
|
||||||
|
// ProxyConfTool.m
|
||||||
|
// ShadowsocksX-NG
|
||||||
|
//
|
||||||
|
// Created by 邱宇舟 on 16/6/29.
|
||||||
|
// Copyright © 2016年 qiuyuzhou. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#import "ProxyConfTool.h"
|
||||||
|
#import <SystemConfiguration/SystemConfiguration.h>
|
||||||
|
|
||||||
|
//https://developer.apple.com/library/mac/documentation/Networking/Conceptual/SystemConfigFrameworks/SC_Intro/SC_Intro.html
|
||||||
|
|
||||||
|
@implementation ProxyConfTool
|
||||||
|
|
||||||
|
|
||||||
|
+(NSArray*)networkServicesList {
|
||||||
|
NSMutableArray* results = [NSMutableArray array];
|
||||||
|
|
||||||
|
SCPreferencesRef prefRef = SCPreferencesCreate(nil, CFSTR("Shadowsocks"), nil);
|
||||||
|
NSDictionary *sets = (__bridge NSDictionary *)SCPreferencesGetValue(prefRef, kSCPrefNetworkServices);
|
||||||
|
// 遍历系统中的网络设备列表
|
||||||
|
for (NSString *key in [sets allKeys]) {
|
||||||
|
NSMutableDictionary *service = [sets objectForKey:key];
|
||||||
|
NSString *userDefinedName = [service valueForKey:(__bridge NSString *)kSCPropUserDefinedName];
|
||||||
|
// NSString *hardware = [service valueForKeyPath:@"Interface.Hardware"];
|
||||||
|
// NSString *deviceName = [service valueForKeyPath:@"Interface.DeviceName"];
|
||||||
|
// NSString *deviceType = [service valueForKeyPath:@"Interface.Type"];
|
||||||
|
|
||||||
|
BOOL isActive = ![service objectForKey:(NSString *)kSCResvInactive];
|
||||||
|
// NSLog(@"%@", hardware);
|
||||||
|
// NSLog(@"%@-------------------", key);
|
||||||
|
// for(NSString* key in service) {
|
||||||
|
// NSLog(@"key=%@ value=%@", key, [service objectForKey:key]);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
if (isActive) {
|
||||||
|
if (isActive && userDefinedName) {
|
||||||
|
NSDictionary* v = @{
|
||||||
|
@"key": key,
|
||||||
|
@"userDefinedName": userDefinedName,
|
||||||
|
};
|
||||||
|
[results addObject:v];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return results;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@end
|
93
ShadowsocksX-NG/ProxyPreferencesController.swift
Normal file
93
ShadowsocksX-NG/ProxyPreferencesController.swift
Normal file
@ -0,0 +1,93 @@
|
|||||||
|
//
|
||||||
|
// ProxyPreferencesController.swift
|
||||||
|
// ShadowsocksX-NG
|
||||||
|
//
|
||||||
|
// Created by 邱宇舟 on 16/6/29.
|
||||||
|
// Copyright © 2016年 qiuyuzhou. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
import Cocoa
|
||||||
|
|
||||||
|
class ProxyPreferencesController: NSWindowController, NSTableViewDataSource, NSTableViewDelegate {
|
||||||
|
|
||||||
|
var networkServices: NSArray!
|
||||||
|
var selectedNetworkServices: NSMutableSet!
|
||||||
|
|
||||||
|
var autoConfigureNetworkServices: Bool = true
|
||||||
|
|
||||||
|
@IBOutlet var autoConfigCheckBox: NSButton!
|
||||||
|
|
||||||
|
@IBOutlet var tableView: NSTableView!
|
||||||
|
|
||||||
|
override func windowDidLoad() {
|
||||||
|
super.windowDidLoad()
|
||||||
|
|
||||||
|
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
|
||||||
|
let defaults = NSUserDefaults.standardUserDefaults()
|
||||||
|
self.setValue(defaults.boolForKey("AutoConfigureNetworkServices"), forKey: "autoConfigureNetworkServices")
|
||||||
|
|
||||||
|
if let services = defaults.arrayForKey("Proxy4NetworkServices") {
|
||||||
|
selectedNetworkServices = NSMutableSet(array: services)
|
||||||
|
} else {
|
||||||
|
selectedNetworkServices = NSMutableSet()
|
||||||
|
}
|
||||||
|
|
||||||
|
networkServices = ProxyConfTool.networkServicesList()
|
||||||
|
tableView.reloadData()
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func ok(sender: NSObject){
|
||||||
|
ProxyConfHelper.disableProxy()
|
||||||
|
|
||||||
|
let defaults = NSUserDefaults.standardUserDefaults()
|
||||||
|
defaults.setValue(selectedNetworkServices.allObjects, forKeyPath: "Proxy4NetworkServices")
|
||||||
|
defaults.setBool(autoConfigureNetworkServices, forKey: "AutoConfigureNetworkServices")
|
||||||
|
|
||||||
|
defaults.synchronize()
|
||||||
|
|
||||||
|
window?.performClose(self)
|
||||||
|
|
||||||
|
NSNotificationCenter.defaultCenter()
|
||||||
|
.postNotificationName(NOTIFY_ADV_PROXY_CONF_CHANGED, object: nil)
|
||||||
|
}
|
||||||
|
|
||||||
|
@IBAction func cancel(sender: NSObject){
|
||||||
|
window?.performClose(self)
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------
|
||||||
|
// For NSTableViewDataSource
|
||||||
|
func numberOfRowsInTableView(tableView: NSTableView) -> Int {
|
||||||
|
if networkServices != nil {
|
||||||
|
return networkServices.count
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
func tableView(tableView: NSTableView, objectValueForTableColumn tableColumn: NSTableColumn?
|
||||||
|
, row: Int) -> AnyObject? {
|
||||||
|
let cell = tableColumn!.dataCell as! NSButtonCell
|
||||||
|
|
||||||
|
let key = networkServices[row]["key"] as! String
|
||||||
|
if selectedNetworkServices.containsObject(key) {
|
||||||
|
cell.state = 1
|
||||||
|
} else {
|
||||||
|
cell.state = 0
|
||||||
|
}
|
||||||
|
let userDefinedName = networkServices[row]["userDefinedName"] as! String
|
||||||
|
cell.title = userDefinedName
|
||||||
|
return cell
|
||||||
|
}
|
||||||
|
|
||||||
|
func tableView(tableView: NSTableView, setObjectValue object: AnyObject?
|
||||||
|
, forTableColumn tableColumn: NSTableColumn?, row: Int) {
|
||||||
|
let key = networkServices[row]["key"] as! String
|
||||||
|
|
||||||
|
// NSLog("%d", object!.integerValue)
|
||||||
|
if object!.integerValue == 1 {
|
||||||
|
selectedNetworkServices.addObject(key)
|
||||||
|
} else {
|
||||||
|
selectedNetworkServices.removeObject(key)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
119
ShadowsocksX-NG/ProxyPreferencesController.xib
Normal file
119
ShadowsocksX-NG/ProxyPreferencesController.xib
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
|
||||||
|
<dependencies>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
|
||||||
|
</dependencies>
|
||||||
|
<objects>
|
||||||
|
<customObject id="-2" userLabel="File's Owner" customClass="ProxyPreferencesController" customModule="ShadowsocksX_NG" customModuleProvider="target">
|
||||||
|
<connections>
|
||||||
|
<outlet property="autoConfigCheckBox" destination="al4-wo-BVS" id="y3x-oN-Wn7"/>
|
||||||
|
<outlet property="tableView" destination="tdp-Lr-L64" id="yJ0-tP-gVw"/>
|
||||||
|
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
|
||||||
|
</connections>
|
||||||
|
</customObject>
|
||||||
|
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||||
|
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||||
|
<window title="Advance Proxy Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||||
|
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||||
|
<rect key="contentRect" x="503" y="308" width="298" height="311"/>
|
||||||
|
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
|
||||||
|
<view key="contentView" id="se5-gp-TjO">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="298" height="311"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
<subviews>
|
||||||
|
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="al4-wo-BVS">
|
||||||
|
<rect key="frame" x="18" y="275" width="262" height="18"/>
|
||||||
|
<buttonCell key="cell" type="check" title="Auto Configure" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="FLv-D9-CRw">
|
||||||
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<binding destination="-2" name="value" keyPath="autoConfigureNetworkServices" id="SgV-RH-wUe"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
|
<scrollView fixedFrame="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="657-dv-Val">
|
||||||
|
<rect key="frame" x="20" y="61" width="258" height="199"/>
|
||||||
|
<clipView key="contentView" ambiguous="YES" id="i6C-d3-Rpb">
|
||||||
|
<rect key="frame" x="1" y="1" width="256" height="197"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" columnSelection="YES" multipleSelection="NO" autosaveColumns="NO" id="tdp-Lr-L64">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="256" height="197"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
<size key="intercellSpacing" width="3" height="2"/>
|
||||||
|
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
<color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
<tableColumns>
|
||||||
|
<tableColumn width="253" minWidth="40" maxWidth="1000" id="26S-Kb-zSc">
|
||||||
|
<tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border">
|
||||||
|
<font key="font" metaFont="smallSystem"/>
|
||||||
|
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
<color key="backgroundColor" name="headerColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
</tableHeaderCell>
|
||||||
|
<buttonCell key="dataCell" type="check" title="Check" bezelStyle="regularSquare" imagePosition="left" inset="2" id="ucF-02-bm8">
|
||||||
|
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
</buttonCell>
|
||||||
|
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
|
||||||
|
<connections>
|
||||||
|
<binding destination="-2" name="enabled" keyPath="autoConfigureNetworkServices" id="XkV-FH-93a">
|
||||||
|
<dictionary key="options">
|
||||||
|
<string key="NSValueTransformerName">NSNegateBoolean</string>
|
||||||
|
</dictionary>
|
||||||
|
</binding>
|
||||||
|
</connections>
|
||||||
|
</tableColumn>
|
||||||
|
</tableColumns>
|
||||||
|
<connections>
|
||||||
|
<outlet property="dataSource" destination="-2" id="e18-9E-A4F"/>
|
||||||
|
<outlet property="delegate" destination="-2" id="8UX-DB-agU"/>
|
||||||
|
</connections>
|
||||||
|
</tableView>
|
||||||
|
</subviews>
|
||||||
|
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||||
|
</clipView>
|
||||||
|
<scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="3sC-hI-IvB">
|
||||||
|
<rect key="frame" x="1" y="119" width="223" height="15"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
</scroller>
|
||||||
|
<scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="6OR-N8-MXx">
|
||||||
|
<rect key="frame" x="224" y="17" width="15" height="102"/>
|
||||||
|
<autoresizingMask key="autoresizingMask"/>
|
||||||
|
</scroller>
|
||||||
|
</scrollView>
|
||||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ulk-V7-E4w">
|
||||||
|
<rect key="frame" x="203" y="13" width="81" height="32"/>
|
||||||
|
<buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="rWE-M6-TvV">
|
||||||
|
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
<string key="keyEquivalent" base64-UTF8="YES">
|
||||||
|
DQ
|
||||||
|
</string>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="ok:" target="-2" id="GTx-sb-ino"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
|
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="NVO-zo-7QI">
|
||||||
|
<rect key="frame" x="122" y="13" width="81" height="32"/>
|
||||||
|
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="lsQ-1C-OhG">
|
||||||
|
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||||
|
<font key="font" metaFont="system"/>
|
||||||
|
<string key="keyEquivalent" base64-UTF8="YES">
|
||||||
|
Gw
|
||||||
|
</string>
|
||||||
|
</buttonCell>
|
||||||
|
<connections>
|
||||||
|
<action selector="cancel:" target="-2" id="bId-aB-i6V"/>
|
||||||
|
</connections>
|
||||||
|
</button>
|
||||||
|
</subviews>
|
||||||
|
</view>
|
||||||
|
<connections>
|
||||||
|
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
|
||||||
|
</connections>
|
||||||
|
<point key="canvasLocation" x="360" y="335.5"/>
|
||||||
|
</window>
|
||||||
|
<userDefaultsController representsSharedInstance="YES" id="vMm-BK-U3M"/>
|
||||||
|
</objects>
|
||||||
|
</document>
|
@ -7,4 +7,5 @@
|
|||||||
#import "LaunchAtLoginController.h"
|
#import "LaunchAtLoginController.h"
|
||||||
#import "SWBQRCodeWindowController.h"
|
#import "SWBQRCodeWindowController.h"
|
||||||
#import "Utils.h"
|
#import "Utils.h"
|
||||||
#import "ProxyConfHelper.h"
|
#import "ProxyConfHelper.h"
|
||||||
|
#import "ProxyConfTool.h"
|
@ -9,6 +9,6 @@
|
|||||||
#ifndef proxy_conf_helper_version_h
|
#ifndef proxy_conf_helper_version_h
|
||||||
#define proxy_conf_helper_version_h
|
#define proxy_conf_helper_version_h
|
||||||
|
|
||||||
#define kProxyConfHelperVersion @"1.1.0"
|
#define kProxyConfHelperVersion @"1.2.0"
|
||||||
|
|
||||||
#endif /* proxy_conf_helper_version_h */
|
#endif /* proxy_conf_helper_version_h */
|
||||||
|
@ -45,6 +45,11 @@ int main(int argc, const char * argv[])
|
|||||||
[options addOption:"pac-url" flag:'u' description:@"PAC file url for auto mode." argument:&pacURL];
|
[options addOption:"pac-url" flag:'u' description:@"PAC file url for auto mode." argument:&pacURL];
|
||||||
[options addOption:"port" flag:'p' description:@"Listen port for global mode." argument:&portString];
|
[options addOption:"port" flag:'p' description:@"Listen port for global mode." argument:&portString];
|
||||||
|
|
||||||
|
NSMutableSet* networkServiceKeys = [NSMutableSet set];
|
||||||
|
[options addOption:"network-service" flag:'n' description:@"Manual specify the network profile need to set proxy." blockWithArgument:^(NSString* value){
|
||||||
|
[networkServiceKeys addObject:value];
|
||||||
|
}];
|
||||||
|
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
if (![options parseArgc:argc argv:argv error:&error]) {
|
if (![options parseArgc:argc argv:argv error:&error]) {
|
||||||
const char * message = error.localizedDescription.UTF8String;
|
const char * message = error.localizedDescription.UTF8String;
|
||||||
@ -108,7 +113,18 @@ int main(int argc, const char * argv[])
|
|||||||
NSMutableDictionary *dict = [sets objectForKey:key];
|
NSMutableDictionary *dict = [sets objectForKey:key];
|
||||||
NSString *hardware = [dict valueForKeyPath:@"Interface.Hardware"];
|
NSString *hardware = [dict valueForKeyPath:@"Interface.Hardware"];
|
||||||
// NSLog(@"%@", hardware);
|
// NSLog(@"%@", hardware);
|
||||||
if ([hardware isEqualToString:@"AirPort"] || [hardware isEqualToString:@"Wi-Fi"] || [hardware isEqualToString:@"Ethernet"]) {
|
BOOL modify = NO;
|
||||||
|
if ([networkServiceKeys count] > 0) {
|
||||||
|
if ([networkServiceKeys containsObject:key]) {
|
||||||
|
modify = YES;
|
||||||
|
}
|
||||||
|
} else if ([hardware isEqualToString:@"AirPort"]
|
||||||
|
|| [hardware isEqualToString:@"Wi-Fi"]
|
||||||
|
|| [hardware isEqualToString:@"Ethernet"]) {
|
||||||
|
modify = YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modify) {
|
||||||
|
|
||||||
if ([mode isEqualToString:@"auto"]) {
|
if ([mode isEqualToString:@"auto"]) {
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user