有没有办法在iPhone上获得防篡改的日期和时间? [英] Is there any way to get the tamper-proof date and time on iPhone?

查看:142
本文介绍了有没有办法在iPhone上获得防篡改的日期和时间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于各种原因,我需要从iPhone获取当前日期和时间,不能被用户所吸引。是的,我已经看过如何检查服务器(例如,这里),但是如果你不能篡改花一点时间反思一下。

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:


  1. 使用GPS时间。

  2. 无法完成。

在回答另一个问题,我已经描述了我的对这个问题的研究。总结一下:

In answer to another question, I've described my researches into this matter. To summarize them:


  1. GPS时间随用户定义的设置而变化。

  2. iPhone绝对具有内部防篡改时间和日期,如设置>常规>时间&中的自动设置后的日期时间所示。日期在上,即使在一个落户庇护所。

  1. The GPS time shifts with the user-defined settings.
  2. 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.

要清楚,基于服务器的解决方案是不合适的。一个,它可以是假的。另外,应用程序需要在没有网络连接的情况下工作。

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.

推荐答案

假设你总是有Internet可用,你可以实现一个类或连接到远程网络时间协议服务器的对象。

Assuming you always have Internet available, you could implement a class or object that connects to a remote Network Time Protocol server.

这是一个开源的GitHub项目,应该让你开始以及我发现的相关StackOverflow问题

这篇关于有没有办法在iPhone上获得防篡改的日期和时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆