Search code examples
androidsmsandroid-5.0-lollipopandroid-4.4-kitkat

Block incoming SMS on rooted Android 4.4 and higher?


In accordance with the doc:

Note that—beginning with Android 4.4—any attempt by your app to abort the SMS_RECEIVED_ACTION broadcast will be ignored so all apps interested have the chance to receive it.

so, only default SMS app can do it and looks like nothing is changed with Android 5.0 (due to unknown reason, according issue is marked as Obsolete).

Is there any way to block incoming SMS for non-default SMS app if phone is rooted (this is is needed for spam-blocking app)? How to do it?


Solution

  • You could write a service that overrides CarrierMessagingService . If the bind to this is successful , then the message is not delivered to the main app.

    BIND_CARRIER_MESSAGING_SERVICE permission required to register as carrier messaging service requires the app to be system app. So you need to push your app to the system.