Collapse android/ios env and enable AdvancedRouting on both

This commit is contained in:
Viktor Liu
2026-04-18 19:16:16 +02:00
parent e55e0cb601
commit a1a5e2bda5
3 changed files with 24 additions and 25 deletions

View File

@@ -1,24 +0,0 @@
//go:build android
package net
// Init initializes the network environment for Android
func Init() {
// No initialization needed on Android
}
// AdvancedRouting reports whether routing loops can be avoided without using exclusion routes.
// Always returns true on Android since we cannot handle routes dynamically.
func AdvancedRouting() bool {
return true
}
// SetVPNInterfaceName is a no-op on Android
func SetVPNInterfaceName(name string) {
// No-op on Android - not needed for Android VPN service
}
// GetVPNInterfaceName returns empty string on Android
func GetVPNInterfaceName() string {
return ""
}

View File

@@ -1,4 +1,4 @@
//go:build !linux && !windows && !android && (ios || !darwin)
//go:build !linux && !windows && !darwin
package net

23
client/net/env_mobile.go Normal file
View File

@@ -0,0 +1,23 @@
//go:build ios || android
package net
// Init initializes the network environment for mobile platforms.
func Init() {
}
// AdvancedRouting reports whether routing loops can be avoided without using exclusion routes.
// Always returns true on mobile since routes cannot be handled dynamically and the VPN extension
// owns the routing scope.
func AdvancedRouting() bool {
return true
}
// SetVPNInterfaceName is a no-op on mobile.
func SetVPNInterfaceName(string) {
}
// GetVPNInterfaceName returns an empty string on mobile.
func GetVPNInterfaceName() string {
return ""
}