由上篇Android Permission权限机制引子,我们知道Android 通过在每台设备上实施了基于权限的安全策略来处理安全问题,采用权限来限制安装应用程序的能力。本篇文章继续来探讨和Android权限相关的话题,主要集中在权限级别、ICC(inter- component communication)权限保护两个方面。

权限级别 protection level

每一个Permission权限都设有了权限级别(protection level),分别如下:

“normal”

The default value. A lower-risk permission that gives requesting applications access to isolated application-level features, with minimal risk to other applications, the system, or the user. The system automatically grants this type of permission to a requesting application at installation, without asking for the user's explicit approval (though the user always has the option to review these permissions before installing).

normal级别是一些比较低风险的权限,我们在安装一个新app到手机时,一般会被折叠起来的权限就是normal级别的。

“dangerous”

A higher-risk permission that would give a requesting application access to private user data or control over the device that can negatively impact the user. Because this type of permission introduces potential risk, the system may not automatically grant it to the requesting application. For example, any dangerous permissions requested by an application may be displayed to the user and require confirmation before proceeding, or some other approach may be taken to avoid the user automatically allowing the use of such facilities.

dangerous则是那些比较高风险的权限,在安装时会明显提示用户该app具有这些权限,并且需要用户同意确认才能正确安装app的权限。

“signature”

A permission that the system grants only if the requesting application is signed with the same certificate as the application that declared the permission. If the certificates match, the system automatically grants the permission without notifying the user or asking for the user's explicit approval.

signature则在我们用户自定义权限custom时,会用得到的,具体做法我会在另一篇博文:Android 自定义权限中具体研究的,这里简述之:

用户在某一个app(先称permisson app)中自定义了permission时,并且指定了某些组件需要该自定义权限才能打开,这是前提,然后用户又开发了另外一个app(称为permission client),这个permission client如果想访问permisson app中指定了自定义权限的组件,那么这两个app必须具备相同的signature,这就是signature级别的意思。

“signatureOrSystem”

A permission that the system grants only to applications that are in the Android system image or that are signed with the same certificates as those in the system image. Please avoid using this option, as the signature protection level should be sufficient for most needs and works regardless of exactly where applications are installed. The “signatureOrSystem” permission is used for certain special situations where multiple vendors have applications built into a system image and need to share specific features explicitly because they are being built together.

这个同上,但多了一个Or,or是指除了相同的signature之外还可以指定为相同的Android img也可以访问,这个img其实就是系统级别的定制了,一般用的很少。

ICC(inter-component communication)权限保护

元素和组件元素都有android:permission的属性,在这里我们称这个属性分别为应用程序和组件的权限标签。应用程序内的组件可以继承应用程序元素设置的权限标签,当某一组件启动 ICC 时,相关的访问控制器就会查看组件和组件所在应用程序的权限标签集合,如目标组件的访问权限标签在以上的集合内,允许 ICC 的建立继续进行,否则将会被拒绝,即使这两个组件在同一应用程序内。

改图描述了该逻辑的进程:组件A是否可以访问组件B和C,取决于比较B和C内的访问权限标签与应用程序1内的标签集合的结果。B和应用程序1内都有i1标签,所以组件A可以访问组件B,相反应用程序1内没有标签i2,组件A 不可以访问组件B。

android组件权限,Android中Permission权限机制的具体使用相关推荐

  1. Android权限管理之Permission权限机制及使用

    前言: 最近突然喜欢上一句诗:"宠辱不惊,看庭前花开花落:去留无意,望天空云卷云舒." 哈哈~,这个和今天的主题无关,最近只要不学习总觉得生活中少了点什么,所以想着围绕着最近面试过 ...

  2. miui 打开android目录,android – 如何在miui中打开权限弹出窗口?

    以下代码对我有用.您需要这两个类MIUIUtils.java和BuildProperties.java MIUIUtils.java public class MIUIUtils { private ...

  3. Android升级butterknife,Android组件化开发中使用Butterknife的坑

    近来整理代码的时候,要对代码做一些模块化组件化的处理.想要在一个BaseLib里面引入ButterKnife,在这个BaseLib里面声明一个BaseActivty,然后其他module的Activi ...

  4. android 组件 线程,Android UI线程和非UI线程

    UI线程及Android的单线程模型原则 当应用启动,系统会创建一个主线程(main thread). 这个主线程负责向UI组件分发事件(包括绘制事件),也是在这个主线程里,你的应用和Android的 ...

  5. android组件设计,Android组件化开发路由的设计实践

    调研了一下目前的路由框架,ARouter(阿里的),ActivityRouter都使用了apt技术 编译时注解,个人想法是一口吃不成胖子,先做个比较实用的. VpRouter路由框架主要应用于组件化开 ...

  6. linux中的acl权限,linux中的权限和ACL

    权限,特殊权限,FACL 用ls -l filename 可以查看文件或者目录的详细信息,具体分析一下 在第一个空格前,有10个字段,第一个"-"表示文件类型,后边"rw ...

  7. 域服务器账号权限,域中文件服务器权限设置

    一个父子多域环境,然后中国属于asia子域.中国有台文件服务器,需要设定NTFS权限,请问,权限设定时,不同的安全组,有什么不同的区别?譬如domain local,global ,universal ...

  8. linux 0644权限,Linux 中的权限 -- 0755 和 0644

    Linux 系统中采用三位十进制数表示权限,如0755, 0644.windows OS不行.如,对root文件夹abc,进行修改权限(包含其子文件夹)sudo chmod -R 777 abc AB ...

  9. android 组件可见,android界面控件可见性方法setVisibility()3个可选参数(visible,invisible,gone)的区别...

    setVisibility()有三个参数:visible, invisible,gone 1. visible :设置为可见 2. invisible : 设置为不可见,但是保留它在父控件上所占的空间 ...

最新文章

  1. Javascript年月日联动
  2. 报名 | 2019年社会计算机国际会议
  3. mysql 特殊字符
  4. 建造者模式与原型模式/builder模式与prototype模式/创建型模式
  5. Python编程学习:让函数更加灵活的*args和**kwargs(设计不同数量参数的函数)的简介、使用方法、经典案例之详细攻略
  6. ABAP实例:一个现金流量表的代码
  7. 后端:Java 中 10 大坑爹功能!
  8. sql 非主键每年自增_或许你不知道的 10 条 SQL 技巧
  9. sql CAST用法
  10. RTT distribution of Internet
  11. 2440: [中山市选2011]完全平方数
  12. 模拟登陆qq空间实现(3)
  13. C++回调函数使用心得
  14. Shell脚本初学习
  15. vscode 更新后报错 Couldn‘t start dlv dap
  16. 英飞凌微控制器,驱动物联网的关键“大脑”
  17. natapp邀请码,新用户购买域名可以享受9折优惠
  18. 米江软件讲三级分销系统
  19. 2007年(第21届)电子信息百强企业名单
  20. DzzOffice共享文件夹、共享目录设置

热门文章

  1. 『互联网架构』软件架构-spring源码之spring结构概述
  2. CentOS(linux) 下JDK的安装
  3. CoreOS 和 Kubernetes 1.5 自主运行 Kubernetes、Container Linux
  4. MFCC特征参数提取(一)(基于MATLAB和Python实现)
  5. mysql忘记root密码解决方法(版本mysql-8.0.12)
  6. 13个Pandas技巧
  7. matlab学习200316
  8. markdownpad 2 pro版本(注册码)
  9. CentOS7中MariaDB重置密码
  10. PHP整数取余返回负数解决办法