0

I want to programmatically hide another apps form the launcher, I know that this is possible because this app does it(also when is installed as user app). I have a rooted device and can use RootTools library.

Up to now, I have done this(without success):

In MainActivity's onCreate:

    PackageManager pm = getPackageManager();
    ComponentName componentName = new ComponentName("ar.com.luzzatto.linterna","MainActivity.launcher classname");
    pm.setComponentEnabledSetting(componentName,PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
    Toast.makeText(this, "DONE", Toast.LENGTH_SHORT).show();

On the manifest:

<uses-permission android:name="android.permission.CHANGE_COMPONENT_ENABLED_STATE"/>

It's very important to say that I put my app on /system/priv-app in order to get system permissions. I don't gen any error and the TOAST shows, but the other app icon keeps showing(as usual) on the phone's launcher.

Another thing that I want to clarify is that the app I want to mimic(this app) doesn't need to be put on /system/priv-app and does the job very well. So my manin intention is to know how that app works. But meanwhile, if anyone has another idea(also if I have to be on /priv-app) will be welcome.

0 Answers0