Merge tag '7.15.7'

This commit is contained in:
2025-11-04 18:28:41 +03:00
32 changed files with 1802 additions and 193 deletions

View File

@@ -9,6 +9,12 @@ on:
push: push:
branches: branches:
- master - master
tags:
- 'v*'
- 'V*'
permissions:
contents: write
env: env:
OutputArch: "linux-64" OutputArch: "linux-64"
@@ -21,7 +27,6 @@ jobs:
strategy: strategy:
matrix: matrix:
configuration: [Release] configuration: [Release]
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
steps: steps:
@@ -31,21 +36,21 @@ jobs:
submodules: 'recursive' submodules: 'recursive'
fetch-depth: '0' fetch-depth: '0'
- name: Setup - name: Setup .NET
uses: actions/setup-dotnet@v5.0.0 uses: actions/setup-dotnet@v5.0.0
with: with:
dotnet-version: '8.0.x' dotnet-version: '8.0.x'
- name: Build - name: Build
run: | run: |
cd v2rayN cd v2rayN
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained=true -o $OutputPath64 dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained=true -o "$OutputPath64"
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 --self-contained=true -o $OutputPathArm64 dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 --self-contained=true -o "$OutputPathArm64"
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 --self-contained=true -p:PublishTrimmed=true -o $OutputPath64 dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 --self-contained=true -p:PublishTrimmed=true -o "$OutputPath64"
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 --self-contained=true -p:PublishTrimmed=true -o $OutputPathArm64 dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 --self-contained=true -p:PublishTrimmed=true -o "$OutputPathArm64"
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4.6.2 uses: actions/upload-artifact@v5.0.0
with: with:
name: v2rayN-linux name: v2rayN-linux
path: | path: |
@@ -56,8 +61,8 @@ jobs:
if: github.event.inputs.release_tag != '' if: github.event.inputs.release_tag != ''
run: | run: |
chmod 755 package-debian.sh chmod 755 package-debian.sh
./package-debian.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }} ./package-debian.sh "$OutputArch" "$OutputPath64" "${{ github.event.inputs.release_tag }}"
./package-debian.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }} ./package-debian.sh "$OutputArchArm" "$OutputPathArm64" "${{ github.event.inputs.release_tag }}"
- name: Upload deb to release - name: Upload deb to release
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
@@ -68,28 +73,13 @@ jobs:
file_glob: true file_glob: true
prerelease: true prerelease: true
- name: Package AppImage
if: github.event.inputs.release_tag != ''
run: |
chmod a+x package-appimage.sh
./package-appimage.sh
- name: Upload AppImage to release
uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
with:
file: ${{ github.workspace }}/v2rayN*.AppImage
tag: ${{ github.event.inputs.release_tag }}
file_glob: true
prerelease: true
# release zip archive # release zip archive
- name: Package release zip archive - name: Package release zip archive
if: github.event.inputs.release_tag != '' if: github.event.inputs.release_tag != ''
run: | run: |
chmod 755 package-release-zip.sh chmod 755 package-release-zip.sh
./package-release-zip.sh $OutputArch $OutputPath64 ./package-release-zip.sh "$OutputArch" "$OutputPath64"
./package-release-zip.sh $OutputArchArm $OutputPathArm64 ./package-release-zip.sh "$OutputArchArm" "$OutputPathArm64"
- name: Upload zip archive to release - name: Upload zip archive to release
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
@@ -100,36 +90,62 @@ jobs:
file_glob: true file_glob: true
prerelease: true prerelease: true
# release RHEL package rpm:
- name: Package RPM (RHEL-family) needs: build
if: github.event.inputs.release_tag != '' if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-24.04
container:
image: quay.io/almalinuxorg/10-base:latest
options: --platform=linux/amd64/v2
env:
RELEASE_TAG: ${{ github.event.inputs.release_tag != '' && github.event.inputs.release_tag || github.ref_name }}
steps:
- name: Prepare tools (Red Hat)
run: | run: |
chmod 755 package-rhel.sh dnf -y makecache
# Build for both x86_64 and aarch64 in one go (explicit version passed; no --buildfrom) dnf -y install epel-release
./package-rhel.sh "${{ github.event.inputs.release_tag }}" --arch all dnf -y install sudo git rpm-build rpmdevtools dnf-plugins-core rsync findutils tar gzip unzip which
- name: Checkout repo (for scripts)
uses: actions/checkout@v5.0.0
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Restore build artifacts
uses: actions/download-artifact@v6
with:
name: v2rayN-linux
path: ${{ github.workspace }}/v2rayN/Release
- name: Ensure script permissions
run: chmod 755 package-rhel.sh
- name: Package RPM (RHEL-family)
run: ./package-rhel.sh "${RELEASE_TAG}" --arch all
- name: Collect RPMs into workspace - name: Collect RPMs into workspace
if: github.event.inputs.release_tag != ''
run: | run: |
mkdir -p "${{ github.workspace }}/dist/rpm" mkdir -p "$GITHUB_WORKSPACE/dist/rpm"
rsync -av "$HOME/rpmbuild/RPMS/" "${{ github.workspace }}/dist/rpm/" rsync -av "$HOME/rpmbuild/RPMS/" "$GITHUB_WORKSPACE/dist/rpm/" || true
# Rename to requested filenames find "$GITHUB_WORKSPACE/dist/rpm" -name "v2rayN-*-1*.x86_64.rpm" -exec mv {} "$GITHUB_WORKSPACE/dist/rpm/v2rayN-linux-rhel-64.rpm" \; || true
find "${{ github.workspace }}/dist/rpm" -name "v2rayN-*-1.x86_64.rpm" -exec mv {} "${{ github.workspace }}/dist/rpm/v2rayN-linux-rhel-x64.rpm" \; || true find "$GITHUB_WORKSPACE/dist/rpm" -name "v2rayN-*-1*.aarch64.rpm" -exec mv {} "$GITHUB_WORKSPACE/dist/rpm/v2rayN-linux-rhel-arm64.rpm" \; || true
find "${{ github.workspace }}/dist/rpm" -name "v2rayN-*-1.aarch64.rpm" -exec mv {} "${{ github.workspace }}/dist/rpm/v2rayN-linux-rhel-arm64.rpm" \; || true echo "==== Dist tree ===="
ls -R "$GITHUB_WORKSPACE/dist/rpm" || true
- name: Upload RPM artifacts - name: Upload RPM artifacts
if: github.event.inputs.release_tag != '' uses: actions/upload-artifact@v5.0.0
uses: actions/upload-artifact@v4.6.2
with: with:
name: v2rayN-rpm name: v2rayN-rpm
path: | path: dist/rpm/**/*.rpm
${{ github.workspace }}/dist/rpm/**/*.rpm
- name: Upload RPMs to release - name: Upload RPMs to release
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
with: with:
file: ${{ github.workspace }}/dist/rpm/**/*.rpm file: dist/rpm/**/*.rpm
tag: ${{ github.event.inputs.release_tag }} tag: ${{ env.RELEASE_TAG }}
file_glob: true file_glob: true
prerelease: true prerelease: true

View File

@@ -45,7 +45,7 @@ jobs:
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 --self-contained=true -p:PublishTrimmed=true -o $OutputPathArm64 dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 --self-contained=true -p:PublishTrimmed=true -o $OutputPathArm64
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4.6.2 uses: actions/upload-artifact@v5.0.0
with: with:
name: v2rayN-macos name: v2rayN-macos
path: | path: |

View File

@@ -45,7 +45,7 @@ jobs:
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPathArm64 dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPathArm64
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4.6.2 uses: actions/upload-artifact@v5.0.0
with: with:
name: v2rayN-windows-desktop name: v2rayN-windows-desktop
path: | path: |

View File

@@ -46,7 +46,7 @@ jobs:
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4.6.2 uses: actions/upload-artifact@v5.0.0
with: with:
name: v2rayN-windows name: v2rayN-windows
path: | path: |

View File

@@ -1,67 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
# Install deps
sudo apt update -y
sudo apt install -y libfuse2 wget file
# Get tools
wget -qO appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage
chmod +x appimagetool
# x86_64 AppDir
APPDIR_X64="AppDir-x86_64"
rm -rf "$APPDIR_X64"
mkdir -p "$APPDIR_X64/usr/lib/v2rayN" "$APPDIR_X64/usr/bin" "$APPDIR_X64/usr/share/applications" "$APPDIR_X64/usr/share/pixmaps"
cp -rf "$OutputPath64"/* "$APPDIR_X64/usr/lib/v2rayN" || true
[ -f "$APPDIR_X64/usr/lib/v2rayN/v2rayN.png" ] && cp "$APPDIR_X64/usr/lib/v2rayN/v2rayN.png" "$APPDIR_X64/usr/share/pixmaps/v2rayN.png" || true
[ -f "$APPDIR_X64/usr/lib/v2rayN/v2rayN.png" ] && cp "$APPDIR_X64/usr/lib/v2rayN/v2rayN.png" "$APPDIR_X64/v2rayN.png" || true
printf '%s\n' '#!/bin/sh' 'HERE="$(dirname "$(readlink -f "$0")")"' 'cd "$HERE/usr/lib/v2rayN"' 'exec "$HERE/usr/lib/v2rayN/v2rayN" "$@"' >"$APPDIR_X64/AppRun"
chmod +x "$APPDIR_X64/AppRun"
ln -sf usr/lib/v2rayN/v2rayN "$APPDIR_X64/usr/bin/v2rayN"
cat >"$APPDIR_X64/v2rayN.desktop" <<EOF
[Desktop Entry]
Name=v2rayN
Comment=A GUI client for Windows and Linux, support Xray core and sing-box-core and others
Exec=v2rayN
Icon=v2rayN
Terminal=false
Type=Application
Categories=Network;
EOF
install -Dm644 "$APPDIR_X64/v2rayN.desktop" "$APPDIR_X64/usr/share/applications/v2rayN.desktop"
ARCH=x86_64 ./appimagetool "$APPDIR_X64" "v2rayN-${OutputArch}.AppImage"
file "v2rayN-${OutputArch}.AppImage" | grep -q 'x86-64'
# aarch64 AppDir
APPDIR_ARM64="AppDir-aarch64"
rm -rf "$APPDIR_ARM64"
mkdir -p "$APPDIR_ARM64/usr/lib/v2rayN" "$APPDIR_ARM64/usr/bin" "$APPDIR_ARM64/usr/share/applications" "$APPDIR_ARM64/usr/share/pixmaps"
cp -rf "$OutputPathArm64"/* "$APPDIR_ARM64/usr/lib/v2rayN" || true
[ -f "$APPDIR_ARM64/usr/lib/v2rayN/v2rayN.png" ] && cp "$APPDIR_ARM64/usr/lib/v2rayN/v2rayN.png" "$APPDIR_ARM64/usr/share/pixmaps/v2rayN.png" || true
[ -f "$APPDIR_ARM64/usr/lib/v2rayN/v2rayN.png" ] && cp "$APPDIR_ARM64/usr/lib/v2rayN/v2rayN.png" "$APPDIR_ARM64/v2rayN.png" || true
printf '%s\n' '#!/bin/sh' 'HERE="$(dirname "$(readlink -f "$0")")"' 'cd "$HERE/usr/lib/v2rayN"' 'exec "$HERE/usr/lib/v2rayN/v2rayN" "$@"' >"$APPDIR_ARM64/AppRun"
chmod +x "$APPDIR_ARM64/AppRun"
ln -sf usr/lib/v2rayN/v2rayN "$APPDIR_ARM64/usr/bin/v2rayN"
cat >"$APPDIR_ARM64/v2rayN.desktop" <<EOF
[Desktop Entry]
Name=v2rayN
Comment=A GUI client for Windows and Linux, support Xray core and sing-box-core and others
Exec=v2rayN
Icon=v2rayN
Terminal=false
Type=Application
Categories=Network;
EOF
install -Dm644 "$APPDIR_ARM64/v2rayN.desktop" "$APPDIR_ARM64/usr/share/applications/v2rayN.desktop"
# aarch64 runtime
wget -qO runtime-aarch64 https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-aarch64
chmod +x runtime-aarch64
# build aarch64 AppImage
ARCH=aarch64 ./appimagetool --runtime-file ./runtime-aarch64 "$APPDIR_ARM64" "v2rayN-${OutputArchArm}.AppImage"
file "v2rayN-${OutputArchArm}.AppImage" | grep -q 'ARM aarch64'

View File

@@ -45,7 +45,7 @@ Maintainer: Vlyaii <voronin9032n3@gmail.com>
Homepage: https://git.vlyaii.ru/voronin9032/v2rayN Homepage: https://git.vlyaii.ru/voronin9032/v2rayN
Architecture: $Arch2 Architecture: $Arch2
Replaces: v2rayn Replaces: v2rayn
Depends: libc6 (>= 2.35), desktop-file-utils, xdg-utils Depends: libc6 (>= 2.34), fontconfig (>= 2.13.1), desktop-file-utils (>= 0.26), xdg-utils (>= 1.1.3), coreutils (>= 8.32), bash (>= 5.1)
Breaks: v2rayn Breaks: v2rayn
Conflicts: v2rayn Conflicts: v2rayn
Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others

View File

@@ -19,6 +19,23 @@ else
exit 1 exit 1
fi fi
# ======================== Kernel version check (require >= 6.11) =======================
MIN_KERNEL_MAJOR=6
MIN_KERNEL_MINOR=11
KERNEL_FULL=$(uname -r)
KERNEL_MAJOR=$(echo "$KERNEL_FULL" | cut -d. -f1)
KERNEL_MINOR=$(echo "$KERNEL_FULL" | cut -d. -f2)
echo "[INFO] Detected kernel version: $KERNEL_FULL"
if (( KERNEL_MAJOR < MIN_KERNEL_MAJOR )) || { (( KERNEL_MAJOR == MIN_KERNEL_MAJOR )) && (( KERNEL_MINOR < MIN_KERNEL_MINOR )); }; then
echo "[ERROR] Kernel $KERNEL_FULL is too old. Requires Linux >= ${MIN_KERNEL_MAJOR}.${MIN_KERNEL_MINOR}."
echo "Please upgrade your system or use a newer container (e.g. Fedora 42+, RHEL 10+, Debian 13+)."
exit 1
fi
echo "[OK] Kernel version >= ${MIN_KERNEL_MAJOR}.${MIN_KERNEL_MINOR}."
# ===== Config & Parse arguments ========================================================= # ===== Config & Parse arguments =========================================================
VERSION_ARG="${1:-}" # Pass version number like 7.13.8, or leave empty VERSION_ARG="${1:-}" # Pass version number like 7.13.8, or leave empty
WITH_CORE="both" # Default: bundle both xray+sing-box WITH_CORE="both" # Default: bundle both xray+sing-box
@@ -264,8 +281,13 @@ ExclusiveArch: aarch64 x86_64
Source0: __PKGROOT__.tar.gz Source0: __PKGROOT__.tar.gz
# Runtime dependencies (Avalonia / X11 / Fonts / GL) # Runtime dependencies (Avalonia / X11 / Fonts / GL)
Requires: libX11, libXrandr, libXcursor, libXi, libXext, libxcb, libXrender, libXfixes, libXinerama, libxkbcommon Requires: freetype, cairo, pango, openssl, mesa-libEGL, mesa-libGL
Requires: fontconfig, freetype, cairo, pango, mesa-libEGL, mesa-libGL, xdg-utils Requires: glibc >= 2.34
Requires: fontconfig >= 2.13.1
Requires: desktop-file-utils >= 0.26
Requires: xdg-utils >= 1.1.3
Requires: coreutils >= 8.32
Requires: bash >= 5.1
Conflicts: v2rayN Conflicts: v2rayN
Obsoletes: v2rayN Obsoletes: v2rayN

View File

@@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>7.15.6</Version> <Version>7.15.7</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View File

@@ -9,16 +9,16 @@
<PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.8" /> <PackageVersion Include="Avalonia.Controls.DataGrid" Version="11.3.8" />
<PackageVersion Include="Avalonia.Desktop" Version="11.3.8" /> <PackageVersion Include="Avalonia.Desktop" Version="11.3.8" />
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.8" /> <PackageVersion Include="Avalonia.Diagnostics" Version="11.3.8" />
<PackageVersion Include="Avalonia.ReactiveUI" Version="11.3.8" /> <PackageVersion Include="ReactiveUI.Avalonia" Version="11.3.8" />
<PackageVersion Include="CliWrap" Version="3.9.0" /> <PackageVersion Include="CliWrap" Version="3.9.0" />
<PackageVersion Include="Downloader" Version="4.0.3" /> <PackageVersion Include="Downloader" Version="4.0.3" />
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.2" /> <PackageVersion Include="H.NotifyIcon.Wpf" Version="2.3.2" />
<PackageVersion Include="MaterialDesignThemes" Version="5.3.0" /> <PackageVersion Include="MaterialDesignThemes" Version="5.3.0" />
<PackageVersion Include="MessageBox.Avalonia" Version="3.2.0" /> <PackageVersion Include="MessageBox.Avalonia" Version="3.2.0" />
<PackageVersion Include="QRCoder" Version="1.7.0" /> <PackageVersion Include="QRCoder" Version="1.7.0" />
<PackageVersion Include="ReactiveUI" Version="20.4.1" /> <PackageVersion Include="ReactiveUI" Version="22.2.1" />
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" /> <PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageVersion Include="ReactiveUI.WPF" Version="20.4.1" /> <PackageVersion Include="ReactiveUI.WPF" Version="22.2.1" />
<PackageVersion Include="Semi.Avalonia" Version="11.3.7" /> <PackageVersion Include="Semi.Avalonia" Version="11.3.7" />
<PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="11.2.0.1" /> <PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="11.2.0.1" />
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.3.7" /> <PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.3.7" />

View File

@@ -35,9 +35,13 @@ public class JsonUtils
/// <typeparam name="T"></typeparam> /// <typeparam name="T"></typeparam>
/// <param name="obj"></param> /// <param name="obj"></param>
/// <returns></returns> /// <returns></returns>
public static T DeepCopy<T>(T obj) public static T? DeepCopy<T>(T? obj)
{ {
return Deserialize<T>(Serialize(obj, false))!; if (obj is null)
{
return default;
}
return Deserialize<T>(Serialize(obj, false));
} }
/// <summary> /// <summary>
@@ -67,7 +71,7 @@ public class JsonUtils
/// </summary> /// </summary>
/// <param name="strJson"></param> /// <param name="strJson"></param>
/// <returns></returns> /// <returns></returns>
public static JsonNode? ParseJson(string strJson) public static JsonNode? ParseJson(string? strJson)
{ {
try try
{ {
@@ -116,7 +120,7 @@ public class JsonUtils
/// <param name="obj"></param> /// <param name="obj"></param>
/// <param name="options"></param> /// <param name="options"></param>
/// <returns></returns> /// <returns></returns>
public static string Serialize(object? obj, JsonSerializerOptions options) public static string Serialize(object? obj, JsonSerializerOptions? options)
{ {
var result = string.Empty; var result = string.Empty;
try try
@@ -125,7 +129,7 @@ public class JsonUtils
{ {
return result; return result;
} }
result = JsonSerializer.Serialize(obj, options); result = JsonSerializer.Serialize(obj, options ?? _defaultSerializeOptions);
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@@ -963,13 +963,13 @@ public class Utils
#region Platform #region Platform
public static bool IsWindows() => RuntimeInformation.IsOSPlatform(OSPlatform.Windows); public static bool IsWindows() => OperatingSystem.IsWindows();
public static bool IsLinux() => RuntimeInformation.IsOSPlatform(OSPlatform.Linux); public static bool IsLinux() => OperatingSystem.IsLinux();
public static bool IsOSX() => RuntimeInformation.IsOSPlatform(OSPlatform.OSX); public static bool IsOSX() => OperatingSystem.IsMacOS();
public static bool IsNonWindows() => !RuntimeInformation.IsOSPlatform(OSPlatform.Windows); public static bool IsNonWindows() => !OperatingSystem.IsWindows();
public static string GetExeName(string name) public static string GetExeName(string name)
{ {
@@ -994,11 +994,6 @@ public class Utils
return false; return false;
} }
if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPIMAGE")))
{
return true;
}
var exePath = GetExePath(); var exePath = GetExePath();
var baseDir = string.IsNullOrEmpty(exePath) ? StartupPath() : Path.GetDirectoryName(exePath) ?? ""; var baseDir = string.IsNullOrEmpty(exePath) ? StartupPath() : Path.GetDirectoryName(exePath) ?? "";
var p = baseDir.Replace('\\', '/'); var p = baseDir.Replace('\\', '/');
@@ -1008,11 +1003,6 @@ public class Utils
return false; return false;
} }
if (p.Contains("/.mount_", StringComparison.Ordinal))
{
return true;
}
if (p.StartsWith("/opt/v2rayN", StringComparison.OrdinalIgnoreCase)) if (p.StartsWith("/opt/v2rayN", StringComparison.OrdinalIgnoreCase))
{ {
return true; return true;

View File

@@ -427,6 +427,7 @@ public class Global
"zh-Hant", "zh-Hant",
"en", "en",
"fa-Ir", "fa-Ir",
"fr",
"ru", "ru",
"hu" "hu"
]; ];

View File

@@ -34,7 +34,7 @@ public class CoreAdminManager
StringBuilder sb = new(); StringBuilder sb = new();
sb.AppendLine("#!/bin/bash"); sb.AppendLine("#!/bin/bash");
var cmdLine = $"{fileName.AppendQuotes()} {string.Format(coreInfo.Arguments, Utils.GetBinConfigPath(configPath).AppendQuotes())}"; var cmdLine = $"{fileName.AppendQuotes()} {string.Format(coreInfo.Arguments, Utils.GetBinConfigPath(configPath).AppendQuotes())}";
sb.AppendLine($"sudo -S {cmdLine}"); sb.AppendLine($"exec sudo -S -- {cmdLine}");
var shFilePath = await FileManager.CreateLinuxShellFile("run_as_sudo.sh", sb.ToString(), true); var shFilePath = await FileManager.CreateLinuxShellFile("run_as_sudo.sh", sb.ToString(), true);
var procService = new ProcessService( var procService = new ProcessService(

File diff suppressed because it is too large Load Diff

View File

@@ -427,7 +427,7 @@
<value>路由设置</value> <value>路由设置</value>
</data> </data>
<data name="menuServers" xml:space="preserve"> <data name="menuServers" xml:space="preserve">
<value>配置文件</value> <value>配置</value>
</data> </data>
<data name="menuSetting" xml:space="preserve"> <data name="menuSetting" xml:space="preserve">
<value>设置</value> <value>设置</value>

View File

@@ -28,15 +28,15 @@ fi
kill_children() { kill_children() {
local parent=$1 local parent=$1
local children=$(ps -o pid --no-headers --ppid "$parent") local children=$(ps -o pid --no-headers --ppid "$parent")
# Output information about processes being terminated # Output information about processes being terminated
echo "Processing children of PID: $parent..." echo "Processing children of PID: $parent..."
# Process each child # Process each child
for child in $children; do for child in $children; do
# Recursively find and kill child's children first # Recursively find and kill child's children first
kill_children "$child" kill_children "$child"
# Force kill the child process # Force kill the child process
echo "Terminating child process: $child" echo "Terminating child process: $child"
kill -9 "$child" 2>/dev/null || true kill -9 "$child" 2>/dev/null || true
@@ -47,6 +47,18 @@ echo "============================================"
echo "Starting termination of process $PID and all its children" echo "Starting termination of process $PID and all its children"
echo "============================================" echo "============================================"
# Try graceful termination first
echo "Attempting graceful termination (SIGTERM) of PID: $PID"
kill -15 "$PID" 2>/dev/null || true
sleep 1
# If still running, fall back to kill_children
if ps -p $PID > /dev/null; then
echo "Process $PID did not exit after SIGTERM; proceeding with forced termination of its children and itself"
else
echo "Process $PID exited cleanly after SIGTERM"
exit 0
fi
# Find and kill all child processes # Find and kill all child processes
kill_children "$PID" kill_children "$PID"

View File

@@ -42,6 +42,20 @@ echo "============================================"
echo "Starting termination of process $PID and all its descendants" echo "Starting termination of process $PID and all its descendants"
echo "============================================" echo "============================================"
# Try graceful termination first
echo "Attempting graceful termination (SIGTERM) of PID: $PID"
kill -15 "$PID" 2>/dev/null || true
sleep 1
# If still running, fall back to kill_descendants
# Use the macOS-native 'kill -0' check
if kill -0 $PID 2>/dev/null; then
echo "Process $PID did not exit after SIGTERM; proceeding with forced termination of its descendants and itself"
else
echo "Process $PID exited cleanly after SIGTERM"
exit 0
fi
# Find and kill all descendant processes # Find and kill all descendant processes
kill_descendants "$PID" kill_descendants "$PID"

View File

@@ -57,6 +57,9 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>PublicResXFileCodeGenerator</Generator> <Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Update="Resx\ResUI.fr.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource>
<EmbeddedResource Update="Resx\ResUI.hu.resx"> <EmbeddedResource Update="Resx\ResUI.hu.resx">
<Generator>PublicResXFileCodeGenerator</Generator> <Generator>PublicResXFileCodeGenerator</Generator>
</EmbeddedResource> </EmbeddedResource>
@@ -79,4 +82,4 @@
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -10,15 +10,17 @@ public partial class App : Application
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException;
DataContext = StatusBarViewModel.Instance;
} }
public override void OnFrameworkInitializationCompleted() public override void OnFrameworkInitializationCompleted()
{ {
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{ {
AppManager.Instance.InitComponents(); if (!Design.IsDesignMode)
{
AppManager.Instance.InitComponents();
DataContext = StatusBarViewModel.Instance;
}
desktop.Exit += OnExit; desktop.Exit += OnExit;
desktop.MainWindow = new MainWindow(); desktop.MainWindow = new MainWindow();

View File

@@ -3,7 +3,7 @@ global using System.Collections.Generic;
global using System.Globalization; global using System.Globalization;
global using System.IO; global using System.IO;
global using System.Linq; global using System.Linq;
global using System.Reactive.Disposables; global using System.Reactive.Disposables.Fluent;
global using System.Reactive.Linq; global using System.Reactive.Linq;
global using System.Text; global using System.Text;
global using System.Threading; global using System.Threading;
@@ -17,7 +17,7 @@ global using Avalonia.Markup.Xaml;
global using Avalonia.Media; global using Avalonia.Media;
global using Avalonia.Media.Imaging; global using Avalonia.Media.Imaging;
global using Avalonia.Platform; global using Avalonia.Platform;
global using Avalonia.ReactiveUI; global using ReactiveUI.Avalonia;
global using Avalonia.Styling; global using Avalonia.Styling;
global using Avalonia.Threading; global using Avalonia.Threading;
global using ReactiveUI; global using ReactiveUI;

View File

@@ -54,12 +54,19 @@ internal class Program
// Avalonia configuration, don't remove; also used by visual designer. // Avalonia configuration, don't remove; also used by visual designer.
public static AppBuilder BuildAvaloniaApp() public static AppBuilder BuildAvaloniaApp()
{ {
return AppBuilder.Configure<App>() var builder = AppBuilder.Configure<App>()
.UsePlatformDetect() .UsePlatformDetect()
//.WithInterFont() //.WithInterFont()
.WithFontByDefault() .WithFontByDefault()
.LogToTrace() .LogToTrace()
.UseReactiveUI() .UseReactiveUI();
.With(new MacOSPlatformOptions { ShowInDock = AppManager.Instance.Config.UiItem.MacOSShowInDock });
if (OperatingSystem.IsMacOS())
{
var showInDock = Design.IsDesignMode || AppManager.Instance.Config.UiItem.MacOSShowInDock;
builder = builder.With(new MacOSPlatformOptions { ShowInDock = showInDock });
}
return builder;
} }
} }

View File

@@ -168,7 +168,7 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
} }
menuAddServerViaScan.IsVisible = false; menuAddServerViaScan.IsVisible = false;
if (_config.UiItem.AutoHideStartup) if (_config.UiItem.AutoHideStartup && Utils.IsWindows())
{ {
this.WindowState = WindowState.Minimized; this.WindowState = WindowState.Minimized;
} }
@@ -402,9 +402,9 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
public void ShowHideWindow(bool? blShow) public void ShowHideWindow(bool? blShow)
{ {
var bl = blShow ?? var bl = blShow ??
Utils.IsLinux() (Utils.IsLinux()
? (!_config.UiItem.ShowInTaskbar ^ (WindowState == WindowState.Minimized)) ? (!_config.UiItem.ShowInTaskbar ^ (WindowState == WindowState.Minimized))
: !_config.UiItem.ShowInTaskbar; : !_config.UiItem.ShowInTaskbar);
if (bl) if (bl)
{ {
this.Show(); this.Show();

View File

@@ -75,6 +75,15 @@
<PathIcon Data="{StaticResource SemiIconBolt}" /> <PathIcon Data="{StaticResource SemiIconBolt}" />
</Button.Content> </Button.Content>
</Button> </Button>
<Button
x:Name="menuMixedTestServer"
Margin="{StaticResource MarginLr4}"
Classes="IconButton Success"
ToolTip.Tip="{x:Static resx:ResUI.menuMixedTestServer}">
<Button.Content>
<PathIcon Data="{StaticResource building_ping}" />
</Button.Content>
</Button>
</WrapPanel> </WrapPanel>
<DataGrid <DataGrid
@@ -99,15 +108,12 @@
<MenuItem x:Name="menuCopyServer" Header="{x:Static resx:ResUI.menuCopyServer}" /> <MenuItem x:Name="menuCopyServer" Header="{x:Static resx:ResUI.menuCopyServer}" />
<MenuItem x:Name="menuRemoveServer" Header="{x:Static resx:ResUI.menuRemoveServer}" /> <MenuItem x:Name="menuRemoveServer" Header="{x:Static resx:ResUI.menuRemoveServer}" />
<MenuItem x:Name="menuRemoveDuplicateServer" Header="{x:Static resx:ResUI.menuRemoveDuplicateServer}" /> <MenuItem x:Name="menuRemoveDuplicateServer" Header="{x:Static resx:ResUI.menuRemoveDuplicateServer}" />
<MenuItem x:Name="menuRemoveInvalidServerResult" Header="{x:Static resx:ResUI.menuRemoveInvalidServerResult}" />
<Separator /> <Separator />
<MenuItem x:Name="menuMixedTestServer" Header="{x:Static resx:ResUI.menuMixedTestServer}" />
<MenuItem x:Name="menuTcpingServer" Header="{x:Static resx:ResUI.menuTcpingServer}" /> <MenuItem x:Name="menuTcpingServer" Header="{x:Static resx:ResUI.menuTcpingServer}" />
<MenuItem x:Name="menuRealPingServer" Header="{x:Static resx:ResUI.menuRealPingServer}" /> <MenuItem x:Name="menuRealPingServer" Header="{x:Static resx:ResUI.menuRealPingServer}" />
<MenuItem x:Name="menuSpeedServer" Header="{x:Static resx:ResUI.menuSpeedServer}" /> <MenuItem x:Name="menuSpeedServer" Header="{x:Static resx:ResUI.menuSpeedServer}" />
<MenuItem Header="{x:Static resx:ResUI.menuTestServerResult}"> <MenuItem x:Name="menuSortServerResult" Header="{x:Static resx:ResUI.menuSortServerResult}" />
<MenuItem x:Name="menuSortServerResult" Header="{x:Static resx:ResUI.menuSortServerResult}" />
<MenuItem x:Name="menuRemoveInvalidServerResult" Header="{x:Static resx:ResUI.menuRemoveInvalidServerResult}" />
</MenuItem>
<Separator /> <Separator />
<MenuItem x:Name="menuMoveToGroup" Header="{x:Static resx:ResUI.menuMoveToGroup}"> <MenuItem x:Name="menuMoveToGroup" Header="{x:Static resx:ResUI.menuMoveToGroup}">
<MenuItem> <MenuItem>

View File

@@ -15,7 +15,7 @@
</PackageReference> </PackageReference>
<PackageReference Include="Avalonia.Desktop" /> <PackageReference Include="Avalonia.Desktop" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" />
<PackageReference Include="Avalonia.ReactiveUI" /> <PackageReference Include="ReactiveUI.Avalonia" />
<PackageReference Include="MessageBox.Avalonia" /> <PackageReference Include="MessageBox.Avalonia" />
<PackageReference Include="Semi.Avalonia" /> <PackageReference Include="Semi.Avalonia" />
<PackageReference Include="Semi.Avalonia.AvaloniaEdit" /> <PackageReference Include="Semi.Avalonia.AvaloniaEdit" />

View File

@@ -26,11 +26,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Action", "GitHub Act
..\.github\workflows\build-osx.yml = ..\.github\workflows\build-osx.yml ..\.github\workflows\build-osx.yml = ..\.github\workflows\build-osx.yml
..\.github\workflows\build-windows-desktop.yml = ..\.github\workflows\build-windows-desktop.yml ..\.github\workflows\build-windows-desktop.yml = ..\.github\workflows\build-windows-desktop.yml
..\.github\workflows\build-windows.yml = ..\.github\workflows\build-windows.yml ..\.github\workflows\build-windows.yml = ..\.github\workflows\build-windows.yml
..\package-appimage.sh = ..\package-appimage.sh
..\package-debian.sh = ..\package-debian.sh ..\package-debian.sh = ..\package-debian.sh
..\package-osx.sh = ..\package-osx.sh ..\package-osx.sh = ..\package-osx.sh
..\package-release-zip.sh = ..\package-release-zip.sh ..\package-release-zip.sh = ..\package-release-zip.sh
..\pkg2appimage.yml = ..\pkg2appimage.yml
..\.github\workflows\winget-publish.yml = ..\.github\workflows\winget-publish.yml ..\.github\workflows\winget-publish.yml = ..\.github\workflows\winget-publish.yml
EndProjectSection EndProjectSection
EndProject EndProject

View File

@@ -6,11 +6,9 @@
<File Path="../.github/workflows/build-windows-desktop.yml" /> <File Path="../.github/workflows/build-windows-desktop.yml" />
<File Path="../.github/workflows/build-windows.yml" /> <File Path="../.github/workflows/build-windows.yml" />
<File Path="../.github/workflows/winget-publish.yml" /> <File Path="../.github/workflows/winget-publish.yml" />
<File Path="../package-appimage.sh" />
<File Path="../package-debian.sh" /> <File Path="../package-debian.sh" />
<File Path="../package-osx.sh" /> <File Path="../package-osx.sh" />
<File Path="../package-release-zip.sh" /> <File Path="../package-release-zip.sh" />
<File Path="../pkg2appimage.yml" />
</Folder> </Folder>
<Folder Name="/Solution Files/"> <Folder Name="/Solution Files/">
<File Path="Directory.Build.props" /> <File Path="Directory.Build.props" />

View File

@@ -2,9 +2,9 @@ using System.Drawing;
using System.Windows.Media; using System.Windows.Media;
using System.Windows.Media.Imaging; using System.Windows.Media.Imaging;
namespace v2rayN; namespace v2rayN.Common;
public class QRCodeUtils public class QRCodeWindowsUtils
{ {
public static ImageSource? GetQRCode(string? strContent) public static ImageSource? GetQRCode(string? strContent)
{ {
@@ -14,7 +14,7 @@ public class QRCodeUtils
} }
try try
{ {
var qrCodeImage = ServiceLib.Common.QRCodeUtils.GenQRCode(strContent); var qrCodeImage = QRCodeUtils.GenQRCode(strContent);
return qrCodeImage is null ? null : ByteToImage(qrCodeImage); return qrCodeImage is null ? null : ByteToImage(qrCodeImage);
} }
catch (Exception ex) catch (Exception ex)

View File

@@ -6,7 +6,7 @@ global using System.Diagnostics;
global using System.Globalization; global using System.Globalization;
global using System.IO; global using System.IO;
global using System.Linq; global using System.Linq;
global using System.Reactive.Disposables; global using System.Reactive.Disposables.Fluent;
global using System.Reactive.Linq; global using System.Reactive.Linq;
global using System.Runtime.InteropServices; global using System.Runtime.InteropServices;
global using System.Text; global using System.Text;
@@ -31,3 +31,4 @@ global using ServiceLib.Manager;
global using ServiceLib.Models; global using ServiceLib.Models;
global using ServiceLib.Resx; global using ServiceLib.Resx;
global using ServiceLib.ViewModels; global using ServiceLib.ViewModels;
global using v2rayN.Common;

View File

@@ -328,7 +328,7 @@ public partial class MainWindow
if (Application.Current?.MainWindow is Window window) if (Application.Current?.MainWindow is Window window)
{ {
var bytes = QRCodeUtils.CaptureScreen(window); var bytes = QRCodeWindowsUtils.CaptureScreen(window);
await ViewModel?.ScanScreenResult(bytes); await ViewModel?.ScanScreenResult(bytes);
} }

View File

@@ -87,6 +87,15 @@
ToolTip="{x:Static resx:ResUI.menuFastRealPing}"> ToolTip="{x:Static resx:ResUI.menuFastRealPing}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="LightningBolt" /> <materialDesign:PackIcon VerticalAlignment="Center" Kind="LightningBolt" />
</Button> </Button>
<Button
x:Name="menuMixedTestServer"
Width="30"
Height="30"
Margin="{StaticResource MarginLeftRight4}"
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
ToolTip="{x:Static resx:ResUI.menuMixedTestServer}">
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Speedometer" />
</Button>
</WrapPanel> </WrapPanel>
<DataGrid <DataGrid
x:Name="lstProfiles" x:Name="lstProfiles"
@@ -131,11 +140,11 @@
x:Name="menuRemoveDuplicateServer" x:Name="menuRemoveDuplicateServer"
Height="{StaticResource MenuItemHeight}" Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuRemoveDuplicateServer}" /> Header="{x:Static resx:ResUI.menuRemoveDuplicateServer}" />
<Separator />
<MenuItem <MenuItem
x:Name="menuMixedTestServer" x:Name="menuRemoveInvalidServerResult"
Height="{StaticResource MenuItemHeight}" Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuMixedTestServer}" /> Header="{x:Static resx:ResUI.menuRemoveInvalidServerResult}" />
<Separator />
<MenuItem <MenuItem
x:Name="menuTcpingServer" x:Name="menuTcpingServer"
Height="{StaticResource MenuItemHeight}" Height="{StaticResource MenuItemHeight}"
@@ -148,16 +157,10 @@
x:Name="menuSpeedServer" x:Name="menuSpeedServer"
Height="{StaticResource MenuItemHeight}" Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuSpeedServer}" /> Header="{x:Static resx:ResUI.menuSpeedServer}" />
<MenuItem Header="{x:Static resx:ResUI.menuTestServerResult}"> <MenuItem
<MenuItem x:Name="menuSortServerResult"
x:Name="menuSortServerResult" Height="{StaticResource MenuItemHeight}"
Height="{StaticResource MenuItemHeight}" Header="{x:Static resx:ResUI.menuSortServerResult}" />
Header="{x:Static resx:ResUI.menuSortServerResult}" />
<MenuItem
x:Name="menuRemoveInvalidServerResult"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuRemoveInvalidServerResult}" />
</MenuItem>
<Separator /> <Separator />
<MenuItem <MenuItem
x:Name="menuMoveToGroup" x:Name="menuMoveToGroup"

View File

@@ -170,7 +170,7 @@ public partial class ProfilesView
public async void ShareServer(string url) public async void ShareServer(string url)
{ {
var img = QRCodeUtils.GetQRCode(url); var img = QRCodeWindowsUtils.GetQRCode(url);
var dialog = new QrcodeView() var dialog = new QrcodeView()
{ {
imgQrcode = { Source = img }, imgQrcode = { Source = img },

View File

@@ -64,7 +64,7 @@ public partial class SubSettingWindow
{ {
return; return;
} }
var img = QRCodeUtils.GetQRCode(url); var img = QRCodeWindowsUtils.GetQRCode(url);
var dialog = new QrcodeView() var dialog = new QrcodeView()
{ {
imgQrcode = { Source = img }, imgQrcode = { Source = img },