I have an android app written in kotlin with a C++ native library (.so). With crashlytics we are able to obfuscate kotlin methods and yet obtain symbolicated crash reports, is it possible to have the same for the native library? Currently I have to choose either to build the C++ library with -fvisibility=hidden and have my function names obfuscated (not visible if I run nm -gDC <.so library packaged with the apk>), or to have my function names visible in the .so file and obtain symbolicated crash reports. Can I have an obfuscated .so file packaged with my app and yet get a symbolicated crash report for crashes within the native library?
This answer seems to imply that I cannot have it all.
You can't have it all in one file, so use two: Build your APK, but maintain two separate versions of the .so: One fully symbolicated, which you keep, and another, which you pass through the strip(1) command, with all symbols removed, to package with the APK. This removes the symbols, but does not change the addresses.
When you get a tombstone/crash report, it will initially contain only addresses in your library - since when running in your APK, it will have no symbols. The addresses, however, will be easily resolvable by you, and you can build a small script to pass the tombstone through addr2line and get more meaningful insights.