I was able to enable a secure element the other day by messing around with this external/libnfc-nxp library. I enabled SMX (SmartMX) in the config headers, and upon booting and monitoring `adb logcat` during boot I saw 1 secure elements (a SmartMX one) had been enabled. I was then able to change the mode in NfcService.java to card emulation mode.
The Nexus S is now emulating a MiFare Classic 4k card. However, I am not able to read sectors from the card directly. I've been trying to use the micmd tool to do that but things act pretty strangely. For example, I tried to read block 0 and micmd tells me "Could not read the data block! Tag halted, reconnecting..." but what's even stranger is that at that point, 'adb logcat' shuts itself off. As if that read command somehow interfered with USB or logging? However trying `a` commands to authenticate in micmd always works for some reason and it'll even pretent to write and persist data to blocks; but of course that data never actually gets persisted to the emulated card. Maybe this is a bug in micmd? Does anyone know if the Nexus S hardware (or its PN544 NFC chipset) even contains a hardware secure element like SmartMX? I tried also enabling UICC but that didn't seem to work at all and NFC service wouldn't even start in that case. Plus my SIM card is MANY years old and not sure it'd even work... Either way, I used libnfc.org's `nfc-mfclassic` tool to dump out the contents of that emulated 4k card. It is here: http://pastebin.com/zKZ2ELcw Seems to be entirely blank which is why I'm wondering if these aren't some default values it would spit out anyway even if no SmartMX module existed? If anyone has any more insights into this, I'd be very happy to hear them. -Nemanja On Dec 19 2010, 7:26 pm, nemik <ne...@nemik.net> wrote: > Dominik, > > Yea, that's right. All it does currently is read; at least via the > Java API. If you look at the kernel source though, a bunch of ifdefs > which allow for emulation were all disabled. So full compliance with > theNFCstandard will have to wait for a future kernel release. > > On Dec 7, 5:42 am, Gruntz Dominik <dominik.gru...@fhnw.ch> wrote: > > > > > > > > > Hi everyone, > > > Do I see it right, that the Android 2.3NFCAPI does not provide > > functionality to access a secure element? A secure element is a smartcard > > connected to theNFCcontroller, i.e. a secure storage in the device, either > > embedded in the mobile phone, on the SIM card or on a SD card. > > > With JavaME access to the secure element was provided with JSR177 which > > supported the communication with smart card applications usind APDU > > commands. I have not seen comparable functionality in package android.nfc. > > > Thanks for any hints > > Dominik -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en