问题来源:手机厂商在进行GMS认证测试时测试出的问题,比如如下代码会产生权限安全问题
<receiver android:name=".wxapi.WXRegister" android:permission="com.tencent.mm.plugin.permission.SEND" > <intent-filter> <action android:name="com.tencent.mm.plugin.openapi.Intent.ACTION_REFRESH_WXAPP" /> </intent-filter> </receiver>
com.sohu.newsclient.wxapi.WXRegister (com.tencent.mm.plugin.permission.SEND)
问题分析:1.任何具有com.tencent.mm.plugin.permission.SEND权限的代码可能会执行你组件(如BroadCastReceiver)中的逻辑。
2.如果第三方危害性的应用首先安装已经注册了这com.tencent.mm.plugin.permission.SEND权限
<uses-permission android:name="com.master.me.CUSTOM_PERMISSION_TEST" android:protectionLevel="signature"/>
。
问题根源:At the beginning Lolipop OS, Basically, Duplicated custom permission definition is not allowed. (If A App defines Permission P and is installed, B App which defines Permission P can not be installed if A app and B App's signature is different.)
解决方法:
1.利用Android FrameWork来规避此问题
manifest> ... <activity android:name=".InternalActivity" android:permission="com.hiqes.sample.frm_enf_perm" android:exported="false" > <intent-filter> <action android:name="com.hiqes.sample.INTERNAL_ACTION1" /> <category android:name="android.category.DEFAULT" /> </intent-filter> <intent-filter> <action android:name="com.hiqes.sample.INTERNAL_ACTION2" /> <category android:name="android.category.DEFAULT" /> </intent-filter> ... </activity> .... </manifest>