Specifying TAR parameter installing applet

Hello,

I am trying to assign a TAR to an applet that I want to install on a sysmoISIM-SJA2. My ultimate goal is to write an OTA message to trigger the opening of this applet later.

As a base, I used HelloSTK, modifying it slightly. Here:

it is explained in detail how to assign the various parameters from section 8.2.1.3.2 of https://www.etsi.org/deliver/etsi_ts/102200_102299/102226/17.00.00_60/ts_102226v170000p.pdf , but I can’t figure out how to include the TAR, which is a field in the table in that document.

I also tried to derive the syntax from shaysim.py but with little success.

Do you have any pointers on how to do this?

Thank you so much for all the resources and materials you share.

Please note that shadysim is an ancient proof-of-concept hack. I suggest you instead try pySim-shell which recently received support for CAP file installation instead.

The TAR value must be specified during INSTALL [for install] according to ETS ITS 102 226 Section 8.2.1.3.2 in the tag CA. You currently need to encode those manually and pass it to the --install-parameters or --install-parameters-stk arguments.

Thank you for the response! Yes, I had looked into shadysim just because I saw that in the install_app function, it handled the TAR separately and it could help me understand the exact placement in the string.

For the actual installation, I was using gp.jar; I didn’t know that pySim-shell supported the installation of CAP files, I will definitely try it.

Anyway, if the only way is to encode the parameters manually, then I think I will need to try harder…

Hello,

I also tried with pysim-shell.py, but the issue isn’t with the tool, it’s that I’m evidently misinterpreting the table in the ETSI document. To recap:

Original CA section

010001001505000000000000000000000000

broken down like this:

0100: Access domain = 0x00 ==> file system access allowed
01: Priority level
00: Maximum allowed timers
15: Maximum length for a menu entry
05: Maximum number of menu entries
0000000000: 2 × m bytes where m is 5
00: Maximum number of channels for this application instance
00: Length of Minimum Security Level field
00: Minimum Security Level (MSL)
00: Length of TAR Value(s) field
000000: TAR Value(s) of the Toolkit Application instance

So if I wanted to assign a TAR of the type

BF FF FF
(ETSI TS 101 220 - ‘BF FF 00’ to ‘BF FF FF’ Proprietary Toolkit Application )

I would, according to this reasoning, have:

010001001505000000000000000003BFFFFF

I still keep receiving 6a80, is there something I’m overlooking?
Thanks again.

Hi @mandomat,
You need 2 bytes per Menu Entry, not 2 digits. But, if you work with Hello STK, 1 menu entry is enough.
Can you try one of these?
01000100150500000000000000000000000003BFFFFF
or
0100010015010000000003BFFFFF (recommended)
Hope this helps.

1 Like

You’re right! Simplifying with just one menu entry made it easier and fixed the issue! Thanks a lot! :slight_smile:

Hello,

I’m currently working on this topic, but I’m having issues with the TAR parameter. I can successfully load the applet using the --install-parameters-stk argument and assign TAR numbers such as “BFFFFF”, “B00030”, or “B00040”. After loading, I can also see the applet on the phone.

pySIM-shell (SCP02[01]:00:MF/ADF.ISD)> install_cap /home/anda/HelloSTK.cap --install-parameters-non-volatile-memory-quota 255 --install-parameters-volatile-memory-quota 255 --install-parameters-stk 0100010015010000000003BFFFFF
loading cap file: /home/anda/HelloSTK.cap ...
parameters:
 security-domain-aid: a000000003000000
 load-file: 786 bytes
 load-file-aid: d07002ca44
 module-aid: d07002ca44900101
 application-aid: d07002ca44900101
 install-parameters: c900ef0dc80200ffc70200ffca03b00030
step #1: install for load...
step #2: load...
Loaded a total of 790 bytes in 4 blocks. Don't forget install_for_install (and make selectable) now!
step #3: install_for_install (and make selectable)...

However, when I send an “OTA SMS” to the SIM card using one of these TAR numbers, I receive the error “09 - TAR Unknown.” I

’m sure that the new applet has been successfully installed — I even verified it through the phone. However, I’m having trouble accessing the TAR information that I assigned using the --install-parameters-stk argument. Could there be something I’m missing or doing incorrectly? I’m open to your suggestions.