从Google Play商店下载应用时,getInstallerPackageName()是否可能为null? [英] Is it possible that getInstallerPackageName() is null when app downloaded from Google Play Store?

查看:245
本文介绍了从Google Play商店下载应用时,getInstallerPackageName()是否可能为null?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我使用一些实现检查该应用程序是否是从Google Play商店下载的.否则它将无法启动. 为此,我使用 getInstallerPackageName(),方法是检查名称是否为com.android.vending.

In my app I use some implementation to check, if the app was downloaded from Google Play Store. Otherwise it does not start. For this I use getInstallerPackageName() by checking if the name is com.android.vending.

这基本上可以在我的所有设备上使用,但是在Google Play中,启动前的报告告诉我,在9台设备中,有2台通过此方法返回了null. 现在有两种可能性.即使从Google Play商店下载了该方法,有时返回的还是null,或者返回null,因为启动前的报告是由某种原因导致的.如果为null,则通常表示未从Google Play商店下载apk.我不知道这份发布前的报告是如何在后台运行的.也许在将APK部署到这些测试设备"上之前,它已经在后台进行了某种方式的处理.即使从Google Play商店下载了该值,是否有人知道此值是否为空?

This basically works on all of my devices, but in Google Play the pre-launch report tells me, that 2 of 9 devices return null from this method. Now there are two possibilities. Either this method returns sometimes null, even if it's downloaded from Google Play Store, or it is null, because the pre-launch report somehow causes it. When it is null, this would usually mean that the apk was not downloaded from Google Play Store. I have no idea how this pre-launch report works in the background. Maybe the APK is somehow processed in the background before it will be deployed on these "test devices". Does anybody have a clue if it is possible that this value is null, even if it is downloaded from Google Play Store?

推荐答案

这听起来像是Google Play发布前报告中的实现细节错误.请您联系Google Play支持人员,让他们知道问题所在.检查您的安装来自Google Play,应该是一件合理的事情.即使对于通过P2P共享为数据价格昂贵的用户提供的安装,如果您使用

This sounds like an implementation detail bug with Google Play pre-launch report. Please could you contact Google Play support and let them know the problem. Checking your install came from Google Play should be a reasonable thing to do. Even for installs that came via P2P sharing for users with expensive data, if you use Google Play P2P in ShareIt / Xender / Files Go the installer should still be Google Play.

以上建议适用于任何人-以下内容适用于原始提问者:

我将与发布前的报告小组联系,并询问他们有关该问题的信息(我为Google工作).请您联系Google Play支持人员,让他们知道问题所在.如有必要,告诉他们我要您这样做,并请他们将所有错误发送给我(他们应该可以按名称查找它们).如果您不得不从应用程序中删除支票,我会很难过.

I will contact the pre-launch report team and ask them about it (I work for Google). Please could you contact Google Play support and let them know the problem. If necessary tell them I asked you to, and ask them to route any bug to me (they should be able to find them by name). I'd be really sad if you had to remove the check from your app.

这篇关于从Google Play商店下载应用时,getInstallerPackageName()是否可能为null?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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