chore: rename

This commit is contained in:
parhelia512 2025-08-12 17:25:30 +08:00
parent 027b5e748f
commit 14ce944d97
17 changed files with 47 additions and 47 deletions

View File

@ -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

View File

@ -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<V2rayStreamSettings> stream = std::make_shared<V2rayStreamSettings>();
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<JsonStore *>(stream.get()), itemType::jsonStore));
};
QString DisplayType() override { return "AnyTls"; };
QString DisplayType() override { return "AnyTLS"; };
CoreObjOutboundBuildResult BuildCoreObjSingBox() override;

View File

@ -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));

View File

@ -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"

View File

@ -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 {

View File

@ -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<Configs::ProxyEntity> _ent) override;
bool onEnd() override;
private:
Ui::EditAnyTls *ui;
Ui::EditAnyTLS *ui;
std::shared_ptr<Configs::ProxyEntity> ent;
};

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>EditAnyTls</class>
<widget class="QWidget" name="EditAnyTls">
<class>EditAnyTLS</class>
<widget class="QWidget" name="EditAnyTLS">
<property name="geometry">
<rect>
<x>0</x>
@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string notr="true">EditAnyTls</string>
<string notr="true">EditAnyTLS</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">

View File

@ -123,11 +123,11 @@
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Amenzia Settings</string>
<string>Amnezia Settings</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QCheckBox" name="enable_amenzia">
<widget class="QCheckBox" name="enable_amnezia">
<property name="text">
<string>Enable</string>
</property>

View File

@ -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;

View File

@ -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));

View File

@ -5,7 +5,7 @@
#include <include/configs/proxy/SocksHttpBean.hpp>
#include <include/configs/proxy/TrojanVLESSBean.hpp>
#include <include/configs/proxy/VMessBean.hpp>
#include <include/configs/proxy/AnyTlsBean.hpp>
#include <include/configs/proxy/AnyTLSBean.hpp>
#include <include/configs/proxy/WireguardBean.h>
#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;

View File

@ -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();

View File

@ -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;

View File

@ -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") {

View File

@ -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") {

View File

@ -1,25 +1,25 @@
#include "include/ui/profile/edit_anytls.h"
#include "include/configs/proxy/AnyTlsBean.hpp"
#include "include/configs/proxy/AnyTLSBean.hpp"
#include <QUuid>
#include <QRegularExpressionValidator>
#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<Configs::ProxyEntity> _ent) {
void EditAnyTLS::onStart(std::shared_ptr<Configs::ProxyEntity> _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<Configs::ProxyEntity> _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();

View File

@ -29,7 +29,7 @@ void EditWireguard::onStart(std::shared_ptr<Configs::ProxyEntity> _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();