Fixes bug in proxy_conf_helper.

This commit is contained in:
Qiu Yuzhou
2019-09-15 19:26:07 +08:00
parent 331fedef34
commit 6742b03005
2 changed files with 3 additions and 3 deletions

View File

@ -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.8.0" #define kProxyConfHelperVersion @"1.8.2"
#endif /* proxy_conf_helper_version_h */ #endif /* proxy_conf_helper_version_h */

View File

@ -188,7 +188,7 @@ int main(int argc, const char * argv[])
SCPreferencesPathSetValue(prefRef, (__bridge CFStringRef)prefPath SCPreferencesPathSetValue(prefRef, (__bridge CFStringRef)prefPath
, (__bridge CFDictionaryRef)proxies); , (__bridge CFDictionaryRef)proxies);
} else if ([mode isEqualToString:@"off"]) { } else if ([mode isEqualToString:@"off"]) {
if (pacURL != nil && portString != nil) { if (pacURL != nil && portString != nil && socks5ListenAddress != nil) {
// shadowsocksX-NG // shadowsocksX-NG
NSDictionary* oldProxies NSDictionary* oldProxies
= (__bridge NSDictionary*)SCPreferencesPathGetValue(prefRef = (__bridge NSDictionary*)SCPreferencesPathGetValue(prefRef
@ -196,7 +196,7 @@ int main(int argc, const char * argv[])
if (([oldProxies[(NSString *)kCFNetworkProxiesProxyAutoConfigURLString] isEqualToString:pacURL] if (([oldProxies[(NSString *)kCFNetworkProxiesProxyAutoConfigURLString] isEqualToString:pacURL]
&&[oldProxies[(NSString *)kCFNetworkProxiesProxyAutoConfigEnable] isEqual:[NSNumber numberWithInt:1]]) &&[oldProxies[(NSString *)kCFNetworkProxiesProxyAutoConfigEnable] isEqual:[NSNumber numberWithInt:1]])
||([oldProxies[(NSString*)kCFNetworkProxiesSOCKSProxy] isEqualToString:@"127.0.0.1"] ||([oldProxies[(NSString*)kCFNetworkProxiesSOCKSProxy] isEqualToString:socks5ListenAddress]
&&[oldProxies[(NSString*)kCFNetworkProxiesSOCKSPort] isEqualTo:[NSNumber numberWithInteger:port]] &&[oldProxies[(NSString*)kCFNetworkProxiesSOCKSPort] isEqualTo:[NSNumber numberWithInteger:port]]
&&[oldProxies[(NSString*)kCFNetworkProxiesSOCKSEnable] isEqual:[NSNumber numberWithInt:1]]) &&[oldProxies[(NSString*)kCFNetworkProxiesSOCKSEnable] isEqual:[NSNumber numberWithInt:1]])
) { ) {