![](/img/trans.png)
[英]Is it possible on iOS to use the hardware encryption with the device key and an app specific passcode?
[英]Is it possible to detect when the passcode on an iOS device is modified?
例如:我有一个使用 FaceID 登录的应用程序,密码是“1111”。 当我将密码更改为“2222”并重新启动应用程序时,它会检测到我的密码已被修改并自动从应用程序注销。
那么有可能做到吗?
我认为您可以使用evaluatePolicyDomainState获得此信息
可用于与该属性返回的其他值进行比较,以确定授权数据库是否已更新
代码示例:
迅速
let localAuthContext = LAContext()
if localAuthContext.canEvaluatePolicy(LAPolicyDeviceOwnerAuthenticationWithBiometrics, error: error) {
if oldBiometryData != nil && localAuthContext.evaluatedPolicyDomainState != oldBiometryData {
changed = true
}
}
目标-C
LAContext *localAuthenticationContext = [LAContext new];
if ([localAuthenticationContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:&error]) {
if (oldBiometryData != nil && ![localAuthenticationContext.evaluatedPolicyDomainState isEqualToData:oldBiometryData]) {
changed = YES;
}
}
使用oldBiometryData
是您存储在应用程序中的先前生物测定数据。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.