XposedTools
XposedTools copied to clipboard
Integrating Xposed to AOSP source tree
I'd need to integrate/merge Xposed to AOSP source tree such that when I issue make
at the AOSP root, it creates system.img
shipping Xposed framework out-of-the-box.
Current installation steps kinda patches an existing non-Xposed image and makes it Xposed installed (via update-binaries
scripts).
Could you please point me out to the way I could approach my goal?
I haven't tried this myself, and I'm not planning to support pre-installed Xposed officially. However, the installation scripts are open source, so you can check what they do. Feel free to document your progress here.
To build a pre-installed Xposed ROM, I can think of two different approaches: (assuming Android 5+)
Approach 1
- Replacing
frameworks/base/cmds/app_process
byxposed
and change allLOCAL_MODULE
toapp_process
. This will build the modifiedapp_process
and put it in the right place. - Replacing
art
with the modifiedart
. (LOCAL_MODULE
s don't need to change) - Creating a prebuilt Jar subproject in
prebuilts/misc/common/XposedBridge
to copy theXposedBridge.jar
in the right place.
Approach 2
- Without touching the original
app_process
, git cloning thexposed
inframeworks/base/cmds/xposed
. (exactly like Xposed official docs suggest) - Without touching the original
art/
, git cloning theandroid_art
inart_exposed/
and change all make files to generate binaries with_xposed
at the end of their names. e.g.libart_xposed.so
,dex2oat_xposed
and so forth. - That prebuilt XposedBridge.jar subproject (exactly like the first approach's)
- Change the source tree make files to replace original art binaries with Xposed binaries (having names ending in
_xposed
) right beforesystem.img
is being packed.
I tried the first one, but unfortunately the modified host dex2oat
(not sure maybe something else) malfunctions and lots of errors show up. So, I'm heading for the second one.
@rovo89
Q1: In your opinion which approach is better?
Q2: With approach 2, I don't know which make files should be changed. Could you please help me to get this done?
I think I'd try to follow the official docs as close as possible, i.e. check out xposed
to frameworks/base/cmds/xposed
and android_art
to art
, and then have some special make file which puts the files in the same places as the official installation script does. Ideally, you'd end up with a ROM that looks exactly like your base ROM after installation the official ZIP.
I tried this way, but checking out android_art
to art
is the source of many problems I think. The issue I've linked to in my previous post is because of this.
My only feeling on the matter is that the host dex2oat
built by android_art
fails during the make process. Here's one of those errors shown up for me: https://github.com/rovo89/android_art/issues/64#issuecomment-307718646
So, that's why I decided to switch to the second way. However since you have a pretty good insight on how Xposed works and compiles, could you please test this way yourself and let us know the result?
Thank you @rovo89
No sorry, I'll have to stop here. I don't have any time to try to compile a ROM this way, nor to investigate why it might fail. If you want to do this, feel free to do so, that's one of the nice things of open source. But you'll have to analyze and fix the errors yourself.