• Announcements

    • PsychoI3oy

      Unsupported devices & future versions   09/03/16

      Unsupported devices posts outside the Device requests forum will be deleted without comment. Posts asking about/for future versions of CM will be locked and/or deleted.   We don't have a crystal ball; we don't know if someone will make CM $version for your deivce or if CM $version+1 will be made for your supported device.
tbellenger

NFC Secure Element Hack

5 posts in this topic

Is there anyone out there that has tried following the vague instructions here (http://www.nearfieldcommunicationsworld.com/2011/02/13/35913/uncovered-the-hidden-nfc-potential-of-the-google-nexus-s-and-the-nokia-c7/) to hack the NFC secure element on the Nexus S? I tried looking through the code (both the libnfcxxx.so and the NFCAdapter parts) but I'd be interested to know if someone on here has gotten further. Even as far as communicating with the secure element (through an app not the NFC interface).

Cheers,

Tom

Share this post


Link to post
Share on other sites

I've recompiled CyanogenMod to allow for communication with the secure element, but it fails with an error in the C++ code, somewhere after it calls INativeNfcAdapter.doOpenSecureElementConnection() if I remember correctly.

I've traced it back to a C++ function that tries to get the tech list of the tags it's found on the secure element (it finds 2, for some reason) where it fails to convert everything it's found back to a java array (I think). I tried fixing it by just ignoring the tech it finds - recompiled it, flashed it, still gives error. Which leads me to believe there's something wrong with the JNI (Java Native Environment) in that particular instance that fails to create a java array. Or something.

Due to my inexperience with C++ I've given up on it for now.

Edited by JMC114

Share this post


Link to post
Share on other sites

Hi,

I managed to enable secure element and switch device (A) to card emulation - it is now detected by common Contacless reader. I can send commands - eg. ask to select AID using eg. another phone in reader mode (B) and send any command - the phone is discovered as a Tag. I can see these commands received in the log of phone A. The problem is it is somehow "wired" to secure element - I can not answer (even do not see the answers anywhere in the logs) of phone A, it is just received by phone B. This makes it impossible to simulate card I need - it is really wired in HW somehow.

Does anybody know how to enable real emulation - so I can answer a command send by reader? I thought I will be able to influence secure element communication, but no luck ... ;-(

Thanks a lot

Share this post


Link to post
Share on other sites

Hi,

I interested in how to enable secure element and switch device (nexus s) to card emulation, can you share this how-to (tutorial). Right now I'm researching about near field communication for college. Thank you :)

Hi,

I managed to enable secure element and switch device (A) to card emulation - it is now detected by common Contacless reader. I can send commands - eg. ask to select AID using eg. another phone in reader mode (B) and send any command - the phone is discovered as a Tag. I can see these commands received in the log of phone A. The problem is it is somehow "wired" to secure element - I can not answer (even do not see the answers anywhere in the logs) of phone A, it is just received by phone B. This makes it impossible to simulate card I need - it is really wired in HW somehow.

Does anybody know how to enable real emulation - so I can answer a command send by reader? I thought I will be able to influence secure element communication, but no luck ... ;-(

Thanks a lot

Share this post


Link to post
Share on other sites

Hi,

I interested in how to enable secure element and switch device (nexus s) to card emulation, can you share this how-to (tutorial). Right now I'm researching about near field communication for college. Thank you smile.gif

I managed to enable card emulation on Nexus S on stock (2.3.4_r1) sources. I added a pair of useful options to the settings application too. The patches are downloadable from xda-developers.

Some comments about my card emulation experience on Nexus S are posted here:

Maybe someone could adapt those patches to stable CM7 so card emulation functionality can grow inside CM community.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now