From a9efee57a3f791d5b21049de07b171cb29f08b52 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Thu, 18 Sep 2025 06:41:06 +0800 Subject: [PATCH 1/9] ci: add legacy macos build --- .github/workflows/build.yml | 25 +++++++++++++++++++++++-- script/build_public_res.sh | 11 ----------- script/deploy_macos.sh | 9 +++++++-- 3 files changed, 30 insertions(+), 15 deletions(-) delete mode 100755 script/build_public_res.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d18cdf7..0604a08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: go_version: "1.25.0" - cross_os: darwin cross_arch: amd64 - go_version: "1.25.0" + go_version: "1.24.7" - cross_os: darwin cross_arch: arm64 go_version: "1.25.0" @@ -106,6 +106,9 @@ jobs: - platform: macos-latest qt_version: "6.9.0" target: arm64 + - platform: macos-latest + qt_version: "6.4.3" + target: x86_64 - platform: windows-latest qt_version: "6.2.12" target: x86_64 @@ -203,7 +206,7 @@ jobs: ./script/deploy_linux64.sh - name: macOS - Generate MakeFile and Build shell: bash - if: matrix.platform == 'macos-latest' + if: matrix.platform == 'macos-latest' && matrix.qt_version != '6.4.3' run: | mkdir build cd build @@ -212,6 +215,17 @@ jobs: ninja cd .. ./script/deploy_macos.sh ${{ matrix.target }} + - name: Legacy macOS - Generate MakeFile and Build + shell: bash + if: matrix.platform == 'macos-latest' && matrix.qt_version == '6.4.3' + run: | + mkdir build + cd build + curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h" + cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_OSX_ARCHITECTURES=${{ matrix.target }} .. + ninja + cd .. + ./script/deploy_macos.sh # ========================================================================================================= Deployments - name: Tar files shell: bash @@ -283,6 +297,12 @@ jobs: zip -9 --symlinks -r $version_standalone-macos-amd64.zip Throne rm -rf macos-amd64 rm -rf Throne + #### + mkdir Throne + mv macoslegacy-amd64/Throne.app Throne/Throne.app + zip -9 --symlinks -r $version_standalone-macoslegacy-amd64.zip Throne + rm -rf macoslegacy-amd64 + rm -rf Throne - name: Clean Up run: | cd deployment @@ -294,6 +314,7 @@ jobs: rm -rf windowslegacy64 rm -rf macos-amd64 rm -rf macos-arm64 + rm -rf macoslegacy-amd64 rm -rf *.pdb - name: Uploading Artifact uses: actions/upload-artifact@v4.6.2 diff --git a/script/build_public_res.sh b/script/build_public_res.sh deleted file mode 100755 index 8bf408f..0000000 --- a/script/build_public_res.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash -set -e - -source script/env_deploy.sh -DEST=$DEPLOYMENT/public_res -rm -rf $DEST -mkdir -p $DEST - -#### Download geodata #### -curl -fLso $DEST/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db" -curl -fLso $DEST/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db" diff --git a/script/deploy_macos.sh b/script/deploy_macos.sh index 03805dc..a45b562 100755 --- a/script/deploy_macos.sh +++ b/script/deploy_macos.sh @@ -1,14 +1,19 @@ #!/bin/bash set -e +source script/env_deploy.sh if [[ $1 == 'arm64' ]]; then ARCH="arm64" + DEST=$DEPLOYMENT/macos-arm64 else ARCH="amd64" + if [[ $1 == 'x86_64' ]]; then + DEST=$DEPLOYMENT/macos-amd64 + else + DEST=$DEPLOYMENT/macoslegacy-amd64 + fi fi -source script/env_deploy.sh -DEST=$DEPLOYMENT/macos-$ARCH rm -rf $DEST mkdir -p $DEST From 538ce1574f2ffbe0db5e7d45633a5d59a86504d3 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Thu, 18 Sep 2025 07:00:47 +0800 Subject: [PATCH 2/9] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0604a08..17eefa0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -222,7 +222,7 @@ jobs: mkdir build cd build curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h" - cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 -DCMAKE_OSX_ARCHITECTURES=${{ matrix.target }} .. + cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES=${{ matrix.target }} .. ninja cd .. ./script/deploy_macos.sh From 35692ea6fdc7778fdd88dbba1837925ef29587f4 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Thu, 18 Sep 2025 15:14:31 +0800 Subject: [PATCH 3/9] fix #774 --- core/server/server.go | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/core/server/server.go b/core/server/server.go index d84388a..9c81775 100644 --- a/core/server/server.go +++ b/core/server/server.go @@ -58,27 +58,29 @@ func (s *server) Start(in *gen.LoadConfigReq, out *gen.ErrorResp) (_ error) { } if *in.NeedExtraProcess { - extraConfPath := *in.ExtraProcessConfDir + string(os.PathSeparator) + "extra.conf" - f, e := os.OpenFile(extraConfPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 700) - if e != nil { - err = E.Cause(e, "Failed to open extra.conf") - return - } - _, e = f.WriteString(*in.ExtraProcessConf) - if e != nil { - err = E.Cause(e, "Failed to write extra.conf") - return - } - _ = f.Close() args, e := shlex.Split(*in.ExtraProcessArgs) if e != nil { err = E.Cause(e, "Failed to parse args") return } - for idx, arg := range args { - if strings.Contains(arg, "%s") { - args[idx] = fmt.Sprintf(arg, extraConfPath) - break + if in.ExtraProcessConf != nil { + extraConfPath := *in.ExtraProcessConfDir + string(os.PathSeparator) + "extra.conf" + f, e := os.OpenFile(extraConfPath, os.O_CREATE|os.O_TRUNC|os.O_RDWR, 700) + if e != nil { + err = E.Cause(e, "Failed to open extra.conf") + return + } + _, e = f.WriteString(*in.ExtraProcessConf) + if e != nil { + err = E.Cause(e, "Failed to write extra.conf") + return + } + _ = f.Close() + for idx, arg := range args { + if strings.Contains(arg, "%s") { + args[idx] = fmt.Sprintf(arg, extraConfPath) + break + } } } From a8941f88018e94fc2af3305fb5e289cf634d136d Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Thu, 18 Sep 2025 15:36:39 +0800 Subject: [PATCH 4/9] Update server.go --- core/server/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/server.go b/core/server/server.go index 9c81775..dd05646 100644 --- a/core/server/server.go +++ b/core/server/server.go @@ -58,7 +58,7 @@ func (s *server) Start(in *gen.LoadConfigReq, out *gen.ErrorResp) (_ error) { } if *in.NeedExtraProcess { - args, e := shlex.Split(*in.ExtraProcessArgs) + args, e := shlex.Split(in.GetExtraProcessArgs()) if e != nil { err = E.Cause(e, "Failed to parse args") return From 6965ea1717805035f023c2944be65532fd9d1b34 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Fri, 19 Sep 2025 08:46:12 +0800 Subject: [PATCH 5/9] fix #783 --- 3rdparty/qv2ray/v2/ui/QvAutoCompleteTextEdit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty/qv2ray/v2/ui/QvAutoCompleteTextEdit.cpp b/3rdparty/qv2ray/v2/ui/QvAutoCompleteTextEdit.cpp index 59b8066..eea77a5 100644 --- a/3rdparty/qv2ray/v2/ui/QvAutoCompleteTextEdit.cpp +++ b/3rdparty/qv2ray/v2/ui/QvAutoCompleteTextEdit.cpp @@ -124,7 +124,7 @@ namespace Qv2ray::ui::widgets { const bool isTab = (e->modifiers().testFlag(Qt::NoModifier) && e->key() == Qt::Key_Tab); const bool isOtherSpace = e->text() == " "; // - if (isSpace || isTab || isOtherSpace) { + if (isSpace && !lineUnderCursor().startsWith("processName:") && !lineUnderCursor().startsWith("processPath:") || isTab || isOtherSpace) { QToolTip::showText(this->mapToGlobal(QPoint(0, 0)), tr("You can not input space characters here."), this, QRect{}, 2000); return; } From 44a12574aedf07da41b87cf466d46bf5c2670684 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Sat, 20 Sep 2025 13:09:45 +0800 Subject: [PATCH 6/9] ci: add Windows on Arm build --- .github/workflows/build.yml | 38 +++++++++++++++++++++++++++++++------ script/deploy_woa.sh | 22 +++++++++++++++++++++ 2 files changed, 54 insertions(+), 6 deletions(-) create mode 100644 script/deploy_woa.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17eefa0..4e8b1a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,25 +17,28 @@ jobs: include: - cross_os: windows cross_arch: amd64 - go_version: "1.25.0" + go_version: "1.25.1" + - cross_os: windows + cross_arch: arm64 + go_version: "1.25.1" - cross_os: linux cross_arch: amd64 - go_version: "1.25.0" + go_version: "1.25.1" - cross_os: linux cross_arch: arm64 - go_version: "1.25.0" + go_version: "1.25.1" - cross_os: darwin cross_arch: amd64 go_version: "1.24.7" - cross_os: darwin cross_arch: arm64 - go_version: "1.25.0" + go_version: "1.25.1" - cross_os: windowslegacy cross_arch: amd64 - go_version: "1.25.0" + go_version: "1.25.1" - cross_os: windowslegacy cross_arch: 386 - go_version: "1.25.0" + go_version: "1.25.1" fail-fast: false runs-on: ubuntu-latest steps: @@ -94,6 +97,9 @@ jobs: - platform: windows-latest qt_version: "6.9.0" target: x86_64 + - platform: windows-11-arm + qt_version: "6.9.0" + target: arm64 - platform: ubuntu-22.04 qt_version: "6.9.0" target: amd64 @@ -130,6 +136,11 @@ jobs: uses: bwoodsend/setup-winlibs-action@v1.15 with: architecture: ${{ matrix.target }} + - name: Install MSVC compiler + if: matrix.platform == 'windows-11-arm' + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: arm64 - name: Download Artifacts uses: actions/download-artifact@v4.3.0 with: @@ -184,6 +195,17 @@ jobs: ninja -j2 cd .. ./script/deploy_windows.sh ${{ matrix.target }} + - name: WOA - Generate MakeFile and Build + shell: bash + if: matrix.platform == 'windows-11-arm' + run: | + mkdir build + cd build + curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h" + cmake -GNinja -DCMAKE_BUILD_TYPE=Release .. + ninja -j2 + cd .. + ./script/deploy_woa.sh - name: Build Installer with NSIS shell: cmd if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12' @@ -286,6 +308,10 @@ jobs: zip -9 -r $version_standalone-windowslegacy64.zip Throne rm -rf Throne #### + mv windows-arm64 Throne + zip -9 -r $version_standalone-windows-arm64.zip Throne + rm -rf Throne + #### mkdir Throne mv macos-arm64/Throne.app Throne/Throne.app zip -9 --symlinks -r $version_standalone-macos-arm64.zip Throne diff --git a/script/deploy_woa.sh b/script/deploy_woa.sh new file mode 100644 index 0000000..88e8060 --- /dev/null +++ b/script/deploy_woa.sh @@ -0,0 +1,22 @@ +#!/bin/bash +set -e + +source script/env_deploy.sh +DEST=$DEPLOYMENT/windows-arm64 +rm -rf $DEST +mkdir -p $DEST + +#### copy exe #### +cp $BUILD/Throne.exe $DEST + +cd download-artifact +cd *windows-arm64 +tar xvzf artifacts.tgz -C ../../ +cd ../.. + +#### deploy qt & DLL runtime #### +pushd $DEST +windeployqt Throne.exe --no-translations --no-system-d3d-compiler --no-opengl-sw --no-svg --verbose 2 +popd + +rm -rf $DEST/dxcompiler.dll $DEST/dxil.dll From 7806bc678638cf051e1b012322dd0093c21c660a Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Sat, 20 Sep 2025 13:12:02 +0800 Subject: [PATCH 7/9] ci: revise permission access --- script/deploy_woa.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 script/deploy_woa.sh diff --git a/script/deploy_woa.sh b/script/deploy_woa.sh old mode 100644 new mode 100755 From 10283eafd1c4633b922a85aceca6ba6f30a9c4c4 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Sat, 20 Sep 2025 14:38:20 +0800 Subject: [PATCH 8/9] fix --- cmake/windows/windows.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmake/windows/windows.cmake b/cmake/windows/windows.cmake index fb34cdf..9bcef01 100644 --- a/cmake/windows/windows.cmake +++ b/cmake/windows/windows.cmake @@ -13,12 +13,7 @@ generate_product_version( ) add_definitions(-DUNICODE -D_UNICODE -DNOMINMAX) set(GUI_TYPE WIN32) -if (MINGW) - if (NOT DEFINED MinGW_ROOT) - set(MinGW_ROOT "C:/msys64/mingw64") - endif () -else () +if (MSVC) add_compile_options("/utf-8") - add_compile_options("/std:c++17") add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS) endif () From 597d2608e3b36c8275d7590ddfeb2229033b24dd Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Sat, 20 Sep 2025 15:39:11 +0800 Subject: [PATCH 9/9] Update mainwindow.cpp --- src/ui/mainwindow.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 5b7f4de..fdca3cc 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -2358,21 +2358,25 @@ bool isNewer(QString assetName) { void MainWindow::CheckUpdate() { QString search; -#ifdef Q_OS_WIN32 -# ifdef Q_OS_WIN64 - if (WinVersion::IsBuildNumGreaterOrEqual(BuildNumber::Windows_10_1809)) - search = "windows64"; - else - search = "windowslegacy64"; +#ifdef Q_OS_WIN +# ifdef Q_PROCESSOR_ARM_64 + search = "windows-arm64"; # else - search = "windows32"; +# ifdef Q_OS_WIN64 + if (WinVersion::IsBuildNumGreaterOrEqual(BuildNumber::Windows_10_1809)) + search = "windows64"; + else + search = "windowslegacy64"; +# else + search = "windows32"; +# endif # endif #endif #ifdef Q_OS_LINUX # ifdef Q_PROCESSOR_X86_64 - search = "linux-amd64"; + search = "linux-amd64"; # else - search = "linux-arm64"; + search = "linux-arm64"; # endif #endif #ifdef Q_OS_MACOS