For various reasons I need to get from the iPhone the current date and time that can't be meddled with by the user. Yes, I've seen how one can check a server (e.g., here), but that's not invulnerable to tampering if you take a moment to reflect.
There are two knee-jerk reactions I'm expecting to hear:
- Use the GPS time.
- It can't be done.
In answer to another question, I've described my researches into this matter. To summarize them:
- The GPS time shifts with the user-defined settings.
- The iPhone definitely has an internal tamper-proof time and date, as shown when date-time reverts after
Set Automatically
in Settings > General > Time & Date is turned back to on
even in a fallout shelter.
What I want to know is how to access this tamper-proof time.
Edit
Just to be clear, the server-based solution is not suitable. For one, it could be faked. For another, the app needs to work without a network connection.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…