mirror of
https://github.com/MatsuriDayo/nekoray.git
synced 2025-12-17 20:44:38 +03:00
update build
This commit is contained in:
24
.github/workflows/build-qv2ray-cmake.yml
vendored
24
.github/workflows/build-qv2ray-cmake.yml
vendored
@@ -9,6 +9,9 @@ on:
|
|||||||
publish:
|
publish:
|
||||||
description: 'Publish: If want ignore'
|
description: 'Publish: If want ignore'
|
||||||
required: false
|
required: false
|
||||||
|
artifact-pack:
|
||||||
|
description: 'artifact-pack: If want ignore'
|
||||||
|
required: false
|
||||||
jobs:
|
jobs:
|
||||||
build-go:
|
build-go:
|
||||||
strategy:
|
strategy:
|
||||||
@@ -16,8 +19,8 @@ jobs:
|
|||||||
cross_os: [ windows, linux, darwin ]
|
cross_os: [ windows, linux, darwin ]
|
||||||
cross_arch: [ amd64 ]
|
cross_arch: [ amd64 ]
|
||||||
include:
|
include:
|
||||||
- cross_os: asset
|
- cross_os: public_res
|
||||||
cross_arch: asset
|
cross_arch: public_res
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -40,10 +43,10 @@ jobs:
|
|||||||
if: steps.cache-common.outputs.cache-hit != 'true'
|
if: steps.cache-common.outputs.cache-hit != 'true'
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
[ ${{ matrix.cross_os }} == asset ] || ./libs/get_source.sh
|
[ ${{ matrix.cross_os }} == public_res ] || ./libs/get_source.sh
|
||||||
[ ${{ matrix.cross_os }} == asset ] || GOOS=${{ matrix.cross_os }} GOARCH=${{ matrix.cross_arch }} ./libs/build_go.sh
|
[ ${{ matrix.cross_os }} == public_res ] || GOOS=${{ matrix.cross_os }} GOARCH=${{ matrix.cross_arch }} ./libs/build_go.sh
|
||||||
[ ${{ matrix.cross_os }} == asset ] || exit 0
|
[ ${{ matrix.cross_os }} == public_res ] || exit 0
|
||||||
./libs/build_asset.sh
|
./libs/build_public_res.sh
|
||||||
- name: Tar files
|
- name: Tar files
|
||||||
if: steps.cache-common.outputs.cache-hit != 'true'
|
if: steps.cache-common.outputs.cache-hit != 'true'
|
||||||
run: tar czvf artifacts.tgz ./deployment
|
run: tar czvf artifacts.tgz ./deployment
|
||||||
@@ -166,7 +169,8 @@ jobs:
|
|||||||
name: NekoRay-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.arch }}
|
name: NekoRay-${{ github.sha }}-${{ matrix.platform }}-${{ matrix.arch }}
|
||||||
path: artifacts.tgz
|
path: artifacts.tgz
|
||||||
publish:
|
publish:
|
||||||
name: Publish Release
|
name: Pack & Publish Release
|
||||||
|
if: github.event.inputs.artifact-pack != 'y'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- build-cpp
|
- build-cpp
|
||||||
@@ -185,9 +189,9 @@ jobs:
|
|||||||
mv ghr*linux_amd64/ghr .
|
mv ghr*linux_amd64/ghr .
|
||||||
find . -name artifacts.tgz | xargs -n1 tar xvzf
|
find . -name artifacts.tgz | xargs -n1 tar xvzf
|
||||||
cd deployment
|
cd deployment
|
||||||
cp -r assets/* linux64
|
cp -r public_res/* linux64
|
||||||
cp -r assets/* windows64
|
cp -r public_res/* windows64
|
||||||
rm -rf assets *.pdb
|
rm -rf public_res *.pdb
|
||||||
####
|
####
|
||||||
mv linux64 nekoray
|
mv linux64 nekoray
|
||||||
zip -r $version_standalone-linux64.zip nekoray
|
zip -r $version_standalone-linux64.zip nekoray
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ if (WIN32)
|
|||||||
include(cmake/fuck_windows/generate_product_version.cmake)
|
include(cmake/fuck_windows/generate_product_version.cmake)
|
||||||
generate_product_version(
|
generate_product_version(
|
||||||
QV2RAY_RC
|
QV2RAY_RC
|
||||||
NAME "Nekoray"
|
|
||||||
BUNDLE "Nekoray Project Family"
|
|
||||||
ICON "${CMAKE_SOURCE_DIR}/res/nekoray.ico"
|
ICON "${CMAKE_SOURCE_DIR}/res/nekoray.ico"
|
||||||
COMPANY_NAME "Nekoray Workgroup"
|
NAME "nekoray"
|
||||||
COMPANY_COPYRIGHT "Nekoray Workgroup"
|
BUNDLE "nekoray"
|
||||||
FILE_DESCRIPTION "Nekoray Main Application"
|
COMPANY_NAME "nekoray"
|
||||||
|
COMPANY_COPYRIGHT "nekoray"
|
||||||
|
FILE_DESCRIPTION "nekoray"
|
||||||
)
|
)
|
||||||
add_definitions(-DUNICODE -D_UNICODE -DNOMINMAX)
|
add_definitions(-DUNICODE -D_UNICODE -DNOMINMAX)
|
||||||
set(GUI_TYPE WIN32)
|
set(GUI_TYPE WIN32)
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
在 Linux 下编译 Nekoray
|
在 Linux 下编译 Nekoray
|
||||||
|
|
||||||
### git clone 源码
|
## git clone 源码
|
||||||
|
|
||||||
```
|
```
|
||||||
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
||||||
```
|
```
|
||||||
|
|
||||||
### 简单编译法
|
## 简单编译法
|
||||||
|
|
||||||
条件:
|
条件:
|
||||||
|
|
||||||
1. C++ 依赖:`protobuf yaml-cpp zxing-cpp` 已用包管理器安装,并符合版本要求
|
1. C++ 依赖:`protobuf yaml-cpp zxing-cpp` 已用包管理器安装,并符合版本要求。
|
||||||
2. 已安装 `qtbase` `qtsvg` `qttools` `qtx11extras`
|
2. 已安装 `qtbase` `qtsvg` `qttools` `qtx11extras`
|
||||||
3. Qt 版本必须大于等于 5.15
|
3. 已安装 Qt `5.12.x` 或 `5.15.x`
|
||||||
4. 系统为 `x86-64-linux-gnu`
|
4. 系统为 `x86-64-linux-gnu`
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
@@ -26,37 +26,43 @@ ninja
|
|||||||
|
|
||||||
解压 Release 的压缩包,替换其中的 `nekoray`,删除 `launcher` 即可使用。
|
解压 Release 的压缩包,替换其中的 `nekoray`,删除 `launcher` 即可使用。
|
||||||
|
|
||||||
### 复杂编译法
|
## 复杂编译法
|
||||||
|
|
||||||
#### CMake 参数
|
### CMake 参数
|
||||||
|
|
||||||
| CMake 参数 | 默认值 | 含义 |
|
| CMake 参数 | 默认值 | 含义 |
|
||||||
|------------------|-----|-------------------------|
|
|-------------------|-------------------|-----------------------|
|
||||||
| QT_VERSION_MAJOR | 5 | QT版本 |
|
| QT_VERSION_MAJOR | 5 | QT版本 |
|
||||||
| NKR_NO_EXTERNAL | | 不包含外部C++依赖(以下所有) |
|
| NKR_NO_EXTERNAL | | 不包含外部 C/C++ 依赖 (以下所有) |
|
||||||
| NKR_NO_YAML | | 不包含 yaml-cpp |
|
| NKR_NO_YAML | | 不包含 yaml-cpp |
|
||||||
| NKR_NO_QHOTKEY | | 不包含 qhotkey |
|
| NKR_NO_QHOTKEY | | 不包含 qhotkey |
|
||||||
| NKR_NO_ZXING | | 不包含 zxing |
|
| NKR_NO_ZXING | | 不包含 zxing |
|
||||||
| NKR_NO_GRPC | | 不包含 gRPC |
|
| NKR_NO_GRPC | | 不包含 gRPC |
|
||||||
| NKR_NO_QUICKJS | | 不包含 quickjs |
|
| NKR_NO_QUICKJS | | 不包含 quickjs |
|
||||||
|
| NKR_PACKAGE | | 编译 package 版本 (aur) |
|
||||||
|
| NKR_PACKAGE_MACOS | | 编译 macos 版本 |
|
||||||
|
| NKR_LIBS | ./libs/deps/built | 依赖搜索目录 |
|
||||||
|
| NKR_DISABLE_LIBS | | 禁用 NKR_LIBS |
|
||||||
|
|
||||||
#### C++ 部分
|
1. `NKR_LIBS` 的值会被追加到 `CMAKE_PREFIX_PATH`
|
||||||
|
2. `NKR_PACKAGE` 打开后,`NKR_LIBS` 的默认值为 `./libs/deps/package` ,具体依赖请看 `build_deps_all.sh`
|
||||||
|
3. `NKR_PACKAGE_MACOS` 或 `NKR_PACKAGE` 打开后,应用将使用 appdata 目录存放配置,自动更新等功能将被禁用。
|
||||||
|
|
||||||
当您的发行版没有上面几个 C++ 依赖包,或者版本不符合要求时,可以参考 libs 文件夹内的默认编译脚本自行编译。
|
### C++ 部分
|
||||||
|
|
||||||
依赖搜寻 prefix 为 `libs/deps/bulit`
|
当您的发行版没有上面几个 C++ 依赖包,或者版本不符合要求时,可以参考 `build_deps_all.sh` 编译脚本自行编译。
|
||||||
|
|
||||||
条件:
|
条件: 已安装 Qt `5.12.x` 或 `5.15.x`
|
||||||
|
|
||||||
1. Qt 版本必须大于等于 5.15
|
#### 编译安装 C/C++ 依赖
|
||||||
|
|
||||||
首先编译安装C++依赖(这一步可能要挂梯)
|
(这一步可能要挂梯)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
./libs/build_deps_all.sh
|
./libs/build_deps_all.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
然后编译本体
|
#### 编译本体
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mkdir build
|
mkdir build
|
||||||
@@ -67,7 +73,7 @@ ninja
|
|||||||
|
|
||||||
编译完成后得到 `nekoray`
|
编译完成后得到 `nekoray`
|
||||||
|
|
||||||
#### Go 部分
|
### Go 部分
|
||||||
|
|
||||||
1. 把 `Matsuridayo/Matsuri` `Matsuridayo/v2ray-core` 置于 `../`
|
1. 把 `Matsuridayo/Matsuri` `Matsuridayo/v2ray-core` 置于 `../`
|
||||||
2. 进入 `go/cmd/nekoray_core` 文件夹 `go build` 得到 `nekoray_core`。
|
2. 进入 `go/cmd/nekoray_core` 文件夹 `go build` 得到 `nekoray_core`。
|
||||||
|
|||||||
@@ -16,23 +16,39 @@ git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
|||||||
|
|
||||||
### 下载 Qt SDK
|
### 下载 Qt SDK
|
||||||
|
|
||||||
目前使用的版本是 Qt 5.15.7 其他版本未测试
|
目前使用的版本是 Qt 5.15.x
|
||||||
|
|
||||||
|
暂时不建议使用 Qt 6.x
|
||||||
|
|
||||||
|
下载解压后,将 bin 目录添加到环境变量。
|
||||||
|
|
||||||
|
#### Qt 5.15.7 MSVC2019 x86_64
|
||||||
|
|
||||||
|
https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt5.15.7-Windows-x86_64-VS2019-16.11.20-20221103.7z
|
||||||
|
|
||||||
|
#### 官方签名版 Qt 5.15.2 (可选,已知有内存泄漏的BUG)
|
||||||
|
|
||||||
在此下载 `qtbase` `qtsvg` `qttools` 的包并解压到同一个目录。
|
在此下载 `qtbase` `qtsvg` `qttools` 的包并解压到同一个目录。
|
||||||
|
|
||||||
https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5152/qt.qt5.5152.win64_msvc2019_64/
|
https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5152/qt.qt5.5152.win64_msvc2019_64/
|
||||||
|
|
||||||
将 bin 目录添加到环境变量。
|
|
||||||
|
|
||||||
### C++ 部分编译
|
### C++ 部分编译
|
||||||
|
|
||||||
首先编译安装C++依赖(这一步可能要挂梯)
|
#### 编译安装 C/C++ 依赖
|
||||||
|
|
||||||
|
(这一步可能要挂梯)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
bash ./libs/build_deps_all.sh
|
bash ./libs/build_deps_all.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
然后编译本体(根据你的 QT Sdk 的位置替换命令)
|
目前只有 bash 脚本,没有批处理或 powershell,如果 Windows 没有带 bash 建议自行安装。
|
||||||
|
|
||||||
|
CMake 参数等细节与 Linux 大同小异,有问题可以参照 Build_Linux 文档。
|
||||||
|
|
||||||
|
#### 编译本体
|
||||||
|
|
||||||
|
请根据你的 QT Sdk 的位置替换命令
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
mkdir build
|
mkdir build
|
||||||
|
|||||||
1
examples/.gitignore
vendored
1
examples/.gitignore
vendored
@@ -1 +0,0 @@
|
|||||||
tun2socks
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
alpine 3.16
|
|
||||||
|
|
||||||
all use package
|
|
||||||
|
|
||||||
apk add git cmake g++ ninja zxing-cpp-dev yaml-cpp-dev grpc-dev protobuf-dev qt5-qtbase-dev qt5-qtsvg-dev qt5-qttools-dev qt5-qtx11extras-dev c-ares-dev re2-dev
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]; then
|
|
||||||
echo "Please run as root"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# add netns
|
|
||||||
ip netns add nekoray
|
|
||||||
# ip netns exec nekoray readlink /proc/self/ns/net
|
|
||||||
|
|
||||||
# add lo: lo is not shared
|
|
||||||
ip -n nekoray addr add 127.0.0.1/8 dev lo
|
|
||||||
ip -n nekoray link set dev lo up
|
|
||||||
|
|
||||||
# add tun
|
|
||||||
ip -n nekoray tuntap add tun0 user $USERID mode tun
|
|
||||||
ip -n nekoray addr add 26.0.0.1/30 dev tun0
|
|
||||||
ip -n nekoray link set dev tun0 up
|
|
||||||
ip -n nekoray route add default dev tun0
|
|
||||||
|
|
||||||
# set veth to use the socks port
|
|
||||||
ip link add dev nekoray-ve1 type veth peer name nekoray-ve2
|
|
||||||
ip addr add 26.1.0.1/30 dev nekoray-ve1
|
|
||||||
ip link set nekoray-ve1 up
|
|
||||||
ip link set nekoray-ve2 netns nekoray
|
|
||||||
ip -n nekoray addr add 26.1.0.2/30 dev nekoray-ve2
|
|
||||||
ip -n nekoray link set nekoray-ve2 up
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
BASEDIR=$(dirname "$0")
|
|
||||||
|
|
||||||
# netns
|
|
||||||
[ -f /var/run/netns/nekoray ] || pkexec env USERID=`id -u` sh -c "cd $PWD && $BASEDIR/netns-root.sh" || true
|
|
||||||
|
|
||||||
# run xjasonlyu/tun2socks to provide vpn
|
|
||||||
firejail --noprofile --netns=nekoray ./tun2socks -device tun0 -proxy socks5://26.1.0.1:2080 -interface nekoray-ve2 -drop-multicast
|
|
||||||
|
|
||||||
# use "firejail --noprofile --netns=nekoray ..." to run your program in VPN
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
Linux Only
|
|
||||||
|
|
||||||
此处为配置 VPN 的脚本,仅供参考,使用时要按实际情况替换某些参数(如 socks 端口)
|
|
||||||
|
|
||||||
vpn.sh 配置全局 VPN
|
|
||||||
ctrl-c 退出后自动删除 VPN
|
|
||||||
|
|
||||||
vpn-netns.sh 配置 netns
|
|
||||||
分应用代理,用法参考脚本内容
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
if [ "$EUID" -ne 0 ]
|
|
||||||
then echo "Please run as root"
|
|
||||||
exit
|
|
||||||
fi
|
|
||||||
|
|
||||||
killall nekoray_core || true
|
|
||||||
cp nekoray_core /opt/nekoray_core
|
|
||||||
cp geo* /opt/
|
|
||||||
setcap cap_net_admin+ep /opt/nekoray_core
|
|
||||||
ln -sf /opt/nekoray_core nekoray_core_cap
|
|
||||||
@@ -3,9 +3,17 @@ set -e
|
|||||||
|
|
||||||
cd libs
|
cd libs
|
||||||
|
|
||||||
|
# 参数
|
||||||
|
if [ -z $cmake ]; then
|
||||||
|
cmake="cmake"
|
||||||
|
fi
|
||||||
|
if [ -z $deps ]; then
|
||||||
|
deps="deps"
|
||||||
|
fi
|
||||||
|
|
||||||
# libs/deps/...
|
# libs/deps/...
|
||||||
mkdir -p deps
|
mkdir -p $deps
|
||||||
cd deps
|
cd $deps
|
||||||
if [ -z $NKR_PACKAGE ]; then
|
if [ -z $NKR_PACKAGE ]; then
|
||||||
INSTALL_PREFIX=$PWD/built
|
INSTALL_PREFIX=$PWD/built
|
||||||
else
|
else
|
||||||
@@ -27,7 +35,7 @@ cd zxing-*
|
|||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
cmake .. -GNinja -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_BLACKBOX_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
|
$cmake .. -GNinja -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=OFF -DBUILD_BLACKBOX_TESTS=OFF -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
|
||||||
ninja && ninja install
|
ninja && ninja install
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
@@ -46,7 +54,7 @@ cd yaml-*
|
|||||||
mkdir -p build
|
mkdir -p build
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
cmake .. -GNinja -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
|
$cmake .. -GNinja -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$INSTALL_PREFIX
|
||||||
ninja && ninja install
|
ninja && ninja install
|
||||||
|
|
||||||
cd ../..
|
cd ../..
|
||||||
@@ -59,7 +67,7 @@ git clone --recurse-submodules -b v21.4 --depth 1 --shallow-submodules https://g
|
|||||||
mkdir -p protobuf/build
|
mkdir -p protobuf/build
|
||||||
cd protobuf/build
|
cd protobuf/build
|
||||||
|
|
||||||
cmake .. -GNinja \
|
$cmake .. -GNinja \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DBUILD_SHARED_LIBS=OFF \
|
-DBUILD_SHARED_LIBS=OFF \
|
||||||
-Dprotobuf_MSVC_STATIC_RUNTIME=OFF \
|
-Dprotobuf_MSVC_STATIC_RUNTIME=OFF \
|
||||||
|
|||||||
@@ -2,15 +2,15 @@
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
source libs/deploy_common.sh
|
source libs/deploy_common.sh
|
||||||
DEST=$DEPLOYMENT/assets
|
DEST=$DEPLOYMENT/public_res
|
||||||
rm -rf $DEST
|
rm -rf $DEST
|
||||||
mkdir -p $DEST
|
mkdir -p $DEST
|
||||||
|
|
||||||
#### Download: geoip ####
|
#### Download geodata ####
|
||||||
curl -Lso $DEST/geoip.dat "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat"
|
curl -Lso $DEST/geoip.dat "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat"
|
||||||
curl -Lso $DEST/geosite.dat "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat"
|
curl -Lso $DEST/geosite.dat "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat"
|
||||||
curl -Lso $DEST/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db"
|
curl -Lso $DEST/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db"
|
||||||
curl -Lso $DEST/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
|
curl -Lso $DEST/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
|
||||||
|
|
||||||
#### copy assets ####
|
#### copy res/public ####
|
||||||
cp assets/* $DEST
|
cp res/public/* $DEST
|
||||||
@@ -12,10 +12,10 @@ DEST=$DEPLOYMENT/macos-$ARCH
|
|||||||
rm -rf $DEST
|
rm -rf $DEST
|
||||||
mkdir -p $DEST
|
mkdir -p $DEST
|
||||||
|
|
||||||
#### copy golang & asset => .app ####
|
#### copy golang & public_res => .app ####
|
||||||
pushd download-artifact
|
pushd download-artifact
|
||||||
find . -name artifacts.tgz | xargs -n1 tar xvzf
|
find . -name artifacts.tgz | xargs -n1 tar xvzf
|
||||||
mv deployment/assets/* deployment/macos-$ARCH
|
mv deployment/public_res/* deployment/macos-$ARCH
|
||||||
mv deployment/macos-$ARCH/* $BUILD/nekoray.app/Contents/MacOS
|
mv deployment/macos-$ARCH/* $BUILD/nekoray.app/Contents/MacOS
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ int main(int argc, char *argv[]) {
|
|||||||
if (args.contains("-tray")) NekoRay::dataStore->flag_tray = true;
|
if (args.contains("-tray")) NekoRay::dataStore->flag_tray = true;
|
||||||
if (args.contains("-debug")) NekoRay::dataStore->flag_debug = true;
|
if (args.contains("-debug")) NekoRay::dataStore->flag_debug = true;
|
||||||
#ifdef NKR_CPP_USE_APPDATA
|
#ifdef NKR_CPP_USE_APPDATA
|
||||||
NekoRay::dataStore->flag_use_appdata = true;
|
NekoRay::dataStore->flag_use_appdata = true; // Example: Package & MacOS
|
||||||
#endif
|
#endif
|
||||||
#ifdef NKR_CPP_DEBUG
|
#ifdef NKR_CPP_DEBUG
|
||||||
NekoRay::dataStore->flag_debug = true;
|
NekoRay::dataStore->flag_debug = true;
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
<file alias="icon/b-system-software-update.svg">icon/system-software-update.svg</file>
|
<file alias="icon/b-system-software-update.svg">icon/system-software-update.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/neko">
|
<qresource prefix="/neko">
|
||||||
<file alias="nekobox.png">../assets/nekobox.png</file>
|
<file alias="nekobox.png">public/nekobox.png</file>
|
||||||
<file alias="nekoray.png">../assets/nekoray.png</file>
|
<file alias="nekoray.png">public/nekoray.png</file>
|
||||||
<file>neko.css</file>
|
<file>neko.css</file>
|
||||||
<file alias="vpn/vpn-run-root.sh">../examples/vpn-run-root.sh</file>
|
<file>vpn/vpn-run-root.sh</file>
|
||||||
<file alias="vpn/sing-box-vpn.json">../examples/sing-box-vpn.json</file>
|
<file>vpn/sing-box-vpn.json</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
@@ -550,7 +550,7 @@ void MainWindow::on_menu_exit_triggered() {
|
|||||||
//
|
//
|
||||||
NekoRay::dataStore->core_prepare_exit = true;
|
NekoRay::dataStore->core_prepare_exit = true;
|
||||||
hide();
|
hide();
|
||||||
ExitNekorayCore();
|
stop_core_daemon();
|
||||||
//
|
//
|
||||||
MF_release_runguard();
|
MF_release_runguard();
|
||||||
if (exit_reason == 1) {
|
if (exit_reason == 1) {
|
||||||
@@ -1394,7 +1394,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event) {
|
|||||||
auto mouseEvent = dynamic_cast<QMouseEvent *>(event);
|
auto mouseEvent = dynamic_cast<QMouseEvent *>(event);
|
||||||
|
|
||||||
if (obj == ui->label_running && mouseEvent->button() == Qt::LeftButton && running != nullptr) {
|
if (obj == ui->label_running && mouseEvent->button() == Qt::LeftButton && running != nullptr) {
|
||||||
test_current();
|
speedtest_current();
|
||||||
return true;
|
return true;
|
||||||
} else if (obj == ui->label_inbound && mouseEvent->button() == Qt::LeftButton) {
|
} else if (obj == ui->label_inbound && mouseEvent->button() == Qt::LeftButton) {
|
||||||
on_menu_basic_settings_triggered();
|
on_menu_basic_settings_triggered();
|
||||||
|
|||||||
@@ -173,13 +173,13 @@ private:
|
|||||||
|
|
||||||
// grpc and ...
|
// grpc and ...
|
||||||
|
|
||||||
static void ExitNekorayCore();
|
void setup_grpc();
|
||||||
|
|
||||||
void speedtest_current_group(int mode);
|
void speedtest_current_group(int mode);
|
||||||
|
|
||||||
void test_current();
|
void speedtest_current();
|
||||||
|
|
||||||
void setup_grpc();
|
static void stop_core_daemon();
|
||||||
|
|
||||||
void CheckUpdate();
|
void CheckUpdate();
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void MainWindow::speedtest_current_group(int mode) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::test_current() {
|
void MainWindow::speedtest_current() {
|
||||||
#ifndef NKR_NO_GRPC
|
#ifndef NKR_NO_GRPC
|
||||||
last_test_time = QTime::currentTime();
|
last_test_time = QTime::currentTime();
|
||||||
ui->label_running->setText(tr("Testing"));
|
ui->label_running->setText(tr("Testing"));
|
||||||
@@ -186,7 +186,7 @@ void MainWindow::test_current() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ExitNekorayCore() {
|
void MainWindow::stop_core_daemon() {
|
||||||
#ifndef NKR_NO_GRPC
|
#ifndef NKR_NO_GRPC
|
||||||
NekoRay::rpc::defaultClient->Exit();
|
NekoRay::rpc::defaultClient->Exit();
|
||||||
#endif
|
#endif
|
||||||
@@ -287,6 +287,7 @@ void MainWindow::neko_stop(bool crash) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::CheckUpdate() {
|
void MainWindow::CheckUpdate() {
|
||||||
|
// on new thread...
|
||||||
#ifndef NKR_NO_GRPC
|
#ifndef NKR_NO_GRPC
|
||||||
bool ok;
|
bool ok;
|
||||||
libcore::UpdateReq request;
|
libcore::UpdateReq request;
|
||||||
|
|||||||
Reference in New Issue
Block a user