Reputation: 43
Is it possible to cech sms message before it gets to the main sms app and change it's body?
Upvotes: 0
Views: 69
Reputation: 39191
Pre-KitKat, this might be possible by intercepting the SMS_RECEIVED
broadcast, aborting it, and writing the altered message to the provider. This won't work everywhere, though, as the SMS API was not publicly available until KitKat, and the exact implementation varies from vendor to vendor.
From KitKat on, the default SMS app is responsible for writing the message to the provider, so if your app is selected as default, you could display and write the altered message. However this isn't a 100% guaranteed solution, as any attempt to abort the SMS_RECEIVED
action is ignored by the system, and any app listening for it will still have access to the original message.
Upvotes: 1