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 else if (node.ConfigType == EConfigType.Custom
&& node.PreSocksPort is > 0 and <= 65535) && 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() itemSocks = new ProfileItem()
{ {
CoreType = preCoreType, CoreType = preCoreType,

View File

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

View File

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

View File

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