Fix not exporting load-balance group for Surge configurations.
Fix password missing when parsing Quantumult X configurations.
This commit is contained in:
Tindy X
2020-03-23 15:42:51 +08:00
parent cb218b6329
commit e99e836ad5
2 changed files with 4 additions and 1 deletions

View File

@@ -1325,7 +1325,7 @@ bool explodeSurge(std::string surge, const std::string &custom_port, int local_p
switch(hash_(itemName))
{
case "method"_hash: method = itemVal; break;
case "password"_hash: id = itemVal; break;
case "password"_hash: password = itemVal; break;
case "tag"_hash: remarks = itemVal; break;
case "ssr-protocol"_hash: protocol = itemVal; break;
case "ssr-protocol-param"_hash: protoparam = itemVal; break;

View File

@@ -1221,6 +1221,7 @@ std::string netchToSurge(std::vector<nodeInfo> &nodes, std::string &base_conf, s
break;
case "url-test"_hash:
case "fallback"_hash:
case "load-balance"_hash:
if(rules_upper_bound < 5)
continue;
rules_upper_bound -= 2;
@@ -1258,6 +1259,8 @@ std::string netchToSurge(std::vector<nodeInfo> &nodes, std::string &base_conf, s
});
if(vArray[1] == "url-test" || vArray[1] == "fallback")
proxy += ",url=" + url + ",interval=" + std::to_string(interval);
else if(vArray[1] == "load-balance")
proxy += ",url=" + url;
ini.Set("{NONAME}", vArray[0] + " = " + proxy); //insert order
}