2

If Google Play Game Services' Anti-Piracy Mode is enabled, then does it mean that, no more ridiculous high-scores will be appearing on Leaderboards? Because, as per Google:

If anti-piracy is turned on for your game, the Game service checks if a user is licensed to play your game. If none of the user accounts on a device are licensed for your game, the Game services calls sent by your game will fail and return a LICENSE_CHECK_FAILED status code.

To be licensed for your game, users must install it from Google Play.

I am just an ordinary developer and haven't reached the hacker level(probably will never ever) :D . But my deduction is that to hack the scores, you need to:

  1. open the apk
  2. modify the api call
  3. repack it
  4. install repacked apk.

But the last step will invalidate Google's condition(last line of the quote) hence making it impossible to hack. Is it true?

PS: Take Flappy bird's leaderboard for example. There are so many insane scores but the developer HAS'NT enabled anti-piracy mode since I can post my scores to it's leaderboard(I installed apk after downloading from a website). And hence that may be the reason.

DroidHeaven
  • 2,414
  • 3
  • 25
  • 31
  • It should fix simple piracy issues. I wouldn't take it as foolproof, but it should fix the easier ways of hacking it. Unless Google continually fixes holes as they come up expect new ways to break it to eventually be created. – Gabe Sechan Dec 21 '14 at 09:57
  • Licensed users can cheat too. It dies not matter where its installed from. – jww Dec 21 '14 at 09:57

2 Answers2

2

Score manipulation is done during runtime using some application that modifies values in memory (requires root). Turning on anti-piracy will NOT prevent this from happening.

You can (if you really want to) detect root and prevent your app from running on these devices (see this question/answer). I would not advise this though.

The best way to deal cheating in leaderboards would be to set a maximum score limit for leaderboards (something reasonable and almost possible, but not quite). Then also monitor the leaderboard for scores that reach the limit and remove them manually.

Edit:
Google has added tamper protection for leaderboards.

Community
  • 1
  • 1
free3dom
  • 18,729
  • 7
  • 52
  • 51
  • incidentally the link you provided was a question asked by none other than me! :) But I would like to know why you advised against it. Could you please explain? – DroidHeaven Dec 22 '14 at 17:47
  • I have a few rooted devices, but would never cheat on a leaderboard - I'm just a power-user and require root for various things. It makes no sense to exclude all root users like me from using your app just because 1% of root users may try to cheat. Root is not evil or wrong in itself, just the way some people use it :) – free3dom Dec 23 '14 at 07:25
  • 1
    As if they were listening, google just added [tamper protection for leaderboards](http://android-developers.blogspot.com/2014/12/google-play-game-services-ends-year.html) to the developer console :) – free3dom Dec 24 '14 at 09:43
  • What I'm interested in is how to "remove them manually" as you mention. – Csaba Toth Jan 27 '15 at 19:37
  • @CsabaToth only way I can think of doing this would be to create new leaderboards, then at app start (in a new version of course) read the player's current scores from the old leaderboards and post them to the new leaderboards only if they are valid. Then after some time delete/disable the old leaderboards. I've never tried this and I'm not sure if it can even be done (esp. removing old leaderboards) but it might be worth looking into. – free3dom Jan 27 '15 at 20:00
  • @free3dom Thanks, that sound cumbersome. And to be fair you'd need to transfer all data in between leaderboards, and as you mention it requires a new release. – Csaba Toth Jan 27 '15 at 23:14
  • The Tamper Protection DOESN'T work, I received fake scores even though the tamper protection was enabled from the start (new game, thus new leaderboard). – thiagolr Feb 11 '15 at 09:50
0

You should enable tamper protection for leaderboards. While this will not eliminate scores that have already been submitted, it will automatically hide tampered scores submitted in the future.

Sam Stern
  • 24,624
  • 13
  • 93
  • 124
  • How efficient is that? Is there any experience with that? – Csaba Toth Jan 27 '15 at 19:35
  • I just read that neither the Anti Piracy setting, nor the Tamper Protection is advised if you target multiple platforms. Sad. – Csaba Toth Jan 27 '15 at 23:15
  • The Tamper Protection DOESN'T work, I received fake scores even though the tamper protection was enabled from the start (new game, thus new leaderboard). – thiagolr Feb 11 '15 at 09:51