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

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

问题描述

在我的应用中,我使用一些实现来检查应用是否是从 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.现在有两种可能.此方法有时返回 null,即使它是从 Google Play 商店下载的,或者它为 null,因为预发布报告以某种方式导致它.当它为空时,这通常意味着该 apk 不是从 Google Play 商店下载的.我不知道这个发布前报告在后台是如何工作的.也许在将 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 共享为具有昂贵数据的用户提供的安装,如果您使用 ShareIt/Xender/Files Go 中的 Google Play P2P 安装程序仍应为 Google Play.

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() 是否可能为空?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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