简体   繁体   中英

Intercept commands on SIM STK Menu

I need to intercept which command is sent when the user selects one option in STK menu of the SIM card.

I've searched a lot and i saw that there is the RIL protocol, but i have no success yet.

In my case, i need to know the command to simulate the check balance of the sim card.

I'm developing an app thats send this command and handles the received message.

the following log is shown in the exact moment i touch the "check balance" option in list

06-11 09:29:27.388: D/CAT(944): CatService: 10arrived on slotid: 0 06-11 09:29:27.398: D/CAT(944): CatService: SEND_SMS 06-11 09:29:27.398: D/CAT(944): CatService: Sending CmdMsg: com.android.internal.telephony.cat.CatCmdMessage@41f6d030 on slotid:0 06-11 09:29:27.428: D/CAT(944): StkAppService: 1called on slot:0 06-11 09:29:27.428: D/CAT(944): StkAppService$ServiceHandler: SEND_SMS 06-11 09:29:28.700: D/PhoneInterfaceManager(944): Broadcasting intent ACTION_UNSOL_RESPONSE_OEM_HOOK_RAW

Two types of commands may be sent to CP(modem), can be intercepted in CatService.java

1) EVELOPE :

private void sendMenuSelection(int menuId, boolean helpRequired)

2) Terminal Response:

private void sendTerminalResponse(CommandDetails cmdDet,
        ResultCode resultCode, boolean includeAdditionalInfo,
        int additionalInfo, ResponseData resp)

For the log you posted, When you touch the "check balance" option in list, Some Terminal Response(pdu) is sent to modem, you can print the raw hex byte out if you are interested.

06-11 09:29:27.388: D/CAT(944): CatService: 10arrived on slotid: 0
06-11 09:29:27.398: D/CAT(944): CatService: SEND_SMS

When modem got the Terminal resp, it send a SMS to particular operator, And then you may be able to received a Message concerning the balance info. Note the SMS is not send from Android, it's trigger by Stk in modem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM