How to disable launching an application using BOOT_COMPLETED

I want to make the task manager soft, I want to check all the apps that used android.intent.action.BOOT_COMPLETED, and I want to disable the automatic launch on mobile device startup as well. I have no clue, if I need root permission to complete it, any advice can get

+3


source to share


3 answers


Note. You cannot modify the file /data/system/packages.xml

above to remove the permission android.intent.action.BOOT_COMPLETED

.

This is due to the fact that at the time of launch, the android framework parses each apk manifest file (for example, an application), and when it sees the permission android.intent.action.BOOT_COMPLETED

, it calls the application at that time.



Therefore, changing the file will have no effect. I tried this - trust me. The only way to remove the permission android.intent.action.BOOT_COMPLETED

(other than changing the andorid framework, recompiling and downloading it to the phone) is to manually edit the apk files from which you want to remove the permission.

Obviously not for the faint of heart!

+1


source


To check which apps are receiving the action BOOT_COMPLETED

, you can use the android class PackageManager

and ResolveInfo

something like

Intent intent = new Intent(android.intent.action.BOOT_COMPLETED);

List<ResolveInfo> listApp = packageManager.queryIntentActivities(intent, 0);
for (ResolveInfo res : listApp) {
    Log.e("Camera Application Package Name and Activity Name",res.activityInfo.packageName + " " + res.activityInfo.name));
}

      

But I think it is not possible to change the other resolution of the app they are using. Thus, you cannot prevent him from starting from the moment BOOT_COMPLETED

. If you want this, then you need ROOT permission for this .



There is one app on the Android market that allows you to do this, such as LBE Privacy Guard

UPDATE:

In the structure of the Android framework /data/system/packages.xml

, which contains all the information about the installed application, the permissions used are included (I never try this also I don't know if it was done or not). If you can change this file, then perhaps you can achieve what you want .. Thanks ..

+4


source


If you can find out what the component is (for example by looking at the application manifest), you can disable the component from the command line or root shell: pm disable package.name/component.class.name

The Autostarts app does this. It has GPL source code (I think) that you can reuse for your application if your application is also GPL.

0


source







All Articles