Fix hide vpn icon

* fix: hide vpn icon

* fix(i18n): the reference of deprecated config about
This commit is contained in:
skymkmk
2025-11-26 21:52:37 +08:00
committed by GitHub
parent 84d8cf1757
commit 085c075a48
4 changed files with 18 additions and 10 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
/.idea/ /.idea/
/Libbox.xcframework/ /Libbox.xcframework/
xcuserdata/ xcuserdata/
.DS_Store/ .DS_Store
/build/ /build/
/sing-box.xcodeproj/project.pbxproj.back /sing-box.xcodeproj/project.pbxproj.back
CLAUDE.md CLAUDE.md
@@ -18,18 +18,18 @@ public struct ProfileOverrideView: View {
} }
} else { } else {
FormView { FormView {
FormToggle("Hide VPN Icon", "Append `0.0.0.0/31` to `inet4_route_exclude_address` if not exists.", $excludeDefaultRoute) { newValue in FormToggle("Hide VPN Icon", "Append `0.0.0.0/31` and `::/127` to `route_exclude_address` if not exists.", $excludeDefaultRoute) { newValue in
await SharedPreferences.excludeDefaultRoute.set(newValue) await SharedPreferences.excludeDefaultRoute.set(newValue)
} }
FormToggle("No Default Route", """ FormToggle("No Default Route", """
By default, segment routing is used in `auto_route` instead of global routing. By default, segment routing is used in `auto_route` instead of global routing.
If `*_<route_address/route_exclude_address>` exists in the configuration, this item will not take effect on the corresponding network (commonly used to resolve HomeKit compatibility issues). If `<route_address/route_exclude_address>` exists in the configuration, this item will not take effect on the corresponding network (commonly used to resolve HomeKit compatibility issues).
""", $autoRouteUseSubRangesByDefault) { newValue in """, $autoRouteUseSubRangesByDefault) { newValue in
await SharedPreferences.autoRouteUseSubRangesByDefault.set(newValue) await SharedPreferences.autoRouteUseSubRangesByDefault.set(newValue)
} }
FormToggle("Exclude APNs Route", "Append `push.apple.com` to `bypass_domain`, and `17.0.0.0/8` to `inet4_route_exclude_address`.", $excludeAPNsRoute) { newValue in FormToggle("Exclude APNs Route", "Append `push.apple.com` to `bypass_domain`, and `17.0.0.0/8` to `route_exclude_address`.", $excludeAPNsRoute) { newValue in
await SharedPreferences.excludeAPNsRoute.set(newValue) await SharedPreferences.excludeAPNsRoute.set(newValue)
} }
@@ -134,6 +134,14 @@ public class ExtensionPlatformInterface: NSObject, LibboxPlatformInterfaceProtoc
ipv6ExcludeRoutes.append(NEIPv6Route(destinationAddress: ipv6RoutePrefix.address(), networkPrefixLength: NSNumber(value: ipv6RoutePrefix.prefix()))) ipv6ExcludeRoutes.append(NEIPv6Route(destinationAddress: ipv6RoutePrefix.address(), networkPrefixLength: NSNumber(value: ipv6RoutePrefix.prefix())))
} }
if await SharedPreferences.excludeDefaultRoute.get(), !ipv6Routes.isEmpty {
if !ipv6ExcludeRoutes.contains(where: { it in
it.destinationAddress == "::" && it.destinationNetworkPrefixLength == 127
}) {
ipv6ExcludeRoutes.append(NEIPv6Route(destinationAddress: "::", networkPrefixLength: 127))
}
}
ipv6Settings.includedRoutes = ipv6Routes ipv6Settings.includedRoutes = ipv6Routes
ipv6Settings.excludedRoutes = ipv6ExcludeRoutes ipv6Settings.excludedRoutes = ipv6ExcludeRoutes
settings.ipv6Settings = ipv6Settings settings.ipv6Settings = ipv6Settings
+6 -6
View File
@@ -100,22 +100,22 @@
} }
} }
}, },
"Append `0.0.0.0/31` to `inet4_route_exclude_address` if not exists." : { "Append `0.0.0.0/31` and `::/127` to `route_exclude_address` if not exists." : {
"localizations" : { "localizations" : {
"zh-Hans" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "将会附加 `0.0.0.0/31` 到 `inet4_route_exclude_address`。" "value" : "将会附加 `0.0.0.0/31` 和 `::/127` 到 `route_exclude_address`。"
} }
} }
} }
}, },
"Append `push.apple.com` to `bypass_domain`, and `17.0.0.0/8` to `inet4_route_exclude_address`." : { "Append `push.apple.com` to `bypass_domain`, and `17.0.0.0/8` to `route_exclude_address`." : {
"localizations" : { "localizations" : {
"zh-Hans" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "将会附加 `push.apple.com` 到 `bypass_domain` 附加 `17.0.0.0/8` 到 `inet4_route_exclude_address`。" "value" : "将会附加 `push.apple.com` 到 `bypass_domain` 附加 `17.0.0.0/8` 到 `route_exclude_address`。"
} }
} }
} }
@@ -176,12 +176,12 @@
} }
} }
}, },
"By default, segment routing is used in `auto_route` instead of global routing.\nIf `*_<route_address/route_exclude_address>` exists in the configuration, this item will not take effect on the corresponding network (commonly used to resolve HomeKit compatibility issues)." : { "By default, segment routing is used in `auto_route` instead of global routing.\nIf `<route_address/route_exclude_address>` exists in the configuration, this item will not take effect on the corresponding network (commonly used to resolve HomeKit compatibility issues)." : {
"localizations" : { "localizations" : {
"zh-Hans" : { "zh-Hans" : {
"stringUnit" : { "stringUnit" : {
"state" : "translated", "state" : "translated",
"value" : "在默认情况下,`auto_route` 中使用分段路由,而非全局路由。\n若配置中存在 `*_<route_address/route_exclude_address>`,则此项不会在对应网络上生效(常用于解决 HomeKit 兼容性问题)。" "value" : "在默认情况下,`auto_route` 中使用分段路由,而非全局路由。\n若配置中存在 `<route_address/route_exclude_address>`,则此项不会在对应网络上生效(常用于解决 HomeKit 兼容性问题)。"
} }
} }
} }