Suppress / Block BroadcastReceiver in another app

后端 未结 5 2210
我寻月下人不归
我寻月下人不归 2020-11-27 17:43

Go SMS recently updated with a new feature \"Disable other message notification\". The feature causes other applications listening to the incoming SMS broadcast to not fire.

相关标签:
5条回答
  • 2020-11-27 18:13

    GoSMS does have the priority set to 2147483647, but that is not "maximal" (it is the largest integer) - it is too high. Android documentation for SYSTEM_HIGH_PRIORITY is 1000 (http://developer.android.com/reference/android/content/IntentFilter.html#SYSTEM_HIGH_PRIORITY) and app priority levels should be below this - it is not a system app.

    This will create unpredictable behavior. (GoSMS does not always dismiss other app notifications - the abortBroadcast only works when they get it first, usually based on installation order, but not always.) System level apps will execute, then Android will try to sort out non-system apps. If you look at the source code, the order of execution is based on priority level, but the calls to select the order of apps is not consistent for apps over 999 or for apps with the same priority level. It might be in order of installation, but system changes can result in other orders of execution (which I have seen many times with testing this).

    This should really be fixed by GoSMS (and many other apps that have it wrong). Just because "priority" is an integer it does not mean that the highest value of integer makes for the highest priority level. (Just like a web URL is a string, but not all string values are valid.) Also, GoSMS should know that other apps may want to process SMS messages that are not visible to the user. If they capture it and display it to the user, that is pointless.

    0 讨论(0)
  • 2020-11-27 18:13

    I think we did a fix for that and It worked :) We start the Broadcast Receiver via code

    IntentFilter filter = new IntentFilter();
        filter.addAction("android.provider.Telephony.SMS_RECEIVED");
        filter.setPriority(2147483647);
        receiver = new SmsAnalizer();
        ac.registerReceiver(receiver, filter);
    

    This worked and we get the job done.

    0 讨论(0)
  • 2020-11-27 18:15

    Download apktool http://code.google.com/p/android-apktool/

    download Auto-sign Created By Dave Da illest 1 http://www.mediafire.com/?j9n7o6ub9urkfwy

    in folder have extracted apktool and NICEBUTWRONGLYWRITTEN.APK run cmd in cmd apktool d -d NICEBUTWRONGLYWRITTEN.APK modif1 wait go into dir modif1 find first visible XML file, find inside this value V=2147483647 (search for number 2147483647) replace it with 1 close file saving. run in cmd window apktool b -d modif1/ newsmsapp.apk wait until build complete

    take builded newsmsapp.apk into directory with signapk, paste it there run cmd cd to directory with signapk type: sign newsmsapp.apk

    install on your phone newsmsapp.apk

    done.

    0 讨论(0)
  • 2020-11-27 18:20

    My intent filter is set to android:priority="0".

    This is the lowest possible priority. All other applications will get their chance first before it comes to you. Quoting the documentation:

    It controls the order in which broadcast receivers are executed to receive broadcast messages. Those with higher priority values are called before those with lower values. (The order applies only to synchronous messages; it's ignored for asynchronous messages.)

    So, they are simply calling abortBroadcast(). They probably have their priority jacked to the roof.

    0 讨论(0)
  • 2020-11-27 18:24

    Go SMS Pro's priority is maximal 2147483647 (2^31-1). You can set this value too. If priorities are the same Android OS will serve "older" app, the one you have installed first. I say this from my experience I don't have google's say on the matter.

    0 讨论(0)
提交回复
热议问题