`
hatedance
  • 浏览: 57963 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

adroid app权限实现方式

 
阅读更多

工作找到了,没事玩玩android。看到文档里这样写:

Once installed on a device, each Android application lives in its own security sandbox:

  • The Android operating system is a multi-user Linux system in which each application is a different user.
  • By default, the system assigns each application a unique Linux user ID (the ID is used only by the system and is unknown to the application). The system sets permissions for all the files in an application so that only the user ID assigned to that application can access them.
  • Each process has its own virtual machine (VM), so an application's code runs in isolation from other applications.
  • By default, every application runs in its own Linux process. Android starts the process when any of the application's components need to be executed, then shuts down the process when it's no longer needed or when the system must recover memory for other applications.

这段很有意思。讲的是每个安卓app都有权限控制。我记得在安装每个app的时候,的确有一个授权列表。是如何实现的呢?

  • 每个app都有一个唯一的user id
  • 每个user id有自己的权限设置
  • 每个进程都对应一个虚拟机
  • 每个app对应一个进程,也就是一个虚拟机

 

以上就是app权限的实现方式,全部依赖linux 操作系统的实现。很懒,很好。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics