Improve AdGuard rule-set parser

This commit is contained in:
Sukka
2025-06-15 17:55:07 +08:00
committed by 世界
parent c0588c30d7
commit fc0f5ed83a
3 changed files with 53 additions and 26 deletions

View File

@@ -5,7 +5,7 @@ import (
"os"
"strings"
"github.com/sagernet/sing-box/cmd/sing-box/internal/convertor/adguard"
"github.com/sagernet/sing-box/common/convertor/adguard"
"github.com/sagernet/sing-box/common/srs"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/log"
@@ -54,7 +54,7 @@ func convertRuleSet(sourcePath string) error {
var rules []option.HeadlessRule
switch flagRuleSetConvertType {
case "adguard":
rules, err = adguard.Convert(reader)
rules, err = adguard.Convert(reader, log.StdLogger())
case "":
return E.New("source type is required")
default: