@@ -1,3 +1,8 @@ | |||||
4.3.2.0 2020-11-05 | |||||
- PAC: direct connection for private IP ranges by @studentmain (#3008) | |||||
- Remove duplicate startup entries (#3012) | |||||
- Other minor bug fixes and improvements | |||||
4.3.1.0 2020-10-25 | 4.3.1.0 2020-10-25 | ||||
- Update abp.js (#2999) | - Update abp.js (#2999) | ||||
- Separate QR code scanning from MenuViewController (#2995) | - Separate QR code scanning from MenuViewController (#2995) | ||||
@@ -793,7 +793,22 @@ for (var i = 0; i < rules.length; i++) { | |||||
defaultMatcher.add(Filter.fromText(rules[i])); | defaultMatcher.add(Filter.fromText(rules[i])); | ||||
} | } | ||||
// PAC has no v6 support, it sucks | |||||
var ip4Re = /^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$/ | |||||
var privateNet = [ | |||||
["10.0.0.0", "255.0.0.0"], | |||||
["127.0.0.0", "255.0.0.0"], | |||||
["172.16.0.0", "255.240.0.0"], | |||||
["192.168.0.0", "255.255.0.0"], | |||||
] | |||||
function FindProxyForURL(url, host) { | function FindProxyForURL(url, host) { | ||||
if (host.match(ip4Re)) { | |||||
for (var i = 0; i < privateNet.length; i++) { | |||||
if (isInNet(host, privateNet[i][0], privateNet[i][1])) return direct; | |||||
} | |||||
} | |||||
if (userrulesMatcher.matchesAny(url, host) instanceof BlockingFilter) { | if (userrulesMatcher.matchesAny(url, host) instanceof BlockingFilter) { | ||||
return proxy; | return proxy; | ||||
} | } | ||||
@@ -71,23 +71,23 @@ namespace Shadowsocks.WPF.Behaviors | |||||
logger.Error(@"Cannot find HKCU\Software\Microsoft\Windows\CurrentVersion\Run"); | logger.Error(@"Cannot find HKCU\Software\Microsoft\Windows\CurrentVersion\Run"); | ||||
return false; | return false; | ||||
} | } | ||||
string[] runList = runKey.GetValueNames(); | |||||
foreach (string item in runList) | |||||
var check = false; | |||||
foreach (var valueName in runKey.GetValueNames()) | |||||
{ | { | ||||
if (item.Equals(Key, StringComparison.OrdinalIgnoreCase)) | |||||
return true; | |||||
else if (item.Equals("Shadowsocks", StringComparison.OrdinalIgnoreCase)) // Compatibility with older versions | |||||
if (valueName.Equals(Key, StringComparison.InvariantCultureIgnoreCase)) | |||||
{ | { | ||||
string value = Convert.ToString(runKey.GetValue(item)); | |||||
if (Program.ExecutablePath.Equals(value, StringComparison.OrdinalIgnoreCase)) | |||||
{ | |||||
runKey.DeleteValue(item); | |||||
runKey.SetValue(Key, Program.ExecutablePath); | |||||
return true; | |||||
} | |||||
check = true; | |||||
continue; | |||||
} | |||||
// Remove other startup keys with the same executable path. fixes #3011 and also assures compatibility with older versions | |||||
if (Program.ExecutablePath.Equals(runKey.GetValue(valueName).ToString(), StringComparison.InvariantCultureIgnoreCase)) | |||||
{ | |||||
runKey.DeleteValue(valueName); | |||||
runKey.SetValue(Key, Program.ExecutablePath); | |||||
check = true; | |||||
} | } | ||||
} | } | ||||
return false; | |||||
return check; | |||||
} | } | ||||
catch (Exception e) | catch (Exception e) | ||||
{ | { | ||||
@@ -119,13 +119,12 @@ namespace Shadowsocks.WPF.Services | |||||
public string ExpandEnvironmentVariables(string name, StringDictionary environmentVariables = null) | public string ExpandEnvironmentVariables(string name, StringDictionary environmentVariables = null) | ||||
{ | { | ||||
name = name.ToLower(); | |||||
// Expand the environment variables from the new process itself | // Expand the environment variables from the new process itself | ||||
if (environmentVariables != null) | if (environmentVariables != null) | ||||
{ | { | ||||
foreach(string key in environmentVariables.Keys) | foreach(string key in environmentVariables.Keys) | ||||
{ | { | ||||
name = name.Replace($"%{key.ToLower()}%", environmentVariables[key]); | |||||
name = name.Replace($"%{key}%", environmentVariables[key], StringComparison.OrdinalIgnoreCase); | |||||
} | } | ||||
} | } | ||||
// Also expand the environment variables from current main process (system) | // Also expand the environment variables from current main process (system) | ||||
@@ -11,7 +11,7 @@ | |||||
# version format | # version format | ||||
# Build version format is taken from UI if it is not set | # Build version format is taken from UI if it is not set | ||||
version: 4.3.1.{build} | |||||
version: 4.3.2.{build} | |||||
# # branches to build | # # branches to build | ||||
# branches: | # branches: | ||||
@@ -102,6 +102,10 @@ namespace Shadowsocks.Controller | |||||
ProgramUpdated += (o, e) => | ProgramUpdated += (o, e) => | ||||
{ | { | ||||
// version update precedures | |||||
if (e.OldVersion == "4.3.0.0" || e.OldVersion == "4.3.1.0") | |||||
_config.geositeDirectGroups.Add("private"); | |||||
logger.Info($"Updated from {e.OldVersion} to {e.NewVersion}"); | logger.Info($"Updated from {e.OldVersion} to {e.NewVersion}"); | ||||
}; | }; | ||||
} | } | ||||
@@ -86,12 +86,13 @@ namespace Shadowsocks.Model | |||||
geositeUrl = ""; | geositeUrl = ""; | ||||
geositeDirectGroups = new List<string>() | geositeDirectGroups = new List<string>() | ||||
{ | { | ||||
"private", | |||||
"cn", | "cn", | ||||
"geolocation-!cn@cn" | |||||
"geolocation-!cn@cn", | |||||
}; | }; | ||||
geositeProxiedGroups = new List<string>() | geositeProxiedGroups = new List<string>() | ||||
{ | { | ||||
"geolocation-!cn" | |||||
"geolocation-!cn", | |||||
}; | }; | ||||
geositePreferDirect = false; | geositePreferDirect = false; | ||||
userAgent = "ShadowsocksWindows/$version"; | userAgent = "ShadowsocksWindows/$version"; | ||||
@@ -308,6 +309,7 @@ namespace Shadowsocks.Model | |||||
public static void ResetGeositeDirectGroup(ref List<string> geositeDirectGroups) | public static void ResetGeositeDirectGroup(ref List<string> geositeDirectGroups) | ||||
{ | { | ||||
geositeDirectGroups.Clear(); | geositeDirectGroups.Clear(); | ||||
geositeDirectGroups.Add("private"); | |||||
geositeDirectGroups.Add("cn"); | geositeDirectGroups.Add("cn"); | ||||
geositeDirectGroups.Add("geolocation-!cn@cn"); | geositeDirectGroups.Add("geolocation-!cn@cn"); | ||||
} | } | ||||