I'm using Application.installerName to detect if the user installed the game from the Google Play Store or if they sideloaded a pirated copy of the game. If they have a pirated copy, the game throws an error. On legitimate copies from the Play Store, it should show com.android.vending. However, I am having an issue where Application.installerName is displaying com.google.android.packageinstaller on legitimate copies instead of indicating that the app was installed from the Play Store. This means the anti-piracy check fires for those copies, which is obviously bad. My question is, what causes installerName to show the wrong installer, and is there any way to check if an app actually was installed from Google Play? It seems that Android is able to figure this out, since sideloaded apps can't be updated through Google Play, so whatever mechanism does that could be repurposed for my anti-piracy check. However, I don't know how I would go about accessing that.