Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check Android licensing permission of other applications

I have a free application that has a number of paid-for upgrade applications you can buy for it. The base game is free and remains the application that the user always launches, it detects the presence of the other applications and unlocks various upgrade features as appropriate.

I wanted to use the new licensing service to detect whether the bought applications were licensed, and pass the name of the package to the licensing service to verify if it is authorised (and blindly following the sample I stupidly assumed that passing in the package name to the obfuscator meant that the package name was passed to the licensing server - oops). However I've just realised how dumb that was, and in any case I have hit a brick wall: "If you already published your application as free, you won't be able to upload an updated version that includes licensing (that is, an application that uses the same package name and that includes the licensing permission)".

So, a two-part question: is there any plan to implement what I'm looking for: to check from inside a free application whether any of my other paid published applications are licensed?

If not, then what would be the best way of achieving what I'm seeking? I'm thinking of maybe sending an intent to each of the installed upgrades, getting them to perform the licensing check, and then getting the upgrades to pass the response back into my base application. Sounds a bit messy - any better ideas?

Thanks loads!

like image 957
Kenton Price Avatar asked Aug 02 '10 01:08

Kenton Price


People also ask

How do I check if permission is granted Android?

checkSelfPermission(activity, Manifest. permission. X) checks if any permission is already granted, if you check out other answers they do the same, and rest of the code asks for the permissions not granted.

How do I license Android apps?

Google Play offers a licensing service that lets you enforce licensing policies for applications that you publish on Google Play. With Google Play Licensing, your application can query Google Play at run time to obtain the licensing status for the current user, then allow or disallow further use as appropriate.


1 Answers

So, a two-part question: is there any plan to implement what I'm looking for: to check from inside a free application whether any of my other paid published applications are licensed?

There is no way to do this.

If not, then what would be the best way of achieving what I'm seeking? I'm thinking of maybe sending an intent to each of the installed upgrades, getting them to perform the licensing check, and then getting the upgrades to pass the response back into my base application. Sounds a bit messy - any better ideas?

That sounds like the most reasonable way of doing it, assuming you have no other way of communicating between the clients (e.g. shared storage where you can write the licence status to).

You just probably want to make sure that you secure these methods with custom permissions, so that only your apps can broadcast the licence status to your apps.

like image 166
Christopher Orr Avatar answered Oct 20 '22 00:10

Christopher Orr