我希望能够得到一个安装的Android应用程序的Linux的UID(用户ID)。
I would like to be able to get the Linux UID (user ID) of an installed Android application.
从安全和权限:在安装的时候,Android给每个包一个独特的Linux的用户ID。该身份保持恒定在该设备上的程序包的寿命的持续时间。
Excerpt from Security and Permissions: "At install time, Android gives each package a distinct Linux user ID. The identity remains constant for the duration of the package's life on that device."
有没有一种方法来检索这个UID?
Is there a way to retrieve this UID?
使用 PackageManager
和 getApplicationInfo()
。