How can I receive SMS / phone events and act on them before sending them to system applications?

I am trying to develop a jailbroken iPhone application similar to Mcleaner or iBlacklist.

What I want my application to be able to do is intercept SMS or phone events and process them before they are sent to the appropriate recipient. For example, I want the application to receive an SMS event, compare the sender with an array of numbers and process the data, or ignore it, and send it to the SMS application.

In MCleaner you can define a black list of numbers, and if a text message is received that matches the black list, the user will not receive a warning from the phone, and the data will be processed by MCleaner.

How can I get these events, and further, how would I get them before the corresponding applications receive them? As far as I understand, I need to become the first responder to these things, but I really don't know where to start. It seems that I can not find any hints on how I will do this, since this application will not call Apple classes to receive data.

Thanks.

+4
source share
2 answers

I can only be guided by this, sorry, the code is not mine to give.

In memory, all action calls are just pointers. What you need to do is move the pointer so that it points to your own function. Once you do this, you do w / e in your function and then call the default function call. This ensures the integrity of action calls and allows you to intercept actions.

0
source

Source: https://habr.com/ru/post/1338796/


All Articles