Android 和 Symbian NFC 移动开发问题与解答 (FAQ)
让我们分享关于 NFC 开发、技术的共同想法……我热烈欢迎您提出任何意见 - 无论是关于 Android 或 Symbian SDK 还是关于 NFC 的一般情况。
从我的角度来看一般问题是我们可以开发什么,即我们可以利用 NFC 技术将哪些类型的应用推向市场?我们开发者如何才能从 NFC 中赚钱并受益?
我认为人们期望 NFC 将为开发者打开众多服务和可能性的大门 - 但这是真的吗? NFC 与其他无线技术(BT、WiFi)之间的区别在于,它已经提供了主要用例 - 支付、交通票和钥匙(楼宇门禁)。但对于所有这些用例,您都需要一个安全元件,该元件
- 要么由手机制造商控制,例如 Google – 请参阅 Google 钱包,它专门使用 Nexus S 上的内置 NXP SecureMX(这是如果我们不想损害安全性,则很难更改的东西),
- 或通过 SIM 卡上的 UICC 访问(在 Android 和 Symbian/和 MeeGO/ 手机上也是如此);这里必须与运营商达成协议。
但是,一个国家有 3 到 4 个运营商,对于一家中型公司来说,他们允许在 SIM 卡上运行小程序的可能性有多大?那么更多的全球解决方案呢?所有上述服务/用例都需要所有参与者的大量协调和完善的生态系统(银行、移动网络运营商、NFC 芯片生产商、手机制造商、TSM...)。
它们仍然是 p2p 应用程序、标签读取的选项,但许多功能已经内置在手机中,所以这看起来不像金矿……
我认为如果手机包含 NFC,机会会更大 - WI(S2C) – 拥有此接口(由 ECMA 指定)和支持 NFC-WI 的微型 SD 卡(已由 SD 卡协会指定)将可能允许为任意公司购买带有安全元件的 SD 卡……但市场上没有而且看起来不会很快出现任何东西。
您对 NFC 和手机开发的愿景和经验是什么?
Let’s share on a common place ideas about the NFC development, technology… I warmly welcome any comments you might have – either about the Android or Symbian SDK or about the NFC in general.
From my point of view the general question is what we can develop, i.e. what kinds of applications can we bring to the market with the NFC technology? And how can we, developers, earn money and benefit from the NFC?
I think there is an expectation the NFC will open the door for numerous services and possibilities for developers – but is that true? The difference between the NFC and other wireless technologies (BT, WiFi) is that it already comes with major use cases – payment, transportation tickets and keys (building access). But for all these use cases you need a secure element, which is
- either controlled by the phone manufacturer, e.g. Google – see Google Wallet which uses exclusively the built-in NXP SecureMX on Nexus S (and this is something which can be very hardly changed if we do not want to compromise the security),
- or accessible via UICC on SIM card (on Android and Symbian /and MeeGO/ phone as well); here the deal has to be made with operators.
But having 3 or 4 operators in a country, how probable it will be for a middle-sized company that they will allow running their applets on SIM cards? And what about more worldwide solutions? All above mentioned services/use cases need a lot of coordination of all the players and a well established ecosystem (banks, MNO, NFC chip producers, phone manufacturers, TSM…).
They are still options for p2p applications, tags reading – but many functionality will be already built-in in the phone, so this does not look like goldmine…
I think the chances can be bigger if the phone will include the NFC-WI(S2C)
– having this interface (specified by ECMA) and micro SD cards with the NFC-WI support (already specified by the SD card association) will possibly allow purchasing the SD cards with secure elements for an arbitrary company… But it is not on the market and it does not look anything will appear soon.
What is your vision and experience with NFC and mobile phone development?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了更加实用,而不仅仅是理论上,我在 xda-developers 在当前唯一支持 NFC 的 Android 手机(Nexus S)上启用卡模拟模式。您和其他人可能有兴趣自己尝试卡模拟模式。请考虑到这仅用于实验目的。
它们适用于 AOSP 源的姜饼版本 2.3.4_r1。它们允许:
到目前为止,我对 Android 上的 NFC 卡模拟的了解是:
顺便说一句,您提到的技术 (NFC-WI) 已在 Nexus S 中使用,用于将 NFC 控制器与嵌入式安全元件互连。
更新
总而言之,我回答了 Sten 的问题:
简短回答是,我确实从外部读卡器访问了 Mifare 4K。我也可以修改默认键。困难来自于修改系统源代码和自己构建自定义固件。
理论上没有。另一种选择是将 APDU 发送到 SIM,其中包含要在 Mifare 卡上执行的 Mifare 命令。
暂时没有。尽管您使用seek-for-android 补丁修改了 AOSP 源代码(我自己就是这样做的),但您的应用程序只会在普通手机上崩溃。原因是他们没有实施3GPP TS 27.007技术规范,允许应用处理器直接向 SIM (UICC) 发送 APDU。
然而,隧道前方可能会有一些曙光,因为法国的 citizy 项目已经在使用 NFC 的安全元件模式Android 手机技术,采用 UICC 安全元件方法。事实上,有一个修改过的 正在使用的三星 Galaxy SII 型号和新的宏碁 Liquid Express 也将很快可以集成到 citizy 中。这些手机必须在其基带处理器固件中实现所需的 TS 27.007 规范。当谈到应用处理器时,我不知道他们是否采用了 G&D 路径中的 SEEK-for-android 或 Insecure 中的 OpenNFC。作为法国人,我会为最后一个赌注全押。
In order to be a little bit more practical, and not only theoretical, I have posted some patches on xda-developers to enable card emulation mode on the currently unique android phone supporting NFC (the Nexus S). You and others might be interested in playing around with card emulation mode by yourselves. Take into consideration that this is only for experimental purposes.
They apply to gingerbread versión 2.3.4_r1 of the AOSP sources. They allow:
What I have found out about NFC card emulation on Android so far:
By the way the technology you mention (NFC-WI) is already used in the Nexus S to interconnect the NFC controller with the embedded secure element.
Upate
To summarize I answer Sten's questions:
Short answer yes, I did access Mifare 4K from an external reader. I was able to modify default keys too. The difficulties come from modifying system sources and building a custom firmware yourself.
Theoretically no. The other alternative would be sending APDUs to the SIM, containing the Mifare commands to execute on the Mifare card.
For the time being no. Though you modify the AOSP sources with seek-for-android patches (I did it myself) your application will just crash with stock phones. The reason is that they have not implemented the 3GPP TS 27.007 Technical Specification, that allows the application processor to send APDUs directly to the SIM (UICC).
However there could be some light ahead of the tunnel, since citizy project in France are already using secure element mode of NFC technology with Android phones, taking the UICC secure element approach. In fact there is a modified Samsung Galaxy SII model in use and the new Acer Liquid Express will also be soon available to integrate into citizy. Those phones are bound to have the required TS 27.007 specification implemented in their baseband processor firmware. When it comes to application processor I do not know if they took the SEEK-for-android from G&D path or the OpenNFC from Insecure. Being french I would bet all-in for the last one.
因此,为了继续讨论,我将对其进行总结:NXP SmartMX 微控制器由两个独立的安全元件组成。第一个是可编程的,运行一些操作系统(例如MULTOS或Sm@rtCafe或其他)和JavaCard VM,但它被锁定并且生产访问密钥仅在Google或TSM手中。此处无法安装用于测试目的的 JavaCard 应用程序,因为无法出于测试目的解锁安全元件。
也没有办法如何利用SIM卡,因为即使这在技术上是可行的,但对于商业应用来说,与MNO打交道是必要的。让我们暂时停一下 Mifare 4K,它似乎是最有前途的:
由于 Mifare 4K 区域有默认密钥,任何拥有外部 NFC 读取器的人都可以更改密钥并在那里安全地存储值 - 这是正确的吗?你尝试过吗?这有什么困难吗?
使用外部 NFC 读卡器是访问 Mifare 空间的唯一方法吗?例如,安装在 Android 手机上的应用程序可以使用某些 API(通过 NFC 控制器和 NFC-WI 路径)向 Mifare 4K 读取/写入一些数据吗?例如,seek-for-android 可以提供帮助吗?
谢谢
斯坦恩
So to continue the discussion I will just summary it: The NXP SmartMX microcontroller consists of two separate secure elements. The first one is programmable, runs some operating system (e.g. MULTOS or Sm@rtCafe or other) and a JavaCard VM, but it is locked and the production access keys there are in Google or TSM hands only. There is no way to install JavaCard application for testing purposes here, since it is not possible to unlock the secure element for test purposes.
Also there is no way how to utilize the SIM card, because even if this can be technically possible, for the commercial application deal with MNO is necessary. Let’s stop for a while with the Mifare 4K, which seems to be the most promissing:
Since the Mifare 4K area has default keys, anybody with the external NFC reader can change the keys and securely store values there – is that correct? Did you try it? Does this come with any difficulties?
Is use of the external NFC reader the only way how to access the Mifare space? Can e.g. application installed on the Android phone read/write some data to Mifare 4K using some API (over NFC controller and NFC-WI path)? Can e.g. seek-for-android help there?
Thanks
STeN