Compile OpenSSL to different name due to Android Zygote

亡梦爱人 提交于 2019-12-02 07:57:54

问题


I can build openssl-1.0.2j successfully for android (libcrypto.so and libssl.so) using GitHub stdchpie/android-openssl:

  • Environment: Linux OS, (my case I use Mac OS)

  • Android NDK: 12b

On Android 5.x if using:

System.loadLibrary("crypto");
System.loadLibrary("ssl");

It will get conflict with native OS libs which also have same names. And unluckily, manually change their names didn't work. So that I want to compile them into different names , like libcryptox.so and libsslx.so

I try to play with Makefile.org all day but not lucky. So please someone tell me how to do.


回答1:


The system has those libs loaded in the run-time environment, you can't use the System.loadLibrary

You can make small ndk code that will use native dload for those libs. And eventually, I think its best to use the ssl api's through the common android API as you never know what they will do next version.



来源:https://stackoverflow.com/questions/39830507/compile-openssl-to-different-name-due-to-android-zygote

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!