mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-02 17:52:19 +00:00
Fix bugs
Fix a critical bug preventing Shadowsocks obfs-host to be read in Surge 2 subscription. Optimize codes.
This commit is contained in:
3 files changed
+10
-10
No files matched your search
+2
-2
@@ -40,11 +40,11 @@ std::string GetMember(const rapidjson::Value& value, std::string member)
|
|||||||
return retStr;
|
return retStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GetMember(const rapidjson::Value& value, std::string member, std::string* target)
|
void GetMember(const rapidjson::Value& value, std::string member, std::string& target)
|
||||||
{
|
{
|
||||||
std::string retStr = GetMember(value, member);
|
std::string retStr = GetMember(value, member);
|
||||||
if(retStr.size())
|
if(retStr.size())
|
||||||
target->assign(retStr);
|
target.assign(retStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string SerializeObject(const rapidjson::Value& value)
|
std::string SerializeObject(const rapidjson::Value& value)
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@
|
|||||||
void operator >> (const rapidjson::Value& value, std::string& i);
|
void operator >> (const rapidjson::Value& value, std::string& i);
|
||||||
void operator >> (const rapidjson::Value& value, int& i);
|
void operator >> (const rapidjson::Value& value, int& i);
|
||||||
std::string GetMember(const rapidjson::Value& value, std::string member);
|
std::string GetMember(const rapidjson::Value& value, std::string member);
|
||||||
void GetMember(const rapidjson::Value& value, std::string member, std::string* target);
|
void GetMember(const rapidjson::Value& value, std::string member, std::string& target);
|
||||||
std::string SerializeObject(const rapidjson::Value& value);
|
std::string SerializeObject(const rapidjson::Value& value);
|
||||||
|
|
||||||
#endif // RAPIDJSON_EXTRA_H_INCLUDED
|
#endif // RAPIDJSON_EXTRA_H_INCLUDED
|
||||||
+7
-7
@@ -163,7 +163,7 @@ void explodeVmess(std::string vmess, std::string custom_port, int local_port, no
|
|||||||
jsondata.Parse(vmess.data());
|
jsondata.Parse(vmess.data());
|
||||||
|
|
||||||
version = "1"; //link without version will treat as version 1
|
version = "1"; //link without version will treat as version 1
|
||||||
GetMember(jsondata, "v", &version); //try to get version
|
GetMember(jsondata, "v", version); //try to get version
|
||||||
|
|
||||||
jsondata["ps"] >> ps;
|
jsondata["ps"] >> ps;
|
||||||
jsondata["add"] >> add;
|
jsondata["add"] >> add;
|
||||||
@@ -391,11 +391,11 @@ void explodeSSD(std::string link, bool libev, std::string custom_port, int local
|
|||||||
jsondata["encryption"] >> method;
|
jsondata["encryption"] >> method;
|
||||||
jsondata["password"] >> password;
|
jsondata["password"] >> password;
|
||||||
jsondata["servers"][i]["server"] >> server;
|
jsondata["servers"][i]["server"] >> server;
|
||||||
GetMember(jsondata["servers"][i], "plugin", &plugin);
|
GetMember(jsondata["servers"][i], "plugin", plugin);
|
||||||
GetMember(jsondata["servers"][i], "plugin_options", &pluginopts);
|
GetMember(jsondata["servers"][i], "plugin_options", pluginopts);
|
||||||
GetMember(jsondata["servers"][i], "encryption", &method);
|
GetMember(jsondata["servers"][i], "encryption", method);
|
||||||
GetMember(jsondata["servers"][i], "port", &port);
|
GetMember(jsondata["servers"][i], "port", port);
|
||||||
GetMember(jsondata["servers"][i], "password", &password);
|
GetMember(jsondata["servers"][i], "password", password);
|
||||||
|
|
||||||
if(custom_port != "")
|
if(custom_port != "")
|
||||||
port = custom_port;
|
port = custom_port;
|
||||||
@@ -1105,7 +1105,7 @@ bool explodeSurge(std::string surge, std::string custom_port, int local_port, st
|
|||||||
plugin = "simple-obfs";
|
plugin = "simple-obfs";
|
||||||
pluginopts_mode = itemVal;
|
pluginopts_mode = itemVal;
|
||||||
}
|
}
|
||||||
else if(itemVal == "obfs-host")
|
else if(itemName == "obfs-host")
|
||||||
pluginopts_host = itemVal;
|
pluginopts_host = itemVal;
|
||||||
}
|
}
|
||||||
if(plugin != "")
|
if(plugin != "")
|
||||||
|
|||||||
Reference in new issue
Block a user