mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 13:50:12 +08:00
chore: Clean up
This commit is contained in:
parent
4bd744e03e
commit
8527fdde5f
1
3rdparty/qjs
vendored
1
3rdparty/qjs
vendored
@ -1 +0,0 @@
|
||||
Subproject commit 3fb0770c9ee5ab031a56072520641d4577b694e3
|
||||
@ -61,9 +61,6 @@ if (NKR_PACKAGE OR NKR_PACKAGE_MACOS)
|
||||
nkr_add_compile_definitions(NKR_CPP_USE_APPDATA)
|
||||
endif ()
|
||||
|
||||
add_subdirectory(3rdparty/qjs)
|
||||
list(APPEND NKR_EXTERNAL_TARGETS quickjs)
|
||||
|
||||
include("cmake/myproto.cmake")
|
||||
list(APPEND NKR_EXTERNAL_TARGETS myproto)
|
||||
|
||||
@ -85,7 +82,6 @@ set(PROJECT_SOURCES
|
||||
main/main.cpp
|
||||
main/NekoGui.cpp
|
||||
main/NekoGui_Utils.cpp
|
||||
main/QJS.cpp
|
||||
main/HTTPRequestHelper.cpp
|
||||
|
||||
3rdparty/base64.cpp
|
||||
|
||||
@ -1,128 +0,0 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
We as members, contributors, and leaders pledge to make participation in our
|
||||
community a harassment-free experience for everyone, regardless of age, body
|
||||
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||
identity and expression, level of experience, education, socio-economic status,
|
||||
nationality, personal appearance, race, religion, or sexual identity
|
||||
and orientation.
|
||||
|
||||
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||
diverse, inclusive, and healthy community.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to a positive environment for our
|
||||
community include:
|
||||
|
||||
* Demonstrating empathy and kindness toward other people
|
||||
* Being respectful of differing opinions, viewpoints, and experiences
|
||||
* Giving and gracefully accepting constructive feedback
|
||||
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||
and learning from the experience
|
||||
* Focusing on what is best not just for us as individuals, but for the
|
||||
overall community
|
||||
|
||||
## Examples of unacceptable behavior include:
|
||||
|
||||
* The use of sexualized language or imagery, and sexual attention or
|
||||
advances of any kind
|
||||
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or email
|
||||
address, without their explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Enforcement Responsibilities
|
||||
|
||||
Community leaders are responsible for clarifying and enforcing our standards of
|
||||
acceptable behavior and will take appropriate and fair corrective action in
|
||||
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||
or harmful.
|
||||
|
||||
Community leaders have the right and responsibility to remove, edit, or reject
|
||||
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||
decisions when appropriate.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all community spaces, and also applies when
|
||||
an individual is officially representing the community in public spaces.
|
||||
Examples of representing our community include using an official e-mail address,
|
||||
posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported to the community leaders responsible for enforcement at
|
||||
.
|
||||
All complaints will be reviewed and investigated promptly and fairly.
|
||||
|
||||
All community leaders are obligated to respect the privacy and security of the
|
||||
reporter of any incident.
|
||||
|
||||
## Enforcement Guidelines
|
||||
|
||||
Community leaders will follow these Community Impact Guidelines in determining
|
||||
the consequences for any action they deem in violation of this Code of Conduct:
|
||||
|
||||
### 1. Correction
|
||||
|
||||
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||
unprofessional or unwelcome in the community.
|
||||
|
||||
**Consequence**: A private, written warning from community leaders, providing
|
||||
clarity around the nature of the violation and an explanation of why the
|
||||
behavior was inappropriate. A public apology may be requested.
|
||||
|
||||
### 2. Warning
|
||||
|
||||
**Community Impact**: A violation through a single incident or series
|
||||
of actions.
|
||||
|
||||
**Consequence**: A warning with consequences for continued behavior. No
|
||||
interaction with the people involved, including unsolicited interaction with
|
||||
those enforcing the Code of Conduct, for a specified period of time. This
|
||||
includes avoiding interactions in community spaces as well as external channels
|
||||
like social media. Violating these terms may lead to a temporary or
|
||||
permanent ban.
|
||||
|
||||
### 3. Temporary Ban
|
||||
|
||||
**Community Impact**: A serious violation of community standards, including
|
||||
sustained inappropriate behavior.
|
||||
|
||||
**Consequence**: A temporary ban from any sort of interaction or public
|
||||
communication with the community for a specified period of time. No public or
|
||||
private interaction with the people involved, including unsolicited interaction
|
||||
with those enforcing the Code of Conduct, is allowed during this period.
|
||||
Violating these terms may lead to a permanent ban.
|
||||
|
||||
### 4. Permanent Ban
|
||||
|
||||
**Community Impact**: Demonstrating a pattern of violation of community
|
||||
standards, including sustained inappropriate behavior, harassment of an
|
||||
individual, or aggression toward or disparagement of classes of individuals.
|
||||
|
||||
**Consequence**: A permanent ban from any sort of public interaction within
|
||||
the community.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 2.0, available at
|
||||
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||
|
||||
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||
enforcement ladder](https://github.com/mozilla/diversity).
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see the FAQ at
|
||||
https://www.contributor-covenant.org/faq. Translations are available at
|
||||
https://www.contributor-covenant.org/translations.
|
||||
95
README_fa.md
95
README_fa.md
@ -1,95 +0,0 @@
|
||||
# NekoRay
|
||||
|
||||
مدیریت پیکربندی پروکسی با رابط کاربری مبتنی بر QT , کراس پلتفرم . (بک اند : v2ray / sing-box )
|
||||
|
||||
اکنون از Windows / Linux / macOS amd64 پشتیبانی می کند.
|
||||
|
||||
## دانلود / Download
|
||||
|
||||
### GitHub Releases (Portable ZIP)
|
||||
|
||||
فرمت قابل حمل، بدون نصب. برای دانلود باینری های از پیش کامپایل شده به Releases بروید، آنها را باز کرده و از آنها استفاده کنید.
|
||||
|
||||
[](https://github.com/Matsuridayo/nekoray/releases)
|
||||
|
||||
[Download](https://github.com/Matsuridayo/nekoray/releases)
|
||||
|
||||
### بسته
|
||||
|
||||
1. AUR [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) [](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yaml)
|
||||
2. Scoop Extras: `scoop install nekoray`
|
||||
3. Homebrew (unoffical): [homebrew-nekoray](https://github.com/tdjnodj/homebrew-nekoray)
|
||||
4. APT (unoffical): [tdjnodj/apt](https://github.com/tdjnodj/apt)
|
||||
|
||||
## تغییرات برنامه و کانال تلگرام / Changelog & Telegram Channel
|
||||
|
||||
https://t.me/Matsuridayo
|
||||
|
||||
## صفحه مستندات / Homepage & Documents
|
||||
|
||||
https://matsuridayo.github.io
|
||||
|
||||
## پروکسی / Proxy
|
||||
|
||||
- SOCKS (4/4a/5)
|
||||
- HTTP(S)
|
||||
- Shadowsocks
|
||||
- VMess
|
||||
- VLESS
|
||||
- Trojan
|
||||
- NaïveProxy ( Custom Core )
|
||||
- Hysteria ( Custom Core or sing-box )
|
||||
- Hysteria2 ( Custom Core or sing-box )
|
||||
- Custom Outbound
|
||||
- Custom Core
|
||||
|
||||
## اشتراک / Subscription
|
||||
|
||||
- فرمت های خام: برخی از فرمت های پرکاربرد (مانند Shadowsocks، Clash و v2rayN)
|
||||
|
||||
## پارامترهای عملیاتی
|
||||
|
||||
- `-many` نمونه در حال اجرا همان دایرکتوری را نادیده بگیرید و به اجبار یک نمونه جدید راه اندازی کنید(0.11+)
|
||||
- `-appdata` پس از باز کردن، فایل پیکربندی در دایرکتوری مشترک قرار می گیرد و نمی توان آن را بیشتر باز کرد و به طور خودکار ارتقا داد. (0.11+)
|
||||
|
||||
## Windows
|
||||
|
||||
اگر به شما می گوید که DLL وجود ندارد و نمی تواند اجرا شود، لطفاً [Microsoft C++ Runtime Library] (https://aka.ms/vs/17/release/vc_redist.x64.exe) را دانلود و نصب کنید.
|
||||
|
||||
## Linux
|
||||
|
||||
[آموزش اجرای لینوکس](docs/Run_Linux.md)
|
||||
|
||||
## آموزش کامپایل
|
||||
|
||||
[Linux](docs/Build_Linux_fa.md)
|
||||
|
||||
[Windows](docs/Build_Windows.md)
|
||||
|
||||
[macOs](docs/Build_MacOS_fa.md)
|
||||
|
||||
## کمک مالی / Donate
|
||||
|
||||
از کمک های مالی برای حمایت از توسعه پروژه استقبال می شود。
|
||||
|
||||
USDT TRC20
|
||||
|
||||
`TRhnA7SXE5Sap5gSG3ijxRmdYFiD4KRhPs`
|
||||
|
||||
XMR
|
||||
|
||||
`49bwESYQjoRL3xmvTcjZKHEKaiGywjLYVQJMUv79bXonGiyDCs8AzE3KiGW2ytTybBCpWJUvov8SjZZEGg66a4e59GXa6k5`
|
||||
|
||||
## Credits
|
||||
|
||||
- [v2fly/v2ray-core](https://github.com/v2fly/v2ray-core)
|
||||
- [MatsuriDayo/Matsuri](https://github.com/MatsuriDayo/Matsuri)
|
||||
- [MatsuriDayo/v2ray-core](https://github.com/MatsuriDayo/v2ray-core)
|
||||
- [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)
|
||||
- [yaml-cpp](https://github.com/jbeder/yaml-cpp)
|
||||
- [zxing-cpp](https://github.com/nu-book/zxing-cpp)
|
||||
- [QHotkey](https://github.com/Skycoder42/QHotkey)
|
||||
- [AppImageKit](https://github.com/AppImage/AppImageKit)
|
||||
123
README_ja.md
123
README_ja.md
@ -1,123 +0,0 @@
|
||||
# NekoRay / PC 用 NekoBox
|
||||
|
||||
QtベースのクロスプラットフォームGUIプロキシ設定マネージャ (バックエンド:v2ray / sing-box)
|
||||
|
||||
Windows / Linuxに対応。
|
||||
|
||||
## ダウンロード
|
||||
|
||||
### GitHub Releases (Portable ZIP)
|
||||
|
||||
Portable 形式、インストーラーなし。Releases からコンパイル済みバイナリをダウンロードし、解凍してお使いください。
|
||||
|
||||
[](https://github.com/Matsuridayo/nekoray/releases)
|
||||
|
||||
[ダウンロード](https://github.com/Matsuridayo/nekoray/releases)
|
||||
|
||||
[ダウンロードするパッケージがわからない場合のインストール方法](https://github.com/MatsuriDayo/nekoray/wiki/Installation-package-description)
|
||||
|
||||
### Package
|
||||
|
||||
#### AUR
|
||||
|
||||
- [nekoray](https://aur.archlinux.org/packages/nekoray)
|
||||
- [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) [](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yaml)
|
||||
|
||||
#### archlinuxcn
|
||||
|
||||
- [nekoray](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/nekoray)
|
||||
- [nekoray-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/nekoray-git)
|
||||
|
||||
#### Scoop Extras
|
||||
|
||||
`scoop install nekoray`
|
||||
|
||||
## Changelog と Telegram チャンネル
|
||||
|
||||
https://t.me/Matsuridayo
|
||||
|
||||
## ホームページとドキュメント
|
||||
|
||||
https://matsuridayo.github.io
|
||||
|
||||
## プロキシ
|
||||
|
||||
- SOCKS (4/4a/5)
|
||||
- HTTP(S)
|
||||
- Shadowsocks
|
||||
- VMess
|
||||
- VLESS
|
||||
- Trojan
|
||||
- TUIC ( sing-box )
|
||||
- NaïveProxy ( Custom Core )
|
||||
- Hysteria ( Custom Core or sing-box )
|
||||
- Hysteria2 ( Custom Core or sing-box )
|
||||
- Custom Outbound
|
||||
- Custom Config
|
||||
- Custom Core
|
||||
|
||||
## サブスクリプション
|
||||
|
||||
- Raw: 広く使われているいくつかのフォーマット (Shadowsocks、Clash、v2rayN など)
|
||||
|
||||
## 動作パラメーター
|
||||
|
||||
[動作パラメーター](docs/RunFlags.md)
|
||||
|
||||
## Windows 実行
|
||||
|
||||
DLL が見つからない場合は、[Microsoft C++ ランタイムライブラリ](https://aka.ms/vs/17/release/vc_redist.x64.exe)をダウンロードしてインストールしてください
|
||||
|
||||
## Linux 実行
|
||||
|
||||
[Linux 実行チュートリアル](docs/Run_Linux.md)
|
||||
|
||||
## macOS
|
||||
|
||||
メンテナンス不足のため、macOS 版はダウンロードできなくなりました。
|
||||
|
||||
また、以下のリポジトリで非公式に更新版を入手することもできる。[非公式リリース](https://github.com/aaaamirabbas/nekoray-macos/releases)
|
||||
|
||||
以下のチュートリアルを参考に、自分でコンパイルすることもできます。FAQ については歴史的な Issue を参照し、修正については Pull Request を歓迎します。
|
||||
|
||||
## コンパイルチュートリアル
|
||||
|
||||
[技術ドキュメント](https://github.com/MatsuriDayo/nekoray/tree/main/docs)を参照して下さい
|
||||
|
||||
## 寄付
|
||||
|
||||
このプロジェクトがあなたのお役に立つのであれば、寄付をすることでプロジェクトの継続を支援することができます。
|
||||
|
||||
50US ドル以上の寄付をされた方は、[寄付リスト](https://mtrdnt.pages.dev/donation_list)にアバターを表示することができます。ここに追加されていない場合は、ご連絡ください。
|
||||
|
||||
USDT TRC20
|
||||
|
||||
`TRhnA7SXE5Sap5gSG3ijxRmdYFiD4KRhPs`
|
||||
|
||||
XMR
|
||||
|
||||
`49bwESYQjoRL3xmvTcjZKHEKaiGywjLYVQJMUv79bXonGiyDCs8AzE3KiGW2ytTybBCpWJUvov8SjZZEGg66a4e59GXa6k5`
|
||||
|
||||
- また、[Google Play](https://play.google.com/store/apps/details?id=moe.nb4a) からも寄付金を購入することができます。アリペイと WeChat の購入オプションもありますので、TG チャンネルのトップをご覧ください。
|
||||
|
||||
## クレジット
|
||||
|
||||
Core:
|
||||
|
||||
- [v2fly/v2ray-core](https://github.com/v2fly/v2ray-core) ( < 3.10 )
|
||||
- [MatsuriDayo/Matsuri](https://github.com/MatsuriDayo/Matsuri) ( < 3.10 )
|
||||
- [MatsuriDayo/v2ray-core](https://github.com/MatsuriDayo/v2ray-core) ( < 3.10 )
|
||||
- [XTLS/Xray-core](https://github.com/XTLS/Xray-core) ( >= 3.10 )
|
||||
- [MatsuriDayo/Xray-core](https://github.com/MatsuriDayo/Xray-core) ( >= 3.10 )
|
||||
- [SagerNet/sing-box](https://github.com/SagerNet/sing-box)
|
||||
- [Matsuridayo/sing-box-extra](https://github.com/MatsuriDayo/sing-box-extra)
|
||||
|
||||
Gui:
|
||||
|
||||
- [Qv2ray](https://github.com/Qv2ray/Qv2ray)
|
||||
- [Qt](https://www.qt.io/)
|
||||
- [protobuf](https://github.com/protocolbuffers/protobuf)
|
||||
- [yaml-cpp](https://github.com/jbeder/yaml-cpp)
|
||||
- [zxing-cpp](https://github.com/nu-book/zxing-cpp)
|
||||
- [QHotkey](https://github.com/Skycoder42/QHotkey)
|
||||
- [AppImageKit](https://github.com/AppImage/AppImageKit)
|
||||
124
README_ru.md
124
README_ru.md
@ -1,124 +0,0 @@
|
||||
# NekoRay / NekoBox для ПК
|
||||
|
||||
Основанный на библиотеке Qt кросс-платформенный GUI менеджер для конфигурации прокси (на базе ядер: v2ray / sing-box)
|
||||
|
||||
Поддерживает Windows / Linux из коробки.
|
||||
|
||||
## Загрузить
|
||||
|
||||
### GitHub Релизы (Портативный ZIP-архив)
|
||||
|
||||
Портативный формат, без установщика. Перейдите в раздел Releases, чтобы загрузить готовые к использованию, предварительно скомпилированные двоичные пакеты.
|
||||
|
||||
[](https://github.com/Matsuridayo/nekoray/releases)
|
||||
|
||||
[Загрузить](https://github.com/Matsuridayo/nekoray/releases)
|
||||
|
||||
[Инструкция по установке пакета, если вы не знаете, какой из них загрузить (на китайском)](https://github.com/MatsuriDayo/nekoray/wiki/Installation-package-description)
|
||||
|
||||
### Пакеты
|
||||
|
||||
#### AUR
|
||||
|
||||
- [nekoray](https://aur.archlinux.org/packages/nekoray)
|
||||
- [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) [](https://github.com/MatsuriDayo/nekoray/actions/workflows/update-pkgbuild.yaml)
|
||||
|
||||
#### archlinuxcn
|
||||
|
||||
- [nekoray](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/nekoray)
|
||||
- [nekoray-git](https://github.com/archlinuxcn/repo/tree/master/archlinuxcn/nekoray-git)
|
||||
|
||||
#### Scoop Extras
|
||||
|
||||
`scoop install nekoray`
|
||||
|
||||
## Список изменений & Телеграм Канал
|
||||
|
||||
https://t.me/Matsuridayo
|
||||
|
||||
## Домашняя страница & Документация
|
||||
|
||||
https://matsuridayo.github.io
|
||||
|
||||
## Прокси
|
||||
|
||||
- SOCKS (4/4a/5)
|
||||
- HTTP(S)
|
||||
- Shadowsocks
|
||||
- VMess
|
||||
- VLESS
|
||||
- Trojan
|
||||
- TUIC ( sing-box )
|
||||
- NaïveProxy ( Пользовательское ядро )
|
||||
- Hysteria ( Пользовательское ядро или sing-box )
|
||||
- Hysteria2 ( Пользовательское ядро или sing-box )
|
||||
- Пользовательские Исходящие Запросы
|
||||
- Пользовательская Конфигурация
|
||||
- Пользовательское ядро
|
||||
|
||||
## Подписка
|
||||
|
||||
- Raw: некоторые широкоиспользуемые форматы (например, Shadowsocks, Clash и v2rayN)
|
||||
|
||||
## Параметры работы
|
||||
|
||||
[Параметры работы](docs/RunFlags.md)
|
||||
|
||||
## Запуск на Windows
|
||||
|
||||
Если появляется ошибка об отсутствии DLL или приложение не запускается, загрузите и установите [Библиотеки среды выполнения Microsoft C++](https://aka.ms/vs/17/release/vc_redist.x64.exe)
|
||||
|
||||
## Запуск на Linux
|
||||
|
||||
[Гайд по запуску на Linux (на китайском)](docs/Run_Linux.md)
|
||||
|
||||
## macOS
|
||||
|
||||
Из-за отсутствия поддержки версия для macOS больше не доступна для загрузки.
|
||||
|
||||
Вы также можете скачать неофициальные обновленные версии в репозитории ниже. [Неофициальные релизы](https://github.com/aaaamirabbas/nekoray-macos/releases)
|
||||
|
||||
Вы все еще можете обратиться к руководству ниже, чтобы скомпилировать самостоятельно.
|
||||
Пожалуйста, присмотритесь устаревшим релизам, чтобы узнать о распространенных проблемах. В случае обнаружения ошибок Pull Requests приветствуется для внесения исправлений.
|
||||
|
||||
## Гайд по компиляции
|
||||
|
||||
Обратите внимание на: [Техническую Документацию](https://github.com/MatsuriDayo/nekoray/tree/main/docs)
|
||||
|
||||
## Пожертвование
|
||||
|
||||
Если этот проект окажется для вас полезным, вы можете помочь нам и дальше разрабатывать его, сделав пожертвование.
|
||||
|
||||
Пожертвования в размере до 50 долларов США можно сделать на странице "Пожертвовать сейчас".[Список поддержавщих](https://mtrdnt.pages.dev/donation_list). Если вы не были добавлены сюда, не стесняйтесь связаться с нами.
|
||||
|
||||
USDT TRC20
|
||||
|
||||
`TRhnA7SXE5Sap5gSG3ijxRmdYFiD4KRhPs`
|
||||
|
||||
XMR
|
||||
|
||||
`49bwESYQjoRL3xmvTcjZKHEKaiGywjLYVQJMUv79bXonGiyDCs8AzE3KiGW2ytTybBCpWJUvov8SjZZEGg66a4e59GXa6k5`
|
||||
|
||||
- Донат через [Google Play](https://play.google.com/store/apps/details?id=moe.nb4a), используя банковскую карту.
|
||||
-
|
||||
## Авторы
|
||||
|
||||
Ядра:
|
||||
|
||||
- [v2fly/v2ray-core](https://github.com/v2fly/v2ray-core) ( < 3.10 )
|
||||
- [MatsuriDayo/Matsuri](https://github.com/MatsuriDayo/Matsuri) ( < 3.10 )
|
||||
- [MatsuriDayo/v2ray-core](https://github.com/MatsuriDayo/v2ray-core) ( < 3.10 )
|
||||
- [XTLS/Xray-core](https://github.com/XTLS/Xray-core) ( >= 3.10 )
|
||||
- [MatsuriDayo/Xray-core](https://github.com/MatsuriDayo/Xray-core) ( >= 3.10 )
|
||||
- [SagerNet/sing-box](https://github.com/SagerNet/sing-box)
|
||||
- [Matsuridayo/sing-box-extra](https://github.com/MatsuriDayo/sing-box-extra)
|
||||
|
||||
Gui:
|
||||
|
||||
- [Qv2ray](https://github.com/Qv2ray/Qv2ray)
|
||||
- [Qt](https://www.qt.io/)
|
||||
- [protobuf](https://github.com/protocolbuffers/protobuf)
|
||||
- [yaml-cpp](https://github.com/jbeder/yaml-cpp)
|
||||
- [zxing-cpp](https://github.com/nu-book/zxing-cpp)
|
||||
- [QHotkey](https://github.com/Skycoder42/QHotkey)
|
||||
- [AppImageKit](https://github.com/AppImage/AppImageKit)
|
||||
@ -2,7 +2,6 @@
|
||||
#include "db/Database.hpp"
|
||||
#include "fmt/includes.h"
|
||||
#include "fmt/Preset.hpp"
|
||||
#include "main/QJS.hpp"
|
||||
#include "rpc/gRPC.h"
|
||||
|
||||
#include <QApplication>
|
||||
@ -72,19 +71,6 @@ namespace NekoGui {
|
||||
// apply custom config
|
||||
MergeJson(QString2QJsonObject(ent->bean->custom_config), result->coreConfig);
|
||||
|
||||
// hook.js
|
||||
if (result->error.isEmpty() && !forTest) {
|
||||
auto source = qjs::ReadHookJS();
|
||||
if (!source.isEmpty()) {
|
||||
qjs::QJS js(source);
|
||||
auto js_result = js.EvalFunction("hook.hook_core_config", QJsonObject2QString(result->coreConfig, true));
|
||||
auto js_result_json = QString2QJsonObject(js_result);
|
||||
if (!js_result_json.isEmpty() && result->coreConfig != js_result_json) {
|
||||
MW_show_log("hook.js modified your " + software_core_name + " json config.");
|
||||
result->coreConfig = js_result_json;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
## 构建 nekoray_core & nekobox_core
|
||||
|
||||
### 目录结构
|
||||
|
||||
```
|
||||
| nekoray
|
||||
| go/cmd/*
|
||||
| Xray-core
|
||||
| sing-box-extra
|
||||
| sing-box
|
||||
| ......
|
||||
```
|
||||
|
||||
### 常规构建
|
||||
|
||||
1. `bash libs/get_source.sh` (自动下载目录结构,自动 checkout commit)
|
||||
2. `GOOS=windows GOARCH=amd64 bash libs/build_go.sh`
|
||||
|
||||
具体支持的 GOOS 和 GOARCH 请看 `libs/build_go.sh`
|
||||
|
||||
非官方构建无需编译 `updater` `launcher`
|
||||
|
||||
### sing-box tags
|
||||
|
||||
具体使用的 tags 请看 `libs/build_go.sh`
|
||||
@ -1,32 +0,0 @@
|
||||
## ساخت nekoray_core و nekobox_core
|
||||
|
||||
### ساختار دایرکتوری
|
||||
|
||||
```
|
||||
| nekoray
|
||||
| go/cmd/*
|
||||
| Xray-core
|
||||
| sing-box-extra
|
||||
| sing-box
|
||||
| ......
|
||||
```
|
||||
|
||||
### ساخت معمولی
|
||||
|
||||
1. `bash libs/get_source.sh `(دریافت خودکار ساختار دایرکتوری، خودکار checkout commit)
|
||||
2. `GOOS=windows GOARCH=amd64 bash libs/build_go.sh`
|
||||
|
||||
برای مشاهده GOOS و GOARCH های پشتیبانی شده به `libs/build_go.sh` مراجعه کنید.
|
||||
|
||||
در ساخت غیررسمی، نیازی به کامپایل `updater` و `launcher` نیست.
|
||||
|
||||
### تگهای sing-box
|
||||
|
||||
برای مشاهده تگهای استفاده شده به `libs/build_go.sh` مراجعه کنید.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,78 +0,0 @@
|
||||
在 Linux 下编译 Nekoray
|
||||
|
||||
## git clone 源码
|
||||
|
||||
```
|
||||
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
||||
```
|
||||
|
||||
## 简单编译法
|
||||
|
||||
条件:
|
||||
|
||||
1. C++ 依赖:`protobuf yaml-cpp zxing-cpp` 已用包管理器安装,并符合版本要求。
|
||||
2. 已安装 `qtbase` `qtsvg` `qttools` `qtx11extras`
|
||||
3. 已安装 Qt `5.12.x` 或 `5.15.x`
|
||||
4. 系统为 `x86-64-linux-gnu`
|
||||
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja ..
|
||||
ninja
|
||||
```
|
||||
|
||||
编译完成后得到 `nekoray`
|
||||
|
||||
解压 Release 的压缩包,替换其中的 `nekoray`,删除 `launcher` 即可使用。
|
||||
|
||||
## 复杂编译法
|
||||
|
||||
### CMake 参数
|
||||
|
||||
| CMake 参数 | 默认值 | 含义 |
|
||||
|-------------------|-------------------|-----------------------|
|
||||
| QT_VERSION_MAJOR | 5 | QT版本 |
|
||||
| NKR_NO_EXTERNAL | | 不包含外部 C/C++ 依赖 (以下所有) |
|
||||
| NKR_NO_YAML | | 不包含 yaml-cpp |
|
||||
| NKR_NO_QHOTKEY | | 不包含 qhotkey |
|
||||
| NKR_NO_ZXING | | 不包含 zxing |
|
||||
| NKR_NO_GRPC | | 不包含 gRPC |
|
||||
| NKR_NO_QUICKJS | | 不包含 quickjs |
|
||||
| NKR_PACKAGE | | 编译 package 版本 (aur) |
|
||||
| NKR_PACKAGE_MACOS | | 编译 macos 版本 |
|
||||
| NKR_LIBS | ./libs/deps/built | 依赖搜索目录 |
|
||||
| NKR_DISABLE_LIBS | | 禁用 NKR_LIBS |
|
||||
|
||||
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++ 部分
|
||||
|
||||
当您的发行版没有上面几个 C++ 依赖包,或者版本不符合要求时,可以参考 `build_deps_all.sh` 编译脚本自行编译。
|
||||
|
||||
条件: 已安装 Qt `5.12.x` 或 `5.15.x`
|
||||
|
||||
#### 编译安装 C/C++ 依赖
|
||||
|
||||
(这一步可能要挂梯)
|
||||
|
||||
```shell
|
||||
./libs/build_deps_all.sh
|
||||
```
|
||||
|
||||
#### 编译本体
|
||||
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja ..
|
||||
ninja
|
||||
```
|
||||
|
||||
编译完成后得到 `nekoray`
|
||||
|
||||
### Go 部分编译
|
||||
|
||||
请看 [Build_Core.md](./Build_Core.md)
|
||||
@ -1,74 +0,0 @@
|
||||
کامپایل کردن nekoray در لینوکس
|
||||
## کلون کردن کد با گیت
|
||||
```
|
||||
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
||||
```
|
||||
## روش کامپایل ساده
|
||||
|
||||
پیشنیازها:
|
||||
|
||||
1. وابستگیهای C++ به نامها: `protobuf yaml-cpp zxing-cpp` باید با مدیریت بسته نصب شده باشند و با نسخههای مورد نیاز سازگار باشند.
|
||||
2. باید `qtbase`، `qtsvg`، `qttools`، `qtx11extras` نصب شده باشد.
|
||||
3. Qt با نسخه `5.12.x` یا `5.15.x` باید نصب شده باشد.
|
||||
4. سیستم باید `x86-64-linux-gnu` باشد.
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja ..
|
||||
ninja
|
||||
```
|
||||
پس از کامپایل، فایل nekoray به دست میآید.
|
||||
|
||||
فایلهای فشرده را از Release استخراج کرده و nekoray را جایگزین کنید، سپس launcher را حذف کنید.
|
||||
|
||||
## روش دیگر کامپایل (پیشرفته)
|
||||
|
||||
|
||||
### پارامترهای CMake
|
||||
|
||||
| پارامتر CMake | مقدار پیشفرض | توضیح |
|
||||
|-------------------|-------------------|-----------------------|
|
||||
| QT_VERSION_MAJOR | 5 | نسخه QT |
|
||||
| NKR_NO_EXTERNAL | | شامل وابستگیهای خارجی C/C++ (همه زیرمجموعهها) نشود |
|
||||
| NKR_NO_YAML | | شامل yaml-cpp نشود |
|
||||
| NKR_NO_QHOTKEY | | شامل qhotkey نشود |
|
||||
| NKR_NO_ZXING | | شامل zxing نشود |
|
||||
| NKR_NO_GRPC | | شامل gRPC نشود |
|
||||
| NKR_NO_QUICKJS | | شامل quickjs نشود |
|
||||
| NKR_PACKAGE | | نسخهی بسته را کامپایل کنید (aur) |
|
||||
| NKR_PACKAGE_MACOS | | نسخهی macOS را کامپایل کنید |
|
||||
| NKR_LIBS | ./libs/deps/built | مسیر جستجوی وابستگیها |
|
||||
| NKR_DISABLE_LIBS | | وابستگیهای NKR_LIBS غیرفعال شود |
|
||||
|
||||
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++
|
||||
|
||||
اگر توزیع شما وابستگیهای C++ مورد نظر یا نسخه مورد نظر را نداشته باشد، میتوانید به اسکریپت کامپایل `build_deps_all.sh` مراجعه کرده و خودتان کامپایل کنید.
|
||||
|
||||
پیشنیازها: Qt با نسخه `5.12.x` یا `5.15.x` باید نصب شده باشد.
|
||||
|
||||
#### کامپایل و نصب وابستگیهای C/C++
|
||||
|
||||
(ممکن است به اتصال VPN نیاز داشته باشد)
|
||||
|
||||
```shell
|
||||
./libs/build_deps_all.sh
|
||||
```
|
||||
|
||||
#### کامپایل برنامه اصلی
|
||||
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja ..
|
||||
ninja
|
||||
```
|
||||
|
||||
پس از کامپایل، فایل `nekoray` به دست میآید.
|
||||
|
||||
### کامپایل بخش Go
|
||||
لطفاً به [Build_Core_fa.md](./Build_Core_fa.md) مراجعه کنید.
|
||||
@ -1,67 +0,0 @@
|
||||
提示:编译通过不代表所有功能可用,Tun 系统代理 这种功能大概率是不可用的。如果您懂得修复,我们欢迎您的 Pull Request。
|
||||
|
||||
Tip: Passing the compilation does not mean that all functions are available, and the function of Tun system proxy is probably not available. If you know how to fix it, we welcome your Pull Request.
|
||||
|
||||
## git clone 源码
|
||||
|
||||
```
|
||||
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
||||
```
|
||||
|
||||
## 先决条件
|
||||
|
||||
1. 安装 `CMake` `Ninja` `npm`
|
||||
2. 安装 Qt `5.15.x` 编译环境,并设置好有关环境变量,以免 CMake 找不到 Qt。 (`qtbase` `qtsvg` `qttools`)
|
||||
3. 安装 `appdmg` (`sudo npm install -g appdmg`)
|
||||
|
||||
## CMake 参数
|
||||
|
||||
同 Build_Linux
|
||||
|
||||
## C++ 部分
|
||||
|
||||
### 编译安装 C/C++ 依赖
|
||||
|
||||
(这一步可能要挂梯)
|
||||
|
||||
```shell
|
||||
./libs/build_deps_all.sh
|
||||
```
|
||||
|
||||
### 编译本体
|
||||
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 ..
|
||||
ninja
|
||||
```
|
||||
|
||||
### Go 部分编译
|
||||
|
||||
请看 [Build_Core.md](./Build_Core.md)
|
||||
|
||||
## 打包
|
||||
|
||||
如有疑问,请参考[这个脚本](https://github.com/MatsuriDayo/nekoray/blob/main/libs/deploy_macos.sh)
|
||||
|
||||
### 准备core
|
||||
|
||||
将 编译得到的 `nekoray_core` `nekobox_core` 放入 `build/nekoray.app/Contents/MacOS`
|
||||
|
||||
### 准备geo文件(可选)
|
||||
|
||||
```shell
|
||||
curl -Lso build/nekoray.app/Contents/MacOS/geoip.dat "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat"
|
||||
curl -Lso build/nekoray.app/Contents/MacOS/geosite.dat "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat"
|
||||
curl -Lso build/nekoray.app/Contents/MacOS/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db"
|
||||
curl -Lso build/nekoray.app/Contents/MacOS/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
|
||||
```
|
||||
|
||||
如果打包时没有包含geo文件,可在应用内设置 `v2ray资源路径` 代替。
|
||||
|
||||
### 在nekoray目录下打包
|
||||
|
||||
```shell
|
||||
appdmg appdmg.json /path/to/nekoray.dmg
|
||||
```
|
||||
@ -1,163 +0,0 @@
|
||||
Tip: Passing the compilation does not mean that all functions are available, and the function of Tun system proxy is probably not available. If you know how to fix it, we welcome your Pull Request.
|
||||
|
||||
## پروژه Nekoray را از منبع آن دریافت کنید
|
||||
در `Terminal` در مسیر دلخواه خود، دستور زیر را وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
||||
```
|
||||
اگر `git` روی دستگاه از پیش نصب نباشد، دستگاه، خودکار نصب آن را پیشنهاد میکند. مرحلههای نصب را به انجام برسانید و سپس دوباره دستور پیش گفته را در `Terminal` اجرا کنید.
|
||||
|
||||
سپس وارد پوشه `nekoray` شوید.
|
||||
برای کامپایل کردن پروژه، پیشنیازهای زیر را نصب کنید. برای این، دستور زیر را در `Terminal` وارد کنید و دکمه `Return` را بفشارید.
|
||||
|
||||
|
||||
```shell
|
||||
cd nekoray
|
||||
```
|
||||
<br>
|
||||
|
||||
## پیشنیازها
|
||||
|
||||
###۱. `CMake`
|
||||
|
||||
برای نصب `CMake` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
brew install cmake
|
||||
```
|
||||
اگر با خطای `zsh: command not found: brew` روبهرو شدید به این معنی است که `homebrew` در دستگاه شما نصب نیست. برای نصب آن نخست باید `XCode's command line tools` را نصب کنید. اگر به این مشکل برخورده اید، گام های `۱.۱`، `۱.۲` و `۱.۳` را دنبال کنید.
|
||||
|
||||
<br>
|
||||
|
||||
####۱.۱. نصب `XCode's command line tools`
|
||||
|
||||
دستور زیر را در `terminal` وادر کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
xcode-select --install
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
####۱.۲. نصب `homebrew`
|
||||
|
||||
دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
curl -fsSL -o install.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
####۱.۳. حال میتوانید با دستوری که پیشتر گفتیم، `CMake` را نصب کنید.
|
||||
|
||||
<br>
|
||||
|
||||
###۲. `Ninja`
|
||||
|
||||
برای نصب `Ninja` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
sudo port install ninja
|
||||
```
|
||||
اگر با خطای `sudo: port: command not found` روبهرو شدید، به این معنی است که `MacPorts` روی دستگاه شما نصب نیست. نسخه `MacPorts` متناسب با نسخه `macOs` خود را بارگری و نصب کنید. سپس بار دیگر، دستور نصب `Ninja` را در `terminal` وارد کرده و دکمه `return` را بفشارید.
|
||||
|
||||
<br>
|
||||
|
||||
###۳. `npm`
|
||||
|
||||
برای نصب `npm` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
brew install npm
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
###۴. `qtbase`
|
||||
|
||||
برای نصب `qtbase` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
sudo port install qt5-qtbase
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
###۵. `qtsvg`
|
||||
|
||||
برای نصب `qtsvg` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
sudo port install qt5-qtsvg
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
###۶. `qttools`
|
||||
|
||||
برای نصب `qttools` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
sudo port install qt5-qttools
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
###۷. `appdmg`
|
||||
|
||||
برای نصب `appdmg` دستور زیر را در `terminal` وارد کنید و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
sudo npm install -g appdmg
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## C++
|
||||
|
||||
### وابستگیهای C و ++C را کامپایل و نصب کنید.
|
||||
|
||||
دستور زیر را در `terminal` وارد کرده و دکمه `return` را بفشارید.
|
||||
|
||||
```shell
|
||||
./libs/build_deps_all.sh
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
### آنتولوژی را کامپایل کنید.
|
||||
|
||||
دستور زیر را در `terminal` وارد کرده و دکمه `return` را بفشارید.
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DNKR_PACKAGE_MACOS=1 ..
|
||||
ninja
|
||||
```
|
||||
|
||||
<br>
|
||||
|
||||
## هسته نرم افزار
|
||||
|
||||
### هسته نرم افزار را کامپایل کنید.
|
||||
|
||||
چگونگی کامپایل کردن هسته نرم افزار را [اینجا ](./Build_Core_fa.md)بخوانید.
|
||||
|
||||
<br>
|
||||
|
||||
### جایگذاری هسته
|
||||
|
||||
فایل کامپایل شده `nekoray_core` و `nekobox_core` را در مسیر زیر کپی کنید.
|
||||
`build/nekoray.app/Contents/MacOS`
|
||||
|
||||
<br>
|
||||
|
||||
## فایلهای جغرافی را تهیه کنید. (اختیاری)
|
||||
|
||||
اگر مایلید، با اجرای دستورهای زیر در `Terminal` فایل های جغرافی را تهیه کنید.
|
||||
|
||||
```shell
|
||||
curl -Lso build/nekoray.app/Contents/MacOS/geoip.dat "https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat"
|
||||
curl -Lso build/nekoray.app/Contents/MacOS/geosite.dat "https://github.com/v2fly/domain-list-community/releases/latest/download/dlc.dat"
|
||||
curl -Lso build/nekoray.app/Contents/MacOS/geoip.db "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db"
|
||||
curl -Lso build/nekoray.app/Contents/MacOS/geosite.db "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db"
|
||||
```
|
||||
<br>
|
||||
|
||||
## پایان کار
|
||||
|
||||
فایل اجرایی `Nekoray` در مسیر زیر قرار دارد. میتوانید آن را در مسیر دلخواه کپی کنید.
|
||||
|
||||
`مسیر پروژه Nekoray/build`
|
||||
@ -1,64 +0,0 @@
|
||||
在 Windows 下编译 Nekoray
|
||||
|
||||
### git clone 源码
|
||||
|
||||
```
|
||||
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
||||
```
|
||||
|
||||
### 安装 Visual Studio
|
||||
|
||||
从微软官网安装,可以使用 2019 和 2022 版本,安装 Win32 C++ 开发环境。
|
||||
|
||||
安装好后可以在「开始」菜单找到 `x64 Native Tools Command Prompt`
|
||||
|
||||
本文之后的命令均在该 cmd 内执行。`cmake` `ninja` 等工具使用 VS 自带的即可。
|
||||
|
||||
### 下载 Qt SDK
|
||||
|
||||
目前 Windows Release 使用的版本是 Qt 6.5.x
|
||||
|
||||
下载解压后,将 bin 目录添加到环境变量。
|
||||
|
||||
#### Release 编译用到的 Qt 包下载 (MSVC2019 x86_64)
|
||||
|
||||
https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt6.5.0-Windows-x86_64-VS2022-17.5.5-20230507.7z
|
||||
|
||||
#### 官方签名版 Qt 5.15.2 (可选,已知有内存泄漏的BUG)
|
||||
|
||||
在此下载 `qtbase` `qtsvg` `qttools` 的包并解压到同一个目录。
|
||||
|
||||
https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5152/qt.qt5.5152.win64_msvc2019_64/
|
||||
|
||||
### C++ 部分编译
|
||||
|
||||
#### 编译安装 C/C++ 依赖
|
||||
|
||||
(这一步可能要挂梯)
|
||||
|
||||
```shell
|
||||
bash ./libs/build_deps_all.sh
|
||||
```
|
||||
|
||||
目前只有 bash 脚本,没有批处理或 powershell,如果 Windows 没有带 bash 建议自行安装。
|
||||
|
||||
CMake 参数等细节与 Linux 大同小异,有问题可以参照 Build_Linux 文档。
|
||||
|
||||
#### 编译本体
|
||||
|
||||
请根据你的 QT Sdk 的位置替换命令
|
||||
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=D:/path/to/qt/5.15.2/msvc2019_64 ..
|
||||
ninja
|
||||
```
|
||||
|
||||
编译完成后得到 `nekoray.exe`
|
||||
|
||||
最后运行 `windeployqt nekoray.exe` 自动复制所需 DLL 等文件到当前目录
|
||||
|
||||
### Go 部分编译
|
||||
|
||||
请看 [Build_Core.md](./Build_Core.md)
|
||||
@ -1,65 +0,0 @@
|
||||
کامپایل Nekoray در ویندوز
|
||||
|
||||
### git clone
|
||||
|
||||
```
|
||||
git clone https://github.com/MatsuriDayo/nekoray.git --recursive
|
||||
```
|
||||
|
||||
### نصب Visual Studio
|
||||
|
||||
با نصب از وب سایت رسمی مایکروسافت، می توانید از نسخه های 2019 و 2022 استفاده کنید و محیط توسعه ++Win32 C را نصب کنید.
|
||||
|
||||
پس از نصب، میتوانید `x64 Native Tools Command Prompt` را در منوی «شروع» پیدا کنید.
|
||||
|
||||
دستورات زیر این مقاله همه در این cmd اجرا می شوند. `cmake` `ninja` و ابزارهای دیگر را می توان با VS استفاده کرد.
|
||||
|
||||
### دانلود Qt SDK
|
||||
|
||||
نسخه ای که در حال حاضر توسط Windows Release استفاده می شود Qt 6.5.x است.
|
||||
|
||||
پس از دانلود و خارج کردن از حالت ظش، پوشه bin را به environment variable اضافه کنید.
|
||||
|
||||
#### بسته Qt مورد استفاده برای کامپایل نسخه (MSVC2019 x86_64) را دانلود کنید
|
||||
|
||||
https://github.com/MatsuriDayo/nekoray_qt_runtime/releases/download/20220503/Qt6.5.0-Windows-x86_64-VS2022-17.5.5-20230507.7z
|
||||
|
||||
#### Official signed version of Qt 5.15.2 (optional, known memory leak bugs)
|
||||
|
||||
پکیج های `qtbase` `qtsvg` `qttools` را از اینجا دانلود کنید و آن را در همان دایرکتوری استخراج کنید.
|
||||
|
||||
https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt5_5152/qt.qt5.5152.win64_msvc2019_64/
|
||||
|
||||
### کامپایل جزئی ++c
|
||||
|
||||
#### وابستگی های مورد نیاز ++C/C را کامپایل و نصب کنید
|
||||
|
||||
(You may have to hang the ladder for this step)
|
||||
|
||||
```shell
|
||||
bash ./libs/build_deps_all.sh
|
||||
```
|
||||
|
||||
در حال حاضر فقط اسکریپت های bash وجود دارد، بدون پردازش دسته ای یا پاورشل، اگر ویندوز همراه bash نیست، توصیه می شود خودتان آن را نصب کنید.
|
||||
|
||||
جزئیاتی مانند پارامترهای CMake مشابه لینوکس است. اگر سوالی دارید، لطفاً به داکیومنت [Build_Linux_fa.md](./Build_Linux_fa.md) مراجعه کنید.
|
||||
|
||||
#### کامپایل کد اصلی
|
||||
|
||||
لطفاً دستورات را با موقعیت QT Sdk خود جایگزین کنید.
|
||||
|
||||
```shell
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=D:/path/to/qt/5.15.2/msvc2019_64 ..
|
||||
ninja
|
||||
```
|
||||
|
||||
بعد از اتمام کامپایل، فایل `nekoray.exe` را دریافت خواهید کرد.
|
||||
|
||||
سپس با اجرای دستور `windeployqt nekoray.exe`، فایلهای مورد نیاز مانند DLL به صورت خودکار در دایرکتوری فعلی کپی میشوند.
|
||||
|
||||
|
||||
### بخش کامپایل Go
|
||||
|
||||
لطفاً به [Build_Core_fa.md](./Build_Core_fa.md) مراجعه کنید.
|
||||
106
docs/HookJS.md
106
docs/HookJS.md
@ -1,106 +0,0 @@
|
||||
# hook.js 使用
|
||||
## 如何启用
|
||||
|
||||
1. 打开 `基本设置 - 安全 - 启用 hook.js 功能`
|
||||
2. js 代码请放置于 `config/hook.nekoray.js` 或 `config/hook.nekobox.js`
|
||||
|
||||
## 技术信息
|
||||
|
||||
* JS Engine: QuickJS ES2020
|
||||
* 提供的接口:如下面代码所示
|
||||
|
||||
## 示例代码 (typescript)
|
||||
|
||||
```ts
|
||||
const globalAny: any = globalThis
|
||||
|
||||
// 目前提供的方法
|
||||
interface nekoray_in {
|
||||
log(...a: any): void
|
||||
}
|
||||
|
||||
// 目前提供的 hook 点
|
||||
interface nekoray_hook {
|
||||
hook_core_config(config: string): string
|
||||
hook_tun_config(config: string): string
|
||||
hook_tun_script(script: string): string
|
||||
hook_import(content: string): string
|
||||
}
|
||||
|
||||
class my_hook implements nekoray_hook {
|
||||
private nekoray = globalAny.nekoray as nekoray_in
|
||||
|
||||
hook_core_config(config: string): string {
|
||||
var json = JSON.parse(config)
|
||||
var my_rule = {
|
||||
"geosite": "cn",
|
||||
"server": "dns-direct",
|
||||
"disable_cache": true
|
||||
}
|
||||
json["dns"]["rules"].push(my_rule)
|
||||
return JSON.stringify(json)
|
||||
}
|
||||
|
||||
hook_tun_config(config: string): string {
|
||||
return config // 返回输入,表示不修改
|
||||
}
|
||||
|
||||
hook_tun_script(script: string): string {
|
||||
console.log("Script") // 输出到 stdout
|
||||
this.nekoray.log("Script:", script) // 输出到日志
|
||||
return script
|
||||
}
|
||||
|
||||
hook_import(content: string): string {
|
||||
var newContent: Array<any> = []
|
||||
content.split("\n").forEach((line: any) => {
|
||||
if (line.startsWith("vmess://")) {
|
||||
newContent.push(line)
|
||||
}
|
||||
})
|
||||
return newContent.join("\n")
|
||||
}
|
||||
}
|
||||
|
||||
globalAny.hook = new my_hook
|
||||
```
|
||||
|
||||
## 示例代码 (javascript)
|
||||
|
||||
```js
|
||||
var globalAny = globalThis;
|
||||
var my_hook = /** @class */ (function () {
|
||||
function my_hook() {
|
||||
this.nekoray = globalAny.nekoray;
|
||||
}
|
||||
my_hook.prototype.hook_core_config = function (config) {
|
||||
var json = JSON.parse(config);
|
||||
var my_rule = {
|
||||
"geosite": "cn",
|
||||
"server": "dns-direct",
|
||||
"disable_cache": true
|
||||
};
|
||||
json["dns"]["rules"].push(my_rule);
|
||||
return JSON.stringify(json);
|
||||
};
|
||||
my_hook.prototype.hook_tun_config = function (config) {
|
||||
return config; // 返回输入,表示不修改
|
||||
};
|
||||
my_hook.prototype.hook_tun_script = function (script) {
|
||||
console.log("Script"); // 输出到 stdout
|
||||
this.nekoray.log("Script:", script); // 输出到日志
|
||||
return script;
|
||||
};
|
||||
my_hook.prototype.hook_import = function (content) {
|
||||
var newContent = [];
|
||||
content.split("\n").forEach(function (line) {
|
||||
if (line.startsWith("vmess://")) {
|
||||
newContent.push(line);
|
||||
}
|
||||
});
|
||||
return newContent.join("\n");
|
||||
};
|
||||
return my_hook;
|
||||
}());
|
||||
globalAny.hook = new my_hook;
|
||||
```
|
||||
@ -1,106 +0,0 @@
|
||||
# استفاده از فایل hook.js
|
||||
## فعالسازی
|
||||
|
||||
1. `Basic Settings - Security - Enable hook.js function` را روشن کنید
|
||||
2. کد JS را در `config/hook.nekoray.js` یا `config/hook.nekobox.js` قرار دهید.
|
||||
|
||||
## Technical Information
|
||||
|
||||
* JS engine: QuickJS ES2020.
|
||||
* Provided interfaces: as shown in the following code
|
||||
|
||||
## کد نمونه (typescript)
|
||||
|
||||
```ts
|
||||
const globalAny: any = globalThis
|
||||
|
||||
// روشهای ارائهشده در حال حاضر
|
||||
interface nekoray_in {
|
||||
log(...a: any): void
|
||||
}
|
||||
|
||||
// نقاط hook ارائهشده در حال حاضر
|
||||
interface nekoray_hook {
|
||||
hook_core_config(config: string): string
|
||||
hook_tun_config(config: string): string
|
||||
hook_tun_script(script: string): string
|
||||
hook_import(content: string): string
|
||||
}
|
||||
|
||||
class my_hook implements nekoray_hook {
|
||||
private nekoray = globalAny.nekoray as nekoray_in
|
||||
|
||||
hook_core_config(config: string): string {
|
||||
var json = JSON.parse(config)
|
||||
var my_rule = {
|
||||
"geosite": "cn",
|
||||
"server": "dns-direct",
|
||||
"disable_cache": true
|
||||
}
|
||||
json["dns"]["rules"].push(my_rule)
|
||||
return JSON.stringify(json)
|
||||
}
|
||||
|
||||
hook_tun_config(config: string): string {
|
||||
return config // بازگشت ورودی، نشان دهنده عدم تغییر
|
||||
}
|
||||
|
||||
hook_tun_script(script: string): string {
|
||||
console.log("Script") // خروجی به stdout
|
||||
this.nekoray.log("Script:", script) // خروجی به لاگ
|
||||
return script
|
||||
}
|
||||
|
||||
hook_import(content: string): string {
|
||||
var newContent: Array<any> = []
|
||||
content.split("\n").forEach((line: any) => {
|
||||
if (line.startsWith("vmess://")) {
|
||||
newContent.push(line)
|
||||
}
|
||||
})
|
||||
return newContent.join("\n")
|
||||
}
|
||||
}
|
||||
|
||||
globalAny.hook = new my_hook
|
||||
```
|
||||
|
||||
## کد نمونه (javascript)
|
||||
|
||||
```js
|
||||
var globalAny = globalThis;
|
||||
var my_hook = /** @class */ (function () {
|
||||
function my_hook() {
|
||||
this.nekoray = globalAny.nekoray;
|
||||
}
|
||||
my_hook.prototype.hook_core_config = function (config) {
|
||||
var json = JSON.parse(config);
|
||||
var my_rule = {
|
||||
"geosite": "cn",
|
||||
"server": "dns-direct",
|
||||
"disable_cache": true
|
||||
};
|
||||
json["dns"]["rules"].push(my_rule);
|
||||
return JSON.stringify(json);
|
||||
};
|
||||
my_hook.prototype.hook_tun_config = function (config) {
|
||||
return config; // بازگشت ورودی، نشان دهنده عدم تغییر
|
||||
};
|
||||
my_hook.prototype.hook_tun_script = function (script) {
|
||||
console.log("Script"); // خروجی به stdout
|
||||
this.nekoray.log("Script:", script); // خروجی به لاگ
|
||||
return script;
|
||||
};
|
||||
my_hook.prototype.hook_import = function (content) {
|
||||
var newContent = [];
|
||||
content.split("\n").forEach(function (line) {
|
||||
if (line.startsWith("vmess://")) {
|
||||
newContent.push(line);
|
||||
}
|
||||
});
|
||||
return newContent.join("\n");
|
||||
};
|
||||
return my_hook;
|
||||
}());
|
||||
globalAny.hook = new my_hook;
|
||||
```
|
||||
@ -1,5 +0,0 @@
|
||||
# 运行参数
|
||||
|
||||
- `-many` 无视同目录正在运行的实例,强行开启新的实例。
|
||||
- `-appdata` 开启后配置文件会指定目录,未指定目录则使用共享目录,无法多开和自动升级。
|
||||
- `-flag_reorder` 进行重新整理配置文件的顺序,并删除损坏和孤立的配置。
|
||||
@ -1,81 +0,0 @@
|
||||
## Linux 安装
|
||||
|
||||
### Debian 系发行版
|
||||
|
||||
使用 Debian 系发行版时,推荐使用 .deb 包安装:
|
||||
|
||||
```shell
|
||||
sudo apt install ./nekoray-*-debian-x64.deb
|
||||
```
|
||||
|
||||
安装完成后,桌面快捷方式启动自带参数 `-appdata`,如果想要直接启动并使用之前的配置,注意附带本参数。
|
||||
|
||||
### Arch 系发行版
|
||||
|
||||
使用 Arch 系发行版时,推荐从 ```aur``` 或 ```archlinuxcn``` 安装:
|
||||
|
||||
#### AUR
|
||||
##### 最新稳定版
|
||||
|
||||
```shell
|
||||
[yay/paru] -S nekoray
|
||||
```
|
||||
|
||||
##### 最新 Git 版 (开发版)
|
||||
|
||||
```shell
|
||||
[yay/paru] -S nekoray-git
|
||||
```
|
||||
|
||||
#### archlinuxcn
|
||||
|
||||
##### 最新稳定版
|
||||
|
||||
```shell
|
||||
sudo pacman -S nekoray
|
||||
```
|
||||
|
||||
##### 最新 Git 版 (开发版)
|
||||
|
||||
```shell
|
||||
sudo pacman -S nekoray-git
|
||||
```
|
||||
|
||||
### 其他发行版
|
||||
|
||||
下载 .zip 文件,解压到合适的路径,开箱即用。
|
||||
|
||||
或下载 .AppImage,并使用 `chmod +x nekoray-*-AppImage-x64.AppImage` 给予可执行权限。
|
||||
|
||||
具体使用方法见下文。
|
||||
|
||||
## Linux 运行
|
||||
|
||||
**使用 Linux 系统相信您已具备基本的排错能力,
|
||||
本项目不提供特定发行版/架构的支持,预编译文件不能满足您的需求时,请自行编译/适配。**
|
||||
|
||||
已知部分 Linux 发行版无法使用、非 x86_64 暂无适配,可以尝试自行编译。
|
||||
|
||||
目前 Release 便携包解压后,有两种使用方法:
|
||||
|
||||
1. System: 若要使用系统的 Qt5 运行库,请执行 `./nekoray`
|
||||
2. Bundle: 若要使用预编译的 Qt 运行库,请执行 `./launcher`
|
||||
|
||||
### Bundle
|
||||
|
||||
要求:已安装主流的发行版和 xcb 桌面环境。
|
||||
|
||||
运行: `./launcher` 或 部分系统可双击打开
|
||||
|
||||
launcher 参数
|
||||
|
||||
* `./launcher -- -appdata` ( `--` 后的参数传递给主程序 )
|
||||
* `-debug` Debug mode
|
||||
|
||||
Ubuntu 22.04: `sudo apt install libxcb-xinerama0`
|
||||
|
||||
### System
|
||||
|
||||
要求:已安装主流的发行版和 xcb 桌面环境,已安装 Qt5.12 ~ Qt5.15 环境。
|
||||
|
||||
运行: `./nekoray` 或 部分系统可双击打开。如果无法运行,建议使用 Bundle 版。
|
||||
@ -1,7 +0,0 @@
|
||||
# 技术文档
|
||||
|
||||
# Technical documentation
|
||||
|
||||
1. Build GUI: `Build_*.md`
|
||||
2. Build Core: `Build_Core.md`
|
||||
3. Hook.js usage: `HookJS.md`
|
||||
148
main/QJS.cpp
148
main/QJS.cpp
@ -1,148 +0,0 @@
|
||||
#include "QJS.hpp"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define JS_STRICT_NAN_BOXING
|
||||
#endif
|
||||
|
||||
#include "3rdparty/qjs/nekoray_qjs.h"
|
||||
#include "main/NekoGui.hpp"
|
||||
|
||||
namespace qjs {
|
||||
#ifndef NKR_NO_QUICKJS
|
||||
namespace exception {
|
||||
static void js_dump_obj(JSContext *ctx, QString &out, JSValueConst val) {
|
||||
const char *str;
|
||||
|
||||
str = JS_ToCString(ctx, val);
|
||||
if (str) {
|
||||
out.append(str);
|
||||
out.append('\n');
|
||||
JS_FreeCString(ctx, str);
|
||||
} else {
|
||||
out += "[exception]\n";
|
||||
}
|
||||
}
|
||||
|
||||
static void js_std_dump_error1(JSContext *ctx, QString &out, JSValueConst exception_val) {
|
||||
JSValue val;
|
||||
auto is_error = JS_IsError(ctx, exception_val);
|
||||
js_dump_obj(ctx, out, exception_val);
|
||||
if (is_error) {
|
||||
val = JS_GetPropertyStr(ctx, exception_val, "stack");
|
||||
if (!JS_IsUndefined(val)) {
|
||||
js_dump_obj(ctx, out, val);
|
||||
}
|
||||
JS_FreeValue(ctx, val);
|
||||
}
|
||||
}
|
||||
|
||||
QString js_std_dump_error(JSContext *ctx) {
|
||||
QString result;
|
||||
JSValue exception_val;
|
||||
|
||||
exception_val = JS_GetException(ctx);
|
||||
js_std_dump_error1(ctx, result, exception_val);
|
||||
JS_FreeValue(ctx, exception_val);
|
||||
|
||||
return result;
|
||||
}
|
||||
} // namespace exception
|
||||
|
||||
JSValue func_log(JSContext *ctx, JSValue this_val, int argc, JSValue *argv) {
|
||||
QString qString;
|
||||
|
||||
int i;
|
||||
const char *str;
|
||||
size_t len;
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
if (i != 0) qString.append(' ');
|
||||
str = JS_ToCStringLen(ctx, &len, argv[i]);
|
||||
if (!str)
|
||||
return JS_EXCEPTION;
|
||||
qString.append(str);
|
||||
JS_FreeCString(ctx, str);
|
||||
}
|
||||
|
||||
MW_show_log(qString);
|
||||
qDebug() << "func_log:" << qString;
|
||||
|
||||
return JS_UNDEFINED;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define NEKO_CTX ((nekoray_qjs_context *) this->neko_ctx)
|
||||
|
||||
QJS::QJS() {
|
||||
#ifndef NKR_NO_QUICKJS
|
||||
MW_show_log("loading quickjs......");
|
||||
//
|
||||
this->neko_ctx = malloc(sizeof(nekoray_qjs_context));
|
||||
nekoray_qjs_new_arg arg;
|
||||
arg.neko_ctx = NEKO_CTX;
|
||||
arg.enable_std = NekoGui::dataStore->enable_js_hook == 2 ? 1 : 0;
|
||||
arg.func_log = func_log;
|
||||
nekoray_qjs_new(arg);
|
||||
#endif
|
||||
}
|
||||
|
||||
QJS::QJS(const QByteArray &jsSource) : QJS() {
|
||||
this->Eval(jsSource);
|
||||
}
|
||||
|
||||
QJS::~QJS() {
|
||||
#ifndef NKR_NO_QUICKJS
|
||||
nekoray_qjs_free(NEKO_CTX);
|
||||
free(this->neko_ctx);
|
||||
#endif
|
||||
}
|
||||
|
||||
QString QJS::Eval(const QByteArray &jsSource) const {
|
||||
#ifndef NKR_NO_QUICKJS
|
||||
auto result = nekoray_qjs_eval(NEKO_CTX, jsSource.data(), jsSource.length());
|
||||
if (JS_IsException(result)) {
|
||||
MW_show_log(exception::js_std_dump_error(NEKO_CTX->ctx));
|
||||
return {};
|
||||
}
|
||||
auto cString = JS_ToCString(NEKO_CTX->ctx, result);
|
||||
QString qString(cString);
|
||||
JS_FreeCString(NEKO_CTX->ctx, cString);
|
||||
JS_FreeValue(NEKO_CTX->ctx, result);
|
||||
return qString;
|
||||
#else
|
||||
return {};
|
||||
#endif
|
||||
}
|
||||
|
||||
QString QJS::Eval(const QString &jsSource) const {
|
||||
return this->Eval(jsSource.toUtf8());
|
||||
}
|
||||
|
||||
QString QJS::EvalFile(const QString &jsPath) const {
|
||||
return this->Eval(ReadFile(jsPath));
|
||||
}
|
||||
|
||||
QString QJS::EvalFunction(const QString &funcName, const QString &arg) const {
|
||||
#ifndef NKR_NO_QUICKJS
|
||||
auto ba1 = arg.toUtf8();
|
||||
JSValue globalObj = JS_GetGlobalObject(NEKO_CTX->ctx);
|
||||
JSValue tempObj = JS_NewStringLen(NEKO_CTX->ctx, ba1.data(), ba1.length());
|
||||
JS_SetPropertyStr(NEKO_CTX->ctx, globalObj, "tempObj", tempObj);
|
||||
auto result = this->Eval(QString("%1(tempObj)").arg(funcName));
|
||||
JS_DeleteProperty(NEKO_CTX->ctx, globalObj, JS_NewAtom(NEKO_CTX->ctx, "tempObj"), 1); // Free tempObj
|
||||
JS_FreeValue(NEKO_CTX->ctx, globalObj);
|
||||
return result;
|
||||
#else
|
||||
return {};
|
||||
#endif
|
||||
}
|
||||
|
||||
QByteArray ReadHookJS() {
|
||||
#ifndef NKR_NO_QUICKJS
|
||||
if (NekoGui::dataStore->enable_js_hook > 0) {
|
||||
return ReadFile(QString("./hook.%1.js").arg(software_name.toLower()));
|
||||
}
|
||||
#endif
|
||||
return {};
|
||||
}
|
||||
} // namespace qjs
|
||||
23
main/QJS.hpp
23
main/QJS.hpp
@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class QByteArray;
|
||||
class QString;
|
||||
|
||||
namespace qjs {
|
||||
class QJS {
|
||||
public:
|
||||
QJS();
|
||||
explicit QJS(const QByteArray &jsSource);
|
||||
~QJS();
|
||||
|
||||
QString Eval(const QByteArray &jsSource) const;
|
||||
QString Eval(const QString &jsSource) const;
|
||||
QString EvalFile(const QString &jsPath) const;
|
||||
QString EvalFunction(const QString &funcName, const QString &arg) const;
|
||||
|
||||
private:
|
||||
void *neko_ctx;
|
||||
};
|
||||
|
||||
QByteArray ReadHookJS();
|
||||
} // namespace qjs
|
||||
@ -1,7 +1,6 @@
|
||||
#include "db/ProfileFilter.hpp"
|
||||
#include "fmt/includes.h"
|
||||
#include "fmt/Preset.hpp"
|
||||
#include "main/QJS.hpp"
|
||||
#include "main/HTTPRequestHelper.hpp"
|
||||
|
||||
#include "GroupUpdater.hpp"
|
||||
@ -649,17 +648,6 @@ namespace NekoGui_sub {
|
||||
}
|
||||
}
|
||||
|
||||
// hook.js
|
||||
auto source = qjs::ReadHookJS();
|
||||
if (!source.isEmpty()) {
|
||||
qjs::QJS js(source);
|
||||
auto js_result = js.EvalFunction("hook.hook_import", content);
|
||||
if (content != js_result) {
|
||||
MW_show_log("hook.js modified your import content.");
|
||||
content = js_result;
|
||||
}
|
||||
}
|
||||
|
||||
// 解析并添加 profile
|
||||
rawUpdater->update(content);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user