Building OpenSSL on Android NDK
Asked Answered
M

3

9

I want to use DTLS (on OpenSSL) using JNI on Android 2.1/2.2.

Can someone help me get started (tutorials, howto, pointers etc) with building OpenSSL for Android (2.1/2.2) using the Android NDK?

Anything important that I should be aware of before doing it.

Thanks.

Meng answered 1/6, 2010 at 19:17 Comment(1)
Many carriers allow UDP from the device, but block UDP to the device. In the US, I have confirmed the behavior with AT&T, Sprint, and Verizon. Be sure that's want you want and the behavior is what you expect.Tamtama
H
13

I guess you don't need help with basic building of programs and OpenSSL.

For specifics of Android and OpenSSL, take a look at Fries's GitHub repository called android-external-openssl.

Take a look especially at README located here: http://github.com/fries/android-external-openssl/blob/master/README.android

There you have step by step instructions on how to build OpenSSL on Android.

Harlen answered 29/6, 2010 at 23:56 Comment(3)
What is the difference between the android-external-openssl repository and checking out the android openssl package directly? android.git.kernel.org/?p=platform/external/…Stenographer
android openssl is part of the (core) system. In some cases you want to have other OpenSSL than the system one(need another version or crypto which is not supported by default) and android-external-openssl helps you build it yourself.Harlen
@MichaelDonohue broken link, maybe android.googlesource.com/platform/external/openssl ?Foxhound
I
9

I've just finished a new fork of the current official Android openssl and got it building with ndk-build from NDKr5b. I tried to make it as easy as possible to build. It doesn't build the ARMv4 assembly stuff yet, it was failing, so any help with that would be most appreciated. Here's the git repo:

https://github.com/eighthave/openssl-android

just run ndk-build in openssl-android, and you should have libs/armeabi/libcrypto.so and libs/armeabi/libssl.so

EDIT: There is a new link for the latest version of this project:

https://github.com/guardianproject/openssl-android

Infinitude answered 10/2, 2011 at 19:23 Comment(2)
Doesn't work: Android NDK: Your APP_BUILD_SCRIPT points to an unknown file: /home/michael/android_dev/openssl/jni/Android.mk /opt/android-ndk-r5b/build/core/add-application.mk:116: *** Android NDK: Aborting.... Stop.Levesque
I can't really tell what the error is from your post, but my guess is your NDK install is not complete. add-application.mk definitely should be there.Infinitude
S
0

1.0.1s OpenSSL NDK, building it now, after received warning from Google. Here You go,

https://github.com/edwardlujunneng/openssl_android_build

It's not my repository, but I found it useful for anyone who will some day come here and look for it.

Silo answered 8/4, 2016 at 8:10 Comment(1)
compiled it using NDK 11c. the biggest problem was that somebody forgot to add #include "" before file path to header files in include/openssl/*Silo

© 2022 - 2024 — McMap. All rights reserved.