瀏覽代碼

Fixes bug in proxy_conf_helper.

Qiu Yuzhou 5 年之前
父節點
當前提交
6742b03005
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 1 1
      ShadowsocksX-NG/proxy_conf_helper_version.h
  2. 2 2
      proxy_conf_helper/main.m

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

+ 2 - 2
proxy_conf_helper/main.m

@@ -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]])
                             ) {
                             ) {