在Android 5.0源代码根目录下:
找到system/extras/su/su.c下的main函数下的这段代码:
将其注释后重新编译即可。
//安卓系统权限修改2017-1-26 yangyx--->change /* Until we have something better, only root and the shell can use su. */ /* myuid = getuid(); if (myuid != AID_ROOT && myuid != AID_SHELL) { fprintf(stderr,"su: uid %d not allowed to su\n", myuid); return 1; } */