Skip to content
Compile curl and dependencies for Android
Shell
Branch: master
Clone or download
Pull request Compare This branch is 11 commits ahead of robertying:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
boringssl @ cb3f04f
brotli @ c435f06
c-ares @ e982924
curl @ 2e9b725
libexpat @ ed34842
libmetalink @ 5bcdfc0
libpsl @ 1eaf180
libssh2 @ 96bbefb
nghttp2 @ cc05c5f
openssl @ 4e3ee45 Fix openssl submodule Dec 14, 2019
zlib @ cacf7f1
.gitignore
.gitmodules
LICENSE
README.md
build-modules.sh
build.sh
local-configure.patch

README.md

curl-boringssl-android

Compiles curl (and dependencies ) for Android

Dynamic linking (default) has most features, static has some removed due to various issues/incompatibilities

Prerequisites

Linux

autoconf,libtool,go,ninja

Download

If you do not want to compile them yourself, you can download pre-compiled static binaries from Unity-Addons External-Tools.
Dynamic ones with required libs can be found here in this unity mod. Just zip the contents of it and flash.
Doing your own compilation is recommended, since the pre-compiled binary can become outdated soon.

Update git submodules to compile newer versions of the libraries:

cd submodule_directory
git checkout LATEST_STABLE_TAG
cd ..

Usage

bash
git clone --recurse-submodules https://github.com/Zackptg5/openssl-curl-android.git

Optional: Update git submodules to compile newer versions of the libraries:

cd submodule_directory
git checkout LATEST_STABLE_TAG
cd ..

Edit build.sh script:

NDK=android_ndk_version_you_want_to_use
export HOST_TAG=see_this_table_for_info # https://developer.android.com/ndk/guides/other_build_systems#overview
export MIN_SDK_VERSION=21 # or any version you want (dependent on the ndk version - keep 21 if in doubt)
export STATIC=false #Change to true for static binary - note that there will be less features then with dynamic
export ARCH="arm arm64 x86 x64" # Remove ones you don't want to compile

Run build script

chmod +x ./build.sh
./build.sh

All compiled libs are located in build directory.

Options

Change scripts' configure arguments to meet your requirements.

Note that https has been fixed now in Android so the peer verification failed message no longer occurs. The solution was to set --with-ca-path=/system/etc/security/cacerts configure flag and to use boringssl instead of openssl

Issues

Curl has weird DNS error in Android Q when not run as superuser

Working Example

Checkout this repo to see how to integrate compiled static libraries into an existing Android project, including Android.mk setup and JNI configurations.

Credits of Originality:

This is a fork of the original here: https://github.com/robertying/openssl-curl-android

You can’t perform that action at this time.