Compare commits

..

3 commits

Author SHA1 Message Date
DHR60
69d027840e Fix 2026-02-15 21:50:29 +08:00
DHR60
84a1eb8445 Optimize ProfileItem acquisition speed 2026-02-15 16:48:44 +08:00
DHR60
f900ce7f3f Fix 2026-02-15 16:48:44 +08:00
2 changed files with 13 additions and 11 deletions

View file

@ -187,10 +187,10 @@ public static class CoreConfigHandler
var newItems = new List<ProfileItem> { node };
if (node.ConfigType.IsGroupType())
{
var groupChildList = await GroupProfileManager.GetAllChildProfileItems(node);
foreach (var childItem in groupChildList)
var (groupChildList, _) = await GroupProfileManager.GetChildProfileItems(node);
foreach (var childItem in groupChildList.Where(childItem => !context.AllProxiesMap.ContainsKey(childItem.IndexId)))
{
context.AllProxiesMap[childItem.IndexId] = childItem;
await FillNodeContext(context, childItem, false);
}
node.SetProtocolExtra(node.GetProtocolExtra() with
{

View file

@ -433,15 +433,17 @@ public partial class CoreConfigSingboxService
{
GenDnsProtectCustom();
var localDnsServer = _coreConfig.dns?.servers?.FirstOrDefault(s => s.tag == Global.SingboxLocalDNSTag);
if (localDnsServer == null)
{
return;
}
localDnsServer.type = null;
localDnsServer.server = null;
_coreConfig.dns?.servers?.RemoveAll(s => s.tag == Global.SingboxLocalDNSTag);
var dnsItem = context.RawDnsItem;
localDnsServer.address = string.IsNullOrEmpty(dnsItem?.DomainDNSAddress) ? Global.DomainPureIPDNSAddress.FirstOrDefault() : dnsItem?.DomainDNSAddress;
var localDnsServer = new Server4Sbox()
{
address = string.IsNullOrEmpty(dnsItem?.DomainDNSAddress)
? Global.DomainPureIPDNSAddress.FirstOrDefault()
: dnsItem?.DomainDNSAddress,
tag = Global.SingboxLocalDNSTag,
detour = Global.DirectTag,
};
_coreConfig.dns?.servers?.Add(localDnsServer);
}
private Rule4Sbox BuildProtectDomainRule()