the SmsInterceptor didn't work at all.
:BangHead: when running it ,I send a sms of"AAA",the service didn't execute the sms_MessageReceived sub,there is "start" string in the log :sign0085::sign0085:
B4X:
'Service module 拦截短信用的
Sub Process_Globals
Type Message (Address As String, Body As String)
Dim cipher As String
cipher="AAA"
Dim m As Message
End Sub
Sub Service_Create
Dim pi As SmsInterceptor
Log("s1 create")
ToastMessageShow("s1 create",True)
pi.Initialize2("sms",999)
End Sub
Sub Service_Destroy
End Sub
Sub sms_MessageReceived (From As String, Body As String) As Boolean
ToastMessageShow("adr:"&From&" content:"&Body,True)
If Body.IndexOf(cipher)>-1 Then
m.Initialize
m.Address=From
m.Body=Body
Log(m)
'eat the event
ToastMessageShow("吃掉事件",True)
Return True
End If
'not eat the event
ToastMessageShow("不吃事件",True)
Return False
End Sub
Sub Service_Start(startingIntent As Intent)
Log("start")
End Sub