Page 1 of 1

Problems with debugging

Posted: Tue May 15, 2018 11:12 am
by xochyreg
Hi!

I'm a newbie to Java Card technology, please don't be cruel to judge.
First i tried to debug the bundled "WalletDemoApplet".
i have entered some commands:


Card Manager AID : A000000003000000
Card Manager state : OP_READY

Application: SELECTABLE (--------) 112233445566
Load File : LOADED (--------) 1122334455
Module : 112233445566


>> /select 112233445566
>> 00 A4 04 00 06 11 22 33 44 55 66 00
<< 90 00

>> /send "80 01 00 00 00 00"
>> 80 01 00 00 00 00
<< 90 00

Apdu may be illegel.Decoding conventions for command APDU should obey the rule in 7816-3 section 12.1.3
>> /send "80 01 00 00 00 00"
>> 80 01 00 00 00 00
<< 90 00


Q1: Why does the app return just this? Where's the card no.?
Q2: I set a breakpoint @ line 131 ( byte[] buf = apdu.getBuffer(); )
Then did (/send "80 01 00 00 00 00") again. The IDE just executed the APDU,
it didn't stop on this BP. Why?

BTW: the (/send "80 20 00 00 00 00") is bad too... i'm in despare! :(

Re: Problems with debugging

Posted: Wed May 16, 2018 11:18 pm
by reumol
Where is the WalletDemo? Could you share it with us?

Re: Problems with debugging

Posted: Thu May 17, 2018 5:42 am
by wumindejia
I guess, It works in a contactless interface. INS = 0x01 is command of the get cardID , INS = 0x20 is command of the verify pin. Because command of the get cardID is case2, so it does not need to receive data and execution is successful. Command of the verify pin is case3,so it needs to receive data and It's wrong in the apdu.setIncomingAndReceive().

Re: Problems with debugging

Posted: Sat May 19, 2018 3:17 pm
by xochyreg
Hi guys,

i've setup the JCKit_JAVACOS_1.0.5.39.exe,
the folder C:\JavaCardKit\SDK\Sample\ contains these three sample apps,
incl. WalletDemo.

@wumindejia: i don't know the exact ways the IDE does the emulation,
but it seems to me it treats all commands as sent to a contact JavaCard,
not a mifare-like one.

Now i discovered even more problems with debugging, with applets i cannot
share, the IDE debugging subsystem needs serious rework, it's not a mature
product :(

Re: Problems with debugging

Posted: Sat May 19, 2018 3:33 pm
by xochyreg
Can somebody please upload the walletdemo app to a real JavaCard?
Will it work okay?
Is the IDE debugging a worth thing or is it just a pain as for me?

Re: Problems with debugging

Posted: Sat May 19, 2018 9:08 pm
by Mohinder
Mine is ok. I have download this applet in my JCOP card(J3D081). What is your JCIDE's version?

Re: Problems with debugging

Posted: Sun May 20, 2018 11:13 pm
by wumindejia
/select 112233445566
>> 00 A4 04 00 06 11 22 33 44 55 66 00
<< 90 00

>> /send "80 20 00 00 081122334455667788 "
>> 80 20 00 00 08 11 22 33 44 55 66 77 88
<< 90 00

>> /send "80 01 00 00 08"
>> 80 01 00 00 08
<< 01 40 20 30 40 50 60 70 90 00

Re: Problems with debugging

Posted: Sun May 20, 2018 11:23 pm
by wumindejia
xochyreg wrote:Can somebody please upload the walletdemo app to a real JavaCard?
Will it work okay?
Is the IDE debugging a worth thing or is it just a pain as for me?

"Apdu may be illegel.Decoding conventions for command APDU should obey the rule in 7816-3 section 12.1.3" is warning. Because your command is wrong, it is processed in the java virtual machine, not to the application processing.

Re: Problems with debugging

Posted: Thu May 24, 2018 7:41 am
by RSA4096
I did some experiments on this topic. Look at the following figure. You should select the protocol "T=1" to replace "T=0|T=1". I think this IDE does not support getting response data automatically. And the other error is a divergence about the LC/LE, I am not sure which is the right format. This JCIDE consider your input APDU( /send "80 01 00 00 00 00") is wrong. If you remove only one byte like my screenshot, it will be ok.


Re: Problems with debugging

Posted: Thu Jun 04, 2020 4:58 am
by kuafu
Pleae using the latest version of JCIDE. It's no a problem anymore.