gpt4 book ai didi

安卓指纹检测新增手指

转载 作者:行者123 更新时间:2023-12-03 15:25:02 24 4
gpt4 key购买 nike

如何检测用户在我的应用程序中验证手指后是否将新指纹添加到 Android 设置?

即 iOS 有一个叫做 (evaluatePolicyDomainState) 的东西来检测指纹目录的变化 Android 中的替代方案是什么?

在这种情况下,出于安全原因,这需要提示密码

最佳答案

来自 setUserAuthenticationRequired 的文档:

The key will become irreversibly invalidated once the secure lock screen is disabled (reconfigured to None, Swipe or other mode which does not authenticate the user) or when the secure lock screen is forcibly reset (e.g., by a Device Administrator). Additionally, if the key requires that user authentication takes place for every use of the key, it is also irreversibly invalidated once a new fingerprint is enrolled or once no more fingerprints are enrolled, unless setInvalidatedByBiometricEnrollment(boolean) is used to allow validity after enrollment. Attempts to initialize cryptographic operations using such keys will throw KeyPermanentlyInvalidatedException.



因此,要检查自创建指纹关联 key 以来是否已注册任何新指纹,只需使用该 key 创建密码并尝试 init密码。如果登记了任何新指纹, init调用应触发 KeyPermanentlyInvalidatedException .

关于安卓指纹检测新增手指,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44515668/

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