当我试图在Android10 (Galaxy A11)上以超级用户权限运行一些命令时,我得到了ioctl "Permission denied“错误。例如:
# ip tuntap add mode tun
ioctl(TUNSETIFF): Permission denied
# ifconfig wlan0
ifconfig: ioctl 8927: Permission denied诸如此类。我试着在谷歌上搜索这个问题,但找不到任何解决它的方法。有些人谈到SELinux的局限性。但是root checker显示SELinux状态是允许的。我如何摆脱这个ioctl错误,让命令行工具在我的根手机上正常工作?
发布于 2021-06-13 19:55:31
我能够通过将ifconfig脚本替换为以下代码来修复此问题:
错误的命令:
./adb -s $device shell ifconfig wlan0 | grep 'inet addr' | cut -d: -f2 | awk '{print $1}'
新命令:
./adb -s $device shell ip addr show wlan0 | grep -e wlan0$ | cut -d " " -f 6 | cut -d/ -f 1
https://stackoverflow.com/questions/64044246
复制相似问题