public static final int SYSTEM_UID = 1000;
来源:
ZygoteInit 定义有函数 private static Runnable forkSystemServer,
传递参数 “–setuid=1000”, 到
Zygote.forkSystemServer 方法, 到
nativeForkSystemServer 到
frameworks/base/core/jni/com_android_internal_os_Zygote.cpp 的
com_android_internal_os_Zygote_nativeForkSystemServer函数,到
ForkCommon 创建子进程 SystemServer ,然后调用 SpecializeCommon ,
最终调用 setresuid
setresuid() sets the real user ID, the effective user ID, and the
saved set-user-ID of the calling process.