react-native - 来自 Google Play 商店的隐式 PendingIntent 漏洞错误

标签 react-native flutter cordova ionic-framework huawei-mobile-services

问题描述:

最近,一些开发者报告说他们想要更新 Play 商店上的应用, 然而,它收到了 Google 的拒绝,标题为隐式 PendingIntent 漏洞,称其应用程序包含隐式 PendingIntent 问题。他们需要在 Play 管理中心显示的截止日期之前解决此问题,否则应用可能会从 Google Play 中删除。

enter image description here

类似问题:Google denied update due Remediation for Implicit PendingIntent Vulnerability

最佳答案

如@ tao提到了,让我在这里发布解决方案。


问题原因:

5.3.0.304版本之前的HMS Core Push套件、6.0.0.301版本之前的Analytics Kit早于 5.3.0.305 版本的帐户工具包包含隐式 PendingIntent 问题。

解决方案:

推送套件SDK version 5.3.0.304 、分析套件SDK version 6.0.0.301和 账户套件SDK version 5.3.0.305已发布并修复了隐式 PendingIntent 问题。它们已经过开发者的测试和验证,并且可以得到 Google 的批准发布。

如果您当前正在使用插件(如React Native、Cordova、Ionic、Flutter),在这些插件新版本发布之前,华为还提供了解决方案(通过手动更改版本号)。

下面介绍修改方法(基于5.x插件):

  • React Native:
  1. RN中安装HMS Core插件后,插件包存放在node_modules/@hmscore中。

    enter image description here

  2. 需要修改node_modules/@hmscore/react-native-hms-account/android目录下的build.gradle文件(将Account以Kit插件为例):

    打开build.gradle文件并更改dependency中的SDK版本。

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation 'com.facebook.react:react-native:+'  // From node_modules
    implementation 'com.huawei.hms:hwid:5.0.3.302'
}
  • 更新后,运行以下命令重新开始编译。插件下载新的SDK:

    react-native run-android


    • Cordova / ionic
    1. 如果您按照华为文档所述安装了该插件,则该插件应保存在node_modules/@hmscore文件夹中。

      enter image description here

    2. 您需要修改node_modules/@hmscore/cordova-plugin-hms-push目录中的plugin.xml文件。 (以下以Push Kit插件为例)

      打开Plugin.xml文件,搜索关键字framework,找到需要修改的SDK。

    <framework src="androidx.core:core:1.3.1"/>
    <framework src="com.facebook.fresco:fresco:2.2.0"/>
    <framework src="com.huawei.hms:push:5.0.2.301" />
    <framework src="resources/plugin.gradle" custom="true" type="gradleReference"/>
    

    将版本号更改为新版本号并保存。

  • 返回应用根目录并删除 platforms/androidplugins/cordova-plugin-hms-push 文件夹。

    enter image description here

  • 在根目录中运行以下命令:

    Cordova :

    cordova平台添加android

    cordova run android --device

    Ionic( Cordova ):

    ionic cordova平台添加android

    ionic 构建

    ionic cordova run android --device

  • ionic (电容器)以不同的方式工作:

    ①。从 android 目录中删除 capacitor-cordova-android-plugins 文件夹。

    enter image description here

    ②。根据步骤2中的描述修改plugin.xml文件。

    ③.运行以下命令:

    ionic 构建

    npx 上限同步

    npx cap 打开 android

    ④.在Android Studio中重新编译


  • 摘要

    以上插件均采用开源模式使用,开发者可以直接修改。

    但是,Xamarin插件是以Nuget Package模式发布的。因此,您无法修改SDK版本。如果出现此问题,请随时与我们联系。

    关于react-native - 来自 Google Play 商店的隐式 PendingIntent 漏洞错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68708777/

    相关文章:

    javascript - React Native+Redux : connect trouble

    javascript - 有没有办法在屏幕底部的页脚中打印并显示从 JSON 到达的总和对象?

    android - 无法在 android 上构建应用程序。多个链接错误

    flutter - 如何在 vscode (Flutter) 上的单次运行/调试中添加 --no-sound-null-safety?

    flutter - 如何在 flutter redux 中观察状态变化

    iphone - 在 iOS 7 中将 UIAlertView 中的消息对齐到左侧

    javascript - 世博地点权限立即被拒绝 iOS 模拟器

    ios - 无法在iPhone上模拟应用程序

    android - 带有 Openlayers 的 PhoneGap : popup which to redirect to another page get a error Uncaught ReferenceError: $ is not defined

    android - $.ajax() 在 phonegap 上