浏览代码

Update Rules

SukkaW 4 年之前
父节点
当前提交
25b04ce4b5

+ 26 - 20
Build/build-reject-domainset.js

@@ -142,16 +142,6 @@ async function processFilterRules(filterRulesUrl) {
 
   console.log(`Import ${filterRuleBlacklistDomainSets.size} rules from adguard filters!`);
 
-  // Remove whitelist from the domain sets
-  console.log(`Remove whitelist from the domain sets!`);
-  for (const domain of domainSets) {
-    for (const white of filterRuleWhitelistDomainSets) {
-      if (domain.includes(white) || white.includes(domain)) {
-        domainSets.delete(domain);
-      }
-    }
-  }
-
   // Read DOMAIN Keyword
   const domainKeywordsSet = new Set();
   await fsPromises.readFile(pathResolve(__dirname, '../List/non_ip/reject.conf'), { encoding: 'utf-8' }).then(data => {
@@ -172,20 +162,36 @@ async function processFilterRules(filterRulesUrl) {
 
   bar2.start(len, 0);
   for (const domain of domainSets) {
+    let shouldContinue = false;
+
+    for (const white of filterRuleWhitelistDomainSets) {
+      if (domain.includes(white) || white.includes(domain)) {
+        domainSets.delete(domain);
+        shouldContinue = true;
+        break;
+      }
+    }
+
+    if (shouldContinue) {
+      continue;
+    }
+
     for (const keyword of domainKeywordsSet) {
-      if (domain.includes(keyword)) {
+      if (domain.includes(keyword) || keyword.includes(domain)) {
         domainSets.delete(domain);
-        continue;
+        shouldContinue = true;
+        break;
       }
     }
 
-    if (domain.startsWith('.')) {
-      for (const domain2 of domainSets) {
-        if (domain2 !== domain) {
-          if (domain2.endsWith(domain) || `.${domain2}` === domain) {
-            domainSets.delete(domain2);
-          }
-        }
+    if (shouldContinue) {
+      continue;
+    }
+
+    for (const domain2 of domainSets) {
+      if (domain2.startsWith('.') && domain2 !== domain && (domain.endsWith(domain2) || `.${domain}` === domain2)) {
+        domainSets.delete(domain);
+        break;
       }
     }
 
@@ -194,5 +200,5 @@ async function processFilterRules(filterRulesUrl) {
 
   bar2.stop();
 
-  return fsPromises.writeFile(pathResolve(__dirname, '../List/domainset/reject.conf'), [...domainSets].join('\n'));
+  return fsPromises.writeFile(pathResolve(__dirname, '../List/domainset/reject.conf'), `${[...domainSets].join('\n')}\n`);
 })();

+ 1 - 0
List/domainset/cdn.conf

@@ -80,6 +80,7 @@ cdnjs.cat.net
 fonts.cat.net
 ajax.cat.net
 gravatar.cat.net
+.rsb.net
 
 # >> Microsoft CDN
 .aspnetcdn.com

+ 1 - 1
List/domainset/icloud_private_relay.conf

@@ -1,3 +1,3 @@
 mask.icloud.com
 mask-h2.icloud.com
-mask-api.icloud.com
+mask-api.icloud.com

文件差异内容过多而无法显示
+ 128 - 71
List/domainset/reject.conf


+ 2 - 0
List/domainset/reject_sukka.conf

@@ -562,6 +562,7 @@ analytics.slashdotmedia.com
 .bluekai.com
 .bkrtx.com
 .ads.pro-market.net
+.stat.xtom.com
 
 # >> Apple
 metrics.apple.com
@@ -577,6 +578,7 @@ stocks-analytics-events.news.apple-dns.net
 .iadsdk.apple.com
 .iad.apple.com
 .qwapi.com
+.wwads.cn
 
 # >> Spotify
 adeventtracker.spotify.com

部分文件因为文件数量过多而无法显示