- 浏览: 235441 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
a568690944:
引用[u][b][list][*]引用[u][/u][/lis ...
浅析permission标签的区别及用法 -
joychine:
这里需要注意的是putExtra method,它的第一个参数 ...
Android系统数据传递机制 -
姑射道人:
update site 链接无效了,请问怎么设置?
Eclipse无法安装ADT插件的解决 -
avd羲羲:
呵呵还需要加入向sd卡写入的权限: <uses-perm ...
关于Traceview的使用 -
kjsoloho:
yushiro 写道lijunjie 写道我个人觉得,onDe ...
关于Traceview的使用
Declaring and Enforcing Permissions 声明和实施permissions
To enforce your own permissions, you must first declare them in your
AndroidManifest.xml
using one or more
<permission>
tags.
For example, an application that wants to control who can start one of its activities could declare a permission for this operation as follows:
为了实现你自己的permissions,你必须首先在AndroidManifest.xml文件中声明该permissions.通常我们通过使用一到多个<permission> tag来进行声明。
下面例子说明了一个应用程序它想控制谁才可以启动它的Activity:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.me.app.myapp" > <permission android:name="com.me.app.myapp.permission.DEADLY_ACTIVITY" android:label="@string/permlab_deadlyActivity" android:description="@string/permdesc_deadlyActivity" android:permissionGroup="android.permission-group.COST_MONEY" android:protectionLevel="dangerous" /> </manifest>
The <protectionLevel> attribute is required, telling the system how the user is to be informed of applications requiring the permission, or who is allowed to hold that permission, as described in the linked documentation.
The <permissionGroup> attribute is optional, and only used to help the system display permissions to the user. You will usually want to set this to either a standard system group (listed in android.Manifest.permission_group ) or in more rare cases to one defined by yourself. It is preferred to use an existing group, as this simplifies the permission UI shown to the user.
这里<protectionLevel>属性是需要声明的(通常系统自有的permission都会有它对应的protection level,而我们自己定义的permission一般都需要定义protecdtion level, 若不去定义,则默认为normal)。通过声明该属性,我们就可以告知系统如何去通告用户以及通告哪些内容,或者告知系统谁才可以拥有该permission。具体请参看链接的文档。
这我多说两句啊,这个protectionLevel分四个等级,分别是Normal, Dangerous, Signature, SignatureOrSystem, 越往后安全等级越高。
这个<permissionGroup>属性是可选项, 只是用于帮助系统显示permissions给用户(实际是告知系统该permission是属于哪个permission group的)。你通常会选择使用标准的system group来设定该属性,或者用你自己定义的group(更为罕见)。通常使用一个已经存在的group会更合适,因为这样UI显示的时候会更简单。
Note that both a label and description should be supplied for the
permission. These are string resources that can be displayed to the user when
they are viewing a list of permissions
(android:label
)
or details on a single permission (
android:description
).
The label should be short, a few words
describing the key piece of functionality the permission is protecting. The
description should be a couple sentences describing what the permission allows
a holder to do. Our convention for the description is two sentences, the first
describing the permission, the second warning the user of what bad things
can happen if an application is granted the permission.
Here is an example of a label and description for the CALL_PHONE permission:
需要注意的是label和description都是需要为permission提供的。这些都是字符串资源,当用户去看permission列表(android:label)或者某个permission的详细信息(android:description)时,这些字符串资源就可以显示给用户。label应当尽量简短,之需要告知用户该permission是在保护什么功能就行。而description可以用于具体描述获取该permission的程序可以做哪些事情,实际上让用户可以知道如果他们同意程序获取该权限的话,该程序可以做什么。我们通常用两句话来描述permission,第一句描述该permission,第二句警告用户如果批准该权限会可能有什么不好的事情发生。下面是一个描述CALL_PHONE permission的label和description的例子:
<string name="permlab_callPhone">directly call phone numbers</string> <string name="permdesc_callPhone">Allows the application to call phone numbers without your intervention. Malicious applications may cause unexpected calls on your phone bill. Note that this does not allow the application to call emergency numbers.</string>
You can look at the permissions currently defined in the system with the
shell command adb shell pm list permissions
. In particular,
the '-s' option displays the permissions in a form roughly similar to how the
user will see them:
你可以通过shell指令 adb shell pm list permissions 来查看目前系统已有的permissions. 特别的,"-s"选项会以一种用户会看到的格式一样的格式来显示这些permissions.
$ adb shell pm list permissions -s All Permissions: Network communication: view Wi-Fi state, create Bluetooth connections, full Internet access, view network state Your location: access extra location provider commands, fine (GPS) location, mock location sources for testing, coarse (network-based) location Services that cost you money: send SMS messages, directly call phone numbers ...
发表评论
-
(转载)怎样使用Eclipse来开发Android源码 + 注释
2010-07-23 17:06 3281用eclipse+ADT作为android ... -
(转载)为Android加入busybox工具
2010-07-14 16:27 3217原文http://blog.csdn.net/liao ... -
Eclipse无法安装ADT插件的解决
2010-05-31 15:14 25597今天偶在Ubuntu上尝试使用Eclipse,并安装ADT插件 ... -
Content Provider基础之SQL
2010-04-26 16:16 6077Keywords: content provider, SQL ... -
Android如何绘制Views
2010-01-30 14:12 3509当一个Activity被激活时 ... -
Content Provider 基础 之URI
2010-01-28 21:34 9304Keywords: content provider, URI ... -
Android基础 : Android Service
2009-10-10 21:54 2368一篇不错的关于Service的介绍,转载了,虽然不知道原始出处 ... -
Android系统数据传递机制
2009-10-10 10:51 4822Keywords: IPC, Thread, Process, ... -
关于Traceview的使用
2009-08-31 11:04 10572Traceview是android平台配备 ... -
OPhone SDK 1.0正式发布
2009-08-04 20:14 1770OPhone SDN网站: http://www.opho ... -
Android Content Provider List
2009-07-12 15:33 2300Android平台提供的Content Providers如下 ... -
查询存储空间的代码
2009-06-29 21:39 2201以下代码片段转载自Android Snippets 该代码片 ... -
浅析permission标签的区别及用法
2009-06-27 19:42 10785在我之前的安全与权限 ... -
为Android Application指定版本
2009-06-17 15:23 4064我们大家都知道,应用程序在发布的时候需要指定一个版本号,这样做 ... -
Content Provider FAQ
2009-05-17 11:42 1703为什么需要Content Provider? 因为在An ... -
Android获取Contact Number的例子
2009-05-16 21:28 7235下面是论坛上有人写的关于获取Contact Number的co ... -
Security and Permissions 安全与权限 (八)
2009-05-13 21:22 2468URI Permissions The standard p ... -
Security and Permissions安全与权限(七)
2009-05-12 20:55 2103Other Permission Enforcement A ... -
Security and Permissions安全与权限(六)
2009-05-11 21:56 1445Enforcing Permissions when Send ... -
Security and Permissions安全与权限(五)
2009-05-10 15:04 2156Enforcing Permissions in Androi ...
相关推荐
NULL 博文链接:https://tojaoomy.iteye.com/blog/1523880
controlling special permissions, encrypting file systems, and much moreMaster the art of securing a Linux environment with this end-to-end practical guideBook Description This book has extensive ...
Script complex GPMC operations with PowerShell, including linking, backup, restore, permissions changes, and more Create a "change management" system with Advanced Group Policy Management (AGPM v4) ...
Permissions
Explaining the Android security model and architecture, the book describes Android permissions, including Manifest permissions, to help readers analyze applications and understand permission ...
NTFS权限管理.超好用工具.Permissions Tools ,可以快速更改共享文件夹或子文件夹权限,包括继承和非继承。还可以复制权限,批量粘帖权限。神一样的NTFS权限管理工具。
Chapter 4: Permissions and Security Chapter 5: Managing Scope Chapter 6: Performance Optimization Chapter 7: Scalable Dynamic Lists Chapter 8: Parameter Sniffing Chapter 9: Dynamic PIVOT and UNPIVOT ...
Application Security for the Android Platform by Jeff Six (英文版 完全文字版, 文件大小 5.51...4. Component Security and Permissions 5. Protecting Stored Data 6. Securing Server Interactions 7. Summary
We introduce theAndroid ...effectiveness and efficiency by modularizing different security models from related work, such as dynamic permissions, inlined reference monitoring, and type enforcement
Laravel开发-permissions Laravel权限处理程序
Elenkov describes Android security architecture from the bottom up, delving into the implementation of major security-related components and subsystems, like Binder IPC, permissions, cryptographic ...
Windows7 Permissions zh-CN最高权限获取工具,删除正在运行的病毒文件和垃圾软件文件。
This sample shows runtime permissions available in Android M and above. It shows how to check and request permissions at runtime, handle backwards compatibility using the support library and how to ...
Chapter 1: The Android Security Model – the Big Picture 7 Installing with care 7 Android platform architecture 9 Linux kernel 9 Middleware 11 Dalvik virtual machine 11 Application layer 11 Android ...
Android 6.0 permissions Demo
Safeguard files and directories with permissions and attributes Create, manage, and protect storage devices: both local and networked Automate system security 24/7 by writing and scheduling scripts ...
4.Permissions and Security 5.Managing Scope 6.Performance Optimization 7.Scalable Dynamic Lists 8.Parameter Sniffing 9.Dynamic Pivot and Unpivot 10.Solving Common Problems 11.Applications of Dynamic ...
烧瓶许可 Flask-Permissions是一个简单的Flask权限扩展,可与。 尽管这不是严格的要求,但它也可以与配合使用。安装使用PIP可以快速轻松地安装: pip install Flask-Permissions入门导入Flask,Flask-SQLAlchemy,...
此存储库包含Permissions API的某些源,Permissions API是Web应用程序能够管理权限的接口。 最新的编辑草稿位于
文件描述:RequiredPermissions.dll 文件大小:188K