mirror of
https://github.com/SukkaW/Surge.git
synced 2025-12-15 10:40:33 +08:00
Update Reject Hosts
This commit is contained in:
parent
e1cea18663
commit
505f7544ed
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2211,6 +2211,7 @@ sentry.d.mi.com
|
||||
.hnzkclouds.com
|
||||
|
||||
.data.intl.miui.com
|
||||
.stats.miui.com
|
||||
|
||||
.cloudcontrol.xiaomixiaoai.com
|
||||
.crashguard.me
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user