feat: 安卓恢复进程规则,可通过enable-process开关,默认true

This commit is contained in:
adlyq
2022-05-19 20:43:41 +08:00
parent fe25ae83df
commit cc1c1340a3
11 changed files with 280 additions and 29 deletions

View File

@ -3,9 +3,11 @@ package rules
import (
"fmt"
C "github.com/Dreamacro/clash/constant"
"github.com/Dreamacro/clash/log"
RC "github.com/Dreamacro/clash/rule/common"
"github.com/Dreamacro/clash/rule/logic"
RP "github.com/Dreamacro/clash/rule/provider"
"runtime"
)
func ParseRule(tp, payload, target string, params []string) (C.Rule, error) {
@ -42,7 +44,11 @@ func ParseRule(tp, payload, target string, params []string) (C.Rule, error) {
case "NETWORK":
parsed, parseErr = RC.NewNetworkType(payload, target)
case "UID":
parsed, parseErr = RC.NewUid(payload, target)
if runtime.GOOS == "linux" || runtime.GOOS == "android" {
parsed, parseErr = RC.NewUid(payload, target)
} else {
log.Warnln("uid rule not support this platform")
}
case "AND":
parsed, parseErr = logic.NewAND(payload, target)
case "OR":