Browse Source

🔀 Merge branch 'master' into v5/master

pull/3006/head
database64128 3 years ago
parent
commit
d3c3142dbd
No known key found for this signature in database GPG Key ID: 1CA27546BEDB8B01
7 changed files with 43 additions and 18 deletions
  1. +5
    -0
      CHANGES
  2. +15
    -0
      Shadowsocks.PAC/Resources/abp.js
  3. +13
    -13
      Shadowsocks.WPF/Behaviors/AutoStartup.cs
  4. +1
    -2
      Shadowsocks.WPF/Services/Sip003Plugin.cs
  5. +1
    -1
      appveyor.yml
  6. +4
    -0
      shadowsocks-csharp/Controller/ShadowsocksController.cs
  7. +4
    -2
      shadowsocks-csharp/Model/Configuration.cs

+ 5
- 0
CHANGES View File

@@ -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
- Update abp.js (#2999)
- Separate QR code scanning from MenuViewController (#2995)


+ 15
- 0
Shadowsocks.PAC/Resources/abp.js View File

@@ -793,7 +793,22 @@ for (var i = 0; i < rules.length; 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) {
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) {
return proxy;
}


+ 13
- 13
Shadowsocks.WPF/Behaviors/AutoStartup.cs View File

@@ -71,23 +71,23 @@ namespace Shadowsocks.WPF.Behaviors
logger.Error(@"Cannot find HKCU\Software\Microsoft\Windows\CurrentVersion\Run");
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)
{


+ 1
- 2
Shadowsocks.WPF/Services/Sip003Plugin.cs View File

@@ -119,13 +119,12 @@ namespace Shadowsocks.WPF.Services

public string ExpandEnvironmentVariables(string name, StringDictionary environmentVariables = null)
{
name = name.ToLower();
// Expand the environment variables from the new process itself
if (environmentVariables != null)
{
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)


+ 1
- 1
appveyor.yml View File

@@ -11,7 +11,7 @@
# version format
# 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:


+ 4
- 0
shadowsocks-csharp/Controller/ShadowsocksController.cs View File

@@ -102,6 +102,10 @@ namespace Shadowsocks.Controller
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}");
};
}


+ 4
- 2
shadowsocks-csharp/Model/Configuration.cs View File

@@ -86,12 +86,13 @@ namespace Shadowsocks.Model
geositeUrl = "";
geositeDirectGroups = new List<string>()
{
"private",
"cn",
"geolocation-!cn@cn"
"geolocation-!cn@cn",
};
geositeProxiedGroups = new List<string>()
{
"geolocation-!cn"
"geolocation-!cn",
};
geositePreferDirect = false;
userAgent = "ShadowsocksWindows/$version";
@@ -308,6 +309,7 @@ namespace Shadowsocks.Model
public static void ResetGeositeDirectGroup(ref List<string> geositeDirectGroups)
{
geositeDirectGroups.Clear();
geositeDirectGroups.Add("private");
geositeDirectGroups.Add("cn");
geositeDirectGroups.Add("geolocation-!cn@cn");
}


Loading…
Cancel
Save