从Google Play Store下载的应用程序,getInstallerPackageName()可能为空吗?[英] Is it possible that getInstallerPackageName() is null when app downloaded from Google Play Store?

本文是小编为大家收集整理的关于从Google Play Store下载的应用程序,getInstallerPackageName()可能为空吗?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

在我的应用程序中,我使用一些实现来检查该应用程序是否是从Google Play商店下载的.否则它不会启动. 为此,我使用/a>通过检查名称是否为com.android.verding.

这基本上可以在我的所有设备上都起作用,但是在Google Play中,发布前的报告告诉我,9个设备中有2个从该方法返回NULL. 现在有两种可能性.即使从Google Play商店下载它,此方法有时也有时返回null,或者是无效的,或者是无效的,因为预发明报告以某种方式导致了它.当无效时,这通常意味着未从Google Play商店下载APK.我不知道该预发明报告如何在后台起作用.也许在将APK部署在这些"测试设备"上之前,APK在后台处理.如果有可能的话,即使从Google Play商店下载它,有人是否有线索?

推荐答案

这听起来像是带有Google Play Pre-Launch报告的实现细节错误.请您联系Google Play支持,并让他们知道问题.检查您的安装来自Google Play应该是一件合理的事情.即使对于通过P2P共享进行的安装,如果您使用 Google Play P2P在Shareit/Xender/Files Go 安装程序仍然应该是Google Play.

上述建议适用于任何人 - 以下建议是针对原始询问的:

我将联系预发明报告团队,并询问他们(我为Google工作).请您联系Google Play支持,并让他们知道问题.如有必要,我请您要求您,并要求他们向我路由任何错误(他们应该能够按名称找到它们).如果您不得不从应用程序中删除支票,我真的很难过.

本文地址:https://www.itbaoku.cn/post/1937961.html

问题描述

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.

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?

推荐答案

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.

The above advice is applicable to anyone - the following is for the original asker:

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.