LVL Licensing Information?

Can someone shed some light on this, looking at the documentation as it stands the only thing necessary to implement License checks on Android is a simple:

function licenseCheck (){
	// Android LVL Licensing Check
		if (iPhoneUtils.isApplicationGenuineAvailable){
			
			if (!iPhoneUtils.isApplicationGenuine)
			{
				myText = "Application Unlicensed";
			} else {
				myText = "All Good";
			}
		} else {
			myText = "Unable to Reach License Server";
			
		}
		
}

However, how does one need to set or access the server responses in code to deal with the various possible outcomes:

LICENSED | NOT_LICENSED | LICENSED_OLD_KEY | ERROR_CONTACTING_SERVER etc

What about Validity Timestamps, Grace Periods too - How are these handled by the current Unity LVL implementation?

Any information would be gratefully received - I wouldn’t want to build an app that kicks out users the moment their network is incapable of contacting the Licensing Servers?

Regards,

mmuller

Is there no one from Unity that can shed any light on this? iPhoneUtils.isApplicationGenuine doesn’t seem capable of returning the correct responses from the licensing server as they are booleans.

I am guessing here but I believe that Unity3D have only introduced a Policy to check whether the server is reachable or not and then whether the app is licensed or not. What happens if I have a license but am unable to get online to have it check? Is the policy used capable of allowing access based on a cached response?

you’re right, the current implementation is somewhat limited, as it basically can return a bool on iPhoneUtils.isApplicationGenuine and a bool on iPhoneUtils.isApplicationGenuineAvailable

And I guess I would point at plugins should you really need a full-feature implementation. At least for today.

LVL in Unity uses the default ServerManagedPolicy, meaning VT/GP is set by the LVL server.
iPhoneUtils.isApplicationGenuineAvailable returns true only if the iPhoneUtils.isApplicationGenuine can be ‘trusted’, meaning, a server response (or a cached response) with a valid key (LICENSED / LICENSED_OLD_KEY) will set isApplicationGenuine to true. ERROR_CONTACTING_SERVER is obviously setting isApplicationGenuineAvailable to false, and so on.

Then you probably need to handle it gracefully on your end. There is no guarantee that the network is available or that there is a cached license response available. What you decide to do in this case is up to you: you can decide to cache a positive license response for a longer period of time, or have the game ‘downgrade’ into an ad-based version, or close off some parts of the game (and inform the user that (s)he needs to validate the license again using a network connection). LVL doesn’t solve how you decide to handle those bits.

Yes, if the license server is not available LVL will never be able to determine whether the app is genuine or not (unless there is cached info); that’s how LVL works. ServerManagedPolicy means that there might be some caching, but there is nothing preventing the game to add additional validity time by caching it for an extended period.

Yes, it may return a positive response, but there is no guarantee for it. Maybe it’s the first time you’re running the app; then there is no cached response to read from.

if (NetworkOffline)
    if (HasNoCachedResponseOrTooOld)
        print("Need network for online check")
        return false
    else
        print("Using cached response");
        return CachedResponse
else if (LvlServerNotAvailable)
    if (HasNoCachedResponseOrTooOld)
        print("Error talking to license server; try again later?")
        return false
    else
        print("Using cached response");
        return CachedResponse
else
    print("LVL response available");
    CachedResponse = LvlServerResponse;
    return CachedResponse

Basically you have 3 states; Application is licensed (because the server says so), not licensed (because the server says so), and “undetermined” state (because of no servers/network nor a cached response was available).

So, its up to the application to decide how to deal with the ‘unknown’ state, as well as the two others.

Erique/Oleg,

Erique thank you for the wonderfully detailed response and you Oleg for the info regarding the current implementation and that a pure JAVA solution is the best approach. I have just a quick response in regard to erique’s post.

So in theory the whole LVL system is still fundamentally flawed and will be bypassed quite swiftly by seasoned hackers around the world yet again (as they have done on iPhone devices). In that they will firstly trace the app for network calls, deliberate on the responses and then factor the code to always return true or even replace the network calls with null’s and then set the booleans as true regardless!

Hmm, hardly seems worth penalising the legitimate users by having the software have to network coverage to play the game they legitimately bought.

One slight issue in one of your above ideas is that the GOOGLE terms and conditions state (unless I read them wrong) that if I am producing a paid app/game then that title must not include ad-based content, so the above may be breaking the T&C’s… Again, I would view that as penalising the legitimate user for the poor network reception of their carrier (not least of all if there is no network they wont receive the ad’s any how!!).

Stangely, I thought the caching was done by the ServerManagedPolicy and that it produced the caching files on the client side… just goes to show how I misinterpreted the Android LVL docs…

:slight_smile:

Many thanks,

mm

Yes, I’m not arguing that the original implementation of LVL from Google it is not flawed, nor that its not already hacked. :wink:

To clairfy; it does caching. How long a cache entry is valid is up to the server (hence the name ServerManagedPolicy). My point was only that there is nothing prohibiting the application of doing something ‘fancy’ on top (like using an extended cache entry) of the ServerManagedPolicy.

erique,

Totally understood that you were hinting at doing something ‘over the top’ of the google implementation - however like all anti-piracy systems - they all end up penalising the legitimate users. And the pirates end up with ‘better’ software as their version doesn’t have the ‘limitations’ of the legitimate one !

How wrong is that ! :smile:

Oh well, looks like it’ll be better just to give them something they wont expect - a blank spot where the copy protection would normally be ! If there’s no challenge then generally there’s no incentive to crack it…

So hopefully, if its cheap enough, good enough and fun enough - nice people will buy my game, the cheap guys and girls can just have it and maybe just maybe I’ll make some money out of it to buy food for my kids and also Unity Pro to develop something else even more fantastic next time round. :slight_smile: The ideas are already flowing so as long as I can make the license fees then more games will come :smile: