From 77a0cedaa7d782f981a59889ceeec1aa91a03538 Mon Sep 17 00:00:00 2001 From: Student Main Date: Mon, 11 May 2020 15:02:08 +0800 Subject: [PATCH] set default geosite group in Configuration --- .../Controller/Service/GeositeUpdater.cs | 14 +++----------- shadowsocks-csharp/Model/Configuration.cs | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs b/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs index 8e95d9fc..30e29666 100644 --- a/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs +++ b/shadowsocks-csharp/Controller/Service/GeositeUpdater.cs @@ -6,8 +6,6 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; -using System.Threading.Tasks; -using Google.Protobuf; using Newtonsoft.Json; using Shadowsocks.Model; using System.Net; @@ -66,14 +64,9 @@ namespace Shadowsocks.Controller public static void UpdatePACFromGeosite(Configuration config) { string geositeUrl = GEOSITE_URL; - string group = "geolocation-!cn"; - bool blacklist = true; - if (!string.IsNullOrWhiteSpace(config.geositeGroup)) - { - group = config.geositeGroup; - blacklist = config.geositeBlacklistMode; - } - + string group = config.geositeGroup; + bool blacklist = config.geositeBlacklistMode; + if (!string.IsNullOrWhiteSpace(config.geositeUrl)) { logger.Info("Found custom Geosite URL in config file"); @@ -170,7 +163,6 @@ var __RULES__ = {JsonConvert.SerializeObject(gfwLines, Formatting.Indented)}; private static List GeositeToGFWList(IList domains, bool blacklist) { return blacklist ? GeositeToGFWListBlack(domains) : GeositeToGFWListWhite(domains); - } private static List GeositeToGFWListBlack(IList domains) diff --git a/shadowsocks-csharp/Model/Configuration.cs b/shadowsocks-csharp/Model/Configuration.cs index 01339041..45e47d09 100644 --- a/shadowsocks-csharp/Model/Configuration.cs +++ b/shadowsocks-csharp/Model/Configuration.cs @@ -30,8 +30,8 @@ namespace Shadowsocks.Model public bool showPluginOutput; public string pacUrl; public string geositeUrl; - public string geositeGroup; - public bool geositeBlacklistMode; + public string geositeGroup = "geolocation-!cn"; + public bool geositeBlacklistMode = true; public bool useOnlinePac; public bool secureLocalPac = true;