Code clean

This commit is contained in:
2dust
2026-07-11 17:43:32 +08:00
parent 3ca49dd9db
commit 994bc1ca6a
6 changed files with 26 additions and 23 deletions

View File

@@ -164,7 +164,7 @@ public static class ConfigHandler
config.ClashUIItem.ConnectionsColumnItem ??= [];
config.SystemProxyItem ??= new();
config.WebDavItem ??= new();
config.CheckUpdateItem ??= new();
config.CheckUpdateItem ??= new();
config.Fragment4RayItem ??= new()
{
Packets = "tlshello",

View File

@@ -288,6 +288,7 @@ public class CertPemManager
collection.ImportFromPem(pemText);
return collection;
});
private static readonly Lazy<X509Certificate2Collection> _mozillaRootCerts = new(() =>
{
var pemText = EmbedUtils.GetEmbedText(Global.MozillaRootCertFileName);
@@ -295,6 +296,7 @@ public class CertPemManager
collection.ImportFromPem(pemText);
return collection;
});
private X509Certificate2Collection BuildTrustedCertificateCollection()
{
if (_config.GuiItem.RootCertProvider == Global.ChromeRootProvider)

View File

@@ -8,8 +8,10 @@ public class CoreManager
private static readonly Lazy<CoreManager> _instance = new(() => new());
public static CoreManager Instance => _instance.Value;
private Config _config;
[SupportedOSPlatform("windows")]
private WindowsJobService? _processJob;
private ProcessService? _processService;
private ProcessService? _processPreService;
private bool _linuxSudo = false;

View File

@@ -149,7 +149,7 @@ namespace ServiceLib.Resx {
return ResourceManager.GetString("Downloading", resourceCulture);
}
}
/// <summary>
/// 查找类似 Failed to convert configuration file 的本地化字符串。
/// </summary>
@@ -321,6 +321,15 @@ namespace ServiceLib.Resx {
}
}
/// <summary>
/// 查找类似 Please enter valid HTTP request headers JSON. 的本地化字符串。
/// </summary>
public static string InvalidHttpOutboundHeaders {
get {
return ResourceManager.GetString("InvalidHttpOutboundHeaders", resourceCulture);
}
}
/// <summary>
/// 查找类似 Invalid Realm URL. 的本地化字符串。
/// </summary>
@@ -330,15 +339,6 @@ namespace ServiceLib.Resx {
}
}
/// <summary>
/// 查找类似 Please enter valid HTTP request headers JSON. 的本地化字符串。
/// </summary>
public static string InvalidHttpOutboundHeaders {
get {
return ResourceManager.GetString("InvalidHttpOutboundHeaders", resourceCulture);
}
}
/// <summary>
/// 查找类似 Invalid address (URL) 的本地化字符串。
/// </summary>
@@ -3231,15 +3231,6 @@ namespace ServiceLib.Resx {
}
}
/// <summary>
/// 查找类似 HTTP headers 的本地化字符串。
/// </summary>
public static string TbHttpOutboundHeaders {
get {
return ResourceManager.GetString("TbHttpOutboundHeaders", resourceCulture);
}
}
/// <summary>
/// 查找类似 Port hopping interval 的本地化字符串。
/// </summary>
@@ -3258,6 +3249,15 @@ namespace ServiceLib.Resx {
}
}
/// <summary>
/// 查找类似 HTTP headers 的本地化字符串。
/// </summary>
public static string TbHttpOutboundHeaders {
get {
return ResourceManager.GetString("TbHttpOutboundHeaders", resourceCulture);
}
}
/// <summary>
/// 查找类似 Realm URL 的本地化字符串。
/// </summary>
@@ -5012,7 +5012,7 @@ namespace ServiceLib.Resx {
return ResourceManager.GetString("TipHttpOutboundHeaders", resourceCulture);
}
}
/// <summary>
/// 查找类似 *Default value raw 的本地化字符串。
/// </summary>

View File

@@ -175,7 +175,7 @@ public partial class CoreConfigV2rayService
outbound.settings.address = _node.Address;
outbound.settings.port = _node.Port;
if(protocolExtra.HttpHeaders.IsNotEmpty())
if (protocolExtra.HttpHeaders.IsNotEmpty())
{
outbound.settings.headers = JsonUtils.ParseJson(protocolExtra.HttpHeaders);
}

View File

@@ -1,5 +1,4 @@
using System.Net.Http.Headers;
using System.Reflection.Metadata;
namespace ServiceLib.Services;