don / cordova-plugin-hce

Cordova plugin for Host Card Emulation (HCE)
Other
28 stars 15 forks source link

HCE MasterCard Emulation #5

Open Adrien-Delahaye opened 8 years ago

Adrien-Delahaye commented 8 years ago

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'?>

` 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 commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

@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.