Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCE MasterCard Emulation #5

Open
Adrien-Delahaye opened this issue Jun 23, 2016 · 3 comments
Open

HCE MasterCard Emulation #5

Adrien-Delahaye opened this issue Jun 23, 2016 · 3 comments

Comments

@Adrien-Delahaye
Copy link

I am trying to make an application using your cordova HCE plugin in order to emulate a MasterCard on an android device to be used on a payment terminal. I have tested it with the right AID and it does not seem to work. Here is the content of my aid_list.xml file

<?xml version='1.0' encoding='utf-8'?> <host-apdu-service android:description="@string/service_name" android:requireDeviceUnlock="false" xmlns:android="http://schemas.android.com/apk/res/android"> <aid-group android:apduServiceBanner="@drawable/settings_banner" android:category="payment" android:description="@string/card_title"> <aid-filter android:name="A0000000041010" /> </aid-group> </host-apdu-service>

The android device recognises the app as a NFC payment application but when I tap the phone against the payment terminal, nothing happens. It seems no APDU is either received or sent.

FYI I tested another application which works on the payment terminal device (https://play.google.com/store/apps/details?id=com.karlisbalcers.simulator&hl=en).

Is there something I am missing ?

@don
Copy link
Owner

don commented Jun 23, 2016

You're not receiving any commands in the callback you registered in hce.registerCommandCallback?

Read through the output of adb logcat and see if there are any errors or stack traces.
Run chrome://inspect and see if there are any javascript errors while you're scanning.

If you're phone has Android 6, it's possible there's a permissions issue. Try targeting Android-22 in config.xml.

<preference name="android-targetSdkVersion" value="22"/> 

@Adrien-Delahaye
Copy link
Author

I am not receiving any commands in the callback (hce.registerCommandCallback).

There are no Javascript errors but in the adb logcat I have the following lines with errors which I don't understand :
`
06-27 14:23:58.836 4285 5928 D HostEmulationManager: notifyHostEmulationData

06-27 14:23:58.946 4285 5928 D SecNfcJni: RoutingManager::CeErrorEventHandler: enter

06-27 14:23:58.946 4285 5928 D SecNfcJni: RoutingManager::CeErrorEventHandler: event = CE_ERROR_RF_PART4_DISCONNECTION_EVT

06-27 14:23:58.946 4285 5928 D SecNfcJni: RoutingManager::CeErrorEventHandler: try notify nfc service

06-27 14:23:58.946 4285 5928 D NfcService: onCardEmulationDiscoveredError : error_type = 2, status = 0

06-27 14:23:58.976 4285 5928 D NfcService: insertLog::json.toString()={"CE_FWE":"010200","DE_PRO":"DH","DE_TEC":"UICC","DE_ADV":"AUTO","DE_LAC":"847","DE_CID":"2c39204","DE_SE1":"com.example.hello","DE_VEN":"S.LSI","DE_FWV":"4.1.2"}

06-27 14:23:58.976 4285 5928 D SecNfcJni: RoutingManager::CeErrorEventHandler: exit
`
My phone has indeed Android 6 but whenever I try to target Android-22 in config.xml, the app can't be run. (Message states that I don't have permission to downgrade SDK)

I guess this is the permissions issue then, what do you think ?

Thank you

@don
Copy link
Owner

don commented Jul 30, 2016

@Adrien-Delahaye the message about downgrading the SDK means you need to delete the android-23 version from your phone before the android-22 version can be installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants