Git Product home page Git Product logo

curl_and_busybox's Introduction

openssl-curl-android

Compiles curl (and dependencies - zlib, openssl ) for Android

Thanks to Zackptg5

https://github.com/Zackptg5/Curl-for-Android-Build-Script

https://github.com/Zackptg5/curl-boringssl-android

Prerequisites

Linux

And also necessary autoconf and libtool toolchains.

Download

If you do not want to compile them yourself, you can download pre-compiled static libraries from releases. They are in build.tar.gz.

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 https://github.com/liwenjie119/openssl-curl-android.git
git submodule update --init --recursive

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)

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

or

./build1.sh ARCH=<ARCH>

All compiled libs are located in build directory.

Options

Change scripts' configure arguments to meet your requirements.

For now, using tls (https) in Android would throw peer verification failed.

If using libcurl, explicitly set curl_easy_setopt(curl, CURLOPT_CAINFO, CA_BUNDLE_PATH); where CA_BUNDLE_PATH is your ca-bundle in the device storage. If using curl binary, change the --with-ca-bundle flag in build-curl.sh to the path/name of the cacert file you'll be placing

You can download and copy cacert.pem to the internal storage to get tls working for libcurl.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.