发现lean的广告屏蔽大师 Plus+不支持白名单,导致使用第三方规则anti-AD屏蔽微软同步

已经测试过在不走代理的IP里加入以下地址无效

1
2
3
activity.windows.com
edge.activity.windows.com
edge-enterprise.activity.windows.com

然后继续在自定义列表里,加入

1
2
3
@@||activity.windows.com^
@@||edge.activity.windows.com^
@@||edge-enterprise.activity.windows.com^

同样无效

终于发现,第三方规则是基于host的过滤规则
所以,目前看来,还是得对脚本下手。

查看lede/package/lean/luci-app-adbyby-plus/luasrc/controller/adbyby.lua源码,找到

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
function refresh_data()
local set =luci.http.formvalue("set")
local icount =0

if set == "rule_data" then
luci.sys.exec("/usr/share/adbyby/rule-update")
icount = luci.sys.exec("/usr/share/adbyby/rule-count '/tmp/rules/'")

if tonumber(icount)>0 then
if nixio.fs.access("/usr/share/adbyby/rules/") then
oldcount=luci.sys.exec("/usr/share/adbyby/rule-count '/usr/share/adbyby/rules/'")
else
oldcount=0
end
else
retstring ="-1"
end

原来是/usr/share/adbyby/rule-update这个脚本起作用
可惜我一开始修改的是/tmp/adbyby/rule-update这个脚本啊,晕死

好了,现在只需要把/usr/share/adbyby/rule-update这个脚本修改下就行了。

找到下面代码

1
2
3
4
5
6
7
8
9
10
if [ -f /tmp/adnew.conf ]; then
if (grep -wq "address=" /tmp/adnew.conf) ; then
cp /tmp/adnew.conf /tmp/rules/data/$rulename.conf
elif (grep -wq -e"0.0.0.0" -e"127.0.0.1" /tmp/adnew.conf) ; then
cp /tmp/adnew.conf /tmp/rules/host/$rulename.txt
else
cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/rules/data/$rulename.conf
sed -i '/activity.windows.com/d' /tmp/rules/data/$rulename.conf
fi
fi

cat /tmp/adnew.conf | grep ^\|\|[^\*]*\^$ | sed -e 's:||:address\=\/:' -e 's:\^:/0\.0\.0\.0:' > /tmp/rules/data/$rulename.conf这行下面增加一行

1
sed -i '/activity.windows.com/d' /tmp/rules/data/$rulename.conf

好吧我们来验证下,edge地址栏输入edge://sync-internals/Environment Info里查看 Server URL
20210910105343-2021-09-10