該漏洞的描述見鏈接文章:http://www.cnxhacker.com/2015/01/07/5603.html .
不對外暴露:應設置android:exported= "false" ,如: |
<activity
android:name= ".HomeActivity" android:exported= "false" > |
<intent-filter> |
<action
android:name= "android.intent.action.VIEW" /> |
<data
android:scheme= "http" android:host= "m.taobao.com" android:path= "/index.htm" /> |
<category
android:name= "android.intent.category.DEFAULT" /> |
</intent-filter> |
</activity> |
2 .
對外部暴露:需要從非本app的其它App(含二方、三方)中通過URL方式喚起。應設置android:exported= "true" ,且含有配置了URL規則的<intent-filter>,如: |
<activity
android:name= ".HomeActivity" android:exported= "true" > |
<intent-filter> |
<action
android:name= "android.intent.action.VIEW" /> |
<data
android:scheme= "http" android:host= "m.example.com" android:path= "/index.htm" /> |
<category
android:name= "android.intent.category.DEFAULT" /> |
</intent-filter> |
</activity> |
3 .
瀏覽器可跳入:在瀏覽器中訪問到與URL規則匹配的網址時,瀏覽器將彈出選擇提示,用戶可選擇使用本App或是繼續用瀏覽器打開。由於存在一定的用戶叨擾,所以須慎用,控制在儘可能小的範圍內。 |
設置
android:exported= "true" ,並在URL規則
的<intent-filter> 中添加BROWSABLE這個category,如: |
<activity
android:name= ".HomeActivity" android:exported= "true" > |
<intent-filter> |
<action
android:name= "android.intent.action.VIEW" /> |
<data
android:scheme= "http" android:host= "m.example.com" android:path= "/index.htm" /> |
<category
android:name= "android.intent.category.DEFAULT" /> |
<category
android:name= "android.intent.category.BROWSABLE" /> |
</intent-filter> |
</activity> |