最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android中Permission權限機制的具體使用

 更新時間:2015年04月07日 10:24:41   投稿:junjie  
這篇文章主要介紹了Android中Permission權限機制的具體使用,本文講解了權限級別 protection level、ICC(inter-component communication)權限保護等內容,需要的朋友可以參考下

由上篇Android Permission權限機制引子,我們知道Android 通過在每臺設備上實施了基于權限的安全策略來處理安全問題,采用權限來限制安裝應用程序的能力。本篇文章繼續(xù)來探討和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時,并且指定了某些組件需要該自定義權限才能打開,這是前提,然后用戶又開發(fā)了另外一個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其實就是系統(tǒng)級別的定制了,一般用的很少。

ICC(inter-component communication)權限保護

<application>元素和組件元素都有android:permission的屬性,在這里我們稱這個屬性分別為應用程序和組件的權限標簽。應用程序內的組件可以繼承應用程序元素設置的權限標簽,當某一組件啟動 ICC 時,相關的訪問控制器就會查看組件和組件所在應用程序的權限標簽集合,如目標組件的訪問權限標簽在以上的集合內,允許 ICC 的建立繼續(xù)進行,否則將會被拒絕,即使這兩個組件在同一應用程序內。

改圖描述了該邏輯的進程:組件A是否可以訪問組件B和C,取決于比較B和C內的訪問權限標簽與應用程序1內的標簽集合的結果。B和應用程序1內都有i1標簽,所以組件A可以訪問組件B,相反應用程序1內沒有標簽i2,組件A 不可以訪問組件B。

相關文章

  • android中圓角圖像生成方法

    android中圓角圖像生成方法

    這篇文章主要介紹了android中圓角圖像生成方法,涉及Android處理圓角圖像的技巧,需要的朋友可以參考下
    2015-04-04
  • Android TabLayout實現京東詳情效果

    Android TabLayout實現京東詳情效果

    這篇文章主要為大家詳細介紹了android TabLayout實現京東詳情效果,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2016-09-09
  • Android開發(fā)之繪制平面上的多邊形功能分析

    Android開發(fā)之繪制平面上的多邊形功能分析

    這篇文章主要介紹了Android開發(fā)之繪制平面上的多邊形功能,結合實例形式分析了Android多邊形圖形繪制的原理、步驟、相關操作技巧與注意事項,需要的朋友可以參考下
    2017-09-09
  • Jetpack Compose實現對話框和進度條實例解析

    Jetpack Compose實現對話框和進度條實例解析

    對話框和進度條其實并無多大聯(lián)系,放在一起寫是因為兩者的內容都不多,所以湊到一起,對話框是我們平時開發(fā)使用得比較多的組件,進度條的使用頻率也很高,比如下載文件,上傳文件,處理任務時都可以使用進度條
    2023-04-04
  • Android Handler移除Message詳解及實例代碼

    Android Handler移除Message詳解及實例代碼

    這篇文章主要介紹了Android Handler移除Message詳解及實例代碼的相關資料,需要的朋友可以參考下
    2017-02-02
  • 詳解Android全局異常的捕獲處理

    詳解Android全局異常的捕獲處理

    這篇文章主要為大家介紹了Android全局異常的捕獲處理,為什么要進行捕獲處理,如何進行捕獲處理,想要了解的朋友可以參考一下
    2016-01-01
  • Android 第三方庫lottie、mmkv的使用詳解

    Android 第三方庫lottie、mmkv的使用詳解

    lottie是Airbnb開源的一個面向 iOS、Android、React Native 的動畫庫,能實現精美、復雜的動畫效果,本文通過實例代碼給大家介紹Android 第三方庫lottie、mmkv的使用,感興趣的的朋友一起看看吧
    2021-04-04
  • Android開發(fā)之自動朗讀TTS用法分析

    Android開發(fā)之自動朗讀TTS用法分析

    這篇文章主要介紹了Android開發(fā)之自動朗讀TTS用法,較為詳細的分析了TTS的概念、功能、使用方法與相關注意事項,需要的朋友可以參考下
    2016-06-06
  • Android RadioGroup 設置某一個選中或者不可選中的方法

    Android RadioGroup 設置某一個選中或者不可選中的方法

    下面小編就為大家?guī)硪黄狝ndroid RadioGroup 設置某一個選中或者不可選中的方法。小編覺得挺不錯的,現在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-04-04
  • Kotlin Flow封裝類SharedFlow StateFlow LiveData使用對比

    Kotlin Flow封裝類SharedFlow StateFlow LiveData使用

    這篇文章主要為大家介紹了Kotlin Flow封裝類SharedFlow StateFlow LiveData使用對比,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-08-08

最新評論

新竹市| 社会| 额敏县| 泉州市| 尉犁县| 吉水县| 孟村| 济宁市| 东乌| 南雄市| 水城县| 屏边| 奈曼旗| 磐安县| 绍兴市| 德昌县| 普格县| 桂平市| 天等县| 伊春市| 土默特左旗| 威宁| 博野县| 晋州市| 汉中市| 吴桥县| 错那县| 德江县| 莱阳市| 建水县| 鄢陵县| 土默特右旗| 深泽县| 柳州市| 钟祥市| 元江| 南昌市| 宣化县| 岳阳县| 大埔区| 天台县|