简体   繁体   中英

Is it possible to make Android HCE backward compatible (for versions below 4.4/KitKat)?

我知道HCE功能仅是在KitKat中引入的,但是由于整个概念只是在软件级别上,应该不应该探索AOSP代码并提取与HCE相关的更改并将其创建为某种库这样每台支持NFC但小于4.4的Android手机都可能兼容HCE?

I would assume that it's not that easy. On Android all interaction with the NFC contactless front-end is handled by the NFC system service (which interacts with the NFC interface library (libnfc-nxp or libnfc-nci). The overall NFC stack looks about like this:

+----------------------------------------------------------------+
| App using NFC functionality (reader/writer, peer-to-peer, HCE) |
+----------------------------------------------------------------+
                               |
                               |
+----------------------------------------------------------------+
|               Android NFC API (Framework/Java)                 |
+----------------------------------------------------------------+
|         NFC system service (Java + native components)          |
+----------------------------------------------------------------+
|        NFC interface library (libnfc-n__, native code)         |
+----------------------------------------------------------------+
|                NFC interface driver (Kernel)                   |
+----------------------------------------------------------------+
                               |
                               |
+----------------------------------------------------------------+
|         NFC contactless frontend chip (Broadcom, NXP)          |
+----------------------------------------------------------------+

In order to add HCE, parts of the NFC interface library (?), the NFC system service and the Android NFC API need to be changed. While it should be possible to integrate the relevant code from the API layer to the application and directly interface to the NFC system service, you cannot change the NFC system service (and the libnfc-n__) without modifying the Android operating system itself.

You could, however try to root the device and modify all these components. (The relevant components are all in user-space, so this should not be a problem.) But then you could also directly install Android 4.4+ on that device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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