Xray precore for custom config (#9754)

* Xray precore for custom config

* Fix

* Custom Pre

---------

Co-authored-by: 2dust <31833384+2dust@users.noreply.github.com>
This commit is contained in:
DHR60
2026-07-15 09:23:21 +00:00
committed by GitHub
parent 1ab9757498
commit 8f5cbad988
4 changed files with 5 additions and 4 deletions

View File

@@ -1511,7 +1511,8 @@ public static class ConfigHandler
else if (node.ConfigType == EConfigType.Custom
&& node.PreSocksPort is > 0 and <= 65535)
{
var preCoreType = config.TunModeItem.EnableTun ? ECoreType.sing_box : ECoreType.Xray;
var customPreCoreType = AppManager.Instance.GetCoreType(null, EConfigType.Custom);
var preCoreType = (enableLegacyProtect && config.TunModeItem.EnableTun) ? ECoreType.sing_box : customPreCoreType;
itemSocks = new ProfileItem()
{
CoreType = preCoreType,

View File

@@ -663,7 +663,7 @@ public sealed class AppManager
return Global.SsSecuritiesInSingbox;
}
public ECoreType GetCoreType(ProfileItem profileItem, EConfigType eConfigType)
public ECoreType GetCoreType(ProfileItem? profileItem, EConfigType eConfigType)
{
if (profileItem?.CoreType != null)
{

View File

@@ -1114,7 +1114,7 @@
Grid.Column="0"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
Text="Custom" />
Text="Custom Pre" />
<ComboBox
x:Name="cmbCoreType2"
Grid.Row="2"

View File

@@ -1388,7 +1388,7 @@
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="Custom" />
Text="Custom Pre" />
<ComboBox
x:Name="cmbCoreType2"
Grid.Row="2"