You should keep in mind that not every .so
file is useful for ndk-stack
. Android NDK produces two kinds of .so
files: stripped and non-stripped. The most difference is that last ones contain debug information, that is needed for ndk-stack
and first ones don't. readelf
may help to check if particular file is stripped or not:
$ readelf <non-stripped-lib> -S | grep debug
[23] .debug_info PROGBITS 00000000 00302c 0052d9 00 0 0 1
[24] .debug_abbrev PROGBITS 00000000 008305 000879 00 0 0 1
[25] .debug_loc PROGBITS 00000000 008b7e 001aa7 00 0 0 1
[26] .debug_aranges PROGBITS 00000000 00a628 000088 00 0 0 8
[27] .debug_ranges PROGBITS 00000000 00a6b0 0000d0 00 0 0 1
[28] .debug_line PROGBITS 00000000 00a780 0009de 00 0 0 1
[29] .debug_str PROGBITS 00000000 00b15e 002387 01 MS 0 0 1
[30] .debug_frame PROGBITS 00000000 00d4e8 0003d0 00 0 0 4
$
$ readelf <stripped-lib> -S | grep debug
$
As you see not-stripped ELF has a lot of .debug_*
sections, that indeed contain line numbers, private / static function names, etc.
Next, .aar
files, both debug and release ones, has only stripped binaries. So they are useless for ndk-stack
.
AFAIK, the only place where non-stripped binaries may be found is a obj/
dir. Its location depends slightly on used build system:
- for
ndk-build
it is under <module_name>/build/intermediates/ndk
- for
CMake
-based it is under <module_name>/build/intermediates/cmake
Also it looks like out-of-the-box android gradle plugin offers no way to pack unstripped libraries to your aar
, so the only way here is some custom task in your build.gradle
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…