Remove hysteria to sing-box generate

This commit is contained in:
arm64v8a
2023-04-09 12:07:54 +09:00
parent 8cb7e5a01d
commit 4fbb13248a
3 changed files with 1 additions and 26 deletions

View File

@@ -137,30 +137,6 @@ namespace NekoRay::fmt {
CoreObjOutboundBuildResult CustomBean::BuildCoreObjSingBox() { CoreObjOutboundBuildResult CustomBean::BuildCoreObjSingBox() {
CoreObjOutboundBuildResult result; CoreObjOutboundBuildResult result;
if (core == "hysteria") {
QJsonObject outbound{{"type", "hysteria"}};
outbound["server"] = serverAddress;
outbound["server_port"] = serverPort;
auto hy = QString2QJsonObject(config_simple);
QJSONOBJECT_COPY(hy, outbound, "up")
QJSONOBJECT_COPY(hy, outbound, "down")
QJSONOBJECT_COPY(hy, outbound, "up_mbps")
QJSONOBJECT_COPY(hy, outbound, "down_mbps")
QJSONOBJECT_COPY(hy, outbound, "obfs")
QJSONOBJECT_COPY(hy, outbound, "auth")
QJSONOBJECT_COPY(hy, outbound, "auth_str")
QJSONOBJECT_COPY(hy, outbound, "recv_window_conn")
QJSONOBJECT_COPY(hy, outbound, "recv_window_client")
QJSONOBJECT_COPY(hy, outbound, "disable_mtu_discovery")
QJsonObject tls{{"enabled", true}};
QJSONOBJECT_COPY(hy, tls, "server_name")
QJSONOBJECT_COPY(hy, tls, "alpn")
QJSONOBJECT_COPY(hy, tls, "insecure")
QJSONOBJECT_COPY2(hy, tls, "ca", "certificate_path")
outbound["tls"] = tls;
result.outbound = outbound;
}
if (core == "internal") { if (core == "internal") {
result.outbound = QString2QJsonObject(config_simple); result.outbound = QString2QJsonObject(config_simple);
} }

View File

@@ -33,7 +33,6 @@ namespace NekoRay::fmt {
int CustomBean::NeedExternal(bool isFirstProfile, bool isVPN) { int CustomBean::NeedExternal(bool isFirstProfile, bool isVPN) {
if (core == "internal") return 0; if (core == "internal") return 0;
if (IS_NEKO_BOX && core == "hysteria") return 0;
if (core == "hysteria") { if (core == "hysteria") {
if (isFirstProfile && !isVPN) { if (isFirstProfile && !isVPN) {
return 2; return 2;

View File

@@ -174,7 +174,7 @@ DialogBasicSettings::DialogBasicSettings(QWidget *parent)
// //
CACHE.extraCore = QString2QJsonObject(NekoRay::dataStore->extraCore->core_map); CACHE.extraCore = QString2QJsonObject(NekoRay::dataStore->extraCore->core_map);
if (!CACHE.extraCore.contains("naive")) CACHE.extraCore.insert("naive", ""); if (!CACHE.extraCore.contains("naive")) CACHE.extraCore.insert("naive", "");
if (!CACHE.extraCore.contains("hysteria") && !IS_NEKO_BOX) CACHE.extraCore.insert("hysteria", ""); if (!CACHE.extraCore.contains("hysteria")) CACHE.extraCore.insert("hysteria", "");
// //
auto extra_core_layout = ui->extra_core_box->layout(); auto extra_core_layout = ui->extra_core_box->layout();
for (const auto &s: CACHE.extraCore.keys()) { for (const auto &s: CACHE.extraCore.keys()) {