Compare commits

...

25 commits

Author SHA1 Message Date
JieXu
3bda022574
Add RiscV64 RPM build && Update (#9114)
Some checks are pending
release Linux / build (push) Waiting to run
release Linux / release-zip (push) Blocked by required conditions
release Linux / build and release deb x64 & arm64 (push) Waiting to run
release Linux / build and release rpm x64 & arm64 (push) Waiting to run
release Linux / build and release rpm riscv64 (push) Waiting to run
release macOS / build (push) Waiting to run
release macOS / release-zip (push) Blocked by required conditions
release macOS / package and release macOS dmg (push) Blocked by required conditions
release Windows desktop (Avalonia UI) / build (push) Waiting to run
release Windows desktop (Avalonia UI) / release-zip (push) Blocked by required conditions
release Windows / build (push) Waiting to run
release Windows / release-zip (push) Blocked by required conditions
* Create package-rhel-riscv.sh

* Update build-linux.yml

* Update UpdateService.cs

* Update CoreInfo.cs

* Add RiscV64 download URLs for various platforms

* Update build-linux.yml

* Update ResUI.fr.resx

* Update ResUI.fr.resx

* Update ResUI.fr.resx

* Update proxy_set_linux_sh

---------

Co-authored-by: xujie86 <167618598+xujie86@users.noreply.github.com>
2026-04-15 20:50:27 +08:00
DHR60
2ea9c5a2ff
Fix mux (#9117)
Some checks are pending
release Linux / build (push) Waiting to run
release Linux / release-zip (push) Blocked by required conditions
release Linux / build and release deb (push) Waiting to run
release Linux / build and release rpm (push) Waiting to run
release macOS / build (push) Waiting to run
release macOS / release-zip (push) Blocked by required conditions
release macOS / package and release macOS dmg (push) Blocked by required conditions
release Windows desktop (Avalonia UI) / build (push) Waiting to run
release Windows desktop (Avalonia UI) / release-zip (push) Blocked by required conditions
release Windows / build (push) Waiting to run
release Windows / release-zip (push) Blocked by required conditions
2026-04-15 19:06:26 +08:00
DHR60
3cb2869920
Fix (#9110) 2026-04-15 19:06:03 +08:00
Bonjour LI
43dcb90632
CI Workflow fix: rpm/deb runs-on (#9106)
Some checks failed
release Linux / build (push) Has been cancelled
release Linux / build and release deb (push) Has been cancelled
release Linux / build and release rpm (push) Has been cancelled
release macOS / build (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (push) Has been cancelled
release Windows / build (push) Has been cancelled
release Linux / release-zip (push) Has been cancelled
release macOS / release-zip (push) Has been cancelled
release macOS / package and release macOS dmg (push) Has been cancelled
release Windows desktop (Avalonia UI) / release-zip (push) Has been cancelled
release Windows / release-zip (push) Has been cancelled
2026-04-14 14:29:52 +08:00
Bonjour LI
e56fca05fc
Refactor and Optimize CI Workflow (#9083)
Some checks are pending
release Linux / build (push) Waiting to run
release Linux / release-zip (push) Blocked by required conditions
release Linux / build and release deb (push) Waiting to run
release Linux / build and release rpm (push) Waiting to run
release macOS / build (push) Waiting to run
release macOS / release-zip (push) Blocked by required conditions
release macOS / package and release macOS dmg (push) Blocked by required conditions
release Windows desktop (Avalonia UI) / build (push) Waiting to run
release Windows desktop (Avalonia UI) / release-zip (push) Blocked by required conditions
release Windows / build (push) Waiting to run
release Windows / release-zip (push) Blocked by required conditions
* Refactor and Optimize CI Workflow

* Refactor and Optimize CI Workflow (Added input option value annotations for clarity.)
2026-04-14 09:41:07 +08:00
DHR60
495b5db4f1
Adjust DNS priority order (#9091)
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / deb (push) Blocked by required conditions
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
2026-04-13 10:59:37 +08:00
DHR60
dea143b20d
Add sing-box ua (#9087)
* Add sing-box ua

* Add curl and fix
2026-04-13 10:58:40 +08:00
2dust
0db611b7a9 up 7.20.3
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled
release Linux / deb (push) Has been cancelled
release Linux / rpm (push) Has been cancelled
2026-04-12 10:00:43 +08:00
2dust
c3d67d186a Update xunit.runner and fix socks port names 2026-04-12 10:00:14 +08:00
DHR60
6b07ca63a0
Add sing-box send-through (#9081)
* Add sing-box send-through

* Perf resx
2026-04-12 09:25:17 +08:00
renwofei423
6c8f22ab86
feat(send-through): 支持配置本地出站地址 (#8946)
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / deb (push) Blocked by required conditions
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
* feat(send-through): 支持配置本地出站地址

为 Xray 增加 SendThrough 配置项,允许指定本机 IPv4 作为出站源地址。

- 在核心设置页新增 SendThrough 输入框及中英文提示文案
- 保存配置时校验并持久化本机 IPv4 地址
- 生成 Xray 配置时为所有 outbound 写入 sendThrough 字段

影响说明:
- 仅对 Xray 生效,留空时不设置该字段

* fix(send-through): limit sendThrough to remote egress outbounds
2026-04-11 21:02:43 +08:00
DHR60
49f65579aa
Replace protect-ss with protect-socks (#9052) 2026-04-11 19:45:23 +08:00
dependabot[bot]
a69e407bda
Bump actions/upload-artifact from 7.0.0 to 7.0.1 (#9073)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 7.0.0 to 7.0.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v7.0.0...v7.0.1)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: 7.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-11 19:42:39 +08:00
taskmgr818
96e5c11fc7
Replace 100MB Cloudflare speedtest URL with 99MB (#9076) 2026-04-11 19:39:25 +08:00
2dust
53041906b3 Use LibraryImport for native APIs
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled
release Linux / deb (push) Has been cancelled
release Linux / rpm (push) Has been cancelled
2026-04-06 20:16:30 +08:00
2dust
f2d929f40e Update GlobalHotKeys 2026-04-06 20:00:48 +08:00
2dust
1160d8c154 Add Windows screen QR scan support for avalonia 2026-04-06 15:34:25 +08:00
2dust
75f2cbaef9 Code clean
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / deb (push) Blocked by required conditions
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
2026-04-05 17:18:28 +08:00
2dust
55b08de5fe up 7.20.2
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled
release Linux / deb (push) Has been cancelled
release Linux / rpm (push) Has been cancelled
2026-04-04 20:36:18 +08:00
2dust
14d598a232 Update Directory.Packages.props 2026-04-04 20:35:11 +08:00
nirvanalinlei
b3102b34b3
修复 sing-box TUN 模式下 relay 出站的 mux 问题 (#9018)
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled
release Linux / deb (push) Has been cancelled
release Linux / rpm (push) Has been cancelled
* Fix sing-box selector generation for dynamic group tags

* 修复 TUN 模式下 DNS 失败及 Windows 提权重启后 TUN 状态丢失

* 按上游意见回滚 TUN 提权时保留启用状态的改动
2026-04-02 20:47:34 +08:00
Miheichev Aleksandr Sergeevich
b556adaa09
i18n(ru): complete and improve Russian localization (#9021)
Some checks failed
release Linux / build (Release) (push) Has been cancelled
release macOS / build (Release) (push) Has been cancelled
release Windows desktop (Avalonia UI) / build (Release) (push) Has been cancelled
release Windows / build (Release) (push) Has been cancelled
release Linux / deb (push) Has been cancelled
release Linux / rpm (push) Has been cancelled
Translate 9 previously untranslated strings and improve 104 existing
translations in ResUI.ru.resx for accuracy, consistency and
naturalness.

New translations:
- TbCustomDnsRay, TbCustomDnsSingbox — custom DNS labels
- TbIcmpRoutingPolicy, TbInsecureConcurrency, TbLegacyProtect, TbUot
- TbUsername, menuEditFormat, menuEditPaste

Key improvements:
- Unify "перезагрузка" → "перезапуск" for app restart context
- Fix grammar: missing spaces before parentheses, hyphen in
  "по умолчанию", capitalization
- Restore lost parts of original strings (Enter hint, restart notes,
  process in auto-sort list)
- Fix incorrect translations: "системные узлы" → "системный файл
  hosts", "PublicKey" → "Открытый ключ", "Режим VPN" → "Включить TUN"
- Improve naturalness: "Обнулить" → "Сбросить", "Просмотр" → "Обзор",
  "Содействие" → "Продвижение"
- Align checkbox labels to infinitive form per Russian UI conventions
- Standardize terminology across all proxy, routing, DNS settings

15 universal technical abbreviations (LAN, UUID, MTU, TLS, ALPN, SNI,
FakeIP, Bootstrap DNS, etc.) intentionally kept as-is.
2026-04-01 09:47:15 +08:00
DHR60
fce86e1434
Finalmask check (#9024)
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / deb (push) Blocked by required conditions
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
2026-03-31 19:33:25 +08:00
DHR60
70003e8a81
Report node validator result (#9025) 2026-03-31 19:30:11 +08:00
JieXu
e19b000081
fix (#9017)
* Update package-rhel.sh

* Enhance download_singbox function to handle cronet
2026-03-31 19:26:53 +08:00
63 changed files with 1994 additions and 494 deletions

View file

@ -13,7 +13,7 @@ jobs:
steps: steps:
- name: Trigger build windows - name: Trigger build windows
if: github.event.inputs.release_tag != '' if: inputs.release_tag != ''
run: | run: |
curl -X POST \ curl -X POST \
-H "Accept: application/vnd.github.v3+json" \ -H "Accept: application/vnd.github.v3+json" \
@ -22,12 +22,12 @@ jobs:
-d "{ -d "{
\"ref\": \"master\", \"ref\": \"master\",
\"inputs\": { \"inputs\": {
\"release_tag\": \"${{ github.event.inputs.release_tag }}\" \"release_tag\": \"${{ inputs.release_tag }}\"
} }
}" }"
- name: Trigger build linux - name: Trigger build linux
if: github.event.inputs.release_tag != '' if: inputs.release_tag != ''
run: | run: |
curl -X POST \ curl -X POST \
-H "Accept: application/vnd.github.v3+json" \ -H "Accept: application/vnd.github.v3+json" \
@ -36,12 +36,12 @@ jobs:
-d "{ -d "{
\"ref\": \"master\", \"ref\": \"master\",
\"inputs\": { \"inputs\": {
\"release_tag\": \"${{ github.event.inputs.release_tag }}\" \"release_tag\": \"${{ inputs.release_tag }}\"
} }
}" }"
- name: Trigger build osx - name: Trigger build osx
if: github.event.inputs.release_tag != '' if: inputs.release_tag != ''
run: | run: |
curl -X POST \ curl -X POST \
-H "Accept: application/vnd.github.v3+json" \ -H "Accept: application/vnd.github.v3+json" \
@ -50,12 +50,12 @@ jobs:
-d "{ -d "{
\"ref\": \"master\", \"ref\": \"master\",
\"inputs\": { \"inputs\": {
\"release_tag\": \"${{ github.event.inputs.release_tag }}\" \"release_tag\": \"${{ inputs.release_tag }}\"
} }
}" }"
- name: Trigger build windows desktop - name: Trigger build windows desktop
if: github.event.inputs.release_tag != '' if: inputs.release_tag != ''
run: | run: |
curl -X POST \ curl -X POST \
-H "Accept: application/vnd.github.v3+json" \ -H "Accept: application/vnd.github.v3+json" \
@ -64,6 +64,6 @@ jobs:
-d "{ -d "{
\"ref\": \"master\", \"ref\": \"master\",
\"inputs\": { \"inputs\": {
\"release_tag\": \"${{ github.event.inputs.release_tag }}\" \"release_tag\": \"${{ inputs.release_tag }}\"
} }
}" }"

View file

@ -13,73 +13,29 @@ on:
permissions: permissions:
contents: write contents: write
env:
OutputArch: "linux-64"
OutputArchArm: "linux-arm64"
OutputPath64: "${{ github.workspace }}/v2rayN/Release/linux-64"
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/linux-arm64"
jobs: jobs:
build: build:
strategy: uses: ./.github/workflows/build.yml
matrix: with:
configuration: [Release] target: linux
runs-on: ubuntu-24.04
steps: release-zip:
- name: Checkout if: inputs.release_tag != ''
uses: actions/checkout@v6.0.2 needs: build
with: uses: ./.github/workflows/package-zip.yml
submodules: 'recursive' with:
fetch-depth: '0' target: linux
release_tag: ${{ inputs.release_tag }}
- name: Setup .NET
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: '8.0.x'
- name: Build
run: |
cd v2rayN
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 -p:SelfContained=true -o "$OutputPath64"
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 -p:SelfContained=true -o "$OutputPathArm64"
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 -p:SelfContained=true -p:PublishTrimmed=true -o "$OutputPath64"
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 -p:SelfContained=true -p:PublishTrimmed=true -o "$OutputPathArm64"
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.0
with:
name: v2rayN-linux
path: |
${{ github.workspace }}/v2rayN/Release/linux*
# release zip archive
- name: Package release zip archive
if: github.event.inputs.release_tag != ''
run: |
chmod 755 package-release-zip.sh
./package-release-zip.sh "$OutputArch" "$OutputPath64"
./package-release-zip.sh "$OutputArchArm" "$OutputPathArm64"
- name: Upload zip archive to release
uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
with:
file: ${{ github.workspace }}/v2rayN*.zip
tag: ${{ github.event.inputs.release_tag }}
file_glob: true
prerelease: true
deb: deb:
needs: build name: build and release deb x64 & arm64
if: | if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') || (github.event_name == 'workflow_dispatch' && inputs.release_tag != '') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
container: container: debian:13
image: debian:13
env: env:
RELEASE_TAG: ${{ github.event.inputs.release_tag != '' && github.event.inputs.release_tag || github.ref_name }} RELEASE_TAG: ${{ case(inputs.release_tag != '', inputs.release_tag, github.ref_name) }}
steps: steps:
- name: Prepare tools (Debian) - name: Prepare tools (Debian)
@ -115,12 +71,6 @@ jobs:
echo "==== Dist tree ====" echo "==== Dist tree ===="
ls -R "$GITHUB_WORKSPACE/dist/deb" || true ls -R "$GITHUB_WORKSPACE/dist/deb" || true
- name: Upload DEB artifacts
uses: actions/upload-artifact@v7.0.0
with:
name: v2rayN-deb
path: dist/deb/**/*.deb
- name: Upload DEBs to release - name: Upload DEBs to release
uses: svenstaro/upload-release-action@v2 uses: svenstaro/upload-release-action@v2
with: with:
@ -130,15 +80,14 @@ jobs:
prerelease: true prerelease: true
rpm: rpm:
needs: build name: build and release rpm x64 & arm64
if: | if: |
(github.event_name == 'workflow_dispatch' && github.event.inputs.release_tag != '') || (github.event_name == 'workflow_dispatch' && inputs.release_tag != '') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
container: container: registry.access.redhat.com/ubi10/ubi
image: registry.access.redhat.com/ubi10/ubi
env: env:
RELEASE_TAG: ${{ github.event.inputs.release_tag != '' && github.event.inputs.release_tag || github.ref_name }} RELEASE_TAG: ${{ case(inputs.release_tag != '', inputs.release_tag, github.ref_name) }}
steps: steps:
- name: Prepare tools (Red Hat) - name: Prepare tools (Red Hat)
@ -207,12 +156,6 @@ jobs:
submodules: 'recursive' submodules: 'recursive'
fetch-depth: '0' fetch-depth: '0'
- name: Restore build artifacts
uses: actions/download-artifact@v8
with:
name: v2rayN-linux
path: ${{ github.workspace }}/v2rayN/Release
- name: Ensure script permissions - name: Ensure script permissions
run: chmod 755 package-rhel.sh run: chmod 755 package-rhel.sh
@ -228,12 +171,6 @@ jobs:
echo "==== Dist tree ====" echo "==== Dist tree ===="
ls -R "$GITHUB_WORKSPACE/dist/rpm" || true ls -R "$GITHUB_WORKSPACE/dist/rpm" || true
- name: Upload RPM artifacts
uses: actions/upload-artifact@v7.0.0
with:
name: v2rayN-rpm
path: 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
with: with:
@ -241,3 +178,76 @@ jobs:
tag: ${{ env.RELEASE_TAG }} tag: ${{ env.RELEASE_TAG }}
file_glob: true file_glob: true
prerelease: true prerelease: true
rpm-riscv64:
name: build and release rpm riscv64
if: |
(github.event_name == 'workflow_dispatch' && inputs.release_tag != '') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-24.04-riscv
container: ghcr.io/xujiegb/fedora-riscv:43-latest
env:
RELEASE_TAG: ${{ case(inputs.release_tag != '', inputs.release_tag, github.ref_name) }}
steps:
- name: Prepare tools (Red Hat)
shell: bash
run: |
set -euo pipefail
dnf -y makecache
dnf -y install \
sudo git rpm-build rpmdevtools dnf-plugins-core rsync findutils tar gzip unzip which curl jq wget file \
ca-certificates desktop-file-utils xdg-utils python3 gcc make glibc-devel kernel-headers libatomic libstdc++
- name: Checkout repo (for scripts)
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
rm -rf ./*
git init .
git config --global --add safe.directory "$PWD"
git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git fetch --depth=1 origin "${GITHUB_SHA}"
git checkout FETCH_HEAD
git submodule update --init --recursive
- name: Ensure script permissions
run: chmod 755 package-rhel-riscv.sh
- name: Package RPM (RHEL-family)
run: ./package-rhel-riscv.sh "${RELEASE_TAG}"
- name: Collect RPMs into workspace
run: |
mkdir -p "$GITHUB_WORKSPACE/dist/rpm-riscv64"
rsync -av "$HOME/rpmbuild/RPMS/" "$GITHUB_WORKSPACE/dist/rpm-riscv64/" || true
find "$GITHUB_WORKSPACE/dist/rpm-riscv64" -name "*.riscv64.rpm" \
-exec mv {} "$GITHUB_WORKSPACE/dist/rpm-riscv64/v2rayN-linux-rhel-riscv64.rpm" \; || true
echo "==== Dist tree ===="
ls -R "$GITHUB_WORKSPACE/dist/rpm-riscv64" || true
- name: Upload RPMs to release
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
shopt -s globstar nullglob
files=(dist/rpm-riscv64/**/*.rpm)
(( ${#files[@]} )) || { echo "No RPMs found."; exit 1; }
api="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/tags/${RELEASE_TAG}"
upload_url="$(curl -fsSL -H "Authorization: Bearer ${GITHUB_TOKEN}" "$api" | jq -r '.upload_url // empty' | sed 's/{?name,label}//')"
[[ "$upload_url" ]] || { echo "Release upload URL not found: ${RELEASE_TAG}"; exit 1; }
for f in "${files[@]}"; do
echo "Uploading ${f##*/}"
curl -fsSL -X POST \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "Content-Type: application/x-rpm" \
--data-binary @"$f" \
"${upload_url}?name=${f##*/}"
done

View file

@ -10,78 +10,62 @@ on:
branches: branches:
- master - master
env: permissions:
OutputArch: "macos-64" contents: write
OutputArchArm: "macos-arm64"
OutputPath64: "${{ github.workspace }}/v2rayN/Release/macos-64"
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/macos-arm64"
jobs: jobs:
build: build:
uses: ./.github/workflows/build.yml
with:
target: macos
release-zip:
if: inputs.release_tag != ''
needs: build
uses: ./.github/workflows/package-zip.yml
with:
target: macos
release_tag: ${{ inputs.release_tag }}
dmg:
name: package and release macOS dmg
if: inputs.release_tag != ''
needs: build
strategy: strategy:
matrix: matrix:
configuration: [Release] arch: [ x64, arm64 ]
runs-on: macos-latest runs-on: macos-latest
env:
Arch: |-
${{
case(
matrix.arch == 'x64', '64',
matrix.arch
)
}}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v6.0.2 uses: actions/checkout@v6.0.2
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Setup - name: Restore build artifacts
uses: actions/setup-dotnet@v5.2.0 uses: actions/download-artifact@v8
with: with:
dotnet-version: '8.0.x' name: ${{ matrix.arch }}
path: v2rayN-macos-${{ env.Arch }}
- name: Build
run: |
cd v2rayN
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 -p:SelfContained=true -o $OutputPath64
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 -p:SelfContained=true -o $OutputPathArm64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-x64 -p:SelfContained=true -p:PublishTrimmed=true -o $OutputPath64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 -p:SelfContained=true -p:PublishTrimmed=true -o $OutputPathArm64
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.0
with:
name: v2rayN-macos
path: |
${{ github.workspace }}/v2rayN/Release/macos*
# release osx package - name: Setup create-dmg
- name: Package osx run: brew install create-dmg
if: github.event.inputs.release_tag != ''
run: | - name: Ensure script permissions
brew install create-dmg run: chmod 755 package-osx.sh
chmod 755 package-osx.sh
./package-osx.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }} - name: Package dmg
./package-osx.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }} run: ./package-osx.sh macos-$Arch v2rayN-macos-$Arch ${{ inputs.release_tag }}
- name: Upload dmg to release - name: Upload dmg 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 }}/v2rayN*.dmg file: ${{ github.workspace }}/v2rayN*.dmg
tag: ${{ github.event.inputs.release_tag }} tag: ${{ inputs.release_tag }}
file_glob: true file_glob: true
prerelease: true prerelease: true
# release zip archive
- name: Package release zip archive
if: github.event.inputs.release_tag != ''
run: |
chmod 755 package-release-zip.sh
./package-release-zip.sh $OutputArch $OutputPath64
./package-release-zip.sh $OutputArchArm $OutputPathArm64
- name: Upload zip archive to release
uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
with:
file: ${{ github.workspace }}/v2rayN*.zip
tag: ${{ github.event.inputs.release_tag }}
file_glob: true
prerelease: true

View file

@ -10,62 +10,19 @@ on:
branches: branches:
- master - master
env: permissions:
OutputArch: "windows-64" contents: write
OutputArchArm: "windows-arm64"
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-64"
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-arm64"
jobs: jobs:
build: build:
strategy: uses: ./.github/workflows/build.yml
matrix: with:
configuration: [Release] target: windows
runs-on: ubuntu-latest release-zip:
if: inputs.release_tag != ''
steps: needs: build
- name: Checkout uses: ./.github/workflows/package-zip.yml
uses: actions/checkout@v6.0.2 with:
with: target: windows-desktop
submodules: 'recursive' release_tag: ${{ inputs.release_tag }}
fetch-depth: '0'
- name: Setup
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: '8.0.x'
- name: Build
run: |
cd v2rayN
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r win-x64 -p:SelfContained=true -p:EnableWindowsTargeting=true -o $OutputPath64
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r win-arm64 -p:SelfContained=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 -p:SelfContained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPath64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 -p:SelfContained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPathArm64
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.0
with:
name: v2rayN-windows-desktop
path: |
${{ github.workspace }}/v2rayN/Release/windows*
# release zip archive
- name: Package release zip archive
if: github.event.inputs.release_tag != ''
run: |
chmod 755 package-release-zip.sh
./package-release-zip.sh $OutputArch $OutputPath64
mv "v2rayN-${OutputArch}.zip" "v2rayN-${OutputArch}-desktop.zip"
./package-release-zip.sh $OutputArchArm $OutputPathArm64
mv "v2rayN-${OutputArchArm}.zip" "v2rayN-${OutputArchArm}-desktop.zip"
- name: Upload zip archive to release
uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
with:
file: ${{ github.workspace }}/v2rayN*.zip
tag: ${{ github.event.inputs.release_tag }}
file_glob: true
prerelease: true

View file

@ -10,57 +10,20 @@ on:
branches: branches:
- master - master
env: permissions:
OutputArch: "windows-64" contents: write
OutputArchArm: "windows-arm64"
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-64"
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-arm64"
jobs: jobs:
build: build:
strategy: uses: ./.github/workflows/build.yml
matrix: with:
configuration: [Release] target: windows
project: ./v2rayN/v2rayN.csproj
runs-on: ubuntu-latest release-zip:
if: inputs.release_tag != ''
steps: needs: build
- name: Checkout uses: ./.github/workflows/package-zip.yml
uses: actions/checkout@v6.0.2 with:
target: windows
- name: Setup release_tag: ${{ inputs.release_tag }}
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: '8.0.x'
- name: Build
run: |
cd v2rayN
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 -p:SelfContained=true -p:EnableWindowsTargeting=true -o $OutputPath64
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-arm64 -p:SelfContained=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 -p:SelfContained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPath64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 -p:SelfContained=true -p:EnableWindowsTargeting=true -p:PublishTrimmed=true -o $OutputPathArm64
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.0
with:
name: v2rayN-windows
path: |
${{ github.workspace }}/v2rayN/Release/windows*
# release zip archive
- name: Package release zip archive
if: github.event.inputs.release_tag != ''
run: |
chmod 755 package-release-zip.sh
./package-release-zip.sh $OutputArch $OutputPath64
./package-release-zip.sh $OutputArchArm $OutputPathArm64
- name: Upload zip archive to release
uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
with:
file: ${{ github.workspace }}/v2rayN*.zip
tag: ${{ github.event.inputs.release_tag }}
file_glob: true
prerelease: true

71
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,71 @@
name: build
on:
workflow_call:
inputs:
target: # windows linux macos
required: true
type: string
project:
required: false
type: string
default: './v2rayN.Desktop/v2rayN.Desktop.csproj'
jobs:
build:
name: build x64 arm64
strategy:
matrix:
arch: [ x64, arm64 ]
runs-on: |-
${{
case(
inputs.target == 'macos', 'macos-latest',
inputs.target == 'linux', 'ubuntu-24.04',
'ubuntu-latest'
)
}}
env:
Output: "${{ github.workspace }}/${{ matrix.arch }}"
RID: |-
${{
case(
inputs.target == 'macos', format('osx-{0}', matrix.arch),
inputs.target == 'windows', format('win-{0}', matrix.arch),
format('{0}-{1}', inputs.target, matrix.arch)
)
}}
Project: ${{ inputs.project }}
ExtOpt: |-
${{
case(
inputs.target == 'windows', '-p:EnableWindowsTargeting=true',
''
)
}}
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
with:
submodules: 'recursive'
fetch-depth: '0'
- name: Setup .NET
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: '8.0.x'
- name: Build v2rayN
working-directory: ./v2rayN
run: dotnet publish $Project -c Release -r $RID -p:SelfContained=true $ExtOpt -o $Output
- name: Build AmazTool
working-directory: ./v2rayN
run: dotnet publish ./AmazTool/AmazTool.csproj -c Release -r $RID -p:SelfContained=true -p:PublishTrimmed=true $ExtOpt -o $Output
- name: Upload build artifacts
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ matrix.arch }}
path: ${{ matrix.arch }}

64
.github/workflows/package-zip.yml vendored Normal file
View file

@ -0,0 +1,64 @@
name: package and release Zip
on:
workflow_call:
inputs:
release_tag:
required: true
type: string
target: # windows linux macos windows-desktop
required: true
type: string
permissions:
contents: write
jobs:
package:
name: package x64 arm64
strategy:
matrix:
arch: [ x64, arm64 ]
runs-on: ubuntu-latest
env:
Target: |-
${{
case(
inputs.target == 'windows-desktop', 'windows',
inputs.target
)
}}
Arch: |-
${{
case(
matrix.arch == 'x64', '64',
matrix.arch
)
}}
steps:
- name: Checkout
uses: actions/checkout@v6.0.2
- name: Restore build artifacts
uses: actions/download-artifact@v8
with:
name: ${{ matrix.arch }}
path: v2rayN-${{ env.Target }}-${{ env.Arch }}
- name: Get v2rayN-core-bin
run: wget -nv -O v2rayN-$Target-$Arch.zip "https://github.com/2dust/v2rayN-core-bin/raw/refs/heads/master/v2rayN-$Target-$Arch.zip"
- name: Package zip archive
run: 7z a -tZip v2rayN-$Target-$Arch.zip v2rayN-$Target-$Arch -mx1
- name: Rename windows-desktop
if: inputs.target == 'windows-desktop'
run: mv "v2rayN-$Target-$Arch.zip" "v2rayN-$Target-$Arch-desktop.zip"
- name: Upload zip archive to release
uses: svenstaro/upload-release-action@v2
with:
file: ${{ github.workspace }}/v2rayN*.zip
tag: ${{ inputs.release_tag }}
file_glob: true
prerelease: true

View file

@ -253,11 +253,14 @@ download_xray() {
} }
download_singbox() { download_singbox() {
local outdir="$1" rid="$2" ver="${SING_VER:-}" url tmp tarname="singbox.tar.gz" bin # Download sing-box
local outdir="$1" rid="$2" ver="${SING_VER:-}" url tmp tarname="singbox.tar.gz" bin cronet
mkdir -p "$outdir" mkdir -p "$outdir"
if [[ -z "$ver" ]]; then if [[ -z "$ver" ]]; then
ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \ ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \
| grep -Eo '"tag_name":\s*"v[^"]+"' | sed -E 's/.*"v([^"]+)".*/\1/' | head -n1)" || true | grep -Eo '"tag_name":\s*"v[^"]+"' \
| sed -E 's/.*"v([^"]+)".*/\1/' \
| head -n1)" || true
fi fi
[[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; } [[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; }
if [[ "$rid" == "linux-arm64" ]]; then if [[ "$rid" == "linux-arm64" ]]; then
@ -272,6 +275,8 @@ download_singbox() {
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)" bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; } [[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
install -m 755 "$bin" "$outdir/sing-box" install -m 755 "$bin" "$outdir/sing-box"
cronet="$(find "$tmp" -type f -name 'libcronet*.so*' | head -n1 || true)"
[[ -n "$cronet" ]] && install -m 644 "$cronet" "$outdir/libcronet.so"
rm -rf "$tmp" rm -rf "$tmp"
} }

View file

@ -1,15 +0,0 @@
#!/bin/bash
Arch="$1"
OutputPath="$2"
OutputArch="v2rayN-${Arch}"
FileName="v2rayN-${Arch}.zip"
wget -nv -O $FileName "https://github.com/2dust/v2rayN-core-bin/raw/refs/heads/master/$FileName"
ZipPath64="./$OutputArch"
mkdir $ZipPath64
cp -rf $OutputPath "$ZipPath64/$OutputArch"
7z a -tZip $FileName "$ZipPath64/$OutputArch" -mx1

703
package-rhel-riscv.sh Normal file
View file

@ -0,0 +1,703 @@
#!/usr/bin/env bash
set -euo pipefail
# Require Red Hat base branch
. /etc/os-release
case "${ID:-}" in
rhel|rocky|almalinux|fedora|centos)
echo "Detected supported system: ${NAME:-$ID} ${VERSION_ID:-}"
;;
*)
echo "Unsupported system: ${NAME:-unknown} (${ID:-unknown})."
echo "This script only supports: RHEL / Rocky / AlmaLinux / Fedora / CentOS."
exit 1
;;
esac
# Kernel version
MIN_KERNEL="5.10"
CURRENT_KERNEL="$(uname -r)"
lowest="$(printf '%s\n%s\n' "$MIN_KERNEL" "$CURRENT_KERNEL" | sort -V | head -n1)"
if [[ "$lowest" != "$MIN_KERNEL" ]]; then
echo "Kernel $CURRENT_KERNEL is below $MIN_KERNEL"
exit 1
fi
echo "[OK] Kernel $CURRENT_KERNEL verified."
# Config & Parse arguments
VERSION_ARG="${1:-}" # Pass version number like 7.13.8, or leave empty
WITH_CORE="both" # Default: bundle both xray+sing-box
FORCE_NETCORE=0 # --netcore => skip archive bundle, use separate downloads
BUILD_FROM="" # --buildfrom 1|2|3 to select channel non-interactively
DOTNET_RISCV_VERSION="10.0.105"
DOTNET_RISCV_BASE="https://github.com/filipnavara/dotnet-riscv/releases/download"
DOTNET_RISCV_FILE="dotnet-sdk-${DOTNET_RISCV_VERSION}-linux-riscv64.tar.gz"
DOTNET_SDK_URL="${DOTNET_RISCV_BASE}/${DOTNET_RISCV_VERSION}/${DOTNET_RISCV_FILE}"
SKIA_VER="${SKIA_VER:-3.119.1}"
HARFBUZZ_VER="${HARFBUZZ_VER:-8.3.1.1}"
# If the first argument starts with --, do not treat it as a version number
if [[ "${VERSION_ARG:-}" == --* ]]; then
VERSION_ARG=""
fi
# Take the first non --* argument as version, discard it
if [[ -n "${VERSION_ARG:-}" ]]; then shift || true; fi
# Parse remaining optional arguments
while [[ $# -gt 0 ]]; do
case "$1" in
--with-core) WITH_CORE="${2:-both}"; shift 2;;
--xray-ver) XRAY_VER="${2:-}"; shift 2;;
--singbox-ver) SING_VER="${2:-}"; shift 2;;
--netcore) FORCE_NETCORE=1; shift;;
--buildfrom) BUILD_FROM="${2:-}"; shift 2;;
*)
if [[ -z "${VERSION_ARG:-}" ]]; then VERSION_ARG="$1"; fi
shift;;
esac
done
# Conflict: version number AND --buildfrom cannot be used together
if [[ -n "${VERSION_ARG:-}" && -n "${BUILD_FROM:-}" ]]; then
echo "You cannot specify both an explicit version and --buildfrom at the same time."
echo " Provide either a version (e.g. 7.14.0) OR --buildfrom 1|2|3."
exit 1
fi
apply_riscv_patch() {
# Upgrade net8.0 -> net10.0
find . -type f \( -name "*.csproj" -o -name "*.props" -o -name "*.targets" \) \
-exec sed -i 's/net8\.0/net10.0/g' {} +
# Patch all Directory.Packages.props for SkiaSharp/HarfBuzzSharp
while IFS= read -r -d '' f; do
# replace existing versions if present
sed -i \
-e "s#<PackageVersion Include=\"SkiaSharp\" Version=\"[^\"]*\" */>#<PackageVersion Include=\"SkiaSharp\" Version=\"$SKIA_VER\" />#g" \
-e "s#<PackageVersion Include=\"SkiaSharp.NativeAssets.Linux\" Version=\"[^\"]*\" */>#<PackageVersion Include=\"SkiaSharp.NativeAssets.Linux\" Version=\"$SKIA_VER\" />#g" \
-e "s#<PackageVersion Include=\"HarfBuzzSharp\" Version=\"[^\"]*\" */>#<PackageVersion Include=\"HarfBuzzSharp\" Version=\"$HARFBUZZ_VER\" />#g" \
-e "s#<PackageVersion Include=\"HarfBuzzSharp.NativeAssets.Linux\" Version=\"[^\"]*\" */>#<PackageVersion Include=\"HarfBuzzSharp.NativeAssets.Linux\" Version=\"$HARFBUZZ_VER\" />#g" \
"$f"
grep -q 'PackageVersion Include="SkiaSharp"' "$f" || \
sed -i "/<\/ItemGroup>/i\ <PackageVersion Include=\"SkiaSharp\" Version=\"$SKIA_VER\" />" "$f"
grep -q 'PackageVersion Include="SkiaSharp.NativeAssets.Linux"' "$f" || \
sed -i "/<\/ItemGroup>/i\ <PackageVersion Include=\"SkiaSharp.NativeAssets.Linux\" Version=\"$SKIA_VER\" />" "$f"
grep -q 'PackageVersion Include="HarfBuzzSharp"' "$f" || \
sed -i "/<\/ItemGroup>/i\ <PackageVersion Include=\"HarfBuzzSharp\" Version=\"$HARFBUZZ_VER\" />" "$f"
grep -q 'PackageVersion Include="HarfBuzzSharp.NativeAssets.Linux"' "$f" || \
sed -i "/<\/ItemGroup>/i\ <PackageVersion Include=\"HarfBuzzSharp.NativeAssets.Linux\" Version=\"$HARFBUZZ_VER\" />" "$f"
done < <(find . -type f -name 'Directory.Packages.props' -print0)
# Patch SDK bundled RIDs
f="$(find "$DOTNET_ROOT/sdk/$(dotnet --version)" -type f -name 'Microsoft.NETCoreSdk.BundledVersions.props' | head -n1 || true)"
[[ -f "$f" ]] && sed -i \
-e 's/linux-arm64/&;linux-riscv64/g' \
-e 's/linux-musl-arm64/&;linux-musl-riscv64/g' \
"$f"
}
build_sqlite_native_riscv64() {
local outdir="$1"
local workdir sqlite_year sqlite_ver sqlite_zip srcdir
mkdir -p "$outdir"
workdir="$(mktemp -d)"
# SQLite 3.49.1 amalgamation
sqlite_year="2025"
sqlite_ver="3490100"
sqlite_zip="sqlite-amalgamation-${sqlite_ver}.zip"
echo "[+] Download SQLite amalgamation: ${sqlite_zip}"
curl -fL "https://www.sqlite.org/${sqlite_year}/${sqlite_zip}" -o "${workdir}/${sqlite_zip}"
unzip -q "${workdir}/${sqlite_zip}" -d "$workdir"
srcdir="$(find "$workdir" -maxdepth 1 -type d -name 'sqlite-amalgamation-*' | head -n1 || true)"
[[ -n "$srcdir" ]] || { echo "[!] SQLite source unpack failed"; rm -rf "$workdir"; return 1; }
echo "[+] Build libe_sqlite3.so for riscv64"
gcc -shared -fPIC -O2 \
-DSQLITE_THREADSAFE=1 \
-DSQLITE_ENABLE_FTS5 \
-DSQLITE_ENABLE_RTREE \
-DSQLITE_ENABLE_JSON1 \
-o "${outdir}/libe_sqlite3.so" "${srcdir}/sqlite3.c" -ldl -lpthread
rm -rf "$workdir"
}
copy_skiasharp_native_riscv64() {
local outdir="$1"
local skia_so=""
local harfbuzz_so=""
mkdir -p "$outdir"
skia_so="$(find "$HOME/.nuget/packages" -path "*/skiasharp.nativeassets.linux/${SKIA_VER}/runtimes/linux-riscv64/native/libSkiaSharp.so" | head -n1 || true)"
if [[ -z "$skia_so" ]]; then
skia_so="$(find "$HOME/.nuget/packages" -path "*/runtimes/linux-riscv64/native/libSkiaSharp.so" | head -n1 || true)"
fi
harfbuzz_so="$(find "$HOME/.nuget/packages" -path "*/harfbuzzsharp.nativeassets.linux/${HARFBUZZ_VER}/runtimes/linux-riscv64/native/libHarfBuzzSharp.so" | head -n1 || true)"
if [[ -z "$harfbuzz_so" ]]; then
harfbuzz_so="$(find "$HOME/.nuget/packages" -path "*/runtimes/linux-riscv64/native/libHarfBuzzSharp.so" | head -n1 || true)"
fi
if [[ -n "$skia_so" && -f "$skia_so" ]]; then
echo "[+] Copy libSkiaSharp.so from NuGet cache"
install -m 755 "$skia_so" "$outdir/libSkiaSharp.so"
else
echo "[WARN] libSkiaSharp.so for linux-riscv64 not found in NuGet cache"
fi
if [[ -n "$harfbuzz_so" && -f "$harfbuzz_so" ]]; then
echo "[+] Copy libHarfBuzzSharp.so from NuGet cache"
install -m 755 "$harfbuzz_so" "$outdir/libHarfBuzzSharp.so"
else
echo "[WARN] libHarfBuzzSharp.so for linux-riscv64 not found in NuGet cache"
fi
}
# Check and install dependencies
host_arch="$(uname -m)"
[[ "$host_arch" == "riscv64" ]] || { echo "Only supports riscv64"; exit 1; }
install_ok=0
if command -v dnf >/dev/null 2>&1; then
sudo dnf -y install \
rpm-build rpmdevtools curl unzip tar jq rsync git python3 gcc make \
glibc-devel kernel-headers libatomic file ca-certificates libicu\
&& install_ok=1
mkdir -p "$HOME/.dotnet"
tmp_dotnet="$(mktemp -d)"
curl -fL "$DOTNET_SDK_URL" -o "$tmp_dotnet/$DOTNET_RISCV_FILE"
tar -C "$HOME/.dotnet" -xzf "$tmp_dotnet/$DOTNET_RISCV_FILE"
rm -rf "$tmp_dotnet"
export PATH="$HOME/.dotnet:$PATH"
export DOTNET_ROOT="$HOME/.dotnet"
dotnet --info >/dev/null 2>&1 || install_ok=0
fi
if [[ "$install_ok" -ne 1 ]]; then
echo "Could not auto-install dependencies for '$ID'. Make sure these are available:"
echo "dotnet-riscv SDK, curl, unzip, tar, rsync, git, python3, gcc, rpm, rpmdevtools, rpm-build (on Red Hat branch)"
exit 1
fi
# Root directory
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Git submodules (best effort)
if [[ -f .gitmodules ]]; then
git submodule sync --recursive || true
git submodule update --init --recursive || true
fi
# Locate project
PROJECT="v2rayN.Desktop/v2rayN.Desktop.csproj"
if [[ ! -f "$PROJECT" ]]; then
PROJECT="$(find . -maxdepth 3 -name 'v2rayN.Desktop.csproj' | head -n1 || true)"
fi
[[ -f "$PROJECT" ]] || { echo "v2rayN.Desktop.csproj not found"; exit 1; }
choose_channel() {
# If --buildfrom provided, map it directly and skip interaction.
if [[ -n "${BUILD_FROM:-}" ]]; then
case "$BUILD_FROM" in
1) echo "latest"; return 0;;
2) echo "prerelease"; return 0;;
3) echo "keep"; return 0;;
*) echo "[ERROR] Invalid --buildfrom value: ${BUILD_FROM}. Use 1|2|3." >&2; exit 1;;
esac
fi
# Print menu to stderr and read from /dev/tty so stdout only carries the token.
local ch="latest" sel=""
if [[ -t 0 ]]; then
echo "[?] Choose v2rayN release channel:" >&2
echo " 1) Latest (stable) [default]" >&2
echo " 2) Pre-release (preview)" >&2
echo " 3) Keep current (do nothing)" >&2
printf "Enter 1, 2 or 3 [default 1]: " >&2
if read -r sel </dev/tty; then
case "${sel:-}" in
2) ch="prerelease" ;;
3) ch="keep" ;;
esac
fi
fi
echo "$ch"
}
get_latest_tag_latest() {
curl -fsSL "https://api.github.com/repos/2dust/v2rayN/releases/latest" \
| jq -re '.tag_name' \
| sed 's/^v//'
}
get_latest_tag_prerelease() {
curl -fsSL "https://api.github.com/repos/2dust/v2rayN/releases?per_page=20" \
| jq -re 'first(.[] | select(.prerelease == true) | .tag_name)' \
| sed 's/^v//'
}
git_try_checkout() {
# Try a series of refs and checkout when found.
local want="$1" ref=""
if git rev-parse --git-dir >/dev/null 2>&1; then
git fetch --tags --force --prune --depth=1 || true
if git rev-parse "refs/tags/${want}" >/dev/null 2>&1; then
ref="${want}"
fi
if [[ -n "$ref" ]]; then
echo "[OK] Found ref '${ref}', checking out..."
git checkout -f "${ref}"
if [[ -f .gitmodules ]]; then
git submodule sync --recursive || true
git submodule update --init --recursive || true
fi
return 0
fi
fi
return 1
}
apply_channel_or_keep() {
local ch="$1" tag
if [[ "$ch" == "keep" ]]; then
echo "[*] Keep current repository state (no checkout)."
VERSION="$(git describe --tags --abbrev=0 2>/dev/null || echo '0.0.0+git')"
VERSION="${VERSION#v}"
return 0
fi
echo "[*] Resolving ${ch} tag from GitHub releases..."
if [[ "$ch" == "prerelease" ]]; then
tag="$(get_latest_tag_prerelease || true)"
else
tag="$(get_latest_tag_latest || true)"
fi
[[ -n "$tag" ]] || { echo "Failed to resolve latest tag for channel '${ch}'."; exit 1; }
echo "[*] Latest tag for '${ch}': ${tag}"
git_try_checkout "$tag" || { echo "Failed to checkout '${tag}'."; exit 1; }
VERSION="${tag#v}"
}
if git rev-parse --git-dir >/dev/null 2>&1; then
if [[ -n "${VERSION_ARG:-}" ]]; then
clean_ver="${VERSION_ARG#v}"
if git_try_checkout "$clean_ver"; then
VERSION="$clean_ver"
else
echo "[WARN] Tag '${VERSION_ARG}' not found."
ch="$(choose_channel)"
apply_channel_or_keep "$ch"
fi
else
ch="$(choose_channel)"
apply_channel_or_keep "$ch"
fi
else
echo "Current directory is not a git repo; proceeding on current tree."
VERSION="${VERSION_ARG:-0.0.0}"
fi
VERSION="${VERSION#v}"
echo "[*] GUI version resolved as: ${VERSION}"
# riscv64 patch
apply_riscv_patch
# Helpers for core
download_xray() {
# Download Xray core
local outdir="$1" rid="$2" ver="${XRAY_VER:-}" url="" tmp zipname="xray.zip"
mkdir -p "$outdir"
if [[ -z "$ver" ]]; then
ver="$(curl -fsSL https://api.github.com/repos/XTLS/Xray-core/releases/latest \
| grep -Eo '"tag_name":\s*"v[^"]+"' | sed -E 's/.*"v([^"]+)".*/\1/' | head -n1)" || true
fi
[[ -n "$ver" ]] || { echo "[xray] Failed to get version"; return 1; }
if [[ "$rid" == "linux-riscv64" ]]; then
url="https://github.com/XTLS/Xray-core/releases/download/v${ver}/Xray-linux-riscv64.zip"
fi
[[ -n "$url" ]] || { echo "[xray] Unsupported RID: $rid"; return 1; }
echo "[+] Download xray: $url"
tmp="$(mktemp -d)"
curl -fL "$url" -o "$tmp/$zipname"
unzip -q "$tmp/$zipname" -d "$tmp"
install -m 755 "$tmp/xray" "$outdir/xray"
rm -rf "$tmp"
}
download_singbox() {
# Download sing-box
local outdir="$1" rid="$2" ver="${SING_VER:-}" url="" tmp tarname="singbox.tar.gz" bin cronet
mkdir -p "$outdir"
if [[ -z "$ver" ]]; then
ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \
| grep -Eo '"tag_name":\s*"v[^"]+"' \
| sed -E 's/.*"v([^"]+)".*/\1/' \
| head -n1)" || true
fi
[[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; }
if [[ "$rid" == "linux-riscv64" ]]; then
url="https://github.com/SagerNet/sing-box/releases/download/v${ver}/sing-box-${ver}-linux-riscv64.tar.gz"
fi
[[ -n "$url" ]] || { echo "[sing-box] Unsupported RID: $rid"; return 1; }
echo "[+] Download sing-box: $url"
tmp="$(mktemp -d)"
curl -fL "$url" -o "$tmp/$tarname"
tar -C "$tmp" -xzf "$tmp/$tarname"
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
install -m 755 "$bin" "$outdir/sing-box"
cronet="$(find "$tmp" -type f -name 'libcronet*.so*' | head -n1 || true)"
[[ -n "$cronet" ]] && install -m 644 "$cronet" "$outdir/libcronet.so"
rm -rf "$tmp"
}
# Move geo files to outroot/bin
unify_geo_layout() {
local outroot="$1"
mkdir -p "$outroot/bin"
local names=( \
"geosite.dat" \
"geoip.dat" \
"geoip-only-cn-private.dat" \
"Country.mmdb" \
"geoip.metadb" \
)
for n in "${names[@]}"; do
if [[ -f "$outroot/bin/xray/$n" ]]; then
mv -f "$outroot/bin/xray/$n" "$outroot/bin/$n"
fi
done
}
# Download geo/rule assets
download_geo_assets() {
local outroot="$1"
local bin_dir="$outroot/bin"
local srss_dir="$bin_dir/srss"
mkdir -p "$bin_dir" "$srss_dir"
echo "[+] Download Xray Geo to ${bin_dir}"
curl -fsSL -o "$bin_dir/geosite.dat" \
"https://github.com/Loyalsoldier/V2ray-rules-dat/releases/latest/download/geosite.dat"
curl -fsSL -o "$bin_dir/geoip.dat" \
"https://github.com/Loyalsoldier/V2ray-rules-dat/releases/latest/download/geoip.dat"
curl -fsSL -o "$bin_dir/geoip-only-cn-private.dat" \
"https://raw.githubusercontent.com/Loyalsoldier/geoip/release/geoip-only-cn-private.dat"
curl -fsSL -o "$bin_dir/Country.mmdb" \
"https://raw.githubusercontent.com/Loyalsoldier/geoip/release/Country.mmdb"
echo "[+] Download sing-box rule DB & rule-sets"
curl -fsSL -o "$bin_dir/geoip.metadb" \
"https://github.com/MetaCubeX/meta-rules-dat/releases/latest/download/geoip.metadb" || true
for f in \
geoip-private.srs geoip-cn.srs geoip-facebook.srs geoip-fastly.srs \
geoip-google.srs geoip-netflix.srs geoip-telegram.srs geoip-twitter.srs; do
curl -fsSL -o "$srss_dir/$f" \
"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-geoip/$f" || true
done
for f in \
geosite-cn.srs geosite-gfw.srs geosite-google.srs geosite-greatfire.srs \
geosite-geolocation-cn.srs geosite-category-ads-all.srs geosite-private.srs; do
curl -fsSL -o "$srss_dir/$f" \
"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-geosite/$f" || true
done
# Unify to bin
unify_geo_layout "$outroot"
}
# Prefer the prebuilt v2rayN core bundle; then unify geo layout
download_v2rayn_bundle() {
local outroot="$1" rid="$2"
local url=""
if [[ "$rid" == "linux-riscv64" ]]; then
url="https://raw.githubusercontent.com/2dust/v2rayN-core-bin/refs/heads/master/v2rayN-linux-riscv64.zip"
fi
[[ -n "$url" ]] || { echo "[!] Bundle unsupported RID: $rid"; return 1; }
echo "[+] Try v2rayN bundle archive: $url"
local tmp zipname
tmp="$(mktemp -d)"; zipname="$tmp/v2rayn.zip"
curl -fL "$url" -o "$zipname" || { echo "[!] Bundle download failed"; return 1; }
unzip -q "$zipname" -d "$tmp" || { echo "[!] Bundle unzip failed"; return 1; }
if [[ -d "$tmp/bin" ]]; then
mkdir -p "$outroot/bin"
rsync -a "$tmp/bin/" "$outroot/bin/"
else
rsync -a "$tmp/" "$outroot/"
fi
rm -f "$outroot/v2rayn.zip" 2>/dev/null || true
find "$outroot" -type d -name "mihomo" -prune -exec rm -rf {} + 2>/dev/null || true
local nested_dir
nested_dir="$(find "$outroot" -maxdepth 1 -type d -name 'v2rayN-linux-*' | head -n1 || true)"
if [[ -n "$nested_dir" && -d "$nested_dir/bin" ]]; then
mkdir -p "$outroot/bin"
rsync -a "$nested_dir/bin/" "$outroot/bin/"
rm -rf "$nested_dir"
fi
# Unify to bin/
unify_geo_layout "$outroot"
echo "[+] Bundle extracted to $outroot"
}
# ===== Build results collection ========================================================
BUILT_RPMS=()
# ===== Build (single-arch) function ====================================================
build_for_arch() {
# $1: target short arch: riscv64
local short="$1"
local rid rpm_target archdir
case "$short" in
riscv64) rid="linux-riscv64"; rpm_target="riscv64"; archdir="riscv64" ;;
*) echo "Unknown arch '$short' (use riscv64)"; return 1;;
esac
echo "[*] Building for target: $short (RID=$rid, RPM --target $rpm_target)"
# .NET publish (self-contained) for this RID
dotnet clean "$PROJECT" -c Release -p:TargetFramework=net10.0
rm -rf "$(dirname "$PROJECT")/bin/Release/net10.0" || true
dotnet restore "$PROJECT" -r "$rid" -p:TargetFramework=net10.0
dotnet publish "$PROJECT" \
-c Release -r "$rid" \
-p:TargetFramework=net10.0 \
-p:PublishSingleFile=false \
-p:SelfContained=true
# Per-arch variables (scoped)
local RID_DIR="$rid"
local PUBDIR
PUBDIR="$(dirname "$PROJECT")/bin/Release/net10.0/${RID_DIR}/publish"
[[ -d "$PUBDIR" ]] || { echo "Publish directory not found: $PUBDIR"; return 1; }
# Per-arch working area
local PKGROOT="v2rayN-publish"
local WORKDIR
WORKDIR="$(mktemp -d)"
trap '[[ -n "${WORKDIR:-}" ]] && rm -rf "$WORKDIR"' RETURN
# rpmbuild topdir selection
local TOPDIR SPECDIR SOURCEDIR PROJECT_DIR
rpmdev-setuptree
TOPDIR="${HOME}/rpmbuild"
SPECDIR="${TOPDIR}/SPECS"
SOURCEDIR="${TOPDIR}/SOURCES"
# Stage publish content
mkdir -p "$WORKDIR/$PKGROOT"
cp -a "$PUBDIR/." "$WORKDIR/$PKGROOT/"
copy_skiasharp_native_riscv64 "$WORKDIR/$PKGROOT" || echo "[!] SkiaSharp native copy failed (skipped)"
build_sqlite_native_riscv64 "$WORKDIR/$PKGROOT" || echo "[!] sqlite native build failed (skipped)"
# Required icon
local ICON_CANDIDATE
PROJECT_DIR="$(cd "$(dirname "$PROJECT")" && pwd)"
ICON_CANDIDATE="$PROJECT_DIR/v2rayN.png"
[[ -f "$ICON_CANDIDATE" ]] || { echo "Required icon not found: $ICON_CANDIDATE"; return 1; }
cp "$ICON_CANDIDATE" "$WORKDIR/$PKGROOT/v2rayn.png"
# Prepare bin structure
mkdir -p "$WORKDIR/$PKGROOT/bin/xray" "$WORKDIR/$PKGROOT/bin/sing_box"
# Bundle / cores per-arch
fetch_separate_cores_and_rules() {
local outroot="$1"
if [[ "$WITH_CORE" == "xray" || "$WITH_CORE" == "both" ]]; then
download_xray "$outroot/bin/xray" "$RID_DIR" || echo "[!] xray download failed (skipped)"
fi
if [[ "$WITH_CORE" == "sing-box" || "$WITH_CORE" == "both" ]]; then
download_singbox "$outroot/bin/sing_box" "$RID_DIR" || echo "[!] sing-box download failed (skipped)"
fi
download_geo_assets "$outroot" || echo "[!] Geo rules download failed (skipped)"
}
if [[ "$FORCE_NETCORE" -eq 0 ]]; then
if download_v2rayn_bundle "$WORKDIR/$PKGROOT" "$RID_DIR"; then
echo "[*] Using v2rayN bundle archive."
else
echo "[*] Bundle failed, fallback to separate core + rules."
fetch_separate_cores_and_rules "$WORKDIR/$PKGROOT"
fi
else
echo "[*] --netcore specified: use separate core + rules."
fetch_separate_cores_and_rules "$WORKDIR/$PKGROOT"
fi
# Tarball
mkdir -p "$SOURCEDIR"
tar -C "$WORKDIR" -czf "$SOURCEDIR/$PKGROOT.tar.gz" "$PKGROOT"
# SPEC
local SPECFILE="$SPECDIR/v2rayN.spec"
mkdir -p "$SPECDIR"
cat > "$SPECFILE" <<'SPEC'
%global debug_package %{nil}
%undefine _debuginfo_subpackages
%undefine _debugsource_packages
# Ignore outdated LTTng dependencies incorrectly reported by the .NET runtime (to avoid installation failures)
%global __requires_exclude ^liblttng-ust\.so\..*$
Name: v2rayN
Version: __VERSION__
Release: 1%{?dist}
Summary: v2rayN (Avalonia) GUI client for Linux (riscv64)
License: GPL-3.0-only
URL: https://github.com/2dust/v2rayN
BugURL: https://github.com/2dust/v2rayN/issues
ExclusiveArch: riscv64
Source0: __PKGROOT__.tar.gz
# Runtime dependencies (Avalonia / X11 / Fonts / GL)
Requires: cairo, pango, openssl, mesa-libEGL, mesa-libGL
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
Requires: freetype >= 2.10
%description
v2rayN Linux for Red Hat Enterprise Linux
Support vless / vmess / Trojan / http / socks / Anytls / Hysteria2 / Shadowsocks / tuic / WireGuard
Support Red Hat Enterprise Linux / Fedora Linux / Rocky Linux / AlmaLinux / CentOS
For more information, Please visit our website
https://github.com/2dust/v2rayN
%prep
%setup -q -n __PKGROOT__
%build
# no build
%install
install -dm0755 %{buildroot}/opt/v2rayN
cp -a * %{buildroot}/opt/v2rayN/
# Normalize permissions
find %{buildroot}/opt/v2rayN -type d -exec chmod 0755 {} +
find %{buildroot}/opt/v2rayN -type f -exec chmod 0644 {} +
[ -f %{buildroot}/opt/v2rayN/v2rayN ] && chmod 0755 %{buildroot}/opt/v2rayN/v2rayN || :
[ -f %{buildroot}/opt/v2rayN/libSkiaSharp.so ] && chmod 0755 %{buildroot}/opt/v2rayN/libSkiaSharp.so || :
[ -f %{buildroot}/opt/v2rayN/libHarfBuzzSharp.so ] && chmod 0755 %{buildroot}/opt/v2rayN/libHarfBuzzSharp.so || :
[ -f %{buildroot}/opt/v2rayN/libe_sqlite3.so ] && chmod 0755 %{buildroot}/opt/v2rayN/libe_sqlite3.so || :
# Launcher (prefer native ELF first, then DLL fallback)
install -dm0755 %{buildroot}%{_bindir}
install -m0755 /dev/stdin %{buildroot}%{_bindir}/v2rayn << 'EOF'
#!/usr/bin/bash
set -euo pipefail
DIR="/opt/v2rayN"
export LD_LIBRARY_PATH="$DIR:${LD_LIBRARY_PATH:-}"
# Prefer native apphost
if [[ -x "$DIR/v2rayN" ]]; then exec "$DIR/v2rayN" "$@"; fi
# DLL fallback
for dll in v2rayN.Desktop.dll v2rayN.dll; do
if [[ -f "$DIR/$dll" ]]; then exec /usr/bin/dotnet "$DIR/$dll" "$@"; fi
done
echo "v2rayN launcher: no executable found in $DIR" >&2
ls -l "$DIR" >&2 || true
exit 1
EOF
# Desktop file
install -dm0755 %{buildroot}%{_datadir}/applications
install -m0644 /dev/stdin %{buildroot}%{_datadir}/applications/v2rayn.desktop << 'EOF'
[Desktop Entry]
Type=Application
Name=v2rayN
Comment=v2rayN for Red Hat Enterprise Linux
Exec=v2rayn
Icon=v2rayn
Terminal=false
Categories=Network;
EOF
# Icon
install -dm0755 %{buildroot}%{_datadir}/icons/hicolor/256x256/apps
install -m0644 %{_builddir}/__PKGROOT__/v2rayn.png %{buildroot}%{_datadir}/icons/hicolor/256x256/apps/v2rayn.png
%post
/usr/bin/update-desktop-database %{_datadir}/applications >/dev/null 2>&1 || true
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor >/dev/null 2>&1 || true
%postun
/usr/bin/update-desktop-database %{_datadir}/applications >/dev/null 2>&1 || true
/usr/bin/gtk-update-icon-cache -f %{_datadir}/icons/hicolor >/dev/null 2>&1 || true
%files
%{_bindir}/v2rayn
/opt/v2rayN
%{_datadir}/applications/v2rayn.desktop
%{_datadir}/icons/hicolor/256x256/apps/v2rayn.png
SPEC
# Replace placeholders
sed -i "s/__VERSION__/${VERSION}/g" "$SPECFILE"
sed -i "s/__PKGROOT__/${PKGROOT}/g" "$SPECFILE"
# Build RPM for this arch
rpmbuild -ba "$SPECFILE" --target "$rpm_target"
echo "Build done for $short. RPM at:"
local f
for f in "${TOPDIR}/RPMS/${archdir}/v2rayN-${VERSION}-1"*.rpm; do
[[ -e "$f" ]] || continue
echo " $f"
BUILT_RPMS+=("$f")
done
}
# ===== Arch selection and build orchestration =========================================
targets=(riscv64)
for arch in "${targets[@]}"; do
build_for_arch "$arch"
done
echo ""
echo "================ Build Summary ================"
if [[ "${#BUILT_RPMS[@]}" -gt 0 ]]; then
for rp in "${BUILT_RPMS[@]}"; do
echo "$rp"
done
else
echo "No RPMs detected in summary (check build logs above)."
fi
echo "=============================================="

View file

@ -232,11 +232,13 @@ download_xray() {
download_singbox() { download_singbox() {
# Download sing-box # Download sing-box
local outdir="$1" rid="$2" ver="${SING_VER:-}" url tmp tarname="singbox.tar.gz" bin local outdir="$1" rid="$2" ver="${SING_VER:-}" url tmp tarname="singbox.tar.gz" bin cronet
mkdir -p "$outdir" mkdir -p "$outdir"
if [[ -z "$ver" ]]; then if [[ -z "$ver" ]]; then
ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \ ver="$(curl -fsSL https://api.github.com/repos/SagerNet/sing-box/releases/latest \
| grep -Eo '"tag_name":\s*"v[^"]+"' | sed -E 's/.*"v([^"]+)".*/\1/' | head -n1)" || true | grep -Eo '"tag_name":\s*"v[^"]+"' \
| sed -E 's/.*"v([^"]+)".*/\1/' \
| head -n1)" || true
fi fi
[[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; } [[ -n "$ver" ]] || { echo "[sing-box] Failed to get version"; return 1; }
if [[ "$rid" == "linux-arm64" ]]; then if [[ "$rid" == "linux-arm64" ]]; then
@ -251,6 +253,8 @@ download_singbox() {
bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)" bin="$(find "$tmp" -type f -name 'sing-box' | head -n1 || true)"
[[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; } [[ -n "$bin" ]] || { echo "[!] sing-box unpack failed"; rm -rf "$tmp"; return 1; }
install -m 755 "$bin" "$outdir/sing-box" install -m 755 "$bin" "$outdir/sing-box"
cronet="$(find "$tmp" -type f -name 'libcronet*.so*' | head -n1 || true)"
[[ -n "$cronet" ]] && install -m 644 "$cronet" "$outdir/libcronet.so"
rm -rf "$tmp" rm -rf "$tmp"
} }

View file

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<Version>7.20.1</Version> <Version>7.20.3</Version>
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View file

@ -12,20 +12,23 @@
<PackageVersion Include="ReactiveUI.Avalonia" Version="11.4.12" /> <PackageVersion Include="ReactiveUI.Avalonia" Version="11.4.12" />
<PackageVersion Include="CliWrap" Version="3.10.1" /> <PackageVersion Include="CliWrap" Version="3.10.1" />
<PackageVersion Include="Downloader" Version="5.1.0" /> <PackageVersion Include="Downloader" Version="5.1.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageVersion Include="H.NotifyIcon.Wpf" Version="2.4.1" /> <PackageVersion Include="H.NotifyIcon.Wpf" Version="2.4.1" />
<PackageVersion Include="MaterialDesignThemes" Version="5.3.1" /> <PackageVersion Include="MaterialDesignThemes" Version="5.3.1" />
<PackageVersion Include="MessageBox.Avalonia" Version="3.3.1.1" /> <PackageVersion Include="MessageBox.Avalonia" Version="3.3.1.1" />
<PackageVersion Include="QRCoder" Version="1.7.0" /> <PackageVersion Include="QRCoder" Version="1.8.0" />
<PackageVersion Include="ReactiveUI" Version="23.1.8" /> <PackageVersion Include="ReactiveUI" Version="23.2.1" />
<PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" /> <PackageVersion Include="ReactiveUI.Fody" Version="19.5.41" />
<PackageVersion Include="ReactiveUI.WPF" Version="23.1.8" /> <PackageVersion Include="ReactiveUI.WPF" Version="23.2.1" />
<PackageVersion Include="Semi.Avalonia" Version="11.3.7.3" /> <PackageVersion Include="Semi.Avalonia" Version="11.3.7.3" />
<PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="11.2.0.2" /> <PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="11.2.0.2" />
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.3.7.3" /> <PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.3.7.3" />
<PackageVersion Include="NLog" Version="6.1.1" /> <PackageVersion Include="NLog" Version="6.1.2" />
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" /> <PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
<PackageVersion Include="TaskScheduler" Version="2.12.2" /> <PackageVersion Include="TaskScheduler" Version="2.12.2" />
<PackageVersion Include="WebDav.Client" Version="2.9.0" /> <PackageVersion Include="WebDav.Client" Version="2.9.0" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.runner.visualstudio" Version="3.1.5" />
<PackageVersion Include="YamlDotNet" Version="16.3.0" /> <PackageVersion Include="YamlDotNet" Version="16.3.0" />
<PackageVersion Include="ZXing.Net.Bindings.SkiaSharp" Version="0.16.14" /> <PackageVersion Include="ZXing.Net.Bindings.SkiaSharp" Version="0.16.14" />
</ItemGroup> </ItemGroup>

@ -1 +1 @@
Subproject commit ffb2850df0991495d0918e13cc5701737f26175a Subproject commit 50f615b671ff8d4a6a850aed19da5f94f58b5d96

View file

@ -0,0 +1,228 @@
using System.Text.Json.Nodes;
using ServiceLib;
using ServiceLib.Enums;
using ServiceLib.Models;
using ServiceLib.Services.CoreConfig;
using Xunit;
namespace ServiceLib.Tests;
public class CoreConfigV2rayServiceTests
{
private const string SendThrough = "198.51.100.10";
[Fact]
public void GenerateClientConfigContent_OnlyAppliesSendThroughToRemoteProxyOutbounds()
{
var node = CreateProxyNode("proxy-1", "198.51.100.1", 443);
var service = new CoreConfigV2rayService(CreateContext(node));
var result = service.GenerateClientConfigContent();
Assert.True(result.Success);
var outbounds = GetOutbounds(result.Data?.ToString());
var proxyOutbound = outbounds.Single(outbound => outbound["tag"]!.GetValue<string>() == Global.ProxyTag);
var directOutbound = outbounds.Single(outbound => outbound["tag"]!.GetValue<string>() == Global.DirectTag);
var blockOutbound = outbounds.Single(outbound => outbound["tag"]!.GetValue<string>() == Global.BlockTag);
Assert.Equal(SendThrough, proxyOutbound["sendThrough"]?.GetValue<string>());
Assert.Null(directOutbound["sendThrough"]);
Assert.Null(blockOutbound["sendThrough"]);
}
[Fact]
public void GenerateClientConfigContent_OnlyAppliesSendThroughToChainExitOutbounds()
{
var exitNode = CreateProxyNode("exit", "198.51.100.2", 443);
var entryNode = CreateProxyNode("entry", "198.51.100.3", 443);
var chainNode = CreateChainNode("chain", exitNode, entryNode);
var service = new CoreConfigV2rayService(CreateContext(
chainNode,
allProxiesMap: new Dictionary<string, ProfileItem>
{
[exitNode.IndexId] = exitNode,
[entryNode.IndexId] = entryNode,
}));
var result = service.GenerateClientConfigContent();
Assert.True(result.Success);
var outbounds = GetOutbounds(result.Data?.ToString())
.Where(outbound => outbound["protocol"]?.GetValue<string>() is not ("freedom" or "blackhole" or "dns"))
.ToList();
var sendThroughOutbounds = outbounds
.Where(outbound => outbound["sendThrough"]?.GetValue<string>() == SendThrough)
.ToList();
var chainedOutbounds = outbounds
.Where(outbound => outbound["streamSettings"]?["sockopt"]?["dialerProxy"] is not null)
.ToList();
Assert.Single(sendThroughOutbounds);
Assert.All(chainedOutbounds, outbound => Assert.Null(outbound["sendThrough"]));
}
[Fact]
public void GenerateClientConfigContent_DoesNotApplySendThroughToTunRelayLoopbackOutbound()
{
var node = CreateProxyNode("proxy-1", "198.51.100.4", 443);
var config = CreateConfig();
config.TunModeItem.EnableLegacyProtect = false;
var service = new CoreConfigV2rayService(CreateContext(
node,
config,
isTunEnabled: true,
tunProtectSsPort: 10811,
proxyRelaySsPort: 10812));
var result = service.GenerateClientConfigContent();
Assert.True(result.Success);
var outbounds = GetOutbounds(result.Data?.ToString());
Assert.DoesNotContain(outbounds, outbound => outbound["sendThrough"]?.GetValue<string>() == SendThrough);
}
private static CoreConfigContext CreateContext(
ProfileItem node,
Config? config = null,
Dictionary<string, ProfileItem>? allProxiesMap = null,
bool isTunEnabled = false,
int tunProtectSsPort = 0,
int proxyRelaySsPort = 0)
{
return new CoreConfigContext
{
Node = node,
RunCoreType = ECoreType.Xray,
AppConfig = config ?? CreateConfig(),
AllProxiesMap = allProxiesMap ?? new(),
SimpleDnsItem = new SimpleDNSItem(),
IsTunEnabled = isTunEnabled,
TunProtectSocksPort = tunProtectSsPort,
ProxyRelaySocksPort = proxyRelaySsPort,
};
}
private static Config CreateConfig()
{
return new Config
{
IndexId = string.Empty,
SubIndexId = string.Empty,
CoreBasicItem = new()
{
LogEnabled = false,
Loglevel = "warning",
MuxEnabled = false,
DefAllowInsecure = false,
DefFingerprint = Global.Fingerprints.First(),
DefUserAgent = string.Empty,
SendThrough = SendThrough,
EnableFragment = false,
EnableCacheFile4Sbox = true,
},
TunModeItem = new()
{
EnableTun = false,
AutoRoute = true,
StrictRoute = true,
Stack = string.Empty,
Mtu = 9000,
EnableIPv6Address = false,
IcmpRouting = Global.TunIcmpRoutingPolicies.First(),
EnableLegacyProtect = false,
},
KcpItem = new(),
GrpcItem = new(),
RoutingBasicItem = new()
{
DomainStrategy = Global.DomainStrategies.First(),
DomainStrategy4Singbox = Global.DomainStrategies4Sbox.First(),
RoutingIndexId = string.Empty,
},
GuiItem = new(),
MsgUIItem = new(),
UiItem = new()
{
CurrentLanguage = "en",
CurrentFontFamily = string.Empty,
MainColumnItem = [],
WindowSizeItem = [],
},
ConstItem = new(),
SpeedTestItem = new(),
Mux4RayItem = new()
{
Concurrency = 8,
XudpConcurrency = 8,
XudpProxyUDP443 = "reject",
},
Mux4SboxItem = new()
{
Protocol = string.Empty,
},
HysteriaItem = new(),
ClashUIItem = new()
{
ConnectionsColumnItem = [],
},
SystemProxyItem = new(),
WebDavItem = new(),
CheckUpdateItem = new(),
Fragment4RayItem = null,
Inbound = [new InItem
{
Protocol = EInboundProtocol.socks.ToString(),
LocalPort = 10808,
UdpEnabled = true,
SniffingEnabled = true,
RouteOnly = false,
}],
GlobalHotkeys = [],
CoreTypeItem = [],
SimpleDNSItem = new(),
};
}
private static ProfileItem CreateProxyNode(string indexId, string address, int port)
{
return new ProfileItem
{
IndexId = indexId,
Remarks = indexId,
ConfigType = EConfigType.SOCKS,
CoreType = ECoreType.Xray,
Address = address,
Port = port,
};
}
private static ProfileItem CreateChainNode(string indexId, params ProfileItem[] nodes)
{
var chainNode = new ProfileItem
{
IndexId = indexId,
Remarks = indexId,
ConfigType = EConfigType.ProxyChain,
CoreType = ECoreType.Xray,
};
chainNode.SetProtocolExtra(new ProtocolExtraItem
{
ChildItems = string.Join(',', nodes.Select(node => node.IndexId)),
});
return chainNode;
}
private static List<JsonObject> GetOutbounds(string? json)
{
var root = JsonNode.Parse(json ?? throw new InvalidOperationException("Config JSON is missing"))?.AsObject()
?? throw new InvalidOperationException("Failed to parse config JSON");
return root["outbounds"]?.AsArray().Select(node => node!.AsObject()).ToList()
?? throw new InvalidOperationException("Config JSON does not contain outbounds");
}
}

View file

@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ServiceLib\ServiceLib.csproj" />
</ItemGroup>
</Project>

View file

@ -46,7 +46,7 @@ public static class ProcUtils
return null; return null;
} }
public static void RebootAsAdmin(bool blAdmin = true) public static bool RebootAsAdmin(bool blAdmin = true)
{ {
try try
{ {
@ -58,11 +58,12 @@ public static class ProcUtils
FileName = Utils.GetExePath().AppendQuotes(), FileName = Utils.GetExePath().AppendQuotes(),
Verb = blAdmin ? "runas" : null, Verb = blAdmin ? "runas" : null,
}; };
_ = Process.Start(startInfo); return Process.Start(startInfo) != null;
} }
catch (Exception ex) catch (Exception ex)
{ {
Logging.SaveLog(_tag, ex); Logging.SaveLog(_tag, ex);
return false;
} }
} }
} }

View file

@ -522,6 +522,23 @@ public class Utils
return false; return false;
} }
public static bool IsIpv4(string? ip)
{
if (ip.IsNullOrEmpty())
{
return false;
}
ip = ip.Trim();
if (!IPAddress.TryParse(ip, out var address))
{
return false;
}
return address.AddressFamily == AddressFamily.InterNetwork
&& ip.Count(c => c == '.') == 3;
}
public static bool IsIpAddress(string? ip) public static bool IsIpAddress(string? ip)
{ {
if (ip.IsNullOrEmpty()) if (ip.IsNullOrEmpty())

View file

@ -143,7 +143,7 @@ public class Global
@"https://cachefly.cachefly.net/50mb.test", @"https://cachefly.cachefly.net/50mb.test",
@"https://speed.cloudflare.com/__down?bytes=10000000", @"https://speed.cloudflare.com/__down?bytes=10000000",
@"https://speed.cloudflare.com/__down?bytes=50000000", @"https://speed.cloudflare.com/__down?bytes=50000000",
@"https://speed.cloudflare.com/__down?bytes=100000000", @"https://speed.cloudflare.com/__down?bytes=99999999",
]; ];
public static readonly List<string> SpeedPingTestUrls = public static readonly List<string> SpeedPingTestUrls =
@ -189,7 +189,8 @@ public class Global
{"safari","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15" }, {"safari","Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.1 Safari/605.1.15" },
{"edge","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.70" }, {"edge","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.70" },
{"none",""}, {"none",""},
{"golang",""} {"golang","Go-http-client/1.1"},
{"curl","curl/7.68.0"},
}; };
public const string Hysteria2ProtocolShare = "hy2://"; public const string Hysteria2ProtocolShare = "hy2://";
@ -393,7 +394,8 @@ public class Global
"chrome", "chrome",
"firefox", "firefox",
"edge", "edge",
"golang" "curl",
"golang",
]; ];
public static readonly List<string> XhttpMode = public static readonly List<string> XhttpMode =
@ -424,11 +426,12 @@ public class Global
public static readonly List<string> DomainDirectDNSAddress = public static readonly List<string> DomainDirectDNSAddress =
[ [
"https://dns.alidns.com/dns-query",
"https://doh.pub/dns-query",
"https://dns.alidns.com/dns-query,https://doh.pub/dns-query",
"223.5.5.5",
"119.29.29.29", "119.29.29.29",
"223.5.5.5",
"119.29.29.29,223.5.5.5,https://doh.pub/dns-query",
"https://doh.pub/dns-query",
"https://dns.alidns.com/dns-query",
"https://doh.pub/dns-query,https://dns.alidns.com/dns-query",
"localhost" "localhost"
]; ];
@ -440,7 +443,7 @@ public class Global
"https://dns.cloudflare.com/dns-query", "https://dns.cloudflare.com/dns-query",
"https://doh.dns.sb/dns-query", "https://doh.dns.sb/dns-query",
"https://doh.opendns.com/dns-query", "https://doh.opendns.com/dns-query",
"https://common.dot.dns.yandex.net", "https://common.dot.dns.yandex.net/dns-query",
"8.8.8.8", "8.8.8.8",
"1.1.1.1", "1.1.1.1",
"185.222.222.222", "185.222.222.222",
@ -450,8 +453,8 @@ public class Global
public static readonly List<string> DomainPureIPDNSAddress = public static readonly List<string> DomainPureIPDNSAddress =
[ [
"223.5.5.5",
"119.29.29.29", "119.29.29.29",
"223.5.5.5",
"localhost" "localhost"
]; ];

View file

@ -25,14 +25,14 @@ public record CoreConfigContextBuilderAllResult(
[.. MainResult.ValidatorResult.Warnings, .. PreSocksResult?.ValidatorResult.Warnings ?? []]); [.. MainResult.ValidatorResult.Warnings, .. PreSocksResult?.ValidatorResult.Warnings ?? []]);
/// <summary> /// <summary>
/// The main context with TunProtectSsPort/ProxyRelaySsPort and ProtectDomainList merged in /// The main context with TunProtectSocksPort/ProxyRelaySocksPort and ProtectDomainList merged in
/// from the pre-socks result (if any). Pass this to the core runner. /// from the pre-socks result (if any). Pass this to the core runner.
/// </summary> /// </summary>
public CoreConfigContext ResolvedMainContext => PreSocksResult is not null public CoreConfigContext ResolvedMainContext => PreSocksResult is not null
? MainResult.Context with ? MainResult.Context with
{ {
TunProtectSsPort = PreSocksResult.Context.TunProtectSsPort, TunProtectSocksPort = PreSocksResult.Context.TunProtectSocksPort,
ProxyRelaySsPort = PreSocksResult.Context.ProxyRelaySsPort, ProxyRelaySocksPort = PreSocksResult.Context.ProxyRelaySocksPort,
ProtectDomainList = [.. MainResult.Context.ProtectDomainList ?? [], .. PreSocksResult.Context.ProtectDomainList ?? []], ProtectDomainList = [.. MainResult.Context.ProtectDomainList ?? [], .. PreSocksResult.Context.ProtectDomainList ?? []],
} }
: MainResult.Context; : MainResult.Context;
@ -58,8 +58,8 @@ public class CoreConfigContextBuilder
IsTunEnabled = config.TunModeItem.EnableTun, IsTunEnabled = config.TunModeItem.EnableTun,
SimpleDnsItem = config.SimpleDNSItem, SimpleDnsItem = config.SimpleDNSItem,
ProtectDomainList = [], ProtectDomainList = [],
TunProtectSsPort = 0, TunProtectSocksPort = 0,
ProxyRelaySsPort = 0, ProxyRelaySocksPort = 0,
RawDnsItem = await AppManager.Instance.GetDNSItem(coreType), RawDnsItem = await AppManager.Instance.GetDNSItem(coreType),
RoutingItem = await ConfigHandler.GetDefaultRouting(config), RoutingItem = await ConfigHandler.GetDefaultRouting(config),
}; };
@ -155,28 +155,23 @@ public class CoreConfigContextBuilder
return null; return null;
} }
var tunProtectSsPort = Utils.GetFreePort(); var tunProtectSocksPort = Utils.GetFreePort();
var proxyRelaySsPort = Utils.GetFreePort(); var proxyRelaySocksPort = Utils.GetFreePort();
var preItem = new ProfileItem() var preItem = new ProfileItem()
{ {
CoreType = ECoreType.sing_box, CoreType = ECoreType.sing_box,
ConfigType = EConfigType.Shadowsocks, ConfigType = EConfigType.SOCKS,
Address = Global.Loopback, Address = Global.Loopback,
Port = proxyRelaySsPort, Port = proxyRelaySocksPort,
Password = Global.None,
}; };
preItem.SetProtocolExtra(preItem.GetProtocolExtra() with
{
SsMethod = Global.None,
});
var preResult2 = await Build(nodeContext.AppConfig, preItem); var preResult2 = await Build(nodeContext.AppConfig, preItem);
return preResult2 with return preResult2 with
{ {
Context = preResult2.Context with Context = preResult2.Context with
{ {
ProtectDomainList = [.. nodeContext.ProtectDomainList ?? [], .. preResult2.Context.ProtectDomainList ?? []], ProtectDomainList = [.. nodeContext.ProtectDomainList ?? [], .. preResult2.Context.ProtectDomainList ?? []],
TunProtectSsPort = tunProtectSsPort, TunProtectSocksPort = tunProtectSocksPort,
ProxyRelaySsPort = proxyRelaySsPort, ProxyRelaySocksPort = proxyRelaySocksPort,
} }
}; };
} }
@ -309,6 +304,11 @@ public class CoreConfigContextBuilder
} }
var nodeValidatorResult = NodeValidator.Validate(node, context.RunCoreType); var nodeValidatorResult = NodeValidator.Validate(node, context.RunCoreType);
var msgs = new List<string>([.. nodeValidatorResult.Errors, .. nodeValidatorResult.Warnings]);
if (msgs.Count > 0)
{
Logging.SaveLog($"{node.Remarks}: {string.Join("; ", msgs)}");
}
if (!nodeValidatorResult.Success) if (!nodeValidatorResult.Success)
{ {
return nodeValidatorResult; return nodeValidatorResult;

View file

@ -143,11 +143,19 @@ public class NodeValidator
if (item.Network == nameof(ETransport.xhttp) && !item.Extra.IsNullOrEmpty()) if (item.Network == nameof(ETransport.xhttp) && !item.Extra.IsNullOrEmpty())
{ {
if (JsonUtils.ParseJson(item.Extra) is null) if (JsonUtils.ParseJson(item.Extra) is not JsonObject)
{ {
v.Error(string.Format(ResUI.MsgInvalidProperty, "XHTTP Extra")); v.Error(string.Format(ResUI.MsgInvalidProperty, "XHTTP Extra"));
} }
} }
if (!item.Finalmask.IsNullOrEmpty())
{
if (JsonUtils.ParseJson(item.Finalmask) is not JsonObject)
{
v.Error(string.Format(ResUI.MsgInvalidProperty, "Finalmask"));
}
}
} }
private static string? ValidateSingboxTransport(EConfigType configType, string net) private static string? ValidateSingboxTransport(EConfigType configType, string net)

View file

@ -41,6 +41,7 @@ public static class ConfigHandler
Loglevel = "warning", Loglevel = "warning",
MuxEnabled = false, MuxEnabled = false,
}; };
config.CoreBasicItem.SendThrough = config.CoreBasicItem.SendThrough?.TrimEx();
if (config.Inbound == null) if (config.Inbound == null)
{ {

View file

@ -306,6 +306,7 @@ public sealed class AppManager
} }
#pragma warning disable CS0618 #pragma warning disable CS0618
public async Task MigrateProfileExtra() public async Task MigrateProfileExtra()
{ {
await MigrateProfileExtraGroup(); await MigrateProfileExtraGroup();
@ -500,6 +501,7 @@ public sealed class AppManager
//await ProfileGroupItemManager.Instance.ClearAll(); //await ProfileGroupItemManager.Instance.ClearAll();
} }
#pragma warning restore CS0618 #pragma warning restore CS0618
#endregion SqliteHelper #endregion SqliteHelper

View file

@ -68,6 +68,7 @@ public sealed class CoreInfoManager
DownloadUrlWinArm64 = urlN + "/download/{0}/v2rayN-windows-arm64.zip", DownloadUrlWinArm64 = urlN + "/download/{0}/v2rayN-windows-arm64.zip",
DownloadUrlLinux64 = urlN + "/download/{0}/v2rayN-linux-64.zip", DownloadUrlLinux64 = urlN + "/download/{0}/v2rayN-linux-64.zip",
DownloadUrlLinuxArm64 = urlN + "/download/{0}/v2rayN-linux-arm64.zip", DownloadUrlLinuxArm64 = urlN + "/download/{0}/v2rayN-linux-arm64.zip",
DownloadUrlLinuxRiscV64 = urlN + "/download/{0}/v2rayN-linux-riscv64.zip",
DownloadUrlOSX64 = urlN + "/download/{0}/v2rayN-macos-64.zip", DownloadUrlOSX64 = urlN + "/download/{0}/v2rayN-macos-64.zip",
DownloadUrlOSXArm64 = urlN + "/download/{0}/v2rayN-macos-arm64.zip", DownloadUrlOSXArm64 = urlN + "/download/{0}/v2rayN-macos-arm64.zip",
}, },
@ -111,6 +112,7 @@ public sealed class CoreInfoManager
DownloadUrlWinArm64 = urlXray + "/download/{0}/Xray-windows-arm64-v8a.zip", DownloadUrlWinArm64 = urlXray + "/download/{0}/Xray-windows-arm64-v8a.zip",
DownloadUrlLinux64 = urlXray + "/download/{0}/Xray-linux-64.zip", DownloadUrlLinux64 = urlXray + "/download/{0}/Xray-linux-64.zip",
DownloadUrlLinuxArm64 = urlXray + "/download/{0}/Xray-linux-arm64-v8a.zip", DownloadUrlLinuxArm64 = urlXray + "/download/{0}/Xray-linux-arm64-v8a.zip",
DownloadUrlLinuxRiscV64 = urlXray + "/download/{0}/Xray-linux-riscv64.zip",
DownloadUrlOSX64 = urlXray + "/download/{0}/Xray-macos-64.zip", DownloadUrlOSX64 = urlXray + "/download/{0}/Xray-macos-64.zip",
DownloadUrlOSXArm64 = urlXray + "/download/{0}/Xray-macos-arm64-v8a.zip", DownloadUrlOSXArm64 = urlXray + "/download/{0}/Xray-macos-arm64-v8a.zip",
Match = "Xray", Match = "Xray",
@ -133,6 +135,7 @@ public sealed class CoreInfoManager
DownloadUrlWinArm64 = urlMihomo + "/download/{0}/mihomo-windows-arm64-{0}.zip", DownloadUrlWinArm64 = urlMihomo + "/download/{0}/mihomo-windows-arm64-{0}.zip",
DownloadUrlLinux64 = urlMihomo + "/download/{0}/mihomo-linux-amd64-v1-{0}.gz", DownloadUrlLinux64 = urlMihomo + "/download/{0}/mihomo-linux-amd64-v1-{0}.gz",
DownloadUrlLinuxArm64 = urlMihomo + "/download/{0}/mihomo-linux-arm64-{0}.gz", DownloadUrlLinuxArm64 = urlMihomo + "/download/{0}/mihomo-linux-arm64-{0}.gz",
DownloadUrlLinuxRiscV64 = urlMihomo + "/download/{0}/mihomo-linux-riscv64-{0}.gz",
DownloadUrlOSX64 = urlMihomo + "/download/{0}/mihomo-darwin-amd64-v1-{0}.gz", DownloadUrlOSX64 = urlMihomo + "/download/{0}/mihomo-darwin-amd64-v1-{0}.gz",
DownloadUrlOSXArm64 = urlMihomo + "/download/{0}/mihomo-darwin-arm64-{0}.gz", DownloadUrlOSXArm64 = urlMihomo + "/download/{0}/mihomo-darwin-arm64-{0}.gz",
Match = "Mihomo", Match = "Mihomo",
@ -175,6 +178,7 @@ public sealed class CoreInfoManager
DownloadUrlWinArm64 = urlSingbox + "/download/{0}/sing-box-{1}-windows-arm64.zip", DownloadUrlWinArm64 = urlSingbox + "/download/{0}/sing-box-{1}-windows-arm64.zip",
DownloadUrlLinux64 = urlSingbox + "/download/{0}/sing-box-{1}-linux-amd64.tar.gz", DownloadUrlLinux64 = urlSingbox + "/download/{0}/sing-box-{1}-linux-amd64.tar.gz",
DownloadUrlLinuxArm64 = urlSingbox + "/download/{0}/sing-box-{1}-linux-arm64.tar.gz", DownloadUrlLinuxArm64 = urlSingbox + "/download/{0}/sing-box-{1}-linux-arm64.tar.gz",
DownloadUrlLinuxRiscV64 = urlSingbox + "/download/{0}/sing-box-{1}-linux-riscv64.tar.gz",
DownloadUrlOSX64 = urlSingbox + "/download/{0}/sing-box-{1}-darwin-amd64.tar.gz", DownloadUrlOSX64 = urlSingbox + "/download/{0}/sing-box-{1}-darwin-amd64.tar.gz",
DownloadUrlOSXArm64 = urlSingbox + "/download/{0}/sing-box-{1}-darwin-arm64.tar.gz", DownloadUrlOSXArm64 = urlSingbox + "/download/{0}/sing-box-{1}-darwin-arm64.tar.gz",
Match = "sing-box", Match = "sing-box",
@ -265,6 +269,7 @@ public sealed class CoreInfoManager
names.Add("mihomo-linux-amd64-v1"); names.Add("mihomo-linux-amd64-v1");
names.Add("mihomo-linux-amd64"); names.Add("mihomo-linux-amd64");
names.Add("mihomo-linux-arm64"); names.Add("mihomo-linux-arm64");
names.Add("mihomo-linux-riscv64");
} }
else if (Utils.IsMacOS()) else if (Utils.IsMacOS())
{ {

View file

@ -15,6 +15,8 @@ public class CoreBasicItem
public string DefUserAgent { get; set; } public string DefUserAgent { get; set; }
public string? SendThrough { get; set; }
public bool EnableFragment { get; set; } public bool EnableFragment { get; set; }
public bool EnableCacheFile4Sbox { get; set; } = true; public bool EnableCacheFile4Sbox { get; set; } = true;

View file

@ -20,6 +20,6 @@ public record CoreConfigContext
// -> tun inbound --(if routing proxy)--> relay outbound // -> tun inbound --(if routing proxy)--> relay outbound
// -> proxy core (relay inbound --> proxy outbound --(dialerProxy)--> protect outbound) // -> proxy core (relay inbound --> proxy outbound --(dialerProxy)--> protect outbound)
// -> protect inbound -> direct proxy outbound data -> internet // -> protect inbound -> direct proxy outbound data -> internet
public int TunProtectSsPort { get; init; } = 0; public int TunProtectSocksPort { get; init; } = 0;
public int ProxyRelaySsPort { get; init; } = 0; public int ProxyRelaySocksPort { get; init; } = 0;
} }

View file

@ -12,6 +12,7 @@ public class CoreInfo
public string? DownloadUrlWinArm64 { get; set; } public string? DownloadUrlWinArm64 { get; set; }
public string? DownloadUrlLinux64 { get; set; } public string? DownloadUrlLinux64 { get; set; }
public string? DownloadUrlLinuxArm64 { get; set; } public string? DownloadUrlLinuxArm64 { get; set; }
public string? DownloadUrlLinuxRiscV64 { get; set; }
public string? DownloadUrlOSX64 { get; set; } public string? DownloadUrlOSX64 { get; set; }
public string? DownloadUrlOSXArm64 { get; set; } public string? DownloadUrlOSXArm64 { get; set; }
public string? Match { get; set; } public string? Match { get; set; }

View file

@ -237,6 +237,8 @@ public class Transport4Sbox
public class Headers4Sbox public class Headers4Sbox
{ {
public string? Host { get; set; } public string? Host { get; set; }
[JsonPropertyName("User-Agent")]
public string UserAgent { get; set; }
} }
public class HyObfs4Sbox public class HyObfs4Sbox

View file

@ -105,6 +105,8 @@ public class Outbounds4Ray
public string protocol { get; set; } public string protocol { get; set; }
public string? sendThrough { get; set; }
public string? targetStrategy { get; set; } public string? targetStrategy { get; set; }
public Outboundsettings4Ray settings { get; set; } public Outboundsettings4Ray settings { get; set; }

View file

@ -222,6 +222,15 @@ namespace ServiceLib.Resx {
} }
} }
/// <summary>
/// 查找类似 Please fill in the correct IPv4 address for SendThrough. 的本地化字符串。
/// </summary>
public static string FillCorrectSendThroughIPv4 {
get {
return ResourceManager.GetString("FillCorrectSendThroughIPv4", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Please enter the correct port format. 的本地化字符串。 /// 查找类似 Please enter the correct port format. 的本地化字符串。
/// </summary> /// </summary>
@ -3763,7 +3772,7 @@ namespace ServiceLib.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 This parameter is valid only for tcp/http and ws 的本地化字符串。 /// 查找类似 This parameter is valid only for tcp/http, ws, gRPC and xhttp 的本地化字符串。
/// </summary> /// </summary>
public static string TbSettingsDefUserAgentTips { public static string TbSettingsDefUserAgentTips {
get { get {
@ -4149,6 +4158,24 @@ namespace ServiceLib.Resx {
} }
} }
/// <summary>
/// 查找类似 Local outbound address (SendThrough) 的本地化字符串。
/// </summary>
public static string TbSettingsSendThrough {
get {
return ResourceManager.GetString("TbSettingsSendThrough", resourceCulture);
}
}
/// <summary>
/// 查找类似 For multi-interface environments, enter the local machine&apos;s IPv4 address 的本地化字符串。
/// </summary>
public static string TbSettingsSendThroughTip {
get {
return ResourceManager.GetString("TbSettingsSendThroughTip", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Set Win10 UWP Loopback 的本地化字符串。 /// 查找类似 Set Win10 UWP Loopback 的本地化字符串。
/// </summary> /// </summary>

View file

@ -937,7 +937,7 @@
<value>User-Agent</value> <value>User-Agent</value>
</data> </data>
<data name="TbSettingsDefUserAgentTips" xml:space="preserve"> <data name="TbSettingsDefUserAgentTips" xml:space="preserve">
<value>این پارامتر فقط برای tcp/http و ws معتبر است</value> <value>This parameter is valid only for tcp/http, ws, gRPC and xhttp</value>
</data> </data>
<data name="TbSettingsCurrentFontFamily" xml:space="preserve"> <data name="TbSettingsCurrentFontFamily" xml:space="preserve">
<value>FontFamily (نیاز به راه اندازی مجدد)</value> <value>FontFamily (نیاز به راه اندازی مجدد)</value>
@ -1698,4 +1698,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
<data name="TbLegacyProtect" xml:space="preserve"> <data name="TbLegacyProtect" xml:space="preserve">
<value>Legacy TUN Protect</value> <value>Legacy TUN Protect</value>
</data> </data>
<data name="TbSettingsSendThroughTip" xml:space="preserve">
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
</data>
</root> </root>

View file

@ -937,7 +937,7 @@
<value>Agent utilisateur (User-Agent)</value> <value>Agent utilisateur (User-Agent)</value>
</data> </data>
<data name="TbSettingsDefUserAgentTips" xml:space="preserve"> <data name="TbSettingsDefUserAgentTips" xml:space="preserve">
<value>Valable uniquement pour les protocoles tcp/http et ws</value> <value>This parameter is valid only for tcp/http, ws, gRPC and xhttp</value>
</data> </data>
<data name="TbSettingsCurrentFontFamily" xml:space="preserve"> <data name="TbSettingsCurrentFontFamily" xml:space="preserve">
<value>Police actuelle (redémarrage requis)</value> <value>Police actuelle (redémarrage requis)</value>
@ -1316,6 +1316,15 @@
</data> </data>
<data name="TbSettingsLinuxSudoPasswordTip" xml:space="preserve"> <data name="TbSettingsLinuxSudoPasswordTip" xml:space="preserve">
<value>Le mot de passe sera vérifié en ligne de commande. En cas déchec ou de dysfonctionnement, redémarrez lapplication. Il nest pas stocké et doit être saisi à chaque redémarrage.</value> <value>Le mot de passe sera vérifié en ligne de commande. En cas déchec ou de dysfonctionnement, redémarrez lapplication. Il nest pas stocké et doit être saisi à chaque redémarrage.</value>
</data>
<data name="TbSettingsSendThrough" xml:space="preserve">
<value>Adresse sortante locale (SendThrough)</value>
</data>
<data name="TbSettingsSendThroughTip" xml:space="preserve">
<value>Pour environnement multi-interfaces, veuillez saisir ladresse IPv4 de la machine locale.</value>
</data>
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
<value>Veuillez saisir ladresse IPv4 correcte de SendThrough.</value>
</data> </data>
<data name="TransportHeaderTypeTip5" xml:space="preserve"> <data name="TransportHeaderTypeTip5" xml:space="preserve">
<value>*Mode XHTTP</value> <value>*Mode XHTTP</value>
@ -1621,49 +1630,49 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
<value>Finalmask</value> <value>Finalmask</value>
</data> </data>
<data name="MsgRoutingRuleOutboundNodeWarning" xml:space="preserve"> <data name="MsgRoutingRuleOutboundNodeWarning" xml:space="preserve">
<value>Routing rule {0} outbound node {1} warning: {2}</value> <value>Règle de routage {0} nœud sortant {1} avertissement: {2}</value>
</data> </data>
<data name="MsgRoutingRuleOutboundNodeError" xml:space="preserve"> <data name="MsgRoutingRuleOutboundNodeError" xml:space="preserve">
<value>Routing rule {0} outbound node {1} error: {2}. Fallback to proxy node only.</value> <value>Règle {0} nœud VPN sortant {1} erreur : {2}. Repli nœud proxy uniquement.</value>
</data> </data>
<data name="MsgGroupCycleDependency" xml:space="preserve"> <data name="MsgGroupCycleDependency" xml:space="preserve">
<value>Group {0} has a cycle dependency on child node {1}. Skipping this node.</value> <value>Le groupe {0} a une dépendance cyclique avec le nœud enfant {1}. Nœud ignoré.</value>
</data> </data>
<data name="MsgGroupChildNodeWarning" xml:space="preserve"> <data name="MsgGroupChildNodeWarning" xml:space="preserve">
<value>Group {0} child node {1} warning: {2}</value> <value>Groupe {0} nœud enfant {1} avertissement : {2}</value>
</data> </data>
<data name="MsgGroupChildNodeError" xml:space="preserve"> <data name="MsgGroupChildNodeError" xml:space="preserve">
<value>Group {0} child node {1} error: {2}. Skipping this node.</value> <value>Groupe {0} nœud enfant {1} erreur : {2}. Nœud ignoré.</value>
</data> </data>
<data name="MsgGroupChildGroupNodeWarning" xml:space="preserve"> <data name="MsgGroupChildGroupNodeWarning" xml:space="preserve">
<value>Group {0} child group node {1} warning: {2}</value> <value>Groupe {0} nœud enfant groupe {1} avertissement: {2}</value>
</data> </data>
<data name="MsgGroupChildGroupNodeError" xml:space="preserve"> <data name="MsgGroupChildGroupNodeError" xml:space="preserve">
<value>Group {0} child group node {1} error: {2}. Skipping this node.</value> <value>Groupe {0} nœud groupe enfant {1} erreur: {2}. Nœud ignoré.</value>
</data> </data>
<data name="MsgGroupNoValidChildNode" xml:space="preserve"> <data name="MsgGroupNoValidChildNode" xml:space="preserve">
<value>Group {0} has no valid child node.</value> <value>Groupe {0} na aucun nœud enfant valide.</value>
</data> </data>
<data name="MsgRoutingRuleEmptyOutboundTag" xml:space="preserve"> <data name="MsgRoutingRuleEmptyOutboundTag" xml:space="preserve">
<value>Routing rule {0} has an empty outbound tag. Fallback to proxy node only.</value> <value>Règle de routage {0} tag sortant vide. Replié sur le nœud proxy uniquement.</value>
</data> </data>
<data name="MsgRoutingRuleOutboundNodeNotFound" xml:space="preserve"> <data name="MsgRoutingRuleOutboundNodeNotFound" xml:space="preserve">
<value>Routing rule {0} outbound node {1} not found. Fallback to proxy node only.</value> <value>Règle de routage {0} nœud sortant {1} introuvable. Repli sur le seul nœud proxy.</value>
</data> </data>
<data name="MsgSubscriptionPrevProfileNotFound" xml:space="preserve"> <data name="MsgSubscriptionPrevProfileNotFound" xml:space="preserve">
<value>Subscription previous proxy {0} not found. Skipping.</value> <value>Nœud proxy précédent de labonnement {0} introuvable. Ignoré.</value>
</data> </data>
<data name="MsgSubscriptionNextProfileNotFound" xml:space="preserve"> <data name="MsgSubscriptionNextProfileNotFound" xml:space="preserve">
<value>Subscription next proxy {0} not found. Skipping.</value> <value>Nœud proxy suivant de labonnement {0} introuvable. Ignoré.</value>
</data> </data>
<data name="menuGenGroupServer" xml:space="preserve"> <data name="menuGenGroupServer" xml:space="preserve">
<value>Generate Policy Group</value> <value>Générer groupe de stratégie</value>
</data> </data>
<data name="menuAllServers" xml:space="preserve"> <data name="menuAllServers" xml:space="preserve">
<value>All configurations</value> <value>Toutes configurations</value>
</data> </data>
<data name="menuGenRegionGroup" xml:space="preserve"> <data name="menuGenRegionGroup" xml:space="preserve">
<value>Group by Region</value> <value>Grouper par région</value>
</data> </data>
<data name="menuEditCopy" xml:space="preserve"> <data name="menuEditCopy" xml:space="preserve">
<value>Copier</value> <value>Copier</value>
@ -1672,7 +1681,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
<value>Tout sélect</value> <value>Tout sélect</value>
</data> </data>
<data name="menuEditPaste" xml:space="preserve"> <data name="menuEditPaste" xml:space="preserve">
<value>Paste</value> <value>Coller</value>
</data> </data>
<data name="menuEditFormat" xml:space="preserve"> <data name="menuEditFormat" xml:space="preserve">
<value>Format</value> <value>Format</value>
@ -1687,12 +1696,15 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
<value>Insecure Concurrency</value> <value>Insecure Concurrency</value>
</data> </data>
<data name="TbUsername" xml:space="preserve"> <data name="TbUsername" xml:space="preserve">
<value>Username</value> <value>Nom dutilisateur</value>
</data> </data>
<data name="TbIcmpRoutingPolicy" xml:space="preserve"> <data name="TbIcmpRoutingPolicy" xml:space="preserve">
<value>ICMP routing policy</value> <value>Politique de routage ICMP</value>
</data> </data>
<data name="TbLegacyProtect" xml:space="preserve"> <data name="TbLegacyProtect" xml:space="preserve">
<value>Legacy TUN Protect</value> <value>Protection TUN héritée</value>
</data> </data>
</root> <data name="TbSettingsSendThroughTip" xml:space="preserve">
<value>Pour environnements multi-interfaces, entrez ladresse IPv4 de la machine locale.</value>
</data>
</root>

View file

@ -937,7 +937,7 @@
<value>User-Agent</value> <value>User-Agent</value>
</data> </data>
<data name="TbSettingsDefUserAgentTips" xml:space="preserve"> <data name="TbSettingsDefUserAgentTips" xml:space="preserve">
<value>Ez a paraméter csak tcp/http és ws esetén érvényes</value> <value>This parameter is valid only for tcp/http, ws, gRPC and xhttp</value>
</data> </data>
<data name="TbSettingsCurrentFontFamily" xml:space="preserve"> <data name="TbSettingsCurrentFontFamily" xml:space="preserve">
<value>Betűtípus (újraindítást igényel)</value> <value>Betűtípus (újraindítást igényel)</value>
@ -1698,4 +1698,7 @@ The "Get Certificate" action may fail if a self-signed certificate is used or if
<data name="TbLegacyProtect" xml:space="preserve"> <data name="TbLegacyProtect" xml:space="preserve">
<value>Legacy TUN Protect</value> <value>Legacy TUN Protect</value>
</data> </data>
<data name="TbSettingsSendThroughTip" xml:space="preserve">
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
</data>
</root> </root>

View file

@ -937,7 +937,7 @@
<value>User-Agent</value> <value>User-Agent</value>
</data> </data>
<data name="TbSettingsDefUserAgentTips" xml:space="preserve"> <data name="TbSettingsDefUserAgentTips" xml:space="preserve">
<value>This parameter is valid only for tcp/http and ws</value> <value>This parameter is valid only for tcp/http, ws, gRPC and xhttp</value>
</data> </data>
<data name="TbSettingsCurrentFontFamily" xml:space="preserve"> <data name="TbSettingsCurrentFontFamily" xml:space="preserve">
<value>Font family (requires restart)</value> <value>Font family (requires restart)</value>
@ -1320,6 +1320,15 @@
<data name="TbSettingsLinuxSudoPasswordTip" xml:space="preserve"> <data name="TbSettingsLinuxSudoPasswordTip" xml:space="preserve">
<value>The password will be validated via the command line. If a validation error causes the application to malfunction, please restart the application. The password will not be stored and must be entered again after each restart.</value> <value>The password will be validated via the command line. If a validation error causes the application to malfunction, please restart the application. The password will not be stored and must be entered again after each restart.</value>
</data> </data>
<data name="TbSettingsSendThrough" xml:space="preserve">
<value>Local outbound address (SendThrough)</value>
</data>
<data name="TbSettingsSendThroughTip" xml:space="preserve">
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
</data>
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
<value>Please fill in the correct IPv4 address for SendThrough.</value>
</data>
<data name="TransportHeaderTypeTip5" xml:space="preserve"> <data name="TransportHeaderTypeTip5" xml:space="preserve">
<value>*xhttp mode</value> <value>*xhttp mode</value>
</data> </data>

View file

@ -142,7 +142,7 @@
<value>Не удалось получить конфигурацию по умолчанию</value> <value>Не удалось получить конфигурацию по умолчанию</value>
</data> </data>
<data name="FailedImportedCustomServer" xml:space="preserve"> <data name="FailedImportedCustomServer" xml:space="preserve">
<value>Не удалось импортировать сервер пользовательской конфигурации</value> <value>Не удалось импортировать пользовательскую конфигурацию</value>
</data> </data>
<data name="FailedReadConfiguration" xml:space="preserve"> <data name="FailedReadConfiguration" xml:space="preserve">
<value>Не удалось прочитать файл конфигурации</value> <value>Не удалось прочитать файл конфигурации</value>
@ -211,13 +211,13 @@
<value>Не удалось импортировать подписку</value> <value>Не удалось импортировать подписку</value>
</data> </data>
<data name="MsgGetSubscriptionSuccessfully" xml:space="preserve"> <data name="MsgGetSubscriptionSuccessfully" xml:space="preserve">
<value>Содержимое подписки успешно импортировано</value> <value>Содержимое подписки успешно получено</value>
</data> </data>
<data name="MsgNoValidSubscription" xml:space="preserve"> <data name="MsgNoValidSubscription" xml:space="preserve">
<value>Нет установленных подписок</value> <value>Нет установленных подписок</value>
</data> </data>
<data name="MsgParsingSuccessfully" xml:space="preserve"> <data name="MsgParsingSuccessfully" xml:space="preserve">
<value>Парсинг {0} прошел успешно</value> <value>Успешно обработано: {0}</value>
</data> </data>
<data name="MsgStartGettingSubscriptions" xml:space="preserve"> <data name="MsgStartGettingSubscriptions" xml:space="preserve">
<value>Начинаю получать подписки</value> <value>Начинаю получать подписки</value>
@ -244,7 +244,7 @@
<value>Успешное обновление ядра! Перезапуск службы...</value> <value>Успешное обновление ядра! Перезапуск службы...</value>
</data> </data>
<data name="NonvmessOrssProtocol" xml:space="preserve"> <data name="NonvmessOrssProtocol" xml:space="preserve">
<value>Не является протоколом VMess или Shadowsocks</value> <value>Протокол не VMess и не Shadowsocks</value>
</data> </data>
<data name="NotFoundCore" xml:space="preserve"> <data name="NotFoundCore" xml:space="preserve">
<value>Файл ядра ({1}) не найден в папке {0}. Скачайте по адресу {2} и поместите его туда</value> <value>Файл ядра ({1}) не найден в папке {0}. Скачайте по адресу {2} и поместите его туда</value>
@ -253,7 +253,7 @@
<value>Сканирование завершено, не найден корректный QR код</value> <value>Сканирование завершено, не найден корректный QR код</value>
</data> </data>
<data name="OperationFailed" xml:space="preserve"> <data name="OperationFailed" xml:space="preserve">
<value>Операция безуспешна, проверьте и попробуйте ещё раз</value> <value>Операция не удалась, проверьте и повторите попытку</value>
</data> </data>
<data name="PleaseFillRemarks" xml:space="preserve"> <data name="PleaseFillRemarks" xml:space="preserve">
<value>Введите примечания</value> <value>Введите примечания</value>
@ -268,7 +268,7 @@
<value>Сначала выберите сервер</value> <value>Сначала выберите сервер</value>
</data> </data>
<data name="RemoveDuplicateServerResult" xml:space="preserve"> <data name="RemoveDuplicateServerResult" xml:space="preserve">
<value>Удаление дублей завершено. Старая: {0}, Новая: {1}</value> <value>Дедупликация конфигураций завершена. Было: {0}, Стало: {1}.</value>
</data> </data>
<data name="RemoveServer" xml:space="preserve"> <data name="RemoveServer" xml:space="preserve">
<value>Вы уверены, что хотите удалить сервер?</value> <value>Вы уверены, что хотите удалить сервер?</value>
@ -283,16 +283,16 @@
<value>Конфигурация выполнена успешно {0}</value> <value>Конфигурация выполнена успешно {0}</value>
</data> </data>
<data name="SuccessfullyImportedCustomServer" xml:space="preserve"> <data name="SuccessfullyImportedCustomServer" xml:space="preserve">
<value>Пользовательская конфигурация сервера успешно импортирована</value> <value>Пользовательская конфигурация успешно импортирована</value>
</data> </data>
<data name="SuccessfullyImportedServerViaClipboard" xml:space="preserve"> <data name="SuccessfullyImportedServerViaClipboard" xml:space="preserve">
<value>{0} серверов импортировано из буфера обмена</value> <value>Из буфера обмена импортировано конфигураций: {0}</value>
</data> </data>
<data name="SuccessfullyImportedServerViaScan" xml:space="preserve"> <data name="SuccessfullyImportedServerViaScan" xml:space="preserve">
<value>Сканирование URL-адреса импорта прошло успешно</value> <value>Ссылка общего доступа успешно отсканирована и импортирована</value>
</data> </data>
<data name="TestMeOutput" xml:space="preserve"> <data name="TestMeOutput" xml:space="preserve">
<value>Задержка текущего сервера: {0} мс, {1}</value> <value>Задержка: {0} мс, {1}</value>
</data> </data>
<data name="OperationSuccess" xml:space="preserve"> <data name="OperationSuccess" xml:space="preserve">
<value>Операция успешна</value> <value>Операция успешна</value>
@ -334,7 +334,7 @@
<value>Введите корректный пользовательский DNS</value> <value>Введите корректный пользовательский DNS</value>
</data> </data>
<data name="TransportPathTip1" xml:space="preserve"> <data name="TransportPathTip1" xml:space="preserve">
<value>*WebSocket-путь</value> <value>*Путь ws/http upgrade/xhttp</value>
</data> </data>
<data name="TransportPathTip2" xml:space="preserve"> <data name="TransportPathTip2" xml:space="preserve">
<value>*HTTP2-путь</value> <value>*HTTP2-путь</value>
@ -349,7 +349,7 @@
<value>*http-хосты, разделённые запятыми (,)</value> <value>*http-хосты, разделённые запятыми (,)</value>
</data> </data>
<data name="TransportRequestHostTip2" xml:space="preserve"> <data name="TransportRequestHostTip2" xml:space="preserve">
<value>*WebSocket-хост</value> <value>*Хост ws/http upgrade/xhttp</value>
</data> </data>
<data name="TransportRequestHostTip3" xml:space="preserve"> <data name="TransportRequestHostTip3" xml:space="preserve">
<value>*HTTP2-хосты, разделённые запятыми (,)</value> <value>*HTTP2-хосты, разделённые запятыми (,)</value>
@ -382,7 +382,7 @@
<value>Глобальная горячая клавиша {0} зарегистрирована успешно</value> <value>Глобальная горячая клавиша {0} зарегистрирована успешно</value>
</data> </data>
<data name="AllGroupServers" xml:space="preserve"> <data name="AllGroupServers" xml:space="preserve">
<value>Все серверы</value> <value>Все</value>
</data> </data>
<data name="FillServerAddressCustom" xml:space="preserve"> <data name="FillServerAddressCustom" xml:space="preserve">
<value>Выберите файл конфигурации сервера для импорта</value> <value>Выберите файл конфигурации сервера для импорта</value>
@ -397,7 +397,7 @@
<value>Локальный</value> <value>Локальный</value>
</data> </data>
<data name="MsgServerTitle" xml:space="preserve"> <data name="MsgServerTitle" xml:space="preserve">
<value>Фильтр серверов</value> <value>Фильтр, нажмите Enter для выполнения</value>
</data> </data>
<data name="menuCheckUpdate" xml:space="preserve"> <data name="menuCheckUpdate" xml:space="preserve">
<value>Проверить обновления</value> <value>Проверить обновления</value>
@ -409,19 +409,19 @@
<value>Выход</value> <value>Выход</value>
</data> </data>
<data name="menuGlobalHotkeySetting" xml:space="preserve"> <data name="menuGlobalHotkeySetting" xml:space="preserve">
<value>Глобальная настройка горячих клавиш</value> <value>Настройка глобальных горячих клавиш</value>
</data> </data>
<data name="menuHelp" xml:space="preserve"> <data name="menuHelp" xml:space="preserve">
<value>Помощь</value> <value>Помощь</value>
</data> </data>
<data name="menuOptionSetting" xml:space="preserve"> <data name="menuOptionSetting" xml:space="preserve">
<value>Настройка параметров</value> <value>Настройки</value>
</data> </data>
<data name="menuPromotion" xml:space="preserve"> <data name="menuPromotion" xml:space="preserve">
<value>Содействие</value> <value>Продвижение</value>
</data> </data>
<data name="menuReload" xml:space="preserve"> <data name="menuReload" xml:space="preserve">
<value>Перезагрузка</value> <value>Перезагрузить</value>
</data> </data>
<data name="menuRoutingSetting" xml:space="preserve"> <data name="menuRoutingSetting" xml:space="preserve">
<value>Настройки маршрутизации</value> <value>Настройки маршрутизации</value>
@ -436,13 +436,13 @@
<value>Обновить текущую подписку без прокси</value> <value>Обновить текущую подписку без прокси</value>
</data> </data>
<data name="menuSubGroupUpdateViaProxy" xml:space="preserve"> <data name="menuSubGroupUpdateViaProxy" xml:space="preserve">
<value>Обновить подписку через прокси</value> <value>Обновить текущую подписку через прокси</value>
</data> </data>
<data name="menuSubscription" xml:space="preserve"> <data name="menuSubscription" xml:space="preserve">
<value>Группа подписки</value> <value>Группа подписки</value>
</data> </data>
<data name="menuSubSetting" xml:space="preserve"> <data name="menuSubSetting" xml:space="preserve">
<value>Настройки группы подписки</value> <value>Настройки групп подписки</value>
</data> </data>
<data name="menuSubUpdate" xml:space="preserve"> <data name="menuSubUpdate" xml:space="preserve">
<value>Обновить подписку без прокси</value> <value>Обновить подписку без прокси</value>
@ -472,46 +472,46 @@
<value>Язык (требуется перезапуск)</value> <value>Язык (требуется перезапуск)</value>
</data> </data>
<data name="menuAddServerViaClipboard" xml:space="preserve"> <data name="menuAddServerViaClipboard" xml:space="preserve">
<value>Импорт массива URL из буфера обмена</value> <value>Импорт ссылок общего доступа из буфера обмена</value>
</data> </data>
<data name="menuAddServerViaScan" xml:space="preserve"> <data name="menuAddServerViaScan" xml:space="preserve">
<value>Сканировать QR-код с экрана</value> <value>Сканировать QR-код на экране</value>
</data> </data>
<data name="menuCopyServer" xml:space="preserve"> <data name="menuCopyServer" xml:space="preserve">
<value>Клонировать выбранный сервер</value> <value>Клонировать выбранное</value>
</data> </data>
<data name="menuRemoveDuplicateServer" xml:space="preserve"> <data name="menuRemoveDuplicateServer" xml:space="preserve">
<value>Удалить дубликаты серверов</value> <value>Удалить дубликаты</value>
</data> </data>
<data name="menuRemoveServer" xml:space="preserve"> <data name="menuRemoveServer" xml:space="preserve">
<value>Удалить выбранные серверы</value> <value>Удалить выбранное</value>
</data> </data>
<data name="menuSetDefaultServer" xml:space="preserve"> <data name="menuSetDefaultServer" xml:space="preserve">
<value>Установить как активный сервер</value> <value>Сделать активным</value>
</data> </data>
<data name="menuClearServerStatistics" xml:space="preserve"> <data name="menuClearServerStatistics" xml:space="preserve">
<value>Очистить всю статистику</value> <value>Очистить статистику всех сервисов</value>
</data> </data>
<data name="menuRealPingServer" xml:space="preserve"> <data name="menuRealPingServer" xml:space="preserve">
<value>Тест на реальную задержку сервера</value> <value>Тест реальной задержки</value>
</data> </data>
<data name="menuSortServerResult" xml:space="preserve"> <data name="menuSortServerResult" xml:space="preserve">
<value>Сортировать по результату теста</value> <value>Сортировка по результату теста</value>
</data> </data>
<data name="menuSpeedServer" xml:space="preserve"> <data name="menuSpeedServer" xml:space="preserve">
<value>Тест на скорость загрузки сервера</value> <value>Тест скорости загрузки</value>
</data> </data>
<data name="menuTcpingServer" xml:space="preserve"> <data name="menuTcpingServer" xml:space="preserve">
<value>Тест задержки с tcping</value> <value>Тест tcping</value>
</data> </data>
<data name="menuExport2ClientConfig" xml:space="preserve"> <data name="menuExport2ClientConfig" xml:space="preserve">
<value>Экспортировать выбранный сервер для клиента</value> <value>Экспортировать выбранное как полную конфигурацию</value>
</data> </data>
<data name="menuExport2ShareUrl" xml:space="preserve"> <data name="menuExport2ShareUrl" xml:space="preserve">
<value>Экспорт URL-адресов общего доступа в буфер обмена</value> <value>Копировать ссылку общего доступа в буфер обмена</value>
</data> </data>
<data name="menuAddCustomServer" xml:space="preserve"> <data name="menuAddCustomServer" xml:space="preserve">
<value>Добавить сервер пользовательской конфигурации</value> <value>Добавить пользовательскую конфигурацию</value>
</data> </data>
<data name="menuAddShadowsocksServer" xml:space="preserve"> <data name="menuAddShadowsocksServer" xml:space="preserve">
<value>Добавить сервер [Shadowsocks]</value> <value>Добавить сервер [Shadowsocks]</value>
@ -556,13 +556,13 @@
<value>Поделиться</value> <value>Поделиться</value>
</data> </data>
<data name="LvEnabled" xml:space="preserve"> <data name="LvEnabled" xml:space="preserve">
<value>Включены обновления</value> <value>Включить обновление</value>
</data> </data>
<data name="LvSort" xml:space="preserve"> <data name="LvSort" xml:space="preserve">
<value>Сортировка</value> <value>Сортировка</value>
</data> </data>
<data name="LvUserAgent" xml:space="preserve"> <data name="LvUserAgent" xml:space="preserve">
<value>Заголовок User-Agent</value> <value>User-Agent</value>
</data> </data>
<data name="TbCancel" xml:space="preserve"> <data name="TbCancel" xml:space="preserve">
<value>Отмена</value> <value>Отмена</value>
@ -595,7 +595,7 @@
<value>UUID (id)</value> <value>UUID (id)</value>
</data> </data>
<data name="TbNetwork" xml:space="preserve"> <data name="TbNetwork" xml:space="preserve">
<value>Транспортный протокол сети</value> <value>Транспортный протокол (network)</value>
</data> </data>
<data name="TbPath" xml:space="preserve"> <data name="TbPath" xml:space="preserve">
<value>Путь</value> <value>Путь</value>
@ -604,13 +604,13 @@
<value>Порт</value> <value>Порт</value>
</data> </data>
<data name="TbRemarks" xml:space="preserve"> <data name="TbRemarks" xml:space="preserve">
<value>Примечание</value> <value>Псевдоним (remarks)</value>
</data> </data>
<data name="TbRequestHost" xml:space="preserve"> <data name="TbRequestHost" xml:space="preserve">
<value>Маскирующий домен (хост)</value> <value>Камуфляжный домен (host)</value>
</data> </data>
<data name="TbSecurity" xml:space="preserve"> <data name="TbSecurity" xml:space="preserve">
<value>Метод шифрования</value> <value>Метод шифрования (security)</value>
</data> </data>
<data name="TbSNI" xml:space="preserve"> <data name="TbSNI" xml:space="preserve">
<value>SNI</value> <value>SNI</value>
@ -619,13 +619,13 @@
<value>TLS</value> <value>TLS</value>
</data> </data>
<data name="TipNetwork" xml:space="preserve"> <data name="TipNetwork" xml:space="preserve">
<value>*По-умолчанию TCP</value> <value>*По умолчанию TCP</value>
</data> </data>
<data name="TbCoreType" xml:space="preserve"> <data name="TbCoreType" xml:space="preserve">
<value>Ядро</value> <value>Ядро</value>
</data> </data>
<data name="TbFlow5" xml:space="preserve"> <data name="TbFlow5" xml:space="preserve">
<value>Поток</value> <value>Управление потоком (Flow)</value>
</data> </data>
<data name="TbGUID" xml:space="preserve"> <data name="TbGUID" xml:space="preserve">
<value>Генерировать</value> <value>Генерировать</value>
@ -634,7 +634,7 @@
<value>Пароль</value> <value>Пароль</value>
</data> </data>
<data name="TbId4" xml:space="preserve"> <data name="TbId4" xml:space="preserve">
<value>Пароль(Необязательно)</value> <value>Парольеобязательно)</value>
</data> </data>
<data name="TbId5" xml:space="preserve"> <data name="TbId5" xml:space="preserve">
<value>UUID(id)</value> <value>UUID(id)</value>
@ -643,10 +643,10 @@
<value>Шифрование</value> <value>Шифрование</value>
</data> </data>
<data name="TbSecurity4" xml:space="preserve"> <data name="TbSecurity4" xml:space="preserve">
<value>Пользователь(Необязательно)</value> <value>Пользовательеобязательно)</value>
</data> </data>
<data name="TbSecurity5" xml:space="preserve"> <data name="TbSecurity5" xml:space="preserve">
<value>Шифрования</value> <value>Шифрование</value>
</data> </data>
<data name="TbPreSocksPort" xml:space="preserve"> <data name="TbPreSocksPort" xml:space="preserve">
<value>Порт SOCKS</value> <value>Порт SOCKS</value>
@ -655,7 +655,7 @@
<value>* После установки этого значения служба SOCKS будет запущена с использованием Xray/sing-box(TUN) для обеспечения таких функций, как отображение скорости</value> <value>* После установки этого значения служба SOCKS будет запущена с использованием Xray/sing-box(TUN) для обеспечения таких функций, как отображение скорости</value>
</data> </data>
<data name="TbBrowse" xml:space="preserve"> <data name="TbBrowse" xml:space="preserve">
<value>Просмотр</value> <value>Обзор</value>
</data> </data>
<data name="TbEdit" xml:space="preserve"> <data name="TbEdit" xml:space="preserve">
<value>Редактировать</value> <value>Редактировать</value>
@ -667,7 +667,7 @@
<value>Разрешить подключения из локальной сети</value> <value>Разрешить подключения из локальной сети</value>
</data> </data>
<data name="TbSettingsAutoHideStartup" xml:space="preserve"> <data name="TbSettingsAutoHideStartup" xml:space="preserve">
<value>Автоскрытие при автозапуске</value> <value>Автоматически скрывать при запуске</value>
</data> </data>
<data name="TbSettingsAutoUpdateInterval" xml:space="preserve"> <data name="TbSettingsAutoUpdateInterval" xml:space="preserve">
<value>Интервал автоматического обновления Geo в часах</value> <value>Интервал автоматического обновления Geo в часах</value>
@ -676,7 +676,7 @@
<value>Ядро: базовые настройки</value> <value>Ядро: базовые настройки</value>
</data> </data>
<data name="TbCustomDnsRay" xml:space="preserve"> <data name="TbCustomDnsRay" xml:space="preserve">
<value>V2ray Custom DNS</value> <value>Пользовательский DNS для V2ray</value>
</data> </data>
<data name="TbSettingsCoreKcp" xml:space="preserve"> <data name="TbSettingsCoreKcp" xml:space="preserve">
<value>Ядро: настройки KCP</value> <value>Ядро: настройки KCP</value>
@ -700,10 +700,10 @@
<value>Исключение</value> <value>Исключение</value>
</data> </data>
<data name="TbSettingsExceptionTip" xml:space="preserve"> <data name="TbSettingsExceptionTip" xml:space="preserve">
<value>Исключение. Не используйте прокси-сервер для адресов, начинающихся с (,), используйте точку с запятой (;)</value> <value>Исключения: не использовать прокси для адресов, начинающихся с указанных. Разделяйте точкой с запятой (;)</value>
</data> </data>
<data name="TbSettingsDisplayRealTimeSpeed" xml:space="preserve"> <data name="TbSettingsDisplayRealTimeSpeed" xml:space="preserve">
<value>Показывать скорость в реальном времени</value> <value>Показывать скорость в реальном времени (требуется перезапуск)</value>
</data> </data>
<data name="TbSettingsKeepOlderDedupl" xml:space="preserve"> <data name="TbSettingsKeepOlderDedupl" xml:space="preserve">
<value>Сохранить старые при удалении дублей</value> <value>Сохранить старые при удалении дублей</value>
@ -721,7 +721,7 @@
<value>Настройки v2rayN</value> <value>Настройки v2rayN</value>
</data> </data>
<data name="TbSettingsPass" xml:space="preserve"> <data name="TbSettingsPass" xml:space="preserve">
<value>Пароль аутентификации</value> <value>Пароль авторизации</value>
</data> </data>
<data name="TbSettingsRemoteDNS" xml:space="preserve"> <data name="TbSettingsRemoteDNS" xml:space="preserve">
<value>Пользовательский DNS (если несколько, то делите запятыми (,))</value> <value>Пользовательский DNS (если несколько, то делите запятыми (,))</value>
@ -736,10 +736,10 @@
<value>Смешанный порт</value> <value>Смешанный порт</value>
</data> </data>
<data name="TbSettingsStartBoot" xml:space="preserve"> <data name="TbSettingsStartBoot" xml:space="preserve">
<value>Автозапуск</value> <value>Запускать при старте системы</value>
</data> </data>
<data name="TbSettingsStatistics" xml:space="preserve"> <data name="TbSettingsStatistics" xml:space="preserve">
<value>Включить статистику (требуется перезагрузка)</value> <value>Включить статистику трафика (требуется перезапуск)</value>
</data> </data>
<data name="TbSettingsSubConvert" xml:space="preserve"> <data name="TbSettingsSubConvert" xml:space="preserve">
<value>URL конвертации подписок</value> <value>URL конвертации подписок</value>
@ -748,31 +748,31 @@
<value>Настройки системного прокси</value> <value>Настройки системного прокси</value>
</data> </data>
<data name="TbSettingsTrayMenuServersLimit" xml:space="preserve"> <data name="TbSettingsTrayMenuServersLimit" xml:space="preserve">
<value>Лимит серверов в меню трея</value> <value>Лимит отображения серверов в контекстном меню трея</value>
</data> </data>
<data name="TbSettingsUdpEnabled" xml:space="preserve"> <data name="TbSettingsUdpEnabled" xml:space="preserve">
<value>Включить UDP</value> <value>Включить UDP</value>
</data> </data>
<data name="TbSettingsUser" xml:space="preserve"> <data name="TbSettingsUser" xml:space="preserve">
<value>Имя пользователя (логин)</value> <value>Пользователь авторизации</value>
</data> </data>
<data name="TbClearSystemProxy" xml:space="preserve"> <data name="TbClearSystemProxy" xml:space="preserve">
<value>Очистить системный прокси</value> <value>Очистить системный прокси</value>
</data> </data>
<data name="TbDisplayGUI" xml:space="preserve"> <data name="TbDisplayGUI" xml:space="preserve">
<value>Показать GUI</value> <value>Показать интерфейс</value>
</data> </data>
<data name="TbGlobalHotkeySetting" xml:space="preserve"> <data name="TbGlobalHotkeySetting" xml:space="preserve">
<value>Настройка горячих клавиш</value> <value>Настройка глобальных горячих клавиш</value>
</data> </data>
<data name="TbGlobalHotkeySettingTip" xml:space="preserve"> <data name="TbGlobalHotkeySettingTip" xml:space="preserve">
<value>Установите непосредственно, нажав на клавиатуру, вступит в силу после перезапуска</value> <value>Задайте, нажав нужную комбинацию клавиш; вступит в силу после перезапуска</value>
</data> </data>
<data name="TbNotChangeSystemProxy" xml:space="preserve"> <data name="TbNotChangeSystemProxy" xml:space="preserve">
<value>Не изменять системный прокси</value> <value>Не менять системный прокси</value>
</data> </data>
<data name="TbReset" xml:space="preserve"> <data name="TbReset" xml:space="preserve">
<value>Обнулить</value> <value>Сбросить</value>
</data> </data>
<data name="TbSetSystemProxy" xml:space="preserve"> <data name="TbSetSystemProxy" xml:space="preserve">
<value>Установить системный прокси</value> <value>Установить системный прокси</value>
@ -781,16 +781,16 @@
<value>Режим PAC</value> <value>Режим PAC</value>
</data> </data>
<data name="menuShareServer" xml:space="preserve"> <data name="menuShareServer" xml:space="preserve">
<value>Поделиться сервером</value> <value>Поделиться</value>
</data> </data>
<data name="menuRouting" xml:space="preserve"> <data name="menuRouting" xml:space="preserve">
<value>Маршрутизация</value> <value>Маршрутизация</value>
</data> </data>
<data name="NotRunAsAdmin" xml:space="preserve"> <data name="NotRunAsAdmin" xml:space="preserve">
<value>Пользователь</value> <value>Запущено без прав администратора</value>
</data> </data>
<data name="RunAsAdmin" xml:space="preserve"> <data name="RunAsAdmin" xml:space="preserve">
<value>Администратор</value> <value>Запущено от имени администратора</value>
</data> </data>
<data name="menuMoveBottom" xml:space="preserve"> <data name="menuMoveBottom" xml:space="preserve">
<value>Спуститься вниз</value> <value>Спуститься вниз</value>
@ -808,13 +808,13 @@
<value>Фильтр, поддерживает regex</value> <value>Фильтр, поддерживает regex</value>
</data> </data>
<data name="menuWebsiteItem" xml:space="preserve"> <data name="menuWebsiteItem" xml:space="preserve">
<value>{0} веб-сайт</value> <value>Веб-сайт {0}</value>
</data> </data>
<data name="menuRoutingAdvancedAdd" xml:space="preserve"> <data name="menuRoutingAdvancedAdd" xml:space="preserve">
<value>Добавить</value> <value>Добавить</value>
</data> </data>
<data name="menuRoutingAdvancedImportRules" xml:space="preserve"> <data name="menuRoutingAdvancedImportRules" xml:space="preserve">
<value>Добавить расширенные правила</value> <value>Импортировать правила</value>
</data> </data>
<data name="menuRoutingAdvancedRemove" xml:space="preserve"> <data name="menuRoutingAdvancedRemove" xml:space="preserve">
<value>Удалить выбранные</value> <value>Удалить выбранные</value>
@ -859,7 +859,7 @@
<value>Детальные настройки правил маршрутизации</value> <value>Детальные настройки правил маршрутизации</value>
</data> </data>
<data name="TbAutoSort" xml:space="preserve"> <data name="TbAutoSort" xml:space="preserve">
<value>Домен и IP автоматически сортируются при сохранении</value> <value>Домен, IP и процесс автоматически сортируются при сохранении</value>
</data> </data>
<data name="TbRuleobjectDoc" xml:space="preserve"> <data name="TbRuleobjectDoc" xml:space="preserve">
<value>Документация RuleObject</value> <value>Документация RuleObject</value>
@ -868,7 +868,7 @@
<value>Поддерживаются DNS-объекты, нажмите для просмотра документации</value> <value>Поддерживаются DNS-объекты, нажмите для просмотра документации</value>
</data> </data>
<data name="SubUrlTips" xml:space="preserve"> <data name="SubUrlTips" xml:space="preserve">
<value>Необязательное поле</value> <value>Для группы оставьте это поле пустым</value>
</data> </data>
<data name="TipChangeRouting" xml:space="preserve"> <data name="TipChangeRouting" xml:space="preserve">
<value>Настройки маршрутизации изменены</value> <value>Настройки маршрутизации изменены</value>
@ -880,7 +880,7 @@
<value>Только маршрут</value> <value>Только маршрут</value>
</data> </data>
<data name="TbSettingsNotProxyLocalAddress" xml:space="preserve"> <data name="TbSettingsNotProxyLocalAddress" xml:space="preserve">
<value>Не используйте прокси-серверы для локальных (интранет) адресов</value> <value>Не использовать прокси для локальных (интранет) адресов</value>
</data> </data>
<data name="menuMixedTestServer" xml:space="preserve"> <data name="menuMixedTestServer" xml:space="preserve">
<value>Тест задержки и скорости всех серверов (Ctrl+E)</value> <value>Тест задержки и скорости всех серверов (Ctrl+E)</value>
@ -895,13 +895,13 @@
<value>Не удалось запустить ядро, посмотрите логи</value> <value>Не удалось запустить ядро, посмотрите логи</value>
</data> </data>
<data name="LvFilter" xml:space="preserve"> <data name="LvFilter" xml:space="preserve">
<value>Фильтр примечаний (Regex)</value> <value>Фильтр по примечаниям (регулярные выражения)</value>
</data> </data>
<data name="TbDisplayLog" xml:space="preserve"> <data name="TbDisplayLog" xml:space="preserve">
<value>Показать логи</value> <value>Отображать журнал</value>
</data> </data>
<data name="TbEnableTunAs" xml:space="preserve"> <data name="TbEnableTunAs" xml:space="preserve">
<value>Режим VPN</value> <value>Включить TUN</value>
</data> </data>
<data name="TbSettingsNewPort4LAN" xml:space="preserve"> <data name="TbSettingsNewPort4LAN" xml:space="preserve">
<value>Новый порт для локальной сети</value> <value>Новый порт для локальной сети</value>
@ -910,10 +910,10 @@
<value>Настройки режима TUN</value> <value>Настройки режима TUN</value>
</data> </data>
<data name="menuMoveToGroup" xml:space="preserve"> <data name="menuMoveToGroup" xml:space="preserve">
<value>Перейти в группу</value> <value>Переместить в группу</value>
</data> </data>
<data name="TbSettingsEnableDragDropSort" xml:space="preserve"> <data name="TbSettingsEnableDragDropSort" xml:space="preserve">
<value>Включить сортировку перетаскиванием сервера (требуется перезагрузка)</value> <value>Включить сортировку перетаскиванием сервера (требуется перезапуск)</value>
</data> </data>
<data name="TbAutoRefresh" xml:space="preserve"> <data name="TbAutoRefresh" xml:space="preserve">
<value>Автообновление</value> <value>Автообновление</value>
@ -922,10 +922,10 @@
<value>Пропустить тест</value> <value>Пропустить тест</value>
</data> </data>
<data name="menuEditServer" xml:space="preserve"> <data name="menuEditServer" xml:space="preserve">
<value>Редактировать сервер</value> <value>Редактировать</value>
</data> </data>
<data name="TbSettingsDoubleClick2Activate" xml:space="preserve"> <data name="TbSettingsDoubleClick2Activate" xml:space="preserve">
<value>Двойной клик чтобы сделать сервер активным</value> <value>Двойной клик для активации конфигурации</value>
</data> </data>
<data name="SpeedtestingCompleted" xml:space="preserve"> <data name="SpeedtestingCompleted" xml:space="preserve">
<value>Тест завершен</value> <value>Тест завершен</value>
@ -937,19 +937,19 @@
<value>User-Agent</value> <value>User-Agent</value>
</data> </data>
<data name="TbSettingsDefUserAgentTips" xml:space="preserve"> <data name="TbSettingsDefUserAgentTips" xml:space="preserve">
<value>Параметр действует только для TCP/HTTP и WebSocket (WS)</value> <value>This parameter is valid only for tcp/http, ws, gRPC and xhttp</value>
</data> </data>
<data name="TbSettingsCurrentFontFamily" xml:space="preserve"> <data name="TbSettingsCurrentFontFamily" xml:space="preserve">
<value>Шрифт (требуется перезагрузка)</value> <value>Шрифт (требуется перезапуск)</value>
</data> </data>
<data name="TbSettingsCurrentFontFamilyTip" xml:space="preserve"> <data name="TbSettingsCurrentFontFamilyTip" xml:space="preserve">
<value>Скопируйте файл шрифта TTF/TTC в каталог guiFonts и заново откройте окно настроек</value> <value>Скопируйте файл шрифта TTF/TTC в каталог guiFonts и заново откройте окно настроек</value>
</data> </data>
<data name="TbSettingsSocksPortTip" xml:space="preserve"> <data name="TbSettingsSocksPortTip" xml:space="preserve">
<value>Pac порт = +3,Xray API порт = +4, mihomo API порт = +5</value> <value>PAC-порт = +3; Xray API порт = +4; mihomo API порт = +5;</value>
</data> </data>
<data name="TbSettingsStartBootTip" xml:space="preserve"> <data name="TbSettingsStartBootTip" xml:space="preserve">
<value>Установите это с правами администратора</value> <value>Установите с правами администратора; после запуска приложение получит права администратора</value>
</data> </data>
<data name="TbSettingsFontSize" xml:space="preserve"> <data name="TbSettingsFontSize" xml:space="preserve">
<value>Размер шрифта</value> <value>Размер шрифта</value>
@ -964,7 +964,7 @@
<value>Переместить вверх/вниз</value> <value>Переместить вверх/вниз</value>
</data> </data>
<data name="TbPublicKey" xml:space="preserve"> <data name="TbPublicKey" xml:space="preserve">
<value>PublicKey</value> <value>Открытый ключ</value>
</data> </data>
<data name="TbShortId" xml:space="preserve"> <data name="TbShortId" xml:space="preserve">
<value>ShortId</value> <value>ShortId</value>
@ -973,22 +973,22 @@
<value>SpiderX</value> <value>SpiderX</value>
</data> </data>
<data name="TbSettingsEnableHWA" xml:space="preserve"> <data name="TbSettingsEnableHWA" xml:space="preserve">
<value>Включить аппаратное ускорение (требуется перезагрузка)</value> <value>Включить аппаратное ускорение (требуется перезапуск)</value>
</data> </data>
<data name="SpeedtestingWait" xml:space="preserve"> <data name="SpeedtestingWait" xml:space="preserve">
<value>Ожидание тестирования…</value> <value>Ожидание…</value>
</data> </data>
<data name="SpeedtestingPressEscToExit" xml:space="preserve"> <data name="SpeedtestingPressEscToExit" xml:space="preserve">
<value>нажмите ESC для отмены</value> <value>Нажмите ESC для прекращения теста</value>
</data> </data>
<data name="TipDisplayLog" xml:space="preserve"> <data name="TipDisplayLog" xml:space="preserve">
<value>Отключите при аномальном разрыве соединения</value> <value>Отключите при нестабильном соединении</value>
</data> </data>
<data name="MsgSkipSubscriptionUpdate" xml:space="preserve"> <data name="MsgSkipSubscriptionUpdate" xml:space="preserve">
<value>Обновления не включены — подписка пропущена</value> <value>Обновления не включены — подписка пропущена</value>
</data> </data>
<data name="menuRebootAsAdmin" xml:space="preserve"> <data name="menuRebootAsAdmin" xml:space="preserve">
<value>Перезагрузить как администратор</value> <value>Перезапустить от имени администратора</value>
</data> </data>
<data name="LvMoreUrl" xml:space="preserve"> <data name="LvMoreUrl" xml:space="preserve">
<value>Дополнительные URL через запятую, конвертация подписки недоступна</value> <value>Дополнительные URL через запятую, конвертация подписки недоступна</value>
@ -1003,7 +1003,7 @@
<value>Включить запись логов в файл</value> <value>Включить запись логов в файл</value>
</data> </data>
<data name="LvConvertTarget" xml:space="preserve"> <data name="LvConvertTarget" xml:space="preserve">
<value>Преобразовать тип цели</value> <value>Целевой тип конвертации</value>
</data> </data>
<data name="LvConvertTargetTip" xml:space="preserve"> <data name="LvConvertTargetTip" xml:space="preserve">
<value>Если преобразование не требуется, оставьте поле пустым</value> <value>Если преобразование не требуется, оставьте поле пустым</value>
@ -1012,7 +1012,7 @@
<value>Настройки DNS</value> <value>Настройки DNS</value>
</data> </data>
<data name="TbCustomDnsSingbox" xml:space="preserve"> <data name="TbCustomDnsSingbox" xml:space="preserve">
<value>sing-box Custom DNS</value> <value>Пользовательский DNS для sing-box</value>
</data> </data>
<data name="TbDnsSingboxObjectDoc" xml:space="preserve"> <data name="TbDnsSingboxObjectDoc" xml:space="preserve">
<value>Заполните структуру DNS, нажмите, чтобы открыть документ</value> <value>Заполните структуру DNS, нажмите, чтобы открыть документ</value>
@ -1042,13 +1042,13 @@
<value>Максимальная пропускная способность Hysteria (загрузка/отдача)</value> <value>Максимальная пропускная способность Hysteria (загрузка/отдача)</value>
</data> </data>
<data name="TbSettingsUseSystemHosts" xml:space="preserve"> <data name="TbSettingsUseSystemHosts" xml:space="preserve">
<value>Использовать системные узлы</value> <value>Использовать системный файл hosts</value>
</data> </data>
<data name="menuAddTuicServer" xml:space="preserve"> <data name="menuAddTuicServer" xml:space="preserve">
<value>Добавить сервер [TUIC]</value> <value>Добавить сервер [TUIC]</value>
</data> </data>
<data name="TbHeaderType8" xml:space="preserve"> <data name="TbHeaderType8" xml:space="preserve">
<value>Контроль перегрузок</value> <value>Управление перегрузками</value>
</data> </data>
<data name="LvPrevProfile" xml:space="preserve"> <data name="LvPrevProfile" xml:space="preserve">
<value>Примечания к предыдущему прокси</value> <value>Примечания к предыдущему прокси</value>
@ -1084,7 +1084,7 @@
<value>Зарезервировано (2, 3, 4)</value> <value>Зарезервировано (2, 3, 4)</value>
</data> </data>
<data name="TbLocalAddress" xml:space="preserve"> <data name="TbLocalAddress" xml:space="preserve">
<value>Адрес (Ipv4,Ipv6)</value> <value>Адрес (IPv4, IPv6)</value>
</data> </data>
<data name="TbPath7" xml:space="preserve"> <data name="TbPath7" xml:space="preserve">
<value>Пароль obfs</value> <value>Пароль obfs</value>
@ -1099,7 +1099,7 @@
<value>URL для быстрой проверки реальной задержки</value> <value>URL для быстрой проверки реальной задержки</value>
</data> </data>
<data name="SpeedtestingStop" xml:space="preserve"> <data name="SpeedtestingStop" xml:space="preserve">
<value>Отмена тестирования...</value> <value>Завершение тестирования...</value>
</data> </data>
<data name="TransportRequestHostTip5" xml:space="preserve"> <data name="TransportRequestHostTip5" xml:space="preserve">
<value>* gRPC Authority (HTTP/2 псевдозаголовок :authority)</value> <value>* gRPC Authority (HTTP/2 псевдозаголовок :authority)</value>
@ -1117,7 +1117,7 @@
<value>Пользовательский набор правил для sing-box</value> <value>Пользовательский набор правил для sing-box</value>
</data> </data>
<data name="NeedRebootTips" xml:space="preserve"> <data name="NeedRebootTips" xml:space="preserve">
<value>Операция успешна. Перезапустите приложение</value> <value>Операция успешна. Закройте приложение, нажав «Выход» в меню трея, и запустите его заново</value>
</data> </data>
<data name="menuOpenTheFileLocation" xml:space="preserve"> <data name="menuOpenTheFileLocation" xml:space="preserve">
<value>Открыть место хранения</value> <value>Открыть место хранения</value>
@ -1138,10 +1138,10 @@
<value>Скорость загрузки</value> <value>Скорость загрузки</value>
</data> </data>
<data name="TbSortingDownTraffic" xml:space="preserve"> <data name="TbSortingDownTraffic" xml:space="preserve">
<value>Скачанный трафик</value> <value>Загруженный трафик</value>
</data> </data>
<data name="TbSortingHost" xml:space="preserve"> <data name="TbSortingHost" xml:space="preserve">
<value>Узел</value> <value>Хост</value>
</data> </data>
<data name="TbSortingName" xml:space="preserve"> <data name="TbSortingName" xml:space="preserve">
<value>Имя</value> <value>Имя</value>
@ -1204,7 +1204,7 @@
<value>Стратегия домена по умолчанию для исходящих</value> <value>Стратегия домена по умолчанию для исходящих</value>
</data> </data>
<data name="TbSettingsMainGirdOrientation" xml:space="preserve"> <data name="TbSettingsMainGirdOrientation" xml:space="preserve">
<value>Основная ориентация макета (требуется перезагрузка)</value> <value>Основная ориентация макета (требуется перезапуск)</value>
</data> </data>
<data name="TbSettingsDomainDNSAddress" xml:space="preserve"> <data name="TbSettingsDomainDNSAddress" xml:space="preserve">
<value>Исходящий DNS адрес</value> <value>Исходящий DNS адрес</value>
@ -1216,13 +1216,13 @@
<value>Экспорт ссылок в формате Base64 в буфер обмена</value> <value>Экспорт ссылок в формате Base64 в буфер обмена</value>
</data> </data>
<data name="menuExport2ClientConfigClipboard" xml:space="preserve"> <data name="menuExport2ClientConfigClipboard" xml:space="preserve">
<value>Экспортировать выбранный сервер для полной конфигурации в буфер обмена</value> <value>Экспортировать полную конфигурацию в буфер обмена</value>
</data> </data>
<data name="menuShowOrHideMainWindow" xml:space="preserve"> <data name="menuShowOrHideMainWindow" xml:space="preserve">
<value>Показать или скрыть главное окно</value> <value>Показать или скрыть главное окно</value>
</data> </data>
<data name="TbPreSocksPort4Sub" xml:space="preserve"> <data name="TbPreSocksPort4Sub" xml:space="preserve">
<value>Пользовательская конфигурация порта SOCKS</value> <value>Порт SOCKS для пользовательской конфигурации</value>
</data> </data>
<data name="menuBackupAndRestore" xml:space="preserve"> <data name="menuBackupAndRestore" xml:space="preserve">
<value>Резервное копирование и восстановление</value> <value>Резервное копирование и восстановление</value>
@ -1276,13 +1276,13 @@
<value>Источник файлов наборов правил sing-box (необязательно)</value> <value>Источник файлов наборов правил sing-box (необязательно)</value>
</data> </data>
<data name="UpgradeAppNotExistTip" xml:space="preserve"> <data name="UpgradeAppNotExistTip" xml:space="preserve">
<value>Программы для обновления не существует</value> <value>Приложение для обновления не найдено</value>
</data> </data>
<data name="TbSettingsRoutingRulesSource" xml:space="preserve"> <data name="TbSettingsRoutingRulesSource" xml:space="preserve">
<value>Источник правил маршрутизации</value> <value>Источник правил маршрутизации (необязательно)</value>
</data> </data>
<data name="menuRegionalPresets" xml:space="preserve"> <data name="menuRegionalPresets" xml:space="preserve">
<value>Региональные пресеты</value> <value>Настройка региональных пресетов</value>
</data> </data>
<data name="menuRegionalPresetsDefault" xml:space="preserve"> <data name="menuRegionalPresetsDefault" xml:space="preserve">
<value>По умолчанию (Китай)</value> <value>По умолчанию (Китай)</value>
@ -1300,13 +1300,13 @@
<value>Сканировать QR-код с изображения</value> <value>Сканировать QR-код с изображения</value>
</data> </data>
<data name="InvalidUrlTip" xml:space="preserve"> <data name="InvalidUrlTip" xml:space="preserve">
<value>Неверный адрес (Url)</value> <value>Неверный адрес (URL)</value>
</data> </data>
<data name="InsecureUrlProtocol" xml:space="preserve"> <data name="InsecureUrlProtocol" xml:space="preserve">
<value>Не используйте небезопасный адрес подписки по протоколу HTTP</value> <value>Не используйте небезопасный адрес подписки по протоколу HTTP</value>
</data> </data>
<data name="TbSettingsCurrentFontFamilyLinuxTip" xml:space="preserve"> <data name="TbSettingsCurrentFontFamilyLinuxTip" xml:space="preserve">
<value>Установите шрифт в систему и перезапустите настройки</value> <value>Установите шрифт в систему, выберите или введите имя шрифта, перезапустите настройки</value>
</data> </data>
<data name="menuExitTips" xml:space="preserve"> <data name="menuExitTips" xml:space="preserve">
<value>Вы уверены, что хотите выйти?</value> <value>Вы уверены, что хотите выйти?</value>
@ -1324,16 +1324,16 @@
<value>*XHTTP-режим</value> <value>*XHTTP-режим</value>
</data> </data>
<data name="TransportExtraTip" xml:space="preserve"> <data name="TransportExtraTip" xml:space="preserve">
<value>Дополнительный сырой JSON для XHTTP, формат: { XHTTP Object }</value> <value>Дополнительный сырой JSON для XHTTP, формат: { XHTTP Object }</value>
</data> </data>
<data name="TbSettingsHide2TrayWhenClose" xml:space="preserve"> <data name="TbSettingsHide2TrayWhenClose" xml:space="preserve">
<value>Скрыть в трее при закрытии окна</value> <value>Сворачивать в трей при закрытии окна</value>
</data> </data>
<data name="TbSettingsMixedConcurrencyCount" xml:space="preserve"> <data name="TbSettingsMixedConcurrencyCount" xml:space="preserve">
<value>Количество одновременно выполняемых тестов при многоэтапном тестировании</value> <value>Количество одновременно выполняемых тестов при многоэтапном тестировании</value>
</data> </data>
<data name="TbSettingsExceptionTip2" xml:space="preserve"> <data name="TbSettingsExceptionTip2" xml:space="preserve">
<value>Исключение. Не используйте прокси-сервер для адресов с запятой (,)</value> <value>Исключения: не использовать прокси для указанных адресов. Разделяйте запятой (,)</value>
</data> </data>
<data name="TbSettingsDestOverride" xml:space="preserve"> <data name="TbSettingsDestOverride" xml:space="preserve">
<value>Тип сниффинга</value> <value>Тип сниффинга</value>
@ -1345,7 +1345,7 @@
<value>socks: локальный порт, socks2: второй локальный порт, socks3: LAN порт</value> <value>socks: локальный порт, socks2: второй локальный порт, socks3: LAN порт</value>
</data> </data>
<data name="TbSettingsTheme" xml:space="preserve"> <data name="TbSettingsTheme" xml:space="preserve">
<value>Темы</value> <value>Тема</value>
</data> </data>
<data name="menuCopyProxyCmdToClipboard" xml:space="preserve"> <data name="menuCopyProxyCmdToClipboard" xml:space="preserve">
<value>Копировать команду прокси в буфер обмена</value> <value>Копировать команду прокси в буфер обмена</value>
@ -1675,27 +1675,30 @@
<value>Выбрать все</value> <value>Выбрать все</value>
</data> </data>
<data name="menuEditPaste" xml:space="preserve"> <data name="menuEditPaste" xml:space="preserve">
<value>Paste</value> <value>Вставить</value>
</data> </data>
<data name="menuEditFormat" xml:space="preserve"> <data name="menuEditFormat" xml:space="preserve">
<value>Format</value> <value>Форматировать</value>
</data> </data>
<data name="TbUot" xml:space="preserve"> <data name="TbUot" xml:space="preserve">
<value>UDP over TCP</value> <value>UDP поверх TCP</value>
</data> </data>
<data name="menuAddNaiveServer" xml:space="preserve"> <data name="menuAddNaiveServer" xml:space="preserve">
<value>Добавить сервер [NaïveProxy]</value> <value>Добавить сервер [NaïveProxy]</value>
</data> </data>
<data name="TbInsecureConcurrency" xml:space="preserve"> <data name="TbInsecureConcurrency" xml:space="preserve">
<value>Insecure Concurrency</value> <value>Небезопасная конкурентность (Insecure Concurrency)</value>
</data> </data>
<data name="TbUsername" xml:space="preserve"> <data name="TbUsername" xml:space="preserve">
<value>Username</value> <value>Имя пользователя</value>
</data> </data>
<data name="TbIcmpRoutingPolicy" xml:space="preserve"> <data name="TbIcmpRoutingPolicy" xml:space="preserve">
<value>ICMP routing policy</value> <value>Политика маршрутизации ICMP</value>
</data> </data>
<data name="TbLegacyProtect" xml:space="preserve"> <data name="TbLegacyProtect" xml:space="preserve">
<value>Legacy TUN Protect</value> <value>Устаревшая защита TUN (Legacy Protect)</value>
</data>
<data name="TbSettingsSendThroughTip" xml:space="preserve">
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
</data> </data>
</root> </root>

View file

@ -937,7 +937,7 @@
<value>用户代理 (User-Agent)</value> <value>用户代理 (User-Agent)</value>
</data> </data>
<data name="TbSettingsDefUserAgentTips" xml:space="preserve"> <data name="TbSettingsDefUserAgentTips" xml:space="preserve">
<value>仅对 tcp/http、ws 协议生效</value> <value>仅对 tcp/http、ws、gRPC、xhttp 生效</value>
</data> </data>
<data name="TbSettingsCurrentFontFamily" xml:space="preserve"> <data name="TbSettingsCurrentFontFamily" xml:space="preserve">
<value>当前字体 (需重启)</value> <value>当前字体 (需重启)</value>
@ -1317,6 +1317,15 @@
<data name="TbSettingsLinuxSudoPasswordTip" xml:space="preserve"> <data name="TbSettingsLinuxSudoPasswordTip" xml:space="preserve">
<value>密码将调用命令行校验,如果因为校验错误导致无法正常运行时,请重启本应用。 密码不会存储,每次重启后都需要再次输入。</value> <value>密码将调用命令行校验,如果因为校验错误导致无法正常运行时,请重启本应用。 密码不会存储,每次重启后都需要再次输入。</value>
</data> </data>
<data name="TbSettingsSendThrough" xml:space="preserve">
<value>本地出站地址 (SendThrough)</value>
</data>
<data name="TbSettingsSendThroughTip" xml:space="preserve">
<value>用于多网口环境,请填写本机 IPv4 地址</value>
</data>
<data name="FillCorrectSendThroughIPv4" xml:space="preserve">
<value>请填写正确的 SendThrough IPv4 地址。</value>
</data>
<data name="TransportHeaderTypeTip5" xml:space="preserve"> <data name="TransportHeaderTypeTip5" xml:space="preserve">
<value>*XHTTP 模式</value> <value>*XHTTP 模式</value>
</data> </data>

View file

@ -937,7 +937,7 @@
<value>使用者代理 (User-Agent)</value> <value>使用者代理 (User-Agent)</value>
</data> </data>
<data name="TbSettingsDefUserAgentTips" xml:space="preserve"> <data name="TbSettingsDefUserAgentTips" xml:space="preserve">
<value>僅對 TCP/HTTP、WS 協定生效</value> <value>僅對 TCP/HTTP、WS、gRPC、XHTTP 生效</value>
</data> </data>
<data name="TbSettingsCurrentFontFamily" xml:space="preserve"> <data name="TbSettingsCurrentFontFamily" xml:space="preserve">
<value>目前字型 (需重啟)</value> <value>目前字型 (需重啟)</value>
@ -1695,4 +1695,7 @@
<data name="TbLegacyProtect" xml:space="preserve"> <data name="TbLegacyProtect" xml:space="preserve">
<value>Legacy TUN Protect</value> <value>Legacy TUN Protect</value>
</data> </data>
<data name="TbSettingsSendThroughTip" xml:space="preserve">
<value>For multi-interface environments, enter the local machine's IPv4 address</value>
</data>
</root> </root>

View file

@ -1,5 +1,24 @@
#!/bin/bash #!/bin/bash
trim() {
local -n ref=$1
ref="${ref#"${ref%%[![:space:]]*}"}"
ref="${ref%"${ref##*[![:space:]]}"}"
}
build_gsettings_array() {
[[ -z "$1" ]] && echo "[]" && return
local host joined hosts=()
IFS=',' read -ra parts <<< "$1"
for host in "${parts[@]}"; do
trim host
[[ -n "$host" ]] && hosts+=("$host")
done
[[ ${#hosts[@]} -eq 0 ]] && echo "[]" && return
printf -v joined "'%s'," "${hosts[@]}"
echo "[${joined%,}]"
}
# Function to set proxy for GNOME # Function to set proxy for GNOME
set_gnome_proxy() { set_gnome_proxy() {
local MODE=$1 local MODE=$1
@ -21,7 +40,7 @@ set_gnome_proxy() {
done done
# Set ignored hosts # Set ignored hosts
gsettings set org.gnome.system.proxy ignore-hosts "['$IGNORE_HOSTS']" gsettings set org.gnome.system.proxy ignore-hosts "$(build_gsettings_array "$IGNORE_HOSTS")"
echo "GNOME: Manual proxy settings applied." echo "GNOME: Manual proxy settings applied."
echo "Proxy IP: $PROXY_IP" echo "Proxy IP: $PROXY_IP"

View file

@ -57,21 +57,30 @@ public partial class CoreConfigSingboxService(CoreConfigContext context)
ConvertGeo2Ruleset(); ConvertGeo2Ruleset();
ApplyOutboundSendThrough();
ret.Msg = string.Format(ResUI.SuccessfulConfiguration, ""); ret.Msg = string.Format(ResUI.SuccessfulConfiguration, "");
ret.Success = true; ret.Success = true;
ret.Data = ApplyFullConfigTemplate(); ret.Data = ApplyFullConfigTemplate();
if (!context.AppConfig.TunModeItem.EnableLegacyProtect if (!context.AppConfig.TunModeItem.EnableLegacyProtect
&& context.TunProtectSsPort is > 0 and <= 65535) && context.TunProtectSocksPort is > 0 and <= 65535)
{ {
// Replace relay proxy outbound, avoid mux or other feature cause issue, and add a socks inbound for tun protect
var relayProxyIndex = _coreConfig.outbounds.FindIndex(o => o.tag == Global.ProxyTag);
_coreConfig.outbounds[relayProxyIndex] = new Outbound4Sbox()
{
type = Global.ProtocolTypes[EConfigType.SOCKS],
tag = Global.ProxyTag,
server = Global.Loopback,
server_port = context.ProxyRelaySocksPort,
};
var ssInbound = new var ssInbound = new
{ {
type = "shadowsocks", type = "socks",
tag = "tun-protect-ss", tag = "tun-protect-socks",
listen = Global.Loopback, listen = Global.Loopback,
listen_port = context.TunProtectSsPort, listen_port = context.TunProtectSocksPort,
method = "none",
password = "none",
}; };
var directRule = new Rule4Sbox() var directRule = new Rule4Sbox()
{ {
@ -214,6 +223,7 @@ public partial class CoreConfigSingboxService(CoreConfigContext context)
_coreConfig.route.rules.Add(rule); _coreConfig.route.rules.Add(rule);
} }
ApplyOutboundSendThrough();
ret.Success = true; ret.Success = true;
ret.Data = JsonUtils.Serialize(_coreConfig); ret.Data = JsonUtils.Serialize(_coreConfig);
return ret; return ret;
@ -272,6 +282,7 @@ public partial class CoreConfigSingboxService(CoreConfigContext context)
listen_port = port, listen_port = port,
type = EInboundProtocol.mixed.ToString(), type = EInboundProtocol.mixed.ToString(),
}); });
ApplyOutboundSendThrough();
ret.Msg = string.Format(ResUI.SuccessfulConfiguration, ""); ret.Msg = string.Format(ResUI.SuccessfulConfiguration, "");
ret.Success = true; ret.Success = true;

View file

@ -58,4 +58,40 @@ public partial class CoreConfigSingboxService
return JsonUtils.Serialize(fullConfigTemplateNode); return JsonUtils.Serialize(fullConfigTemplateNode);
} }
private void ApplyOutboundSendThrough()
{
var sendThrough = _config.CoreBasicItem.SendThrough?.TrimEx();
foreach (var outbound in _coreConfig.outbounds ?? [])
{
outbound.inet4_bind_address = ShouldApplySendThrough(outbound, sendThrough) ? sendThrough : null;
}
}
private static bool ShouldApplySendThrough(Outbound4Sbox outbound, string? sendThrough)
{
if (sendThrough.IsNullOrEmpty())
{
return false;
}
if (outbound.type is "direct" or "block" or "dns" or "selector" or "urltest")
{
return false;
}
if (!outbound.detour.IsNullOrEmpty())
{
return false;
}
var outboundAddress = outbound.server ?? string.Empty;
if (outboundAddress.Equals("localhost", StringComparison.OrdinalIgnoreCase))
{
return false;
}
return !IPAddress.TryParse(outboundAddress, out var address) || !IPAddress.IsLoopback(address);
}
} }

View file

@ -11,7 +11,7 @@ public partial class CoreConfigSingboxService
_coreConfig.inbounds = []; _coreConfig.inbounds = [];
if (!context.IsTunEnabled if (!context.IsTunEnabled
|| (context.IsTunEnabled && _node.Port != listenPort)) || (context.IsTunEnabled && _node.Address != Global.Loopback && _node.Port != listenPort))
{ {
var inbound = new Inbound4Sbox() var inbound = new Inbound4Sbox()
{ {

View file

@ -438,6 +438,8 @@ public partial class CoreConfigSingboxService
try try
{ {
var transport = new Transport4Sbox(); var transport = new Transport4Sbox();
var useragent = _config.CoreBasicItem.DefUserAgent ?? string.Empty;
var useragentValue = Global.TcpHttpUserAgentTexts.GetValueOrDefault(useragent, useragent);
switch (_node.GetNetwork()) switch (_node.GetNetwork())
{ {
@ -453,6 +455,11 @@ public partial class CoreConfigSingboxService
transport.type = nameof(ETransport.http); transport.type = nameof(ETransport.http);
transport.host = _node.RequestHost.IsNullOrEmpty() ? null : Utils.String2List(_node.RequestHost); transport.host = _node.RequestHost.IsNullOrEmpty() ? null : Utils.String2List(_node.RequestHost);
transport.path = _node.Path.NullIfEmpty(); transport.path = _node.Path.NullIfEmpty();
if (!useragentValue.IsNullOrEmpty())
{
transport.headers ??= new();
transport.headers.UserAgent = useragentValue;
}
} }
break; break;
@ -494,12 +501,22 @@ public partial class CoreConfigSingboxService
Host = _node.RequestHost Host = _node.RequestHost
}; };
} }
if (!useragentValue.IsNullOrEmpty())
{
transport.headers ??= new();
transport.headers.UserAgent = useragentValue;
}
break; break;
case nameof(ETransport.httpupgrade): case nameof(ETransport.httpupgrade):
transport.type = nameof(ETransport.httpupgrade); transport.type = nameof(ETransport.httpupgrade);
transport.path = _node.Path.NullIfEmpty(); transport.path = _node.Path.NullIfEmpty();
transport.host = _node.RequestHost.NullIfEmpty(); transport.host = _node.RequestHost.NullIfEmpty();
if (!useragentValue.IsNullOrEmpty())
{
transport.headers ??= new();
transport.headers.UserAgent = useragentValue;
}
break; break;

View file

@ -96,7 +96,6 @@ public partial class CoreConfigSingboxService
_coreConfig.route.rules.Add(new() _coreConfig.route.rules.Add(new()
{ {
port = [53], port = [53],
network = ["udp"],
action = "hijack-dns" action = "hijack-dns"
}); });
} }

View file

@ -17,8 +17,8 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
{ {
if (!context.AppConfig.TunModeItem.EnableLegacyProtect if (!context.AppConfig.TunModeItem.EnableLegacyProtect
&& context.IsTunEnabled && context.IsTunEnabled
&& context.TunProtectSsPort is > 0 and <= 65535 && context.TunProtectSocksPort is > 0 and <= 65535
&& context.ProxyRelaySsPort is > 0 and <= 65535) && context.ProxyRelaySocksPort is > 0 and <= 65535)
{ {
return GenerateClientProxyRelayConfig(); return GenerateClientProxyRelayConfig();
} }
@ -62,6 +62,7 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
GenDns(); GenDns();
GenStatistic(); GenStatistic();
ApplyOutboundSendThrough();
var finalRule = BuildFinalRule(); var finalRule = BuildFinalRule();
if (!string.IsNullOrEmpty(finalRule?.balancerTag)) if (!string.IsNullOrEmpty(finalRule?.balancerTag))
@ -195,6 +196,7 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
_coreConfig.routing.rules.Add(rule); _coreConfig.routing.rules.Add(rule);
} }
ApplyOutboundSendThrough();
//ret.Msg =string.Format(ResUI.SuccessfulConfiguration"), node.getSummary()); //ret.Msg =string.Format(ResUI.SuccessfulConfiguration"), node.getSummary());
ret.Success = true; ret.Success = true;
ret.Data = JsonUtils.Serialize(_coreConfig); ret.Data = JsonUtils.Serialize(_coreConfig);
@ -255,6 +257,7 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
}); });
_coreConfig.routing.rules.Add(BuildFinalRule()); _coreConfig.routing.rules.Add(BuildFinalRule());
ApplyOutboundSendThrough();
ret.Msg = string.Format(ResUI.SuccessfulConfiguration, ""); ret.Msg = string.Format(ResUI.SuccessfulConfiguration, "");
ret.Success = true; ret.Success = true;
@ -309,17 +312,16 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
var protectNode = new ProfileItem() var protectNode = new ProfileItem()
{ {
CoreType = ECoreType.Xray, CoreType = ECoreType.Xray,
ConfigType = EConfigType.Shadowsocks, ConfigType = EConfigType.SOCKS,
Address = Global.Loopback, Address = Global.Loopback,
Port = context.TunProtectSsPort, Port = context.TunProtectSocksPort,
Password = Global.None,
}; };
protectNode.SetProtocolExtra(protectNode.GetProtocolExtra() with protectNode.SetProtocolExtra(protectNode.GetProtocolExtra() with
{ {
SsMethod = Global.None, SsMethod = Global.None,
}); });
const string protectTag = "tun-protect-ss"; const string protectTag = "tun-protect-socks";
foreach (var outbound in _coreConfig.outbounds foreach (var outbound in _coreConfig.outbounds
.Where(o => o.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true)) .Where(o => o.streamSettings?.sockopt?.dialerProxy?.IsNullOrEmpty() ?? true))
{ {
@ -368,7 +370,7 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
var hasBalancer = _coreConfig.routing.balancers is { Count: > 0 }; var hasBalancer = _coreConfig.routing.balancers is { Count: > 0 };
_coreConfig.routing.rules.Add(new() _coreConfig.routing.rules.Add(new()
{ {
inboundTag = ["proxy-relay-ss"], inboundTag = ["proxy-relay-socks"],
outboundTag = hasBalancer ? null : Global.ProxyTag, outboundTag = hasBalancer ? null : Global.ProxyTag,
balancerTag = hasBalancer ? Global.ProxyTag + Global.BalancerTagSuffix : null, balancerTag = hasBalancer ? Global.ProxyTag + Global.BalancerTagSuffix : null,
type = "field" type = "field"
@ -376,19 +378,19 @@ public partial class CoreConfigV2rayService(CoreConfigContext context)
//_coreConfig.inbounds.Clear(); //_coreConfig.inbounds.Clear();
ApplyOutboundSendThrough();
var configNode = JsonUtils.ParseJson(JsonUtils.Serialize(_coreConfig))!; var configNode = JsonUtils.ParseJson(JsonUtils.Serialize(_coreConfig))!;
configNode["inbounds"]!.AsArray().Add(new configNode["inbounds"]!.AsArray().Add(new
{ {
listen = Global.Loopback, listen = Global.Loopback,
port = context.ProxyRelaySsPort, port = context.ProxyRelaySocksPort,
protocol = "shadowsocks", protocol = "socks",
settings = new settings = new
{ {
network = "tcp,udp", auth = "noauth",
method = Global.None, udp = true,
password = Global.None,
}, },
tag = "proxy-relay-ss", tag = "proxy-relay-socks",
}); });
ret.Msg = string.Format(ResUI.SuccessfulConfiguration, ""); ret.Msg = string.Format(ResUI.SuccessfulConfiguration, "");

View file

@ -127,4 +127,43 @@ public partial class CoreConfigV2rayService
return JsonUtils.Serialize(fullConfigTemplateNode); return JsonUtils.Serialize(fullConfigTemplateNode);
} }
private void ApplyOutboundSendThrough()
{
var sendThrough = _config.CoreBasicItem.SendThrough?.TrimEx();
foreach (var outbound in _coreConfig.outbounds ?? [])
{
outbound.sendThrough = ShouldApplySendThrough(outbound, sendThrough) ? sendThrough : null;
}
}
private static bool ShouldApplySendThrough(Outbounds4Ray outbound, string? sendThrough)
{
if (sendThrough.IsNullOrEmpty())
{
return false;
}
if (outbound.protocol is "freedom" or "blackhole" or "dns" or "loopback")
{
return false;
}
if (outbound.streamSettings?.sockopt?.dialerProxy.IsNullOrEmpty() == false)
{
return false;
}
var outboundAddress = outbound.settings?.servers?.FirstOrDefault()?.address
?? outbound.settings?.vnext?.FirstOrDefault()?.address
?? outbound.settings?.address?.ToString()
?? string.Empty;
if (outboundAddress.Equals("localhost", StringComparison.OrdinalIgnoreCase))
{
return false;
}
return !IPAddress.TryParse(outboundAddress, out var address) || !IPAddress.IsLoopback(address);
}
} }

View file

@ -225,12 +225,13 @@ public partial class CoreConfigV2rayService
usersItem.email = Global.UserEMail; usersItem.email = Global.UserEMail;
usersItem.encryption = protocolExtra.VlessEncryption; usersItem.encryption = protocolExtra.VlessEncryption;
if (!protocolExtra.Flow.IsNullOrEmpty()) if (protocolExtra.Flow.IsNullOrEmpty())
{ {
usersItem.flow = protocolExtra.Flow; FillOutboundMux(outbound, muxEnabled, muxEnabled);
} }
else else
{ {
usersItem.flow = protocolExtra.Flow;
FillOutboundMux(outbound, false, muxEnabled); FillOutboundMux(outbound, false, muxEnabled);
} }
outbound.settings.servers = null; outbound.settings.servers = null;

View file

@ -299,15 +299,22 @@ public class UpdateService(Config config, Func<bool, string, Task> updateFunc)
return url; return url;
} }
else if (Utils.IsLinux()) else if (Utils.IsLinux())
{ {
return RuntimeInformation.ProcessArchitecture switch var arch = RuntimeInformation.ProcessArchitecture;
if (arch.ToString().Equals("RiscV64", StringComparison.OrdinalIgnoreCase))
{
return coreInfo?.DownloadUrlLinuxRiscV64;
}
return arch switch
{ {
Architecture.Arm64 => coreInfo?.DownloadUrlLinuxArm64, Architecture.Arm64 => coreInfo?.DownloadUrlLinuxArm64,
Architecture.X64 => coreInfo?.DownloadUrlLinux64, Architecture.X64 => coreInfo?.DownloadUrlLinux64,
_ => null, _ => null,
}; };
} }
else if (Utils.IsMacOS()) else if (Utils.IsMacOS())
{ {
return RuntimeInformation.ProcessArchitecture switch return RuntimeInformation.ProcessArchitecture switch

View file

@ -20,6 +20,7 @@ public class OptionSettingViewModel : MyReactiveObject
[Reactive] public bool defAllowInsecure { get; set; } [Reactive] public bool defAllowInsecure { get; set; }
[Reactive] public string defFingerprint { get; set; } [Reactive] public string defFingerprint { get; set; }
[Reactive] public string defUserAgent { get; set; } [Reactive] public string defUserAgent { get; set; }
[Reactive] public string sendThrough { get; set; }
[Reactive] public string mux4SboxProtocol { get; set; } [Reactive] public string mux4SboxProtocol { get; set; }
[Reactive] public bool enableCacheFile4Sbox { get; set; } [Reactive] public bool enableCacheFile4Sbox { get; set; }
[Reactive] public int? hyUpMbps { get; set; } [Reactive] public int? hyUpMbps { get; set; }
@ -154,6 +155,7 @@ public class OptionSettingViewModel : MyReactiveObject
defAllowInsecure = _config.CoreBasicItem.DefAllowInsecure; defAllowInsecure = _config.CoreBasicItem.DefAllowInsecure;
defFingerprint = _config.CoreBasicItem.DefFingerprint; defFingerprint = _config.CoreBasicItem.DefFingerprint;
defUserAgent = _config.CoreBasicItem.DefUserAgent; defUserAgent = _config.CoreBasicItem.DefUserAgent;
sendThrough = _config.CoreBasicItem.SendThrough;
mux4SboxProtocol = _config.Mux4SboxItem.Protocol; mux4SboxProtocol = _config.Mux4SboxItem.Protocol;
enableCacheFile4Sbox = _config.CoreBasicItem.EnableCacheFile4Sbox; enableCacheFile4Sbox = _config.CoreBasicItem.EnableCacheFile4Sbox;
hyUpMbps = _config.HysteriaItem.UpMbps; hyUpMbps = _config.HysteriaItem.UpMbps;
@ -297,6 +299,12 @@ public class OptionSettingViewModel : MyReactiveObject
NoticeManager.Instance.Enqueue(ResUI.FillLocalListeningPort); NoticeManager.Instance.Enqueue(ResUI.FillLocalListeningPort);
return; return;
} }
var sendThroughValue = sendThrough?.TrimEx();
if (sendThroughValue.IsNotEmpty() && !Utils.IsIpv4(sendThroughValue))
{
NoticeManager.Instance.Enqueue(ResUI.FillCorrectSendThroughIPv4);
return;
}
var needReboot = EnableStatistics != _config.GuiItem.EnableStatistics var needReboot = EnableStatistics != _config.GuiItem.EnableStatistics
|| DisplayRealTimeSpeed != _config.GuiItem.DisplayRealTimeSpeed || DisplayRealTimeSpeed != _config.GuiItem.DisplayRealTimeSpeed
|| EnableDragDropSort != _config.UiItem.EnableDragDropSort || EnableDragDropSort != _config.UiItem.EnableDragDropSort
@ -336,6 +344,7 @@ public class OptionSettingViewModel : MyReactiveObject
_config.CoreBasicItem.DefAllowInsecure = defAllowInsecure; _config.CoreBasicItem.DefAllowInsecure = defAllowInsecure;
_config.CoreBasicItem.DefFingerprint = defFingerprint; _config.CoreBasicItem.DefFingerprint = defFingerprint;
_config.CoreBasicItem.DefUserAgent = defUserAgent; _config.CoreBasicItem.DefUserAgent = defUserAgent;
_config.CoreBasicItem.SendThrough = sendThrough?.TrimEx();
_config.Mux4SboxItem.Protocol = mux4SboxProtocol; _config.Mux4SboxItem.Protocol = mux4SboxProtocol;
_config.CoreBasicItem.EnableCacheFile4Sbox = enableCacheFile4Sbox; _config.CoreBasicItem.EnableCacheFile4Sbox = enableCacheFile4Sbox;
_config.HysteriaItem.UpMbps = hyUpMbps ?? 0; _config.HysteriaItem.UpMbps = hyUpMbps ?? 0;

View file

@ -490,6 +490,7 @@ public class StatusBarViewModel : MyReactiveObject
} }
} }
} }
await ConfigHandler.SaveConfig(_config); await ConfigHandler.SaveConfig(_config);
AppEvents.ReloadRequested.Publish(); AppEvents.ReloadRequested.Publish();
} }

View file

@ -0,0 +1,189 @@
using System.Runtime.InteropServices;
using SkiaSharp;
namespace v2rayN.Desktop.Common;
public partial class QRCodeAvaloniaUtils
{
public static byte[]? CaptureScreen()
{
if (!Utils.IsWindows())
{
return null;
}
try
{
return CaptureScreenWindows();
}
catch (Exception ex)
{
Logging.SaveLog("CaptureScreen", ex);
return null;
}
}
private static byte[]? CaptureScreenWindows()
{
var hdcScreen = IntPtr.Zero;
var hdcMemory = IntPtr.Zero;
var hBitmap = IntPtr.Zero;
try
{
var workArea = new RECT();
SystemParametersInfo(SPI_GETWORKAREA, 0, ref workArea, 0);
var left = workArea.Left;
var top = workArea.Top;
var width = workArea.Right - workArea.Left;
var height = workArea.Bottom - workArea.Top;
if (width <= 0 || height <= 0)
{
left = 0;
top = 0;
width = GetSystemMetrics(0);
height = GetSystemMetrics(1);
}
hdcScreen = GetDC(IntPtr.Zero);
if (hdcScreen == IntPtr.Zero)
{
return null;
}
hdcMemory = CreateCompatibleDC(hdcScreen);
hBitmap = CreateCompatibleBitmap(hdcScreen, width, height);
if (hBitmap == IntPtr.Zero)
{
return null;
}
SelectObject(hdcMemory, hBitmap);
const int SRCCOPY = 0x00CC0020;
BitBlt(hdcMemory, 0, 0, width, height, hdcScreen, left, top, SRCCOPY);
var bmi = new BITMAPINFO
{
biSize = Marshal.SizeOf(typeof(BITMAPINFO)),
biWidth = width,
biHeight = -height,
biPlanes = 1,
biBitCount = 32,
biCompression = 0
};
var imageSize = width * height * 4;
var imageData = new byte[imageSize];
var scanLines = GetDIBits(hdcScreen, hBitmap, 0, (uint)height, imageData, ref bmi, 0);
if (scanLines == 0)
{
return null;
}
using var bitmap = new SKBitmap(width, height, SKColorType.Bgra8888, SKAlphaType.Premul);
Marshal.Copy(imageData, 0, bitmap.GetPixels(), imageSize);
using var image = SKImage.FromBitmap(bitmap);
using var encoded = image.Encode(SKEncodedImageFormat.Png, 100);
return encoded.ToArray();
}
catch (Exception ex)
{
Logging.SaveLog("CaptureScreenWindows", ex);
return null;
}
finally
{
if (hBitmap != IntPtr.Zero)
{
DeleteObject(hBitmap);
}
if (hdcMemory != IntPtr.Zero)
{
DeleteDC(hdcMemory);
}
if (hdcScreen != IntPtr.Zero)
{
ReleaseDC(IntPtr.Zero, hdcScreen);
}
}
}
#region Win32 API
[LibraryImport("user32.dll")]
private static partial IntPtr GetDC(IntPtr hwnd);
[LibraryImport("user32.dll")]
private static partial int ReleaseDC(IntPtr hwnd, IntPtr hdc);
[LibraryImport("gdi32.dll")]
private static partial IntPtr CreateCompatibleDC(IntPtr hdc);
[LibraryImport("gdi32.dll")]
private static partial IntPtr CreateCompatibleBitmap(IntPtr hdc, int nWidth, int nHeight);
[LibraryImport("gdi32.dll")]
private static partial IntPtr SelectObject(IntPtr hdc, IntPtr hObject);
[LibraryImport("gdi32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool BitBlt(IntPtr hdcDest, int nXDest, int nYDest, int nWidth, int nHeight,
IntPtr hdcSrc, int nXSrc, int nYSrc, int dwRop);
[LibraryImport("gdi32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool DeleteObject(IntPtr hObject);
[LibraryImport("gdi32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool DeleteDC(IntPtr hdc);
[LibraryImport("gdi32.dll")]
private static partial int GetDIBits(IntPtr hdc, IntPtr hbmp, uint uStartScan, uint cScanLines,
byte[] lpvBits, ref BITMAPINFO lpbmi, uint uUsage);
[LibraryImport("user32.dll")]
private static partial int GetSystemMetrics(int nIndex);
[LibraryImport("user32.dll", EntryPoint = "SystemParametersInfoW", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
private static partial bool SystemParametersInfo(int uiAction, int uiParam, ref RECT pvParam, int fWinIni);
private const int SPI_GETWORKAREA = 0x0030;
[StructLayout(LayoutKind.Sequential)]
private struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
[StructLayout(LayoutKind.Sequential)]
private struct BITMAPINFO
{
public int biSize;
public int biWidth;
public int biHeight;
public short biPlanes;
public short biBitCount;
public int biCompression;
public int biSizeImage;
public int biXPelsPerMeter;
public int biYPelsPerMeter;
public int biClrUsed;
public int biClrImportant;
}
#endregion Win32 API
}

View file

@ -53,7 +53,7 @@ public partial class JsonEditor : UserControl
var keyColor = dark ? "#9CDCFE" : "#0451A5"; var keyColor = dark ? "#9CDCFE" : "#0451A5";
var strColor = dark ? "#CE9178" : "#A31515"; var strColor = dark ? "#CE9178" : "#A31515";
var numColor = dark ? "#B5CEA8" : "#098658"; var numColor = dark ? "#B5CEA8" : "#098658";
var kwColor = dark ? "#569CD6" : "#0000FF"; var kwColor = dark ? "#569CD6" : "#0000FF";
var xshd = $""" var xshd = $"""
<?xml version="1.0"?> <?xml version="1.0"?>
<SyntaxDefinition name="JSON" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008"> <SyntaxDefinition name="JSON" xmlns="http://icsharpcode.net/sharpdevelop/syntaxdefinition/2008">
@ -91,6 +91,8 @@ public partial class JsonEditor : UserControl
} }
private void Copy_Click(object? sender, RoutedEventArgs e) => Editor.Copy(); private void Copy_Click(object? sender, RoutedEventArgs e) => Editor.Copy();
private void Paste_Click(object? sender, RoutedEventArgs e) => Editor.Paste(); private void Paste_Click(object? sender, RoutedEventArgs e) => Editor.Paste();
private void SelectAll_Click(object? sender, RoutedEventArgs e) => Editor.SelectAll(); private void SelectAll_Click(object? sender, RoutedEventArgs e) => Editor.SelectAll();
} }

View file

@ -162,8 +162,8 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
else else
{ {
Title = $"{Utils.GetVersion()}"; Title = $"{Utils.GetVersion()}";
menuAddServerViaScan.IsVisible = false;
} }
menuAddServerViaScan.IsVisible = false;
if (_config.UiItem.AutoHideStartup && Utils.IsWindows()) if (_config.UiItem.AutoHideStartup && Utils.IsWindows())
{ {
@ -336,17 +336,17 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
public async Task ScanScreenTaskAsync() public async Task ScanScreenTaskAsync()
{ {
//ShowHideWindow(false); ShowHideWindow(false);
NoticeManager.Instance.SendMessageAndEnqueue("Not yet implemented.(还未实现)"); await Task.Delay(200);
await Task.CompletedTask;
//if (Application.Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
//{
// //var bytes = QRCodeHelper.CaptureScreen(desktop);
// //await ViewModel?.ScanScreenResult(bytes);
//}
//ShowHideWindow(true); var bytes = QRCodeAvaloniaUtils.CaptureScreen();
if (bytes != null && ViewModel != null)
{
await ViewModel.ScanScreenResult(bytes);
}
ShowHideWindow(true);
} }
private async Task ScanImageTaskAsync() private async Task ScanImageTaskAsync()

View file

@ -325,6 +325,27 @@
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin4}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock
Grid.Row="21"
Grid.Column="0"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.TbSettingsSendThrough}" />
<TextBox
x:Name="txtsendThrough"
Grid.Row="21"
Grid.Column="1"
Width="200"
Margin="{StaticResource Margin4}"
Watermark="0.0.0.0" />
<TextBlock
Grid.Row="21"
Grid.Column="2"
Margin="{StaticResource Margin4}"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.TbSettingsSendThroughTip}"
TextWrapping="Wrap" />
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>
</TabItem> </TabItem>

View file

@ -76,6 +76,7 @@ public partial class OptionSettingWindow : WindowBase<OptionSettingViewModel>
this.Bind(ViewModel, vm => vm.defAllowInsecure, v => v.togdefAllowInsecure.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.defAllowInsecure, v => v.togdefAllowInsecure.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.defFingerprint, v => v.cmbdefFingerprint.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.defFingerprint, v => v.cmbdefFingerprint.SelectedValue).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.defUserAgent, v => v.cmbdefUserAgent.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.defUserAgent, v => v.cmbdefUserAgent.SelectedValue).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.sendThrough, v => v.txtsendThrough.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.mux4SboxProtocol, v => v.cmbmux4SboxProtocol.SelectedValue).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.mux4SboxProtocol, v => v.cmbmux4SboxProtocol.SelectedValue).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.enableCacheFile4Sbox, v => v.togenableCacheFile4Sbox.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.enableCacheFile4Sbox, v => v.togenableCacheFile4Sbox.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.hyUpMbps, v => v.txtUpMbps.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.hyUpMbps, v => v.txtUpMbps.Text).DisposeWith(disposables);

View file

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
@ -6,6 +6,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport> <BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault> <AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
<AssemblyName>v2rayN</AssemblyName> <AssemblyName>v2rayN</AssemblyName>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -52,4 +53,4 @@
</None> </None>
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -32,6 +32,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub Action", "GitHub Act
..\.github\workflows\winget-publish.yml = ..\.github\workflows\winget-publish.yml ..\.github\workflows\winget-publish.yml = ..\.github\workflows\winget-publish.yml
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServiceLib.Tests", "ServiceLib.Tests\ServiceLib.Tests.csproj", "{E0B6C5C7-ED48-42EB-947A-877779E9F555}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -58,6 +60,10 @@ Global
{CB3DE54F-3A26-AE02-1299-311132C32156}.Debug|Any CPU.Build.0 = Debug|Any CPU {CB3DE54F-3A26-AE02-1299-311132C32156}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB3DE54F-3A26-AE02-1299-311132C32156}.Release|Any CPU.ActiveCfg = Release|Any CPU {CB3DE54F-3A26-AE02-1299-311132C32156}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB3DE54F-3A26-AE02-1299-311132C32156}.Release|Any CPU.Build.0 = Release|Any CPU {CB3DE54F-3A26-AE02-1299-311132C32156}.Release|Any CPU.Build.0 = Release|Any CPU
{E0B6C5C7-ED48-42EB-947A-877779E9F555}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E0B6C5C7-ED48-42EB-947A-877779E9F555}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0B6C5C7-ED48-42EB-947A-877779E9F555}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0B6C5C7-ED48-42EB-947A-877779E9F555}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View file

@ -16,6 +16,7 @@
</Folder> </Folder>
<Project Path="AmazTool/AmazTool.csproj" /> <Project Path="AmazTool/AmazTool.csproj" />
<Project Path="GlobalHotKeys/src/GlobalHotKeys/GlobalHotKeys.csproj" /> <Project Path="GlobalHotKeys/src/GlobalHotKeys/GlobalHotKeys.csproj" />
<Project Path="ServiceLib.Tests/ServiceLib.Tests.csproj" />
<Project Path="ServiceLib/ServiceLib.csproj" /> <Project Path="ServiceLib/ServiceLib.csproj" />
<Project Path="v2rayN.Desktop/v2rayN.Desktop.csproj" /> <Project Path="v2rayN.Desktop/v2rayN.Desktop.csproj" />
<Project Path="v2rayN/v2rayN.csproj" /> <Project Path="v2rayN/v2rayN.csproj" />

View file

@ -5,7 +5,7 @@ using Microsoft.Win32;
namespace v2rayN.Common; namespace v2rayN.Common;
internal static class WindowsUtils internal static partial class WindowsUtils
{ {
private static readonly string _tag = "WindowsUtils"; private static readonly string _tag = "WindowsUtils";
@ -39,8 +39,8 @@ internal static class WindowsUtils
} }
} }
[DllImport("dwmapi.dll")] [LibraryImport("dwmapi.dll")]
public static extern int DwmSetWindowAttribute(nint hwnd, DWMWINDOWATTRIBUTE attribute, ref int attributeValue, uint attributeSize); public static partial int DwmSetWindowAttribute(nint hwnd, DWMWINDOWATTRIBUTE attribute, ref int attributeValue, uint attributeSize);
public static ImageSource IconToImageSource(Icon icon) public static ImageSource IconToImageSource(Icon icon)
{ {

View file

@ -1,6 +1,6 @@
namespace v2rayN.Manager; namespace v2rayN.Manager;
public sealed class HotkeyManager public sealed partial class HotkeyManager
{ {
private static readonly Lazy<HotkeyManager> _instance = new(() => new()); private static readonly Lazy<HotkeyManager> _instance = new(() => new());
public static HotkeyManager Instance = _instance.Value; public static HotkeyManager Instance = _instance.Value;
@ -165,11 +165,13 @@ public sealed class HotkeyManager
} }
} }
[DllImport("user32.dll", SetLastError = true)] [LibraryImport("user32.dll", SetLastError = true)]
private static extern bool RegisterHotKey(nint hWnd, int id, int fsModifiers, int vlc); [return: MarshalAs(UnmanagedType.Bool)]
private static partial bool RegisterHotKey(nint hWnd, int id, int fsModifiers, int vlc);
[DllImport("user32.dll", SetLastError = true)] [LibraryImport("user32.dll", SetLastError = true)]
private static extern bool UnregisterHotKey(nint hWnd, int id); [return: MarshalAs(UnmanagedType.Bool)]
private static partial bool UnregisterHotKey(nint hWnd, int id);
[Flags] [Flags]
private enum KeyModifiers private enum KeyModifiers

View file

@ -894,7 +894,6 @@
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin4}" Margin="{StaticResource Margin4}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
</Grid> </Grid>
<Separator <Separator

View file

@ -391,6 +391,30 @@
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock
Grid.Row="21"
Grid.Column="0"
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsSendThrough}" />
<TextBox
x:Name="txtsendThrough"
Grid.Row="21"
Grid.Column="1"
Width="200"
Margin="{StaticResource Margin8}"
Style="{StaticResource DefTextBox}"
materialDesign:HintAssist.Hint="0.0.0.0" />
<TextBlock
Grid.Row="21"
Grid.Column="2"
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsSendThroughTip}"
TextWrapping="Wrap" />
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>
</TabItem> </TabItem>

View file

@ -73,6 +73,7 @@ public partial class OptionSettingWindow
this.Bind(ViewModel, vm => vm.defAllowInsecure, v => v.togdefAllowInsecure.IsChecked).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.defFingerprint, v => v.cmbdefFingerprint.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.defUserAgent, v => v.cmbdefUserAgent.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.defUserAgent, v => v.cmbdefUserAgent.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.sendThrough, v => v.txtsendThrough.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.mux4SboxProtocol, v => v.cmbmux4SboxProtocol.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.mux4SboxProtocol, v => v.cmbmux4SboxProtocol.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.enableCacheFile4Sbox, v => v.togenableCacheFile4Sbox.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.enableCacheFile4Sbox, v => v.togenableCacheFile4Sbox.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.hyUpMbps, v => v.txtUpMbps.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.hyUpMbps, v => v.txtUpMbps.Text).DisposeWith(disposables);

View file

@ -8,6 +8,7 @@
<ApplicationIcon>Resources\v2rayN.ico</ApplicationIcon> <ApplicationIcon>Resources\v2rayN.ico</ApplicationIcon>
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
<SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion> <SupportedOSPlatformVersion>7.0</SupportedOSPlatformVersion>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -35,4 +36,4 @@
<ProjectReference Include="..\ServiceLib\ServiceLib.csproj" /> <ProjectReference Include="..\ServiceLib\ServiceLib.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>