diff --git a/adblock-for-dnsmasq.conf b/adblock-for-dnsmasq.conf index 845da9e8..81800c3f 100644 --- a/adblock-for-dnsmasq.conf +++ b/adblock-for-dnsmasq.conf @@ -1,4 +1,4 @@ -#TIME=20200201054155 +#TIME=20200201061105 #URL=https://github.com/privacy-protection-tools/anti-AD address=/0024aaaa.com/ address=/0026645142c89aeb1.com/ diff --git a/anti-ad-easylist.txt b/anti-ad-easylist.txt index 696332eb..dc184351 100644 --- a/anti-ad-easylist.txt +++ b/anti-ad-easylist.txt @@ -1,4 +1,4 @@ -!TIME=20200201054155 +!TIME=20200201061105 !URL=https://github.com/privacy-protection-tools/anti-AD ||201*.myhard.com^ ||8*.tianya.cn^ @@ -33585,7 +33585,6 @@ ||zszgjiejuw.mobi^ ||zzasj.cn^ ||zzhssy.cn^ -@@||tongji.*kuwo.cn^ @@||ad.10010.com^ @@||ad.abchina.com^ @@||ad.filmweb.pl^ @@ -33600,3 +33599,5 @@ @@||ads.ultimatesurrender.com^ @@||widget.clipix.com^ @@||widget.myrentacar.me^ +@@||tongji.*kuwo.cn^ +@@||ntp.org^ diff --git a/anti-ad-surge.txt b/anti-ad-surge.txt index 46e1d137..412c38e2 100644 --- a/anti-ad-surge.txt +++ b/anti-ad-surge.txt @@ -1,4 +1,4 @@ -#TIME=20200201054155 +#TIME=20200201061105 #URL=https://github.com/privacy-protection-tools/anti-AD [RULE] DOMAIN-SUFFIX,0024aaaa.com,REJECT diff --git a/tools/easylist-extend.php b/tools/easylist-extend.php index 7dbd97ce..3484444d 100644 --- a/tools/easylist-extend.php +++ b/tools/easylist-extend.php @@ -89,8 +89,9 @@ $ARR_REGEX_LIST = array( //对通配符匹配或正则匹配增加的额外赦免规则 $ARR_WHITE_RULE_LIST = array( - '@@||github.com^', - '@@||tongji.*kuwo.cn^', + '@@||github.com^' => 0, + '@@||tongji.*kuwo.cn^' => 0, + '@@||ntp.org^' => 1, //针对上面正则表达式的一个赦免规则,例如:2.android.pool.ntp.org ); //针对上游赦免规则anti-AD不予赦免的规则,即赦免名单的黑名单 @@ -207,9 +208,10 @@ while(!feof($src_fp)){ //按需写入白名单规则 $wrote_whitelist = array(); -$whiterule = file(WHITERULE_SRC, FILE_SKIP_EMPTY_LINES); -$ARR_WHITE_RULE_LIST = array_merge($ARR_WHITE_RULE_LIST, $whiterule); -foreach($ARR_WHITE_RULE_LIST as $row){ +$whiterule = file(WHITERULE_SRC, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES); +$whiterule=array_fill_keys($whiterule, 0); +$ARR_WHITE_RULE_LIST = array_merge($whiterule, $ARR_WHITE_RULE_LIST); +foreach($ARR_WHITE_RULE_LIST as $row => $v){ if(empty($row) || $row{0} !== '@' || $row{1} !== '@'){ continue; } @@ -221,6 +223,11 @@ foreach($ARR_WHITE_RULE_LIST as $row){ if(array_key_exists("@@||${matches[1]}^", $ARR_WHITE_RULE_BLK_LIST)){ continue; } + if($v === 1){ + $wrote_whitelist[$matches[1]] = null; + fwrite($new_fp, "@@||${matches[1]}^\n"); + continue; + } foreach($wrote_wild as $core_str => $val){ if($core_str{0} === '/'){