mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2025-10-27 20:03:01 +00:00
fix singbox parser bug.(#4)
This commit is contained in:
@@ -2709,15 +2709,22 @@ void explodeSub(std::string sub, std::vector<Proxy> &nodes) {
|
||||
throw;
|
||||
}
|
||||
try {
|
||||
std::string pattern = "\"?(inbounds)\"?:";
|
||||
if (!processed &&
|
||||
regFind(sub, "^(?=.*(\"?(inbounds)\"?:))(?=.*(\"?(outbounds)\"?:))(?=.*(\"?(route)\"?:)).*")) {
|
||||
rapidjson::Document document;
|
||||
document.Parse(sub.c_str());
|
||||
if (!document.HasParseError() || document.IsObject()) {
|
||||
rapidjson::Value &value = document["outbounds"];
|
||||
if (value.IsArray() && !value.Empty()) {
|
||||
explodeSingbox(value, nodes);
|
||||
processed = true;
|
||||
regFind(sub, pattern)) {
|
||||
pattern = "\"?(outbounds)\"?:";
|
||||
if (regFind(sub, pattern)) {
|
||||
pattern = "\"?(route)\"?:";
|
||||
if (regFind(sub, pattern)) {
|
||||
rapidjson::Document document;
|
||||
document.Parse(sub.c_str());
|
||||
if (!document.HasParseError() || document.IsObject()) {
|
||||
rapidjson::Value &value = document["outbounds"];
|
||||
if (value.IsArray() && !value.Empty()) {
|
||||
explodeSingbox(value, nodes);
|
||||
processed = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user