adb root works Runtime.GetRuntime().Exec(“su”); does not

感情迁移 提交于 2019-12-06 01:53:49

It looks like both linux DAC and SE-Android are blocking your application's process from accessing the 'su' executable.

Check if your system is running in enforced mode, meaning that SE-Android is enabled. If this is indeed the case, you can temporarily disable it by running:

adb root

adb shell setenfoerce 0

This will disable SE-Android and will not block the apps process from executing 'su'.

Additionally, your app might not have the DAC permissions necessary to launch 'su' as root. You can execute the following command:

adb shell ps

For a list of all running processes on your device. locate your app (by searching for its package name), and check its group and uid. Most probably neither are root.

Please note that building a custom userdebug image is not quite like rooting a standard Android device. The debug version is meant to allow access to the device's internals while still simulating a real functioning device with all of its default security mechanisms enabled.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!