mirror of
https://github.com/asdlokj1qpi233/subconverter.git
synced 2026-11-03 18:24:58 +00:00
Fix the issue of Clash subscription password being numeric-only
This commit is contained in:
1 parent
4563be3d45
commit
0409830b3f
5 files changed
+15
-6
No files matched your search
@@ -5,7 +5,7 @@
|
|||||||
;For more available options, please check the readme section
|
;For more available options, please check the readme section
|
||||||
|
|
||||||
target=clash
|
target=clash
|
||||||
url=ss://Y2hhY2hhMjAtaWV0Zi1wb2x5MTMwNTpwYXNzd29yZA@www.example.com:1080#Example
|
url=trojan://65474277@sqcu.hostmsu.ru:55551?allowinsecure=0&peer=mza.hkfq.xyz&mux=1&ws=0&wspath=&wshost=&ss=0&ssmethod=aes-128-gcm&sspasswd=&group=#%E9%A6%99%E6%B8%AFCN2-MZA%E8%8A%82%E7%82%B9-%E5%AE%BF%E8%BF%81%E8%81%94%E9%80%9A%E4%B8%AD%E8%BD%AC
|
||||||
;config=config/example_external_config.ini
|
;config=config/example_external_config.ini
|
||||||
;ver=3
|
;ver=3
|
||||||
;udp=true
|
;udp=true
|
||||||
|
|||||||
@@ -666,13 +666,21 @@ std::string proxyToClash(std::vector<Proxy> &nodes, const std::string &base_conf
|
|||||||
|
|
||||||
std::string output_content = rulesetToClashStr(yamlnode, ruleset_content_array, ext.overwrite_original_rules,
|
std::string output_content = rulesetToClashStr(yamlnode, ruleset_content_array, ext.overwrite_original_rules,
|
||||||
ext.clash_new_field_name);
|
ext.clash_new_field_name);
|
||||||
output_content.insert(0, YAML::Dump(yamlnode));
|
std::string yamlnode_str = YAML::Dump(yamlnode);
|
||||||
|
output_content.insert(0, yamlnode_str);
|
||||||
//rulesetToClash(yamlnode, ruleset_content_array, ext.overwrite_original_rules, ext.clash_new_field_name);
|
//rulesetToClash(yamlnode, ruleset_content_array, ext.overwrite_original_rules, ext.clash_new_field_name);
|
||||||
//std::string output_content = YAML::Dump(yamlnode);
|
//std::string output_content = YAML::Dump(yamlnode);
|
||||||
|
replaceAll(output_content,"!<str> ","");
|
||||||
return output_content;
|
return output_content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void replaceAll(std::string& input, const std::string& search, const std::string& replace) {
|
||||||
|
size_t pos = 0;
|
||||||
|
while ((pos = input.find(search, pos)) != std::string::npos) {
|
||||||
|
input.replace(pos, search.length(), replace);
|
||||||
|
pos += replace.length();
|
||||||
|
}
|
||||||
|
}
|
||||||
// peer = (public-key = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=, allowed-ips = "0.0.0.0/0, ::/0", endpoint = engage.cloudflareclient.com:2408, client-id = 139/184/125),(public-key = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=, endpoint = engage.cloudflareclient.com:2408)
|
// peer = (public-key = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=, allowed-ips = "0.0.0.0/0, ::/0", endpoint = engage.cloudflareclient.com:2408, client-id = 139/184/125),(public-key = bmXOC+F1FxEMF9dyiK2H5/1SUtzH0JuVo51h2wPfgyo=, endpoint = engage.cloudflareclient.com:2408)
|
||||||
std::string generatePeer(Proxy &node, bool client_id_as_reserved = false) {
|
std::string generatePeer(Proxy &node, bool client_id_as_reserved = false) {
|
||||||
std::string result;
|
std::string result;
|
||||||
|
|||||||
@@ -72,5 +72,5 @@ std::string proxyToQuan(std::vector<Proxy> &nodes, const std::string &base_conf,
|
|||||||
void proxyToQuan(std::vector<Proxy> &nodes, INIReader &ini, std::vector<RulesetContent> &ruleset_content_array, const ProxyGroupConfigs &extra_proxy_group, extra_settings &ext);
|
void proxyToQuan(std::vector<Proxy> &nodes, INIReader &ini, std::vector<RulesetContent> &ruleset_content_array, const ProxyGroupConfigs &extra_proxy_group, extra_settings &ext);
|
||||||
std::string proxyToSSD(std::vector<Proxy> &nodes, std::string &group, std::string &userinfo, extra_settings &ext);
|
std::string proxyToSSD(std::vector<Proxy> &nodes, std::string &group, std::string &userinfo, extra_settings &ext);
|
||||||
std::string proxyToSingBox(std::vector<Proxy> &nodes, const std::string &base_conf, std::vector<RulesetContent> &ruleset_content_array, const ProxyGroupConfigs &extra_proxy_group, extra_settings &ext);
|
std::string proxyToSingBox(std::vector<Proxy> &nodes, const std::string &base_conf, std::vector<RulesetContent> &ruleset_content_array, const ProxyGroupConfigs &extra_proxy_group, extra_settings &ext);
|
||||||
|
void replaceAll(std::string& input, const std::string& search, const std::string& replace);
|
||||||
#endif // SUBEXPORT_H_INCLUDED
|
#endif // SUBEXPORT_H_INCLUDED
|
||||||
@@ -1031,7 +1031,7 @@ void explodeNetch(std::string netch, Proxy &node) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void explodeClash(Node yamlnode, std::vector<Proxy> &nodes) {
|
void explodeClash(Node yamlnode, std::vector<Proxy> &nodes) {
|
||||||
std::string proxytype, ps, server, port, cipher, group, password; //common
|
std::string proxytype, ps, server, port, cipher, group, password,tempPassword; //common
|
||||||
std::string type = "none", id, aid = "0", net = "tcp", path, host, edge, tls, sni; //vmess
|
std::string type = "none", id, aid = "0", net = "tcp", path, host, edge, tls, sni; //vmess
|
||||||
std::string fp = "chrome", pbk, sid; //vless
|
std::string fp = "chrome", pbk, sid; //vless
|
||||||
std::string plugin, pluginopts, pluginopts_mode, pluginopts_host, pluginopts_mux; //ss
|
std::string plugin, pluginopts, pluginopts_mode, pluginopts_host, pluginopts_mux; //ss
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ void explodeKitsunebi(std::string kit, Proxy &node);
|
|||||||
void explodeVless(std::string vless, Proxy &node);
|
void explodeVless(std::string vless, Proxy &node);
|
||||||
void explodeHysteria(std::string hysteria, Proxy &node);
|
void explodeHysteria(std::string hysteria, Proxy &node);
|
||||||
void explodeHysteria2(std::string hysteria2, Proxy &node);
|
void explodeHysteria2(std::string hysteria2, Proxy &node);
|
||||||
|
|
||||||
/// Parse a link
|
/// Parse a link
|
||||||
void explode(const std::string &link, Proxy &node);
|
void explode(const std::string &link, Proxy &node);
|
||||||
void explodeSSD(std::string link, std::vector<Proxy> &nodes);
|
void explodeSSD(std::string link, std::vector<Proxy> &nodes);
|
||||||
|
|||||||
Reference in new issue
Block a user