如何解决EventReceiver引起的隐私合规问题

更新时间:
复制为 MD 格式

问题描述

当 com.taobao.accs.EventReceiver 被提示存在隐私合规问题(例如:App 存在非服务所必需或无合理应用场景的行为,如监听系统广播 android.intent.action.BOOT_COMPLETED 以实现自启动)时,请注意:

3.7.5 及以上版本 开始,该 Receiver 的 android:enabled 属性已默认设为 false,正常情况下不会触发启动。

<receiver
    android:name="com.taobao.accs.EventReceiver"
    android:enabled="false"
    android:exported="false"
    android:process="@string/aliyun_accs_channel_process">
    <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.PACKAGE_REMOVED" />
        <data android:scheme="package" />
    </intent-filter>
    <intent-filter>
        <action android:name="android.intent.action.USER_PRESENT" />
    </intent-filter>
</receiver>

若仍需处理相关合规问题,可参考以下两种解决方案:

  1. 通过tool remove 方式掉这个Receiver
    <receiver
        android:name="com.taobao.accs.EventReceiver"
        tools:node="remove" />
  2. 直接升级到3.9.5及以上版本,已经移除掉相关的action
    implementation "com.aliyun.ams:alicloud-android-push:3.9.5"