简体   繁体   English

由于 Android Zygote,将 OpenSSL 编译为不同的名称

[英]Compile OpenSSL to different name due to Android Zygote

I can build openssl-1.0.2j successfully for android (libcrypto.so and libssl.so) using GitHub stdchpie/android-openssl :我可以使用GitHub stdchpie/android-openssl为 android(libcrypto.so 和 libssl.so)成功构建 openssl-1.0.2j :

  • Environment: Linux OS, (my case I use Mac OS)环境:Linux OS,(我的情况我使用Mac OS)

  • Android NDK: 12b安卓 NDK:12b

On Android 5.x if using:在 Android 5.x 上,如果使用:

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所以我想把它们编译成不同的名字,比如 libcryptox.so 和 libsslx.so

I try to play with Makefile.org all day but not lucky.我试着整天玩 Makefile.org 但不走运。 So please someone tell me how to do.所以请有人告诉我该怎么做。

The system has those libs loaded in the run-time environment, you can't use the System.loadLibrary系统在运行时环境中加载了那些库,您不能使用 System.loadLibrary

You can make small ndk code that will use native dload for those libs.您可以制作小型 ndk 代码,这些代码将对这些库使用本机 dload。 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.最终,我认为最好通过通用的 android API 使用 ssl api,因为你永远不知道他们下一个版本会做什么。

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

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