This commit is contained in:
Nova 2025-06-29 18:40:32 +03:30
commit 8b857a0ff7
8 changed files with 2359 additions and 2278 deletions

View File

@ -14605,12 +14605,18 @@ inline namespace yaml_literals {
#pragma clang diagnostic ignored "-Wdeprecated"
#endif
#if defined(__GNUC__) && (__GNUC__ > 6)
#define FK_YAML_QUOTE_OPERATOR operator""_yaml
#else
#define FK_YAML_QUOTE_OPERATOR operator"" _yaml
#endif
/// @brief The user-defined string literal which deserializes a `char` array into a `node` object.
/// @param s An input `char` array.
/// @param n The size of `s`.
/// @return The resulting `node` object deserialized from `s`.
/// @sa https://fktn-k.github.io/fkYAML/api/operator_literal_yaml/
inline fkyaml::node operator"" _yaml(const char* s, std::size_t n) {
inline fkyaml::node FK_YAML_QUOTE_OPERATOR(const char* s, std::size_t n) {
return fkyaml::node::deserialize(s, s + n);
}
@ -14619,7 +14625,7 @@ inline fkyaml::node operator"" _yaml(const char* s, std::size_t n) {
/// @param n The size of `s`.
/// @return The resulting `node` object deserialized from `s`.
/// @sa https://fktn-k.github.io/fkYAML/api/operator_literal_yaml/
inline fkyaml::node operator"" _yaml(const char16_t* s, std::size_t n) {
inline fkyaml::node FK_YAML_QUOTE_OPERATOR(const char16_t* s, std::size_t n) {
return fkyaml::node::deserialize(s, s + n);
}
@ -14628,7 +14634,7 @@ inline fkyaml::node operator"" _yaml(const char16_t* s, std::size_t n) {
/// @param n The size of `s`.
/// @return The resulting `node` object deserialized from `s`.
/// @sa https://fktn-k.github.io/fkYAML/api/operator_literal_yaml/
inline fkyaml::node operator"" _yaml(const char32_t* s, std::size_t n) {
inline fkyaml::node FK_YAML_QUOTE_OPERATOR(const char32_t* s, std::size_t n) {
return fkyaml::node::deserialize(s, s + n);
}
@ -14637,7 +14643,7 @@ inline fkyaml::node operator"" _yaml(const char32_t* s, std::size_t n) {
/// @param s An input `char8_t` array.
/// @param n The size of `s`.
/// @return The resulting `node` object deserialized from `s`.
inline fkyaml::node operator"" _yaml(const char8_t* s, std::size_t n) {
inline fkyaml::node FK_YAML_QUOTE_OPERATOR(const char8_t* s, std::size_t n) {
return fkyaml::node::deserialize((const char8_t*)s, (const char8_t*)s + n);
}

62
README_zh.md Normal file
View File

@ -0,0 +1,62 @@
# Nekoray-new
基于 Qt 的跨平台的桌面 GUI 代理客户端,授权自 [Sing-box](https://github.com/SagerNet/sing-box)
开箱支持 Windows / Linux / MacOS 。对于 Windows 7 / 8 / 8.1,使用 [nekoray-win7](https://github.com/parhelia512/nekoray-win7)
![image](https://github.com/user-attachments/assets/ebba3f17-01e6-4066-8eaa-b9a35dd35b08)
### MacOS 发行版说明
苹果的平台具有非常严格的安全策略,由于 Nekoray 没有签名证书,所以必须使用 `xattr -d com.apple.quarantine /path/to/nekoray.app` 去掉隔离。 此外,为了使内置的提权起效,“终端”应该具有 “Full Disk” 访问权限。
### GitHub 发行版 (Portable ZIP)
[![GitHub All Releases](https://img.shields.io/github/downloads/Mahdi-zarei/nekoray/total?label=downloads-total&logo=github&style=flat-square)](https://github.com/Mahdi-zarei/nekoray/releases)
## 支持的协议
- SOCKS
- HTTP(S)
- Shadowsocks
- Trojan
- VMess
- VLESS
- TUIC
- Hysteria
- Hysteria2
- Wireguard
- SSH
- Custom Outbound
- Custom Config
- Chaining outbounds
- Extra Core
## 订阅格式
支持各种格式,包括分享链接,出站的 JSON 数组和 v2rayN 链接格式,以及对 Shadowsocks 和 Clash 格式的有限支持。
## 致谢
- [SagerNet/sing-box](https://github.com/SagerNet/sing-box)
- [Qv2ray](https://github.com/Qv2ray/Qv2ray)
- [Qt](https://www.qt.io/)
- [protobuf](https://github.com/protocolbuffers/protobuf)
- [fkYAML](https://github.com/fktn-k/fkYAML)
- [quirc](https://github.com/dlbeer/quirc)
- [QHotkey](https://github.com/Skycoder42/QHotkey)
## FAQ
**这个项目与原始的 Nekoray 有什么不同?** <br/>
[Nekoray](https://github.com/MatsuriDayo/nekoray/releases) 的原始开发者 MatsuriDayo 从 2023 年 12 月开始开始部分放弃项目,只进行一些小更新,而现在该项目以正式归档。
[Mahdi-zarei 的 nekoray](https://github.com/Mahdi-zarei/nekoray) 旨在继承原始计划,带有大量的改进,增加大量新特性,还去掉了过时的功能并进行了简化。
**为何某些防毒软件检测到 Nekoray 或其 核心 为恶意软件?** <br/>
Nekoray 的内置更新功能下载新发行版,移除旧文件并使用新的文件进行替代,这些相当类似于某些恶意软件所作所为(删除你的文件,使用加密文件替换你的文件)。
还有 `System DNS` 功能将更改你的系统的 DNS 设置,也会被某些防毒软件视为危险的行为。
**在 Linux 上是否真的需要设置 `SUID` 比特?** <br/>
为了创建和管理系统 TUN 接口,需要 root 访问权,没有它,你就必须赋予 Core 一些 `Cap_xxx_admin` 而且每次 TUN 激活时还需要你输入密码 3 到 4 次。
您还可以选择在“基本设置”->“安全”中禁用自动权限升级,但请注意,需要 root 访问权的功能将停止工作,除非您手动授予所需的权限。
**AUR, PKGCONFIG 等是否可以发布,以便 Linux 用户可以使用它们自己的方式安装该应用?** <br/>
这项工作正在进行中,很快该项目将以新的名称重命名,然后发布这类软件包。

View File

@ -28,7 +28,7 @@ require (
github.com/ajg/form v1.5.1 // indirect
github.com/andybalholm/brotli v1.0.6 // indirect
github.com/caddyserver/certmagic v0.20.0 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cretz/bine v0.2.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-chi/chi/v5 v5.2.1 // indirect

View File

@ -10,8 +10,8 @@ github.com/andybalholm/brotli v1.0.6 h1:Yf9fFpf49Zrxb9NlQaluyE92/+X7UVHlhMNJN2sx
github.com/andybalholm/brotli v1.0.6/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
github.com/caddyserver/certmagic v0.20.0 h1:bTw7LcEZAh9ucYCRXyCpIrSAGplplI0vGYJ4BpCQ/Fc=
github.com/caddyserver/certmagic v0.20.0/go.mod h1:N4sXgpICQUskEWpj7zVzvWD41p3NYacrNoZYiRM2jTg=
github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU=
github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA=
github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0=
github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/cretz/bine v0.2.0 h1:8GiDRGlTgz+o8H9DSnsl+5MeBK4HsExxgl6WgzOCuZo=
github.com/cretz/bine v0.2.0/go.mod h1:WU4o9QR9wWp8AVKtTM1XD5vUHkEqnf2vVSo6dBqbetI=

File diff suppressed because it is too large Load Diff

View File

@ -668,6 +668,8 @@ namespace NekoGui {
}
auto ruleSetArray = QJsonArray();
auto geoSitePath = GetCoreAssetDir("geosite.db");
auto geoIpPath = GetCoreAssetDir("geoip.db");
for (const auto &item: *neededRuleSets) {
ruleSetArray += QJsonObject{
{"type", "local"},
@ -677,7 +679,13 @@ namespace NekoGui {
};
if (QFile(QString(RULE_SETS_DIR + "/%1.srs").arg(item)).exists()) continue;
bool ok;
auto err = NekoGui_rpc::defaultClient->CompileGeoSet(&ok, item.contains("_IP") ? NekoGui_rpc::GeoRuleSetType::ip : NekoGui_rpc::GeoRuleSetType::site, item.toStdString(), GetBasePath());
auto mode = NekoGui_rpc::GeoRuleSetType::site;
auto geoAssertPath = geoSitePath;
if (item.contains("_IP")) {
mode = NekoGui_rpc::GeoRuleSetType::ip;
geoAssertPath = geoIpPath;
}
auto err = NekoGui_rpc::defaultClient->CompileGeoSet(&ok, mode, item.toStdString(), geoAssertPath);
if (!ok) {
MW_show_log("Failed to generate rule set asset for " + item);
status->result->error = err;

View File

@ -361,7 +361,11 @@ namespace NekoGui_sub {
int Node2Int(const fkyaml::node &n, const int &def = 0) {
try {
return n.as_int();
if (n.is_integer())
return n.as_int();
else if (n.is_string())
return atoi(n.as_str().c_str());
return def;
} catch (const fkyaml::exception &ex) {
qDebug() << ex.what();
return def;

View File

@ -518,6 +518,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
});
}
}
ui->data_view->setStyleSheet("background: transparent; border: none;");
}
void MainWindow::closeEvent(QCloseEvent *event) {