Android Process resident----A simple guardian and summary of the start-up broadcast

Source: Internet
Author: User

This is a lightweight library, configure a few lines of code, you can implement on Android to achieve the process of permanent, that is, under the system strong kill, as well as 360 get root, clean master can not kill process under root permission

Support System 2.3 to 6.0

Support for most devices, including Samsung, Huawei, Oppo,nexus, Meizu, etc.

Can simply protect the power-on broadcast

GitHub Address:

Https://github.com/Marswin/MarsDaemon

Principle Analysis:

Android Process Resident (0)----Marsdaemon instructions for use

Android Process Resident (1)----opening

Android Process resident (2)----count the keepalive means of using the Android system mechanism

Android Process resident (3)----Native KeepAlive 5.0 The following scenario deduction process and code details

Android Process Resident (4)----native 5.0 above program deduction process and code details

Android Process Resident (5) Simple guardian and summary of----start-up broadcast

Body:

Finally, the end of the finished, this is the last one months in the results, but also have an account of themselves.

In fact, KeepAlive is two points:

1, how to listen to the process hung off

2, how to pull up the process

The problem is solved by solving the two points.

Everyone put my previous articles are read, will find that both points have a good variety of strategies, then on different mobile phones, the two points of the different strategies have a variety of combinations, but also I fit the main means of mobile phone.

I was fitted with a test cell phone.

Also say, some mobile phone will be in your system set force close, the display has killed the process, but actually did not really kill, such as Meizu ...

Can shell go in with command PS | grep Mars to see all the Marsdaemon processes

If you have root privileges, you can use the kill-9 command to kill the process, but the effect does not force close and 360\cm kill the good

Finally, the process is guaranteed not to die, but first to live.
In other words a lot of people ask me if I want to start the boot time, how to start
The answer must be a boot broadcast.
But now there are third-party software to get root permission to disable our start-up broadcast, then Marsdaemon of the protection of life is meaningless.

So how did 360/cm disable our broadcast?

We stand in his perspective to think about this question:

1, he stopped the system to issue a power-on broadcast, immediately after the injection systemservice

2, the system issued a broadcast, he let us not receive

3. After we received the broadcast, he sent us away.

4. He failed to return us, but he killed us right away.

OK, the first one is too difficult, if he can do it, we have no root so no solution.

Fourth, we're not threatening, because Marsdaemon is used to kill.

The third one, he's going to inject us, we can add shells.

So what did he do with the second one? System method:

Yes, he can set a component to enable or disable, and if we set our start-up broadcast to disable, it's definitely not going to work.

But this they can not call, need system signature.

But they can do the same with the PMS PM command in the Android Shell:


You can use this PM disable Componentsname command as long as you have root privileges. Third-party security software, we have the default they have root access, then what should we do?


Marsdaemon has such a class in the project
/marsdaemon/libmarsdaemon/src/main/java/com/marswin89/marsdaemon/packageutils

Yes, because it is our own component, so set up he does not need any permissions, just need to reset the status of the boot broadcast at some time (such as every time the process restarts, the network changes when the switch screen), there is a registration of a shutdown broadcast, Reset the status of the boot broadcast every time you shut down, so as to protect the start-up broadcast.

In Cleanmaster, after giving root permission, disable the power-on broadcast, then restart the phone, the power-on broadcast fails, and then add my method, and then disable, turn off the broadcast ok!

It's a simple little tip.

Android Process resident----A simple guardian and summary of the start-up broadcast

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.