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