该漏洞的描述见链接文章: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> |