mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-06-13 21:54:13 +08:00
Add KernelSU root permission detection for auto-redirect
This commit is contained in:
parent
5960c255a1
commit
13f4b57997
@ -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")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user