gpt4 book ai didi

ios - 某些 iPad 设备返回此代码不可用的生物识别信息,为什么?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:10:52 25 4
gpt4 key购买 nike

我在理解返回值时遇到了一些问题,即使是一个只有以下代码的新项目也是如此。

- (void)viewDidLoad {
[super viewDidLoad];

LAContext* touchContext = [LAContext new];
NSError* policyEvaluationError = nil;

[touchContext canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics
error:&policyEvaluationError];

NSLog(@"\n\n %@", policyEvaluationError);
}

这些只是 iPad 模拟器 iOS 10.3.1 - 11.3 上的结果。

iPad (5th Generation) - "Biometry is not available on this device."

iPad Air - "Biometry is not available on this device."

iPad Air 2 - “No identities are enrolled."

iPad Pro (9.7-inch) - "Biometry is not available on this device."

iPad Pro (12.9-inch) (2nd generation) - "Biometry is not available on this device."

“生物识别在此设备上不可用”的这些结果。这些设备是否注册时都会发生。

测试的所有 iPhone 设备类型也返回“未注册身份”。就像 iPad Air 2,我希望他们没有注册但拥有 touchID 硬件。注册时,根本没有错误。

在一些实际的 iPad 设备上,结果似乎也有所不同,但方式不同。如果没有存储指纹,某些设备会返回“此设备上不提供生物识别”。而其他人只是返回注册/零。存储指纹后,它们的行为似乎都符合我的预期。

据我所知,我们已经在生产中使用这段代码很长一段时间了,没有收到与此主题相关的投诉,但我们最近才在开发/QA 中注意到它。

这段代码是否在所有设备上都不可靠,是否可能发生了某些变化,或者我在这里做错了什么?

最佳答案

这是 Apple 框架中的一个错误,我已将其提交给 rdar://problem/46148637。如果您好奇,请查看该报告的全文:

iPad Pro (12.9-inch) (2nd generation) simulator thinks it doesn't have Touch ID

Summary:
LAContext().canEvaluatePolicy(_:error:) with the policy LAPolicy.deviceOwnerAuthenticationWithBiometrics fails with LAError.Code. biometryNotAvailable on the iPad Pro (12.9-inch) (2nd generation) simulator. A bit of digging suggests that:

• LAContext().canEvaluatePolicy(_:error:), from LocalAuthentication.framework, ends up communicating with coreauthd to evaluate the policy.
• The specific error is generated in -[BiometryHelper deviceHasBiometryWithError:] in DaemonUtils.framework, which is loaded into coreauthd.
• -[BiometryHelper deviceHasBiometryWithError:] returns this error when -BiometryHelper._device is nil.
• BiometryHelper._device is the first object grabbed from +[BKDeviceManager availableDevices], in BiometricKit.framework.
• +[BKDeviceManager availableDevices] *should* create a Touch ID device descriptor if it finds that the device supports Touch ID, which it checks by calling MGGetBoolAnswer(@"touch-id").
• MGGetBoolAnswer(@"touch-id") returns NO (!)
• The device believes it does not have a Touch ID sensor.
• LAContext().canEvaluatePolicy(_:error:) returns false because it believes the device cannot evaluate this policy.

Steps to Reproduce:
1. Try to evaluate a biometric policy on the iPad Pro (12.9-inch) (2nd generation) simulator.

Expected Results:
I either receive a success, or something about being unenrolled.

Actual Results:
I'm told that this iPad doesn't have a Touch ID sensor, when clearly should have one.

Version/Build:
Xcode Version 10.1 (10B61)

Configuration:
Xcode Version 10.1 (10B61)/macOS Mojave 10.14.2 Beta (18C48a)

关于ios - 某些 iPad 设备返回此代码不可用的生物识别信息,为什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50031743/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com