bladox.com Forum Index bladox.com
Turbo SIM Toolkit Adapter Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Turbo Lite 2 on Android

 
Post new topic   Reply to topic    bladox.com Forum Index -> Development
View previous topic :: View next topic  
Author Message
gabolema



Joined: 09 Oct 2012
Posts: 2

PostPosted: Tue Oct 09, 2012 4:55 pm    Post subject: Turbo Lite 2 on Android Reply with quote

Hello,
I'm having problems using Turbo Lite 2 on Androird, Samsung Galaxy GT-S106 dual sim.
I wrote an application that receives an SMS and automatically sends an SMS to a phone, using the ACTION_SMS.
The application works well in a Nokia 1112, but not on my Android device. I traced the messages sent between the SIM and Bladox, and I never got the ACTION_SMS triggered..

Another topic, I compiled fake_sim, but I don't get the menu when selecting it..I did a trace, and I'm getting a SIM reset after selecting the fake_sim application..and the reset won't stop until I power off the device. I don't have this problem on my Nokia device.

Any clues? Thanks in advance!
Back to top
View user's profile Send private message
belve



Joined: 04 May 2006
Posts: 30

PostPosted: Tue Oct 09, 2012 7:13 pm    Post subject: Reply with quote

#define ACTION_SMS - Invoked when SMS is received. In the case that SMS is received and the ACTION_SMS invoked the incoming SMS is not stored to SIM by default (it is up to the application to store it to SIM).
A lot of Nokia MEs Series 40 SW do not support AT+CGMR/W/D commands to handle SMS events. And a lot of Nokia MEs Series 40 do not issue the proper events. To trace the incoming SMS you should to catch and handle a chain of events such as ACTION_RUN_GSM_ALGORITHM, then ACTION_FILE_APDU () and handle a chain of ME_CMD_RUN_GSM_ALGORITHM, ME_CMD_GET_RESPONSE, ME_CMD_SELECT and ME_CMD_UPDATE_BINARY (6f7e loci update).
Something like below:
case ACTION_RUN_GSM_ALGORITHM: //A0 88 00 00 10
sim(((File_apdu_data *) data)->ins,((File_apdu_data *) data)->p1,((File_apdu_data *) data)->p2,((File_apdu_data *) data)->p3,((File_apdu_data *) data)->data);
sms_incame_status=0x00;//
break;
case ACTION_FILE_APDU:
if (((File_apdu_data *) data)->prev_ins == ME_CMD_RUN_GSM_ALGORITHM
&& ((File_apdu_data *) data)->ins == ME_CMD_GET_RESPONSE)
if (sms_incame_status==0x00)
{sms_incame_status=0x01; dbsp ("run gsm");}
if (((File_apdu_data *) data)->prev_ins == ME_CMD_SELECT
&& ((File_apdu_data *) data)->ins == ME_CMD_UPDATE_BINARY
&& ((File_apdu_data *) data)->p3 == 0x04
&& ((File_apdu_data *) data)->ef == 0x6F7E
&& (sms_incame_status==0x01))//1xxxxxxx)
{sms_incame_me(data); sms_incame_status==0x00; dbsp ("loci update1");}

sim(((File_apdu_data *) data)->ins,((File_apdu_data *) data)->p1,((File_apdu_data *) data)->p2,((File_apdu_data *) data)->p3,((File_apdu_data *) data)->data);
dbsp ("status 2 apdu");
dbch (((File_apdu_data *) data)->prev_ins);
dbch (((File_apdu_data *) data)->ins);
dbch (((File_apdu_data *) data)->p3);
dbch (((File_apdu_data *) data)->ef);
break;
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Thu Oct 11, 2012 11:31 am    Post subject: Re: Turbo Lite 2 on Android Reply with quote

gabolema wrote:
Hello,
I'm having problems using Turbo Lite 2 on Androird, Samsung Galaxy GT-S106 dual sim.
I wrote an application that receives an SMS and automatically sends an SMS to a phone, using the ACTION_SMS.
The application works well in a Nokia 1112, but not on my Android device. I traced the messages sent between the SIM and Bladox, and I never got the ACTION_SMS triggered..


Android is buggy in many ways, it probably doesn't store SMS in SIM card even if class explicitly says so. There is some android API in SMSManager to access SIM SMS memory.

Quote:

Another topic, I compiled fake_sim, but I don't get the menu when selecting it..I did a trace, and I'm getting a SIM reset after selecting the fake_sim application..and the reset won't stop until I power off the device. I don't have this problem on my Nokia device.

Any clues? Thanks in advance!


For this a trace of ME-SIM communication would be needed. Could be USIM related - speculation. Does it happen with all SIM cards? Can you try some old one?
Back to top
View user's profile Send private message
gabolema



Joined: 09 Oct 2012
Posts: 2

PostPosted: Thu Oct 11, 2012 3:03 pm    Post subject: Reply with quote

Hi thank you both for the replies.
I'm sorry if I wasn't clear enough, but I have no intention to store the SMS. I'm just saying that even though an SMS is received, ACTION_SMS in not being invoked..is it necesary to store the SMS on SIM in order to be invoked? I'm a bit confused..

Regarding the fake_sim application, you can find the trace below.
Code:
FROM ME:  00 d6 00 00 06
FROM ME:  0f ff ff 0f ff ff
TO SIM:   00 d6 00 00 06
TO SIM:   0f ff ff 0f ff ff
FROM SIM: 90 00
TO ME:    90 00

FROM ME:  00 d6 00 00 06
FROM ME:  00 00 02 00 00 04
TO SIM:   00 d6 00 00 06
TO SIM:   00 00 02 00 00 04
FROM SIM: 90 00
TO ME:    90 00

FROM ME:  00 d6 00 00 06
FROM ME:  00 00 02 00 00 06
TO SIM:   00 d6 00 00 06
TO SIM:   00 00 02 00 00 06
FROM SIM: 90 00
TO ME:    90 00

FROM ME:  80 c2 00 00 09
FROM ME:  d3 07 82 02 01 81 10 01 04
About to enter fake sim
I'm in!
RESET
3b
9e
95
80
1f
c7
80
31
e0
73
fe
21
1b
66
d0
01
77
36
0e
00
4d
TCK
TA1: 95
TC1: 00
TC2: 00
Pff
Q
P10
A
P95
B
P7a
E
D
I
TA1=95
D=0200
D=0020
U=0003
Jff
J10
J95
J7a
Kff
K10
K95
K7a

FROM ME:  00 a4 00 0c 02
FROM ME:  3f 00
TO SIM:   00 a4 00 0c 02
TO SIM:   3f 00
FROM SIM: 90 00
TO ME:    90 00


Looking at the debug messages, the application won't succesfully initiate
Code:
SCtx *c = spider_init ();

So I guess there is a problem with user interface in Android?

Thanks!
Back to top
View user's profile Send private message
pz



Joined: 12 Mar 2004
Posts: 1161

PostPosted: Wed Oct 31, 2012 10:37 am    Post subject: Reply with quote

The problem is the SIM is in fact USIM (see 00 CLA APDU's) while Fake SIM is old GSM SIM - A0 class.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    bladox.com Forum Index -> Development All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group