Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

update EF under ADF in USIM in java card

I am working on applet and I want to update a FIle (a LOCI file for example : 0x6f7e ) under USIM using SIM/UICC applet.

The first question is: can I read/update EF under the ADF using SIM JAVA API (using STK applet) ?

According to my reads (the 3GPP TS 43.019) The obvious answer is no, i am wrong did i miss somtehing that can let me read/update a file under the ADF using SIM applet ?

So i started working on UICC applet (release 6) based on the (ETSI TS 102 241) and the stepping stone (link here) the ADF can be a readed/updated only by getting the ADF reference (getTheFileView) using the AID. but for an unknown reason I am having and UICC exception (0003 : SECURITY_STATUS_NOT_SATISFIED ) in the update command (the selection goes well). The Applet is installed with full access and Admin Full access also (using GEMALTO tools).

you can find here the code that i am using (in the applet init):

    AID adf_aid = new AID (uicc_aid, (short) 0x00, (byte) uicc_aid.length);
    ADFView = UICCSystem.getTheFileView( adf_aid,
             JCSystem.CLEAR_ON_RESET);

on this part i also use the AID as buffer without creation of the AID object.

update on the STK menu access

    ADFView.select(FID_EF_LOCI);
        ADFView.updateBinary((short) 0, eraseLoci, (short) 0,
                (short) eraseLoci.length);

I tried almost everything that I thought about :

  • select the MF before selection of the AFD.

  • select directly the 7FFF

    and i still having same exception, can you please tell what should i check ? must I change the code, use another release (Jar file) ? use a specific install parameter ? is there any other solution to update the files under the ADF ?

i checked the AID value and its same put in the first record of the EF_DIR (2F00).

Thanks in advance.

like image 736
forest forest Avatar asked Nov 08 '22 22:11

forest forest


1 Answers

you might wanna try simalliance cat loader instead. it has privilege modification for FileView and AdminFileView.

like image 198
amin bakhtvar Avatar answered Dec 19 '22 14:12

amin bakhtvar