doc-rj / smartcard-reader

Android NFC contactless smart card reader
GNU General Public License v3.0
240 stars 96 forks source link

Crash in emv read mode #6

Closed vectorialgradha closed 8 years ago

vectorialgradha commented 8 years ago

Touching another android device using HCE seems to read some data on the screen but crashes the app with:

FATAL EXCEPTION: Thread-2237
Process: org.docrj.smartcard.reader, PID: 30330
java.lang.ExceptionInInitializerError
    at org.docrj.smartcard.emv.GpoApdu.getGpoApdu(GpoApdu.java:40)
    at org.docrj.smartcard.reader.PaymentReaderXcvr.initiateAppProcessing(PaymentReaderXcvr.java:169)
    at org.docrj.smartcard.reader.PaymentReaderXcvr.run(PaymentReaderXcvr.java:87)
    at java.lang.Thread.run(Thread.java:818)
 Caused by: java.lang.NullPointerException: in == null
    at java.util.Properties.load(Properties.java:246)
    at org.docrj.smartcard.emv.EMVTerminal.<clinit>(EMVTerminal.java:67)
    at org.docrj.smartcard.emv.GpoApdu.getGpoApdu(GpoApdu.java:40) 
    at org.docrj.smartcard.reader.PaymentReaderXcvr.initiateAppProcessing(PaymentReaderXcvr.java:169) 
    at org.docrj.smartcard.reader.PaymentReaderXcvr.run(PaymentReaderXcvr.java:87) 
    at java.lang.Thread.run(Thread.java:818) 
vectorialgradha commented 8 years ago

Looks like the error happens only with another android device, using physical plastic cards doesn't crash the emv read mode.

doc-rj commented 8 years ago

Hi, I haven't been able to reproduce this. Can you provide any details about the two devices and the HCE app running on the second device? Thanks!

pickeyboy commented 8 years ago

Hey Doc-rj,

Even I get this error, I compiled and installed the reader app in my Android device. Then select EMV Read and tried to use my NFC enabled bank card and I get exactly the same error.

Where can I find "terminal.properties" resource? Do I need to prepare this file and copy it somewhere in the mobile device?

doc-rj commented 8 years ago

pickeyboy, vectorialgradha, please excuse my slowness, I haven't been working on this project recently. Well, I finally got around to fixing this issue in the latest commit: https://github.com/doc-rj/smartcard-reader/commit/53350b24e20a9429e5f5c6e924a1d683bece0025

Let me know if it resolves the issue for you... Some work may be needed yet in Get Processing Options command generation, but at least the crash should be fixed.