KeyguardManager和BiometricManager来自Android API在ChromeOS中。

huangapple go评论56阅读模式
英文:

KeyguardManager, BiometricManager from Android API in ChromeOS

问题

我们正在开发Android应用,但我们希望它也能在ChromeOS上运行。它确实可以运行,除了我们最新的一个功能会导致错误的否定。

所有KeyguardManager的方法都返回false。例如,https://developer.android.com/reference/android/app/KeyguardManager#isDeviceSecure() 或 https://developer.android.com/reference/android/app/KeyguardManager#isKeyguardSecure(),尽管Chromebook设置了密码。

或者BiometricManager返回https://developer.android.com/reference/android/hardware/biometrics/BiometricManager#BIOMETRIC_ERROR_NO_HARDWARE,即使笔记本电脑上有指纹传感器,https://developer.android.com/reference/android/hardware/biometrics/BiometricManager#canAuthenticate(int)。

我正在尝试找到解决方法,非常感谢任何帮助。

我在Google Groups中也有同样的问题,但没有运气(https://groups.google.com/a/chromium.org/g/chromium-os-dev/c/5fjBragbAIM)。

英文:

We're developing the app for Android, but we expect it to work in ChromeOS too. And it does work, except one of our latest features brings false negatives.

All KeyguardManager methods return false. For example https://developer.android.com/reference/android/app/KeyguardManager#isDeviceSecure()or https://developer.android.com/reference/android/app/KeyguardManager#isKeyguardSecure() despite that fact, that Chromebook has password

Or BiometricManager returns https://developer.android.com/reference/android/hardware/biometrics/BiometricManager#BIOMETRIC_ERROR_NO_HARDWARE for https://developer.android.com/reference/android/hardware/biometrics/BiometricManager#canAuthenticate(int) even with the laptop having fingerprint sensor

I'm trying to find a solution to this, any help is appreciated

I have same question in google groups, but no luck (https://groups.google.com/a/chromium.org/g/chromium-os-dev/c/5fjBragbAIM)

答案1

得分: 1

关于Android应用程序 - ChromeOS互操作性的文档不足。

Chrome OS 是一个基于Linux的操作系统,具有基于Chrome的用户界面。Android应用程序与Linux不兼容,使用ARC在特殊的虚拟机中运行APK文件。
类似的解决方案可以在Sailfish OSAlienDalvik/TurboDalvik VM)或WindowsWindows Subsystem for Android™)中找到。

这种解决方案的一般问题是虚拟机不能与主机操作系统提供适当的兼容性(技术限制或尚未实施),因此某些功能只是“存根”。

当我尝试在Acer Aspire 7 with fingerprint scanner & Windows 11上实施生物识别身份验证时,我遇到了类似的问题 - 所有与生物识别相关的类(FingerprintManagerBiometricPrompt/BiometricManager)只是存根。与此同时,Windows Hello(主机操作系统功能)正常工作。

这与你的Chromebook上情况相同 - 有PIN码/密码,也有指纹扫描仪,但你的应用程序无法按预期运行,因为API中存在许多存根。

因此,目前在Chrome OS/Windows等上通过编程方式解决问题的方法是等待将来的虚拟机更新。

英文:

There is a lack of documentation about Android apps - ChromeOS interoperability.

Chrome OS is a Linux-based OS with a Chrome-based UI. The Android apps are not natively compatible with Linux and used ARC to run APKs in a special crafter VM.
A similar solution you can find in Sailfish OS (AlienDalvik/TurboDalvik VM) or Windows (Windows Subsystem for Android™).

The general problem with a such solution - the VM does not provide proper compatibility with the host OS (technical limitations or not implemented yet), so some of the functions are is just "stubs".

I faced a similar problem when tried to implement biometric authentification on Acer Aspire 7 with fingerprint scanner & Windows 11 - all biometric-related classes (FingerprintManager or BiometricPrompt/BiometricManager) - just stubs. At the same time, Windows Hello (host OS feature) works properly.

This is the same as on your Chromebook - there is a PIN code/password, and there is a fingerprint scanner, but your application does not work, as was expected, because many stubs are present in the APIs.

Thus, there is no way at this moment to solve the problem programmatically, except to wait for future updates to the virtual machine on Chrome OS/Windows/etc.

huangapple
  • 本文由 发表于 2023年3月3日 19:58:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75626785.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定