Compare commits

...

3 commits

Author SHA1 Message Date
DHR60
1e8f9ce2cd Fix fragment 2026-02-26 14:21:46 +08:00
DHR60
3a5293bf87
Fix cert separator (#8837)
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled
release Linux / rpm (push) Has been cancelled
2026-02-25 19:30:29 +08:00
DHR60
ac43bb051d
Node test with sub chain (#8778) 2026-02-25 19:28:20 +08:00
17 changed files with 25 additions and 57 deletions

View file

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

View file

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

View file

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

View file

@ -3798,15 +3798,6 @@ namespace ServiceLib.Resx {
}
}
/// <summary>
/// 查找类似 which conflicts with the group previous proxy 的本地化字符串。
/// </summary>
public static string TbSettingsEnableFragmentTips {
get {
return ResourceManager.GetString("TbSettingsEnableFragmentTips", resourceCulture);
}
}
/// <summary>
/// 查找类似 Enable hardware acceleration (requires restart) 的本地化字符串。
/// </summary>

View file

@ -1113,9 +1113,6 @@
<data name="menuAddHttpServer" xml:space="preserve">
<value>افزودن سرور [HTTP]</value>
</data>
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
<value>which conflicts with the group previous proxy</value>
</data>
<data name="TbSettingsEnableFragment" xml:space="preserve">
<value>فعال کردن فرگمنت</value>
</data>

View file

@ -1110,9 +1110,6 @@
<data name="menuAddHttpServer" xml:space="preserve">
<value>Ajouter [HTTP]</value>
</data>
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
<value>En conflit avec le proxy amont de groupe</value>
</data>
<data name="TbSettingsEnableFragment" xml:space="preserve">
<value>Activer le fragmentation (Fragment)</value>
</data>

View file

@ -1113,9 +1113,6 @@
<data name="menuAddHttpServer" xml:space="preserve">
<value>HTTP konfiguráció hozzáadása</value>
</data>
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
<value>which conflicts with the group previous proxy</value>
</data>
<data name="TbSettingsEnableFragment" xml:space="preserve">
<value>Fragment engedélyezése</value>
</data>

View file

@ -1113,9 +1113,6 @@
<data name="menuAddHttpServer" xml:space="preserve">
<value>Add [HTTP]</value>
</data>
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
<value>which conflicts with the group previous proxy</value>
</data>
<data name="TbSettingsEnableFragment" xml:space="preserve">
<value>Enable fragment</value>
</data>

View file

@ -1113,9 +1113,6 @@
<data name="menuAddHttpServer" xml:space="preserve">
<value>Добавить сервер [HTTP]</value>
</data>
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
<value>что конфликтует с предыдущим прокси группы</value>
</data>
<data name="TbSettingsEnableFragment" xml:space="preserve">
<value>Включить фрагментацию (Fragment)</value>
</data>

View file

@ -1110,9 +1110,6 @@
<data name="menuAddHttpServer" xml:space="preserve">
<value>添加 [HTTP] </value>
</data>
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
<value>和分组前置代理冲突</value>
</data>
<data name="TbSettingsEnableFragment" xml:space="preserve">
<value>启用分片 (Fragment)</value>
</data>

View file

@ -1110,9 +1110,6 @@
<data name="menuAddHttpServer" xml:space="preserve">
<value>新增 [HTTP] 節點</value>
</data>
<data name="TbSettingsEnableFragmentTips" xml:space="preserve">
<value>和分組前置代理衝突</value>
</data>
<data name="TbSettingsEnableFragment" xml:space="preserve">
<value>啟用分片Fragment</value>
</data>

View file

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

View file

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

View file

@ -31,7 +31,7 @@ public partial class CoreConfigV2rayService
var fragmentOutbound = new Outbounds4Ray
{
protocol = "freedom",
tag = $"frag-{Global.ProxyTag}",
tag = $"frag-{baseTagName}",
settings = new()
{
fragment = new()
@ -44,16 +44,17 @@ public partial class CoreConfigV2rayService
};
var actOutboundWithTlsList =
proxyOutboundList.Where(n => n.streamSettings?.security.IsNullOrEmpty() == false
&& (n.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true));
&& (n.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true)).ToList();
if (actOutboundWithTlsList.Count > 0)
{
proxyOutboundList.Add(fragmentOutbound);
}
foreach (var outbound in actOutboundWithTlsList)
{
var fragmentOutboundClone = JsonUtils.DeepCopy(fragmentOutbound);
fragmentOutboundClone.tag = $"frag-{outbound.tag}";
outbound.streamSettings.sockopt = new()
{
dialerProxy = fragmentOutboundClone.tag
dialerProxy = fragmentOutbound.tag
};
proxyOutboundList.Add(fragmentOutboundClone);
}
}
return proxyOutboundList;

View file

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

View file

@ -325,12 +325,6 @@
Grid.Column="1"
Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" />
<TextBlock
Grid.Row="20"
Grid.Column="2"
Margin="{StaticResource Margin4}"
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}"
TextWrapping="Wrap" />
</Grid>
</ScrollViewer>
</TabItem>

View file

@ -391,13 +391,6 @@
Grid.Column="1"
Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" />
<TextBlock
Grid.Row="20"
Grid.Column="2"
Margin="{StaticResource Margin8}"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}"
TextWrapping="Wrap" />
</Grid>
</ScrollViewer>
</TabItem>