From 11c4795b7c12ea63dfe944d90b249df03eb724b9 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Thu, 9 Jul 2026 15:01:25 +0800 Subject: [PATCH] Reset DefaultResolver on Android CGO builds v2ray-core hardcodes 8.8.8.8 as the system DNS on all Android builds (v2fly/v2ray-core#572). That is only needed without CGO; with CGO it causes DNS loopback/poisoning under Android VPN protect (shadowsocks/v2ray-plugin-android#44). Upstream fixed this with a build tag in v5.52.0 (v2fly/v2ray-core#3755), which requires Go 1.25.5+. Until we can bump core, undo the override from main after dependency package inits run. --- dns_android.go | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 dns_android.go diff --git a/dns_android.go b/dns_android.go new file mode 100644 index 0000000..55e9f9e --- /dev/null +++ b/dns_android.go @@ -0,0 +1,10 @@ +//go:build android && cgo +// +build android,cgo + +package main + +import "net" + +func init() { + net.DefaultResolver = &net.Resolver{} +}