From d6e40fb7f55d473431ccaf7455fdb29ce6d8c848 Mon Sep 17 00:00:00 2001 From: Ilya Voronin Date: Sat, 8 Nov 2025 22:05:24 +0300 Subject: [PATCH] Add patch to fix #8276 --- package-debian.sh | 6 ++++++ package-rhel.sh | 6 ++++++ patches/0001-fix-automatic-connection.patch | 23 +++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 patches/0001-fix-automatic-connection.patch diff --git a/package-debian.sh b/package-debian.sh index 6623b11b..d818e5f4 100755 --- a/package-debian.sh +++ b/package-debian.sh @@ -10,6 +10,9 @@ Arch="linux-64" OutputPath="$(mktemp -d)" Version="$1" +# Apply patches before building +git apply ./patches/0001-fix-automatic-connection.patch + PROJ="./v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj" dotnet restore "$PROJ" sudo rm -rf "$(dirname "$PROJ")/bin/Release/net8.0" @@ -19,6 +22,9 @@ dotnet restore "$PROJ" sudo rm -rf "$(dirname "$PROJ")/bin/Release/net8.0" dotnet publish "${PROJ}" -c Release -r "linux-x64" --self-contained -p:StripSymbols=true -p:PublishTrimmed=true -o "$OutputPath" +# Revert patches after building +git apply -R ./patches/0001-fix-automatic-connection.patch + export RID_DIR="linux-x64" download_xray "$OutputPath/bin/xray" download_singbox "$OutputPath/bin/sing_box" diff --git a/package-rhel.sh b/package-rhel.sh index 86c75665..74633295 100755 --- a/package-rhel.sh +++ b/package-rhel.sh @@ -192,6 +192,9 @@ build_for_arch() { echo "[*] Building for target: $short (RID=$rid, RPM --target $rpm_target)" + # Apply patches before building + git apply ./patches/0001-fix-automatic-connection.patch + # .NET publish (self-contained) for this RID dotnet restore "$PROJECT" rm -rf "$(dirname "$PROJECT")/bin/Release/net8.0" || true @@ -203,6 +206,9 @@ build_for_arch() { -p:IncludeNativeLibrariesForSelfExtract=true \ -p:StripSymbols=true + # Revert patches after building + git apply -R ./patches/0001-fix-automatic-connection.patch + # Per-arch variables (scoped) local RID_DIR="$rid" local PUBDIR diff --git a/patches/0001-fix-automatic-connection.patch b/patches/0001-fix-automatic-connection.patch new file mode 100644 index 00000000..034ae963 --- /dev/null +++ b/patches/0001-fix-automatic-connection.patch @@ -0,0 +1,23 @@ +From a6af95e083262509c48deca95ddc83ee5ff66334 Mon Sep 17 00:00:00 2001 +From: 2dust <31833384+2dust@users.noreply.github.com> +Date: Sat, 8 Nov 2025 20:10:20 +0800 +Subject: [PATCH] Bug fix + +https://github.com/2dust/v2rayN/issues/8276 +--- + v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +index ad91fa02556..74271149b95 100644 +--- a/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs ++++ b/v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs +@@ -268,7 +268,7 @@ private async Task Init() + } + await RefreshServers(); + +- SetReloadEnabled(true); ++ BlReloadEnabled = true; + await Reload(); + } +