mirror of
https://github.com/2dust/v2rayN.git
synced 2026-07-26 09:52:05 +03:00
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:
@@ -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,
|
||||||
|
|||||||
@@ -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)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user