diff --git a/include/global/Const.hpp b/include/global/Const.hpp index 85489b4..c395ea4 100644 --- a/include/global/Const.hpp +++ b/include/global/Const.hpp @@ -26,7 +26,7 @@ namespace Configs { namespace Information { inline QString HijackInfo = "Listens on the given addr:port (on Windows, port is always 53) and redirects the requests to the DNS module. Domains that match the rules will have their requests hijacked and the A and AAAA queries will be responded with the Inet4 response and Inet6 response respectively.\nThe Redirect settings sets up an inbound that listens on the given addr:port, sniffs the destination if possible and redirects the requests to their true destination.\nThe use case of these settings is apps that do not respect the system proxy for resolving their DNS requests (one such example is discord), You can hijack their DNS requests to 127.0.0.1 and then route them through the Throne tunnel. The same effect could be achieved using Tun mode, but one may not want to tunnel the whole device (For example when Gaming), this is where DNS hijack can transparently handle things.\n\nCurrently you can Automatically set the System DNS in windows."; - inline QString SimpleRuleInfo = "You can add rules with the following format:\ndomain:\nsuffix:\nkeyword:\nregex:\nruleset:\nip:\nprocessName:\nprocessPath:\nRules are validated on tab change or when pressing ok.\nImportant: On saving the rules, the previous rules are discarded, meaning\nany changes made to the generated rules in the Advanced tab will be lost."; + inline QString SimpleRuleInfo = "You can add rules with the following format:\ndomain:\nsuffix:\nkeyword:\nregex:\nruleset: or ruleset:\nip:\nprocessName:\nprocessPath:\nRules are validated on tab change or when pressing ok.\nImportant: On saving the rules, the previous rules are discarded, meaning\nany changes made to the generated rules in the Advanced tab will be lost."; } namespace GeoAssets { diff --git a/src/dataStore/RouteEntity.cpp b/src/dataStore/RouteEntity.cpp index f99c6ba..6c2a473 100644 --- a/src/dataStore/RouteEntity.cpp +++ b/src/dataStore/RouteEntity.cpp @@ -838,10 +838,10 @@ namespace Configs { bool RoutingChain::add_simple_address_rule(const QString& content, const std::shared_ptr& rule) { - auto sp = content.split(":"); - if (sp.size() != 2) return false; - const QString& address = sp[1]; - const QString& subType = sp[0]; + auto colonIdx = content.indexOf(':'); + if (colonIdx == -1) return false; + const QString& address = content.mid(colonIdx+1); + const QString& subType = content.left(colonIdx); if (subType == "domain") { if (!rule->domain.contains(address)) rule->domain.append(address); return true; diff --git a/src/ui/setting/RouteItem.cpp b/src/ui/setting/RouteItem.cpp index e538df0..46b93ec 100644 --- a/src/ui/setting/RouteItem.cpp +++ b/src/ui/setting/RouteItem.cpp @@ -124,7 +124,7 @@ RouteItem::RouteItem(QWidget *parent, const std::shared_ptrdef_out->setCurrentText(Configs::outboundIDToString(chain->defaultOutboundID)); // simple rules setup - QStringList ruleItems = {"domain:", "suffix:", "regex:", "keyword:", "ip:", "processName:", "processPath:"}; + QStringList ruleItems = {"domain:", "suffix:", "regex:", "keyword:", "ip:", "processName:", "processPath:", "ruleset:"}; for (const auto& geoIP : geoIpList) { ruleItems.append("ruleset:"+geoIP); }