PAGalaxyLab / YAHFA

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

Hooking ActivityThread#attach(boolean) failed in system_server process. #90

Closed solohsu closed 5 years ago

solohsu commented 5 years ago

2018-12-31 13:49:20.408 1363-1363/? E/YAHFA-Native: mmap failed, errno = 13 2018-12-31 13:49:20.408 1363-1363/? E/YAHFA-Native: cannot hook method

I am trying to hook method ActivityThread#attach(boolean), in normal app process everything is ok, but in system_server process, mmap failed with errno 13 (EACCES).

solohsu commented 5 years ago

I have solved this. It turns out the SELinux disallow executable memory usage in system_server process, setting SELinux mode to permissive or allowing execmem for system_server should do the trick. http://androidxref.com/8.1.0_r33/xref/system/sepolicy/private/system_server.te#755

ov3rf1ow commented 2 years ago

Hey, i am unable to find classes in system_server to hook, can you help me with it.