Search code examples
androidandroid-ndkandroid-4.2-jelly-beanld-preload

Android 4.2 - LD_PRELOAD supported or not?


I wonder if LD_PRELOAD is now supported with the newer Android-versions?

At the time of 4.0 ICS it wasn't, and in the documentation (NDK docs/SYSTEM-ISSUES.html) there's still:

No support for LD_LIBRARY_PATH, LD_PRELOAD, RTLD_LOCAL and many other options.

But some days ago I have used LD_LIBRARY_PATH on my Android 4.2 Galaxy Nexus and it worked (!).

Thanks in advance!


Solution

  • Generally speaking, LD_LIBRARY_PATH has worked on engineering builds (a.k.a. rooted devices) for quite a while. The problem is that this does not help for production builds - not because the loader is changed, but because the environment for your app is secured.