About if and prevent the Android program to prevent the problem of restarting after 360kill, certainly we have searched a lot of methods, are not good, right, what elevated authority, what process priority, these things are not controllable, so there are some very insurance methods, Automatically restarts the program after it has been killed.
We find that when we use 360 for program cleanup, some applications start up quickly and how do they do it? In fact, we have not seen their source code, it is not good to say how to achieve.
I will give you some ideas below, and may be helpful to you:
There are a lot of rogue software and viruses on windows, and sometimes you can't kill them, unless you unplug them to keep them from bullying. How they can not be killed, that is, through the daemon process to operate,
For example, 1.exe, 2.exe of these two programs, when killed 1.exe, the 2.exe to start, if you kill 2. EXE in the time to start the 1.exe, so I can't kill him at all. In fact, just to give a small example, should be more complex than this, virus and rogue software is to and antivirus software against the dry.
We can also use this idea in Android:
(1) Creation of two Service,service1 and Service2
(2) write the code to start Service2 in Service1 's Ondestory method
Write the code that starts Service1 in Service2 's Ondestory method
This ensures that non- system processes kill their own program restart method
At that time, if it is a system program, such as the system comes with the management of the program to force kill off the program how to do it? Do we have a good idea?
Of course there is, haha, is actually very simple,
We are the most commonly used system broadcast registration, such as the lock screen broadcast, etc., after receiving the broadcast to check whether the service has been started, if not started that even one of the service can
The above method does not need to what the system of higher permission and so on things, also can let own program become immortal body.
Android program prevents kill by 360 or system