XposedBridge icon indicating copy to clipboard operation
XposedBridge copied to clipboard

Share data between module and my application.

Open DoodleWing opened this issue 6 years ago • 4 comments

When I' ve hooked a calling of a method, I want to send a message to my main application to show a notification or a toast to make users notified. How could I do it? I don't know how to share data between my hook module and my main application because the module runs in processes where hooked method runs. Sorry for my poor English XD

DoodleWing avatar May 19 '18 09:05 DoodleWing

One of the alternatives is to create a service within your main app. You can then bind to such service from a foreign app and tell it what to do. https://developer.android.com/guide/components/bound-services Using Messenger approach would be enough in this case.

C3C0 avatar May 21 '18 12:05 C3C0

The way I solved it is using Intents. Create a BroadcastReceiver in your main application and make your module send an Intent to it with the data you want to show.

voider1 avatar May 26 '18 00:05 voider1

I' ve worked it out, thanks a lot! Here comes another problem. Is sharedPreference being set as MODE_WORLD_READABLE absolutely needed? I couldn' t perform it on Android N.

DoodleWing avatar May 27 '18 06:05 DoodleWing

I' ve worked it out, thanks a lot! Here comes another problem. Is sharedPreference being set as MODE_WORLD_READABLE absolutely needed? I couldn' t perform it on Android N.

you got solution??

Android1500 avatar Feb 07 '21 20:02 Android1500