crmulliner / adbi

Android Dynamic Binary Instrumentation Toolkit
http://www.mulliner.org/android
1.25k stars 418 forks source link

did you have plan to support android-l art runtime? #8

Open hwjump opened 9 years ago

hwjump commented 9 years ago

Great project. But I found it can't run on art runtime while google have released android-l which change it's runtime---“art”,so I want to know did you have plan to support android-l? Thank you very much!

t0kt0ckus commented 9 years ago

I think you're referring to the DDI project, as the move from Dalvik to ART should not break ADBI's binary injection/hooking, which takes place in the native layer. Actually, ART breaks the Dalvik level hooking provided by DDI. But you can still use ADBI to inject native code, and from there use JNI to create a class loader that loads a DEX file, so "Java" code injection is also still possible. I think that with ART, we'll only miss "Java" level hooking, until someone find a hack.

scintill commented 9 years ago

I just added support for ART to my injectable class loader here. Loading only, not hooking. You can search-and-replace the dex file names and class names, and it should automatically work with both Dalvik and ART. It does not invoke any methods or constructors, so you will want to do that in a class static variable initialization, or static {} code block.

I've tested on CyanogenMod 11 with ART and Dalvik. I did a little bit of testing with CM 12, but ran into some issues on the native side, so I don't have confirmation it works there.