mirror of
https://github.com/Mahdi-zarei/nekoray.git
synced 2025-12-19 05:30:06 +08:00
commit
45ce180932
@ -785,17 +785,18 @@ namespace Configs {
|
||||
bool RoutingChain::add_simple_process_rule(const QString& content, const std::shared_ptr<RouteRule>& rule, ruleType type)
|
||||
{
|
||||
auto sp = content.split(":");
|
||||
if (sp.size() != 2) return false;
|
||||
const QString& address = sp[1];
|
||||
if (sp.size() < 2) return false;
|
||||
const QString& subType = sp[0];
|
||||
if (subType == "processName" && type == simpleProcessName)
|
||||
{
|
||||
if (!rule->process_name.contains(address)) rule->process_name.append(address);
|
||||
return true;
|
||||
} else if (subType == "processPath" && type == simpleProcessPath)
|
||||
if (subType == "processPath" && type == simpleProcessPath)
|
||||
{
|
||||
const QString& address = content.section(':', 1);
|
||||
if (!rule->process_path.contains(address)) rule->process_path.append(address);
|
||||
return true;
|
||||
} else if (subType == "processName" && type == simpleProcessName && sp.size() == 2)
|
||||
{
|
||||
const QString& address = sp[1];
|
||||
if (!rule->process_name.contains(address)) rule->process_name.append(address);
|
||||
return true;
|
||||
} else
|
||||
{
|
||||
return false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user