Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMS Broadcastreceiver not called when GO SMS Pro installed

Tags:

android

I have implemented an SMS receiver which intercepts incoming SMS messages without any issues. However, when I install GO SMS Pro and set "Disable other message notification", then my app does not receive any broadcast message even though I have set the priority on intent filter very high. Is there a way to overcome so that my app always receive a SMS broadcast irrespective of what user does on Go SMS Pro's app, especially since my app does not show any UI pop-up notification? As soon as I uninstall GO SMS Pro, my app starts getting incoming SMS broadcasts and works fine.

Here is the log when an incoming SMS is received and GO SMS Pro is installed. There is some magic done by GO SMS Pro which I don't understand. Can someone explain what is done here and how can I make sure my app does get ordered broadcast notification every time.

07-02 19:52:21.674: INFO/Zygote(25209): Zygote: pid 25209 has INTERNET permission, then set capability for CAP_NET_RAW

07-02 19:52:21.820: INFO/ActivityThread(25209): Publishing provider go-sms: com.jb.gosms.provider.GoSmsProvider

07-02 19:52:21.830: INFO/ActivityThread(25209): Publishing provider go-mms-sms: com.jb.gosms.provider.GoMmsSmsProvider

07-02 19:52:21.834: INFO/ActivityThread(25209): Publishing provider com.jb.gosms.im;com.jb.gosms.chat: 
com.jb.gosms.im.database.ImContentProvider

07-02 19:52:21.842: INFO/ActivityThread(25209): Publishing provider com.jb.gosms.schedule.Schedule: com.jb.gosms.schedule.ScheduleProvider

07-02 19:52:21.846: INFO/ActivityThread(25209): Publishing provider go-mms: com.jb.gosms.provider.GoMmsProvider

07-02 19:52:21.959: DEBUG/dalvikvm(25209): GC_FOR_MALLOC freed 2657 objects / 173112 bytes in 30ms

07-02 19:52:22.182: DEBUG/dalvikvm(25209): Trying to load lib /data/data/com.jb.gosms/lib/libHanzi2Pinyin.so 0x47d4cf70

07-02 19:52:22.182: DEBUG/dalvikvm(25209): Added shared lib /data/data/com.jb.gosms/lib/libHanzi2Pinyin.so 0x47d4cf70

07-02 19:52:22.182: DEBUG/dalvikvm(25209): No JNI_OnLoad found in /data/data/com.jb.gosms/lib/libHanzi2Pinyin.so 0x47d4cf70, skipping init

07-02 19:52:22.186: INFO/Hanzi2Pinyin_Native(25209): InitLib in ver=3141000

07-02 19:52:22.186: INFO/Hanzi2Pinyin_Native(25209): Init in

07-02 19:52:22.186: INFO/Hanzi2Pinyin_Native(25209): file size=155203 

07-02 19:52:22.186: INFO/Hanzi2Pinyin_Native(25209): Init out

07-02 19:52:22.186: INFO/Hanzi2Pinyin_Native(25209): Instance out Init = 21

07-02 19:52:22.186: INFO/Hanzi2Pinyin_Native(25209): InitLib out

07-02 19:52:22.467: DEBUG/dalvikvm(25209): GC_FOR_MALLOC freed 5960 objects / 376104 bytes in 29ms

07-02 19:52:22.815: DEBUG/IMS/Ims3GPP2SmsMessage(25209): IMSLogcreateFromPdu : calling parsePdu

07-02 19:52:22.815: DEBUG/IMS/Ims3GPP2SmsMessage(25209): IMSLogpdu to parse : 000002100202070292A106A85A0008150003100730010610254E9D3A000306110702195220

07-02 19:52:22.815: DEBUG/IMS/Ims3GPP2SmsMessage(25209): IMSLogparseAddress

07-02 19:52:22.815: DEBUG/IMS/Ims3GPP2SmsMessage(25209): IMSLogaddress received :3233292992

07-02 19:52:22.815: DEBUG/IMS/Ims3GPP2SmsMessage(25209): IMSLogbearer data received : 0003100730010610254E9D3A000306110702195220

07-02 19:52:22.815: ERROR/bearer data(25209): bearer data obtained 1

07-02 19:52:22.815: DEBUG/EMS(25209):  messageType is 1 messageId is 115 hasUserDataHeader is false

07-02 19:52:22.858: DEBUG/IMS/Ims3GPP2SmsMessage(25209): IMSLogcreateFromPdu : calling parsePdu
like image 691
david price Avatar asked Jul 03 '11 05:07

david price


2 Answers

"Pretty high" value for priority is just not enough when it comes to Go SMS Pro because they've set their on absolute maximum of 2147483647 (2^31-1). So if you put that value you'll be fine as long as your app is installed before Go SMS Pro is because when on same priority Android OS will pass broadcast to "older" app (This is from my experience, not an official information). If Go SMS Pro is installed prior to your app you should warn your users about the situation. They could configure Go SMS Pro differently or uninstall it and then re install it again so your app can work too.

like image 148
Nemanja Kovacevic Avatar answered Oct 27 '22 00:10

Nemanja Kovacevic


go sms pro has set these lines in it's manifest for SmsReceiver:

<receiver android:name=".smspopup.SmsReceiver"     android:permission="android.permission.BROADCAST_SMS">
        <intent-filter android:priority="2147483647">
            <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
        <intent-filter android:priority="2147483647">
            <action android:name="android.provider.Telephony.GSM_SMS_RECEIVED" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />
            <data android:mimeType="application/vnd.wap.mms-message" />
        </intent-filter>
        <intent-filter>
            <action android:name="com.android.mms.transaction.MESSAGE_SENT" />
        </intent-filter>
    </receiver>

all these intent-filters make its priority higher than your receiver even if your reciever has the priority set to 2147483647. you can see the list of all receivers of all apps by:

List<ResolveInfo> receivers = getPackageManager().queryBroadcastReceivers(new Intent("android.provider.Telephony.SMS_RECEIVED"), 0);

the first receiver in the list, receives the sms before than others

like image 32
Shayan_Aryan Avatar answered Oct 27 '22 00:10

Shayan_Aryan