Compare commits

...

4 commits

Author SHA1 Message Date
2dust
24f8d767b1 Update routing version prefix to V4
Some checks are pending
release Linux / build (Release) (push) Waiting to run
release Linux / rpm (push) Blocked by required conditions
release macOS / build (Release) (push) Waiting to run
release Windows desktop (Avalonia UI) / build (Release) (push) Waiting to run
release Windows / build (Release) (push) Waiting to run
2025-11-12 19:34:04 +08:00
2dust
31a8ddef23 Update Directory.Packages.props 2025-11-12 19:33:32 +08:00
MkQtS
30e9e64fd5
Simplify sing-box rules for domain_suffix (#8306)
adapt to new domain_suffix behavior since sing-box 1.9.0
2025-11-12 19:08:57 +08:00
MkQtS
f677934257
Proxy all Google domains (#8287)
* Proxy all Google domains

Default geosite-cn(dat/srs) used by v2rayN contains google@cn, which performs poorly in certain user environments.

* Resolve all Google domains via remote server

* fix typo

* Add google to default geofiles
2025-11-12 19:08:36 +08:00
10 changed files with 25 additions and 31 deletions

View file

@ -458,7 +458,7 @@ download_geo_assets() {
"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-geoip/$f" || true
done
for f in \
geosite-cn.srs geosite-gfw.srs geosite-greatfire.srs \
geosite-cn.srs geosite-gfw.srs geosite-google.srs geosite-greatfire.srs \
geosite-geolocation-cn.srs geosite-category-ads-all.srs geosite-private.srs; do
curl -fsSL -o "$srss_dir/$f" \
"https://raw.githubusercontent.com/2dust/sing-box-rules/rule-set-geosite/$f" || true

View file

@ -22,7 +22,7 @@
<PackageVersion Include="Semi.Avalonia" Version="11.3.7" />
<PackageVersion Include="Semi.Avalonia.AvaloniaEdit" Version="11.2.0.1" />
<PackageVersion Include="Semi.Avalonia.DataGrid" Version="11.3.7" />
<PackageVersion Include="NLog" Version="6.0.5" />
<PackageVersion Include="NLog" Version="6.0.6" />
<PackageVersion Include="sqlite-net-pcl" Version="1.9.172" />
<PackageVersion Include="TaskScheduler" Version="2.12.2" />
<PackageVersion Include="WebDav.Client" Version="2.9.0" />

View file

@ -2080,7 +2080,7 @@ public static class ConfigHandler
/// <returns>0 if successful</returns>
public static async Task<int> InitBuiltinRouting(Config config, bool blImportAdvancedRules = false)
{
var ver = "V3-";
var ver = "V4-";
var items = await AppManager.Instance.RoutingItems();
//TODO Temporary code to be removed later
@ -2091,7 +2091,7 @@ public static class ConfigHandler
items = await AppManager.Instance.RoutingItems();
}
if (!blImportAdvancedRules && items.Count > 0)
if (!blImportAdvancedRules && items.Count(u => u.Remarks.StartsWith(ver)) > 0)
{
//migrate
//TODO Temporary code to be removed later

View file

@ -13,20 +13,19 @@
"api.ip.sb"
]
},
{
"remarks": "Google cn",
"outboundTag": "proxy",
"domain": [
"domain:googleapis.cn",
"domain:gstatic.com"
]
},
{
"remarks": "阻断udp443",
"outboundTag": "block",
"port": "443",
"network": "udp"
},
{
"remarks": "代理Google",
"outboundTag": "proxy",
"domain": [
"geosite:google"
]
},
{
"remarks": "绕过局域网IP",
"outboundTag": "direct",

View file

@ -1,18 +1,17 @@
[
{
"remarks": "Google cn",
"outboundTag": "proxy",
"domain": [
"domain:googleapis.cn",
"domain:gstatic.com"
]
},
{
"remarks": "阻断udp443",
"outboundTag": "block",
"port": "443",
"network": "udp"
},
{
"remarks": "代理Google",
"outboundTag": "proxy",
"domain": [
"geosite:google"
]
},
{
"remarks": "绕过局域网IP",
"outboundTag": "direct",

View file

@ -14,9 +14,8 @@
],
"rules": [
{
"domain_suffix": [
"googleapis.cn",
"gstatic.com"
"rule_set": [
"geosite-google"
],
"server": "remote",
"strategy": "prefer_ipv4"

View file

@ -8,8 +8,7 @@
"address": "1.1.1.1",
"skipFallback": true,
"domains": [
"domain:googleapis.cn",
"domain:gstatic.com"
"geosite:google"
]
},
{

View file

@ -14,9 +14,8 @@
],
"rules": [
{
"domain_suffix": [
"googleapis.cn",
"gstatic.com"
"rule_set": [
"geosite-google"
],
"server": "remote",
"strategy": "prefer_ipv4"

View file

@ -316,10 +316,8 @@ public partial class CoreConfigSingboxService
}
else if (domain.StartsWith("domain:"))
{
rule.domain ??= [];
rule.domain_suffix ??= [];
rule.domain?.Add(domain.Substring(7));
rule.domain_suffix?.Add("." + domain.Substring(7));
rule.domain_suffix?.Add(domain.Substring(7));
}
else if (domain.StartsWith("full:"))
{

View file

@ -396,6 +396,7 @@ public class UpdateService(Config config, Func<bool, string, Task> updateFunc)
}
//append dns items TODO
geoSiteFiles.Add("google");
geoSiteFiles.Add("cn");
geoSiteFiles.Add("geolocation-cn");
geoSiteFiles.Add("category-ads-all");