Many of the tools on the market now have the ability to block other apps from booting, such as the Cheetah Cleanup Master and 360 security guards. This article explains how to avoid being a cheetah cleanup master closed the boot broadcast, 360 security guard Shield mode has not been clear, there are Daniel understand the words please enlighten.
The cheetah blocking principle is achieved by changing the state of the third-party app to receive the reciver of the boot broadcast. The solution is to change the power to be available in the shutdown broadcast.
The specific code is as follows:
Receive the boot broadcast Android.intent.action.BOOT_COMPLETED the build name is Com.android.test.CompletedReciver.java
Receive shutdown broadcast Android.intent.action.ACTION_SHUTDOWN The build name is Com.android.test.ShutDownReciver.java
Package com.android.test;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import Android.content.Context;
import android.content.Intent;
import Android.content.pm.PackageManager;
import android.text.TextUtils;
Public class Shutdownreceiverextends broadcastreceiver {
Private Static void setcomponentenablesetting (context context, String ClassName) {
Packagemanager pm = Context.getpackagemanager ();
ComponentName componentname = new componentname (context, className);
Pm.setcomponentenabledsetting (ComponentName, Packagemanager. Component_enabled_state_enabled, Packagemanager. Dont_kill_app);
}
Private Static int getcomponentenablesetting (context context, String ClassName) {
Packagemanager pm = Context.getpackagemanager ();
ComponentName componentname = new componentname (context, className);
return pm.getcomponentenabledsetting (componentname);
}
@Override
Public void onreceive (final context context, Intent Intent) {
String action = Intent.getaction ();
if (Textutils.isempty (Action)) {
return;
}
if (Intent. action_shutdown. Equals (ACTION)) {
String componentname = "Com.android.test.CompletedReciver";
if (Packagemanager. component_enabled_state_disabled = = getcomponentenablesetting (Context.getapplicationcontext (), ComponentName)) {
Setcomponentenablesetting (Context.getapplicationcontext (), componentname);
}
}
}
}
About 360 security guard and MIUI system the implementation of the Security Center has not been understood.
Solve the method that the phone management tool does not disable boot