Code Monkey home page Code Monkey logo

Comments (6)

yvant avatar yvant commented on September 28, 2024 1

Great! Thanks of lot for the advice and for the snippet!

from ane-packagemanager.

marchbold avatar marchbold commented on September 28, 2024

Sounds like you might want to consider using Google Play Licensing?

This functionality is available for free through our Google Play Services libs:

Alternatively you can use this extension to check the installer package name which should be set to com.android.vending if an application was installed through the Play Store :

var installer:String = PackageManager.service.getInstallerPackageName();
if (installer == "com.android.vending")
{
    // Installed from the play store
}

https://docs.airnativeextensions.com/asdocs/packagemanager/com/distriqt/extension/packagemanager/PackageManager.html#getInstallerPackageName()

from ane-packagemanager.

yvant avatar yvant commented on September 28, 2024

Is there a difference between both solutions, in terms of security or reliability? At first sight, the one with PackageManager seems simpler to implement. Additionally, can the script that you suggested block "legit" users inadvertently? What I plan to do is: if the app doesn't come from the Play Store => the user cannot make in app purchases

from ane-packagemanager.

marchbold avatar marchbold commented on September 28, 2024

That definitely is a reasonable approach and one we have used in the past.

I just mentioned the licensing approach as it is a more "official" way of checking the legitimacy of an install.

from ane-packagemanager.

yvant avatar yvant commented on September 28, 2024

In the end, some fraudulent APKs still have the "com.android.vending" as installer, so I'm trying to implement the licensing method but it's not working. Here is some feedback:

  • Using the code in the related github, I get the errorcode 6
  • I used APM, and the generated app descriptor doesn't add <uses-permission android:name="com.android.vending.CHECK_LICENSE" />. Is it an issue?
  • I generated a random SALT that is stored in the APK, as mentionned on the wiki. Do I need to put it somewhere else? Is there something to do in the google play console?

from ane-packagemanager.

marchbold avatar marchbold commented on September 28, 2024

Yeah there isn't an apm package setup for this so you'll need to add the permissions into a project config or manually.

You'll need to work through the setup process outlined here as well: https://developer.android.com/google/play/licensing/setting-up

from ane-packagemanager.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.