在原生Android应用程序中使用libssl.so [英] using libssl.so in native Android app
问题描述
我为Android编写一个本地库(mylib.so),使用NDK。 Mylib.so取决于libssl.so。
I'm writing a native lib (mylib.so) for Android, using the NDK. Mylib.so depends on libssl.so.
而Android NDK的文档告诉我,我不应该从系统的/ lib目录libssl.so使用,因为它不是稳定的API的一部分。相反,我应该交叉编译的libssl自己,把它添加到NDK。
The Android NDK doc tells me I shouldn't use libssl.so from system/lib, because it's not part of the stable API. Instead I should cross-compile libssl myself and add it to the NDK.
但我看到mylib.so都会自动与系统连接的/ lib目录/ libssl.so因为Dalvik虚拟机(这是加载mylib.so)已经依赖于libssl.so。
But I see that mylib.so get automatically linked with system/lib/libssl.so because the dalvik vm (which is loading mylib.so) already depends on libssl.so.
$ readelf -d /system/bin/dalvikvm | grep Shared
0x00000001 (NEEDED) Shared library: [libdvm.so]
0x00000001 (NEEDED) Shared library: [libssl.so]
0x00000001 (NEEDED) Shared library: [libz.so]
0x00000001 (NEEDED) Shared library: [libc.so]
0x00000001 (NEEDED) Shared library: [libstdc++.s
0x00000001 (NEEDED) Shared library: [libm.so]
那么,什么是处理这个正确的方式?使用系统/ lib目录/ libssl.so呢?
So what is the correct way to deal with this? Using system/lib/libssl.so anyway?
感谢
推荐答案
您可以在以下网站下载:
http://www.mediafire.com/download/njyqyxu3nxm/tcpdump.zip
You can download it on the following site: http://www.mediafire.com/download/njyqyxu3nxm/tcpdump.zip
这篇关于在原生Android应用程序中使用libssl.so的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!