diff --git a/v2rayN/ServiceLib/Services/UpdateService.cs b/v2rayN/ServiceLib/Services/UpdateService.cs index 5a430a9c..1a8e8d64 100644 --- a/v2rayN/ServiceLib/Services/UpdateService.cs +++ b/v2rayN/ServiceLib/Services/UpdateService.cs @@ -6,12 +6,10 @@ namespace ServiceLib.Services public class UpdateService { private Action? _updateFunc; - private Config _config; private int _timeout = 30; public async Task CheckUpdateGuiN(Config config, Action updateFunc, bool preRelease) { - _config = config; _updateFunc = updateFunc; var url = string.Empty; var fileName = string.Empty; @@ -53,7 +51,6 @@ namespace ServiceLib.Services public async Task CheckUpdateCore(ECoreType type, Config config, Action updateFunc, bool preRelease) { - _config = config; _updateFunc = updateFunc; var url = string.Empty; var fileName = string.Empty; @@ -108,7 +105,6 @@ namespace ServiceLib.Services public async Task UpdateSubscriptionProcess(Config config, string subId, bool blProxy, Action updateFunc) { - _config = config; _updateFunc = updateFunc; _updateFunc?.Invoke(false, ResUI.MsgUpdateSubscriptionStart); @@ -454,7 +450,6 @@ namespace ServiceLib.Services private async Task UpdateGeoFile(string geoName, Config config, Action updateFunc) { - _config = config; _updateFunc = updateFunc; var geoUrl = string.IsNullOrEmpty(config?.ConstItem.GeoSourceUrl) @@ -470,7 +465,6 @@ namespace ServiceLib.Services private async Task UpdateSrsFileAll(Config config, Action updateFunc) { - _config = config; _updateFunc = updateFunc; var geoipFiles = new List(); @@ -521,9 +515,9 @@ namespace ServiceLib.Services private async Task UpdateSrsFile(string type, string srsName, Config config, Action updateFunc) { - var srsUrl = string.IsNullOrEmpty(_config.ConstItem.SrsSourceUrl) + var srsUrl = string.IsNullOrEmpty(config.ConstItem.SrsSourceUrl) ? Global.SingboxRulesetUrl - : _config.ConstItem.SrsSourceUrl; + : config.ConstItem.SrsSourceUrl; var fileName = $"{type}-{srsName}.srs"; var targetPath = Path.Combine(Utils.GetBinPath("srss"), fileName);