PAGalaxyLab / YAHFA

Yet Another Hook Framework for ART
GNU General Public License v3.0
1.56k stars 350 forks source link

Cannot hook private/hidden API #166

Open vegedreamgagnoa opened 2 years ago

vegedreamgagnoa commented 2 years ago

It's weird. I tried to hook android.view.WindowManagerGlobal#getInstance method on an x86_64 Android Emulator (API 28/Android 9) as a sample and YAHFA reported that the hook and backup done, but actually the method was not hooked. Hooking non-private/non-hidden API was not a problem!

Could you help? Pine and Whale works great in this case (both can easily work with Private/Hidden API/Class); I don't see why YAHFA is failing in this one.

vegedreamgagnoa commented 2 years ago

More info:

I tried to hook VMDebug#dumpHprofData which is a private class/API marked with @hide, and it works fine with YAHFA.

Seems like the problem is hooking hidden virtual methods!!!!