feat: 安卓恢复进程规则,可通过enable-process开关,默认true
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
//go:build !android
|
||||
|
||||
package process
|
||||
|
||||
import (
|
||||
@ -32,12 +34,13 @@ const (
|
||||
pathProc = "/proc"
|
||||
)
|
||||
|
||||
func findProcessName(network string, ip netip.Addr, srcPort int) (string, error) {
|
||||
func findProcessName(network string, ip netip.Addr, srcPort int) (int32, string, error) {
|
||||
inode, uid, err := resolveSocketByNetlink(network, ip, srcPort)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return -1, "", err
|
||||
}
|
||||
return resolveProcessNameByProcSearch(inode, uid)
|
||||
pp, err := resolveProcessNameByProcSearch(inode, uid)
|
||||
return uid, pp, err
|
||||
}
|
||||
|
||||
func resolveSocketByNetlink(network string, ip netip.Addr, srcPort int) (int32, int32, error) {
|
||||
|
Reference in New Issue
Block a user