Compare commits

...

37 Commits
7.4.1 ... 7.5.1

Author SHA1 Message Date
2dust
f500d2b9f4 up 7.5.1 2025-01-01 16:25:53 +08:00
2dust
79e53bf1f5 Improve macos system proxy code 2025-01-01 14:24:23 +08:00
2dust
31de7ec094 Bug fix SetLinuxChmod 2025-01-01 12:27:49 +08:00
2dust
2e4501187c Window title display adjustment
https://github.com/2dust/v2rayN/issues/6389
2025-01-01 10:38:55 +08:00
2dust
4430c9bd74 Remove the last rule from the Whitelist
https://github.com/2dust/v2rayN/issues/6378
2024-12-31 20:37:14 +08:00
2dust
cf8be85ff7 Remove the display of run as an administrator in Linux and macos 2024-12-31 16:30:27 +08:00
2dust
0759be1223 Fix rule required
https://github.com/2dust/v2rayN/issues/6378
2024-12-31 15:32:31 +08:00
2dust
21f8ddcf9f macos adds system proxy for USB
https://github.com/2dust/v2rayN/issues/6381
2024-12-31 14:55:35 +08:00
2dust
37cba5ee34 Fix export rule order issue
https://github.com/2dust/v2rayN/issues/6377
2024-12-31 14:15:09 +08:00
OnceUponATimeInAmerica
ff642fd1ac Add full support for (one-click) Iran regional preset by using Chocolate4U's github repos for iran routing rules (#6384) 2024-12-31 13:51:06 +08:00
2dust
647f1d9c8b up 7.5.0 2024-12-30 19:56:33 +08:00
2dust
d886195ee3 Adjust upgrade waiting time 2024-12-30 19:55:32 +08:00
2dust
e2b8f4f89a If Process.start contains spaces, add quotes 2024-12-30 19:33:39 +08:00
2dust
1dcfe661e9 Modify the build script
When NotStoreConfigHere.txt file exists, the configs not stored in the current folder
2024-12-30 18:16:07 +08:00
2dust
d6dd110781 Adjust open the storage location 2024-12-30 11:10:27 +08:00
2dust
a0f956c885 Add command shortcut keys for macos
https://github.com/2dust/v2rayN/issues/6375
2024-12-30 11:02:09 +08:00
Long Yixing
88bcafed97 Modify the build macos script (#6374) 2024-12-30 09:24:22 +08:00
2dust
6e4f15ab52 Update README.md 2024-12-27 10:12:38 +08:00
Wydy
20cae1ff4d Update pac (#6356) 2024-12-27 09:48:28 +08:00
2dust
dcf621b822 Modify the build script 2024-12-26 17:19:42 +08:00
2dust
eafa20032b Modify the build windows script 2024-12-25 17:06:03 +08:00
2dust
7375e1a490 Modify the build macos script 2024-12-25 16:48:23 +08:00
2dust
199d87ba84 Modify the build linux script and add release package deb 2024-12-25 16:11:02 +08:00
2dust
b43975ebfc Add v2rayN.png for desktop 2024-12-25 16:06:11 +08:00
2dust
fe7314c978 up 7.4.2 2024-12-24 10:55:25 +08:00
2dust
d4eb8e59a6 update build 2024-12-23 17:39:50 +08:00
2dust
8ee00907b7 update build 2024-12-23 17:34:06 +08:00
2dust
25fddc3c71 Code clean for desktop 2024-12-23 14:28:33 +08:00
2dust
c78b733850 Revert "update build macos"
This reverts commit a57c83125e.
2024-12-23 13:59:55 +08:00
2dust
a57c83125e update build macos 2024-12-23 12:12:03 +08:00
2dust
247b59985f update build 2024-12-23 11:31:56 +08:00
2dust
7470b8b6d3 Try to fix
https://github.com/2dust/v2rayN/issues/6073
2024-12-23 10:38:37 +08:00
2dust
776d37b7aa Optimize port display 2024-12-23 10:37:43 +08:00
alphax-hue3682
8f532f8468 Update persian translate (#6325) 2024-12-23 10:00:51 +08:00
2dust
472963fe2d Add a second local listening port
https://github.com/2dust/v2rayN/issues/6321
2024-12-22 20:03:20 +08:00
2dust
6a9b62ab9a Improve Ctrl+V for Windows 2024-12-22 12:02:00 +08:00
2dust
9ac8aa2969 up PackageReference 2024-12-22 12:00:50 +08:00
67 changed files with 6855 additions and 939 deletions

76
.github/workflows/build-linux.yml vendored Normal file
View File

@@ -0,0 +1,76 @@
name: release Linux
on:
workflow_dispatch:
inputs:
release_tag:
required: false
type: string
push:
branches:
- master
env:
OutputArch: "linux-64"
OutputArchArm: "linux-arm64"
OutputPath64: "${{ github.workspace }}/v2rayN/Release/linux-64"
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/linux-arm64"
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
cd v2rayN
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r linux-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r linux-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: v2rayN-linux
path: |
${{ github.workspace }}/v2rayN/Release/linux*
# release debian package
- name: Package debian
if: github.event.inputs.release_tag != ''
run: |
chmod 755 package-debian.sh
./package-debian.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }}
./package-debian.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }}
- name: Upload deb to release
uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
with:
file: ${{ github.workspace }}/v2rayN*.deb
tag: ${{ github.event.inputs.release_tag }}
file_glob: 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

View File

@@ -1,10 +1,20 @@
name: release macos name: release macOS
on: on:
workflow_dispatch:
inputs:
release_tag:
required: false
type: string
push: push:
branches: [ "master" ] branches:
pull_request: - master
branches: [ "master" ]
env:
OutputArch: "macos-64"
OutputArchArm: "macos-arm64"
OutputPath64: "${{ github.workspace }}/v2rayN/Release/macos-64"
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/macos-arm64"
jobs: jobs:
build: build:
@@ -19,14 +29,49 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Build - name: Build
run: cd v2rayN && run: |
./build-osx.sh cd v2rayN
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPath64
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o $OutputPathArm64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPath64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -o $OutputPathArm64
- name: Upload build artifacts - name: Upload build artifacts
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: v2rayN-osx name: v2rayN-macos
path: | path: |
./v2rayN/v2rayN-osx.zip ${{ github.workspace }}/v2rayN/Release/macos*
# release osx package
- name: Package osx
if: github.event.inputs.release_tag != ''
run: |
brew install create-dmg
chmod 755 package-osx.sh
./package-osx.sh $OutputArch $OutputPath64 ${{ github.event.inputs.release_tag }}
./package-osx.sh $OutputArchArm $OutputPathArm64 ${{ github.event.inputs.release_tag }}
- name: Upload dmg to release
uses: svenstaro/upload-release-action@v2
if: github.event.inputs.release_tag != ''
with:
file: ${{ github.workspace }}/v2rayN*.dmg
tag: ${{ github.event.inputs.release_tag }}
file_glob: 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

67
.github/workflows/build-windows.yml vendored Normal file
View File

@@ -0,0 +1,67 @@
name: release Windows
on:
workflow_dispatch:
inputs:
release_tag:
required: false
type: string
push:
branches:
- master
env:
OutputArch: "windows-64"
OutputArchArm: "windows-arm64"
OutputPath64: "${{ github.workspace }}/v2rayN/Release/windows-64"
OutputPathArm64: "${{ github.workspace }}/v2rayN/Release/windows-arm64"
OutputPath64Sc: "${{ github.workspace }}/v2rayN/Release/windows-64-SelfContained"
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build
run: |
cd v2rayN
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-arm64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
dotnet publish ./v2rayN/v2rayN.csproj -c Release -r win-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPath64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-arm64 --self-contained false -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:EnableWindowsTargeting=true -o $OutputPathArm64
dotnet publish ./AmazTool/AmazTool.csproj -c Release -r win-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -p:PublishTrimmed=true -p:EnableWindowsTargeting=true -o $OutputPath64Sc
- name: Upload build artifacts
uses: actions/upload-artifact@v4
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 "windows-64-With-Core" $OutputPath64
./package-release-zip.sh $OutputArchArm $OutputPathArm64
./package-release-zip.sh "windows-64-SelfContained" $OutputPath64Sc
./package-release-zip.sh "windows-64-SelfContained-With-Core" $OutputPath64Sc
- 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

View File

@@ -1,60 +0,0 @@
name: release
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
matrix:
configuration: [Release]
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: 删除工作流运行
# uses: Mattraks/delete-workflow-runs@v2
# with:
# token: ${{ github.token }}
# repository: ${{ github.repository }}
# retain_days: 0
# keep_minimum_runs: 1
- name: Build
run: cd v2rayN &&
./build.ps1
# - name: Package
# shell: pwsh
# run: |
# 7z a -mx9 ..\v2rayN.7z $env:Wap_Project_Directory
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: v2rayN
path: |
./v2rayN/v2rayN.zip
# - name: Release
# uses: softprops/action-gh-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
# with:
# prerelease: ${{ contains(github.ref, '-') }}
# draft: false
# files: |
# .\v2rayN\v2rayN.zip
# body: |
# [![](https://img.shields.io/badge/Telegram-Channel-blue)](https://t.me/netch_channel) [![](https://img.shields.io/badge/Telegram-Group-green)](https://t.me/netch_group)
# ## Changelogs
# * This is an automated deployment of GitHub Actions, the change log should be updated manually soon
# ## 更新日志
# * 这是 GitHub Actions 自动化部署,更新日志应该很快会手动更新

View File

@@ -1,5 +1,5 @@
# v2rayN # v2rayN
A GUI client for Windows and Linux, support [Xray core](https://github.com/XTLS/Xray-core) and [sing-box-core](https://github.com/SagerNet/sing-box/releases) and [others](https://github.com/2dust/v2rayN/wiki/List-of-supported-cores) A GUI client for Windows, Linux and macOS, support [Xray core](https://github.com/XTLS/Xray-core) and [sing-box-core](https://github.com/SagerNet/sing-box/releases) and [others](https://github.com/2dust/v2rayN/wiki/List-of-supported-cores)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/2dust/v2rayN)](https://github.com/2dust/v2rayN/commits/master) [![GitHub commit activity](https://img.shields.io/github/commit-activity/m/2dust/v2rayN)](https://github.com/2dust/v2rayN/commits/master)
@@ -19,6 +19,11 @@ Debian 9+
Ubuntu 16.04+ Ubuntu 16.04+
Fedora 30+ Fedora 30+
``` ```
### macOS
- `chmod +x v2rayN` Run `./v2rayN` under user permissions
```
macOS 10.14+
```
## Requirements ## Requirements
- [Microsoft .NET 8.0 Desktop Runtime ](https://dotnet.microsoft.com/en-us/download/dotnet/8.0) - [Microsoft .NET 8.0 Desktop Runtime ](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)

53
package-debian.sh Normal file
View File

@@ -0,0 +1,53 @@
#!/bin/bash
Arch="$1"
OutputPath="$2"
Version="$3"
PackagePath="v2rayN-Package-${Arch}"
mkdir -p "${PackagePath}/DEBIAN"
mkdir -p "${PackagePath}/opt"
cp -rf $OutputPath "${PackagePath}/opt/v2rayN"
echo "When this file exists, app will not store configs under this folder" > "${PackagePath}/opt/v2rayN/NotStoreConfigHere.txt"
if [ $Arch = "linux-64" ]; then
Arch2="amd64"
else
Arch2="arm64"
fi
echo $Arch2
# basic
cat >"${PackagePath}/DEBIAN/control" <<-EOF
Package: v2rayN
Version: $Version
Architecture: $Arch2
Maintainer: https://github.com/2dust/v2rayN
Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others
EOF
cat >"${PackagePath}/DEBIAN/postinst" <<-EOF
if [ ! -s /usr/share/applications/v2rayN.desktop ]; then
cat >/usr/share/applications/v2rayN.desktop<<-END
[Desktop Entry]
Name=v2rayN
Comment=A GUI client for Windows and Linux, support Xray core and sing-box-core and others
Exec=/opt/v2rayN/v2rayN
Icon=/opt/v2rayN/v2rayN.png
Terminal=false
Type=Application
Categories=Network;Application;
END
fi
update-desktop-database
EOF
sudo chmod 0755 "${PackagePath}/DEBIAN/postinst"
sudo chmod 0755 "${PackagePath}/opt/v2rayN/v2rayN"
sudo chmod 0755 "${PackagePath}/opt/v2rayN/AmazTool"
# desktop && PATH
sudo dpkg-deb -Zxz --build $PackagePath
sudo mv "${PackagePath}.deb" "v2rayN-${Arch}.deb"

65
package-osx.sh Executable file
View File

@@ -0,0 +1,65 @@
#!/bin/bash
Arch="$1"
OutputPath="$2"
Version="$3"
PackagePath="v2rayN-Package-${Arch}"
mkdir -p "$PackagePath/v2rayN.app/Contents/Resources"
cp -rf "$OutputPath" "$PackagePath/v2rayN.app/Contents/MacOS"
echo "When this file exists, app will not store configs under this folder" > "$PackagePath/v2rayN.app/Contents/MacOS/NotStoreConfigHere.txt"
chmod +x "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN"
mkdir -p "$PackagePath/icons.iconset"
sips -z 16 16 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_16x16.png"
sips -z 32 32 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_16x16@2x.png"
sips -z 32 32 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_32x32.png"
sips -z 64 64 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_32x32@2x.png"
sips -z 128 128 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_128x128.png"
sips -z 256 256 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_128x128@2x.png"
sips -z 256 256 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_256x256.png"
sips -z 512 512 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_256x256@2x.png"
sips -z 512 512 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_512x512.png"
sips -z 1024 1024 "$PackagePath/v2rayN.app/Contents/MacOS/v2rayN.png" --out "$PackagePath/icons.iconset/icon_512x512@2x.png"
iconutil -c icns "$PackagePath/icons.iconset" -o "$PackagePath/v2rayN.app/Contents/Resources/AppIcon.icns"
cat >"$PackagePath/v2rayN.app/Contents/Info.plist" <<-EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDisplayName</key>
<string>v2rayN</string>
<key>CFBundleExecutable</key>
<string>v2rayN</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundleIconName</key>
<string>AppIcon</string>
<key>CFBundleIdentifier</key>
<string>2dust.v2rayN</string>
<key>CFBundleName</key>
<string>v2rayN</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${Version}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
EOF
create-dmg \
--volname "v2rayN Installer" \
--window-size 700 420 \
--icon-size 100 \
--icon "v2rayN.app" 160 185 \
--hide-extension "v2rayN.app" \
--app-drop-link 500 185 \
"v2rayN-${Arch}.dmg" \
"$PackagePath/v2rayN.app"

15
package-release-zip.sh Normal file
View File

@@ -0,0 +1,15 @@
#!/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

View File

@@ -6,7 +6,7 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Copyright>Copyright © 2017-2024 (GPLv3)</Copyright> <Copyright>Copyright © 2017-2024 (GPLv3)</Copyright>
<FileVersion>1.3.0</FileVersion> <FileVersion>1.3.1</FileVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -10,7 +10,7 @@ namespace AmazTool
{ {
Console.WriteLine($"{Resx.Resource.StartUnzipping}\n{fileName}"); Console.WriteLine($"{Resx.Resource.StartUnzipping}\n{fileName}");
Waiting(9); Waiting(8);
if (!File.Exists(fileName)) if (!File.Exists(fileName))
{ {
@@ -91,7 +91,7 @@ namespace AmazTool
} }
Console.WriteLine(Resx.Resource.Restartv2rayN); Console.WriteLine(Resx.Resource.Restartv2rayN);
Waiting(9); Waiting(3);
Process process = new() Process process = new()
{ {
StartInfo = new() StartInfo = new()

View File

@@ -517,7 +517,7 @@ namespace ServiceLib.Common
public static bool UpgradeAppExists(out string fileName) public static bool UpgradeAppExists(out string fileName)
{ {
fileName = Path.Combine(Utils.StartupPath(), GetExeName("AmazTool")); fileName = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, GetExeName("AmazTool"));
return File.Exists(fileName); return File.Exists(fileName);
} }
@@ -530,7 +530,7 @@ namespace ServiceLib.Common
try try
{ {
return blFull return blFull
? $"{Global.AppName} - V{GetVersionInfo()} - {RuntimeInformation.ProcessArchitecture} - {StartupPath()}" ? $"{Global.AppName} - V{GetVersionInfo()} - {RuntimeInformation.ProcessArchitecture}"
: $"{Global.AppName}/{GetVersionInfo()}"; : $"{Global.AppName}/{GetVersionInfo()}";
} }
catch (Exception ex) catch (Exception ex)
@@ -554,6 +554,11 @@ namespace ServiceLib.Common
} }
} }
public static string GetRuntimeInfo()
{
return $"{Utils.GetVersion()} | {Utils.StartupPath()} | {Utils.GetExePath()} | {Environment.OSVersion} | {(Environment.Is64BitOperatingSystem ? 64 : 32)}";
}
/// <summary> /// <summary>
/// 取得GUID /// 取得GUID
/// </summary> /// </summary>
@@ -593,6 +598,9 @@ namespace ServiceLib.Common
return; return;
} }
if (fileName.Contains(' ')) fileName = fileName.AppendQuotes();
if (arguments.Contains(' ')) arguments = arguments.AppendQuotes();
Process.Start(new ProcessStartInfo(fileName, arguments) { UseShellExecute = true }); Process.Start(new ProcessStartInfo(fileName, arguments) { UseShellExecute = true });
} }
catch (Exception ex) catch (Exception ex)
@@ -675,6 +683,12 @@ namespace ServiceLib.Common
{ {
try try
{ {
//When this file exists, it is equivalent to having no permission to read and write
if (File.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "NotStoreConfigHere.txt")))
{
return false;
}
var tempPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "guiTemps"); var tempPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "guiTemps");
if (!Directory.Exists(tempPath)) if (!Directory.Exists(tempPath))
{ {
@@ -851,18 +865,19 @@ namespace ServiceLib.Common
{ {
return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
} }
else return false;
{ //else
var id = GetLinuxUserId().Result ?? "1000"; //{
if (int.TryParse(id, out var userId)) // var id = GetLinuxUserId().Result ?? "1000";
{ // if (int.TryParse(id, out var userId))
return userId == 0; // {
} // return userId == 0;
else // }
{ // else
return false; // {
} // return false;
} // }
//}
} }
private static async Task<string?> GetLinuxUserId() private static async Task<string?> GetLinuxUserId()
@@ -874,6 +889,7 @@ namespace ServiceLib.Common
public static async Task<string?> SetLinuxChmod(string? fileName) public static async Task<string?> SetLinuxChmod(string? fileName)
{ {
if (fileName.IsNullOrEmpty()) return null; if (fileName.IsNullOrEmpty()) return null;
if (fileName.Contains(' ')) fileName = fileName.AppendQuotes();
//File.SetUnixFileMode(fileName, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute); //File.SetUnixFileMode(fileName, UnixFileMode.UserRead | UnixFileMode.UserWrite | UnixFileMode.UserExecute);
var arg = new List<string>() { "-c", $"chmod +x {fileName}" }; var arg = new List<string>() { "-c", $"chmod +x {fileName}" };
return await GetCliWrapOutput("/bin/bash", arg); return await GetCliWrapOutput("/bin/bash", arg);
@@ -893,6 +909,12 @@ namespace ServiceLib.Common
: Environment.GetEnvironmentVariable("HOME"); : Environment.GetEnvironmentVariable("HOME");
} }
public static async Task<string?> GetListNetworkServices()
{
var arg = new List<string>() { "-c", $"networksetup -listallnetworkservices" };
return await GetCliWrapOutput("/bin/bash", arg);
}
#endregion Platform #endregion Platform
} }
} }

View File

@@ -4,6 +4,7 @@
{ {
socks = 0, socks = 0,
socks2, socks2,
socks3,
pac, pac,
api, api,
api2, api2,

View File

@@ -4,5 +4,6 @@
{ {
Default = 0, Default = 0,
Russia = 1, Russia = 1,
Iran = 2,
} }
} }

View File

@@ -124,21 +124,25 @@
public static readonly List<string> GeoFilesSources = new() { public static readonly List<string> GeoFilesSources = new() {
"", "",
@"https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/{0}.dat", @"https://github.com/runetfreedom/russia-v2ray-rules-dat/releases/latest/download/{0}.dat",
@"https://cdn.jsdelivr.net/gh/chocolate4u/Iran-v2ray-rules@release/{0}.dat",
}; };
public static readonly List<string> SingboxRulesetSources = new() { public static readonly List<string> SingboxRulesetSources = new() {
"", "",
@"https://cdn.jsdelivr.net/gh/runetfreedom/russia-v2ray-rules-dat@release/sing-box/rule-set-{0}/{1}.srs", @"https://cdn.jsdelivr.net/gh/runetfreedom/russia-v2ray-rules-dat@release/sing-box/rule-set-{0}/{1}.srs",
@"https://cdn.jsdelivr.net/gh/chocolate4u/Iran-sing-box-rules@rule-set/{1}.srs",
}; };
public static readonly List<string> RoutingRulesSources = new() { public static readonly List<string> RoutingRulesSources = new() {
"", "",
@"https://cdn.jsdelivr.net/gh/runetfreedom/russia-v2ray-custom-routing-list@main/v2rayN/template.json", @"https://cdn.jsdelivr.net/gh/runetfreedom/russia-v2ray-custom-routing-list@main/v2rayN/template.json",
@"https://cdn.jsdelivr.net/gh/Chocolate4U/Iran-v2ray-rules@main/v2rayN/template.json",
}; };
public static readonly List<string> DNSTemplateSources = new() { public static readonly List<string> DNSTemplateSources = new() {
"", "",
@"https://cdn.jsdelivr.net/gh/runetfreedom/russia-v2ray-custom-routing-list@main/v2rayN/", @"https://cdn.jsdelivr.net/gh/runetfreedom/russia-v2ray-custom-routing-list@main/v2rayN/",
@"https://cdn.jsdelivr.net/gh/Chocolate4U/Iran-v2ray-rules@main/v2rayN/",
}; };
public static readonly Dictionary<string, string> UserAgentTexts = new() public static readonly Dictionary<string, string> UserAgentTexts = new()
@@ -200,7 +204,7 @@
public static readonly List<string> Languages = new() { "zh-Hans", "zh-Hant", "en", "fa-Ir", "ru", "hu" }; public static readonly List<string> Languages = new() { "zh-Hans", "zh-Hant", "en", "fa-Ir", "ru", "hu" };
public static readonly List<string> Alpns = new() { "h3", "h2", "http/1.1", "h3,h2", "h2,http/1.1", "h3,h2,http/1.1", "" }; public static readonly List<string> Alpns = new() { "h3", "h2", "http/1.1", "h3,h2", "h2,http/1.1", "h3,h2,http/1.1", "" };
public static readonly List<string> LogLevels = new() { "debug", "info", "warning", "error", "none" }; public static readonly List<string> LogLevels = new() { "debug", "info", "warning", "error", "none" };
public static readonly List<string> InboundTags = new() { "socks", "socks2" }; public static readonly List<string> InboundTags = new() { "socks", "socks2", "socks3" };
public static readonly List<string> RuleProtocols = new() { "http", "tls", "bittorrent" }; public static readonly List<string> RuleProtocols = new() { "http", "tls", "bittorrent" };
public static readonly List<string> RuleNetworks = new() { "", "tcp", "udp", "tcp,udp" }; public static readonly List<string> RuleNetworks = new() { "", "tcp", "udp", "tcp,udp" };
public static readonly List<string> destOverrideProtocols = ["http", "tls", "quic", "fakedns", "fakedns+others"]; public static readonly List<string> destOverrideProtocols = ["http", "tls", "quic", "fakedns", "fakedns+others"];

View File

@@ -77,8 +77,7 @@
public bool InitComponents() public bool InitComponents()
{ {
Logging.SaveLog($"v2rayN start up | {Utils.GetVersion()} | {Utils.GetExePath()}"); Logging.SaveLog($"v2rayN start up | {Utils.GetRuntimeInfo()}");
Logging.SaveLog($"{Environment.OSVersion} - {(Environment.Is64BitOperatingSystem ? 64 : 32)}");
Logging.LoggingEnabled(_config.GuiItem.EnableLog); Logging.LoggingEnabled(_config.GuiItem.EnableLog);
Logging.ClearLogs(); Logging.ClearLogs();

View File

@@ -68,7 +68,7 @@ namespace ServiceLib.Handler
config.RoutingBasicItem ??= new(); config.RoutingBasicItem ??= new();
if (Utils.IsNullOrEmpty(config.RoutingBasicItem.DomainStrategy)) if (Utils.IsNullOrEmpty(config.RoutingBasicItem.DomainStrategy))
{ {
config.RoutingBasicItem.DomainStrategy = Global.DomainStrategies.First();//"IPIfNonMatch"; config.RoutingBasicItem.DomainStrategy = Global.DomainStrategies.First();
} }
config.KcpItem ??= new KcpItem config.KcpItem ??= new KcpItem
@@ -1868,6 +1868,16 @@ namespace ServiceLib.Handler
await SaveDNSItems(config, await GetExternalDNSItem(ECoreType.Xray, Global.DNSTemplateSources[1] + "v2ray.json")); await SaveDNSItems(config, await GetExternalDNSItem(ECoreType.Xray, Global.DNSTemplateSources[1] + "v2ray.json"));
await SaveDNSItems(config, await GetExternalDNSItem(ECoreType.sing_box, Global.DNSTemplateSources[1] + "sing_box.json")); await SaveDNSItems(config, await GetExternalDNSItem(ECoreType.sing_box, Global.DNSTemplateSources[1] + "sing_box.json"));
return true;
case EPresetType.Iran:
config.ConstItem.GeoSourceUrl = Global.GeoFilesSources[2];
config.ConstItem.SrsSourceUrl = Global.SingboxRulesetSources[2];
config.ConstItem.RouteRulesTemplateSourceUrl = Global.RoutingRulesSources[2];
await SaveDNSItems(config, await GetExternalDNSItem(ECoreType.Xray, Global.DNSTemplateSources[2] + "v2ray.json"));
await SaveDNSItems(config, await GetExternalDNSItem(ECoreType.sing_box, Global.DNSTemplateSources[2] + "sing_box.json"));
return true; return true;
} }

View File

@@ -67,7 +67,7 @@ namespace ServiceLib.Handler
} }
ShowMsg(true, $"{node.GetSummary()}"); ShowMsg(true, $"{node.GetSummary()}");
ShowMsg(false, $"{Environment.OSVersion} - {(Environment.Is64BitOperatingSystem ? 64 : 32)}"); ShowMsg(false, $"{Utils.GetRuntimeInfo()}");
ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss"))); ShowMsg(false, string.Format(ResUI.StartService, DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")));
await CoreStop(); await CoreStop();
await Task.Delay(100); await Task.Delay(100);

View File

@@ -35,6 +35,16 @@
List<string> lstType = ["", "http", "https", "socks", "ftp"]; List<string> lstType = ["", "http", "https", "socks", "ftp"];
List<CmdItem> lstCmd = []; List<CmdItem> lstCmd = [];
//GNOME
foreach (var type in lstType)
{
lstCmd.AddRange(GetSetCmd4Gnome(type, host, port));
}
if (exceptions.IsNotEmpty())
{
lstCmd.AddRange(GetSetCmd4Gnome("exceptions", exceptions, 0));
}
if (isKde) if (isKde)
{ {
foreach (var type in lstType) foreach (var type in lstType)
@@ -45,17 +55,13 @@
{ {
lstCmd.AddRange(GetSetCmd4Kde("exceptions", exceptions, 0, configDir)); lstCmd.AddRange(GetSetCmd4Kde("exceptions", exceptions, 0, configDir));
} }
}
else // Notify system to reload
{ lstCmd.Add(new CmdItem()
foreach (var type in lstType)
{ {
lstCmd.AddRange(GetSetCmd4Gnome(type, host, port)); Cmd = "dbus-send",
} Arguments = ["--type=signal", "/KIO/Scheduler", "org.kde.KIO.Scheduler.reparseSlaveConfiguration", "string:''"]
if (exceptions.IsNotEmpty()) });
{
lstCmd.AddRange(GetSetCmd4Gnome("exceptions", exceptions, 0));
}
} }
return lstCmd; return lstCmd;
} }
@@ -65,6 +71,13 @@
var isKde = IsKde(out var configDir); var isKde = IsKde(out var configDir);
List<CmdItem> lstCmd = []; List<CmdItem> lstCmd = [];
//GNOME
lstCmd.Add(new CmdItem()
{
Cmd = "gsettings",
Arguments = ["set", "org.gnome.system.proxy", "mode", "none"]
});
if (isKde) if (isKde)
{ {
lstCmd.Add(new CmdItem() lstCmd.Add(new CmdItem()
@@ -72,16 +85,14 @@
Cmd = GetKdeVersion(), Cmd = GetKdeVersion(),
Arguments = ["--file", $"{configDir}/kioslaverc", "--group", "Proxy Settings", "--key", "ProxyType", "0"] Arguments = ["--file", $"{configDir}/kioslaverc", "--group", "Proxy Settings", "--key", "ProxyType", "0"]
}); });
}
else // Notify system to reload
{
lstCmd.Add(new CmdItem() lstCmd.Add(new CmdItem()
{ {
Cmd = "gsettings", Cmd = "dbus-send",
Arguments = ["set", "org.gnome.system.proxy", "mode", "none"] Arguments = ["--type=signal", "/KIO/Scheduler", "org.kde.KIO.Scheduler.reparseSlaveConfiguration", "string:''"]
}); });
} }
return lstCmd; return lstCmd;
} }
@@ -161,7 +172,11 @@
{ {
configDir = "/home"; configDir = "/home";
var desktop = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP"); var desktop = Environment.GetEnvironmentVariable("XDG_CURRENT_DESKTOP");
var isKde = string.Equals(desktop, "KDE", StringComparison.OrdinalIgnoreCase); var desktop2 = Environment.GetEnvironmentVariable("XDG_SESSION_DESKTOP");
var isKde = string.Equals(desktop, "KDE", StringComparison.OrdinalIgnoreCase)
|| string.Equals(desktop, "plasma", StringComparison.OrdinalIgnoreCase)
|| string.Equals(desktop2, "KDE", StringComparison.OrdinalIgnoreCase)
|| string.Equals(desktop2, "plasma", StringComparison.OrdinalIgnoreCase);
if (isKde) if (isKde)
{ {
var homeDir = Environment.GetEnvironmentVariable("HOME"); var homeDir = Environment.GetEnvironmentVariable("HOME");
@@ -173,6 +188,7 @@
return isKde; return isKde;
} }
private static string GetKdeVersion() private static string GetKdeVersion()
{ {
var ver = Environment.GetEnvironmentVariable("KDE_SESSION_VERSION") ?? "0"; var ver = Environment.GetEnvironmentVariable("KDE_SESSION_VERSION") ?? "0";

View File

@@ -2,14 +2,10 @@
{ {
public class ProxySettingOSX public class ProxySettingOSX
{ {
/*
* 仅测试了MacOS 13.7.1 x86 版本,其他版本有待确认
*/
/// <summary> /// <summary>
/// 应用接口类型 /// 应用接口类型
/// </summary> /// </summary>
private static readonly List<string> LstInterface = ["Ethernet", "Wi-Fi", "Thunderbolt Bridge"]; private static readonly List<string> LstInterface = ["Ethernet", "Wi-Fi", "Thunderbolt Bridge", "USB 10/100/1000 LAN"];
/// <summary> /// <summary>
/// 代理类型,对应 http,https,socks /// 代理类型,对应 http,https,socks
@@ -18,13 +14,15 @@
public static async Task SetProxy(string host, int port, string exceptions) public static async Task SetProxy(string host, int port, string exceptions)
{ {
var lstCmd = GetSetCmds(host, port, exceptions); var lstInterface = await GetListNetworkServices();
var lstCmd = GetSetCmds(lstInterface, host, port, exceptions);
await ExecCmd(lstCmd); await ExecCmd(lstCmd);
} }
public static async Task UnsetProxy() public static async Task UnsetProxy()
{ {
var lstCmd = GetUnsetCmds(); var lstInterface = await GetListNetworkServices();
var lstCmd = GetUnsetCmds(lstInterface);
await ExecCmd(lstCmd); await ExecCmd(lstCmd);
} }
@@ -42,10 +40,10 @@
} }
} }
private static List<CmdItem> GetSetCmds(string host, int port, string exceptions) private static List<CmdItem> GetSetCmds(List<string> lstInterface, string host, int port, string exceptions)
{ {
List<CmdItem> lstCmd = []; List<CmdItem> lstCmd = [];
foreach (var interf in LstInterface) foreach (var interf in lstInterface)
{ {
foreach (var type in LstTypes) foreach (var type in LstTypes)
{ {
@@ -70,10 +68,10 @@
return lstCmd; return lstCmd;
} }
private static List<CmdItem> GetUnsetCmds() private static List<CmdItem> GetUnsetCmds(List<string> lstInterface)
{ {
List<CmdItem> lstCmd = []; List<CmdItem> lstCmd = [];
foreach (var interf in LstInterface) foreach (var interf in lstInterface)
{ {
foreach (var type in LstTypes) foreach (var type in LstTypes)
{ {
@@ -87,5 +85,16 @@
return lstCmd; return lstCmd;
} }
public static async Task<List<string>> GetListNetworkServices()
{
var services = await Utils.GetListNetworkServices();
if (services.IsNullOrEmpty())
{
return LstInterface;
}
var lst = services.Split(Environment.NewLine);
return lst.Length > 0 ? LstInterface.Intersect(lst).ToList() : LstInterface;
}
} }
} }

View File

@@ -24,21 +24,16 @@
public class InItem public class InItem
{ {
public int LocalPort { get; set; } public int LocalPort { get; set; }
public string Protocol { get; set; } public string Protocol { get; set; }
public bool UdpEnabled { get; set; } public bool UdpEnabled { get; set; }
public bool SniffingEnabled { get; set; } = true; public bool SniffingEnabled { get; set; } = true;
public List<string>? DestOverride { get; set; } = ["http", "tls"]; public List<string>? DestOverride { get; set; } = ["http", "tls"];
public bool RouteOnly { get; set; } public bool RouteOnly { get; set; }
public bool AllowLANConn { get; set; } public bool AllowLANConn { get; set; }
public bool NewPort4LAN { get; set; } public bool NewPort4LAN { get; set; }
public string User { get; set; } public string User { get; set; }
public string Pass { get; set; } public string Pass { get; set; }
public bool SecondLocalPortEnabled { get; set; }
} }
[Serializable] [Serializable]

View File

@@ -1248,6 +1248,15 @@ namespace ServiceLib.Resx {
} }
} }
/// <summary>
/// 查找类似 Iran 的本地化字符串。
/// </summary>
public static string menuRegionalPresetsIran {
get {
return ResourceManager.GetString("menuRegionalPresetsIran", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Russia 的本地化字符串。 /// 查找类似 Russia 的本地化字符串。
/// </summary> /// </summary>
@@ -2599,6 +2608,15 @@ namespace ServiceLib.Resx {
} }
} }
/// <summary>
/// 查找类似 socks: local port, socks2: second local port, socks3: LAN port 的本地化字符串。
/// </summary>
public static string TbRoutingInboundTagTips {
get {
return ResourceManager.GetString("TbRoutingInboundTagTips", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Domain 的本地化字符串。 /// 查找类似 Domain 的本地化字符串。
/// </summary> /// </summary>
@@ -2914,6 +2932,15 @@ namespace ServiceLib.Resx {
} }
} }
/// <summary>
/// 查找类似 Sniffing type 的本地化字符串。
/// </summary>
public static string TbSettingsDestOverride {
get {
return ResourceManager.GetString("TbSettingsDestOverride", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Outbound DNS address 的本地化字符串。 /// 查找类似 Outbound DNS address 的本地化字符串。
/// </summary> /// </summary>
@@ -3301,6 +3328,15 @@ namespace ServiceLib.Resx {
} }
} }
/// <summary>
/// 查找类似 Enable second mixed port 的本地化字符串。
/// </summary>
public static string TbSettingsSecondLocalPortEnabled {
get {
return ResourceManager.GetString("TbSettingsSecondLocalPortEnabled", resourceCulture);
}
}
/// <summary> /// <summary>
/// 查找类似 Set Win10 UWP Loopback 的本地化字符串。 /// 查找类似 Set Win10 UWP Loopback 的本地化字符串。
/// </summary> /// </summary>
@@ -3329,7 +3365,7 @@ namespace ServiceLib.Resx {
} }
/// <summary> /// <summary>
/// 查找类似 Pac port = +2; Xray API port = +3; mihomo API port = +4; 的本地化字符串。 /// 查找类似 Pac port = +3; Xray API port = +4; mihomo API port = +5; 的本地化字符串。
/// </summary> /// </summary>
public static string TbSettingsSocksPortTip { public static string TbSettingsSocksPortTip {
get { get {

View File

@@ -1129,6 +1129,9 @@
<data name="menuRegionalPresetsRussia" xml:space="preserve"> <data name="menuRegionalPresetsRussia" xml:space="preserve">
<value>روسیه</value> <value>روسیه</value>
</data> </data>
<data name="menuRegionalPresetsIran" xml:space="preserve">
<value>ایران</value>
</data>
<data name="TbSettingsChinaUserTip" xml:space="preserve"> <data name="TbSettingsChinaUserTip" xml:space="preserve">
<value>کاربران در منطقه چین می توانند این مورد را نادیده بگیرند</value> <value>کاربران در منطقه چین می توانند این مورد را نادیده بگیرند</value>
</data> </data>
@@ -1244,7 +1247,7 @@
<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 = +2; پورت Xray API = +3; پورت mihomo API = +4;</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>
@@ -1390,4 +1393,13 @@
<data name="TbSettingsExceptionTip2" xml:space="preserve"> <data name="TbSettingsExceptionTip2" xml:space="preserve">
<value>استثنا:از سرور پروکسی برای آدرس ها، با کاما (،) استفاده نکنید</value> <value>استثنا:از سرور پروکسی برای آدرس ها، با کاما (،) استفاده نکنید</value>
</data> </data>
<data name="TbSettingsDestOverride" xml:space="preserve">
<value>نوع Sniffing</value>
</data>
<data name="TbSettingsSecondLocalPortEnabled" xml:space="preserve">
<value>فعال کردن دومین پورت ترکیبی</value>
</data>
<data name="TbRoutingInboundTagTips" xml:space="preserve">
<value>socks:پورت محلی، socks2: پورت دوم محلی، socks3: پورت LAN</value>
</data>
</root> </root>

View File

@@ -109,7 +109,7 @@
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
@@ -992,7 +992,7 @@
<value>Kérlek, másold a betűtípus TTF/TTC fájlt a guiFonts könyvtárba, indítsd újra a beállításokat</value> <value>Kérlek, másold a betűtípus TTF/TTC fájlt a guiFonts könyvtárba, indítsd újra a beállításokat</value>
</data> </data>
<data name="TbSettingsSocksPortTip" xml:space="preserve"> <data name="TbSettingsSocksPortTip" xml:space="preserve">
<value>Pac port = +2; Xray API port = +3; mihomo API port = +4;</value> <value>Pac port = +3; Xray API port = +4; mihomo API port = +5;</value>
</data> </data>
<data name="TbSettingsStartBootTip" xml:space="preserve"> <data name="TbSettingsStartBootTip" xml:space="preserve">
<value>Állítsd be ezt admin jogokkal, indítás után szerezd meg az admin jogokat</value> <value>Állítsd be ezt admin jogokkal, indítás után szerezd meg az admin jogokat</value>
@@ -1342,6 +1342,9 @@
<data name="menuRegionalPresetsRussia" xml:space="preserve"> <data name="menuRegionalPresetsRussia" xml:space="preserve">
<value>Oroszország</value> <value>Oroszország</value>
</data> </data>
<data name="menuRegionalPresetsIran" xml:space="preserve">
<value>Irán</value>
</data>
<data name="TbSettingsChinaUserTip" xml:space="preserve"> <data name="TbSettingsChinaUserTip" xml:space="preserve">
<value>A Kínában élő felhasználók figyelmen kívül hagyhatják ezt a tételt</value> <value>A Kínában élő felhasználók figyelmen kívül hagyhatják ezt a tételt</value>
</data> </data>
@@ -1390,4 +1393,13 @@
<data name="TbSettingsExceptionTip2" xml:space="preserve"> <data name="TbSettingsExceptionTip2" xml:space="preserve">
<value>Kivétel. Ne használj proxy szervert a címeknél, évezz pontosvesszőt (,)</value> <value>Kivétel. Ne használj proxy szervert a címeknél, évezz pontosvesszőt (,)</value>
</data> </data>
</root> <data name="TbSettingsDestOverride" xml:space="preserve">
<value>Sniffing type</value>
</data>
<data name="TbSettingsSecondLocalPortEnabled" xml:space="preserve">
<value>Enable second mixed port</value>
</data>
<data name="TbRoutingInboundTagTips" xml:space="preserve">
<value>socks: local port, socks2: second local port, socks3: LAN port</value>
</data>
</root>

View File

@@ -992,7 +992,7 @@
<value>Copy the font TTF/TTC file to the directory guiFonts, restart the settings</value> <value>Copy the font TTF/TTC file to the directory guiFonts, restart the settings</value>
</data> </data>
<data name="TbSettingsSocksPortTip" xml:space="preserve"> <data name="TbSettingsSocksPortTip" xml:space="preserve">
<value>Pac port = +2; Xray API port = +3; mihomo API port = +4;</value> <value>Pac port = +3; Xray API port = +4; mihomo API port = +5;</value>
</data> </data>
<data name="TbSettingsStartBootTip" xml:space="preserve"> <data name="TbSettingsStartBootTip" xml:space="preserve">
<value>Set this with admin privileges, get admin privileges after startup</value> <value>Set this with admin privileges, get admin privileges after startup</value>
@@ -1342,6 +1342,9 @@
<data name="menuRegionalPresetsRussia" xml:space="preserve"> <data name="menuRegionalPresetsRussia" xml:space="preserve">
<value>Russia</value> <value>Russia</value>
</data> </data>
<data name="menuRegionalPresetsIran" xml:space="preserve">
<value>Iran</value>
</data>
<data name="TbSettingsChinaUserTip" xml:space="preserve"> <data name="TbSettingsChinaUserTip" xml:space="preserve">
<value>Users in China region can ignore this item</value> <value>Users in China region can ignore this item</value>
</data> </data>
@@ -1390,4 +1393,13 @@
<data name="TbSettingsExceptionTip2" xml:space="preserve"> <data name="TbSettingsExceptionTip2" xml:space="preserve">
<value>Exception. Do not use proxy server for addresses,with a comma (,)</value> <value>Exception. Do not use proxy server for addresses,with a comma (,)</value>
</data> </data>
<data name="TbSettingsDestOverride" xml:space="preserve">
<value>Sniffing type</value>
</data>
<data name="TbSettingsSecondLocalPortEnabled" xml:space="preserve">
<value>Enable second mixed port</value>
</data>
<data name="TbRoutingInboundTagTips" xml:space="preserve">
<value>socks: local port, socks2: second local port, socks3: LAN port</value>
</data>
</root> </root>

View File

@@ -1039,6 +1039,9 @@
<data name="menuRegionalPresetsRussia" xml:space="preserve"> <data name="menuRegionalPresetsRussia" xml:space="preserve">
<value>Россия</value> <value>Россия</value>
</data> </data>
<data name="menuRegionalPresetsIran" xml:space="preserve">
<value>Иран</value>
</data>
<data name="TbSettingsChinaUserTip" xml:space="preserve"> <data name="TbSettingsChinaUserTip" xml:space="preserve">
<value>Используйте Настройки -&gt; Региональные пресеты вместо изменения этого поля</value> <value>Используйте Настройки -&gt; Региональные пресеты вместо изменения этого поля</value>
</data> </data>
@@ -1310,7 +1313,7 @@
<value>Move up and down</value> <value>Move up and down</value>
</data> </data>
<data name="TbSettingsSocksPortTip" xml:space="preserve"> <data name="TbSettingsSocksPortTip" xml:space="preserve">
<value>Pac port = +2; Xray API port = +3; mihomo API port = +4;</value> <value>Pac port = +3; Xray API port = +4; mihomo API port = +5;</value>
</data> </data>
<data name="TbSettingsCurrentFontFamilyLinuxTip" xml:space="preserve"> <data name="TbSettingsCurrentFontFamilyLinuxTip" xml:space="preserve">
<value>Install the font to the system and restart the settings</value> <value>Install the font to the system and restart the settings</value>
@@ -1390,4 +1393,13 @@
<data name="TbSettingsExceptionTip2" xml:space="preserve"> <data name="TbSettingsExceptionTip2" xml:space="preserve">
<value>Exception. Do not use proxy server for addresses,with a comma (,)</value> <value>Exception. Do not use proxy server for addresses,with a comma (,)</value>
</data> </data>
<data name="TbSettingsDestOverride" xml:space="preserve">
<value>Sniffing type</value>
</data>
<data name="TbSettingsSecondLocalPortEnabled" xml:space="preserve">
<value>Enable second mixed port</value>
</data>
<data name="TbRoutingInboundTagTips" xml:space="preserve">
<value>socks: local port, socks2: second local port, socks3: LAN port</value>
</data>
</root> </root>

View File

@@ -992,7 +992,7 @@
<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端口= +2Xray API端口= +3mihomo API端口= +4</value> <value>Pac端口= +3Xray API端口= +4mihomo API端口= +5</value>
</data> </data>
<data name="TbSettingsStartBootTip" xml:space="preserve"> <data name="TbSettingsStartBootTip" xml:space="preserve">
<value>以管理员权限设置此项,在启动后获得管理员权限</value> <value>以管理员权限设置此项,在启动后获得管理员权限</value>
@@ -1342,6 +1342,9 @@
<data name="menuRegionalPresetsRussia" xml:space="preserve"> <data name="menuRegionalPresetsRussia" xml:space="preserve">
<value>俄罗斯</value> <value>俄罗斯</value>
</data> </data>
<data name="menuRegionalPresetsIran" xml:space="preserve">
<value>伊朗</value>
</data>
<data name="menuAddServerViaImage" xml:space="preserve"> <data name="menuAddServerViaImage" xml:space="preserve">
<value>扫描图片中的二维码</value> <value>扫描图片中的二维码</value>
</data> </data>
@@ -1387,4 +1390,13 @@
<data name="TbSettingsExceptionTip2" xml:space="preserve"> <data name="TbSettingsExceptionTip2" xml:space="preserve">
<value>例外. 对于下列地址不使用代理配置文件:使用逗号(,)分隔</value> <value>例外. 对于下列地址不使用代理配置文件:使用逗号(,)分隔</value>
</data> </data>
<data name="TbSettingsDestOverride" xml:space="preserve">
<value>流量探测类型</value>
</data>
<data name="TbSettingsSecondLocalPortEnabled" xml:space="preserve">
<value>开启第二个本地监听端口</value>
</data>
<data name="TbRoutingInboundTagTips" xml:space="preserve">
<value>socks本地端口socks2第二个本地端口socks3局域网端口</value>
</data>
</root> </root>

View File

@@ -992,7 +992,7 @@
<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連接埠= +2Xray API連接埠= +3mihomo API連接埠= +4</value> <value>Pac連接埠= +3Xray API連接埠= +4mihomo API連接埠= +5</value>
</data> </data>
<data name="TbSettingsStartBootTip" xml:space="preserve"> <data name="TbSettingsStartBootTip" xml:space="preserve">
<value>以管理員權限設定此項,在啟動後獲得管理員權限</value> <value>以管理員權限設定此項,在啟動後獲得管理員權限</value>
@@ -1222,6 +1222,9 @@
<data name="menuRegionalPresetsRussia" xml:space="preserve"> <data name="menuRegionalPresetsRussia" xml:space="preserve">
<value>俄羅斯</value> <value>俄羅斯</value>
</data> </data>
<data name="menuRegionalPresetsIran" xml:space="preserve">
<value>伊朗</value>
</data>
<data name="menuAddServerViaImage" xml:space="preserve"> <data name="menuAddServerViaImage" xml:space="preserve">
<value>掃描圖片中的二維碼</value> <value>掃描圖片中的二維碼</value>
</data> </data>
@@ -1387,4 +1390,13 @@
<data name="TbSettingsExceptionTip2" xml:space="preserve"> <data name="TbSettingsExceptionTip2" xml:space="preserve">
<value>例外. 對於下列位址不使用代理設定檔:使用逗號(,)分隔</value> <value>例外. 對於下列位址不使用代理設定檔:使用逗號(,)分隔</value>
</data> </data>
<data name="TbSettingsDestOverride" xml:space="preserve">
<value>流量探測類型</value>
</data>
<data name="TbSettingsSecondLocalPortEnabled" xml:space="preserve">
<value>開啟第二個本機監聽埠</value>
</data>
<data name="TbRoutingInboundTagTips" xml:space="preserve">
<value>socks本地端口socks2第二個本地端口socks3區域網路端口</value>
</data>
</root> </root>

View File

@@ -99,10 +99,5 @@
"domain": [ "domain": [
"geosite:cn" "geosite:cn"
] ]
},
{
"remarks": "最终代理",
"port": "0-65535",
"outboundTag": "proxy"
} }
] ]

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@
<TargetFramework>net8.0</TargetFramework> <TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<Version>7.4.1</Version> <Version>7.5.1</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -14,7 +14,7 @@
<PackageReference Include="sqlite-net-pcl" Version="1.9.172" /> <PackageReference Include="sqlite-net-pcl" Version="1.9.172" />
<PackageReference Include="Splat.NLog" Version="15.2.22" /> <PackageReference Include="Splat.NLog" Version="15.2.22" />
<PackageReference Include="WebDav.Client" Version="2.8.0" /> <PackageReference Include="WebDav.Client" Version="2.8.0" />
<PackageReference Include="YamlDotNet" Version="16.2.1" /> <PackageReference Include="YamlDotNet" Version="16.3.0" />
<PackageReference Include="QRCoder" Version="1.6.0" /> <PackageReference Include="QRCoder" Version="1.6.0" />
<PackageReference Include="CliWrap" Version="3.7.0" /> <PackageReference Include="CliWrap" Version="3.7.0" />
<PackageReference Include="SkiaSharp.QrCode" Version="0.7.0" /> <PackageReference Include="SkiaSharp.QrCode" Version="0.7.0" />

View File

@@ -507,11 +507,17 @@ namespace ServiceLib.Services.CoreConfig
inbound.domain_strategy = routing.DomainStrategy4Singbox; inbound.domain_strategy = routing.DomainStrategy4Singbox;
} }
if (_config.Inbound.First().SecondLocalPortEnabled)
{
var inbound2 = GetInbound(inbound, EInboundProtocol.socks2, true);
singboxConfig.inbounds.Add(inbound2);
}
if (_config.Inbound.First().AllowLANConn) if (_config.Inbound.First().AllowLANConn)
{ {
if (_config.Inbound.First().NewPort4LAN) if (_config.Inbound.First().NewPort4LAN)
{ {
var inbound3 = GetInbound(inbound, EInboundProtocol.socks2, true); var inbound3 = GetInbound(inbound, EInboundProtocol.socks3, true);
inbound3.listen = listen; inbound3.listen = listen;
singboxConfig.inbounds.Add(inbound3); singboxConfig.inbounds.Add(inbound3);

View File

@@ -394,11 +394,17 @@ namespace ServiceLib.Services.CoreConfig
var inbound = GetInbound(_config.Inbound.First(), EInboundProtocol.socks, true); var inbound = GetInbound(_config.Inbound.First(), EInboundProtocol.socks, true);
v2rayConfig.inbounds.Add(inbound); v2rayConfig.inbounds.Add(inbound);
if (_config.Inbound.First().SecondLocalPortEnabled)
{
var inbound2 = GetInbound(_config.Inbound.First(), EInboundProtocol.socks2, true);
v2rayConfig.inbounds.Add(inbound2);
}
if (_config.Inbound.First().AllowLANConn) if (_config.Inbound.First().AllowLANConn)
{ {
if (_config.Inbound.First().NewPort4LAN) if (_config.Inbound.First().NewPort4LAN)
{ {
var inbound3 = GetInbound(_config.Inbound.First(), EInboundProtocol.socks2, true); var inbound3 = GetInbound(_config.Inbound.First(), EInboundProtocol.socks3, true);
inbound3.listen = listen; inbound3.listen = listen;
v2rayConfig.inbounds.Add(inbound3); v2rayConfig.inbounds.Add(inbound3);

View File

@@ -50,6 +50,8 @@ namespace ServiceLib.ViewModels
public ReactiveCommand<Unit, Unit> RegionalPresetRussiaCmd { get; } public ReactiveCommand<Unit, Unit> RegionalPresetRussiaCmd { get; }
public ReactiveCommand<Unit, Unit> RegionalPresetIranCmd { get; }
public ReactiveCommand<Unit, Unit> ReloadCmd { get; } public ReactiveCommand<Unit, Unit> ReloadCmd { get; }
[Reactive] [Reactive]
@@ -197,6 +199,11 @@ namespace ServiceLib.ViewModels
await ApplyRegionalPreset(EPresetType.Russia); await ApplyRegionalPreset(EPresetType.Russia);
}); });
RegionalPresetIranCmd = ReactiveCommand.CreateFromTask(async () =>
{
await ApplyRegionalPreset(EPresetType.Iran);
});
#endregion WhenAnyValue && ReactiveCommand #endregion WhenAnyValue && ReactiveCommand
Init(); Init();
@@ -528,17 +535,18 @@ namespace ServiceLib.ViewModels
private async Task OpenTheFileLocation() private async Task OpenTheFileLocation()
{ {
var path = Utils.StartupPath();
if (Utils.IsWindows()) if (Utils.IsWindows())
{ {
Utils.ProcessStart("Explorer", $"/select,{Utils.GetConfigPath()}"); Utils.ProcessStart(path);
} }
else if (Utils.IsLinux()) else if (Utils.IsLinux())
{ {
Utils.ProcessStart("nautilus", Utils.GetConfigPath()); Utils.ProcessStart("nautilus", path);
} }
else if (Utils.IsOSX()) else if (Utils.IsOSX())
{ {
Utils.ProcessStart("open", Utils.GetConfigPath()); Utils.ProcessStart("open", path);
} }
} }

View File

@@ -9,6 +9,7 @@ namespace ServiceLib.ViewModels
#region Core #region Core
[Reactive] public int localPort { get; set; } [Reactive] public int localPort { get; set; }
[Reactive] public bool SecondLocalPortEnabled { get; set; }
[Reactive] public bool udpEnabled { get; set; } [Reactive] public bool udpEnabled { get; set; }
[Reactive] public bool sniffingEnabled { get; set; } [Reactive] public bool sniffingEnabled { get; set; }
public IList<string> destOverride { get; set; } public IList<string> destOverride { get; set; }
@@ -125,6 +126,7 @@ namespace ServiceLib.ViewModels
var inbound = _config.Inbound.First(); var inbound = _config.Inbound.First();
localPort = inbound.LocalPort; localPort = inbound.LocalPort;
SecondLocalPortEnabled = inbound.SecondLocalPortEnabled;
udpEnabled = inbound.UdpEnabled; udpEnabled = inbound.UdpEnabled;
sniffingEnabled = inbound.SniffingEnabled; sniffingEnabled = inbound.SniffingEnabled;
routeOnly = inbound.RouteOnly; routeOnly = inbound.RouteOnly;
@@ -288,6 +290,7 @@ namespace ServiceLib.ViewModels
//Core //Core
_config.Inbound.First().LocalPort = localPort; _config.Inbound.First().LocalPort = localPort;
_config.Inbound.First().SecondLocalPortEnabled = SecondLocalPortEnabled;
_config.Inbound.First().UdpEnabled = udpEnabled; _config.Inbound.First().UdpEnabled = udpEnabled;
_config.Inbound.First().SniffingEnabled = sniffingEnabled; _config.Inbound.First().SniffingEnabled = sniffingEnabled;
_config.Inbound.First().DestOverride = destOverride?.ToList(); _config.Inbound.First().DestOverride = destOverride?.ToList();

View File

@@ -74,15 +74,16 @@ namespace ServiceLib.ViewModels
SelectedSource.Protocol = ProtocolItems?.ToList(); SelectedSource.Protocol = ProtocolItems?.ToList();
SelectedSource.InboundTag = InboundTagItems?.ToList(); SelectedSource.InboundTag = InboundTagItems?.ToList();
bool hasRule = SelectedSource.Domain?.Count > 0 var hasRule = SelectedSource.Domain?.Count > 0
|| SelectedSource.Ip?.Count > 0 || SelectedSource.Ip?.Count > 0
|| SelectedSource.Protocol?.Count > 0 || SelectedSource.Protocol?.Count > 0
|| SelectedSource.Process?.Count > 0 || SelectedSource.Process?.Count > 0
|| Utils.IsNotEmpty(SelectedSource.Port); || Utils.IsNotEmpty(SelectedSource.Port)
|| Utils.IsNotEmpty(SelectedSource.Network);
if (!hasRule) if (!hasRule)
{ {
NoticeHandler.Instance.Enqueue(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Port/Protocol/Domain/IP/Process")); NoticeHandler.Instance.Enqueue(string.Format(ResUI.RoutingRuleDetailRequiredTips, "Network/Port/Protocol/Domain/IP/Process"));
return; return;
} }
//NoticeHandler.Instance.Enqueue(ResUI.OperationSuccess); //NoticeHandler.Instance.Enqueue(ResUI.OperationSuccess);

View File

@@ -177,12 +177,12 @@ namespace ServiceLib.ViewModels
} }
var lst = new List<RulesItem>(); var lst = new List<RulesItem>();
foreach (var it in SelectedSources ?? [SelectedSource]) var sources = SelectedSources ?? [SelectedSource];
foreach (var it in _rules)
{ {
var item = _rules.FirstOrDefault(t => t.Id == it?.Id); if (sources.Any(t => t.Id == it?.Id))
if (item != null)
{ {
var item2 = JsonUtils.DeepCopy(item); //JsonUtils.Deserialize<RulesItem4Ray>(JsonUtils.Serialize(item)); var item2 = JsonUtils.DeepCopy(it);
item2.Id = null; item2.Id = null;
lst.Add(item2 ?? new()); lst.Add(item2 ?? new());
} }

View File

@@ -451,21 +451,20 @@ namespace ServiceLib.ViewModels
public async Task InboundDisplayStatus() public async Task InboundDisplayStatus()
{ {
StringBuilder sb = new(); StringBuilder sb = new();
sb.Append($"[{EInboundProtocol.mixed}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks)}]"); sb.Append($"[{EInboundProtocol.mixed}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks)}");
if (_config.Inbound.First().SecondLocalPortEnabled)
{
sb.Append($",{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks2)}");
}
sb.Append(']');
InboundDisplay = $"{ResUI.LabLocal}:{sb}"; InboundDisplay = $"{ResUI.LabLocal}:{sb}";
if (_config.Inbound.First().AllowLANConn) if (_config.Inbound.First().AllowLANConn)
{ {
if (_config.Inbound.First().NewPort4LAN) var lan = _config.Inbound.First().NewPort4LAN
{ ? $"[{EInboundProtocol.mixed}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks3)}]"
StringBuilder sb2 = new(); : $"[{EInboundProtocol.mixed}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks)}]";
sb2.Append($"[{EInboundProtocol.mixed}:{AppHandler.Instance.GetLocalPort(EInboundProtocol.socks2)}]"); InboundLanDisplay = $"{ResUI.LabLAN}:{lan}";
InboundLanDisplay = $"{ResUI.LabLAN}:{sb2}";
}
else
{
InboundLanDisplay = $"{ResUI.LabLAN}:{sb}";
}
} }
else else
{ {

View File

@@ -1,17 +0,0 @@
#!/bin/sh
echo 'Building'
OutputPath='./bin/v2rayN'
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-x64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o "${OutputPath}/osx-x64"
dotnet publish ./v2rayN.Desktop/v2rayN.Desktop.csproj -c Release -r osx-arm64 --self-contained true -p:PublishReadyToRun=false -p:PublishSingleFile=true -o "${OutputPath}/osx-arm64"
rm -rf "$OutputPath/osx-x64/*.pdb"
rm -rf "$OutputPath/osx-arm64/*.pdb"
echo 'Build done'
ls $OutputPath
7z a v2rayN-osx.zip $OutputPath
exit 0

View File

@@ -1,62 +0,0 @@
param (
[Parameter()]
[ValidateNotNullOrEmpty()]
[string]
$OutputPath = './bin/v2rayN'
)
Write-Host 'Building'
dotnet publish `
./v2rayN/v2rayN.csproj `
-c Release `
-r win-x64 `
--self-contained false `
-p:PublishReadyToRun=false `
-p:PublishSingleFile=true `
-o "$OutputPath/win-x64"
dotnet publish `
./v2rayN/v2rayN.csproj `
-c Release `
-r win-arm64 `
--self-contained false `
-p:PublishReadyToRun=false `
-p:PublishSingleFile=true `
-o "$OutputPath/win-arm64"
dotnet publish `
./v2rayN.Desktop/v2rayN.Desktop.csproj `
-c Release `
-r linux-x64 `
--self-contained true `
-p:PublishReadyToRun=false `
-p:PublishSingleFile=true `
-o "$OutputPath/linux-x64"
dotnet publish `
./v2rayN.Desktop/v2rayN.Desktop.csproj `
-c Release `
-r linux-arm64 `
--self-contained true `
-p:PublishReadyToRun=false `
-p:PublishSingleFile=true `
-o "$OutputPath/linux-arm64"
if ( -Not $? ) {
exit $lastExitCode
}
if ( Test-Path -Path ./bin/v2rayN ) {
rm -Force "$OutputPath/win-x64/*.pdb"
rm -Force "$OutputPath/win-arm64/*.pdb"
rm -Force "$OutputPath/linux-x64/*.pdb"
rm -Force "$OutputPath/linux-arm64/*.pdb"
}
Write-Host 'Build done'
ls $OutputPath
7z a v2rayN.zip $OutputPath
exit 0

View File

@@ -109,7 +109,8 @@ namespace v2rayN.Desktop.ViewModels
x.OfType<Menu>(), x.OfType<Menu>(),
x.OfType<ContextMenu>(), x.OfType<ContextMenu>(),
x.OfType<DataGridRow>(), x.OfType<DataGridRow>(),
x.OfType<ListBoxItem>() x.OfType<ListBoxItem>(),
x.OfType<HeaderedContentControl>()
)); ));
style.Add(new Setter() style.Add(new Setter()
{ {
@@ -137,6 +138,7 @@ namespace v2rayN.Desktop.ViewModels
x.OfType<ContextMenu>(), x.OfType<ContextMenu>(),
x.OfType<DataGridRow>(), x.OfType<DataGridRow>(),
x.OfType<ListBoxItem>(), x.OfType<ListBoxItem>(),
x.OfType<HeaderedContentControl>(),
x.OfType<WindowNotificationManager>() x.OfType<WindowNotificationManager>()
)); ));
style.Add(new Setter() style.Add(new Setter()

View File

@@ -34,147 +34,126 @@
IsCancel="True" /> IsCancel="True" />
</StackPanel> </StackPanel>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid> <Grid ColumnDefinitions="Auto,Auto,Auto" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.menuServers}" /> Text="{x:Static resx:ResUI.menuServers}" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbRemarks}" /> Text="{x:Static resx:ResUI.TbRemarks}" />
<TextBox <TextBox
x:Name="txtRemarks" x:Name="txtRemarks"
Grid.Row="1" Grid.Row="1"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbAddress}" /> Text="{x:Static resx:ResUI.TbAddress}" />
<TextBox <TextBox
x:Name="txtAddress" x:Name="txtAddress"
Grid.Row="2" Grid.Row="2"
Grid.Column="1" Grid.Column="1"
Width="400" Width="400"
HorizontalAlignment="Left" HorizontalAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
IsReadOnly="True" /> IsReadOnly="True" />
<StackPanel <StackPanel
Grid.Row="2" Grid.Row="2"
Grid.Column="2" Grid.Column="2"
VerticalAlignment="Center" VerticalAlignment="Center"
Orientation="Horizontal"> Orientation="Horizontal">
<Button <Button
x:Name="btnBrowse" x:Name="btnBrowse"
Margin="2,0" Margin="2,0"
Content="{x:Static resx:ResUI.TbBrowse}" /> Content="{x:Static resx:ResUI.TbBrowse}" />
<Button <Button
x:Name="btnEdit" x:Name="btnEdit"
Margin="2,0" Margin="2,0"
Content="{x:Static resx:ResUI.TbEdit}" /> Content="{x:Static resx:ResUI.TbEdit}" />
</StackPanel> </StackPanel>
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbCoreType}" /> Text="{x:Static resx:ResUI.TbCoreType}" />
<ComboBox <ComboBox
x:Name="cmbCoreType" x:Name="cmbCoreType"
Grid.Row="3" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" Classes="Margin8"
MaxDropDownHeight="1000" /> MaxDropDownHeight="1000" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbDisplayLog}" /> Text="{x:Static resx:ResUI.TbDisplayLog}" />
<StackPanel <StackPanel
Grid.Row="4" Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Classes="Margin8" Classes="Margin8"
Orientation="Horizontal"> Orientation="Horizontal">
<ToggleSwitch <ToggleSwitch
x:Name="togDisplayLog" x:Name="togDisplayLog"
HorizontalAlignment="Left"
Classes="Margin8" />
<TextBlock
Margin="8,0"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.TipDisplayLog}" />
</StackPanel>
<TextBlock
Grid.Row="5"
Grid.Column="0"
VerticalAlignment="Center"
Classes="Margin8"
Text="{x:Static resx:ResUI.TbPreSocksPort}" />
<TextBox
x:Name="txtPreSocksPort"
Grid.Row="5"
Grid.Column="1"
Width="200"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<StackPanel <TextBlock
Grid.Row="6" Margin="8,0"
Grid.Column="1" VerticalAlignment="Center"
Grid.ColumnSpan="2" Text="{x:Static resx:ResUI.TipDisplayLog}" />
Classes="Margin8"> </StackPanel>
<TextBlock
Width="500" <TextBlock
VerticalAlignment="Center" Grid.Row="5"
Text="{x:Static resx:ResUI.TipPreSocksPort}" Grid.Column="0"
TextWrapping="Wrap" /> VerticalAlignment="Center"
<TextBlock Classes="Margin8"
Width="500" Text="{x:Static resx:ResUI.TbPreSocksPort}" />
Margin="8,0" <TextBox
VerticalAlignment="Center" x:Name="txtPreSocksPort"
Text="{x:Static resx:ResUI.CustomServerTips}" Grid.Row="5"
TextWrapping="Wrap" /> Grid.Column="1"
</StackPanel> Width="200"
</Grid> HorizontalAlignment="Left"
Classes="Margin8" />
<StackPanel
Grid.Row="6"
Grid.Column="1"
Grid.ColumnSpan="2"
Classes="Margin8">
<TextBlock
Width="500"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.TipPreSocksPort}"
TextWrapping="Wrap" />
<TextBlock
Width="500"
Margin="8,0"
VerticalAlignment="Center"
Text="{x:Static resx:ResUI.CustomServerTips}"
TextWrapping="Wrap" />
</StackPanel>
</Grid> </Grid>
</ScrollViewer> </ScrollViewer>
</DockPanel> </DockPanel>

View File

@@ -34,31 +34,12 @@
IsCancel="True" /> IsCancel="True" />
</StackPanel> </StackPanel>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid> <Grid RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid Grid.Row="0"> <Grid
<Grid.RowDefinitions> Grid.Row="0"
<RowDefinition Height="Auto" /> ColumnDefinitions="180,Auto,Auto"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
@@ -122,18 +103,9 @@
<Grid <Grid
x:Name="gridVMess" x:Name="gridVMess"
Grid.Row="2" Grid.Row="2"
IsVisible="False"> ColumnDefinitions="180,Auto,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -184,17 +156,9 @@
<Grid <Grid
x:Name="gridSs" x:Name="gridSs"
Grid.Row="2" Grid.Row="2"
IsVisible="False"> ColumnDefinitions="180,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -225,17 +189,9 @@
<Grid <Grid
x:Name="gridSocks" x:Name="gridSocks"
Grid.Row="2" Grid.Row="2"
IsVisible="False"> ColumnDefinitions="180,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -266,18 +222,9 @@
<Grid <Grid
x:Name="gridVLESS" x:Name="gridVLESS"
Grid.Row="2" Grid.Row="2"
IsVisible="False"> ColumnDefinitions="180,Auto,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -328,17 +275,9 @@
<Grid <Grid
x:Name="gridTrojan" x:Name="gridTrojan"
Grid.Row="2" Grid.Row="2"
IsVisible="False"> ColumnDefinitions="180,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -369,17 +308,9 @@
<Grid <Grid
x:Name="gridHysteria2" x:Name="gridHysteria2"
Grid.Row="2" Grid.Row="2"
IsVisible="False"> ColumnDefinitions="180,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -410,17 +341,9 @@
<Grid <Grid
x:Name="gridTuic" x:Name="gridTuic"
Grid.Row="2" Grid.Row="2"
IsVisible="False"> ColumnDefinitions="180,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -464,19 +387,9 @@
<Grid <Grid
x:Name="gridWireguard" x:Name="gridWireguard"
Grid.Row="2" Grid.Row="2"
IsVisible="False"> ColumnDefinitions="180,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -551,22 +464,11 @@
Grid.Row="3" Grid.Row="3"
Margin="0,10" /> Margin="0,10" />
<Grid x:Name="gridTransport" Grid.Row="4"> <Grid
<Grid.RowDefinitions> x:Name="gridTransport"
<RowDefinition Height="Auto" /> Grid.Row="4"
<RowDefinition Height="Auto" /> ColumnDefinitions="180,Auto,Auto"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
@@ -695,18 +597,11 @@
<Separator Grid.Row="5" Margin="0,10" /> <Separator Grid.Row="5" Margin="0,10" />
<Grid x:Name="gridTls" Grid.Row="6"> <Grid
<Grid.RowDefinitions> x:Name="gridTls"
<RowDefinition Height="Auto" /> Grid.Row="6"
<RowDefinition Height="Auto" /> ColumnDefinitions="180,Auto"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
@@ -724,18 +619,9 @@
<Grid <Grid
x:Name="gridTlsMore" x:Name="gridTlsMore"
Grid.Row="7" Grid.Row="7"
IsVisible="False"> ColumnDefinitions="180,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
@@ -793,18 +679,9 @@
<Grid <Grid
x:Name="gridRealityMore" x:Name="gridRealityMore"
Grid.Row="7" Grid.Row="7"
IsVisible="False"> ColumnDefinitions="180,Auto"
<Grid.RowDefinitions> IsVisible="False"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"

View File

@@ -25,17 +25,10 @@
VerticalAlignment="Center" VerticalAlignment="Center"
Theme="{StaticResource CardBorder}"> Theme="{StaticResource CardBorder}">
<Grid Classes="Margin8"> <Grid
<Grid.RowDefinitions> Classes="Margin8"
<RowDefinition Height="Auto" /> ColumnDefinitions="300,200"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
@@ -77,18 +70,10 @@
Margin="4" Margin="4"
VerticalAlignment="Center" VerticalAlignment="Center"
Theme="{StaticResource CardBorder}"> Theme="{StaticResource CardBorder}">
<Grid Classes="Margin8"> <Grid
<Grid.RowDefinitions> Classes="Margin8"
<RowDefinition Height="Auto" /> ColumnDefinitions="300,200"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="200" />
</Grid.ColumnDefinitions>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
@@ -111,18 +96,7 @@
<Button.Flyout> <Button.Flyout>
<Flyout> <Flyout>
<StackPanel> <StackPanel>
<Grid> <Grid ColumnDefinitions="Auto,300" RowDefinitions="Auto,Auto,Auto,Auto,Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="300" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"

View File

@@ -53,15 +53,7 @@
Margin="-8" Margin="-8"
VerticalAlignment="Center" VerticalAlignment="Center"
Theme="{StaticResource CardBorder}"> Theme="{StaticResource CardBorder}">
<Grid> <Grid ColumnDefinitions="1*,1*,3*" RowDefinitions="Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="3*" />
</Grid.ColumnDefinitions>
<ToggleSwitch <ToggleSwitch
x:Name="togAutoRefresh" x:Name="togAutoRefresh"
Grid.Column="0" Grid.Column="0"

View File

@@ -109,12 +109,7 @@
Padding="0" Padding="0"
Theme="{StaticResource CardBorder}"> Theme="{StaticResource CardBorder}">
<DockPanel> <DockPanel>
<Grid Grid.Column="0" Classes="Margin8"> <Grid Classes="Margin8" RowDefinitions="1*,8,1*">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="8" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<DockPanel Grid.Row="0"> <DockPanel Grid.Row="0">
<TextBlock DockPanel.Dock="Right" Text="{Binding Type}" /> <TextBlock DockPanel.Dock="Right" Text="{Binding Type}" />
<TextBlock Text="{Binding Name}" /> <TextBlock Text="{Binding Name}" />
@@ -154,12 +149,7 @@
CornerRadius="4" CornerRadius="4"
DockPanel.Dock="Left" DockPanel.Dock="Left"
IsVisible="{Binding IsActive}" /> IsVisible="{Binding IsActive}" />
<Grid Classes="Margin8"> <Grid Classes="Margin8" RowDefinitions="1*,8,1*">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />
<RowDefinition Height="8" />
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{Binding Name}" /> <TextBlock Grid.Row="0" Text="{Binding Name}" />
<DockPanel Grid.Row="2"> <DockPanel Grid.Row="2">
<TextBlock <TextBlock

View File

@@ -141,12 +141,7 @@
</StackPanel> </StackPanel>
</WrapPanel> </WrapPanel>
<Grid Classes="Margin8"> <Grid Classes="Margin8" ColumnDefinitions="*,10,*">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBox <TextBox
x:Name="txtnormalDNS2" x:Name="txtnormalDNS2"

View File

@@ -39,25 +39,12 @@
IsCancel="True" /> IsCancel="True" />
</StackPanel> </StackPanel>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid> <Grid RowDefinitions="Auto,Auto,Auto">
<Grid.RowDefinitions> <Grid
<RowDefinition Height="Auto" /> x:Name="gridText"
<RowDefinition Height="Auto" /> Grid.Row="0"
<RowDefinition Height="Auto" /> ColumnDefinitions="Auto,400"
</Grid.RowDefinitions> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto">
<Grid x:Name="gridText" Grid.Row="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="400" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"

View File

@@ -80,6 +80,7 @@
<MenuItem Header="{x:Static resx:ResUI.menuRegionalPresets}"> <MenuItem Header="{x:Static resx:ResUI.menuRegionalPresets}">
<MenuItem x:Name="menuRegionalPresetsDefault" Header="{x:Static resx:ResUI.menuRegionalPresetsDefault}" /> <MenuItem x:Name="menuRegionalPresetsDefault" Header="{x:Static resx:ResUI.menuRegionalPresetsDefault}" />
<MenuItem x:Name="menuRegionalPresetsRussia" Header="{x:Static resx:ResUI.menuRegionalPresetsRussia}" /> <MenuItem x:Name="menuRegionalPresetsRussia" Header="{x:Static resx:ResUI.menuRegionalPresetsRussia}" />
<MenuItem x:Name="menuRegionalPresetsIran" Header="{x:Static resx:ResUI.menuRegionalPresetsIran}" />
</MenuItem> </MenuItem>
<MenuItem x:Name="menuBackupAndRestore" Header="{x:Static resx:ResUI.menuBackupAndRestore}" /> <MenuItem x:Name="menuBackupAndRestore" Header="{x:Static resx:ResUI.menuBackupAndRestore}" />
<MenuItem x:Name="menuOpenTheFileLocation" Header="{x:Static resx:ResUI.menuOpenTheFileLocation}" /> <MenuItem x:Name="menuOpenTheFileLocation" Header="{x:Static resx:ResUI.menuOpenTheFileLocation}" />
@@ -124,12 +125,10 @@
<view:StatusBarView DockPanel.Dock="Bottom" /> <view:StatusBarView DockPanel.Dock="Bottom" />
<Grid> <Grid>
<Grid x:Name="gridMain" IsVisible="False"> <Grid
<Grid.ColumnDefinitions> x:Name="gridMain"
<ColumnDefinition Width="1*" /> ColumnDefinitions="1*,10,1*"
<ColumnDefinition Width="10" /> IsVisible="False">
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<ContentControl x:Name="tabProfiles" Grid.Column="0" /> <ContentControl x:Name="tabProfiles" Grid.Column="0" />
<GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" /> <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" />
<TabControl <TabControl
@@ -141,12 +140,10 @@
<TabItem x:Name="tabClashConnections" Header="{x:Static resx:ResUI.TbConnections}" /> <TabItem x:Name="tabClashConnections" Header="{x:Static resx:ResUI.TbConnections}" />
</TabControl> </TabControl>
</Grid> </Grid>
<Grid x:Name="gridMain1" IsVisible="False"> <Grid
<Grid.RowDefinitions> x:Name="gridMain1"
<RowDefinition Height="1*" /> IsVisible="False"
<RowDefinition Height="10" /> RowDefinitions="1*,10,1*">
<RowDefinition Height="1*" />
</Grid.RowDefinitions>
<ContentControl x:Name="tabProfiles1" Grid.Row="0" /> <ContentControl x:Name="tabProfiles1" Grid.Row="0" />
<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" /> <GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" />
<TabControl <TabControl

View File

@@ -104,6 +104,7 @@ namespace v2rayN.Desktop.Views
this.BindCommand(ViewModel, vm => vm.OpenTheFileLocationCmd, v => v.menuOpenTheFileLocation).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.OpenTheFileLocationCmd, v => v.menuOpenTheFileLocation).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.RegionalPresetDefaultCmd, v => v.menuRegionalPresetsDefault).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.RegionalPresetDefaultCmd, v => v.menuRegionalPresetsDefault).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.RegionalPresetRussiaCmd, v => v.menuRegionalPresetsRussia).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.RegionalPresetRussiaCmd, v => v.menuRegionalPresetsRussia).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.RegionalPresetIranCmd, v => v.menuRegionalPresetsIran).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
@@ -133,7 +134,7 @@ namespace v2rayN.Desktop.Views
} }
}); });
this.Title = $"{Utils.GetVersion()} - {(AppHandler.Instance.IsAdministrator ? ResUI.RunAsAdmin : ResUI.NotRunAsAdmin)}"; this.Title = $"{Utils.GetVersion()}";
if (Utils.IsWindows()) if (Utils.IsWindows())
{ {
ThreadPool.RegisterWaitForSingleObject(Program.ProgramStarted, OnProgramStarted, null, -1, false); ThreadPool.RegisterWaitForSingleObject(Program.ProgramStarted, OnProgramStarted, null, -1, false);
@@ -304,7 +305,7 @@ namespace v2rayN.Desktop.Views
private async void MainWindow_KeyDown(object? sender, KeyEventArgs e) private async void MainWindow_KeyDown(object? sender, KeyEventArgs e)
{ {
if (e.KeyModifiers == KeyModifiers.Control) if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta)
{ {
switch (e.Key) switch (e.Key)
{ {

View File

@@ -37,33 +37,10 @@
<TabControl HorizontalContentAlignment="Stretch"> <TabControl HorizontalContentAlignment="Stretch">
<TabItem Header="{x:Static resx:ResUI.TbSettingsCore}"> <TabItem Header="{x:Static resx:ResUI.TbSettingsCore}">
<ScrollViewer VerticalScrollBarVisibility="Visible"> <ScrollViewer VerticalScrollBarVisibility="Visible">
<Grid Classes="Margin8"> <Grid
<Grid.RowDefinitions> Classes="Margin8"
<RowDefinition Height="Auto" /> ColumnDefinitions="Auto,Auto,Auto"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
@@ -86,225 +63,244 @@
TextWrapping="Wrap" /> TextWrapping="Wrap" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="2"
Grid.Column="0"
VerticalAlignment="Center"
Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsSecondLocalPortEnabled}" />
<ToggleSwitch
x:Name="togSecondLocalPortEnabled"
Grid.Row="2"
Grid.Column="1"
HorizontalAlignment="Left"
Classes="Margin8" />
<TextBlock
Grid.Row="3"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsUdpEnabled}" /> Text="{x:Static resx:ResUI.TbSettingsUdpEnabled}" />
<ToggleSwitch <ToggleSwitch
x:Name="togudpEnabled" x:Name="togudpEnabled"
Grid.Row="1" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsSniffingEnabled}" /> Text="{x:Static resx:ResUI.TbSettingsSniffingEnabled}" />
<StackPanel <ToggleSwitch
Grid.Row="2" x:Name="togsniffingEnabled"
Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Grid.ColumnSpan="2" HorizontalAlignment="Left"
Orientation="Horizontal"> Classes="Margin8" />
<ToggleSwitch
x:Name="togsniffingEnabled"
HorizontalAlignment="Left"
Classes="Margin8" />
<ListBox
x:Name="clbdestOverride"
HorizontalAlignment="Left"
Classes="Margin8"
SelectionMode="Multiple"
Theme="{DynamicResource PureCardRadioGroupListBox}" />
</StackPanel>
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="5"
Grid.Column="0"
VerticalAlignment="Center"
Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsDestOverride}" />
<ListBox
x:Name="clbdestOverride"
Grid.Row="5"
Grid.Column="1"
Grid.ColumnSpan="2"
HorizontalAlignment="Left"
Classes="Margin8"
SelectionMode="Multiple"
Theme="{DynamicResource PureCardRadioGroupListBox}" />
<TextBlock
Grid.Row="6"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsRouteOnly}" /> Text="{x:Static resx:ResUI.TbSettingsRouteOnly}" />
<ToggleSwitch <ToggleSwitch
x:Name="togrouteOnly" x:Name="togrouteOnly"
Grid.Row="3" Grid.Row="6"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="7"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsAllowLAN}" /> Text="{x:Static resx:ResUI.TbSettingsAllowLAN}" />
<ToggleSwitch <ToggleSwitch
x:Name="togAllowLANConn" x:Name="togAllowLANConn"
Grid.Row="4" Grid.Row="7"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="8"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsNewPort4LAN}" /> Text="{x:Static resx:ResUI.TbSettingsNewPort4LAN}" />
<ToggleSwitch <ToggleSwitch
x:Name="togNewPort4LAN" x:Name="togNewPort4LAN"
Grid.Row="5" Grid.Row="8"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="6" Grid.Row="9"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsUser}" /> Text="{x:Static resx:ResUI.TbSettingsUser}" />
<TextBox <TextBox
x:Name="txtuser" x:Name="txtuser"
Grid.Row="6" Grid.Row="9"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="7" Grid.Row="10"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsPass}" /> Text="{x:Static resx:ResUI.TbSettingsPass}" />
<TextBox <TextBox
x:Name="txtpass" x:Name="txtpass"
Grid.Row="7" Grid.Row="10"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="8" Grid.Row="11"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsMuxEnabled}" /> Text="{x:Static resx:ResUI.TbSettingsMuxEnabled}" />
<ToggleSwitch <ToggleSwitch
x:Name="togmuxEnabled" x:Name="togmuxEnabled"
Grid.Row="8" Grid.Row="11"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="9" Grid.Row="12"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsLogEnabledToFile}" /> Text="{x:Static resx:ResUI.TbSettingsLogEnabledToFile}" />
<ToggleSwitch <ToggleSwitch
x:Name="toglogEnabled" x:Name="toglogEnabled"
Grid.Row="9" Grid.Row="12"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="10" Grid.Row="13"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsLogLevel}" /> Text="{x:Static resx:ResUI.TbSettingsLogLevel}" />
<ComboBox <ComboBox
x:Name="cmbloglevel" x:Name="cmbloglevel"
Grid.Row="10" Grid.Row="13"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Classes="Margin8" Classes="Margin8"
ToolTip.Tip="Level" /> ToolTip.Tip="Level" />
<TextBlock <TextBlock
Grid.Row="11" Grid.Row="14"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsDefAllowInsecure}" /> Text="{x:Static resx:ResUI.TbSettingsDefAllowInsecure}" />
<ToggleSwitch <ToggleSwitch
x:Name="togdefAllowInsecure" x:Name="togdefAllowInsecure"
Grid.Row="11" Grid.Row="14"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="12" Grid.Row="15"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsDefFingerprint}" /> Text="{x:Static resx:ResUI.TbSettingsDefFingerprint}" />
<ComboBox <ComboBox
x:Name="cmbdefFingerprint" x:Name="cmbdefFingerprint"
Grid.Row="12" Grid.Row="15"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="13" Grid.Row="16"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsDefUserAgent}" /> Text="{x:Static resx:ResUI.TbSettingsDefUserAgent}" />
<ComboBox <ComboBox
x:Name="cmbdefUserAgent" x:Name="cmbdefUserAgent"
Grid.Row="13" Grid.Row="16"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="13" Grid.Row="16"
Grid.Column="3" Grid.Column="3"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsDefUserAgentTips}" /> Text="{x:Static resx:ResUI.TbSettingsDefUserAgentTips}" />
<TextBlock <TextBlock
Grid.Row="14" Grid.Row="17"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsMux4SboxProtocol}" /> Text="{x:Static resx:ResUI.TbSettingsMux4SboxProtocol}" />
<ComboBox <ComboBox
x:Name="cmbmux4SboxProtocol" x:Name="cmbmux4SboxProtocol"
Grid.Row="14" Grid.Row="17"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="15" Grid.Row="18"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsEnableCacheFile4Sbox}" /> Text="{x:Static resx:ResUI.TbSettingsEnableCacheFile4Sbox}" />
<ToggleSwitch <ToggleSwitch
x:Name="togenableCacheFile4Sbox" x:Name="togenableCacheFile4Sbox"
Grid.Row="15" Grid.Row="18"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="16" Grid.Row="19"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsHysteriaBandwidth}" /> Text="{x:Static resx:ResUI.TbSettingsHysteriaBandwidth}" />
<StackPanel <StackPanel
Grid.Row="16" Grid.Row="19"
Grid.Column="1" Grid.Column="1"
Orientation="Horizontal"> Orientation="Horizontal">
@@ -321,19 +317,19 @@
</StackPanel> </StackPanel>
<TextBlock <TextBlock
Grid.Row="17" Grid.Row="20"
Grid.Column="0" Grid.Column="0"
VerticalAlignment="Center" VerticalAlignment="Center"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsEnableFragment}" /> Text="{x:Static resx:ResUI.TbSettingsEnableFragment}" />
<ToggleSwitch <ToggleSwitch
x:Name="togenableFragment" x:Name="togenableFragment"
Grid.Row="17" Grid.Row="20"
Grid.Column="1" Grid.Column="1"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="17" Grid.Row="20"
Grid.Column="2" Grid.Column="2"
Classes="Margin8" Classes="Margin8"
Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}" Text="{x:Static resx:ResUI.TbSettingsEnableFragmentTips}"
@@ -344,39 +340,11 @@
<TabItem Header="{x:Static resx:ResUI.TbSettingsN}"> <TabItem Header="{x:Static resx:ResUI.TbSettingsN}">
<ScrollViewer VerticalScrollBarVisibility="Visible"> <ScrollViewer VerticalScrollBarVisibility="Visible">
<Grid Grid.Row="2" Classes="Margin8"> <Grid
<Grid.RowDefinitions> Grid.Row="2"
<RowDefinition Height="Auto" /> Classes="Margin8"
<RowDefinition Height="Auto" /> ColumnDefinitions="Auto,Auto,*"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
x:Name="tbAutoRun" x:Name="tbAutoRun"
@@ -503,7 +471,6 @@
HorizontalAlignment="Left" HorizontalAlignment="Left"
Classes="Margin8" /> Classes="Margin8" />
<TextBlock <TextBlock
Grid.Row="11" Grid.Row="11"
Grid.Column="0" Grid.Column="0"
@@ -748,22 +715,11 @@
<TabItem Header="{x:Static resx:ResUI.TbSettingsTunMode}"> <TabItem Header="{x:Static resx:ResUI.TbSettingsTunMode}">
<DockPanel Classes="Margin8"> <DockPanel Classes="Margin8">
<Grid Classes="Margin8" DockPanel.Dock="Top"> <Grid
<Grid.RowDefinitions> Classes="Margin8"
<RowDefinition Height="Auto" /> ColumnDefinitions="Auto,Auto,Auto"
<RowDefinition Height="Auto" /> DockPanel.Dock="Top"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="2"
@@ -857,20 +813,10 @@
</TabItem> </TabItem>
<TabItem Header="{x:Static resx:ResUI.TbSettingsCoreType}"> <TabItem Header="{x:Static resx:ResUI.TbSettingsCoreType}">
<Grid Classes="Margin8"> <Grid
<Grid.RowDefinitions> Classes="Margin8"
<RowDefinition Height="Auto" /> ColumnDefinitions="Auto,Auto"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"

View File

@@ -102,6 +102,7 @@ namespace v2rayN.Desktop.Views
this.WhenActivated(disposables => this.WhenActivated(disposables =>
{ {
this.Bind(ViewModel, vm => vm.localPort, v => v.txtlocalPort.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.localPort, v => v.txtlocalPort.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SecondLocalPortEnabled, v => v.togSecondLocalPortEnabled.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.udpEnabled, v => v.togudpEnabled.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.udpEnabled, v => v.togudpEnabled.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.sniffingEnabled, v => v.togsniffingEnabled.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.sniffingEnabled, v => v.togsniffingEnabled.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.routeOnly, v => v.togrouteOnly.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.routeOnly, v => v.togrouteOnly.IsChecked).DisposeWith(disposables);

View File

@@ -187,12 +187,7 @@ namespace v2rayN.Desktop.Views
private void lstProfiles_SelectionChanged(object? sender, SelectionChangedEventArgs e) private void lstProfiles_SelectionChanged(object? sender, SelectionChangedEventArgs e)
{ {
List<ProfileItemModel> lst = []; ViewModel.SelectedProfiles = lstProfiles.SelectedItems.Cast<ProfileItemModel>().ToList();
foreach (var item in lstProfiles.SelectedItems)
{
lst.Add((ProfileItemModel)item);
}
ViewModel.SelectedProfiles = lst;
} }
private void LstProfiles_DoubleTapped(object? sender, Avalonia.Input.TappedEventArgs e) private void LstProfiles_DoubleTapped(object? sender, Avalonia.Input.TappedEventArgs e)
@@ -233,7 +228,7 @@ namespace v2rayN.Desktop.Views
private void LstProfiles_KeyDown(object? sender, KeyEventArgs e) private void LstProfiles_KeyDown(object? sender, KeyEventArgs e)
{ {
if (e.KeyModifiers == KeyModifiers.Control) if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta)
{ {
switch (e.Key) switch (e.Key)
{ {

View File

@@ -8,11 +8,7 @@
d:DesignHeight="480" d:DesignHeight="480"
d:DesignWidth="400" d:DesignWidth="400"
mc:Ignorable="d"> mc:Ignorable="d">
<Grid Margin="30"> <Grid Margin="30" RowDefinitions="Auto,Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Image <Image
Name="imgQrcode" Name="imgQrcode"

View File

@@ -14,20 +14,11 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
mc:Ignorable="d"> mc:Ignorable="d">
<DockPanel> <DockPanel>
<Grid Classes="Margin8" DockPanel.Dock="Top"> <Grid
<Grid.RowDefinitions> Classes="Margin8"
<RowDefinition Height="Auto" /> ColumnDefinitions="Auto,Auto,Auto"
<RowDefinition Height="Auto" /> DockPanel.Dock="Top"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"
@@ -119,6 +110,13 @@
Classes="Margin8" Classes="Margin8"
SelectionMode="Multiple" SelectionMode="Multiple"
Theme="{DynamicResource PureCardRadioGroupListBox}" /> Theme="{DynamicResource PureCardRadioGroupListBox}" />
<TextBlock
Grid.Row="4"
Grid.Column="2"
HorizontalAlignment="Left"
Classes="Margin8"
Text="{x:Static resx:ResUI.TbRoutingInboundTagTips}" />
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="5"
@@ -169,14 +167,7 @@
IsCancel="True" /> IsCancel="True" />
</StackPanel> </StackPanel>
<Grid Classes="Margin8"> <Grid Classes="Margin8" ColumnDefinitions="1*,10,1*,10,1*">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="10" />
<ColumnDefinition Width="1*" />
</Grid.ColumnDefinitions>
<HeaderedContentControl <HeaderedContentControl
Grid.Column="0" Grid.Column="0"
BorderBrush="Gray" BorderBrush="Gray"

View File

@@ -46,20 +46,11 @@
IsCancel="True" /> IsCancel="True" />
</StackPanel> </StackPanel>
<Grid Classes="Margin8" DockPanel.Dock="Top"> <Grid
<Grid.RowDefinitions> Classes="Margin8"
<RowDefinition Height="Auto" /> ColumnDefinitions="Auto,Auto,Auto"
<RowDefinition Height="Auto" /> DockPanel.Dock="Top"
<RowDefinition Height="Auto" /> RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto">
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"
Grid.Column="0" Grid.Column="0"

View File

@@ -128,7 +128,7 @@ namespace v2rayN.Desktop.Views
private void RoutingRuleSettingWindow_KeyDown(object? sender, KeyEventArgs e) private void RoutingRuleSettingWindow_KeyDown(object? sender, KeyEventArgs e)
{ {
if (e.KeyModifiers == KeyModifiers.Control) if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta)
{ {
if (e.Key == Key.A) if (e.Key == Key.A)
{ {
@@ -166,12 +166,7 @@ namespace v2rayN.Desktop.Views
private void lstRules_SelectionChanged(object? sender, SelectionChangedEventArgs e) private void lstRules_SelectionChanged(object? sender, SelectionChangedEventArgs e)
{ {
List<RulesItemModel> lst = []; ViewModel.SelectedSources = lstRules.SelectedItems.Cast<RulesItemModel>().ToList();
foreach (var item in lstRules.SelectedItems)
{
lst.Add((RulesItemModel)item);
}
ViewModel.SelectedSources = lst;
} }
private void LstRules_DoubleTapped(object? sender, Avalonia.Input.TappedEventArgs e) private void LstRules_DoubleTapped(object? sender, Avalonia.Input.TappedEventArgs e)

View File

@@ -83,7 +83,7 @@ namespace v2rayN.Desktop.Views
private void RoutingSettingWindow_KeyDown(object? sender, KeyEventArgs e) private void RoutingSettingWindow_KeyDown(object? sender, KeyEventArgs e)
{ {
if (e.KeyModifiers == KeyModifiers.Control) if (e.KeyModifiers is KeyModifiers.Control or KeyModifiers.Meta)
{ {
if (e.Key == Key.A) if (e.Key == Key.A)
{ {
@@ -107,12 +107,7 @@ namespace v2rayN.Desktop.Views
private void lstRoutings_SelectionChanged(object? sender, SelectionChangedEventArgs e) private void lstRoutings_SelectionChanged(object? sender, SelectionChangedEventArgs e)
{ {
List<RoutingItemModel> lst = []; ViewModel.SelectedSources = lstRoutings.SelectedItems.Cast<RoutingItemModel>().ToList();
foreach (var item in lstRoutings.SelectedItems)
{
lst.Add((RoutingItemModel)item);
}
ViewModel.SelectedSources = lst;
} }
private void LstRoutings_DoubleTapped(object? sender, TappedEventArgs e) private void LstRoutings_DoubleTapped(object? sender, TappedEventArgs e)

View File

@@ -34,29 +34,7 @@
</StackPanel> </StackPanel>
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<Grid> <Grid ColumnDefinitions="Auto,400,Auto" RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="400" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock <TextBlock
Grid.Row="0" Grid.Row="0"

View File

@@ -82,12 +82,7 @@ namespace v2rayN.Desktop.Views
private void LstSubscription_SelectionChanged(object? sender, SelectionChangedEventArgs e) private void LstSubscription_SelectionChanged(object? sender, SelectionChangedEventArgs e)
{ {
List<SubItem> lst = []; ViewModel.SelectedSources = lstSubscription.SelectedItems.Cast<SubItem>().ToList();
foreach (var item in lstSubscription.SelectedItems)
{
lst.Add((SubItem)item);
}
ViewModel.SelectedSources = lst;
} }
private void menuClose_Click(object? sender, RoutedEventArgs e) private void menuClose_Click(object? sender, RoutedEventArgs e)

View File

@@ -20,12 +20,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.2.2" /> <PackageReference Include="Avalonia" Version="11.2.3" />
<PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.2" /> <PackageReference Include="Avalonia.Controls.DataGrid" Version="11.2.3" />
<PackageReference Include="Avalonia.Desktop" Version="11.2.2" /> <PackageReference Include="Avalonia.Desktop" Version="11.2.3" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.2" /> <PackageReference Include="Avalonia.Fonts.Inter" Version="11.2.3" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.2" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.2.3" />
<PackageReference Include="Avalonia.ReactiveUI" Version="11.2.2" /> <PackageReference Include="Avalonia.ReactiveUI" Version="11.2.3" />
<PackageReference Include="DialogHost.Avalonia" Version="0.8.1" /> <PackageReference Include="DialogHost.Avalonia" Version="0.8.1" />
<PackageReference Include="MessageBox.Avalonia" Version="3.2.0" /> <PackageReference Include="MessageBox.Avalonia" Version="3.2.0" />
<PackageReference Include="Semi.Avalonia" Version="11.2.1.2" /> <PackageReference Include="Semi.Avalonia" Version="11.2.1.2" />
@@ -42,6 +42,12 @@
<EmbeddedResource Include="Assets\v2rayN.ico"> <EmbeddedResource Include="Assets\v2rayN.ico">
<CopyToOutputDirectory>Never</CopyToOutputDirectory> <CopyToOutputDirectory>Never</CopyToOutputDirectory>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup>
<ItemGroup>
<None Update="v2rayN.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
</Project> </Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@@ -194,6 +194,10 @@
x:Name="menuRegionalPresetsRussia" x:Name="menuRegionalPresetsRussia"
Height="{StaticResource MenuItemHeight}" Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuRegionalPresetsRussia}" /> Header="{x:Static resx:ResUI.menuRegionalPresetsRussia}" />
<MenuItem
x:Name="menuRegionalPresetsIran"
Height="{StaticResource MenuItemHeight}"
Header="{x:Static resx:ResUI.menuRegionalPresetsIran}" />
</MenuItem> </MenuItem>
<MenuItem <MenuItem
x:Name="menuBackupAndRestore" x:Name="menuBackupAndRestore"

View File

@@ -102,6 +102,7 @@ namespace v2rayN.Views
this.BindCommand(ViewModel, vm => vm.OpenTheFileLocationCmd, v => v.menuOpenTheFileLocation).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.OpenTheFileLocationCmd, v => v.menuOpenTheFileLocation).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.RegionalPresetDefaultCmd, v => v.menuRegionalPresetsDefault).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.RegionalPresetDefaultCmd, v => v.menuRegionalPresetsDefault).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.RegionalPresetRussiaCmd, v => v.menuRegionalPresetsRussia).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.RegionalPresetRussiaCmd, v => v.menuRegionalPresetsRussia).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.RegionalPresetIranCmd, v => v.menuRegionalPresetsIran).DisposeWith(disposables);
this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables); this.BindCommand(ViewModel, vm => vm.ReloadCmd, v => v.menuReload).DisposeWith(disposables);
this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables); this.OneWayBind(ViewModel, vm => vm.BlReloadEnabled, v => v.menuReload.IsEnabled).DisposeWith(disposables);
@@ -278,6 +279,13 @@ namespace v2rayN.Views
{ {
switch (e.Key) switch (e.Key)
{ {
case Key.V:
if (Keyboard.FocusedElement is TextBox) return;
var clipboardData = WindowsUtils.GetClipboardData();
var service = Locator.Current.GetService<MainWindowViewModel>();
if (service != null) _ = service.AddServerViaClipboardAsync(clipboardData);
break;
case Key.S: case Key.S:
ScanScreenTaskAsync().ContinueWith(_ => { }); ScanScreenTaskAsync().ContinueWith(_ => { });
break; break;

View File

@@ -63,6 +63,9 @@
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" /> <ColumnDefinition Width="Auto" />
@@ -94,7 +97,21 @@
TextWrapping="Wrap" /> TextWrapping="Wrap" />
<TextBlock <TextBlock
Grid.Row="1" Grid.Row="2"
Grid.Column="0"
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsSecondLocalPortEnabled}" />
<ToggleButton
x:Name="togSecondLocalPortEnabled"
Grid.Row="2"
Grid.Column="1"
Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" />
<TextBlock
Grid.Row="3"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -102,37 +119,44 @@
Text="{x:Static resx:ResUI.TbSettingsUdpEnabled}" /> Text="{x:Static resx:ResUI.TbSettingsUdpEnabled}" />
<ToggleButton <ToggleButton
x:Name="togudpEnabled" x:Name="togudpEnabled"
Grid.Row="1" Grid.Row="3"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="2" Grid.Row="4"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsSniffingEnabled}" /> Text="{x:Static resx:ResUI.TbSettingsSniffingEnabled}" />
<StackPanel <ToggleButton
Grid.Row="2" x:Name="togsniffingEnabled"
Grid.Row="4"
Grid.Column="1" Grid.Column="1"
Grid.ColumnSpan="2" Margin="{StaticResource Margin8}"
Orientation="Horizontal"> HorizontalAlignment="Left" />
<ToggleButton
x:Name="togsniffingEnabled"
Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" />
<ListBox
x:Name="clbdestOverride"
Margin="{StaticResource Margin4}"
HorizontalAlignment="Left"
FontSize="{DynamicResource StdFontSize}"
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
</StackPanel>
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="5"
Grid.Column="0"
Margin="{StaticResource Margin8}"
VerticalAlignment="Center"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsDestOverride}" />
<ListBox
x:Name="clbdestOverride"
Grid.Row="5"
Grid.Column="1"
Grid.ColumnSpan="2"
Margin="{StaticResource Margin4}"
HorizontalAlignment="Left"
FontSize="{DynamicResource StdFontSize}"
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
<TextBlock
Grid.Row="6"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -140,13 +164,13 @@
Text="{x:Static resx:ResUI.TbSettingsRouteOnly}" /> Text="{x:Static resx:ResUI.TbSettingsRouteOnly}" />
<ToggleButton <ToggleButton
x:Name="togrouteOnly" x:Name="togrouteOnly"
Grid.Row="3" Grid.Row="6"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="4" Grid.Row="7"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -154,13 +178,13 @@
Text="{x:Static resx:ResUI.TbSettingsAllowLAN}" /> Text="{x:Static resx:ResUI.TbSettingsAllowLAN}" />
<ToggleButton <ToggleButton
x:Name="togAllowLANConn" x:Name="togAllowLANConn"
Grid.Row="4" Grid.Row="7"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="8"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -168,13 +192,13 @@
Text="{x:Static resx:ResUI.TbSettingsNewPort4LAN}" /> Text="{x:Static resx:ResUI.TbSettingsNewPort4LAN}" />
<ToggleButton <ToggleButton
x:Name="togNewPort4LAN" x:Name="togNewPort4LAN"
Grid.Row="5" Grid.Row="8"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="6" Grid.Row="9"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -182,14 +206,14 @@
Text="{x:Static resx:ResUI.TbSettingsUser}" /> Text="{x:Static resx:ResUI.TbSettingsUser}" />
<TextBox <TextBox
x:Name="txtuser" x:Name="txtuser"
Grid.Row="6" Grid.Row="9"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="7" Grid.Row="10"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -197,14 +221,14 @@
Text="{x:Static resx:ResUI.TbSettingsPass}" /> Text="{x:Static resx:ResUI.TbSettingsPass}" />
<TextBox <TextBox
x:Name="txtpass" x:Name="txtpass"
Grid.Row="7" Grid.Row="10"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
Style="{StaticResource DefTextBox}" /> Style="{StaticResource DefTextBox}" />
<TextBlock <TextBlock
Grid.Row="8" Grid.Row="11"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -212,13 +236,13 @@
Text="{x:Static resx:ResUI.TbSettingsMuxEnabled}" /> Text="{x:Static resx:ResUI.TbSettingsMuxEnabled}" />
<ToggleButton <ToggleButton
x:Name="togmuxEnabled" x:Name="togmuxEnabled"
Grid.Row="8" Grid.Row="11"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="9" Grid.Row="12"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -226,13 +250,13 @@
Text="{x:Static resx:ResUI.TbSettingsLogEnabledToFile}" /> Text="{x:Static resx:ResUI.TbSettingsLogEnabledToFile}" />
<ToggleButton <ToggleButton
x:Name="toglogEnabled" x:Name="toglogEnabled"
Grid.Row="9" Grid.Row="12"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="10" Grid.Row="13"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -240,7 +264,7 @@
Text="{x:Static resx:ResUI.TbSettingsLogLevel}" /> Text="{x:Static resx:ResUI.TbSettingsLogLevel}" />
<ComboBox <ComboBox
x:Name="cmbloglevel" x:Name="cmbloglevel"
Grid.Row="10" Grid.Row="13"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
@@ -248,7 +272,7 @@
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="11" Grid.Row="14"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -256,13 +280,13 @@
Text="{x:Static resx:ResUI.TbSettingsDefAllowInsecure}" /> Text="{x:Static resx:ResUI.TbSettingsDefAllowInsecure}" />
<ToggleButton <ToggleButton
x:Name="togdefAllowInsecure" x:Name="togdefAllowInsecure"
Grid.Row="11" Grid.Row="14"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="12" Grid.Row="15"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -270,7 +294,7 @@
Text="{x:Static resx:ResUI.TbSettingsDefFingerprint}" /> Text="{x:Static resx:ResUI.TbSettingsDefFingerprint}" />
<ComboBox <ComboBox
x:Name="cmbdefFingerprint" x:Name="cmbdefFingerprint"
Grid.Row="12" Grid.Row="15"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
@@ -278,7 +302,7 @@
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="13" Grid.Row="16"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -286,21 +310,21 @@
Text="{x:Static resx:ResUI.TbSettingsDefUserAgent}" /> Text="{x:Static resx:ResUI.TbSettingsDefUserAgent}" />
<ComboBox <ComboBox
x:Name="cmbdefUserAgent" x:Name="cmbdefUserAgent"
Grid.Row="13" Grid.Row="16"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
IsEditable="True" IsEditable="True"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="13" Grid.Row="16"
Grid.Column="3" Grid.Column="3"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbSettingsDefUserAgentTips}" /> Text="{x:Static resx:ResUI.TbSettingsDefUserAgentTips}" />
<TextBlock <TextBlock
Grid.Row="14" Grid.Row="17"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -308,14 +332,14 @@
Text="{x:Static resx:ResUI.TbSettingsMux4SboxProtocol}" /> Text="{x:Static resx:ResUI.TbSettingsMux4SboxProtocol}" />
<ComboBox <ComboBox
x:Name="cmbmux4SboxProtocol" x:Name="cmbmux4SboxProtocol"
Grid.Row="14" Grid.Row="17"
Grid.Column="1" Grid.Column="1"
Width="200" Width="200"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
Style="{StaticResource DefComboBox}" /> Style="{StaticResource DefComboBox}" />
<TextBlock <TextBlock
Grid.Row="15" Grid.Row="18"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -323,13 +347,13 @@
Text="{x:Static resx:ResUI.TbSettingsEnableCacheFile4Sbox}" /> Text="{x:Static resx:ResUI.TbSettingsEnableCacheFile4Sbox}" />
<ToggleButton <ToggleButton
x:Name="togenableCacheFile4Sbox" x:Name="togenableCacheFile4Sbox"
Grid.Row="15" Grid.Row="18"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="16" Grid.Row="19"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -337,7 +361,7 @@
Text="{x:Static resx:ResUI.TbSettingsHysteriaBandwidth}" /> Text="{x:Static resx:ResUI.TbSettingsHysteriaBandwidth}" />
<StackPanel <StackPanel
Grid.Row="16" Grid.Row="19"
Grid.Column="1" Grid.Column="1"
Orientation="Horizontal"> Orientation="Horizontal">
@@ -356,7 +380,7 @@
</StackPanel> </StackPanel>
<TextBlock <TextBlock
Grid.Row="17" Grid.Row="20"
Grid.Column="0" Grid.Column="0"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
VerticalAlignment="Center" VerticalAlignment="Center"
@@ -364,12 +388,12 @@
Text="{x:Static resx:ResUI.TbSettingsEnableFragment}" /> Text="{x:Static resx:ResUI.TbSettingsEnableFragment}" />
<ToggleButton <ToggleButton
x:Name="togenableFragment" x:Name="togenableFragment"
Grid.Row="17" Grid.Row="20"
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left" />
<TextBlock <TextBlock
Grid.Row="17" Grid.Row="20"
Grid.Column="2" Grid.Column="2"
Margin="{StaticResource Margin8}" Margin="{StaticResource Margin8}"
Style="{StaticResource ToolbarTextBlock}" Style="{StaticResource ToolbarTextBlock}"

View File

@@ -104,6 +104,7 @@ namespace v2rayN.Views
this.WhenActivated(disposables => this.WhenActivated(disposables =>
{ {
this.Bind(ViewModel, vm => vm.localPort, v => v.txtlocalPort.Text).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.localPort, v => v.txtlocalPort.Text).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.SecondLocalPortEnabled, v => v.togSecondLocalPortEnabled.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.udpEnabled, v => v.togudpEnabled.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.udpEnabled, v => v.togudpEnabled.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.sniffingEnabled, v => v.togsniffingEnabled.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.sniffingEnabled, v => v.togsniffingEnabled.IsChecked).DisposeWith(disposables);
this.Bind(ViewModel, vm => vm.routeOnly, v => v.togrouteOnly.IsChecked).DisposeWith(disposables); this.Bind(ViewModel, vm => vm.routeOnly, v => v.togrouteOnly.IsChecked).DisposeWith(disposables);

View File

@@ -223,12 +223,6 @@ namespace v2rayN.Views
{ {
switch (e.Key) switch (e.Key)
{ {
case Key.V:
var clipboardData = WindowsUtils.GetClipboardData();
var service = Locator.Current.GetService<MainWindowViewModel>();
if (service != null) _ = service.AddServerViaClipboardAsync(clipboardData);
break;
case Key.A: case Key.A:
menuSelectAll_Click(null, null); menuSelectAll_Click(null, null);
break; break;

View File

@@ -1,11 +1,11 @@
<reactiveui:ReactiveWindow <reactiveui:ReactiveWindow
x:Class="v2rayN.Views.RoutingRuleDetailsWindow" x:Class="v2rayN.Views.RoutingRuleDetailsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:reactiveui="http://reactiveui.net"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:reactiveui="http://reactiveui.net"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib" xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib" xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
Title="{x:Static resx:ResUI.menuRoutingRuleDetailsSetting}" Title="{x:Static resx:ResUI.menuRoutingRuleDetailsSetting}"
@@ -134,6 +134,13 @@
Margin="{StaticResource Margin4}" Margin="{StaticResource Margin4}"
FontSize="{DynamicResource StdFontSize}" FontSize="{DynamicResource StdFontSize}"
Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" /> Style="{StaticResource MaterialDesignFilterChipPrimaryListBox}" />
<TextBlock
Grid.Row="4"
Grid.Column="2"
Margin="{StaticResource Margin4}"
HorizontalAlignment="Left"
Style="{StaticResource ToolbarTextBlock}"
Text="{x:Static resx:ResUI.TbRoutingInboundTagTips}" />
<TextBlock <TextBlock
Grid.Row="5" Grid.Row="5"