Android 4.2 - LD_PRELOAD is supported or not?
I wonder if LD_PRELOAD is supported by newer Android versions?
During 4.0 ICS this was not the case, and the documentation (NDK docs / SYSTEM-ISSUES.html) also has:
No support for LD_LIBRARY_PATH, LD_PRELOAD, RTLD_LOCAL and many other options.
But a few days ago I used LD_LIBRARY_PATH on my Android 4.2 Galaxy Nexus and it worked (!).
Thanks in advance!
+3
source to share
2 answers
Although the official NDK-r9d documentation still says the same thing, it turns out that LD_PRELOAD does work on rooted devices. Run
adb shell
setprop wrap.com.xyz.yourapp LD_PRELOAD=/path/to/your/library.so
stop
start
after clicking library to device. I tried this on ANDROID-19 emulator to provide an alternative function definition.
Check out this link - http://cedricvb.be/post/intercepting-android-native-library-calls/
+5
source to share