Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make sure the Android application was installed from Play-Store

I've recently discovered the BlackMarket application, it is a rip of Google Play-Store apps, where these people take a paid app from the Play-Store and let their users download it and use it for free.

As a developer which plan on charging a buck for my app, this bothers me, and I would like to make sure that my application was installed via the Play-Store, or whatever store I approve of.

I guess that the only way to verify this sort of thing is via the campaign tracking, but since Google analytics v2, the tracking of the campaign is done with in a receiver in the Jar.

Is there any other way to determine the origin of the installation of my app? Is there a way to intercept the campaign tracking data?

Thanks.

like image 589
TacB0sS Avatar asked Jul 31 '13 11:07

TacB0sS


People also ask

How do I know if an app is installed Android?

Call the method isPackageInstalled() : boolean isAppInstalled = isPackageInstalled("com. android. app" , this.

Why apps are not installing from Play Store showing pending?

Begin with checking your device storage, a common cause for download errors. However, Google will notify if the device or SD card storage has insufficient space. You may have to free up some space by uninstalling unused apps. At times, updates or security patches of your device might cause download issues.


1 Answers

Check this link here. Then

PackageManager pm = getPackageManager();
String installationSource = pm.getInstallerPackageName(getPackageName());

When installed from the marked, the installationSource will return something like com.google.android% or com.android.vending%. However this changes and you have to maintain (support) it in case of a change - otherwise it will return null (from debugger) or some other package name, from some other application (the undesired ones :))

like image 133
g00dy Avatar answered Sep 28 '22 16:09

g00dy