From 071ff373175ea17488e33a11cc2f15c4483dc826 Mon Sep 17 00:00:00 2001 From: 2dust <31833384+2dust@users.noreply.github.com> Date: Sun, 19 Apr 2026 19:20:09 +0800 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20error=20when=20process=20UID=20?= =?UTF-8?q?not=20found?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libv2ray_android.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/libv2ray_android.go b/libv2ray_android.go index c0b42d4..76ff8e6 100644 --- a/libv2ray_android.go +++ b/libv2ray_android.go @@ -2,6 +2,7 @@ package libv2ray import ( "fmt" + corenet "github.com/xtls/xray-core/common/net" ) @@ -31,8 +32,8 @@ func (x *CoreController) RegisterProcessFinder(finder ProcessFinder) { } corenet.RegisterAndroidProcessFinder(func(network, srcIP string, srcPort uint16, destIP string, destPort uint16) (uid int, name string, path string, err error) { - // getConnectionOwnerUid only works for established connections, - // so if dest is missing, it likely means the connection is not fully established yet. + // getConnectionOwnerUid only works for established connections, + // so if dest is missing, it likely means the connection is not fully established yet. // In that case, we can return an error to indicate that the process cannot be determined at this time. if destPort == 0 || destIP == "" { return 0, "", "", fmt.Errorf("processFinder, no dest for %s %s:%d", network, srcIP, srcPort) @@ -44,9 +45,9 @@ func (x *CoreController) RegisterProcessFinder(finder ProcessFinder) { } }() uid = finder.FindProcessByConnection(network, srcIP, int(srcPort), destIP, int(destPort)) - if uid < 0 { - return 0, "", "", fmt.Errorf("processFinder, not found for %s %s:%d -> %s:%d", network, srcIP, srcPort, destIP, destPort) - } + // if uid < 0 { + // return 0, "", "", fmt.Errorf("processFinder, not found for %s %s:%d -> %s:%d", network, srcIP, srcPort, destIP, destPort) + // } return uid, fmt.Sprintf("%d", uid), "", nil }) }