NFC Secure Element

Showing 1-135 of 135 messages
NFC Secure Element Dominik 12/7/10 3:42 AM
Hi everyone,

Do I see it right, that the Android 2.3 NFC API does not provide functionality to access a secure element? A secure element is a smartcard connected to the NFC controller, 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

Re: NFC Secure Element nemik 12/19/10 5:26 PM
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
the NFC standard 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.
Re: NFC Secure Element nemik 1/8/11 11:30 AM
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.
Re: NFC Secure Element gusdgg 1/9/11 10:27 AM
Could you tell me how do you enabled SMX (SmartMX) and set the
cardemulation mode? So far, I was able to read and write tags with the
Nexus S.

Thanks

.gusdgg
> > which allow foremulationwere 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- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -
Re: [android-developers] Re: NFC Secure Element Ajith 1/9/11 9:31 PM
Hi Nemik
 
* I have small doubt with current implementation. Is SmartMX a Secure Element ?If so can you give me examples?
* I have checked libnfc-nxp , enabling P2P parameter was  at phnfcconfig.h. what needs to be done to enable Secure element?
what are MifarePlus, Desfire, Topaz . Is it a Card type or Secure Element?
 
 
* Also where is the general read-write methods for entry of Secure element.
All I can see is phLibNfc_SE.c is methods for getting list of secured element, selecting secure element, deselecting.
* But method for exchange of data is not present. Can you tell me where can I find this?
 
* In libnfc-nxp There are files like  phFriNfc_NdefMap.c, phFriNfc_MifareULMap.c,  phFriNfc_TopazMap.c, phFriNfc_TopazDynamicMap.c, phFriNfc_DesfireMap.c, phFriNfc_FelicaMap.c.
Can you tell me what these files are used for. The current comments in the file do not provide sufficient information
 
* I am trying to use Wired Mode, Hence phHciNfc_WI.c will be used to communicate between Controller and Secure element right?
 
Please advice.
 
Regards,
Ajith
 
 
 
Hi


--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: NFC Secure Element nemik 1/9/11 10:14 PM
Ajith,

According to http://discussion.forum.nokia.com/forum/showthread.php?199442-6212-device-how-to-work-with-the-secure-element
the CN072 is a secure element in the Smart MX family. I'm not sure the
same one is in the Nexus S, but I presume the one in there is at least
very similar.

Here is the info on it:
http://www.nxp.com/acrobat_download2/other/identification/SFS107710.pdf

I'm still trying to figure out how to get access to it as well, for
reading or writing. I doubt there are any specific commands for it
though, it just takes regular commands over ISO14443 just like other
MiFare cards.
> > android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubs cr...@googlegroups.com>
Re: [android-developers] Re: NFC Secure Element Ajith 1/9/11 11:51 PM
Hi Nemik
 
I'm running over the libnfc code.
I can see these 4 files to be prominent for communication with SE
 
phHciNfc_CE_A.c
phHciNfc_CE_B.c
 
I am thinking the above two might be used for R/W into SE from App Processor.
And the below two is used for communication between NFC Controller and SE.
 
phHciNfc_SWP.c
phHciNfc_WI.c
 
Please go through these files and let me know if I'm in right path.
 
Regards,
Ajith
Re: NFC Secure Element gusdgg 1/10/11 7:20 AM
Hi Nemik,

Please, could you tell me how do you enable the SMX in the nexus s
configuration and change the mode in the Nfcservice? So far, I can
read and write tags,

Regards
gusdgg

On 10 ene, 04:51, Ajith Kamath <sjce.aj...@gmail.com> wrote:
> Hi Nemik
>
> I'm running over the libnfc code.
> I can see these 4 files to be prominent for communication with SE
>
> phHciNfc_CE_A.c
> phHciNfc_CE_B.c
>
> I am thinking the above two might be used for R/W into SE from App
> Processor.
> And the below two is used for communication between NFC Controller and SE.
>
> phHciNfc_SWP.c
> phHciNfc_WI.c
>
> Please go through these files and let me know if I'm in right path.
>
> Regards,
> Ajith
>
>
>
> On Mon, Jan 10, 2011 at 11:44 AM, nemik <ne...@nemik.net> wrote:
> > Ajith,
>
> > According to
> >http://discussion.forum.nokia.com/forum/showthread.php?199442-6212-de...
> > > > android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubs­cribe@googlegroups.com><android-developers%2Bunsubs
> > cr...@googlegroups.com>
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/android-developers?hl=en
>
> > --
> >  You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-d...@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscribe@googlegroups.com<android-developers%2Bunsubs­cribe@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en- Ocultar texto de la cita -
Re: NFC Secure Element Dominik 1/17/11 4:11 PM
According to the NXP documentation of PN544, three SE variants are
supported:
- SIM Card (via UICC)
- Embedded (SmartMX security chip)
- SD Card

Do you know which version is intended to be used by the Nexus S
device?

The above messages describe attempts to enable SmartMX. As soon as
access to this SE is possible:
Which keys do you use to access the SE? Such keys should be private
and not generally be known.

I am at a loss.

- Dominik
Re: NFC Secure Element Ajith 1/17/11 7:11 PM
I still dont have nexus s but there is a high probability that its Embedded
 
Yes Keys are private and most likely needs to be provided by Service Provider. The same thing has been mentioned in nokia forum
But I am not sure  how this will be done for nexus S.(may be there are ties with Service Provider)
 
If anyone can explain OTA agent and its communication with TSM, it would be very helpful. Since this too is not clear (w.r.t android)
 
Regards,
Ajith
Re: NFC Secure Element nemik 1/20/11 1:01 PM
Sorry for not replying in a while, been very busy with projects at
work.

I posted my diff's to enable the Nexus S to emulate an NFC tag. The
links are below:
http://nemik.net/code/android-nfc/Nfc-app.diff for
http://android.git.kernel.org/?p=platform/packages/apps/Nfc.git;a=summary
and
http://nemik.net/code/android-nfc/libnfc-nxp.diff for
http://android.git.kernel.org/?p=platform/external/libnfc-nxp.git;a=summary

These are just based on the on the open source, plain vanilla Android
Gingerbread codebase. If you patch it with the diffs above, you can
build the OS, upload the images to the phone's bootloader (make sure
to unlock the bootloader first) and then see it for yourself.

It is pretty badly broken and this is just to prove that it can kinda
work, I hacked it up pretty hard.

Also, I added a lot of LOGD()'s in the NFC app's JNI so I could see
what was going on when trying things out on the phone so I could read
it when doing an 'adb logcat' on the computer with the phone attached
over USB.

Have fun!

On Jan 17, 9:11 pm, Ajith Kamath <sjce.aj...@gmail.com> wrote:
> I still dont have nexus s but there is a high probability that its Embedded
>
> Yes Keys are private and most likely needs to be provided by Service
> Provider. The same thing has been mentioned in nokia forum
> But I am not sure  how this will be done for nexus S.(may be there are ties
> with Service Provider)
>
> If anyone can explain OTA agent and its communication with TSM, it would be
> very helpful. Since this too is not clear (w.r.t android)
>
> Regards,
> Ajith
>
>
>
>
>
>
>
Re: NFC Secure Element mtk 1/20/11 10:04 PM
Thanks Nemik for posting the patch, I was trying to get the emulation
working without much luck so far, I see you have flipped some
additional flags than what I had, so I'll trying those.
Btw I was able to set the SE to wired mode by calling
phLibNfc_SE_SetMode(seID,phLibNfc_SE_ActModeWired,
nfc_jni_se_set_mode_callback,(void *)nat);
so now the SE gets detected as a local tag and I can open a tag
connection to same - I tried a few APDUs, but getting error codes 6a
82 (not found), 69 85 etc back.. I'll post if I'm able to make any
progress.


On Jan 20, 2:01 pm, nemik <ne...@nemik.net> wrote:
> Sorry for not replying in a while, been very busy with projects at
> work.
>
> I posted my diff's to enable the Nexus S to emulate an NFC tag. The
> links are below:http://nemik.net/code/android-nfc/Nfc-app.diffforhttp://android.git.kernel.org/?p=platform/packages/apps/Nfc.git;a=sum...
> andhttp://nemik.net/code/android-nfc/libnfc-nxp.diffforhttp://android.git.kernel.org/?p=platform/external/libnfc-nxp.git;a=s...
Re: NFC Secure Element gusdgg 1/21/11 9:28 AM

Nemik,

Thanks for posting the diff's and great work! I'll patch the codebase
and see what happen. In the meantime and coming back to your question
about the Nexus S hardware containing a secure element like SmartMX,
did you get the secure element list with the method
getSecureElementList() in the patched version? I called this method
(via reflection, no patched yet) but it gets the error message
"WRITE_SECURE_SETTINGS permission required"

As you may know, there are an excelent nexus s teardown (http://
www.ifixit.com/Teardown/Nexus-S-Teardown/4365/1) from iFixit. You'll
see there, in the step 7 - 2nd picture, the NXP PN544 NFC chip closely
located to the UICC slot, but as far I can see there isn't any SmartMx
chip in that picture, nor in the others.

Regards,
gusdgg
Re: NFC Secure Element nemik 1/27/11 9:25 PM
mtk, very cool! So when you did that call directly (somewhere in init
of the jni code?) you got it to detect? How are you sending APDU
commands? Also, if I understand wired mode correctly, the tag is not
emulated externally to other readers; it's only available internally
using the NFC API?

gusdgg, yes, I saw the secure elements using the
getSecureElementList() and just doing logging with those and observing
them using `adb logcat`. I think that is in one of the diffs I posted.
It worked OK for me and I wasn't seeing any permission errors. Though
I never even bothered to do it via reflection on the stock firmware
since I figured it would just deny it. Your findings clearly confirm
that.
As for the SmartMX chip, maybe you're right. But I suppose it could
also be built into the PN544 chip itself. I have no idea, I wasn't
able to find any datasheets that talk about it and have no details on
the NXP chips Samsung's been sourcing for the Nexus S.

On Jan 21, 11:28 am, gusdgg <gus...@gmail.com> wrote:
> Nemik,
>
> Thanks for posting the diff's and great work! I'll patch the codebase
> and see what happen. In the meantime and coming back to your question
> about the Nexus S hardware containing a secure element like SmartMX,
> did you get the secure element list with the method
> getSecureElementList() in the patched version? I called this method
> (via reflection, no patched yet) but it gets the error message
> "WRITE_SECURE_SETTINGS permission required"
>
> As you may know, there are an excelent nexus s teardown (http://www.ifixit.com/Teardown/Nexus-S-Teardown/4365/1) from iFixit. You'll
> see there, in the step 7 - 2nd picture, the NXP PN544NFCchip closely
Re: NFC Secure Element aleks 1/28/11 2:00 AM
hello, I've been looking for a way to turn on nfc card emulation on
the nexus s and I came across the following recent blog post:
http://mobisocial.stanford.edu/news/2011/01/nfc-on-android-for-social-applications/

They found some nfc p2p code that got removed from Gingerbread and
they used it to develop some nfc applications. I didn't have time to
analyse their work but I assume that it might be helpful for the rest
of you.

best regards
aleks
Re: NFC Secure Element mtk 1/28/11 7:49 AM
I added the code to set wired mode in
com_android_nfc_NativeNfcManager.cpp. I also added some additional
methods on NFcService so I can conveniently call it from my test
activity. For sending APDU commands in SWP mode, I use another
activity with "TAG_DISCOVERED" action in android manifest, (just like
the tag reader same program) and then use RawTagConnection to send
APDU bytes. Btw I think the SE is GP compliant! When I send the select
command with zero AID (Select ISD per GP, 00 a4 04 00 00) - it
promptly responds back with FCI template! So it looks like we can use
install apps into the SE, once we have the keys? Sorry I'm new to GP
so learning stuff as I go...
Re: [android-developers] Re: NFC Secure Element Ajith 1/30/11 8:58 PM
great mtk, my doubts are getting cleared...
So to work on WI mode , i need to set the SE to wired -interface mode like u said.
 
After this if i Use RawTagconenction to send GP commands to SE , Will this work for WI mode?
I mean can u select the 0 AID with this? . Sorry i dont have device yet, so still working on with code
 
If this is the case, then for Credit card emulation , Is my assumptions correct :
* The cardlet in SE will be given by TSM
* the midlet in mobile application will access SE cardlet via the method you described earlier(for gingerbread) , but only if its digitally signed by TSM
 
Are these 2 assuptions correct.? Also can you share doc/link on GP complaince and commands?
Please advice
 
Regards,
Ajith

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-d...@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: NFC Secure Element Thomas de Lazzari 3/31/11 11:51 AM
Hello,

I was wondering if Google could eventually provide an Android
application that could "unlock" the Secure Element for developers?
It would allow developers to authenticate to the embedded SE and start
uploading their Java Card applications to see if it works.
For production, this will be installed by a TSM.
Also, do we know the specs of the JavaCard inside the PN544? Is it a
JavaCard 2.2.2 running JCOP?

Regards,
Thomas
Re: NFC Secure Element Markus 5/13/11 3:08 AM
mtk
you wrote after call
phLibNfc_SE_SetMode(seID,phLibNfc_SE_ActModeWired,nfc_jni_se_set_mode_callback,
(void *)nat);
your nexus s was in card emulation

I called it with mode default
phLibNfc_SE_SetMode(seID,phLibNfc_SE_ActModeDefault,nfc_jni_se_set_mode_callback,
(void *)nat);
and get following log
5-12 22:08:54.421: DEBUG/NFC JNI(303): NFC capabilities: HAL =
8150100, FW = a70414, HW = 620003, Model = 0, HCI = 1, Full_FW = 104,
FW Update Info = 0
05-12 22:08:54.769: DEBUG/NFC JNI(303):
phLibNfc_SE_GetSecureElementList()
05-12 22:08:54.769: DEBUG/NFC JNI(303): > Number of Secure
Element(s) : 1
05-12 22:08:54.769: DEBUG/NFC JNI(303):
phLibNfc_SE_GetSecureElementList(): SMX detected, handle=0xabcdef
05-12 22:08:54.769: DEBUG/NFC JNI(303): phLibNfc_SE_SetMode() returned
0x000d[NFCSTATUS_PENDING]
05-12 22:08:54.828: INFO/NFC JNI(303): NFC Initialized
05-12 22:08:54.828: DEBUG/NfcService(303): NFC-EE routing OFF
05-12 22:08:54.847: DEBUG/NfcService(303): NFC-C discovery ON

BUT reader is not detecting a Tag on my phone
Is there maybe a problem to setting the mode
returned 0x000d[NFCSTATUS_PENDING] sounds not so great

I am working with CyanogenMod 7 (Android 2.3.4)

regards
Markus
Re: NFC Secure Element Goo_Goo 5/16/11 6:48 AM
Could someone please post the the image with card emulation enabled
for Nexus S?
Re: NFC Secure Element benza 5/18/11 5:20 AM
Thank you everyone to share this.

Currently I'm evaluating if it's the case to start to try to enable
the secure element.

I more or less understand how to do it but I don't understand if after
is possible to build application on card emulation.
Moreover some of you speak about authentication, and about a password
that is not possible to have? (What are you talking about when you
speak about this stuff).

Anyway some news about NFC card emulation
http://www.nearfieldcommunicationsworld.com/2011/05/11/37352/google-raises-concerns-over-the-viability-of-nfc-card-emulation-mode-for-mobile-payments/

it seems that Google dev will not give use api about that in the next
future.
Moreover, what does it mean "And if you improperly authenticate
yourself a certain number of times, there are secure elements out
there that will physically destroy themselves and can never be
recovered"? Is related to the password of my previous questions?

thanks
On May 16, 3:48 pm, Goo_Goo <danny.w.s...@gmail.com> wrote:
> Could someone please post the the image withcardemulationenabled
> for Nexus S?
>
> On May 13, 5:08 am, Markus <markus.tau...@gmail.com> wrote:
>
>
>
> > mtk
> > you wrote after call
> > phLibNfc_SE_SetMode(seID,phLibNfc_SE_ActModeWired,nfc_jni_se_set_mode_callb ack,
> > (void *)nat);
> > your nexus s was incardemulation
>
> > I called it with mode default
> > phLibNfc_SE_SetMode(seID,phLibNfc_SE_ActModeDefault,nfc_jni_se_set_mode_cal lback,
> > (void *)nat);
> > and get following log
> > 5-12 22:08:54.421: DEBUG/NFCJNI(303):NFCcapabilities: HAL =
> > 8150100, FW = a70414, HW = 620003, Model = 0, HCI = 1, Full_FW = 104,
> > FW Update Info = 0
> > 05-12 22:08:54.769: DEBUG/NFCJNI(303):
> > phLibNfc_SE_GetSecureElementList()
> > 05-12 22:08:54.769: DEBUG/NFCJNI(303): > Number of Secure
> > Element(s) : 1
> > 05-12 22:08:54.769: DEBUG/NFCJNI(303):
> > phLibNfc_SE_GetSecureElementList(): SMX detected, handle=0xabcdef
> > 05-12 22:08:54.769: DEBUG/NFCJNI(303): phLibNfc_SE_SetMode() returned
> > 0x000d[NFCSTATUS_PENDING]
> > 05-12 22:08:54.828: INFO/NFCJNI(303):NFCInitialized
> > 05-12 22:08:54.828: DEBUG/NfcService(303):NFC-EE routing OFF
> > 05-12 22:08:54.847: DEBUG/NfcService(303):NFC-C discovery ON
>
> > BUT reader is not detecting a Tag on my phone
> > Is there maybe a problem to setting the mode
> > returned 0x000d[NFCSTATUS_PENDING] sounds not so great
>
> > I am working with CyanogenMod 7 (Android 2.3.4)
>
> > regards
> > Markus- Hide quoted text -
>
> - Show quoted text -
Re: NFC Secure Element benza 5/18/11 5:22 AM


On May 18, 2:20 pm, benza <luca.schia...@gmail.com> wrote:
> Thank you everyone to share this.
>
> Currently I'm evaluating if it's the case to start to try to enable
> thesecureelement.
>
> I more or less understand how to do it but I don't understand if after
> is possible to build application on card emulation.
> Moreover some of you speak about authentication, and about a password
> that is not possible to have? (What are you talking about when you
> speak about this stuff).
>
> Anyway some news about NFC card emulationhttp://www.nearfieldcommunicationsworld.com/2011/05/11/37352/google-r...
>
> it seems that Google dev will not give use api about that in the next
> future.
> Moreover, what does it mean "And if you improperly authenticate
> yourself a certain number of times, there aresecureelements out
> > - Show quoted text -- Hide quoted text -
Re: [android-developers] Re: NFC Secure Element Nikolay Elenkov 5/18/11 6:10 AM
On Wed, May 18, 2011 at 9:20 PM, benza <luca.s...@gmail.com> wrote:

> Moreover, what does it mean "And if you improperly authenticate
> yourself a certain number of times, there are secure elements out
> there that will physically destroy themselves and can never be
> recovered"? Is related to the password of my previous questions?
>

It means that if you fail mutual authentication a certain number of
times, some cards will go into an unrecoverable state and return
error no matter what you send. Don't know about the on in the
Nexus S though.

Re: [android-developers] Re: NFC Secure Element Michael Roland 5/18/11 3:59 PM
Hallo,

> I more or less understand how to do it but I don't understand if after
> is possible to build application on card emulation.

Regarding the internal secure element (SmartMX): No. Even if you
activate this chip as the secure element, you could only use its UID for
your application. To edit data on it/install applications into it you
would need to have the access keys for that secure element.

Regarding an external secure element on the UICC ("SIM" card): Partly
yes. You can activate an SWP-UICC as secure element. But access is
limited to external readers for the moment. Until now, there is no known
way to get access to application on the UICC from a phone application.

> Moreover some of you speak about authentication, and about a password
> that is not possible to have? (What are you talking about when you
> speak about this stuff).

The SmartMX in the Nexus S contains a JavaCard operating system that is
compliant to GlobalPlatform. GlobalPlatform defines methods to manage
multiple applications on this JavaCard. A central component of this card
management is the Card Manager, which itself is one application on the
secure element. The card manager provides an interface to load, install,
... delete applications on the secure element. Additionally it controls
access to these methods. To establish a secure channel with the card
manager (i.e. a connection that provides authenticity, integrity and
possibly confidentiality) both, the entity that wants to manage the card
and the card manager need to know one or more shared secrets, the
authentication keys.

> Anyway some news about NFC card emulation
> [nearfieldcommunicationworld]

> it seems that Google dev will not give use api about that in the next
> future.

Still there is some developments towards card emulation going on (cf.
http://www.nfctimes.com/news/android-card-emulation-expected-despite-doubts-google-engineers
)

> Moreover, what does it mean "And if you improperly authenticate
> yourself a certain number of times, there are secure elements out
> there that will physically destroy themselves and can never be
> recovered"? Is related to the password of my previous questions?

While the card manager is protected by access keys, there still exist
some methods to find such keys. One of these methods would be brute
forces (i.e. trying each possible key value). While such methods are
usually very inefficient (if the key has an appropriate length) there
might be some methods that could significantly speed up this process. As
a safety mechanism the card manager usually implements an additional
protection against such an attack: After ten consecutive authentication
failures, the card manager locks itself and refuses any further
commands. (Other applications that were previously installed on that
card will continue to function as usual.) Once this lockdown has
happened, there is *NO* way of reversing this. THerefore, once in
lockdown no applications can be installed on, removed from, ... the
secure element.

br
Michael

Re: NFC Secure Element Martin 5/19/11 10:51 AM
Hello all,

Michael as you already mentioned, it is possible to activate the card
emulation mode and the Secure Element in the Nexus S.
I did that and also changed the permissions from
android.permission.WRITE_SECURE_SETTINGS to android.permission.NFC in
NfcService.java to get access to the Secure Element.
Now I am able to create and open a connection to the Secure Element
and get its UID.
After enabling the card emulation mode on the Nexus S, I am able to
read and write data to the emulated MiFare Classic 4k card by an
external NFC reader. I would like to do that within an android app.
Why is that not possible through an android application? You have
spoken about the access keys, but aren't they the same for internal
and external access?
If I have understood you correctly, there is nothing more I can do so
far, right?

Thanks a lot!

Martin

On 19 Mai, 00:59, Michael Roland <mi.rol...@gmail.com> wrote:
> Hallo,
>
> > I more or less understand how to do it but I don't understand if after
> > is possible to build application on card emulation.
>
> Regarding the internalsecureelement(SmartMX): No. Even if you
> activate this chip as thesecureelement, you could only use its UID for
> your application. To edit data on it/install applications into it you
> would need to have the access keys for thatsecureelement.
>
> Regarding an externalsecureelementon the UICC ("SIM" card): Partly
> yes. You can activate an SWP-UICC assecureelement. But access is
> limited to external readers for the moment. Until now, there is no known
> way to get access to application on the UICC from a phone application.
>
> > Moreover some of you speak about authentication, and about a password
> > that is not possible to have? (What are you talking about when you
> > speak about this stuff).
>
> The SmartMX in the Nexus S contains a JavaCard operating system that is
> compliant to GlobalPlatform. GlobalPlatform defines methods to manage
> multiple applications on this JavaCard. A central component of this card
> management is the Card Manager, which itself is one application on thesecureelement. The card manager provides an interface to load, install,
> ... delete applications on thesecureelement. Additionally it controls
> access to these methods. To establish asecurechannel with the card
> manager (i.e. a connection that provides authenticity, integrity and
> possibly confidentiality) both, the entity that wants to manage the card
> and the card manager need to know one or more shared secrets, the
> authentication keys.
>
> > Anyway some news aboutNFCcard emulation
> > [nearfieldcommunicationworld]
> > it seems that Google dev will not give use api about that in the next
> > future.
>
> Still there is some developments towards card emulation going on (cf.http://www.nfctimes.com/news/android-card-emulation-expected-despite-...
> )
>
> > Moreover, what does it mean "And if you improperly authenticate
> > yourself a certain number of times, there aresecureelements out
Re: [android-developers] Re: NFC Secure Element Michael Roland 5/19/11 11:18 AM
Hallo Martin,

> After enabling the card emulation mode on the Nexus S, I am able to
> read and write data to the emulated MiFare Classic 4k card by an
> external NFC reader. I would like to do that within an android app.

Have you verified that you actually wrote data to the MIFARE Classic? I
really doubt that you did. What MIFARE keys did you use? In my tests
authentication passed regardless of the keys I used. In fact every
command seemed to return successfully, but in fact no data was ever
written to the card.

> You have
> spoken about the access keys, but aren't they the same for internal
> and external access?

Yes, they would be the same for internal and external access.


br,
Michael


> On 19 Mai, 00:59, Michael Roland <mi.rol...@gmail.com> wrote:
>> Hallo,
>>
>>> I more or less understand how to do it but I don't understand if after
>>> is possible to build application on card emulation.
>>
>> Regarding the internalsecureelement(SmartMX): No. Even if you
>> activate this chip as thesecureelement, you could only use its UID for
>> your application. To edit data on it/install applications into it you
>> would need to have the access keys for thatsecureelement.
>>
>> Regarding an externalsecureelementon the UICC ("SIM" card): Partly
>> yes. You can activate an SWP-UICC assecureelement. But access is
>> limited to external readers for the moment. Until now, there is no known
>> way to get access to application on the UICC from a phone application.
>>
>>> Moreover some of you speak about authentication, and about a password
>>> that is not possible to have? (What are you talking about when you
>>> speak about this stuff).
>>
>> The SmartMX in the Nexus S contains a JavaCard operating system that is
>> compliant to GlobalPlatform. GlobalPlatform defines methods to manage
>> multiple applications on this JavaCard. A central component of this card
>> management is the Card Manager, which itself is one application on thesecureelement. The card manager provides an interface to load, install,
>> ... delete applications on thesecureelement. Additionally it controls
>> access to these methods. To establish asecurechannel with the card
>> manager (i.e. a connection that provides authenticity, integrity and
>> possibly confidentiality) both, the entity that wants to manage the card
>> and the card manager need to know one or more shared secrets, the
>> authentication keys.
>>
>>> Anyway some news aboutNFCcard emulation
>>> [nearfieldcommunicationworld]
>>> it seems that Google dev will not give use api about that in the next
>>> future.
>>
>> Still there is some developments towards card emulation going on (cf.http://www.nfctimes.com/news/android-card-emulation-expected-despite-...
>> )
>>
>>> Moreover, what does it mean "And if you improperly authenticate
>>> yourself a certain number of times, there aresecureelements out
>>> there that will physically destroy themselves and can never be
>>> recovered"? Is related to the password of my previous questions?
>>
>> While the card manager is protected by access keys, there still exist
>> some methods to find such keys. One of these methods would be brute
>> forces (i.e. trying each possible key value). While such methods are
>> usually very inefficient (if the key has an appropriate length) there
>> might be some methods that could significantly speed up this process. As
>> a safety mechanism the card manager usually implements an additional
>> protection against such an attack: After ten consecutive authentication
>> failures, the card manager locks itself and refuses any further
>> commands. (Other applications that were previously installed on that
>> card will continue to function as usual.) Once this lockdown has
>> happened, there is *NO* way of reversing this. THerefore, once in
>> lockdown no applications can be installed on, removed from, ... thesecureelement.
>>
>> br
>> Michael
>>
>>
>>
>>
>>
>>
>>
>>> On May 16, 3:48 pm, Goo_Goo <danny.w.s...@gmail.com> wrote:
>>>> Could someone please post the the image withcardemulationenabled
>>>> for Nexus S?
>>
>>>> On May 13, 5:08 am, Markus <markus.tau...@gmail.com> wrote:
>>
>>>>> mtk
>>>>> you wrote after call
>>>>> phLibNfc_SE_SetMode(seID,phLibNfc_SE_ActModeWired,nfc_jni_se_set_mode_callb ack,
>>>>> (void *)nat);
>>>>> your nexus s was incardemulation
>>
>>>>> I called it with mode default
>>>>> phLibNfc_SE_SetMode(seID,phLibNfc_SE_ActModeDefault,nfc_jni_se_set_mode_cal lback,
>>>>> (void *)nat);
>>>>> and get following log
>>>>> 5-12 22:08:54.421: DEBUG/NFCJNI(303):NFCcapabilities: HAL =
>>>>> 8150100, FW = a70414, HW = 620003, Model = 0, HCI = 1, Full_FW = 104,
>>>>> FW Update Info = 0
>>>>> 05-12 22:08:54.769: DEBUG/NFCJNI(303):
>>>>> phLibNfc_SE_GetSecureElementList()
>>>>> 05-12 22:08:54.769: DEBUG/NFCJNI(303): > Number ofSecure
>>>>> Element(s) : 1
>>>>> 05-12 22:08:54.769: DEBUG/NFCJNI(303):
>>>>> phLibNfc_SE_GetSecureElementList(): SMX detected, handle=0xabcdef
>>>>> 05-12 22:08:54.769: DEBUG/NFCJNI(303): phLibNfc_SE_SetMode() returned
>>>>> 0x000d[NFCSTATUS_PENDING]
>>>>> 05-12 22:08:54.828: INFO/NFCJNI(303):NFCInitialized
>>>>> 05-12 22:08:54.828: DEBUG/NfcService(303):NFC-EE routing OFF
>>>>> 05-12 22:08:54.847: DEBUG/NfcService(303):NFC-C discovery ON
>>
>>>>> BUT reader is not detecting a Tag on my phone
>>>>> Is there maybe a problem to setting the mode
>>>>> returned 0x000d[NFCSTATUS_PENDING] sounds not so great
>>
>>>>> I am working with CyanogenMod 7 (Android 2.3.4)
>>
>>>>> regards
>>>>> Markus- Hide quoted text -
>>
>>>> - Show quoted text -
>

Re: NFC Secure Element Martin 5/19/11 12:26 PM
Hello Michael,

yes I am very sure that I can read and also write persistent data to
the MiFare Classic.
Even if the Nexus S is turned off, we are still able to read and write
data.
I will give you some information about the NFC reader, the software
and the keys we use tomorrow, because I have all these stuff at my
company and not in mind.
So what do you think about reading and writing data to the emulated
MiFare card via an android app? Are there any hidden methods in the
api, which I can use via reflection to handle that? As I have already
written I am able to access the Secure Element with the hidden methods
of the NfcAdapter class, but all I can do so far is to connect, then
open it and read the UID.

Best wishes,

Martin
Re: NFC Secure Element Martin 5/20/11 4:32 AM

Hello Michael,

here are the information I promised you yesterday.

Reader: Omnikey 55x3
Software: HID Reader Utility Version 4.0.0.0

Key: FFFFFFFFFFFF it works for each sector.

This is what we found in the api:

// The well-known default MIFARE read key. All keys are set to this at
the factory.
// Using this key will effectively make the payload in the sector
public.

         public static final byte[] KEY_DEFAULT =

                  {(byte)0xFF,(byte)0xFF,(byte)0xFF,(byte)0xFF,
(byte)0xFF,(byte)0xFF};

I checked the UID of the SecureElement, which I can get by calling the
getSecureElementUid() of the NfcSecureElement class via reflection.
And I also checked the sector 00 block 00 of the emulated MiFare card
with our external NFC reader to get the UID. They match!

Do you think it is possible to read/write data with APDU commands?
There is a hidden method in the NfcSecureElement class called
exchangeAPDU.
public byte [] exchangeAPDU(int handle,byte [] data){...}

I have tried some commands, which I found on page eleven at the
following pdf document:

http://www.nfc-reader.com/NFC-smart-card-reader/ACR122-API-Manual/API_ACR122.pdf

But I always get back 6E 00.

Best wishes!

Martin


On 19 Mai, 20:18, Michael Roland <mi.rol...@gmail.com> wrote:
Re: [android-developers] Re: NFC Secure Element Michael Roland 5/25/11 8:48 AM
Hallo Martin,

it seems you are right. Obviously, my tests were too superficial.

I tested with an Omnikey 5321, but that reader automatically activated
the SMX up to the ISO 14443-4 layer, so it was not possible to transmit
any MIFARE Commands.

I, therefore, switched to an ACR122U. I followed the instructions in
that reader's manual to stop activation after ISO 14443-3 (the layer
were MIFARE Classic kicks in). This seemed to work, but regardless of
what commands I sent to the reader my program told me that the commands
were successful. Yet, when I tried to read back any previously written
data it did not work.

It took me a while to figure out what was going wrong: I misinterpreted
the steps required to stop ISO 14443-4 activation.

I can now confirm that reading & writing the MIFARE Classic area of the
SmartMX works with the default keys (0xffffffffffff). (Tested with a
properly initialized ACR122U and an NXP Pegoda reader.)

Actually, I'm still a bit surprised that the default keys were used
here. In fact I would have expected that the MIFARE area was locked with
some non-standard keys to be protected against modification by anyone
except Google (or whoever will get access to te rest of the secure element).


So now we would only need to find a way to access the MIFARE area from
within an application on the phone.

I'm currently testing with a modified version of the 2.3.4 firmware. But
as with the smart card readers, the SmartMX is automatically activated
up to the ISO 14443-4/APDU layer. So far I was unable to use any MIFARE
Classic commands to access the secure element.

br
Michael

Re: [android-developers] Re: NFC Secure Element Nikolay Elenkov 5/26/11 7:31 PM
This may warrant a new thread, but since most people interested in
NFC and the secure element are posting here, I'll just chime in.
(the whole thread is a bit OT, since none of this stuff is part of the SDK)

So, Google Wallet has been announced, and it does save stuff
to the secure element. A few questions and thoughts:

* is the Spring Nexus S different from the 'regular' Nexus S?
Different secure element chip? Different keys? Different OS
version? Anyone have one to confirm?
* If the OS version is the same, and their are no API's for
accessing the secure element, that only leaves the Wallet
app using custom native libraries to access the SE.
Unfortunately, that means that third-party developers are
not likely to get access (through the SDK)
* Reading the marketing blurbs, it looks like that relevant
applets are only installed only after you install the Wallet
app and authorize linking to your credit card.

All in all, seems like a closed system, controlled by Google,
which is understandable, but rather unfortunate. NFC for third party
developers is just an interesting toy, and it seems it will stay
that way.

Re: [android-developers] Re: NFC Secure Element JMC114 6/1/11 1:36 AM
Are you guys sure it's a MIFARE 4k card it's emulating?

When I put the device in emulation mode and read its ATR, I'm getting:
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 00 00 00 00 00 6B
While I'm actually expecting:
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 02 00 00 00 00 69
Similar - but not quite.
Thoughts?
Regards,
JMC
Re: NFC Secure Element Martin 6/1/11 2:21 AM
Hi JMC,

I can not check this at the moment, because I do not have the device
at the moment.
After some changes in the the android cpp sources, I got additional
information about the Secure Element, when I open a secure element
connection via reflection. So there I can see that it has the Mifare
technology.

But
3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 00 00 00 00 00 6B
does not even represent a Mifare Classic 1k card.

Log output:
2 Tags discovered.

Tag Technology:
3 - ISO_DEP
1 - NFC_A
8 - MIFARE_CLASSIC

Tech Type - don't know what this is...
9
9
12

Tech handle
3211564 - just an example
3211564 - just an example
3211495 - just an example

Best wishes,

Martin
Re: NFC Secure Element Michael Roland 6/2/11 4:15 AM
Hallo JMC,

> Are you guys sure it's a MIFARE 4k card it's emulating?

Yes, I'm very sure it is emulating a MIFARE Classic 4K card and an APDU
based smart card (depending on the protocol activation level).


> When I put the device in emulation mode and read its ATR, I'm getting:
> 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 00 00 00 00 00 6B

Decoding this PC/SC ATR gives this:
3B ... Contactless card
  8F ... Number of historical bytes: 0xF (15)
  80
  01
    80 ... Category indicator: A status indicator may be present
           in an optional COMPACT-TLV data object.
    4F ... Application identifier Presence indicator
    0C ... Length of application identifier: 0x0C (12)
      Application identifier:
        A0 00 00 03 06 ... RID: PC/SC Working Group
        03 ... Byte for Standard: ISO 14443 A, part 3
        00 00 ... Bytes for Card Name: not in standard
        00 00 00 00 ... RFU (Shall be set to zero)
  6B ... Checksum

This is a typical ATR if the card emulation mode is not activated. I
receive that ATR if I put the phone in peer-to-peer communication mode
(which is the default if card emulation is disabled).


> While I'm actually expecting:
> 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 02 00 00 00 00 69

With the phone you would not normally receive such an ATR for the card
emulation mode either. Usually a contactless smart card reader (like the
Omnikey 5321) activates the contactless smart card up to its highest
supported protocol layer. For the SmartMX, this means that ISO 14443-4
protocol layer is activated for APDU based communication with the
JavaCard. Thus, the ATR generated by the smart card reader would reflect
the properties of the APDU-based JavaCard and not those of the MIFARE 4K
area. This is the value I recieve when card emulation is on:
  3B 8A 80 01 00 31 C1 73 C8 40 00 00 90 00 90


Best regards,
Michael

Re: NFC Secure Element JMC114 6/2/11 5:55 AM
Hey Michael,

Oh, it seems I failed terribly.. That's the value I thought to receive when the device is in peer-to-peer mode. I confused the two.

Thanks for the clarification.

--
Met vriendelijke groet, | Best regards,
Jorn Cruijsen
jorncr...@gmail.com
(+31) (0)6 272 492 91
Re: NFC Secure Element Alberto González 6/2/11 11:21 AM
Have anyone read this?

2.3.4. adds hidden classes for secure element and related:
http://gibraltarsf.com/blog/?p=247

On Jun 2, 2:55 pm, Jorn Cruijsen <jorncruij...@gmail.com> wrote:
> Hey Michael,
>
> Oh, it seems I failed terribly.. That's the value I thought to receive when
> the device is in peer-to-peer mode. I confused the two.
>
> Thanks for the clarification.
>
> --
> Met vriendelijke groet, | Best regards,
> Jorn Cruijsen
> jorncruij...@gmail.com
> (+31) (0)6 272 492 91
>
>
>
>
>
>
>
Re: NFC Secure Element Steve McRae 6/2/11 12:44 PM
I can confirm the ATR's as Michael pointed and add an interesting
follow on. When I do scardconnect and then scardsttus to get uid I get
the 5 byte (4 byte dynamic first by 08 static e.g. 080A97A6) from the
phone whenever the NFC service is running. if I leave the connection
open and run multiple commands the uid stays the same but if i
disconnect and reconnect the uid dynamically changes. Is there a way
to capture this uid as it is being created/sent from the phone? Is
this uid generated by the secure element?
Re: NFC Secure Element Michael Roland 6/3/11 12:40 AM
Hallo Steve,

> I can confirm the ATR's as Michael pointed and add an interesting
> follow on. When I do scardconnect and then scardsttus to get uid I get
> the 5 byte (4 byte dynamic first by 08 static e.g. 080A97A6) from the
> phone whenever the NFC service is running.

The UID (or actually the NFCID1) you get should be 4 bytes in total,
starting with 0x08 to mark that bytes 1 to 3 are randomly generated.

> if I leave the connection
> open and run multiple commands the uid stays the same but if i
> disconnect and reconnect the uid dynamically changes.

Correct. A random UID/NFCID1 must stay constant during one power cycle
(i.e. whenever the magnetic field of the reader switches from POWER-OFF
state to the IDLE state.) As the UID is used for anti-collision of
multiple transponders in the field of the reader it needs to be constant
during the communication phase.

> Is there a way
> to capture this uid as it is being created/sent from the phone?
> Is this uid generated by the secure element?

At least with the 3 phones I tried so far, the UID of the secure element
was static. Only the NFCID1 generated for peer-to-peer mode was dynamic
(as required by the standard).

For the UID of the secure element: Yes it can be captured through the phone.
For the NFCID1 in peer-to-peer mode: I guess there could be some way to
capture the current NFCID1 through libnfc-nxp but I haven't tried.


Best regards,
Michael

Re: NFC Secure Element Marcus 6/10/11 2:50 AM
Hello,

I'm in university and i'm working on NFC in Nexus S for three weeks.

At time, I'm able to put my devices into emulation mode.
I'm getting ATR and UID throuth my OMNIKEY CardMan 5321 :
   - ATR: 3B 8A 80 01 00 31 C1 73 C8 40 00 00 90 00 90
   - The ID of the emulated card is constant even if i start a new
power cycle .

My question is how can I found my UID on the NXP chip ?
Can you give me more information about the 0xffffffffffff key? I don't
understant how to use it ...

Thanks for your help,

Regards,

Marcus
Re: NFC Secure Element Michael Roland 6/11/11 2:33 AM
Hallo Marcus,

> At time, I'm able to put my devices into emulation mode.
> I'm getting ATR and UID throuth my OMNIKEY CardMan 5321 :
>    - ATR: 3B 8A 80 01 00 31 C1 73 C8 40 00 00 90 00 90

Correct, this is the ATR generated for the SmartMX.

>    - The ID of the emulated card is constant even if i start a new
> power cycle .

Correct, the UID of the SmartMX is static (by default).

> My question is how can I found my UID on the NXP chip ?

What do you mean by "find"?

 - Do you want to read the UID value from Android?

This can be done through some hidden/internal NFC APIs.

> Can you give me more information about the 0xffffffffffff key? I don't
> understant how to use it ...

This is the authentication key to the MIFARE Classic area of the
SmartMX. You can use this key to read & write data to the 4K MIFARE area
on the SmartMX. You would use this key with your reader's MIFARE access
methods (either reader specific or compliant to the PC/SC standard for
access to contactless memory cards).

With your Omnikey reader it will be quite difficult to use the MIFARE
area as it automatically activates the SmartMX up to its highest
protocol level (APDU-based access to the JavaCard). So the MIFARE
protocol will not work on this activation level. (As far as I remember
you might be able to disable the automatic protocol activation with some
registry tweaks.)

br,
Michael

Re: NFC Secure Element Marcus 6/14/11 8:52 AM
Ok thanks for advices Michael,

I will try to modify the mifare area of the Nexus in order to
reproduce my badge.

Best regards

Marcus
Re: NFC Secure Element JMC114 6/14/11 2:29 PM
Note that the uid is contained inside the first sector, which is a read-only sector and is therefore impossible to modify. As such, it's impossible to fully reproduce your badge. If the system you wish to reproduce it for depends on the card's uid for identification, the procedure won't work.
Re: NFC Secure Element Markus 6/20/11 1:04 AM
Hi Michael,

On 19 Mai, 00:59, Michael Roland <mi.rol...@gmail.com> wrote:
> Regarding an external secure element on the UICC ("SIM" card): Partly
> yes. You can activate an SWP-UICC as secure element. But access is
> limited to external readers for the moment. Until now, there is no known
> way to get access to application on the UICC from a phone application.

You are sure its not possible to access it from an android
application?
In Madlmayers Blog he wrote, its possible because of the additional AT
Commands in RIL since 2.3.2.

Question about UICC

Have somebody activate the Card Emulation with UICC?
I tryed it, with SmartMX SE it was no problem Card Emulation was
running.
When I tried the ID of my UICC in the Method doSelectSecureElement
from NFC Service,
then the Card Emulation was not running, Reader dont detect a Tag.

Somebody knows why doSelectSecureElement Method dont working with
UICC?




Re: NFC Secure Element Markus 6/21/11 6:57 AM
Hello,
I cant load the key ff ff ff ff ff ff to the 4k MIFARE.
If my Nexus S is in Card Emulation I tried with JCShell to do
something.
Reading UID and ATR is no problem it works.
But by loading the Key, occurs an error:

/send FF82201A06FFFFFFFFFFFF
=> FF 82 20 1A 06 FF FF FF FF FF FF                   .. ........
(407461 nsec)
<= 69 86                                              i.
Status: Command not allowed (no current EF)

Anybody know where is the fault???


greets
Markus


On 19 Mai, 19:51, Martin <martin.buellesb...@googlemail.com> wrote:
> Hello all,
>
> Michael as you already mentioned, it is possible to activate the card
> emulation mode and theSecureElementin the Nexus S.
> I did that and also changed the permissions from
> android.permission.WRITE_SECURE_SETTINGS to android.permission.NFCin
> NfcService.java to get access to theSecureElement.
> Now I am able to create and open a connection to theSecureElement
> and get its UID.
> After enabling the card emulation mode on the Nexus S, I am able to
> read and write data to the emulated MiFare Classic 4k card by an
> externalNFCreader. I would like to do that within an android app.
> Why is that not possible through an android application? You have
> spoken about the access keys, but aren't they the same for internal
> and external access?
> If I have understood you correctly, there is nothing more I can do so
> far, right?
>
> Thanks a lot!
>
> Martin
>
> On 19 Mai, 00:59, Michael Roland <mi.rol...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hallo,
>
> > > I more or less understand how to do it but I don't understand if after
> > > is possible to build application on card emulation.
>
> > Regarding the internalsecureelement(SmartMX): No. Even if you
> > activate this chip as thesecureelement, you could only use its UID for
> > your application. To edit data on it/install applications into it you
> > would need to have the access keys for thatsecureelement.
>
> > Regarding an externalsecureelementon the UICC ("SIM" card): Partly
> > yes. You can activate an SWP-UICC assecureelement. But access is
> > limited to external readers for the moment. Until now, there is no known
> > way to get access to application on the UICC from a phone application.
>
Re: NFC Secure Element JMC114 6/21/11 4:04 PM
doSelectSecureElement should work for the UICC. (code here) I haven't got a SWP compliant SIM handy though so I can't test it, but I can't see any reason it wouldn't work (judging from the linked code).

Opening a connection with it - using doOpenSecureElementConnection, like you can with the Smart-MX - will most definitely not work for a UICC SE though. (code here) As the NativeNfcSecureElement will only open a connection with the Smart-MX SE - completely ignoring a UICC even if it is detected.
Perhaps you could tweak this code to force a connection with a UICC if it's detected, but I doubt that will work (correctly).
Re: NFC Secure Element JMC114 6/22/11 11:04 PM
[0] command (0x60 for key A, 0x61 for key B)
[1] block number (will authenticate entire sector)
[2-5] last 4 bytes of uid
[6-11] 6 byte key

Also, here's how Android does the authentication: click

Re: [android-developers] Re: NFC Secure Element Michael Roland 6/26/11 3:48 AM
Hallo Markus,

> You are sure its not possible to access it [SWP-UICC] from an android


> application?
> In Madlmayers Blog he wrote, its possible because of the additional AT
> Commands in RIL since 2.3.2.

Where did you find this information in Gerald's blog? I only found "When
Android switched from 2.3.1 to 2.3.2, Google made some changes in the
telephony API, which are required by G&D's smartcard stack.", which
referes to the Telephony API and not to the RIL itself. According to the
information in the SEEK project
(http://code.google.com/p/seek-for-android/) the RIL itself is still not
able to handle the additional AT commands.

> Have somebody activate the Card Emulation with UICC?

Yes.

> I tryed it, with SmartMX SE it was no problem Card Emulation was
> running.
> When I tried the ID of my UICC in the Method doSelectSecureElement
> from NFC Service,
> then the Card Emulation was not running, Reader dont detect a Tag.
>
> Somebody knows why doSelectSecureElement Method dont working with
> UICC?

If the UICC supports SWP, the doSelectSecureElement method works just
fine here. (ID is 11259376 for UICC)

br,
Michael

Re: [android-developers] Re: NFC Secure Element Michael Roland 6/26/11 4:22 AM
Hallo Markus,

> But by loading the Key, occurs an error:
>
> /send FF82201A06FFFFFFFFFFFF
> => FF 82 20 1A 06 FF FF FF FF FF FF                   .. ........
> (407461 nsec)
> <= 69 86                                              i.
> Status: Command not allowed (no current EF)

Actually this response means "Volatile memory is not available"
according to the PC/SC standard. This suggests that the key number 0x1A
is not usable with your reader.

br,
Michael

Re: [android-developers] Re: NFC Secure Element Michael Roland 6/26/11 4:26 AM
Hallo,

> Opening a connection with it - using doOpenSecureElementConnection, like
> you can with the Smart-MX - will most definitely not work for a UICC SE
> though. As

> the NativeNfcSecureElement will only open a connection with the Smart-MX
> SE - completely ignoring a UICC even if it is detected.
> Perhaps you could tweak this code to force a connection with a UICC if
> it's detected, but I doubt that will work (correctly).

No, unfortunately this will not work. Neither the libnfc-nxp nor the
PN544 NFC chip support internal access to the UICC through this method.
Therefore, we will have to wait until UICC access gets available through
the Telephony API.

br,
Michael

Re: NFC Secure Element Dominik 6/27/11 3:43 PM
Hello Michael,

> So now we would only need to find a way to access the MIFARE area from
> within an application on the phone.
>
> I'm currently testing with a modified version of the 2.3.4 firmware. But
> as with the smart card readers, the SmartMX is automatically activated
> up to the ISO 14443-4/APDU layer. So far I was unable to use any MIFARE
> Classic commands to access the secure element.

What would be the use-case which requires access to the emulated
Mifare card from within an android application?
Or asked another way round: What could be done additionally compared
to NDEF Push?

Dominik
Re: NFC Secure Element Michael Roland 6/28/11 3:29 AM
Hallo Dominik,

> What would be the use-case which requires access to the emulated
> Mifare card from within an android application?
> Or asked another way round: What could be done additionally compared
> to NDEF Push?

Have a look at my reply a while ago in this thread:
https://groups.google.com/group/android-developers/tree/browse_frm/thread/418c9b370f08a9f7/f1d824274a797adf?rnum=1#doc_55a8c6f6ba10f98c

br,
Michael

Re: NFC Secure Element CK 6/29/11 9:53 PM
Hello all,

Any has customer rom 2.3.4 to support card emulation.

Thanks in advance!
CK

On May 20, 1:51 am, Martin <martin.buellesb...@googlemail.com> wrote:
> Hello all,
>
> Michael as you already mentioned, it is possible to activate the card
> emulation mode and theSecureElementin the Nexus S.
> I did that and also changed the permissions from
> android.permission.WRITE_SECURE_SETTINGS to android.permission.NFC in
> NfcService.java to get access to theSecureElement.
> Now I am able to create and open a connection to theSecureElement
> and get its UID.
> After enabling the card emulation mode on the Nexus S, I am able to
> read and write data to the emulated MiFare Classic 4k card by an
> external NFC reader. I would like to do that within an android app.
Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 7/14/11 3:49 AM

> Have somebody activate the Card Emulation with UICC?

Yes.

> I tryed it, with SmartMX SE it was no problem Card Emulation was
> running.
> When I tried the ID of my UICC in the Method doSelectSecureElement
> from NFC Service,
> then the Card Emulation was not running, Reader dont detect a Tag.
>
> Somebody knows why doSelectSecureElement Method dont working with
> UICC?

If the UICC supports SWP, the doSelectSecureElement method works just
fine here. (ID is 11259376 for UICC)


Hi Michael,

I am new to this forum and I am impressed of the level your mastership and the rest of the members.

Do you mean you could enable card emulation mode from UICC? Could you read the contents of a smartcard through an external reader and also from an android application?
 
Re: NFC Secure Element Michael Roland 7/14/11 4:55 AM
Hallo,

> Do you mean you could enable card emulation mode from UICC? Could you
> read the contents of a smartcard through an external reader and also
> from an android application?


Yes, I managed to enable card emulation mode with a SWP-UICC as secure
element. As the NFC controller allows only external card emulation for
secure elements connected through SWP, I could only access the smartcard
from an external reader but not through an Android app.

br
Michael

Re: NFC Secure Element Fernando Miguélez Palomo 7/14/11 6:59 AM
Interesting.

Did you get it tweaking the code by yourself as described above or you used SEEK patches? I am currently trying to get some results myself but I am new to Android platform development and I am a little bit lost.

2011/7/14 Michael Roland <mi.r...@gmail.com>

Re: NFC Secure Element Rui Campos 7/15/11 10:43 AM
Do any of you have an image that can be applied directly to a Nexus S?
Re: NFC Secure Element Fernando Miguélez Palomo 7/18/11 8:26 AM
Hi Nemik,

I just applied your patches to 2.3.4_r1 version (I had to change them a little bit) but card emulation does not seem to work (an external reader detects nothing). Could you please tell us what tag of AOSP gingerbread did you use?

Thanks
Re: NFC Secure Element nemik 7/18/11 9:35 AM
Fernando, the patches were against 2.3.1 or 2.3.2 I believe, a long
time ago (relatively). I have not had a chance to revisit this but I'm
fairly sure it will not work on 2.3.4+.

I'm sure some of the header defines have changed as well but try to re-
enable the ones I had if they exist? Good luck.

On Jul 18, 10:26 am, Fernando Miguélez Palomo
Re: NFC Secure Element Fernando Miguélez Palomo 7/18/11 9:58 AM
Yes I know. I revised them manually and adapted to 2.3.4_r1. However I must be missing something. 

I see the Secure Element SMX selected, the embedded Mifare card is not detected by means of external readers. The external reader detects a memory card but it can not read the CSN (UID). It seems as if the card emulation were enabled but then disabled. 

This is my init sequence as seen by logcat: http://pastebin.com/XpyLUGaJ

I can see the following sequence. So I assume the embedded secure element is enabled:

I/NFC JNI (  198): NFC Initialized
D/NfcService(  198): NFC-EE routing ON
D/NFC JNI (  198): ******  Select Secure Element ******
D/NFC JNI (  198): phLibNfc_SE_SetMode(0x00abcdef, ...)
D/NFC JNI (  198): phLibNfc_SE_SetMode() returned 0x000d[NFCSTATUS_PENDING]

What is the correct message sequence?

I attach your patches modified to compile against 2.3.4_r1. Someone could find them useful. By the way in this tag Nfc is disabled by default. So the patch "device_base_2_3_4_r1.diff" must be also applied.

Re: NFC Secure Element Fernando Miguélez Palomo 7/18/11 10:08 AM
For convenience I post the filtered NFC related I can see after initialization. As I said the card is detected on reader but only after phone restarts (however it can not read any UID). If I approach it latter it is not recognized.

07-18 17:01:54.800: DEBUG/NFC JNI(283): NFC Service : loading JNI
07-18 17:01:54.847: INFO/NfcService(283): Starting NFC service
07-18 17:01:54.992: DEBUG/NFC JNI(283): > Set NFC DISCOVERY A to 1
07-18 17:01:54.992: DEBUG/NFC JNI(283): > Set NFC DISCOVERY B to 1
07-18 17:01:54.992: DEBUG/NFC JNI(283): > Set NFC DISCOVERY F to 1
07-18 17:01:54.992: DEBUG/NFC JNI(283): > Set NFC DISCOVERY 15693 to 1
07-18 17:01:54.992: DEBUG/NFC JNI(283): > Set NFC DISCOVERY 15693 to 1
07-18 17:01:55.089: DEBUG/NFC JNI(283): phLibNfc_Mgt_Initialize returned 0x000d[NFCSTATUS_PENDING]
07-18 17:01:55.113: DEBUG/NFC JNI(283): NFC client started
07-18 17:01:55.250: DEBUG/NFC JNI(283): NFC capabilities: HAL = 8150100, FW = a70414, HW = 620003, Model = 0, HCI = 1, Full_FW = 104, FW Update Info = 0
07-18 17:01:55.582: DEBUG/NFC JNI(283): phLibNfc_SE_SetMode() returned 0x000d[NFCSTATUS_PENDING]
07-18 17:01:55.597: DEBUG/NFC JNI(283): ******  NFC Config Mode NFCIP1 - LLCP ******
07-18 17:01:55.597: DEBUG/NFC JNI(283): phLibNfc_Mgt_SetLlcp_ConfigParams returned 0x000d[NFCSTATUS_PENDING]
07-18 17:01:55.644: INFO/NFC JNI(283): NFC Initialized
07-18 17:01:55.644: DEBUG/NfcService(283): NFC-EE routing ON
07-18 17:01:55.644: DEBUG/NFC JNI(283): phLibNfc_SE_SetMode() returned 0x000d[NFCSTATUS_PENDING]
07-18 17:01:55.664: DEBUG/NfcService(283): NFC-C discovery OFF
07-18 17:01:55.664: DEBUG/NFC JNI(283): ******  Stop NFC Discovery ******
07-18 17:01:55.746: DEBUG/NFC JNI(283): phLibNfc_Llcp_Socket() returned 0x0000[NFCSTATUS_SUCCESS]
07-18 17:01:55.750: DEBUG/NFC JNI(283): phLibNfc_Llcp_Bind() returned 0x0000[NFCSTATUS_SUCCESS]
07-18 17:01:55.750: DEBUG/NFC JNI(283): phLibNfc_Llcp_Listen() returned 0x0000[NFCSTATUS_SUCCESS]

Re: NFC Secure Element Fernando Miguélez Palomo 7/19/11 3:48 AM
I got it working on 2.3.4_r1!!!

The key was enabling discoverability but in card emulation mode. The strange thing is now I can detect two smart card types with an Arcontia smart card reader:
  • ISO14443A tag CL1 tag (This is the Mifare 4K)
  • FELICA RCS-885 424kbs tag (I suppose this is really the Javacard, not a Felica card)
I managed to write and read a block (4) to the Mifare 4K with default keys. Next thing will be investigating wheter 2.3.4 adds support by means of nxp-nfc library to directly send APDUs to the SE. You and Michael Roland already confirmed it was not possible with prior gingerbread versions.

I post the corrected patch to get card emulation on 2.3.4_r1.

One thing. Card stops being readable from an external reader after screen goes off and back on. However if you disable NFC and re-enable it (from settings) card is discoverable again.

Thanks nemik for your work (you can update your patches with these corretions to work with gingerbread 2.3.4_r1 at your site if you want).


Re: NFC Secure Element Michael Roland 7/20/11 4:01 AM
Hallo,

> Did you get it tweaking the code by yourself as described above or you
> used SEEK patches? I am currently trying to get some results myself but
> I am new to Android platform development and I am a little bit lost.

I tweaked the code by myself. The SEEK patches won't enable card
emulation through NFC. They enable secure element access from within
Android apps.

br
Michael

Re: [android-developers] Re: NFC Secure Element Michael Roland 7/20/11 4:14 AM
Hallo,

> I managed to write and read a block (4) to the Mifare 4K with default
> keys. Next thing will be investigating wheter 2.3.4 adds support by
> means of nxp-nfc library to directly send APDUs to the SE. You and
> Michael Roland already confirmed it was not possible with prior
> gingerbread versions.

Just to be clear on that: From within Android apps it *is* possible to
send APDUs to the internal secure element (SmartMX). But it *is not*
possible to send APDus to an SWP-UICC.

br,
Michael

Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 7/21/11 3:17 AM
Hi Michael,

As far as I understand sending APDUs to the SmartMX SE element is possible because the NFC Controller (PN544) is told to enable the NFC-WI interface with SE. This is carried out by calling phHal4Nfc_Switch_SMX_Mode(), with parameter eSmartMx_Wired (function phLibNfc_SE_SetMode()).

Wouldn't it be possible to use the SWP channel to send APDUs to UICC SE through NFC Controller in an "wired mode" from an application the same way it is performed when sending APDUs to the SmartMX element? Or is SWP only supposed for raw RF Communication and has no such equivalent capabilities used by NFC-WI?

Taking a look at the libnfc-nxp library theare are some SWP related functions that are not being used.Maybe phHal4Nfc_Switch_Swp_Mode() could be used in a similar fashion to phHal4Nfc_Switch_SMX_Mode()?


Re: NFC Secure Element nemik 7/21/11 8:30 AM
Great job Fernando! Thank you for sharing your diff on this, it's
fantastic news.

On Jul 19, 5:48 am, Fernando Miguélez Palomo
<fernando.migue...@gmail.com> wrote:
> I got it working on 2.3.4_r1!!!
>
> The key was enabling discoverability but in card emulation mode. The strange
> thing is now I can detect two smart card types with an Arcontia smart card
> reader:
>
>    - ISO14443A tag CL1 tag (This is the Mifare 4K)
>    - FELICA RCS-885 424kbs tag (I suppose this is really the Javacard, not a
>    Felica card)
>
> I managed to write and read a block (4) to the Mifare 4K with default keys.
> Next thing will be investigating wheter 2.3.4 adds support by means of
> nxp-nfc library to directly send APDUs to the SE. You and Michael Roland
> already confirmed it was not possible with prior gingerbread versions.
>
> I post the corrected patch to get card emulation on 2.3.4_r1.
>
> One thing. Card stops being readable from an external reader after screen
> goes off and back on. However if you disable NFC and re-enable it (from
> settings) card is discoverable again.
>
> Thanks nemik for your work (you can update your patches with these
> corretions to work with gingerbread 2.3.4_r1 at your site if you want).
>
>  Nfc-app-2_3_4_r1.diff
> 31KViewDownload
Re: [android-developers] Re: NFC Secure Element Michael Roland 7/25/11 5:15 AM
Hallo Fernando,

> As far as I understand sending APDUs to the SmartMX SE element is
> possible because the NFC Controller (PN544) is told to enable the NFC-WI
> interface with SE. This is carried out by calling
> phHal4Nfc_Switch_SMX_Mode(), with parameter eSmartMx_Wired (function
> phLibNfc_SE_SetMode()).

Correct, for the SE connected through NFC-WI/S2C, the NFC controller has
three modes: off, wired and virtual mode. Off means that there is no
communication with the secure element. Wired mode means that the secure
element is visible to the application processor as if it was a
(contactless) smartcard connected to the RF reader. Virtual mode means
that the secure element is visible to external readers as if the phone
were a contactless smartcard.

> Wouldn't it be possible to use the SWP channel to send APDUs to UICC SE
> through NFC Controller in an "wired mode" from an application the same
> way it is performed when sending APDUs to the SmartMX element?

From what I've read in the PN544 User Manual, I don't think that there
is an equvalent for the wired mode with SWP/HCI (I would be happy to be
proven wrong). Usually for the "wired mode", the contact interface of
the UICC would be used so it wouldn't really make sense if the NFC
controller allowed for an additional* channel between the UICC and the
application processor.

*) "Additional" once the RIL supported APDU exchange with the UICC.

> Or is SWP only supposed for raw RF Communication and has no such
> equivalent capabilities used by NFC-WI?

In fact it is quite the opposite. NFC-WI is the protocol for raw "RF"
communication. SWP has several more capabilities. There is three
protocols used on top of SWP: ACT, CLT and SHDLC. ACT is used for
interface activation. CLT is a tunneling protocol for raw frames of the
contactless protocol (used for e.g. MIFARE protocol). SHDLC is the high
level data link protocol. On top of this HCI (Host Controller Interface)
is used for communication between the UICC and the NFC controller.

br,
Michael

Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 7/27/11 12:30 AM
Hi Michael,

Correct, for the SE connected through NFC-WI/S2C, the NFC controller has
three modes: off, wired and virtual mode. Off means that there is no
communication with the secure element. Wired mode means that the secure
element is visible to the application processor as if it was a
(contactless) smartcard connected to the RF reader. Virtual mode means
that the secure element is visible to external readers as if the phone
were a contactless smartcard.

That's right.
 

From what I've read in the PN544 User Manual, I don't think that there
is an equvalent for the wired mode with SWP/HCI (I would be happy to be
proven wrong). Usually for the "wired mode", the contact interface of
the UICC would be used so it wouldn't really make sense if the NFC
controller allowed for an additional* channel between the UICC and the
application processor.

*) "Additional" once the RIL supported APDU exchange with the UICC.

Well, here is where the  phHal4Nfc_Switch_Swp_Mode()  comes. It is analog to the phHal4Nfc_Switch_SMX_Mode() which is used to set the wired mode to work with the SmartMX. In function phLibNfc_SE_SetMode() when told to enable wired mode it ignores to enable it if secure element is UICC instead of SmartMX. In this last case it uses phHal4Nfc_Switch_SMX_Mode()  with the parameter eSmartMx_Wired. I modified the function to use phHal4Nfc_Switch_Swp_Mode() with parameter eSWP_Switch_On (this parameter has an incorrect value by default, it must be enabled by using nemik's patches). This function (phHal4Hnfc_Switch_Swp_Mode()) succeeds, which makes me think there could be a "wired" SWP mode. 

Although the SWP mode is enabled, no SE seems to be detected this way. When opening SMX in wired mode from  com_android_nfc_NativeNfcSecureElement_doOpenSecureElementConnection() the callback is called twice after calling  phLibNfc_SE_SetMode(). However if SWP is enabled (using external SE element) callback is only called once after phLibNfc_SE_SetMode(). If we avoid waiting for second callback phLibNfc_RemoteDev_Connect() always fails (internally no SE has been discovered).

When it comes to RIL issue. I patched the sources with SEEK diffs too but rild daemon crashes. SEEK mantainers say it is due to baseband processor not implementing required (AT+CSIM, AT+CCHO, AT+CCHC, AT+CGLA) commands (http://code.google.com/p/seek-for-android/wiki/UICCSupport). Is there any way to reverse engineer baseband firmware or get access to a modified version implementing those commands? Or has anyone discovered whether Samsung has other propietary commands achieving the same results (raw APDU exchange with SIM/UICC)?

regards,

Fernando

Re: [android-developers] Re: NFC Secure Element Michael Roland 8/1/11 3:39 AM
Hallo Fernando,

>> From what I've read in the PN544 User Manual, I don't think that there
>> is an equvalent for the wired mode with SWP/HCI (I would be happy to be
>> proven wrong).
>
> Well, here is where the  phHal4Nfc_Switch_Swp_Mode()  comes. It is
> analog to the phHal4Nfc_Switch_SMX_Mode() which is used to set the
> wired mode to work with the SmartMX.
> I modified the function to use phHal4Nfc_Switch_Swp_Mode() with
> parameter eSWP_Switch_On (this parameter has an incorrect value by
> default, it must be enabled by using nemik's patches).

If you are refering to this patch:
http://nemik.net/code/android-nfc/libnfc-nxp.diff

Then I don't see how it changes the value of eSWP_Switch_On

typedef enum phHal_eSWP_Mode{
  eSWP_Switch_Off      = 0x00U,   /* SWP Link is Switched off */
+ //eSWP_Switch_Off,   /* SWP Link is Switched off */
  eSWP_Switch_Default, /* SWP is in Default Configuration Mode */
- eSWP_Switch_On       /* SWP Link is Switched on */
+ eSWP_Switch_On       /* SWP Link is Switched on */
+ //eSWP_Switch_On        = 0x00U /* SWP Link is Switched on */
} phHal_eSWP_Mode_t;

After this patch eSWP_Switch_On still is 0x02. Which is in fact the
correct value according to PN544 user manual:

  SWP Switch Mode Event Parameters:
      -----------------------------
      Value   Description
      -----------------------------
      0x00    Off (deactivated)
      0x01    Default mode
      0x02    On (activated)
      others  RFU

So there is no equivalent to the wired mode, but only options to
enable/disable external emulation.

> When it comes to RIL issue. I patched the sources with SEEK diffs too
> but rild daemon crashes. SEEK mantainers say it is due to baseband
> processor not implementing required (AT+CSIM, AT+CCHO, AT+CCHC, AT+CGLA)
> commands (http://code.google.com/p/seek-for-android/wiki/UICCSupport).

Correct.

> Is there any way to reverse engineer baseband firmware or get access to
> a modified version implementing those commands? Or has anyone discovered
> whether Samsung has other propietary commands achieving the same results
> (raw APDU exchange with SIM/UICC)?

I believe this would be the most promising direction. Unfortunately, I
haven't found much information on this.

br
Michael


Re: NFC Secure Element Xiang 8/4/11 12:11 AM
Hi,

Thanks for the information and patches for manually enabling the card
emulation in Android. I am able to read and write a block into the
Mifare 4K emulated inside Nexus S using an external card reader. Is it
possible to read the data inside the Mifare 4K from Android
application? Is SEEK patches able to perform that?

Thanks again.


Regards,
Xiang


On Jul 19, 6:48 pm, Fernando Miguélez Palomo
<fernando.migue...@gmail.com> wrote:
> I got it working on 2.3.4_r1!!!
>
> The key was enabling discoverability but in card emulation mode. The strange
> thing is now I can detect two smart card types with an Arcontia smart card
> reader:
>
>    - ISO14443A tag CL1 tag (This is the Mifare 4K)
>    - FELICA RCS-885 424kbs tag (I suppose this is really the Javacard, not a
>    Felica card)
>
> I managed to write and read a block (4) to the Mifare 4K with default keys.
> Next thing will be investigating wheter 2.3.4 adds support by means of
> nxp-nfc library to directly send APDUs to the SE. You and Michael Roland
> already confirmed it was not possible with prior gingerbread versions.
>
> I post the corrected patch to get card emulation on 2.3.4_r1.
>
> One thing. Card stops being readable from an external reader after screen
> goes off and back on. However if you disable NFC and re-enable it (from
> settings) card is discoverable again.
>
> Thanks nemik for your work (you can update your patches with these
> corretions to work with gingerbread 2.3.4_r1 at your site if you want).
>
>  Nfc-app-2_3_4_r1.diff
> 31KViewDownload
Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 8/4/11 3:25 PM

If you follow the complete thread you will answer yourself to both questions, no.

El 05/08/2011 00:15, "Xiang" <xian...@gmail.com> escribió:> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-d...@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
Re: NFC Secure Element Tommy 8/5/11 8:32 PM
Hi.
   Now i modified the source code like the nemik's diffs before for my
Nexus S.But when i make the source code i got errors

packages/apps/Nfc/src/com/android/nfc/NfcService.java:47: cannot find
symbol
symbol  : class INfcSecureElement
location: package android.nfc
import android.nfc.INfcSecureElement;

i think it's because i used the @hide methods.How can i find a way to
make it work?
Thanks for any tips.

Regards
tommy.yang
Re: NFC Secure Element JhonatanAA(Colombia) 8/16/11 7:41 PM
hello
You did as reading and writing a block in Mifare 4K Nexus emulates inside S with a external card reader.
You can post the step by step or guide us in this process
thanks

Re: NFC Secure Element Tommy 8/26/11 9:24 AM
hi all:
    Now i modified the download android source code 2.3.4 for card
emulation like Fernando's diffs.I make the modified source code on my
vmware+ubuntu success,make the sdk success,and make the download
samsung kernal code success.But now how can i use these changes on my
Nexus S phone?What can i do, step by step to make my Nexus S to be
card emulation. Thanks for any help.

tommy.yang
Re: NFC Secure Element Rames P 9/19/11 2:20 AM
Hi Fernando Miguélez Palomo

Did you get the ROM working for Nexus S with NFC card emulation enabled? I so can you please share the rom? Your answer might be very useful to achieve a position in my carrer.

Thanks

Re: NFC Secure Element Fernando Miguélez Palomo 9/29/11 2:44 AM
I polished the patches so now you have some options from Settings application:

  • Card Emulation Only Mode. This disables reader function. Card emulation mode is always enabled. Be careful because P2P mode may not work (not tested)
  • Use External Secure Element if Available. This makes the phone to use the SE of the UICC if available instead of embedded one.

  • I posted the patches on xda-developers

    As a bonus I also removed the stupid time-limit when enable discoverable option of Bluetooth.
    Re: NFC Secure Element Fernando Miguélez Palomo 9/29/11 3:53 AM
    For the time being I can not share the ROM but you can compile it yourself with the supplied patches. Take a look at the last ones: https://groups.google.com/d/msg/android-developers/1fw1qfFqpGc/pvhc11jVDEUJ
    Re: NFC Secure Element Tommy 9/29/11 8:09 PM
    Here is my Nexus S ROM of Card Emulation  http://dl.dbank.com/c0wutpddbv
    .I modified the source code base on Fernando's.You can download and
    test it.Good Luck!
    Re: NFC Secure Element fuful 11/25/11 2:41 AM
    Dear all,
    I've downloaded rom from Tommy, but I don't see the option Fernando is speaking of, about card emulation.
    Wherre these options are placed ?
    Thanks in advance.
    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 11/28/11 11:41 PM
    There should be an option in Settings Screen (NFC Settings)

    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: [android-developers] Re: NFC Secure Element fuful 11/29/11 12:56 AM
    I only have a checkbox 'NFC', to activate the NFC reader.
    Activated (or not), the phone doesn't act as a Mifare tag on every Mifare test system I own.
    Is there something else I can check ?
    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 11/29/11 1:24 AM
    Then the patches are not correctly applied.

    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: [android-developers] Re: NFC Secure Element fuful 11/29/11 5:23 AM
    OK, understood.
    Now my next question will be about this patch : how can I apply it ?
    I'm totally new at Android, and I have no idea how to add this patch to my phone.
    Is there some information on the web somewhere I can follow do perform this ?
    Thank for your answer.
    Re: [android-developers] Re: NFC Secure Element mickae1 12/21/11 2:03 AM
    Hi,

    I would like to know if it's possible to wirte data on the card with an android application ? Or is it the problem that you have been talking about a secret key that no one know ?

    Thx for the answer,
    Re: NFC Secure Element softy 1/4/12 12:17 AM
    Hi All, 
    Thanks Fernando Miguélez Palomo for posting the patches.I have applied it to 2.3.4-r1 Android gingerbread and compiled /flashed it on Samsung Nexus S and was able to see the NFC Settings changed(though i cant select them, they are disabled)
    I have blogged the whole steps here .Plz let me know if I miss something.

    @ Fernando Miguélez Palomo
    What next after that.How can i test this.Any source code or tool /card reader description will be enlightening.
    Rgds,
    softy
    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 1/4/12 5:34 AM
    Great work.

    Obviously there is something wrong with the compilation. Have you tried to connect in debug mode the phone to a computer with Android Development Tools and see what the traces look like. They may offer a clue. My suspicion is that NfcService is crashing. I will review my notes tomorrow if I find something different to the steps you followed to build the image.

    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: [android-developers] Re: NFC Secure Element softy 1/4/12 5:56 AM
    Thanks !
    I will also try from my side recompiling it.So you mean I should get the Check boxes enabled for
    > Only Card EmulationMode
    and
    > Use External SE

    My main aim is to write to the NFC card in card emulation mode so that it can be read by any Card Reader.is it possible after your patches are applied using teh android SDKs or do we have to write some native application.
    Rgds,
    Softy
    "..pain is temporary.....quitting lasts forever......"



    2012/1/4 Fernando Miguélez <fernando...@gmail.com>

    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 1/4/12 6:17 AM
    Well, options are enabled in cascade. The problem comes because the first option is not enabled. Besides, if you look at the Wireless Settings screen, there is only the "NFC Settings" option, but not the one that lets you enalbe/disable NFC directly from that screen. That is beacuse the Nfc service in not available. Connection to a computer in debug mode will draw some light.

    Instead of compiling the whole image again I suggest you to compile just the Nfc.apk system application and replace the original one. You must remount /system partition in read/write mode and overwrite the apk inside /system/app. Then you must kill the nfc service by means of DDMS view of the ADT (you must connnect the phone in debug mode and since you have compiled in userdebug mode you will see all the running proccesses). The service will restart automatically.

    When it comes to read/write the card by means of an external reader, any Mifare Classic 4K compatible RFID reader will do. If you try to access directly to the SE from an Android application I am afraid to disappoint you but that is not possible, at least I wasn't successful at it and nobody I know either. The reasons are well described in other posts and on stackoverflow.

    Regards
    Re: [android-developers] Re: NFC Secure Element softy 1/5/12 12:31 AM
    I did re-flashing from the patched Android Source and again the same thing.Here are the logcat logs on clicking the NFC Settings :

    D/dalvikvm(  298): GC_EXPLICIT freed 91K, 45% free 3160K/5703K, external 4731K/5234K, paused 290ms
    I/ActivityManager(  106): Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.WirelessSettings } from pid 493
    D/dalvikvm(  493): GC_EXTERNAL_ALLOC freed 55K, 50% free 2933K/5831K, external 2878K/3220K, paused 20ms
    E/NFC     (  493): could not retrieve NFC service
    I/ActivityManager(  106): Displayed com.android.settings/.WirelessSettings: +351ms
    D/dalvikvm(  493): GC_EXTERNAL_ALLOC freed 43K, 49% free 3022K/5831K, external 3171K/3241K, paused 21ms
    I/ActivityManager(  106): Starting: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.nfc.NfcSettings } from pid 493
    I/ActivityManager(  106): Displayed com.android.settings/.nfc.NfcSettings: +261ms


    Any clue on this.
    Rgds,
    Saurabh
    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 1/5/12 1:20 AM
    Hi Saurabdh,

    I reviewed my notes and I definetly built the image with "lunch full_crespo-eng". Try building in engineer mode so the traces can be more verbose. Apart from that the process to compile the firmware is the same you described in your blog.
    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 1/5/12 3:55 AM
    Saurabh,

    After reflashing my phone and verifying that the NFC toggle option was available also in main Wireless Settings Screen, and after examining your problem I reached the conclusion that your generated image does not include NFC support, only the settings screen. I reviewed the patches and there was a bug. The NFC was not enabled in building proccess because the wrong file was patched (device.mk instead of device_base.mk). Sorry for the incovenience. 

    I have just updated the patches and uploaded to http://forum.xda-developers.com/showthread.php?p=17965091 . Could you please check from the beginning that now the patches are completely correct by rebuilding the image? It is safe to apply again over the patches files, since the changes apply to another file.

    On Thu, Jan 5, 2012 at 9:31 AM, s.rawat <imsaura...@gmail.com> wrote:
    Re: [android-developers] Re: NFC Secure Element softy 1/5/12 4:34 AM
    Sure I will try that  and post the results !

    "..pain is temporary.....quitting lasts forever......"



    2012/1/5 Fernando Miguélez <fernando...@gmail.com>

    Re: [android-developers] Re: NFC Secure Element softy 1/5/12 9:54 PM
    Yes you are correct, now it looks fine and I can see the options getting "ticked" on the NFC Setting UI.But i was getting the segmentation fault as well.Plz find attached the logs( showing the logs at the boot time ).It shows the stack trace as well.

    Rgds,
    Saurabh
    "..pain is temporary.....quitting lasts forever......"



    Re: [android-developers] Re: NFC Secure Element softy 1/13/12 12:24 AM
    HI,
    I am gettign an ATR : A card is present. ATR: 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 FF 40 00 00 00 00 D4 .
     
     
    I dont htink it emulated the card.Does it.For 1k/4k Mifare Classic Card it has to be 00 01(Mifare 1k) or 00 02(Mifare 1k) instead of FF 40 .PLz correct my understanding.I have used the patches to enable to the phone in Card emulation mode.
     
     
    Rgds,
    Saurabh
    "..pain is temporary.....quitting lasts forever......"



    Re: NFC Secure Element anton krasnoff 1/18/12 4:10 AM
    Hi, Tommy! 
    Could you, please, build a new version your Nexus S ROM of Card Emulation with fresh patch from m0rtadelo ?
    Many thanks!
    Re: [android-developers] Re: NFC Secure Element softy 1/19/12 4:30 AM
    Hi All,

    I am getting This ATR now : 3B 8A 80 01 00 31 C1 73 C8 40 00 00 90 00 90 , which I have read in this group that it is for SmartMX.
    I am looking into writing onto it but so far I am getting 63 00 response(which means error)
    I am trying to load., authenticate the keys and then read -write and then read back from the SmartMX (Secure Element).

    Here is my list of commands : 

    FF82006006FFFFFFFFFFFF // load keys
    FF860000050100026000 // authenticate
    FFB0000210 //read sector 2
    FFD600021022222222222222222222222222222222 // write sector 2
    FFB0000210 // read sector 2 again

    I followed this -- > http://www.nfc-reader.com/NFC-smart-card-reader/ACR122-API-Manual/API_ACR122.pdf

    My main aim is to get the notification programatically or any logs that comes out as the result of doing this.I will try sending these by combining them in APDUs from the application code.I think that will be possible.If successfull I will plan the next step.PLz assist me on this.

    Rgds,
    Saurabh


    "..pain is temporary.....quitting lasts forever......"



    Re: [android-developers] Re: NFC Secure Element Michael Roland 1/19/12 4:44 AM
    Hallo Saurabh,

    > I am getting This ATR now : *3B 8A 80 01 00 31 C1 73 C8 40 00 00 90 00
    > 90* , which I have read in this group that it is for SmartMX.

    Correct, that's the PC/SC ATR for the SmartMX.

    > I am looking into writing onto it but so far I am getting 63 00
    > response(which means error)
    > I am trying to load., authenticate the keys and then read -write and
    > then read back from the SmartMX (Secure Element).
    >
    > *_Here is my list of commands : _*
    >
    > FF82006006FFFFFFFFFFFF// load keys
    > FF860000050100026000// authenticate
    > FFB0000210//read sector 2
    > FFD600021022222222222222222222222222222222// write sector 2

    > FFB0000210 // read sector 2 again
    >
    > I followed this -- > http://www.nfc-reader.com/
    > NFC-smart-card-reader/ACR122-API-Manual/API_ACR122.pdf

    I would guess, that the reader automatically performed protocol
    selection up to ISO 14443-4 / APDU layer. In that state it is not
    possible to access the MIFARE part of the chip with reader-side MIFARE
    emulation. You could try the example on page 12ff of this document.

    br,
    Michael

    Re: [android-developers] Re: NFC Secure Element softy 1/19/12 11:10 PM
    Hi  Michael , 
    You mean page 12 , section 5.3 Reading Binary Block.
    I tried that, i found as soon as I send the command the green light on the card reader turns Red for the time being(which I fear is some operation failed signal) , accompanied by the 63 00 response .I am using the TestResMan tool.Even though it shows Command is sent successfully and response is received in XXX secs.
    Can you tell me the name of card reader where we cant see this behavior (reader automatically performed protocol selection up to ISO 14443-4 / APDU layer)

    Rgds,
    Saurabh

    "..pain is temporary.....quitting lasts forever......"




    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: [android-developers] Re: NFC Secure Element Michael Roland 1/20/12 8:46 AM
    Hallo Saurabh,

    > You mean page 12 , section *5.3 Reading Binary Block*.
    I didn't find any "section *5.3 Reading Binary Block*" on that page. In
    fact, I mean have you tried the whole command sequence described for
    "Card Access -- How to access MIFARE Classic Tags?" on that page.

    You have to do the polling using these commands to access the card. The
    standard PC/SC commands will not work.

    I just looked through my code and found that I also explicitly disabled
    ISO 14443-4 activation (before polling) using this command:
      FF00000003D41224

    > Can you tell me the name of card reader where we cant see
    > this behavior (reader automatically performed protocol selection up to
    > ISO 14443-4 / APDU layer)
    The ACR 122U was the only reader with which I successfully accessed the
    MIFARE area of the SmartMX so far.

    br,
    Michael

    > On Thu, Jan 19, 2012 at 6:14 PM, Michael Roland <mi.r...@gmail.com
    >     <mailto:android-d...@googlegroups.com>

    >     To unsubscribe from this group, send email to
    >     android-developers+unsubscribe@googlegroups.com
    >     <mailto:android-developers%2Bunsubscribe@googlegroups.com>

    >     For more options, visit this group at
    >     http://groups.google.com/group/android-developers?hl=en
    >
    >
    > --
    > You received this message because you are subscribed to the Google
    > Groups "Android Developers" group.
    > To post to this group, send email to android-d...@googlegroups.com
    > To unsubscribe from this group, send email to
    > android-developers+unsubscribe@googlegroups.com
    > For more options, visit this group at
    > http://groups.google.com/group/android-developers?hl=en

    Re: [android-developers] Re: NFC Secure Element softy 1/24/12 4:28 AM
    Hi Michael  
    Yes i have followed the aforesaid method but as soon as I execute these commands.:

    Step 1) Polling for the MIFARE 1K/4K Tags, 106 kbps
    << FF 00 00 00 04 D4 4A 01 00
    >> d5 4b 00 90 00 ( I am getting this) 
    -> which shows no NFC tag.

    and 63 00 for rest of the of the commands.

    I am using the same reader(ACR 122U ) as suggested by you.

    Is it possible to share your Nexus S Images, so that I could try them out here and confirm whether the files I have generated by compiling the Android 2.3.4-r1 source code with the card emulation patches , is correct or not.

    What is the significance of this : 

    >I just looked through my code and found that I also explicitly disabled
    >ISO 14443-4 activation (before polling) using this command:
    > FF00000003D41224

    Rgds,
    Saurabh

    "..pain is temporary.....quitting lasts forever......"



    On Fri, Jan 20, 2012 at 10:16 PM, Michael Roland <mi.r...@gmail.com> wrote:
    FF00000003D41224

    Re: [android-developers] Re: NFC Secure Element malls 1/26/12 3:54 PM
    Dear Fernando

    I tried to patch as per your instructions and root the device. I get error saying libpn544.so not found. I don't see this file created after the compilation. Where is it trying to load from.

    regards
    malls
    Re: NFC Secure Element malls 1/26/12 4:22 PM
    Fernando,

    Here is the logcat output that I am getting. Is libpn544.so supposed to be built as part of this build process or am i missing something. I have checked, there were no errors during the compilation anywhere.

    D/NFC JNI ( 4179): NFC Service : loading JNI
    I/NfcService( 4179): Starting NFC service
    D/NFC JNI ( 4179): ******  Init Native Structure ******
    D/NFC JNI ( 4179): ******  Init Native Structure ******
    D/NFC JNI ( 4179): ****** Init Native Structure OK ******
    D/NFC JNI ( 4179): ****** Init Native Structure OK ******
    I/RegisteredComponentCache( 4179): ComponentInfo: ResolveInfo{405641b0 com.andro
    id.apps.tag.TagViewer p=0 o=0 m=0x108000}, techs: android.nfc.tech.Ndef,
    D/NFC JNI ( 4179): > Set LLCP LTO to 150
    D/NFC JNI ( 4179): > Set LLCP LTO to 150
    D/NFC JNI ( 4179): > Set LLCP MIU to 128
    D/NFC JNI ( 4179): > Set LLCP MIU to 128
    D/NFC JNI ( 4179): > Set LLCP WKS to 1
    D/NFC JNI ( 4179): > Set LLCP WKS to 1
    D/NFC JNI ( 4179): > Set LLCP OPT to 0
    D/NFC JNI ( 4179): > Set LLCP OPT to 0
    D/NFC JNI ( 4179): > Set NFC DISCOVERY A to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY A to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY B to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY B to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY F to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY F to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY 15693 to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY 15693 to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY NFCIP to 1
    D/NFC JNI ( 4179): > Set NFC DISCOVERY 15693 to 1
    D/NFC JNI ( 4179): Start Initialization
    D/NFC_LIST( 4179): Allocated node: 0x292868 (0x4496fa70)
    D/NFC JNI ( 4179): phLibNfc_Mgt_ConfigureDriver(0x00295ad8, 0x00000008)
    D/NFC JNI ( 4179): phLibNfc_Mgt_ConfigureDriver(0x00295ad8, 0x00000008)
    W/NFC_i2c ( 4179): sleeping a little longer...
    D/NFC JNI ( 4179): phLibNfc_Mgt_ConfigureDriver() returned 0x0000[NFCSTATUS_SUCC
    ESS]
    D/NFC JNI ( 4179): phLibNfc_Mgt_Initialize()
    D/NFC JNI ( 4179): phLibNfc_Mgt_Initialize()
    E/NFC-HCI ( 4179): Could not open libpn544.so
    D/NFC JNI ( 4179): phLibNfc_Mgt_Initialize returned 0x000d[NFCSTATUS_PENDING]
    D/NFC JNI ( 4179): phLibNfc_Mgt_Initialize returned 0x000d[NFCSTATUS_PENDING]
    D/NFC JNI ( 4179): NFC client started
    D/NFC JNI ( 4179): NFC client started
    D/NFC JNI ( 4179): Callback: nfc_jni_init_callback() - status=0x0000[NFCSTATUS_S
    UCCESS]
    I/DEBUG   ( 3190): *** *** *** *** *** *** *** *** *** *** *** ***^C
    unk...@googlegroups.com 1/26/12 4:25 PM <This message has been deleted.>
    Re: [android-developers] Re: NFC Secure Element malls 1/26/12 4:25 PM
    Softy

    Could you please share android client code snippet to send APDU command to SE after the patch.

    regards
    malls
    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 1/26/12 10:22 PM
    There must be an error with patches since other person had the same issue. Just copy it manually to the /system/lib directory of the phone (you have to remount the system partition as RW).

    2012/1/27 malls <masub...@gmail.com>

    Re: [android-developers] Re: NFC Secure Element softy 1/26/12 11:09 PM
    Hi,

    I faced this issue.Plz paste the file attached in the mail to the /system/lib directory as suggested by Fernando .And yes you have to do remount the system partition as RW.

    Rgds,
    Saurabh


    "..pain is temporary.....quitting lasts forever......"

    2012/1/27 Fernando Miguélez <fernando...@gmail.com>

    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: [android-developers] Re: NFC Secure Element Michael Roland 1/27/12 2:02 PM
    Hallo Saurabh,

    > What is the significance of this :
    >
    >>I just looked through my code and found that I also explicitly disabled
    >>ISO 14443-4 activation (before polling) using this command:
    >> FF00000003D41224

    See page 9 of the reader API manual:

    "Some Type A Tags may support both ISO14443-3 Type A and ISO14443-4 Type
    A operating modes. For example, JCOP30 supports MIFARE 1K emulation
    (ISO14443-3) and ISO14443-4. If the reader sends a RATS command to the
    tag, the ISO14443-4 mode will be activated, or the tag remains in MIFARE
    1K emulation mode (ISO14443-3). It is up to the
    application to decide which operating mode to be activated. By default,
    the reader will perform automatic ISO14443-4 activation if the tag
    supports ISO14443-4.
    * To disable automatic ISO14443-4 activation: FF 00 00 00 03 D4 12 24
    * To Enable automatic ISO14443-4 activation: FF 00 00 00 03 D4 12 34"

    So you need to disable ISO 14443-4 activation *before* you start the
    anti-collision sequence. Once the RATS command is sent, the SmartMX will
    not accept raw MIFARE classic commands anymore.

    br
    Michael

    Re: NFC Secure Element malls 1/30/12 12:29 PM
    Thanks Saurabh and Fernando, that worked just adding the library. Just
    Curious is it supposed to be part of android build, not sure why am I
    missing that file.


    On Jan 26, 11:09 pm, "s.rawat" <imsaurabhra...@gmail.com> wrote:
    > Hi,
    >
    > I faced this issue.Plz paste the file attached in the mail to the *
    > /system/lib* directory as suggested by * Fernando* .And yes you have to do
    > remount the system partition as RW.
    > Rgds,
    > Saurabh
    >
    > "..pain is temporary.....quitting lasts forever......"
    >
    > 2012/1/27 Fernando Miguélez <fernando.migue...@gmail.com>
    >
    >
    >
    >
    >
    >
    >
    > > There must be an error with patches since other person had the same issue.
    > > Just copy it manually to the /system/lib directory of the phone (you have
    > > to remount the system partition as RW).
    >
    > > 2012/1/27 malls <masubha...@gmail.com>
    >
    > >> Dear Fernando
    >
    > >> I tried to patch as per your instructions and root the device. I get
    > >> error saying libpn544.so not found. I don't see this file created after the
    > >> compilation. Where is it trying to load from.
    >
    > >> regards
    > >> malls
    >
    > >  --
    > > You received this message because you are subscribed to the Google
    > > Groups "Android Developers" group.
    > > To post to this group, send email to android-d...@googlegroups.com
    > > To unsubscribe from this group, send email to
    > > android-developers+unsubscribe@googlegroups.com
    > > For more options, visit this group at
    > >http://groups.google.com/group/android-developers?hl=en
    >
    >
    >
    >  libpn544_fw.so
    > 77KViewDownload
    Re: NFC Secure Element malls 1/30/12 5:22 PM
    Fernando,

    Thanks I could create custom image with nfc enabled by using your
    help.

    Just to clarify myself, if we are connected to external reader, I
    should be able to directly read/write APDUs from my app right.
    should I be using NFCService.transceive(..) method to read/write from
    the external reader.

    regards
    malls

    On Jan 4, 6:17 am, Fernando Miguélez <fernando.migue...@gmail.com>
    wrote:
    > Well, options are enabled in cascade. The problem comes because the first
    > option is not enabled. Besides, if you look at the Wireless Settings
    > screen, there is only the "NFC Settings" option, but not the one that lets
    > you enalbe/disable NFC directly from that screen. That is beacuse the Nfc
    > service in not available. Connection to a computer in debug mode will draw
    > some light.
    >
    > Instead of compiling the whole image again I suggest you to compile just
    > the Nfc.apk system application and replace the original one. You must
    > remount /system partition in read/write mode and overwrite the apk inside
    > /system/app. Then you must kill the nfc service by means of DDMS view of
    > the ADT (you must connnect the phone in debug mode and since you have
    > compiled in userdebug mode you will see all the running proccesses). The
    > service will restart automatically.
    >
    > When it comes to read/write the card by means of an external reader, any
    > Mifare Classic 4K compatible RFID reader will do. If you try to access
    > directly to the SE from an Android application I am afraid to disappoint
    > you but that is not possible, at least I wasn't successful at it and nobody
    > I know either. The reasons are well described in other posts and on
    > stackoverflow.
    >
    > Regards
    >
    >
    >
    >
    >
    >
    >
    > On Wed, Jan 4, 2012 at 2:56 PM, s.rawat <imsaurabhra...@gmail.com> wrote:
    > > Thanks !
    > > I will also try from my side recompiling it.So you mean I should get the
    > > Check boxes enabled for
    > > > *Only Card EmulationMode*
    > > and
    > > > *Use External SE*
    >
    > > My main aim is to write to the NFC card in card emulation mode so that it
    > > can be read by any Card Reader.is it possible after your patches are
    > > applied using teh android SDKs or do we have to write some native
    > > application.
    > > Rgds,
    > > Softy
    > > "..pain is temporary.....quitting lasts forever......"
    >
    > > 2012/1/4 Fernando Miguélez <fernando.migue...@gmail.com>
    >
    > >> Great work.
    >
    > >> Obviously there is something wrong with the compilation. Have you tried
    > >> to connect in debug mode the phone to a computer with Android Development
    > >> Tools and see what the traces look like. They may offer a clue. My
    > >> suspicion is that NfcService is crashing. I will review my notes tomorrow
    > >> if I find something different to the steps you followed to build the image.
    >
    > >> On Wed, Jan 4, 2012 at 9:17 AM, softy <imsaurabhra...@gmail.com> wrote:
    >
    > >>> Hi All,
    > >>> Thanks Fernando Miguélez Palomo for posting the patches.I have applied
    > >>> it to 2.3.4-r1 Android gingerbread and compiled /flashed it on Samsung
    > >>> Nexus S and was able to see the NFC Settings changed(though i cant select
    > >>> them, they are disabled)
    > >>> I have blogged the whole steps here<http://techshek4u.blogspot.com/2012/01/applying-card-emulation-patch-...>.Plz let me know if I miss something.
    Re: [android-developers] Re: NFC Secure Element softy 1/30/12 10:14 PM
    Could you please share android client code snippet to send APDU command to SE after the patch.
    > Well actually I haven't got here yet , but still trying , if you happen to find this ,do plz share it.
    I checked in other devices this shared library is present there, i think somehow it got deleted by the build process.Ideally it should bundle it up from the system folder.(but there is no system folder as well :( )
    Rgds

    Saurabh

    "..pain is temporary.....quitting lasts forever......"



    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 1/30/12 11:52 PM
    No, you cannot read/write APDUs from your application while working with an external reader. When card emulation is enabled APDUs are routed directly to SE from NFC Controller. APDU communication with SE has other objective, main application processor can not emulate a PICC, that is the task of SE. When communicating main processor with SE you can theoretically load/remove cardlets, interact with them and so on. For the time being Mifare embedded inside SmartMX chip can not be accessed from an application. At least AFAIK. 
    Re: NFC Secure Element Cadu Silvestre 1/31/12 2:43 AM
    And besides that, Google took out microSD from the major NFC phones,
    so, basically, we won't be able to do nothing when it comes card
    emulation - as for an obvius reason, the SE keys are not available.

    As far as I can gather from the giants in this matter (like our friend
    Michael Roland), SWP is the only way out.

    On 31 jan, 05:52, Fernando Miguélez <fernando.migue...@gmail.com>
    wrote:
    > No, you cannot read/write APDUs from your application while working with an
    > external reader. When card emulation is enabled APDUs are routed directly
    > to SE from NFC Controller. APDU communication with SE has other objective,
    > main application processor can not emulate a PICC, that is the task of SE.
    > When communicating main processor with SE you can theoretically load/remove
    > cardlets, interact with them and so on. For the time being Mifare embedded
    > inside SmartMX chip can not be accessed from an application. At least
    > AFAIK.
    >
    >
    >
    >
    >
    >
    >
    Re: [android-developers] Re: NFC Secure Element malls 1/31/12 2:20 PM
    Fernando,

    In that case, what's api to send apdu to external SE and how can we have external SE added to the phone.

    regards
    malls
    Re: [android-developers] Re: NFC Secure Element malls 1/31/12 4:15 PM
    Fernando,

    I was wondering if I can emulate the card in my application and send it to the terminal.

    regards
    malls
    Re: NFC Secure Element p z 1/31/12 11:51 PM
    I think maybe you can.
    and plesae share your rom when you finished.thx.
    Re: [android-developers] Re: NFC Secure Element malls 2/1/12 10:46 AM
    I don't see any interface of passing the keys to open secure element in the android code. I am not sure how many people claims that you need google Keys to open SecureElement. May be I am missing something.


    Re: [android-developers] Re: NFC Secure Element Fernando Miguélez Palomo 2/1/12 10:19 PM
    Keys are used in raw communication through APDUs

    On Wed, Feb 1, 2012 at 7:46 PM, malls <masub...@gmail.com> wrote:
    I don't see any interface of passing the keys to open secure element in the android code. I am not sure how many people claims that you need google Keys to open SecureElement. May be I am missing something.



    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: NFC Secure Element mickae1 2/2/12 3:34 PM
    theoritacally is it possible to change the chip with one that we know
    the key ? Will it be difficult to access to the chip ?

    On Feb 2, 7:19 am, Fernando Miguélez <fernando.migue...@gmail.com>
    wrote:
    > Keys are used in raw communication through APDUs
    >
    >
    >
    >
    >
    >
    >
    Re: [android-developers] Re: NFC Secure Element softy 2/3/12 2:12 AM
    Hi All, 
    Recently I have tried with another Card reader , I got this message. 

    MIFARE 4K card on reader 
    ATR : 3B 8F 80 01 80 4F 0C A0 00 00 03 06 03 00 02 00 00 00 00 69  

    00 02 --> Shows the Mifare 4K 

    Earlier with another Card I was getting --> 3B 8A 80 01 00 31 C1 73 C8 40 00 00 90 00 90 and I read in this group that it is for emulated Card Smart MX.
    I wanted to know 
    (1) Can the  two Card readers produce different ATR for the same card?If yes , Why so?
    (2) Can I get the notification or any type of logs when the read /write transaction is happening.or do I have to put the LOG messages , preferably in the NFC framework files.
    (3) Is it possible to READ(not Write ) the SE element(i.e Mifare 4k ) memory Area using the APDU(I think this is same as what others have mentioned in this group)


    Rgds,
    Saurabh




    "..pain is temporary.....quitting lasts forever......"



    Re: [android-developers] Re: NFC Secure Element softy 2/6/12 5:38 AM
    Any comments...plz respond if you are reading this mail !
    rgds,
    Saurabh
    "..pain is temporary.....quitting lasts forever......"



    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: [android-developers] Re: NFC Secure Element softy 2/6/12 5:51 AM
    Hi Nemik, 
    You wrote : 
    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
    the NFC standard will have to wait for a future kernel release. 


    waht are these JAVA APIs ?Can we use them for reading NFC Secure Element - Mifare 4k?
    Rgds,
    Saurabh



    "..pain is temporary.....quitting lasts forever......"



    Re: NFC Secure Element malls 2/8/12 4:59 PM
    I am not sure if anybody explored NfcExecutionEnvironment class. There
    are APIs to communicate to secure element. I don't see any key
    requirement.

    I could listen to AID_SELECTED event from NfcService. I am trying to
    send data to SE. I get error that "External RF Field detected", what
    does this mean.

    Should I be waiting until the external reader sets mode or i have to
    initiate the NFC mode.

    regards
    malls
    On Feb 6, 5:51 am, "s.rawat" <imsaurabhra...@gmail.com> wrote:
    > Hi Nemik,
    > You wrote :
    > *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
    > the NFC standard will have to wait for a future kernel release. *
    >
    > waht are these JAVA APIs ?Can we use them for reading NFC Secure Element -
    > Mifare 4k?
    > Rgds,
    > Saurabh
    >
    > "..pain is temporary.....quitting lasts forever......"
    >
    >
    >
    > On Mon, Feb 6, 2012 at 7:08 PM, s.rawat <imsaurabhra...@gmail.com> wrote:
    > > Any comments...plz respond if you are reading this mail !
    > > rgds,
    > > Saurabh
    >
    > > "..pain is temporary.....quitting lasts forever......"
    >
    > > On Wed, Feb 1, 2012 at 1:21 PM, p z <ymdo...@gmail.com> wrote:
    >
    > >> I think maybe you can.
    > >> and plesae share your rom when you finished.thx.
    >
    > >> On 2月1日, 上午8时15分, malls <masubha...@gmail.com> wrote:
    > >> > Fernando,
    >
    > >> > I was wondering if I can emulate the card in my application and send it
    > >> to
    > >> > the terminal.
    >
    > >> > regards
    > >> > malls
    >
    > >> --
    > >> You received this message because you are subscribed to the Google
    > >> Groups "Android Developers" group.
    > >> To post to this group, send email to android-d...@googlegroups.com
    > >> To unsubscribe from this group, send email to
    > >> android-developers+unsubscribe@googlegroups.com
    > >> For more options, visit this group at
    > >>http://groups.google.com/group/android-developers?hl=en- Hide quoted text -
    >
    > - Show quoted text -
    Re: NFC Secure Element malls 2/10/12 11:47 AM
    When the card emulation is detected, the call is routed to nfc_jni_transaction_callback() of SecureElement. From here the event is posted to NfcService for example AID_SELECTED events are all posted to NfcService. I was wondering if there is way to communicate to SecureElement through this handle. If I try to open SecureElement parallel y, the call throws error that "External RF Field is detected", when this channel is open, I believe there must be a way to wait until this mode is finished and communicate back to SecureElement or use the same channel to communicate.

    In fact, If I view the ice-scream sandwich code, there is new event subscription  APDU_RECIEVED in the secure element callback.  It looks like the PICC interface is open now. Hopefully we should be able to communicate.


    Re: [android-developers] Re: NFC Secure Element Michael Roland 2/11/12 3:41 AM
    Hallo malls,

    > I could listen to AID_SELECTED event from NfcService. I am trying to
    > send data to SE. I get error that "External RF Field detected", what
    > does this mean.

    It means that you are trying to access the secure element from two sides
    simultaneously (from an external reader and from the application
    processor). You can only communicate through one interface at a time.

    br
    Michael

    Re: [android-developers] Re: NFC Secure Element softy 2/12/12 7:48 PM
    is  nfc_jni_transaction_callback() inside the (HAL)Libnfc-nxp or framewrok code.?Where is it?Which Android Version?ICS?? PLz post 

    Rgds,
    Saurabh
    "..pain is temporary.....quitting lasts forever......"




    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: NFC Secure Element choumarin 3/4/12 10:40 AM
    Hi all,

    Before digging deeply in all this. I wonder if it will be worth it. My aim is to emulate the key I have to enter my building.
    It is a Mifare 1k, 16secrots, of which I have the keys.

    Would this be possible ?

    Le vendredi 10 février 2012 20:47:18 UTC+1, malls a écrit :
    When the card emulation is detected, the call is routed to nfc_jni_transaction_callback() of SecureElement. From here the event is posted to NfcService for example AID_SELECTED events are all posted to NfcService. I was wondering if there is way to communicate to SecureElement through this handle. If I try to open SecureElement parallel y, the call throws error that "External RF Field is detected", when this channel is open, I believe there must be a way to wait until this mode is finished and communicate back to SecureElement or use the same channel to communicate.

    In fact, If I view the ice-scream sandwich code, there is new event subscription  APDU_RECIEVED in the secure element callback.  It looks like the PICC interface is open now. Hopefully we should be able to communicate.



    Le vendredi 10 février 2012 20:47:18 UTC+1, malls a écrit :
    When the card emulation is detected, the call is routed to nfc_jni_transaction_callback() of SecureElement. From here the event is posted to NfcService for example AID_SELECTED events are all posted to NfcService. I was wondering if there is way to communicate to SecureElement through this handle. If I try to open SecureElement parallel y, the call throws error that "External RF Field is detected", when this channel is open, I believe there must be a way to wait until this mode is finished and communicate back to SecureElement or use the same channel to communicate.

    In fact, If I view the ice-scream sandwich code, there is new event subscription  APDU_RECIEVED in the secure element callback.  It looks like the PICC interface is open now. Hopefully we should be able to communicate.



    Le vendredi 10 février 2012 20:47:18 UTC+1, malls a écrit :
    When the card emulation is detected, the call is routed to nfc_jni_transaction_callback() of SecureElement. From here the event is posted to NfcService for example AID_SELECTED events are all posted to NfcService. I was wondering if there is way to communicate to SecureElement through this handle. If I try to open SecureElement parallel y, the call throws error that "External RF Field is detected", when this channel is open, I believe there must be a way to wait until this mode is finished and communicate back to SecureElement or use the same channel to communicate.

    In fact, If I view the ice-scream sandwich code, there is new event subscription  APDU_RECIEVED in the secure element callback.  It looks like the PICC interface is open now. Hopefully we should be able to communicate.



    Le vendredi 10 février 2012 20:47:18 UTC+1, malls a écrit :
    Re: NFC Secure Element Janhouse 3/6/12 4:05 AM
    Anyone tried it on ICS yet?
    And are there new patches or something?
    Re: NFC Secure Element xanium4332 4/6/12 6:06 AM


    Hi everyone,

    Firstly I'm extremely sorry for hijacking this thread, but this appears to be where all the activity regarding NFC on Android is occuring, and so should reach the relevant audience.

    I've recently read through a lot of information regarding the implementation of NFC, Google Wallet, card emulation etc.. on the Galaxy S. I've tried to document all that I have learned below. It would be extremely helpful if people could read this, pull it apart, point out bits that are wrong etc.. Hopefully this can help other people who are trying to learn about the implementation, saving them some time. I've not discussed absolute specifics about protocols and whatever, but if I've mixed up terms (such as incorrectly mentioning the use of ADPUs), please correct them as well :)

    This documentation should hopefully prevent some repeated questions also...

    --------

    Within the Nexus S is contained an NXP PN65N nfc ic, which is similar to a PN544, but with an internally connected SmartMX 'secure element'.

    The secure element (SE) is 'logically connected' to the PN544 via an NFC-WI interface. All of this is contained within the PN65N.

    The SE runs a JavaCard operating system. One Java application included on the SE is an implementation of the GlobalPlatform specs. Through communication to and from this app (using the correct keys), other javacard apps can be installed. (such as a Google wallet app).

    The SE is also configured to emulate a Mifare classic 4K card. Currently, the default keys allow read/write access to this emulated 'card'.

    The PN544 has 3 modes of operation. Reader/Writer mode, peer-to-peer mode, and card emulation mode. In card emulation mode, there two different 'sub-modes' of operation:

    1. The PN544 acts as a dumb 'frontend' to the secure element. This allows contactless communication directly with the secure element using external reader/writers. At this point, the entire system is functionaly identical to a wireless JavaCard, which is capable of both emulating a normal Mifare 4K card, (ISO14443-3) and allowing access to javacard apps (using ADPUs) (ISO 14443-4).

    2. The PN544 acts as a reader/writer, with the secure element appearing as an attached wireless card. This presents a similar situation as 1), but in reverse (the host can now communicate with the secure element, pretending it is a contactless javacard).

    The PN544 supports using 'emulation mode' with either a secure element (using the NFC-WI protocol), or a UICC (a.k.a SIM card), using an SWP bus. However, when using a UICC, sub-mode 2) is unavailable. Therefore, a host can only communicate (via the PN544) to the secure element. The word 'communication', in this context, means the ability to pass ADPUs back/forth from the host to the 'emulated' card (either SE or UICC).

    Typically this is not a problem, as the host can normally communicate (pass ADPUs) directly to the UICC via other channels. In Android, however, the RIL does not currently provide direct access to the SIM card, so ADPU exchange with the SIM card is not currently possible.

    Android currently contains official APIs to make use of the reader/writer and peer-to-peer modes of the PN544. The official NXP host stack also contains code to use the 'card emulation' mode also. The code used to be commented out, but later versions of Android have the code present. No public Java Android APIs currently exist to make use of this however.

    Google have preprogrammed the GlobalPlatform access keys, and so are in control of exactly what javacard apps are loaded onto the secure element. They are a 'TSM'.

    Google Wallet makes use of undocumented Java Android APIs to enable card emulation mode on the PN544. This is only possible because of the recently uncommented code within the native official NXP host stack code. Google Wallet also communicates with an installed javacard app, to setup 'whatever-it-is-the-credit-card-companies-need-on-the-card'. This is the same javacard app that is interacted with by external pay-terminal reader/writers.

    For a normal, un-rooted phone, communication with the secure element (using ADPUs) (a.k.a enabling card emulation mode 2) is only possible using an APK that has been signed with a special key, which Google hold. The Android OS verifies the keys before allowing use of some (currently undocumented) Java API.*

    Having an rooted phone allows bypassing of this restriction, such that any APK can successfully enable emulation mode, perform ADPU communication with the secure element, and thus interract with javacard apps (including the GlobalPlatform app). However, as we do not know the GlobalPlatform keys, we are unable to add/remove javacard apps from the secure element.

    10 failed authentications with the GlobalPlatform app will cause a permenant lockout, preventing any future add/remove operations for javacard apps. Existing javacard apps will continue to work, however.

    -------

    Now for things I'm not sure about:

    Does Google Wallet make use of native APIs or Java APIs to communicate to the secure element. I.e., is it talking to the NXP NFC stack directly, or through some Android-like API?

    People who are receiving the 'secure element not responding' error are presumably failing to authenticate with the Google Wallet javacard app which has been installed. However, people seem to be mentioning that this error means the SE is 'bricked', which I would interpret as the lockout from the GlobalPlatform app due to 10 failed auths. Anybody know exactly what is going on here?

    I think I read somewhere that the google wallet javacard app is only installed onto the SE after successful setup of the Google Wallet app. I.e. it is not factory installed. If so, how does secure communication occur with the GlobalPlatform app. Does Google Wallet perform this (I guess not, as we could find the keys from the APK). How do the GlobalPlatform keys get securely transmitted to the SE? With SIM cards I think binary SMSs are used to OTA chat with the radio interface, but obviously that can't happen here.

    Regards,
    xanium
    Re: [android-developers] Re: NFC Secure Element Nikolay Elenkov 4/6/12 7:16 AM
    On Fri, Apr 6, 2012 at 10:06 PM, xanium4332 <xaniu...@gmail.com> wrote:
    >

    > I've recently read through a lot of information regarding the implementation
    > of NFC, Google Wallet, card emulation etc.. on the Galaxy S

    Nice write up, you should put it in a blog post somewhere. Sounds about
    right, but can't really commend on the finer points. Maybe someone else will.
    You might also get better info/response on XDA. This list is not exactly
    dedicated to analyzing third party apps and/or hardware.

    >
    > Now for things I'm not sure about:
    >
    > Does Google Wallet make use of native APIs or Java APIs to communicate to
    > the secure element. I.e., is it talking to the NXP NFC stack directly, or
    > through some Android-like API?

    AFAIK, it uses only Java code. You can send APDU via the Java APIs,
    so that's basically all you need.

    >
    > People who are receiving the 'secure element not responding' error are
    > presumably failing to authenticate with the Google Wallet javacard app which
    > has been installed. However, people seem to be mentioning that this error
    > means the SE is 'bricked', which I would interpret as the lockout from the
    > GlobalPlatform app due to 10 failed auths. Anybody know exactly what is
    > going on here?

    You can't say for sure until you see the response APDU. IIRC, if you lock
    the card you will get 'Security condition not satisfied', SW= 0x6982.
    If seen this a few times :)

    >
    > I think I read somewhere that the google wallet javacard app is only
    > installed onto the SE after successful setup of the Google Wallet app. I.e.
    > it is not factory installed.

    This appears to be correct.

    > If so, how does secure communication occur with
    > the GlobalPlatform app. Does Google Wallet perform this (I guess not, as we
    > could find the keys from the APK). How do the GlobalPlatform keys get
    > securely transmitted to the SE? With SIM cards I think binary SMSs are used
    > to OTA chat with the radio interface, but obviously that can't happen here.
    >

    You don't really need to transmit the actual keys to the card, you only need to
    compute the correct session key based on the card manager key. Maybe they
    are in the APK (unlikely), or processing is offloaded to a server. You might
    want to look yourself :)

    Re: [android-developers] Re: NFC Secure Element Jonas Lenz 4/6/12 7:43 AM

    >
    > I think I read somewhere that the google wallet javacard app is only
    > installed onto the SE after successful setup of the Google Wallet app. I.e.
    > it is not factory installed.

    This appears to be correct.


    can confirm this aswell.
    after successfully installing google wallet i get response from jcshell /identify command.
    before it only sent error 

    Re: [android-developers] Re: NFC Secure Element Janhouse 4/6/12 9:00 AM
    Someone wrote that you can't emulate cards on Nexus S (or maybe only mifare ultralight cards), even if you have the opennfc driver and the rest of it set up.
    Any comments on this?


    --
    You received this message because you are subscribed to the Google
    Groups "Android Developers" group.
    To post to this group, send email to android-d...@googlegroups.com
    To unsubscribe from this group, send email to
    android-developers+unsubscribe@googlegroups.com
    For more options, visit this group at
    http://groups.google.com/group/android-developers?hl=en

    Re: NFC Secure Element Alexander Sytnik 4/11/12 12:05 AM

    Great work! It helped me very much. My current goal - to download into the Secure Element a cardlet, which can securely manage MIFARE part and communicate with our own TSM through an additional application in a phone. But this possibility, that can be used even in old Nokia 3220 with NFC cover, seems to be blocked in new Android platforms.

    Additional information (how I understand it):

    -          Google wallet is Mastercard PayPass payment application;

    -          Document that defines the requirements for UICCs intended to host a payment system’s mobile payment application within mobile consumer device are called “EMVProfiles of Global Platform UICC Configuration”. It can be free downloaded. It can be useful for understanding architecture of infrastructure that used by Google to download and manage Google Wallet. Also there is second interesting document “EMV Contactless Mobile Payment - Application Activation User Interface”.

    -          The document with may describe a target state of secure element it the phone (how I think) is Global Platform UICC Configuration v1.0.1. But it cost about 1.5K and it is silly to download the document that can’t help you download your applet in NFC phone.

    Resume: Joe doesn’t share food! Google wants to use single-handedly new business possibilities which are given to us by new technologies. Nick Pelly: “So we did not put card emulation APIs in Gingerbread because we want to make sure that we have a compelling user story before we do that. And we really think that peer-to-peer is the way to go for future NFC uses.”, “There are a bunch of different reasons. Again, the secure element is a very limited resource. It can't hold a large amount of data in there. And if we open it up to any third-party application, there's going to be a huge resource contention over the secure element.”.

    P.S.: Please correct me if I'm wrong.

    P.P.S.: Sorry for my English.

    unk...@googlegroups.com 4/11/12 12:43 AM <This message has been deleted.>
    Re: NFC Secure Element Cristina Jerez 6/30/12 9:26 AM
    Hi! 

    So is possible that the phone ( I have Galaxy S III) acts like a Mifare card and with him I can comunicat with the infraestructure of NFC of one office to use the phone to open dors ?

    I'm trying to develop this applicacion for the University but I'm not sure that the comunicacion with this element could be correctly.

    Can you help me?


    El martes, 7 de diciembre de 2010 12:42:29 UTC+1, Dominik escribió:
    Hi everyone,

    Do I see it right, that the Android 2.3 NFC API does not provide functionality to access a secure element? A secure element is a smartcard connected to the NFC controller, 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

    Re: NFC Secure Element ThyMythos 8/2/12 11:56 AM
    Am Mittwoch, 11. April 2012 09:05:34 UTC+2 schrieb Alexander Sytnik:
    Latest official update on that:
    http://www.youtube.com/watch?v=HkzPc8ZvCco#t=3490s
    Re: [android-developers] Re: NFC Secure Element Factionwars 2/3/13 2:35 PM
    Might take a look at this url: http://intrepidusgroup.com/insight/2011/09/a-brave-new-wallet-first-look-at-decompiling-google-wallet/ He notices a debug menu in a old version of google wallet.
    unk...@googlegroups.com 4/8/13 2:41 AM <This message has been deleted.>
    More topics »