Add default fingerprint settings

This commit is contained in:
2dust 2023-02-01 11:24:45 +08:00
parent 61f297215d
commit d2bef312ce
10 changed files with 44 additions and 8 deletions

View file

@ -105,7 +105,7 @@
public static readonly List<string> Protocols = new List<string> { "http", "tls", "bittorrent" };
public static readonly List<string> TunMtus = new List<string> { "9000", "1500" };
public static readonly List<string> TunStacks = new List<string> { "gvisor", "system" };
public static readonly List<string> PresetMsgFilters = new List<string> { "^(?!.*proxy).*$", "^(?!.*direct).*$" };
public static readonly List<string> PresetMsgFilters = new List<string> { "^(?!.*proxy).*$", "^(?!.*direct).*$", "" };
#endregion

View file

@ -556,7 +556,7 @@ namespace v2rayN.Handler
{
allowInsecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? config.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
alpn = node.GetAlpn(),
fingerprint = node.fingerprint
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.defFingerprint : node.fingerprint
};
if (!string.IsNullOrWhiteSpace(sni))
{
@ -578,7 +578,7 @@ namespace v2rayN.Handler
{
allowInsecure = Utils.ToBool(node.allowInsecure.IsNullOrEmpty() ? config.defAllowInsecure.ToString().ToLower() : node.allowInsecure),
alpn = node.GetAlpn(),
fingerprint = node.fingerprint
fingerprint = node.fingerprint.IsNullOrEmpty() ? config.defFingerprint : node.fingerprint
};
if (!string.IsNullOrWhiteSpace(sni))
{

View file

@ -90,10 +90,9 @@
/// <summary>
/// 是否允许不安全连接
/// </summary>
public bool defAllowInsecure
{
get; set;
}
public bool defAllowInsecure { get; set; }
public string defFingerprint { get; set; }
/// <summary>
/// 域名解析策略

View file

@ -2401,6 +2401,15 @@ namespace v2rayN.Resx {
}
}
/// <summary>
/// 查找类似 Default TLS fingerprint 的本地化字符串。
/// </summary>
public static string TbSettingsDefFingerprint {
get {
return ResourceManager.GetString("TbSettingsDefFingerprint", resourceCulture);
}
}
/// <summary>
/// 查找类似 Outbound Freedom domainStrategy 的本地化字符串。
/// </summary>

View file

@ -1084,4 +1084,7 @@
<data name="SpeedtestingCompleted" xml:space="preserve">
<value>Test completed</value>
</data>
<data name="TbSettingsDefFingerprint" xml:space="preserve">
<value>Default TLS fingerprint</value>
</data>
</root>

View file

@ -1084,4 +1084,7 @@
<data name="SpeedtestingCompleted" xml:space="preserve">
<value>测试完成</value>
</data>
<data name="TbSettingsDefFingerprint" xml:space="preserve">
<value>默认TLS指纹(fingerprint)</value>
</data>
</root>

View file

@ -28,6 +28,7 @@ namespace v2rayN.ViewModels
[Reactive] public bool logEnabled { get; set; }
[Reactive] public string loglevel { get; set; }
[Reactive] public bool defAllowInsecure { get; set; }
[Reactive] public string defFingerprint { get; set; }
#endregion
#region Core DNS
@ -110,6 +111,7 @@ namespace v2rayN.ViewModels
logEnabled = _config.logEnabled;
loglevel = _config.loglevel;
defAllowInsecure = _config.defAllowInsecure;
defFingerprint = _config.defFingerprint;
#endregion
#region Core DNS
@ -269,6 +271,7 @@ namespace v2rayN.ViewModels
_config.loglevel = loglevel;
_config.muxEnabled = muxEnabled;
_config.defAllowInsecure = defAllowInsecure;
_config.defFingerprint = defFingerprint;
//DNS

View file

@ -16,7 +16,6 @@ namespace v2rayN.Views
{
cmbMsgFilter.Items.Add(it);
});
cmbMsgFilter.Items.Add(string.Empty);
}
void DelegateAppendText(string msg)

View file

@ -62,6 +62,7 @@
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
@ -235,6 +236,20 @@
Grid.Column="1"
Margin="{StaticResource SettingItemMargin}"
HorizontalAlignment="Left" />
<TextBlock
Grid.Row="12"
Grid.Column="0"
Margin="{StaticResource SettingItemMargin}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsDefFingerprint}" />
<ComboBox
x:Name="cmbdefFingerprint"
Grid.Row="12"
Grid.Column="1"
Margin="{StaticResource SettingItemMargin}" />
</Grid>
</TabItem>

View file

@ -21,6 +21,10 @@ namespace v2rayN.Views
{
cmbloglevel.Items.Add(it);
});
Global.fingerprints.ForEach(it =>
{
cmbdefFingerprint.Items.Add(it);
});
Global.domainStrategy4Freedoms.ForEach(it =>
{
cmbdomainStrategy4Freedom.Items.Add(it);
@ -63,6 +67,7 @@ namespace v2rayN.Views
this.Bind(ViewModel, vm => vm.logEnabled, v => v.toglogEnabled.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.loglevel, v => v.cmbloglevel.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.defAllowInsecure, v => v.togdefAllowInsecure.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.defFingerprint, v => v.cmbdefFingerprint.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.domainStrategy4Freedom, v => v.cmbdomainStrategy4Freedom.Text).DisposeWith(disposables);