Compare commits

..

No commits in common. "20457e9e6372ee5475edf093532fea24cc951e51" and "aae5906311aa76f4667eb772646b62c1678763ca" have entirely different histories.

17 changed files with 50 additions and 63 deletions

View file

@ -81,7 +81,6 @@ public static class ProcUtils
return;
}
var procId = review ? proc?.Id : null;
var fileName = review ? proc?.MainModule?.FileName : null;
var processName = review ? proc?.ProcessName : null;
@ -91,27 +90,15 @@ public static class ProcUtils
try { proc?.Dispose(); } catch (Exception ex) { Logging.SaveLog(_tag, ex); }
await Task.Delay(300);
if (review && procId != null && fileName != null)
if (review && fileName != null)
{
try
var proc2 = Process.GetProcessesByName(processName)
.FirstOrDefault(t => t.MainModule?.FileName == fileName);
if (proc2 != null)
{
var lstProc = Process.GetProcessesByName(processName);
foreach (var proc2 in lstProc)
{
if (proc2.Id == procId)
{
Logging.SaveLog($"{_tag}, KillProcess not completing the job, procId");
Logging.SaveLog($"{_tag}, KillProcess not completing the job");
await ProcessKill(proc2, false);
}
if (proc2.MainModule != null && proc2.MainModule?.FileName == fileName)
{
Logging.SaveLog($"{_tag}, KillProcess not completing the job, fileName");
}
}
}
catch (Exception ex)
{
Logging.SaveLog(_tag, ex);
proc2 = null;
}
}
}

View file

@ -5,7 +5,6 @@ namespace ServiceLib.Common
internal static class WindowsUtils
{
private static readonly string _tag = "WindowsUtils";
public static string? RegReadValue(string path, string name, string def)
{
RegistryKey? regKey = null;

View file

@ -1,4 +1,6 @@
namespace ServiceLib.Handler
using YamlDotNet.Core.Tokens;
namespace ServiceLib.Handler
{
/// <summary>
/// Core configuration file processing class

View file

@ -3,7 +3,6 @@
public static class SysProxyHandler
{
private static readonly string _tag = "SysProxyHandler";
public static async Task<bool> UpdateSysProxy(Config config, bool forceDisable)
{
var type = config.SystemProxyItem.SysProxyType;

View file

@ -15,6 +15,7 @@ namespace ServiceLib.Handler
private readonly string _webFileName = "backup.zip";
private readonly string _tag = "WebDav--";
public WebDavHandler()
{
_config = AppHandler.Instance.Config;

View file

@ -5,25 +5,24 @@
"loglevel": "warning"
},
"inbounds": [],
"outbounds": [
{
"outbounds": [{
"tag": "proxy",
"protocol": "vmess",
"settings": {
"vnext": [{
"address": "",
"port": 0,
"address": "v2ray.cool",
"port": 10086,
"users": [{
"id": "",
"id": "a3482e88-686a-4a58-8126-99c9df64b7bf",
"security": "auto"
}]
}],
"servers": [{
"address": "",
"method": "",
"address": "v2ray.cool",
"method": "chacha20",
"ota": false,
"password": "",
"port": 0,
"password": "123456",
"port": 10086,
"level": 1
}]
},
@ -36,20 +35,24 @@
},
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
},
{
"protocol": "blackhole",
"tag": "block"
"tag": "block",
"settings": {
"response": {
"type": "http"
}
}
}
],
"routing": {
"domainStrategy": "IPIfNonMatch",
"rules": [
{
"inboundTag": [
"api"
],
"inboundTag": ["api"],
"outboundTag": "api",
"type": "field"
}

View file

@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>7.5.5</Version>
<Version>7.5.2</Version>
</PropertyGroup>
<ItemGroup>

View file

@ -313,7 +313,7 @@ namespace ServiceLib.Services.CoreConfig
var outbound = JsonUtils.Deserialize<Outbound4Sbox>(txtOutbound);
await GenOutbound(item, outbound);
outbound.tag = $"{Global.ProxyTag}-{tagProxy.Count + 1}";
singboxConfig.outbounds.Insert(0, outbound);
singboxConfig.outbounds.Add(outbound);
tagProxy.Add(outbound.tag);
}
if (tagProxy.Count <= 0)
@ -333,7 +333,7 @@ namespace ServiceLib.Services.CoreConfig
outbounds = tagProxy,
interrupt_exist_connections = false,
};
singboxConfig.outbounds.Insert(0, outUrltest);
singboxConfig.outbounds.Add(outUrltest);
//add selector outbound
var outSelector = new Outbound4Sbox
@ -344,7 +344,7 @@ namespace ServiceLib.Services.CoreConfig
interrupt_exist_connections = false,
};
outSelector.outbounds.Insert(0, outUrltest.tag);
singboxConfig.outbounds.Insert(0, outSelector);
singboxConfig.outbounds.Add(outSelector);
ret.Success = true;
ret.Data = JsonUtils.Serialize(singboxConfig);

View file

@ -154,7 +154,7 @@ namespace ServiceLib.Services.CoreConfig
var outbound = JsonUtils.Deserialize<Outbounds4Ray>(txtOutbound);
await GenOutbound(item, outbound);
outbound.tag = $"{Global.ProxyTag}-{tagProxy.Count + 1}";
v2rayConfig.outbounds.Insert(0, outbound);
v2rayConfig.outbounds.Add(outbound);
tagProxy.Add(outbound.tag);
}
if (tagProxy.Count <= 0)
@ -182,12 +182,15 @@ namespace ServiceLib.Services.CoreConfig
rule.balancerTag = balancer.tag;
}
}
else
{
v2rayConfig.routing.rules.Add(new()
{
network = "tcp,udp",
balancerTag = balancer.tag,
type = "field"
});
}
ret.Success = true;
ret.Data = JsonUtils.Serialize(v2rayConfig);

View file

@ -13,7 +13,6 @@ namespace ServiceLib.Services
public event EventHandler<RetResult>? UpdateCompleted;
public event ErrorEventHandler? Error;
private static readonly string _tag = "DownloadService";
public async Task<int> DownloadDataAsync(string url, WebProxy webProxy, int downloadTimeout, Action<bool, string> updateFunc)

View file

@ -3,13 +3,12 @@
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:semi="https://irihi.tech/semi"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
x:DataType="vms:StatusBarViewModel"
RequestedThemeVariant="Default">
<Application.Styles>
<semi:SemiTheme />
<StyleInclude Source="Assets/GlobalStyles.axaml" />
<StyleInclude Source="avares://Semi.Avalonia/Themes/Index.axaml" />
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
<StyleInclude Source="avares://DialogHost.Avalonia/Styles.xaml" />
</Application.Styles>

View file

@ -103,8 +103,6 @@ namespace v2rayN.Desktop.ViewModels
private void ModifyFontSize()
{
double size = CurrentFontSize;
if (size < Global.MinFontSize) return;
Style style = new(x => Selectors.Or(
x.OfType<Button>(),
x.OfType<TextBox>(),

View file

@ -28,8 +28,8 @@
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.3" />
<PackageReference Include="DialogHost.Avalonia" Version="0.8.1" />
<PackageReference Include="MessageBox.Avalonia" Version="3.2.0" />
<PackageReference Include="Semi.Avalonia" Version="11.2.1.3" />
<PackageReference Include="Semi.Avalonia.DataGrid" Version="11.2.1.3" />
<PackageReference Include="Semi.Avalonia" Version="11.2.1.2" />
<PackageReference Include="Semi.Avalonia.DataGrid" Version="11.2.1.2" />
<PackageReference Include="ReactiveUI" Version="20.1.63" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
</ItemGroup>

View file

@ -14,7 +14,6 @@ namespace v2rayN
internal static class WindowsUtils
{
private static readonly string _tag = "WindowsUtils";
/// <summary>
/// 获取剪贴板数
/// </summary>

View file

@ -122,7 +122,7 @@ namespace v2rayN.ViewModels
y => y > 0)
.Subscribe(c =>
{
if (_config.UiItem.CurrentFontSize != CurrentFontSize)
if (_config.UiItem.CurrentFontSize != CurrentFontSize && CurrentFontSize >= Global.MinFontSize)
{
_config.UiItem.CurrentFontSize = CurrentFontSize;
ModifyFontSize();
@ -158,8 +158,6 @@ namespace v2rayN.ViewModels
private void ModifyFontSize()
{
double size = (long)CurrentFontSize;
if (size < Global.MinFontSize) return;
Application.Current.Resources["StdFontSize"] = size;
Application.Current.Resources["StdFontSize1"] = size + 1;
Application.Current.Resources["StdFontSize-1"] = size - 1;

View file

@ -14,7 +14,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MaterialDesignThemes" Version="5.2.0" />
<PackageReference Include="MaterialDesignThemes" Version="5.1.0" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.2.0" />
<PackageReference Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageReference Include="ReactiveUI.WPF" Version="20.1.63" />