Android4.0 开放Root权限

来源:互联网 发布:考研英语单词书 知乎 编辑:程序博客网 时间:2024/06/11 23:47

system/extras/su/

1>Android.mk:

                    添加: ifeq ($(strip $(TARGET_OPEN_ROOT)),true)
                                 LOCAL_CFLAGS += -DOPEN_ROOT=1
                                 endif

2>su.c:

         /* Until we have something better, only root and the shell can use su. */
         myuid = getuid();
#if OPEN_ROOT
#else
          if (myuid != AID_ROOT && myuid != AID_SHELL) {
              fprintf(stderr,"su: uid %d not allowed to su\n", myuid);
              return 1;
          }   
#endif  

3>init.rc:

           chown root root /system/xbin/su
           chmod 4755 /system/xbin/su

4>删除busybox里面的su

0 0
原创粉丝点击