From 14ce944d976b868a487feeb2dfcbabc532ca7127 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Tue, 12 Aug 2025 17:25:30 +0800 Subject: [PATCH] chore: rename --- README.md | 2 +- include/configs/proxy/AnyTlsBean.hpp | 6 +++--- include/configs/proxy/WireguardBean.h | 6 +++--- include/configs/proxy/includes.h | 2 +- include/dataStore/ProxyEntity.hpp | 6 +++--- include/ui/profile/edit_anytls.h | 10 +++++----- include/ui/profile/edit_anytls.ui | 6 +++--- include/ui/profile/edit_wireguard.ui | 4 ++-- src/configs/proxy/Bean2CoreObj_box.cpp | 4 ++-- src/configs/proxy/Bean2Link.cpp | 6 +++--- src/configs/proxy/Json2Bean.cpp | 6 +++--- src/configs/proxy/Link2Bean.cpp | 4 ++-- src/configs/sub/GroupUpdater.cpp | 10 +++++----- src/dataStore/Database.cpp | 2 +- src/ui/profile/dialog_edit_profile.cpp | 2 +- src/ui/profile/edit_anytls.cpp | 14 +++++++------- src/ui/profile/edit_wireguard.cpp | 4 ++-- 17 files changed, 47 insertions(+), 47 deletions(-) diff --git a/README.md b/README.md index e625890..b1184f0 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Apple platforms have a very strict security policy and since Throne does not hav - TUIC - Hysteria - Hysteria2 -- AnyTls +- AnyTLS - Wireguard - SSH - Custom Outbound diff --git a/include/configs/proxy/AnyTlsBean.hpp b/include/configs/proxy/AnyTlsBean.hpp index 5aab7d9..cd14007 100644 --- a/include/configs/proxy/AnyTlsBean.hpp +++ b/include/configs/proxy/AnyTlsBean.hpp @@ -5,7 +5,7 @@ #include "Preset.hpp" namespace Configs { - class AnyTlsBean : public AbstractBean { + class AnyTLSBean : public AbstractBean { public: QString password = ""; int idle_session_check_interval = 30; @@ -14,7 +14,7 @@ namespace Configs { std::shared_ptr stream = std::make_shared(); - AnyTlsBean() : AbstractBean(0) { + AnyTLSBean() : AbstractBean(0) { _add(new configItem("password", &password, itemType::string)); _add(new configItem("idle_session_check_interval", &idle_session_check_interval, itemType::integer)); _add(new configItem("idle_session_timeout", &idle_session_timeout, itemType::integer)); @@ -22,7 +22,7 @@ namespace Configs { _add(new configItem("stream", dynamic_cast(stream.get()), itemType::jsonStore)); }; - QString DisplayType() override { return "AnyTls"; }; + QString DisplayType() override { return "AnyTLS"; }; CoreObjOutboundBuildResult BuildCoreObjSingBox() override; diff --git a/include/configs/proxy/WireguardBean.h b/include/configs/proxy/WireguardBean.h index 905468c..e3dea4e 100644 --- a/include/configs/proxy/WireguardBean.h +++ b/include/configs/proxy/WireguardBean.h @@ -15,8 +15,8 @@ namespace Configs { bool useSystemInterface = false; int workerCount = 0; - // Amenzia Options - bool enable_amenzia = false; + // Amnezia Options + bool enable_amnezia = false; int junk_packet_count; int junk_packet_min_size; int junk_packet_max_size; @@ -38,7 +38,7 @@ namespace Configs { _add(new configItem("use_system_proxy", &useSystemInterface, itemType::boolean)); _add(new configItem("worker_count", &workerCount, itemType::integer)); - _add(new configItem("enable_amenzia", &enable_amenzia, itemType::boolean)); + _add(new configItem("enable_amnezia", &enable_amnezia, itemType::boolean)); _add(new configItem("junk_packet_count", &junk_packet_count, itemType::integer)); _add(new configItem("junk_packet_min_size", &junk_packet_min_size, itemType::integer)); _add(new configItem("junk_packet_max_size", &junk_packet_max_size, itemType::integer)); diff --git a/include/configs/proxy/includes.h b/include/configs/proxy/includes.h index 2e7cc5d..61ba112 100644 --- a/include/configs/proxy/includes.h +++ b/include/configs/proxy/includes.h @@ -6,7 +6,7 @@ #include "VMessBean.hpp" #include "TrojanVLESSBean.hpp" #include "QUICBean.hpp" -#include "AnyTlsBean.hpp" +#include "AnyTLSBean.hpp" #include "WireguardBean.h" #include "SSHBean.h" #include "CustomBean.hpp" diff --git a/include/dataStore/ProxyEntity.hpp b/include/dataStore/ProxyEntity.hpp index 080c0e0..a0eb629 100644 --- a/include/dataStore/ProxyEntity.hpp +++ b/include/dataStore/ProxyEntity.hpp @@ -18,7 +18,7 @@ namespace Configs { class QUICBean; - class AnyTlsBean; + class AnyTLSBean; class WireguardBean; @@ -78,8 +78,8 @@ namespace Configs { return (Configs::QUICBean *) bean.get(); }; - [[nodiscard]] Configs::AnyTlsBean *AnyTlsBean() const { - return (Configs::AnyTlsBean *) bean.get(); + [[nodiscard]] Configs::AnyTLSBean *AnyTLSBean() const { + return (Configs::AnyTLSBean *) bean.get(); }; [[nodiscard]] Configs::WireguardBean *WireguardBean() const { diff --git a/include/ui/profile/edit_anytls.h b/include/ui/profile/edit_anytls.h index b1bea70..9c69fc6 100644 --- a/include/ui/profile/edit_anytls.h +++ b/include/ui/profile/edit_anytls.h @@ -6,23 +6,23 @@ QT_BEGIN_NAMESPACE namespace Ui { - class EditAnyTls; + class EditAnyTLS; } QT_END_NAMESPACE -class EditAnyTls : public QWidget, public ProfileEditor { +class EditAnyTLS : public QWidget, public ProfileEditor { Q_OBJECT public: - explicit EditAnyTls(QWidget *parent = nullptr); + explicit EditAnyTLS(QWidget *parent = nullptr); - ~EditAnyTls() override; + ~EditAnyTLS() override; void onStart(std::shared_ptr _ent) override; bool onEnd() override; private: - Ui::EditAnyTls *ui; + Ui::EditAnyTLS *ui; std::shared_ptr ent; }; diff --git a/include/ui/profile/edit_anytls.ui b/include/ui/profile/edit_anytls.ui index 95a5997..3463591 100644 --- a/include/ui/profile/edit_anytls.ui +++ b/include/ui/profile/edit_anytls.ui @@ -1,7 +1,7 @@ - EditAnyTls - + EditAnyTLS + 0 @@ -11,7 +11,7 @@ - EditAnyTls + EditAnyTLS diff --git a/include/ui/profile/edit_wireguard.ui b/include/ui/profile/edit_wireguard.ui index 4267af0..6bf0ed6 100644 --- a/include/ui/profile/edit_wireguard.ui +++ b/include/ui/profile/edit_wireguard.ui @@ -123,11 +123,11 @@ - Amenzia Settings + Amnezia Settings - + Enable diff --git a/src/configs/proxy/Bean2CoreObj_box.cpp b/src/configs/proxy/Bean2CoreObj_box.cpp index 89904a9..de3a33f 100644 --- a/src/configs/proxy/Bean2CoreObj_box.cpp +++ b/src/configs/proxy/Bean2CoreObj_box.cpp @@ -171,7 +171,7 @@ namespace Configs { return result; } - CoreObjOutboundBuildResult AnyTlsBean::BuildCoreObjSingBox() { + CoreObjOutboundBuildResult AnyTLSBean::BuildCoreObjSingBox() { CoreObjOutboundBuildResult result; QJsonObject outbound{ @@ -327,7 +327,7 @@ namespace Configs { {"system", useSystemInterface}, {"workers", workerCount} }; - if (enable_amenzia) + if (enable_amnezia) { outbound["junk_packet_count"] = junk_packet_count; outbound["junk_packet_min_size"] = junk_packet_min_size; diff --git a/src/configs/proxy/Bean2Link.cpp b/src/configs/proxy/Bean2Link.cpp index a2322f1..1afa4f2 100644 --- a/src/configs/proxy/Bean2Link.cpp +++ b/src/configs/proxy/Bean2Link.cpp @@ -23,7 +23,7 @@ namespace Configs { return url.toString(QUrl::FullyEncoded); } - QString AnyTlsBean::ToShareLink() { + QString AnyTLSBean::ToShareLink() { QUrl url; QUrlQuery query; url.setScheme("anytls"); @@ -300,9 +300,9 @@ namespace Configs { q.addQueryItem("use_system_interface", useSystemInterface ? "true":"false"); q.addQueryItem("local_address", localAddress.join("-")); q.addQueryItem("workers", Int2String(workerCount)); - if (enable_amenzia) + if (enable_amnezia) { - q.addQueryItem("enable_amenzia", "true"); + q.addQueryItem("enable_amnezia", "true"); q.addQueryItem("junk_packet_count", Int2String(junk_packet_count)); q.addQueryItem("junk_packet_min_size", Int2String(junk_packet_min_size)); q.addQueryItem("junk_packet_max_size", Int2String(junk_packet_max_size)); diff --git a/src/configs/proxy/Json2Bean.cpp b/src/configs/proxy/Json2Bean.cpp index cc5b771..8e57656 100644 --- a/src/configs/proxy/Json2Bean.cpp +++ b/src/configs/proxy/Json2Bean.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include "include/configs/proxy/ExtraCore.h" @@ -214,7 +214,7 @@ namespace Configs return true; } - bool AnyTlsBean::TryParseJson(const QJsonObject& obj) + bool AnyTLSBean::TryParseJson(const QJsonObject& obj) { name = obj["tag"].toString(); serverAddress = obj["server"].toString(); @@ -267,7 +267,7 @@ namespace Configs transport_packet_magic_header = obj["transport_packet_magic_header"].toInt(); if (junk_packet_count > 0 || junk_packet_min_size > 0 || junk_packet_max_size > 0) { - enable_amenzia = true; + enable_amnezia = true; } return true; diff --git a/src/configs/proxy/Link2Bean.cpp b/src/configs/proxy/Link2Bean.cpp index db5c854..4017ab3 100644 --- a/src/configs/proxy/Link2Bean.cpp +++ b/src/configs/proxy/Link2Bean.cpp @@ -42,7 +42,7 @@ namespace Configs { return !serverAddress.isEmpty(); } - bool AnyTlsBean::TryParseLink(const QString &link) { + bool AnyTLSBean::TryParseLink(const QString &link) { auto url = QUrl(link); if (!url.isValid()) return false; auto query = GetQuery(url); @@ -406,7 +406,7 @@ namespace Configs { useSystemInterface = query.queryItemValue("use_system_interface") == "true"; workerCount = query.queryItemValue("workers").toInt(); - enable_amenzia = query.queryItemValue("enable_amenzia") == "true"; + enable_amnezia = query.queryItemValue("enable_amnezia") == "true"; junk_packet_count = query.queryItemValue("junk_packet_count").toInt(); junk_packet_min_size = query.queryItemValue("junk_packet_min_size").toInt(); junk_packet_max_size = query.queryItemValue("junk_packet_max_size").toInt(); diff --git a/src/configs/sub/GroupUpdater.cpp b/src/configs/sub/GroupUpdater.cpp index e875ece..00be505 100644 --- a/src/configs/sub/GroupUpdater.cpp +++ b/src/configs/sub/GroupUpdater.cpp @@ -172,10 +172,10 @@ namespace Subscription { if (!ok) return; } - // AnyTls + // AnyTLS if (str.startsWith("anytls://")) { ent = Configs::ProfileManager::NewProxyEntity("anytls"); - auto ok = ent->AnyTlsBean()->TryParseLink(str); + auto ok = ent->AnyTLSBean()->TryParseLink(str); if (!ok) return; } @@ -297,10 +297,10 @@ namespace Subscription { if (!ok) continue; } - // AnyTls + // AnyTLS if (out["type"] == "anytls") { ent = Configs::ProfileManager::NewProxyEntity("anytls"); - auto ok = ent->AnyTlsBean()->TryParseJson(out); + auto ok = ent->AnyTLSBean()->TryParseJson(out); if (!ok) continue; } @@ -622,7 +622,7 @@ namespace Subscription { } } else if (type == "anytls") { needFix = true; - auto bean = ent->AnyTlsBean(); + auto bean = ent->AnyTLSBean(); bean->password = Node2QString(proxy["password"]); if (Node2Bool(proxy["tls"])) bean->stream->security = "tls"; if (Node2Bool(proxy["skip-cert-verify"])) bean->stream->allow_insecure = true; diff --git a/src/dataStore/Database.cpp b/src/dataStore/Database.cpp index a85d1fe..d796117 100644 --- a/src/dataStore/Database.cpp +++ b/src/dataStore/Database.cpp @@ -177,7 +177,7 @@ namespace Configs { } else if (type == "tuic") { bean = new Configs::QUICBean(Configs::QUICBean::proxy_TUIC); } else if (type == "anytls") { - bean = new Configs::AnyTlsBean(); + bean = new Configs::AnyTLSBean(); } else if (type == "wireguard") { bean = new Configs::WireguardBean(Configs::WireguardBean()); } else if (type == "ssh") { diff --git a/src/ui/profile/dialog_edit_profile.cpp b/src/ui/profile/dialog_edit_profile.cpp index 9bf146e..5566d19 100644 --- a/src/ui/profile/dialog_edit_profile.cpp +++ b/src/ui/profile/dialog_edit_profile.cpp @@ -236,7 +236,7 @@ void DialogEditProfile::typeSelected(const QString &newType) { innerWidget = _innerWidget; innerEditor = _innerWidget; } else if (type == "anytls") { - auto _innerWidget = new EditAnyTls(this); + auto _innerWidget = new EditAnyTLS(this); innerWidget = _innerWidget; innerEditor = _innerWidget; } else if (type == "wireguard") { diff --git a/src/ui/profile/edit_anytls.cpp b/src/ui/profile/edit_anytls.cpp index 4b4c97e..ca04e93 100644 --- a/src/ui/profile/edit_anytls.cpp +++ b/src/ui/profile/edit_anytls.cpp @@ -1,25 +1,25 @@ #include "include/ui/profile/edit_anytls.h" -#include "include/configs/proxy/AnyTlsBean.hpp" +#include "include/configs/proxy/AnyTLSBean.hpp" #include #include #include "include/global/GuiUtils.hpp" -EditAnyTls::EditAnyTls(QWidget *parent) : QWidget(parent), ui(new Ui::EditAnyTls) { +EditAnyTLS::EditAnyTLS(QWidget *parent) : QWidget(parent), ui(new Ui::EditAnyTLS) { ui->setupUi(this); ui->interval->setValidator(QRegExpValidator_Number); ui->timeout->setValidator(QRegExpValidator_Number); ui->min->setValidator(QRegExpValidator_Number); } -EditAnyTls::~EditAnyTls() { +EditAnyTLS::~EditAnyTLS() { delete ui; } -void EditAnyTls::onStart(std::shared_ptr _ent) { +void EditAnyTLS::onStart(std::shared_ptr _ent) { this->ent = _ent; - auto bean = this->ent->AnyTlsBean(); + auto bean = this->ent->AnyTLSBean(); ui->password->setText(bean->password); ui->interval->setText(Int2String(bean->idle_session_check_interval)); @@ -27,8 +27,8 @@ void EditAnyTls::onStart(std::shared_ptr _ent) { ui->min->setText(Int2String(bean->min_idle_session)); } -bool EditAnyTls::onEnd() { - auto bean = this->ent->AnyTlsBean(); +bool EditAnyTLS::onEnd() { + auto bean = this->ent->AnyTLSBean(); bean->password = ui->password->text(); bean->idle_session_check_interval = ui->interval->text().toInt(); diff --git a/src/ui/profile/edit_wireguard.cpp b/src/ui/profile/edit_wireguard.cpp index 19a8aa5..09eeaeb 100644 --- a/src/ui/profile/edit_wireguard.cpp +++ b/src/ui/profile/edit_wireguard.cpp @@ -29,7 +29,7 @@ void EditWireguard::onStart(std::shared_ptr _ent) { ui->local_addr->setText(bean->localAddress.join(",")); ui->workers->setText(Int2String(bean->workerCount)); - ui->enable_amenzia->setChecked(bean->enable_amenzia); + ui->enable_amnezia->setChecked(bean->enable_amnezia); ui->junk_packet_count->setText(Int2String(bean->junk_packet_count)); ui->junk_packet_min_size->setText(Int2String(bean->junk_packet_min_size)); ui->junk_packet_max_size->setText(Int2String(bean->junk_packet_max_size)); @@ -59,7 +59,7 @@ bool EditWireguard::onEnd() { bean->localAddress = ui->local_addr->text().replace(" ", "").split(","); bean->workerCount = ui->workers->text().toInt(); - bean->enable_amenzia = ui->enable_amenzia->isChecked(); + bean->enable_amnezia = ui->enable_amnezia->isChecked(); bean->junk_packet_count = ui->junk_packet_count->text().toInt(); bean->junk_packet_min_size = ui->junk_packet_min_size->text().toInt(); bean->junk_packet_max_size = ui->junk_packet_max_size->text().toInt();