Add KernelSU root permission detection for auto-redirect

This commit is contained in:
lgjint 2024-06-01 01:41:54 +08:00
parent 5960c255a1
commit 13f4b57997

View File

@ -62,7 +62,16 @@ func newAutoRedirect(t *Tun) (*tunAutoRedirect, error) {
err error err error
) )
if t.platformInterface != nil { if t.platformInterface != nil {
suPath, err = exec.LookPath("/bin/su") suPaths := []string{
"/bin/su",
"/system/bin/su",
}
for _, path := range suPaths {
suPath, err = exec.LookPath(path)
if err == nil {
break
}
}
} else { } else {
suPath, err = exec.LookPath("su") suPath, err = exec.LookPath("su")
} }