Optimizing Subscription Update
This commit is contained in:
@@ -75,9 +75,11 @@ namespace ClashN.Handler
|
||||
try
|
||||
{
|
||||
Utils.SetSecurityProtocol(LazyConfig.Instance.Config.EnableSecurityProtocolTls13);
|
||||
var webProxy = GetWebProxy(blProxy);
|
||||
var client = new HttpClient(new SocketsHttpHandler()
|
||||
{
|
||||
Proxy = GetWebProxy(blProxy)
|
||||
Proxy = webProxy,
|
||||
UseProxy = webProxy != null
|
||||
});
|
||||
|
||||
if (string.IsNullOrEmpty(userAgent))
|
||||
|
||||
@@ -173,14 +173,14 @@ namespace ClashN.Handler
|
||||
Task.Run(async () =>
|
||||
{
|
||||
//Turn off system proxy
|
||||
bool bSysProxyType = false;
|
||||
if (!blProxy && config.SysProxyType == SysProxyType.ForcedChange)
|
||||
{
|
||||
bSysProxyType = true;
|
||||
config.SysProxyType = SysProxyType.ForcedClear;
|
||||
SysProxyHandle.UpdateSysProxy(config, false);
|
||||
Thread.Sleep(3000);
|
||||
}
|
||||
//bool bSysProxyType = false;
|
||||
//if (!blProxy && config.SysProxyType == SysProxyType.ForcedChange)
|
||||
//{
|
||||
// bSysProxyType = true;
|
||||
// config.SysProxyType = SysProxyType.ForcedClear;
|
||||
// SysProxyHandle.UpdateSysProxy(config, false);
|
||||
// Thread.Sleep(3000);
|
||||
//}
|
||||
|
||||
if (profileItems == null)
|
||||
{
|
||||
@@ -280,11 +280,11 @@ namespace ClashN.Handler
|
||||
|
||||
}
|
||||
//restore system proxy
|
||||
if (bSysProxyType)
|
||||
{
|
||||
config.SysProxyType = SysProxyType.ForcedChange;
|
||||
SysProxyHandle.UpdateSysProxy(config, false);
|
||||
}
|
||||
//if (bSysProxyType)
|
||||
//{
|
||||
// config.SysProxyType = SysProxyType.ForcedChange;
|
||||
// SysProxyHandle.UpdateSysProxy(config, false);
|
||||
//}
|
||||
_updateFunc(true, $"{ResUI.MsgUpdateSubscriptionEnd}");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MaterialDesignThemes" Version="4.8.0" />
|
||||
<PackageReference Include="MaterialDesignThemes" Version="4.7.1" />
|
||||
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="NHotkey" Version="2.1.0" />
|
||||
<PackageReference Include="NHotkey.Wpf" Version="2.1.0" />
|
||||
<PackageReference Include="QRCoder.Xaml" Version="1.4.3" />
|
||||
<PackageReference Include="TaskScheduler" Version="2.10.1" />
|
||||
<PackageReference Include="YamlDotNet" Version="13.0.1" />
|
||||
<PackageReference Include="YamlDotNet" Version="13.0.2" />
|
||||
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
|
||||
<PackageReference Include="ReactiveUI.Fody" Version="18.3.1" />
|
||||
<PackageReference Include="ReactiveUI.Validation" Version="3.0.1" />
|
||||
|
||||
Reference in New Issue
Block a user