I want to be able to post notifications, show toasts, and start/stop services from my Xposed module, to do that I need a Context
. Does my Xposed module have it's own Context? If not, can I get one by hooking into another process? Which process would I want to hook into?
The Xposed Module in itself is installed as an application, so you can add activities and retrieve the context like in any normal application.
It depends on where you want to launch the Toast messages. As you seem to know, every application runs on its own process (and VM) and each process/app has its own copy of your Xposed module classes.
If you built your Xposed module with activities, then you can retrieve the context (e.g. retrieving context) normally within your xposed app.
BUT, since these activities are running within their own process (installed xposed module), this context will not be accessible in other apps running a copy of your Xposed module code.
So, in applications you are actually hooking (the ones you handle in "handleLoadPackage"), you can always hook Activity or broadcast receivers methods to retrieve their context (check this).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With