Android 和 Symbian NFC 移动开发问题与解答 (FAQ)

发布于 2024-11-28 08:45:35 字数 900 浏览 7 评论 0原文

让我们分享关于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

洛阳烟雨空心柳 2024-12-05 08:45:35

为了更加实用,而不仅仅是理论上,我在 xda-developers 在当前唯一支持 NFC 的 Android 手机(Nexus S)上启用卡模拟模式。您和其他人可能有兴趣自己尝试卡模拟模式。请考虑到这仅用于实验目的。

它们适用于 AOSP 源的姜饼版本 2.3.4_r1。它们允许:

  • 在 Nexus S 上启用 NFC 卡模拟模式。此模式始终启用。
  • 禁用读卡器模式,让卡模拟成为唯一有效的模式。
  • 选择外部安全元件(在 UICC 中)而不是嵌入式安全元件(在 SmartMX 芯片中)。
  • 尽管不相关,但删除了蓝牙可发现性选项的时间限制。

到目前为止,我对 Android 上的 NFC 卡模拟的了解是:

  • 默认情况下,库存图像上禁用卡模拟,并且需要修改固件。 Nfc 系统应用程序和 libnfc-nxp 系统库的更改是值得关注的地方。
  • Nexus S 内的嵌入式 SmartMX 芯片将自身呈现为双智能卡。一种基于可编程的(允许在其上安装小卡)和 4K Mifare 的。
  • 4K Mifare 卡具有默认密钥,因此可以从外部读卡器写入/读取。
  • 可编程卡应该与 GP 兼容,但除了 Google 之外没有人可以摆弄它,因为访问密钥不可用民众。
  • Nexus S 支持 SWP,并允许使用位于 UICC 内部的安全元件进行操作。
  • 应用程序无法直接访问安全元素的任何内容。一方面,嵌入式 SE 无法访问,因为我们不知道密钥。另一方面,外部元件可以通过 SWP(连接到 NFC 控制器)从外部访问,但不能在内部访问,因为据我所知,SIM 插槽没有通过其他方式连接到 NFC 控制器。这样我们就只剩下一条路了,那就是基带处理器。然而 BB 固件是专有的并由制造商控制。三星尚未实施 3GPP TS 27.007 技术规范来与它在 BB 固件中。
  • OTA 访问外部 SE 应该是可能的,这掌握在 MNO 手中。其中一些可能会提供 TSM 服务,以允许第三方访问 UICC 内的 SE。

顺便说一句,您提到的技术 (NFC-WI) 已在 Nexus S 中使用,用于将 NFC 控制器与嵌入式安全元件互连。

更新

总而言之,我回答了 Sten 的问题:

由于 Mifare 4K 区域有默认密钥,任何拥有外部
NFC 读取器可以更改密钥并安全地存储值 – 是
正确吗?你尝试过吗?这有什么困难吗?

简短回答,我确实从外部读卡器访问了 Mifare 4K。我也可以修改默认键。困难来自于修改系统源代码和自己构建自定义固件。

使用外部 NFC 读取器是访问 NFC 的唯一方法吗?
Mifare 空间?

理论上没有。另一种选择是将 APDU 发送到 SIM,其中包含要在 Mifare 卡上执行的 Mifare 命令。

例如,安装在 Android 手机上的应用程序可以读/写一些内容吗?
使用一些 API(通过 NFC 控制器和 NFC-WI)将数据传输到 Mifare 4K
小路)?例如,seek-for-android 可以提供帮助吗?

暂时没有。尽管您使用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:

  • Enabling NFC card emulation mode on the Nexus S. This mode is always enabled.
  • Disabling reader mode, letting the card emulation being the only one working.
  • Selecting an external secure element (in UICC) instead of the embedded one (in SmartMX chip).
  • Although not related, removing time-limit to bluetooth discoverability option.

What I have found out about NFC card emulation on Android so far:

  • Card emulation is disabled by default on stock images and require a firmware modification. Alteration of Nfc system application and libnfc-nxp system library are the places to look at.
  • Embedded SmartMX chip inside Nexus S presents itself as a dual smartcard. A programable one (allowing installing of cardlets on it) based and a 4K Mifare one.
  • The 4K Mifare card has default keys, so it can be written/read from an external reader.
  • The programable card is supposed to be GP compatible, but no one except Google can fiddle with it since access keys are not public.
  • Nexus S does support SWP and allows to operate with a secure element located inside an UICC.
  • Applications can not access directly to any contents of secure elements. On one hand the embedded SE is unaccessible because we do not know the keys. On the other hand the external element is accesible externally by means of SWP (that connects to NFC controller) but not internally because AFAIK the SIM slot is not connected by other means to the NFC controller. This leaves us with only one path, the baseband processor. However BB firmware is propietary and controlled by manufacturers. Samsung has not implemented the 3GPP TS 27.007 Technical Specification to interact with it in its BB firmware.
  • OTA access to external SE should be possible, this lies in hands of MNOs. Some of the might offer TSM services to allow 3rd party access to SE inside UICC.

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:

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?

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.

Is use of the external NFC reader the only way how to access the
Mifare space?

Theoretically no. The other alternative would be sending APDUs to the SIM, containing the Mifare commands to execute on the Mifare card.

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?

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.

捂风挽笑 2024-12-05 08:45:35

因此,为了继续讨论,我将对其进行总结: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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文