feat: uid rule support for logic and rule-set

This commit is contained in:
adlyq
2022-05-22 13:07:07 +08:00
parent 948700eed6
commit 79469fc8d6
2 changed files with 14 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import (
"net/http"
"os"
"regexp"
"runtime"
"strings"
)
@ -104,6 +105,12 @@ func parseRule(tp, payload string, params []string) (C.Rule, error) {
case "RULE-SET":
noResolve := RC.HasNoResolve(params)
parsed, parseErr = provider.NewRuleSet(payload, "", noResolve)
case "UID":
if runtime.GOOS == "linux" || runtime.GOOS == "android" {
parsed, parseErr = RC.NewUid(payload, "")
} else {
parseErr = fmt.Errorf("uid rule not support this platform")
}
case "IN-TYPE":
parsed, parseErr = RC.NewInType(payload, "")
case "NOT":