ソースを参照

Update Reject Hosts

SukkaW 11 ヶ月 前
コミット
505f7544ed
2 ファイル変更12 行追加1 行削除
  1. 11 1
      Build/tools-migrate-domains.ts
  2. 1 0
      Source/domainset/reject.conf

+ 11 - 1
Build/tools-migrate-domains.ts

@@ -14,6 +14,7 @@ import { PREDEFINED_WHITELIST } from './constants/reject-data-source';
   await writeHostsToTrie(trie, 'https://cdn.jsdelivr.net/gh/jerryn70/GoodbyeAds@master/Extension/GoodbyeAds-Xiaomi-Extension.txt', true);
 
   await runWhiteOnSource(path.join(SOURCE_DIR, 'domainset', 'reject.conf'), trie);
+  await runWhiteOnSource(path.join(SOURCE_DIR, 'non_ip', 'reject.conf'), trie);
 
   for (let i = 0, len = PREDEFINED_WHITELIST.length; i < len; i++) {
     trie.whitelist(PREDEFINED_WHITELIST[i]);
@@ -28,7 +29,16 @@ async function runWhiteOnSource(sourceFile: string, trie: HostnameSmolTrie) {
   for await (const line of readFileByLine(sourceFile)) {
     const l = processLine(line);
     if (l) {
-      trie.whitelist(l);
+      if (l.includes(',')) {
+        const [type, domain] = l.split(',', 3);
+        if (type === 'DOMAIN') {
+          trie.whitelist(domain, false);
+        } else if (type === 'DOMAIN-SUFFIX') {
+          trie.whitelist(domain, true);
+        }
+      } else {
+        trie.whitelist(l);
+      }
     }
   }
 }

+ 1 - 0
Source/domainset/reject.conf

@@ -2211,6 +2211,7 @@ sentry.d.mi.com
 .hnzkclouds.com
 
 .data.intl.miui.com
+.stats.miui.com
 
 .cloudcontrol.xiaomixiaoai.com
 .crashguard.me