mirror of
https://github.com/privacy-protection-tools/anti-AD.git
synced 2025-02-02 19:53:02 +08:00
update wildcard white list. fiexd #24
This commit is contained in:
parent
1303bc96ab
commit
8f0f2b02e5
@ -1,4 +1,4 @@
|
|||||||
#TIME=20200201054155
|
#TIME=20200201061105
|
||||||
#URL=https://github.com/privacy-protection-tools/anti-AD
|
#URL=https://github.com/privacy-protection-tools/anti-AD
|
||||||
address=/0024aaaa.com/
|
address=/0024aaaa.com/
|
||||||
address=/0026645142c89aeb1.com/
|
address=/0026645142c89aeb1.com/
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
!TIME=20200201054155
|
!TIME=20200201061105
|
||||||
!URL=https://github.com/privacy-protection-tools/anti-AD
|
!URL=https://github.com/privacy-protection-tools/anti-AD
|
||||||
||201*.myhard.com^
|
||201*.myhard.com^
|
||||||
||8*.tianya.cn^
|
||8*.tianya.cn^
|
||||||
@ -33585,7 +33585,6 @@
|
|||||||
||zszgjiejuw.mobi^
|
||zszgjiejuw.mobi^
|
||||||
||zzasj.cn^
|
||zzasj.cn^
|
||||||
||zzhssy.cn^
|
||zzhssy.cn^
|
||||||
@@||tongji.*kuwo.cn^
|
|
||||||
@@||ad.10010.com^
|
@@||ad.10010.com^
|
||||||
@@||ad.abchina.com^
|
@@||ad.abchina.com^
|
||||||
@@||ad.filmweb.pl^
|
@@||ad.filmweb.pl^
|
||||||
@ -33600,3 +33599,5 @@
|
|||||||
@@||ads.ultimatesurrender.com^
|
@@||ads.ultimatesurrender.com^
|
||||||
@@||widget.clipix.com^
|
@@||widget.clipix.com^
|
||||||
@@||widget.myrentacar.me^
|
@@||widget.myrentacar.me^
|
||||||
|
@@||tongji.*kuwo.cn^
|
||||||
|
@@||ntp.org^
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#TIME=20200201054155
|
#TIME=20200201061105
|
||||||
#URL=https://github.com/privacy-protection-tools/anti-AD
|
#URL=https://github.com/privacy-protection-tools/anti-AD
|
||||||
[RULE]
|
[RULE]
|
||||||
DOMAIN-SUFFIX,0024aaaa.com,REJECT
|
DOMAIN-SUFFIX,0024aaaa.com,REJECT
|
||||||
|
@ -89,8 +89,9 @@ $ARR_REGEX_LIST = array(
|
|||||||
|
|
||||||
//对通配符匹配或正则匹配增加的额外赦免规则
|
//对通配符匹配或正则匹配增加的额外赦免规则
|
||||||
$ARR_WHITE_RULE_LIST = array(
|
$ARR_WHITE_RULE_LIST = array(
|
||||||
'@@||github.com^',
|
'@@||github.com^' => 0,
|
||||||
'@@||tongji.*kuwo.cn^',
|
'@@||tongji.*kuwo.cn^' => 0,
|
||||||
|
'@@||ntp.org^' => 1, //针对上面正则表达式的一个赦免规则,例如:2.android.pool.ntp.org
|
||||||
);
|
);
|
||||||
|
|
||||||
//针对上游赦免规则anti-AD不予赦免的规则,即赦免名单的黑名单
|
//针对上游赦免规则anti-AD不予赦免的规则,即赦免名单的黑名单
|
||||||
@ -207,9 +208,10 @@ while(!feof($src_fp)){
|
|||||||
|
|
||||||
//按需写入白名单规则
|
//按需写入白名单规则
|
||||||
$wrote_whitelist = array();
|
$wrote_whitelist = array();
|
||||||
$whiterule = file(WHITERULE_SRC, FILE_SKIP_EMPTY_LINES);
|
$whiterule = file(WHITERULE_SRC, FILE_SKIP_EMPTY_LINES | FILE_IGNORE_NEW_LINES);
|
||||||
$ARR_WHITE_RULE_LIST = array_merge($ARR_WHITE_RULE_LIST, $whiterule);
|
$whiterule=array_fill_keys($whiterule, 0);
|
||||||
foreach($ARR_WHITE_RULE_LIST as $row){
|
$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} !== '@'){
|
if(empty($row) || $row{0} !== '@' || $row{1} !== '@'){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -221,6 +223,11 @@ foreach($ARR_WHITE_RULE_LIST as $row){
|
|||||||
if(array_key_exists("@@||${matches[1]}^", $ARR_WHITE_RULE_BLK_LIST)){
|
if(array_key_exists("@@||${matches[1]}^", $ARR_WHITE_RULE_BLK_LIST)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if($v === 1){
|
||||||
|
$wrote_whitelist[$matches[1]] = null;
|
||||||
|
fwrite($new_fp, "@@||${matches[1]}^\n");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
foreach($wrote_wild as $core_str => $val){
|
foreach($wrote_wild as $core_str => $val){
|
||||||
if($core_str{0} === '/'){
|
if($core_str{0} === '/'){
|
||||||
|
Loading…
Reference in New Issue
Block a user