2

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

Zoe
  • 27,060
  • 21
  • 118
  • 148
Leonardo
  • 228
  • 3
  • 10
  • You can try to use STK commands to actually "simulate" the user interaction One thing: you must choose carefully your USB modem, as not all of them are capable of running such code. I was able to get working only one device: ZTE MF100 If you need some more info, i will gladly give you my experience. (Now i have a working STK application to check balance / topup money via the STK menu using USB modem) – Gipsz Jakab Oct 17 '14 at 05:47
  • @GipszJakab I need this please – Jimmy Ilenloa Jan 25 '20 at 09:51

2 Answers2

0

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)
yummy
  • 570
  • 3
  • 9
0

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.

zq w
  • 26
  • 2