diff --git a/v2rayN/v2rayN/Global.cs b/v2rayN/v2rayN/Global.cs index 726c9c18b4..067b53eae1 100644 --- a/v2rayN/v2rayN/Global.cs +++ b/v2rayN/v2rayN/Global.cs @@ -23,7 +23,7 @@ internal class Global public const string SpeedPingTestUrl = @"https://www.google.com/generate_204"; public const string JuicityCoreUrl = "https://github.com/juicity/juicity/releases"; public const string CustomRoutingListUrl = @"https://raw.githubusercontent.com/2dust/v2rayCustomRoutingList/master/"; - public const string SingboxRulesetUrlGeosite = @"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-{0}.srs"; + public const string SingboxRulesetUrlGeosite = @"https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/{0}.srs"; public const string SingboxRulesetUrlGeoip = @"https://raw.githubusercontent.com/Loyalsoldier/geoip/release/srs/{0}.srs"; public const string PromotionUrl = @"aHR0cHM6Ly85LjIzNDQ1Ni54eXovYWJjLmh0bWw="; diff --git a/v2rayN/v2rayN/Handler/CoreConfig/CoreConfigSingbox.cs b/v2rayN/v2rayN/Handler/CoreConfig/CoreConfigSingbox.cs index 04c4aee4d5..01f13ec8bd 100644 --- a/v2rayN/v2rayN/Handler/CoreConfig/CoreConfigSingbox.cs +++ b/v2rayN/v2rayN/Handler/CoreConfig/CoreConfigSingbox.cs @@ -953,14 +953,14 @@ private int ConvertGeo2Ruleset(SingboxConfig singboxConfig) } else { - var geo = item.Split('-').FirstOrDefault() ?? geosite; - var value = item.Split('-').LastOrDefault(); singboxConfig.route.rule_set.Add(new() { type = "remote", format = "binary", tag = item, - url = string.Format(geo.Equals(geosite) ? Global.SingboxRulesetUrlGeosite : Global.SingboxRulesetUrlGeoip, value), + url = item.StartsWith(geosite) ? + string.Format(Global.SingboxRulesetUrlGeosite, item) : + string.Format(Global.SingboxRulesetUrlGeoip, item.Replace($"{geoip}-", "")), download_detour = Global.ProxyTag }); } diff --git a/v2rayN/v2rayN/Models/SingboxConfig.cs b/v2rayN/v2rayN/Models/SingboxConfig.cs index ced5adbda3..e7b531ad43 100644 --- a/v2rayN/v2rayN/Models/SingboxConfig.cs +++ b/v2rayN/v2rayN/Models/SingboxConfig.cs @@ -49,6 +49,7 @@ public class Rule4Sbox public string? mode { get; set; } public bool? ip_is_private { get; set; } public string? client_subnet { get; set; } + public bool? invert { get; set; } public List? inbound { get; set; } public List? protocol { get; set; } public List? network { get; set; }