简体   繁体   English

Android NDK:覆盖本机库的动态链接?

[英]Android NDK: override dynamic linking for native libraries?

I have an application that uses some native libraries through .SO files. 我有一个通过.SO文件使用一些本机库的应用程序。

I'm in a situation where I can't upload a new version of the app to Google play because those native libraries link to old versions of OpenSSL and LibPNG which have security vulnerabilities as described here: https://android-developers.blogspot.com.eg/2016/06/android-changes-for-ndk-developers.html 我无法将新版本的应用程序上传到Google Play,因为这些本机库链接到旧版本的OpenSSL和LibPNG,这些版本存在安全漏洞,如下所述: https://android-developers.blogspot .com.eg / 2016/06 / Android的变化换NDK-developers.html

My question is: is there any way to include the .SO files in a new project, along with the new versions of OpenSSL and LibPNG and override the linking to the old versions of OpenSSL and LibPNG? 我的问题是:有没有办法在新项目中包含.SO文件,以及OpenSSL和LibPNG的新版本,并覆盖到旧版本的OpenSSL和LibPNG的链接?

Knowing that I can't rebuild the .SO files because I don't have the source files. 知道我无法重建.SO文件,因为我没有源文件。

Is there any workaround for solving this? 解决这个问题有什么解决方法吗?

If you lost access to the source code of your library, but have the .o files (or the .a archive), you can choose a different version of dependencies. 如果您无法访问库的源代码,但拥有.o文件(或.a存档),则可以选择不同版本的依赖项。

If you use OpenSSL and libPNG as dynamic libraries, your life is easier. 如果您使用OpenSSL和libPNG作为动态库,您的生活将更加轻松。 If you have them statically linked into your .so file, you need some advanced ELF manipulation techniques which may help if you are lucky and determined. 如果你将它们静态链接到你的.so文件中,你需要一些先进的ELF操作技术 ,如果你很幸运并且有所帮助,这些技术可能会有所帮助。

All this can only work if the interfaces that you use to these libraries remain untouched. 所有这些只有在您用于这些库的接口保持不变时才能工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM