Compare commits

..

1 commit

Author SHA1 Message Date
DHR60
2308f63da8 Fix fragment 2026-02-25 08:54:43 +08:00
7 changed files with 9 additions and 19 deletions

View file

@ -99,12 +99,7 @@ public static class CoreConfigHandler
var nodes = await AppManager.Instance.GetProfileItemsByIndexIds(ids); var nodes = await AppManager.Instance.GetProfileItemsByIndexIds(ids);
foreach (var node in nodes) foreach (var node in nodes)
{ {
var actNode = await FillNodeContext(context, node, true); await FillNodeContext(context, node, false);
if (node.IndexId == actNode.IndexId)
{
continue;
}
context.ServerTestItemMap[node.IndexId] = actNode.IndexId;
} }
if (coreType == ECoreType.sing_box) if (coreType == ECoreType.sing_box)
{ {

View file

@ -66,7 +66,7 @@ public class Hysteria2Fmt : BaseFmt
if (!item.CertSha.IsNullOrEmpty()) if (!item.CertSha.IsNullOrEmpty())
{ {
var sha = item.CertSha; var sha = item.CertSha;
var idx = sha.IndexOf(','); var idx = sha.IndexOf('~');
if (idx > 0) if (idx > 0)
{ {
sha = sha[..idx]; sha = sha[..idx];

View file

@ -10,9 +10,6 @@ public record CoreConfigContext
public Config AppConfig { get; init; } = new(); public Config AppConfig { get; init; } = new();
public FullConfigTemplateItem? FullConfigTemplate { get; init; } = new(); public FullConfigTemplateItem? FullConfigTemplate { get; init; } = new();
// Test ServerTestItem Map
public Dictionary<string, string> ServerTestItemMap { get; init; } = new();
// TUN Compatibility // TUN Compatibility
public bool IsTunEnabled { get; init; } = false; public bool IsTunEnabled { get; init; } = false;
public HashSet<string> ProtectDomainList { get; init; } = new(); public HashSet<string> ProtectDomainList { get; init; } = new();

View file

@ -122,9 +122,8 @@ public partial class CoreConfigSingboxService(CoreConfigContext context)
{ {
continue; continue;
} }
var actIndexId = context.ServerTestItemMap.GetValueOrDefault(it.IndexId, it.IndexId); var item = context.AllProxiesMap.GetValueOrDefault(it.IndexId);
var item = context.AllProxiesMap.GetValueOrDefault(actIndexId); if (item is null || item.IsComplex() || !item.IsValid())
if (item is null || item.ConfigType is EConfigType.Custom || !item.IsValid())
{ {
continue; continue;
} }

View file

@ -120,9 +120,8 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
{ {
continue; continue;
} }
var actIndexId = context.ServerTestItemMap.GetValueOrDefault(it.IndexId, it.IndexId); var item = context.AllProxiesMap.GetValueOrDefault(it.IndexId);
var item = context.AllProxiesMap.GetValueOrDefault(actIndexId); if (item is null || item.IsComplex() || !item.IsValid())
if (item is null || item.ConfigType is EConfigType.Custom || !item.IsValid())
{ {
continue; continue;
} }

View file

@ -31,7 +31,7 @@ public partial class CoreConfigV2rayService
var fragmentOutbound = new Outbounds4Ray var fragmentOutbound = new Outbounds4Ray
{ {
protocol = "freedom", protocol = "freedom",
tag = $"frag-{baseTagName}", tag = $"frag-{Global.ProxyTag}",
settings = new() settings = new()
{ {
fragment = new() fragment = new()

View file

@ -218,7 +218,7 @@ public class AddServerViewModel : MyReactiveObject
return; return;
} }
List<string> shaList = []; List<string> shaList = new();
foreach (var cert in certList) foreach (var cert in certList)
{ {
var sha = CertPemManager.GetCertSha256Thumbprint(cert); var sha = CertPemManager.GetCertSha256Thumbprint(cert);
@ -228,7 +228,7 @@ public class AddServerViewModel : MyReactiveObject
} }
shaList.Add(sha); shaList.Add(sha);
} }
CertSha = string.Join(',', shaList); CertSha = string.Join('~', shaList);
} }
private async Task FetchCert() private async Task FetchCert()