Enhancements

Fix a bug that Clash may interpret pure number password as float64 type (Issue [#58](https://github.com/tindy2013/subconverter/issues/58)).
Fix support for parsing some non-standard Clash configurations.
Add generator-only mode to save configurations to files or upload to Gists.
Optimize codes.
Fix typo.
This commit is contained in:
Tindy X committed 2020-02-23 15:49:16 +08:00
1 parent c51affc3cc
commit ac0dedecf0
7 files changed
+151 -53

No files matched your search

+8
View File
@@ -655,6 +655,8 @@ void netchToClash(std::vector<nodeInfo> &nodes, YAML::Node &yamlnode, string_arr
singleproxy["type"] = "ss";
singleproxy["cipher"] = method;
singleproxy["password"] = password;
if(std::all_of(password.begin(), password.end(), ::isdigit))
singleproxy["password"].SetTag("str");
if(plugin == "simple-obfs" || plugin == "obfs-local")
{
singleproxy["plugin"] = "obfs";
@@ -724,6 +726,8 @@ void netchToClash(std::vector<nodeInfo> &nodes, YAML::Node &yamlnode, string_arr
singleproxy["type"] = "ssr";
singleproxy["cipher"] = method;
singleproxy["password"] = password;
if(std::all_of(password.begin(), password.end(), ::isdigit))
singleproxy["password"].SetTag("str");
singleproxy["protocol"] = protocol;
singleproxy["protocolparam"] = protoparam;
singleproxy["obfs"] = obfs;
@@ -733,6 +737,8 @@ void netchToClash(std::vector<nodeInfo> &nodes, YAML::Node &yamlnode, string_arr
singleproxy["type"] = "socks5";
singleproxy["username"] = username;
singleproxy["password"] = password;
if(std::all_of(password.begin(), password.end(), ::isdigit))
singleproxy["password"].SetTag("str");
if(ext.skip_cert_verify)
singleproxy["skip-cert-verify"] = true;
break;
@@ -740,6 +746,8 @@ void netchToClash(std::vector<nodeInfo> &nodes, YAML::Node &yamlnode, string_arr
singleproxy["type"] = "http";
singleproxy["username"] = username;
singleproxy["password"] = password;
if(std::all_of(password.begin(), password.end(), ::isdigit))
singleproxy["password"].SetTag("str");
singleproxy["tls"] = type == "HTTPS";
if(ext.skip_cert_verify)
singleproxy["skip-cert-verify"] = true;