diff --git a/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs b/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs index 8ec815d65..f076df96c 100644 --- a/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs +++ b/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs @@ -39,15 +39,18 @@ public static class GeositeUpdater private static HttpClient httpClient; private static readonly string GEOSITE_URL = "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat"; private static readonly string GEOSITE_SHA256SUM_URL = "https://github.com/v2fly/domain-list-community/raw/release/dlc.dat.sha256sum"; + private static readonly DomainObject.Types.Attribute geositeExcludeAttribute; private static byte[] geositeDB; public static readonly Dictionary> Geosites = new Dictionary>(); static GeositeUpdater() { - //socketsHttpHandler = new SocketsHttpHandler(); - //httpClient = new HttpClient(socketsHttpHandler); - + geositeExcludeAttribute = new DomainObject.Types.Attribute + { + Key = "cn", + BoolValue = true + }; if (File.Exists(DATABASE_PATH) && new FileInfo(DATABASE_PATH).Length > 0) { geositeDB = File.ReadAllBytes(DATABASE_PATH); @@ -241,6 +244,9 @@ private static List GeositeToGFWListBlack(IList domains) List ret = new List(domains.Count + 100);// 100 overhead foreach (var d in domains) { + if (d.Attribute.Contains(geositeExcludeAttribute)) + continue; + string domain = d.Value; switch (d.Type)