AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Fallout shelter save on ios location2/1/2024 ![]() ![]() so divide by one million to get milliseconds mach_absolute_time() returns billionth of seconds, ![]() (void) mach_timebase_info(&s_timebase_info) Static mach_timebase_info_data_t s_timebase_info Static const int64_t kOneMillion = 1000 * 1000 To make this more usable I use a function like the one below: #include In order to get it in a human readable form, you have to modify it by the result from mach_timebase_info (a ratio), which will return billionth of seconds (or nanoseconds). It returns ticks since the device was last rebooted (otherwise known as uptime). Mach_absolute_time depends on the processor of the device. However, you can check the mach_absolute_time to get untampered time since last boot up, and perhaps use it to at least be aware of how much time has passed since the app has been awoken (without having the potential for that time to be tampered with while the app is running). NSDate and it's CF counterpart are all based on the user controllable time, and thereby aren't tamper proof.Īs far as I know, there is no open API for either GPS time or carrier time directly. Another function gettimeofday() is similarly dependent on user-defined time. Unfortunately it too changes with the user-adjusted data and time, even without reboot. It's accessed through a call something like this: sysctlbyname("kern.boottime", &boottime, &size, NULL, 0). Addendum, July 2013įound a few more posts ( here, here and here) about another kind of time measure: system kernel boot time. The author of the penultimate comment tried this in a fallout shelter: so it's clear the phone is not getting the pristine time from any external source. So it seems that there is something like a tamper-proof time the device maintains internally. this works even after cycling the phone's power. Ugh.įunny thing that I found (still in airplane mode) is that if you tamper with the system clock (after turning to off Time & Date's Set Automatically), and then turn Set Automatically back to on, the machine restores the real (original) time without a hitch. But unfortunately this time seems to change with the system clock. I tried this code on an iPhone 4 in airplane mode (iOS 6.1), and even then it gives a time all right. It doesn't seem to be tamper-proof though. ![]()
0 Comments
Read More
Leave a Reply. |