rovo89 / XposedBridge

The Java part of the Xposed framework.
3.91k stars 1.1k forks source link

Loading XposedBridge.jar from App instead of App_Process #85

Closed mariaqur closed 8 years ago

mariaqur commented 8 years ago

[Question] Hi, I am trying to start XposedBridge.jar from my own app for some research purposes. The module and target app, both will reside inside my project. And I am not planning to hook other apps' methods.

My Target :

I need your suggestion in this regard. And please also tell me how can I compile modified XposedBridge with native code ( without app_process modifications ).

Thanks :)

rovo89 commented 8 years ago

We can make this very short: You can't used XposedBridge without the native parts (app_process, modified ART libraries).

It's a bit like asking taking the seats from your car, putting them into your living room and expecting that you can drive with them. The critical parts of Xposed are in native code, it's not just there to call the main method... Sure, you could try to port all that code to a JNI modules. There even seem to be attempts to do this: https://github.com/alibaba/dexposed For Dalvik, this might be relatively successful, as it's mostly functional (vs. object-oriented) and was left pretty much unchanged for all 4.x versions. However, ART is very object-oriented, very optimized, many vendors and ROM makers do their changes, ... and if you try to change data structures there, you have to invest much work just to get it working on one device. Making it compatible with various platforms, ROMs, Android versions is impossible. That's why I decided to replace the ART libraries. It gives me a known environment, I can influence how AOT compilation is done, and even though there are issues with various vendor-specific stuff, I believe it's the only feasible way.