Obtain the Linux UID of an Android App

前端 未结 6 2166
半阙折子戏
半阙折子戏 2020-12-23 12:23

I would like to be able to get the Linux UID (user ID) of an installed Android application.

Excerpt from Security and Permissions: \"At install time, Android gives e

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-23 12:34

    Use android.os.Process.myUid() to get the calling apps UID directly.

    Using the PackageManager is not necessary to find the own UID.

提交回复
热议问题