Compare commits

..

10 Commits
6.32 ... 6.33

Author SHA1 Message Date
2dust
559ffcbab5 up 6.33 2024-01-06 13:47:03 +08:00
2dust
80ed8346be Bug fix 2024-01-06 10:41:07 +08:00
2dust
a49455f330 Code clean 2024-01-05 13:48:42 +08:00
2dust
c3de6f6d02 Merge pull request #4568 from ShiinaRinne/theme
fix: 当关闭"是否跟随系统主题"时,无法应用"暗黑模式"的设置
2024-01-03 20:07:43 +08:00
2dust
ee416b1bf2 Merge pull request #4567 from ShiinaRinne/patch-2
添加ico格式的自定义图标支持
2024-01-03 20:06:54 +08:00
2dust
784928ffc8 Merge pull request #4571 from canmengxian/patch-2
禁用删除工作流运行
2024-01-03 20:06:34 +08:00
残梦
609360a1d0 禁用删除工作流运行 2024-01-02 23:52:14 +08:00
ShiinaRinne
18ce2f7b1c fix: 当关闭"是否跟随系统主题"时,无法应用"暗黑模式"的设置 2024-01-02 15:34:42 +08:00
ShiinaRinne
78625d82ae 添加ico格式的自定义图标支持 2024-01-02 15:03:21 +08:00
2dust
2ca34fb9ad Bug fix 2023-12-29 18:16:02 +08:00
16 changed files with 75 additions and 54 deletions

View File

@@ -18,13 +18,13 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: 删除工作流运行 # - name: 删除工作流运行
uses: Mattraks/delete-workflow-runs@v2 # uses: Mattraks/delete-workflow-runs@v2
with: # with:
token: ${{ github.token }} # token: ${{ github.token }}
repository: ${{ github.repository }} # repository: ${{ github.repository }}
retain_days: 0 # retain_days: 0
keep_minimum_runs: 1 # keep_minimum_runs: 1
- name: Build - name: Build
run: cd v2rayN && run: cd v2rayN &&
@@ -58,4 +58,4 @@ jobs:
# * This is an automated deployment of GitHub Actions, the change log should be updated manually soon # * This is an automated deployment of GitHub Actions, the change log should be updated manually soon
# ## 更新日志 # ## 更新日志
# * 这是 GitHub Actions 自动化部署,更新日志应该很快会手动更新 # * 这是 GitHub Actions 自动化部署,更新日志应该很快会手动更新

View File

@@ -10,8 +10,8 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.25.1" /> <PackageReference Include="Google.Protobuf" Version="3.25.1" />
<PackageReference Include="Grpc.Net.Client" Version="2.59.0" /> <PackageReference Include="Grpc.Net.Client" Version="2.60.0" />
<PackageReference Include="Grpc.Tools" Version="2.59.0"> <PackageReference Include="Grpc.Tools" Version="2.60.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@@ -1,9 +1,9 @@
<Application <Application
x:Class="v2rayN.App" x:Class="v2rayN.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters" xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
ShutdownMode="OnExplicitShutdown" ShutdownMode="OnExplicitShutdown"
StartupUri="Views/MainWindow.xaml"> StartupUri="Views/MainWindow.xaml">
<Application.Resources> <Application.Resources>

View File

@@ -776,18 +776,21 @@ namespace v2rayN.Handler
{ {
singboxConfig.experimental = new Experimental4Sbox() singboxConfig.experimental = new Experimental4Sbox()
{ {
//cache_file = new CacheFile4Sbox()
//{
// enabled = true
//},
//v2ray_api = new V2ray_Api4Sbox() //v2ray_api = new V2ray_Api4Sbox()
//{ //{
// listen = $"{Global.Loopback}:{Global.statePort}", // listen = $"{Global.Loopback}:{Global.StatePort}",
// stats = new Stats4Sbox() // stats = new Stats4Sbox()
// { // {
// enabled = true, // enabled = true,
// } // }
//} //},
clash_api = new Clash_Api4Sbox() clash_api = new Clash_Api4Sbox()
{ {
external_controller = $"{Global.Loopback}:{Global.StatePort}", external_controller = $"{Global.Loopback}:{Global.StatePort}",
store_selected = true
} }
}; };
} }

View File

@@ -223,10 +223,11 @@ namespace v2rayN.Handler
{ {
ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"))); ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")));
ShowMsg(false, configPath);
try try
{ {
var coreInfo = LazyConfig.Instance.GetCoreInfo(coreType); var coreInfo = LazyConfig.Instance.GetCoreInfo(coreType);
var proc = RunProcess(new(), coreInfo, $" -c {configPath}", true, ShowMsg); var proc = RunProcess(new(), coreInfo, $" -c {Global.CoreSpeedtestConfigFileName}", true, ShowMsg);
if (proc is null) if (proc is null)
{ {
return -1; return -1;

View File

@@ -143,14 +143,12 @@ namespace v2rayN.Handler
{ {
return defaultPort; return defaultPort;
} }
for (int i = 0; i < 3; i++)
{ TcpListener l = new(IPAddress.Loopback, 0);
TcpListener l = new(IPAddress.Loopback, 0); l.Start();
l.Start(); int port = ((IPEndPoint)l.LocalEndpoint).Port;
int port = ((IPEndPoint)l.LocalEndpoint).Port; l.Stop();
l.Stop(); return port;
return port;
}
} }
catch catch
{ {

View File

@@ -8,8 +8,8 @@ namespace v2rayN.Handler
internal class StatisticsV2ray internal class StatisticsV2ray
{ {
private Mode.Config _config; private Mode.Config _config;
private GrpcChannel _channel; private GrpcChannel? _channel;
private StatsService.StatsServiceClient _client; private StatsService.StatsServiceClient? _client;
private bool _exitFlag; private bool _exitFlag;
private Action<ServerSpeedItem> _updateFunc; private Action<ServerSpeedItem> _updateFunc;
@@ -26,10 +26,17 @@ namespace v2rayN.Handler
private void GrpcInit() private void GrpcInit()
{ {
if (_channel == null) if (_channel is null)
{ {
_channel = GrpcChannel.ForAddress($"{Global.HttpProtocol}{Global.Loopback}:{Global.StatePort}"); try
_client = new StatsService.StatsServiceClient(_channel); {
_channel = GrpcChannel.ForAddress($"{Global.HttpProtocol}{Global.Loopback}:{Global.StatePort}");
_client = new StatsService.StatsServiceClient(_channel);
}
catch (Exception ex)
{
Utils.SaveLog(ex.Message, ex);
}
} }
} }
@@ -44,7 +51,7 @@ namespace v2rayN.Handler
{ {
try try
{ {
if (_channel.State == ConnectivityState.Ready) if (_channel?.State == ConnectivityState.Ready)
{ {
QueryStatsResponse? res = null; QueryStatsResponse? res = null;
try try

View File

@@ -180,8 +180,9 @@
public class Experimental4Sbox public class Experimental4Sbox
{ {
public V2ray_Api4Sbox v2ray_api { get; set; } public CacheFile4Sbox? cache_file { get; set; }
public Clash_Api4Sbox clash_api { get; set; } public V2ray_Api4Sbox? v2ray_api { get; set; }
public Clash_Api4Sbox? clash_api { get; set; }
} }
public class V2ray_Api4Sbox public class V2ray_Api4Sbox
@@ -192,8 +193,8 @@
public class Clash_Api4Sbox public class Clash_Api4Sbox
{ {
public string external_controller { get; set; } public string? external_controller { get; set; }
public bool store_selected { get; set; } public bool? store_selected { get; set; }
} }
public class Stats4Sbox public class Stats4Sbox
@@ -210,4 +211,12 @@
public string inet4_range { get; set; } public string inet4_range { get; set; }
public string inet6_range { get; set; } public string inet6_range { get; set; }
} }
public class CacheFile4Sbox
{
public bool enabled { get; set; }
public string? path { get; set; }
public string? cache_id { get; set; }
public bool? store_fakeip { get; set; }
}
} }

View File

@@ -1744,7 +1744,7 @@ namespace v2rayN.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 {0}:{1}/s↑ | {2}/s↓ 的本地化字符串。 /// 查找类似 {0} : {1}/s↑ | {2}/s↓ 的本地化字符串。
/// </summary> /// </summary>
public static string SpeedDisplayText { public static string SpeedDisplayText {
get { get {

View File

@@ -1097,7 +1097,7 @@
<value>More urls, separated by commas;Subscription conversion will be invalid</value> <value>More urls, separated by commas;Subscription conversion will be invalid</value>
</data> </data>
<data name="SpeedDisplayText" xml:space="preserve"> <data name="SpeedDisplayText" xml:space="preserve">
<value>{0}:{1}/s↑ | {2}/s↓</value> <value>{0} : {1}/s↑ | {2}/s↓</value>
</data> </data>
<data name="LvAutoUpdateInterval" xml:space="preserve"> <data name="LvAutoUpdateInterval" xml:space="preserve">
<value>Automatic update interval(minutes)</value> <value>Automatic update interval(minutes)</value>

View File

@@ -880,13 +880,13 @@ namespace v2rayN
if (blFull) if (blFull)
{ {
return string.Format("v2rayN - V{0} - {1}", return string.Format("v2rayN - V{0} - {1}",
FileVersionInfo.GetVersionInfo(location).FileVersion.ToString(), FileVersionInfo.GetVersionInfo(location).FileVersion?.ToString(),
File.GetLastWriteTime(location).ToString("yyyy/MM/dd")); File.GetLastWriteTime(location).ToString("yyyy/MM/dd"));
} }
else else
{ {
return string.Format("v2rayN/{0}", return string.Format("v2rayN/{0}",
FileVersionInfo.GetVersionInfo(location).FileVersion.ToString()); FileVersionInfo.GetVersionInfo(location).FileVersion?.ToString());
} }
} }
catch (Exception ex) catch (Exception ex)

View File

@@ -1726,6 +1726,10 @@ namespace v2rayN.ViewModels
{ {
ModifyTheme(!Utils.IsLightTheme()); ModifyTheme(!Utils.IsLightTheme());
} }
else
{
ModifyTheme(ColorModeDark);
}
} }
}); });

View File

@@ -1,17 +1,17 @@
<reactiveui:ReactiveWindow <reactiveui:ReactiveWindow
x:Class="v2rayN.Views.MainWindow" x:Class="v2rayN.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
xmlns:base="clr-namespace:v2rayN.Base" xmlns:base="clr-namespace:v2rayN.Base"
xmlns:conv="clr-namespace:v2rayN.Converters" xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:v2rayN.Views"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net"
xmlns:resx="clr-namespace:v2rayN.Resx" xmlns:resx="clr-namespace:v2rayN.Resx"
xmlns:tb="clr-namespace:H.NotifyIcon;assembly=H.NotifyIcon.Wpf"
xmlns:vms="clr-namespace:v2rayN.ViewModels" xmlns:vms="clr-namespace:v2rayN.ViewModels"
xmlns:local="clr-namespace:v2rayN.Views"
Title="v2rayN" Title="v2rayN"
Width="900" Width="900"
Height="700" Height="700"

View File

@@ -132,7 +132,7 @@ namespace v2rayN.Views
private void btnBrowse_Click(object sender, System.Windows.RoutedEventArgs e) private void btnBrowse_Click(object sender, System.Windows.RoutedEventArgs e)
{ {
var openFileDialog1 = new OpenFileDialog(); var openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "PNG|*.png"; openFileDialog1.Filter = "PNG,ICO|*.png;*.ico";
openFileDialog1.ShowDialog(); openFileDialog1.ShowDialog();
txtCustomIcon.Text = openFileDialog1.FileName; txtCustomIcon.Text = openFileDialog1.FileName;

View File

@@ -1,12 +1,12 @@
<reactiveui:ReactiveWindow <reactiveui:ReactiveWindow
x:Class="v2rayN.Views.SubEditWindow" x:Class="v2rayN.Views.SubEditWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net" xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:conv="clr-namespace:v2rayN.Converters"
xmlns:resx="clr-namespace:v2rayN.Resx" xmlns:resx="clr-namespace:v2rayN.Resx"
xmlns:vms="clr-namespace:v2rayN.ViewModels" xmlns:vms="clr-namespace:v2rayN.ViewModels"
Title="{x:Static resx:ResUI.menuSubSetting}" Title="{x:Static resx:ResUI.menuSubSetting}"
@@ -288,7 +288,6 @@
AcceptsReturn="True" AcceptsReturn="True"
Style="{StaticResource MyOutlinedTextBox}" /> Style="{StaticResource MyOutlinedTextBox}" />
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>
</DockPanel> </DockPanel>
</reactiveui:ReactiveWindow> </reactiveui:ReactiveWindow>

View File

@@ -9,22 +9,22 @@
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>v2rayN.ico</ApplicationIcon> <ApplicationIcon>v2rayN.ico</ApplicationIcon>
<Copyright>Copyright © 2017-2023 (GPLv3)</Copyright> <Copyright>Copyright © 2017-2024 (GPLv3)</Copyright>
<FileVersion>6.32</FileVersion> <FileVersion>6.33</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Downloader" Version="3.0.6" /> <PackageReference Include="Downloader" Version="3.0.6" />
<PackageReference Include="MaterialDesignThemes" Version="4.9.0" /> <PackageReference Include="MaterialDesignThemes" Version="4.9.0" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.123" /> <PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.124" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="QRCoder.Xaml" Version="1.4.3" /> <PackageReference Include="QRCoder.Xaml" Version="1.4.3" />
<PackageReference Include="sqlite-net-pcl" Version="1.8.116" /> <PackageReference Include="sqlite-net-pcl" Version="1.8.116" />
<PackageReference Include="TaskScheduler" Version="2.10.1" /> <PackageReference Include="TaskScheduler" Version="2.10.1" />
<PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" /> <PackageReference Include="ZXing.Net.Bindings.Windows.Compatibility" Version="0.16.12" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.31" /> <PackageReference Include="ReactiveUI.Fody" Version="19.5.39" />
<PackageReference Include="ReactiveUI.Validation" Version="3.1.7" /> <PackageReference Include="ReactiveUI.Validation" Version="3.1.7" />
<PackageReference Include="ReactiveUI.WPF" Version="19.5.31" /> <PackageReference Include="ReactiveUI.WPF" Version="19.5.39" />
<PackageReference Include="Splat.NLog" Version="14.8.12" /> <PackageReference Include="Splat.NLog" Version="14.8.12" />
<PackageReference Include="System.Reactive" Version="6.0.0" /> <PackageReference Include="System.Reactive" Version="6.0.0" />
</ItemGroup> </ItemGroup>