首页 > 解决方案 > 如何更改 AppMeasurementInstallReferrerReceiver 权限

问题描述

目前我在 ionic 中的应用程序在执行安全扫描时检测到此问题广播接收器(com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver)受权限保护,但应检查权限的保护级别。权限:android.permission.INSTALL_PACKAGES [android:exported = true]

我目前正在编辑我的应用程序 config.xml 文件,但我不断收到消息:

在此处输入图像描述

我的 config.xml 是:

    <platform name="android">
        <hook src="hooks/add_tools_namespace.js" type="after_prepare" />
        <allow-intent href="market:*" />
        <allow-navigation href="*" />
        <allow-intent href="*" />
        <access origin="*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
        <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <application android:usesCleartextTraffic="false" />
            <application android:requestLegacyExternalStorage="true" />
            <application android:allowBackup="false" tools:replace="android:allowBackup" />
        </edit-config>
        <config-file file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <uses-permission android:name="android.permission.INTERNET" />
            <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        </config-file>
        <config-file file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <activity android:exported="false" android:name="com.google.android.gms.tagmanager.TagManagerPreviewActivity" android:noHistory="true" />
        </config-file>
        <config-file file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <receiver android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" android:permission="android.permission.INSTALL_PACKAGES" />
        </config-file>
        <config-file file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <receiver android:enabled="true" android:exported="false" android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:permission="com.google.android.c2dm.permission.SEND" />
        </config-file>
        <config-file file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <activity android:name="com.google.firebase.auth.internal.FederatedSignInActivity" tools:replace="android:standard" />
        </config-file>
        <config-file file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <activity android:exported="false" android:name=".com.google.firebase.auth.internal.FederatedSignInActivity" android:permission="com.google.firebase.auth.api.gms.permission.LAUNCH_FEDERATED_SIGN_IN" />
        </config-file>
        <config-file file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <service android:enabled="true" android:exported="false" android:name="com.google.android.gms.auth.api.signin.RevocationBoundService" android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION" />
        </config-file>
    </platform>

添加权限,但我不断收到错误

 <config-file file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
            <receiver android:enabled="true" android:exported="false" android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver" android:permission="android.permission.INSTALL_PACKAGES" />
        </config-file>

标签: androidxmlionic-framework

解决方案


推荐阅读