Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by xikky · Aug 22, 2013 at 08:34 AM · androidgoogle playmarket

Identify which android market app is downloaded

Is it possible to identify if an apk is downloaded from Google Play or Amazone?

Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ShadoX · Aug 22, 2013 at 08:49 AM 2
Share

Depends on what you're talking about. Do you mean to detect if some App on the Users phone has been downloaded from a specific source or if your App was downloaded from one of those sites?

I guess that you could just build two version and just change one file/variable for each site.

avatar image xikky · Aug 22, 2013 at 01:36 PM 0
Share

I need to know if my app was downloaded from which site. The purpose is to avoid having to apks for each site.

avatar image raviraj_vdy · Apr 05, 2016 at 06:00 AM 0
Share

Hello Guys,

I wanted to know if there is a direct unity plugin available for the same as we want to implement the same for our game.

Thank you, Raviraj.

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by viraf · Jan 14, 2017 at 08:46 AM

You can use Application.installerName

https://docs.unity3d.com/ScriptReference/Application-installerName.html

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Dominic Cerisano · Feb 12, 2014 at 04:02 AM

This is the Android API code for checking the package installer name of an app. It is pretty secure, since the vendor is not stored in your app, but rather comes from the signed download service running on the user's device (eg. com.android.vending). Currently, only playstore and amazon report this. Seems that as of this writing, iOS and other platforms can also report this, but not in a secure way - they are easily spoofed. Android, with its signed apks has a distinct advantage here.

 // Dont just copy/paste this code - that is what automated crackers look for - cludge it!
 // No network communication is required at runtime.
 // myPackageName should decode at runtime to "com.yourpackagename"
 // google        should decode at runtime to "com.android.vending";
 // amazon        should decode at runtime to "com.amazon.venezia"; 
 
 public boolean scuttle(Context context, String myPackageName, String google, String amazon)
 {
   //Scallywags renamed your app?
 
   if (context.getPackageName().compareTo(myPackageName != 0)
     return true; // BOOM!
 
   //Rogues relocated your app?
 
   String installer = context.getPackageManager().getInstallerPackageName(myPackageName);
 
   if (installer == null)
     return true; // BOOM!
 
   if (installer.compareTo(google) != 0 && installer.compareTo(amazon) != 0)
     return true; // BOOM!
 
   return false; 
 }
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

20 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Specific Market to be allowed to play the game 0 Answers

Android game in amazon app market 0 Answers

If a player purchases a Non Consumable item in my game, will they be able to do so again after restarting the app? 1 Answer

How to include obb extension files in Google play developer console 0 Answers

app for android compatibe with few devices 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges