为什么HMS PushKit需要android.permission.REQUEST_INSTALL_PACKAGES [英] Why HMS PushKit needs android.permission.REQUEST_INSTALL_PACKAGES

查看:383
本文介绍了为什么HMS PushKit需要android.permission.REQUEST_INSTALL_PACKAGES的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我使用此gradle代码添加了HMS PushKit SDK:

Recently I've added HMS PushKit SDK with this gradle code:

implementation "com.huawei.hms:push:5.0.4.302"

之后,我注意到我的应用程序已添加到应用程序列表中,可以访问来自未知来源的安装应用程序(特殊权限).我检查了该库依赖项之一的 AndroidManifest.xml 文件( com.huawei.hms.base.availableupdate ),发现它具有以下特殊权限:

After That I've noticed that my application added to the list of apps with access to install apps from unknown source (special permission). I checked the AndroidManifest.xml file of one of this library's dependency (com.huawei.hms.base.availableupdate) and saw that it has this special permission:

<!-- If it is Android 8.0, the targetSdkVersion of the application compilation configuration>=26, please be sure to add the following permissions --> 
<uses-permission  android:name="android.permission.REQUEST_INSTALL_PACKAGES" />

那么为什么PushKit需要此权限?我不希望我的应用使用此权限.如果我用这段代码删除它,将会出现问题(崩溃):

So Why PushKit needs this permission? I don't want my app to use this permission. And If I remove it with this code is there gonna be a problem (crash):

<uses-permission
        android:name="android.permission.REQUEST_INSTALL_PACKAGES"
        tools:node="remove"/>

推荐答案

更新

如果删除此权限,它将不会在华为手机上受到影响,但非华为手机上可能未安装HMS Core APK.

If you remove this permission, it will not be affected on Huawei phones,but the HMS Core APK may not be installed on non-Huawei phones.

是否会因为升级失败而导致我们的应用程序崩溃?-不,只能使该应用程序无法自动升级,必须卸载并下载新版本.

can it cause to crash in our app because of upgrade failure?--no,Only will make the application cannot be automatically upgraded,have to uninstall and download the new version.

< uses-permission android:name =" android.permission.REQUEST_INSTALL_PACKAGES"/>

此权限用于更新HMS Core和Push kit APK.推包很大程度上取决于HMS核心和推包APK.如果未授予此权限,则可能无法安装应用程序,并导致HMS和Push kit的APK升级失败.

This permission is used to update the HMS Core and push kit APK. Push kit strongly depends on the HMS Core and push kit APK. If this permission is not granted, applications may fail to be installed, and causing upgrade failures of the HMS and push kit`s APK.

因此,此权限是强制性的.

Therefore, this permission is mandatory.

这篇关于为什么HMS PushKit需要android.permission.REQUEST_INSTALL_PACKAGES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆