ZSShen / ProbeDroid

A SDK for the creation of analysis tools without obtaining app source code in order to profile runtime performance, examine code coverage, and track high-risk behaviors of a given app on Android 5.0 and above.
MIT License
196 stars 37 forks source link

Cannot hook Android APIs in Android 8 #8

Open Angelawj60311 opened 6 years ago

Angelawj60311 commented 6 years ago

I try to use your approach to hook some Android APIs in Android 8. I have made some version adjustment. But the Android API cannot be hooked successfully after entry_point_from_quick_compiledcode is modified to be ArtQuickInstrumentTrampoline. Before hooking, I checked the value of entry_point_from_quick_compiledcode in an ArtMethod and found it points to art_quick_to_interpreter_bridge which could mean that my system is running in interpreter mode. Do you know how to solve the problem?

Rprop commented 6 years ago

it seems that you are running in force-interpreter-only mode, in which case ArtMethod's entry_point_from_quick_compiledcode will not be used unless the ArtMethod is native or called outside the interpreter. so, an idea is to make the ArtMethod native.