0

The Android system provides a default libc.so, and it will be loaded automatically in every app.

Now I just want to change the libc.so's function abs(), say, I want abs(any_number) always returns 0; and the other functions are same as the original libc.so's.

The easiest way is modifying the abs() function body of libc project, and rebuilding the modified project. The output is also named libc.so, and embedded in the APK.

Is this way possible?

The Android App launcher will first load the embedded libc.so if any?

xmllmx
  • 39,765
  • 26
  • 162
  • 323
  • 1
    "Is this way possible?" -- I highly doubt it. The zygote process will have already loaded `libc` at boot time, and app processes are forked off of the zygote. "it will be loaded automatically in every app" -- no, it is automatically loaded by the zygote. – CommonsWare Jun 12 '16 at 11:49
  • Yes it's quite possible, see http://stackoverflow.com/a/10395889/192373 – Alex Cohn Jun 12 '16 at 13:04

0 Answers0