Can I use AsyncTask to create a background-running rewards timer and replace the cheatable DateTime?

Hello,

Can I use AsyncTask to create something like a background counter that will always run even if the application is not running. I’m making a rewards system but I don’t want to use DateTime becase it’s easily exploitable but I also don’t want to require internet from the user. Making a background counter seems like the best solution, but what will happen if the phone is off or if the battery is taken off?

This game https://play.google.com/store/apps/details?id=com.TreetopCrew.VirtualBeggar has achieved exactly the result I want but I don’t know how. Their rewards system (for example wait 5 hours to get something…) can’t be exploited by changing the OS time, I even tried to take out the battery and put it back again after changing the time but it still kept it’s time. The game also doesn’t require internet. How is that possible? Is there some part of the phone that is always running?

  • Thanks

I’m pretty certain I’m correct on this. Most likely they are using native code to create a timer that can tick away and stop and start even if the device is turned off or restarted, etc. At least, this is my guess. Something like this