在android上开启root权限临时解决方法

来源:互联网 发布:软件流程图设计工具 编辑:程序博客网 时间:2024/05/16 19:28

需要调整su程序,休眠system/extra/su/su.c,注释掉限制rootshell的限制:

if (myuid != AID_ROOT && myuid != AID_SHELL) {

        fprintf(stderr,"su: uid %d not allowed to su\n", myuid);

     //   return 1; 注释掉这句话。 

   }

然后chmod 24xxx /system/xbin/su ,开启suid权限(xxx根据需要调整)。

检查init.rc确保su放置的文件系统挂接时候没有nosuid这样的代码:

mount ext3 mtd@system /system nosuid nodev noatime nodiratime ,需把nosuid去掉。

mount ext3 mtd@system /system suid noatime nodiratime

这样root就被开放了,当然上面改动造成了安全漏洞是肯定的。