From ab1857fd40728b7b240b36297ebe5ce4b18c554d Mon Sep 17 00:00:00 2001 From: arm64v8a <48624112+arm64v8a@users.noreply.github.com> Date: Tue, 25 Oct 2022 13:53:52 +0900 Subject: [PATCH] update --- README.md | 14 +++++--------- db/ConfigBuilder.cpp | 4 +--- main/NekoRay_DataStore.hpp | 2 +- main/main.cpp | 1 + matsuri_commit.txt | 2 +- sys/ExternalProcess.cpp | 4 +++- ui/mainwindow.cpp | 7 +++++++ ui/mainwindow.ui | 33 ++++++++++++++++++++++----------- 8 files changed, 41 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 6f6ec3c..56dbb3f 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,13 @@ # NekoRay -基于 Qt/C++ 的跨平台 GUI 代理配置管理器 - -后端 1. v2ray 2. sing-box - -目前支持 Windows / Linux amd64 开箱即用 - -Qt/C++ based cross-platform GUI proxy configuration manager - -backend: 1. v2ray 2.sing-box +Qt based cross-platform GUI proxy configuration manager (backend: v2ray / sing-box) Support Windows / Linux amd64 out of the box now. +基于 Qt 的跨平台代理配置管理器 (后端 v2ray / sing-box) + +目前支持 Windows / Linux / macOS amd64 开箱即用 + ## 下载 Download 便携格式,无安装器。转到 Releases 下载预编译的二进制文件,解压后即可使用。 diff --git a/db/ConfigBuilder.cpp b/db/ConfigBuilder.cpp index 396a313..ce51b7a 100644 --- a/db/ConfigBuilder.cpp +++ b/db/ConfigBuilder.cpp @@ -532,9 +532,7 @@ namespace NekoRay { status->result = result; // Log - auto level = dataStore->log_level; - level = level.replace("warning", "warn"); - result->coreConfig["log"] = QJsonObject{{"level", level}}; + result->coreConfig["log"] = QJsonObject{{"level", dataStore->log_level}}; // Inbounds diff --git a/main/NekoRay_DataStore.hpp b/main/NekoRay_DataStore.hpp index a704e32..ac62300 100644 --- a/main/NekoRay_DataStore.hpp +++ b/main/NekoRay_DataStore.hpp @@ -91,7 +91,7 @@ namespace NekoRay { // DNS QString remote_dns = "https://8.8.8.8/dns-query"; - QString direct_dns = "https+local://223.5.5.5/dns-query"; + QString direct_dns = "localhost"; bool dns_routing = true; bool enhance_resolve_server_domain = false; diff --git a/main/main.cpp b/main/main.cpp index ab63ead..baac9e2 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -33,6 +33,7 @@ int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_DisableWindowContextHelpButton); #endif QApplication::setAttribute(Qt::AA_DontUseNativeDialogs); + QApplication::setQuitOnLastWindowClosed(false); // Clean QDir::setCurrent(QApplication::applicationDirPath()); diff --git a/matsuri_commit.txt b/matsuri_commit.txt index d0b8a08..d8f5164 100644 --- a/matsuri_commit.txt +++ b/matsuri_commit.txt @@ -1 +1 @@ -46ba6137206cb0e0fc3433b3459237c55132aabe +cec14872528e7a6a0e7a902069c1b62a324911f9 diff --git a/sys/ExternalProcess.cpp b/sys/ExternalProcess.cpp index 7a41ef8..fff8baf 100644 --- a/sys/ExternalProcess.cpp +++ b/sys/ExternalProcess.cpp @@ -112,11 +112,13 @@ namespace NekoRay::sys { void CoreProcess::Start() { show_stderr = false; + env = QStringList(); auto v2ray_asset_dir = FindCoreAsset("geoip.dat"); if (!v2ray_asset_dir.isEmpty()) { v2ray_asset_dir = QFileInfo(v2ray_asset_dir).absolutePath(); - env = QStringList{"V2RAY_LOCATION_ASSET=" + v2ray_asset_dir}; + env << "V2RAY_LOCATION_ASSET=" + v2ray_asset_dir; } + env << "GODEBUG=netdns=go"; ExternalProcess::Start(); write((dataStore->core_token + "\n").toUtf8()); } diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index c37e3dc..81d4977 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -97,6 +97,9 @@ MainWindow::MainWindow(QWidget *parent) if (IS_NEKO_BOX) { software_name = "NekoBox"; software_core_name = "sing-box"; + if (NekoRay::dataStore->log_level == "warning") { + NekoRay::dataStore->log_level = "info"; + } } // top bar @@ -329,6 +332,9 @@ MainWindow::MainWindow(QWidget *parent) connect(ui->checkBox_VPN, &QCheckBox::clicked, this, [=](bool checked) { neko_set_spmode(checked ? NekoRay::SystemProxyMode::VPN : NekoRay::SystemProxyMode::DISABLE); }); + connect(ui->checkBox_SystemProxy, &QCheckBox::clicked, this, [=](bool checked) { + neko_set_spmode(checked ? NekoRay::SystemProxyMode::SYSTEM_PROXY : NekoRay::SystemProxyMode::DISABLE); + }); connect(ui->menu_spmode, &QMenu::aboutToShow, this, [=]() { ui->menu_spmode_disabled->setChecked(title_spmode == NekoRay::SystemProxyMode::DISABLE); ui->menu_spmode_system_proxy->setChecked(title_spmode == NekoRay::SystemProxyMode::SYSTEM_PROXY); @@ -648,6 +654,7 @@ void MainWindow::refresh_status(const QString &traffic_update) { ui->label_inbound->setText(inbound_txt); // ui->checkBox_VPN->setChecked(title_spmode == NekoRay::SystemProxyMode::VPN); + ui->checkBox_SystemProxy->setChecked(title_spmode == NekoRay::SystemProxyMode::SYSTEM_PROXY); if (select_mode) ui->label_running->setText("[" + tr("Select") + "]"); auto make_title = [=](bool isTray) { diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui index 79fc84a..8a697dd 100644 --- a/ui/mainwindow.ui +++ b/ui/mainwindow.ui @@ -162,17 +162,28 @@ - - - - 0 - 0 - - - - VPN Mode - - + + + + + + 0 + 0 + + + + VPN Mode + + + + + + + System Proxy + + + +