Protecting your In-App purchases?

I’m wondering where would I start and what tools should I use for protecting stuff like In-App purchases because there are some apps like freedom and lucky patcher which basicly allows you to fake the purchase and then you get the things like free money in that game.

So how do you fight those? I know they are illegal in some countries but the rest of the world can just cheat like that. It’s rediculous and some games already fighting against it (I think their trick is if the trasaction is not confirmed officialy then it wont work).

Yet I still dont know how secrue unity In app purchases are and maybe there could be something in the asset store that can help with that.

It’s Android - the most pirated platform on planet Earth. I’m not sure there is much you can do that would be worth your while.

Well for example that doesnt work shadowgun deadzone so guess there is a way, you just gotta find out.

It’s possible to buy a inApp product, then ask a refund from Google, I have so many refund asked every month for my games :frowning:
You can crypt what you want, or save the uid on your server for each product bought, you can’t secure your inApp.

In my games I crypt everything, and restore sometime non consumables inApp

You could look at trying to assign IAP’s a unique code & then match that up with the payment & after a certain period of time kill the game for people that have an IAP & no corresponding payment.

Of course, it’s only really worth it if they are affecting multiplayer balance. If they a just giving themselves unlimited gold so they can finish the solo game then it probably isn’t worth the effort as they are only ruining the game for themselves.

You might be missing out on small income but the solution would probably cause more hassle, time & expense than you would earn because the people that are willing to pay are already paying you. Stopping the cheats won’t actually earn you any more since they obviously don't intend to spend any real .

4 Likes

Store the player’s virtual currency balance on your server, and validate the purchase receipts by having your server talking to the Apple/Google servers.

Then have the game client check your server what the actual currency balance is, and when unlocking an item, or buying an in-game upgrade with currency, validate with your server the player account has enough money to make the upgrade.

While this won’t prevent all hacking, it certainly adds another layer of complexity.

6 Likes

From a cost perspective, I’d have to ask: Does your game JUST have in-app purchases that affect the individual player, or is there something like a multiplayer mode where what people have purchased changes the game for other players?

If a hacked in-app purchase only affects the individual player or copy of the game, then forget it. It’s just not cost effective, especially on Android, to try and fight it. Big companies with massive budgets for developing new security loose that battle; you will lose that battle too.

If hacking an in-app purchase can hurt the play experience of other customers, then both your need and your situation changes. Your situation changes because if everyone is playing on or through your servers, you can check the purchases applied to the account versus the purchases you have listed, banning anyone who has a certain amount of “unexplained” content. Your need changes in that you want to prevent hacking or duping or whatever from ruining the experience of other customers as that will cost you good will and future business.

You could also take the approach of having official servers or matches or whatever where the player’s game is validated for purchase, but then just ignore matches not set up through the official server since you’ll never win that battle.

Either way, protect your own game’s purchase server. Unless you’re a network security expert, this means paying someone else to protect it for you. Just as I would never try to write my own money processing code for a website because I know the hackers have far more experience than me, I’d never try to handle money processing myself. I don’t know Android, but as I understand it there are marketplaces like Google where you sell your game and they can handle the money part for in-app purchases as well.

7 Likes

anyone know about providers of the service?
like braintree i guess ?
like you just pay them a percentage of your earnings, you add their code to your game, theyre program takes care of the hard work… i guess??

i dont know much about mtx systems, ive generally hated the idea … but kinda changing my thought about em

… oh… its still my server… that kinda sucks lol
ehh yeah iam looking at PC … i guess steam has some (relatively) new thing now too?
i dunno iam behind on this stuff

But however how is it possible that some lucky patcher and other hacking tools dont work on some offline game. How did they do it.

Probably by having custom/bespoke protection built in, rather than using common techniques that have common (and automated) foils. The issue is that if someone experienced specifically targets a game then they probably won’t take too long to beat it, rendering the time you spent on implementing it practically wasted.

4 Likes

Hmmm thanks man. Thats very true

Someone trying to steal in app purchases wasn’t going to pay money for them anyway. I’d only bother with this if it involved PVP multiplayer, but if that is the case you could handle things like item inventories all server side.

Everybody here is saying that if the player is hacking then he won’t be willing to pay money from the start, however. People who are willing to pay probably won’t pay when they find out they can just hack the game for free, right ?

3 Likes

I could pirate my entire steam library but I still chose to buy them.

1 Like

Hacking games is not common knowledge. It just appears that way because the number of people using the platform is very high resulting in an abnormally large number of hackers. If it’s not common knowledge then they would have to be looking for it.

Working off of the above assumption that hacking is not common knowledge, if someone were willing to pay would they have gone searching for a way to hack the game? If someone were searching for a hack were they truly willing to pay for the game?

There will be exceptions but I believe the majority of the time the answer will be “no” to both of these questions.

IAP systems on all platforms provide methods to validate purchases using cryptographic signatures on your server. So you just make the server authoritative for does the player have an item or whatever the content is. If it’s content you can unlock treat it like an item, only download it to the client if the server say’s they have unlocked it.

That’s just the standard way it’s done. And by server I mean cloud service of some type. If you don’t want to do that, you really have no business using in app purchases. It’s not just you it effects if you get hacked, it’s your customers that didn’t hack as well as the IAP provider potentially. It’s unethical not to do it right.

3 Likes

Hi, I really like this approach, I am using playfab to validate the receipts but how do I download the files to the player’s device after the purchase is validated?

How are you downloading them at any other time?

Typically you would have a web service running somewhere which sends content files for your game upon request. For instance, something like a web call to:

https://mygame.com/getskin?id=11111

If the server doesn’t know who is requesting the content then all it can do is blindly send it. In other words, it’s relying on the client side to only make legitimate requests. However, clients can be hacked, so you can’t assume that they only make requests for content they should be able to access.

Instead, you can change your service’s API to something like:

https://mygame.com/getSkin?id=11111,user=22222,receipt=abc123def456

On the back end, the server now has some info to check for itself whether the request is ok. It can request from your IAP provider to see if receipt ‘abc123def456’ exists, is associated with user ‘22222’, and includes an ID matching content ‘11111’. If that all pans out then send the content, otherwise send an error message.

Of course that query isn’t too hard to write for people familiar with such things, but it does mean that your content server has to be designed and implemented to include metadata for all assets. Straightforward enough if you do it from the start, quite a pain if you decide to add it in later.

1 Like

Note that doing the above only works for some types of purchases. If the player needs to download content before they can use it, or if it is to access something which requires ongoing communication with a server, then it can be quite effective. That’s because data or functionality from the online service is required. If the server doesn’t do its piece then the client doesn’t have everything it needs to do the thing.

However, for stuff like consumable items, or access to content which is included in the game anyway, the above is easy to defeat. An unhacked client may ask permission from the server before doing or enabling something, but a hacked client can simply pretend the answer is always yes, or a spoof server be put in place.

1 Like

So for a simple game, the likes of angry bird. This is overkill right? Just keep everything on the device?