简体   繁体   English

我可以判断一下iPhone是否有密码?

[英]Can I tell if the iPhone has a passcode?

I'm developing an application that asks for a PIN when you start it. 我正在开发一个应用程序,当你启动它时会要求输入PIN码。 That's not great, but I can live with it. 那不是很好,但我可以忍受它。 The problem is I'm being asked to ask for the PIN each time the phone wakes from sleep, too. 问题是,每次手机从睡眠状态唤醒时,我都会被要求输入密码。 Combined with the OS asking for its passcode, it's too much. 结合操作系统要求输入密码,这太过分了。

Is there any legitimate way to detect if the phone has a passcode required for waking, so I can skip requiring a PIN in this case? 有没有合法的方法来检测手机是否有唤醒所需的密码,所以在这种情况下我可以跳过要求PIN码? I don't want to know the PIN and I don't actually care if it was locked (for instance, if the phone was asleep very briefly), I just want to know that the data is in some way "protected." 我不想知道PIN,我实际上并不关心它是否被锁定(例如,如果电话非常短暂地睡着了),我只想知道数据在某种程度上是“受保护的”。

For AppStore or not? 对于AppStore与否? If the former, no way. 如果是前者,没办法。


In 3.x, the passcode is stored on the keychain, that means you have to get into the SpringBoard process to determine whether a passcode exists and nonempty. 在3.x中,密码存储在密钥链中,这意味着您必须进入SpringBoard进程以确定密码是否存在且非空。 If you are in SpringBoard, calling -[SBAwayController isPasswordProtected] will determine if the device has passcode. 如果你在SpringBoard中,调用-[SBAwayController isPasswordProtected]将确定设备是否有密码。

我为同样的问题创建了一个非常难看的解决方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM