Android install source

末鹿安然 提交于 2019-12-12 07:19:09

问题


Is it possible to get the source of install from an Android app?

I mean, I want to see, if the app is installed from the Play Store, Amazon Appstore or via executing an APK.

PS: I think to see it while my app crashes and I was able to send an bug report, that my app was installed via Play Store. How do I get this value?


回答1:


The PackageManager class supplies the getInstallerPackageName method that will tell you the package name of whatever installed the package you specify. Side-loaded apps will not contain a value.

The latest version of the Amazon store finally sets PackageManager.getInstallerPackageName() to "com.amazon.venezia" as well to contrast with Google Play's "com.android.vending".

Source: How to know an application is installed from google play or side-load? For an Example: getInstallerPackageName returns null




回答2:


Use getInstallerPackageName.

This stores the packageName of what installed the application.

  • Google Play: "com.android.vending"
  • Amazon Appstore: "com.amazon.venezia"


来源:https://stackoverflow.com/questions/23262979/android-install-source

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!