[MOD][Xposed]MyAndroidTools Xposed Module 0.1

Search This thread

wangqi060934

New member
Jan 5, 2011
1
10
This module prevents components from trying to enable themselves.

---------------------------------
We can use MyAndroidTools or MyAndroidTools Pro (you can find them in the Google Play) to disable components(service,broadcast receiver,activity,content provider).
But any app can enable their own component through an open api (setComponentEnabledSetting).
This module just prevent it.
The icon comes from Uchiha Shisui's Mangekyō Sharingan.

1. Log:record all the components that use "setComponentEnabledSetting" to enable themselves,not matter whether it is checked in the blacklist.
2. BlackList settings:select the app you want to block,then save.
--------------------------------------------
//the main source code:
Code:
XposedHelpers.findAndHookMethod("android.app.ApplicationPackageManager",
                loadPackageParam.classLoader,
                "setComponentEnabledSetting",
                ComponentName.class, int.class, int.class,
                new XC_MethodHook() {
                    @Override
                    protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                         if (((int) param.args[1]) == PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
                               param.args[1]=PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
                                }
                    }
             });
 
Last edited:

savvymatthew

Senior Member
Dec 31, 2011
194
43
OnePlus 3
OnePlus 6T
I love your app !!! What version do I need to be on for this to work ?

Would be nice if you explained more info in your thread ? What exactly does this do that the app already doesn't ?
 

Pain-N-Panic

Senior Member
Mar 24, 2013
1,731
625
Droid
Google Pixel 7 Pro
I agree with m0han. The module doesn't provide us with a user interface. So when activated through Xposed, what exactly is it doing? Do we need to download the apk from the app store? More clarification is needed before I activate this module. Thanks.
 

daniel_m

Senior Member
Oct 7, 2012
680
294
This module prevent components from trying to enable themselves.

Awesome, thank you!
Finally something to stop K9-Mail and Google Play store from starting at boot :cool:

Would you consider making the Xposed module or even MyAndroidTools open source? Xposed modules and root apps are scary and releasing the source would increase trust immensely.
I bought the pro version and I would actually buy it again or donate for an open source version. Your app and XPrivacy (open source ;) ) make a very nice couple on any phone :laugh:
 

Kirrrr

Senior Member
Sep 15, 2013
264
62
@wangqi060934, it is very cool and higly anticipated feature. Thank you!

But how does it work? How does it distinct components disabled by me with MyAndroidTools and components disabled by host app itself? And, by the way, can such components be visually distinguished in MyAndroidTools's GUI?
I don't know the nature of this facts but some apps (e.g. Gmail) indeed have services which are disabled without any manual intrusion.

Kind regards!
 
  • Like
Reactions: patrickdrd

TNSMANI

Senior Moderator / RC-RT Committee
Staff member
Jan 8, 2014
7,682
5
14,335
Chennai
OnePlus 9 Pro
There is a beta2 now. I already have MyAndroidTools 0.9.8.6 installed from Play Store. I downloaded the beta through Xposed and installed it as we usually do for Xposed modules, enabled it in Xposed and rebooted.

If we go to XPOSED>modules and click on My AndroidTools, we are asked to activate the module. When we click OK, it goes back to the modules screen and if once again clicked, the UI appears. We have Log, Blacklist and Settings options at top left.
The blacklist menu gives options of third party apps and system apps and when you choose one, the apps are listed with a checkbox against their names. Till now I have experimented. After this comes the conjecture.
If we choose one or more of the apps and click the save button at top right, then that app is prevented from enabling itself unless we invoke that app ourselves. This is my understanding. I have not attempted it. I am afraid as 1. I am not an expert 2. there is no info about what this module actually does 3. it is an Xposed module 4. I won't have my laptop for some more time (in case something happens).

The settings option has only one option to show a toast when a blocking happens. The log is a log.

So if somebody else is brave enough to experiment further or if the OP explains things, I would be happy.

EDIT:
The app also appears in the app drawer and clicking it has the same effect as from Xposed.
 
Last edited:
  • Like
Reactions: bkkzak

xk0niR

Senior Member
Jun 21, 2014
409
112
v0.2 is not working for me, it always show me that the Module is not active even though I can see in Xposed Log it's loaded.
 

TNSMANI

Senior Moderator / RC-RT Committee
Staff member
Jan 8, 2014
7,682
5
14,335
Chennai
OnePlus 9 Pro
v0.2 is not working for me, it always show me that the Module is not active even though I can see in Xposed Log it's loaded.
There seems to be an issue with the UI. I also get the popup that the app is not active and asking me to activate it. If I activate it, the UI closes. The workaround I found is to open it from recents. Then the UI stays and you can play with it.

---------- Post added at 02:14 PM ---------- Previous post was at 02:13 PM ----------

Same here.
(CM12.1 at SGS4mini I9192)

...
 
  • Like
Reactions: Kirrrr

daniel_m

Senior Member
Oct 7, 2012
680
294
Version 0.3 seems to work again.

I was wondering about the purpose of a blacklist. When I disable a service for an app with MyAndroidTools, I do not want that app to re-enable said service. Essentially this means that all apps should be activated in the blacklist in the Xposed module?
 

TNSMANI

Senior Moderator / RC-RT Committee
Staff member
Jan 8, 2014
7,682
5
14,335
Chennai
OnePlus 9 Pro
There is a version 0.6 now. Further the Dev has also furnished more info on the app in the first post.

When we reboot after enabling the app in Xposed and open the app, the log populates and shows the components which have been enabled through 'setComponentEnabledSetting'. We can then long press the component which we want to disable and choose 'blacklist'. It is then shown as blacklisted. The 'blacklist settings' shows the third party apps installed on the phone which can be selected and saved for blocking.

So find any component or third party apps which you want to block and do so. When something is chosen for blocking and it tries to enable itself, it is blocked and an entry appears in the log with its name and the time of its blocking.

If anyone finds any further info, please post the same so that we can learn.

---------- Post added at 01:52 PM ---------- Previous post was at 01:48 PM ----------

Version 0.3 seems to work again.

I was wondering about the purpose of a blacklist. When I disable a service for an app with MyAndroidTools, I do not want that app to re-enable said service. Essentially this means that all apps should be activated in the blacklist in the Xposed module?
No. You check the log and if you find the blocked app/component shown as started, then you add it to the blacklist.

As the Dev explains in the first post, not all disabled apps/components enable themselves. Only a few do so. You find them from the log and block them. Not all.
 

daniel_m

Senior Member
Oct 7, 2012
680
294
No. You check the log and if you find the blocked app/component shown as started, then you add it to the blacklist.

As the Dev explains in the first post, not all disabled apps/components enable themselves. Only a few do so. You find them from the log and block them. Not all.

Yes, I noticed. Of the 200 apps installed on my phone, only K9-Mail and Google Play Store try to re-enable some services.
The question is, does blacklisting impact performance? If not, one could simply blacklist all apps and not care about checking the log. On my ancient Sony Xperia Mini Pro, blacklisting all apps did not seem to slow down the phone noticeably.
 

Bino92

Senior Member
Jul 4, 2014
51
14
Installed it and it worked perfectly; however I had to uninstall the module since it caused, sometimes, a bootloop. It didn't happened all the time and if I accessed to the recovery and rebooted the phone after a forced shutdown, phone booted correctly. I'm almost sure it's the module fault because since I uninstalled it the phone is working smoothly, anyway I don't know how to provide a log in order to help.
I have a Oneplus One running custom CM12.1 by Sultanxda.
 

TNSMANI

Senior Moderator / RC-RT Committee
Staff member
Jan 8, 2014
7,682
5
14,335
Chennai
OnePlus 9 Pro
Installed it and it worked perfectly; however I had to uninstall the module since it caused, sometimes, a bootloop. It didn't happened all the time and if I accessed to the recovery and rebooted the phone after a forced shutdown, phone booted correctly. I'm almost sure it's the module fault because since I uninstalled it the phone is working smoothly, anyway I don't know how to provide a log in order to help.
I have a Oneplus One running custom CM12.1 by Sultanxda.
Try the next version 0.7
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    This module prevents components from trying to enable themselves.

    ---------------------------------
    We can use MyAndroidTools or MyAndroidTools Pro (you can find them in the Google Play) to disable components(service,broadcast receiver,activity,content provider).
    But any app can enable their own component through an open api (setComponentEnabledSetting).
    This module just prevent it.
    The icon comes from Uchiha Shisui's Mangekyō Sharingan.

    1. Log:record all the components that use "setComponentEnabledSetting" to enable themselves,not matter whether it is checked in the blacklist.
    2. BlackList settings:select the app you want to block,then save.
    --------------------------------------------
    //the main source code:
    Code:
    XposedHelpers.findAndHookMethod("android.app.ApplicationPackageManager",
                    loadPackageParam.classLoader,
                    "setComponentEnabledSetting",
                    ComponentName.class, int.class, int.class,
                    new XC_MethodHook() {
                        @Override
                        protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
                             if (((int) param.args[1]) == PackageManager.COMPONENT_ENABLED_STATE_ENABLED) {
                                   param.args[1]=PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
                                    }
                        }
                 });
    3
    The module is a great addition.
    However, like in MyAndroidTools, I don't want to disable the whole application.
    Some applications routinely enable / disable their components that are vital to their functioning, so I don't want those prevented.
    However, the same applications also re-enable all sorts of "optional" components. For example, Google Play Services re-enables SMS monitoring receiver, wearable service...
    We should be able, like in MyAndroidTools, to blacklist the components themselves, not the whole application. The hooked method receives the ComponentName, so it can be detected. Moreover, you can just check the log and long press to blacklist the components one by one (please display / add option to display the full package name, like MyAndroidTools).
    1
    does MyAndroidTools 1.2.8.7 apk need to be installed first and then this Xposed Module 0.1?
    how exactly does this work? please explain in detail and also the installation procedure.
    1
    @wangqi060934, it is very cool and higly anticipated feature. Thank you!

    But how does it work? How does it distinct components disabled by me with MyAndroidTools and components disabled by host app itself? And, by the way, can such components be visually distinguished in MyAndroidTools's GUI?
    I don't know the nature of this facts but some apps (e.g. Gmail) indeed have services which are disabled without any manual intrusion.

    Kind regards!
    1
    There is a beta2 now. I already have MyAndroidTools 0.9.8.6 installed from Play Store. I downloaded the beta through Xposed and installed it as we usually do for Xposed modules, enabled it in Xposed and rebooted.

    If we go to XPOSED>modules and click on My AndroidTools, we are asked to activate the module. When we click OK, it goes back to the modules screen and if once again clicked, the UI appears. We have Log, Blacklist and Settings options at top left.
    The blacklist menu gives options of third party apps and system apps and when you choose one, the apps are listed with a checkbox against their names. Till now I have experimented. After this comes the conjecture.
    If we choose one or more of the apps and click the save button at top right, then that app is prevented from enabling itself unless we invoke that app ourselves. This is my understanding. I have not attempted it. I am afraid as 1. I am not an expert 2. there is no info about what this module actually does 3. it is an Xposed module 4. I won't have my laptop for some more time (in case something happens).

    The settings option has only one option to show a toast when a blocking happens. The log is a log.

    So if somebody else is brave enough to experiment further or if the OP explains things, I would be happy.

    EDIT:
    The app also appears in the app drawer and clicking it has the same effect as from Xposed.