Skip to content

boringssl static library prefab for android

Notifications You must be signed in to change notification settings

tehcneko/BoringSSL_Android

 
 

Repository files navigation

BoringSSL Android

boringssl static library prefab for android

This library is based on the boringssl AOSP repo.

Integration

Gradle:

implementation("io.github.vvb2060.ndk:boringssl:5.0")
// or LTO version (~35MiB), it does not strip any debug info
implementation("io.github.vvb2060.ndk:boringssl:5.0-lto-ndk27")

This library is Prefab, so you will need to enable it in your project (Android Gradle Plugin 4.1+):

android {
    ...
    buildFeatures {
        ...
        prefab = true
    }
}

Usage

ndk-build

you can use crypto_static/ssl_static in your Android.mk. For example, if your application defines libapp.so and it uses ssl_static, your Android.mk file should include the following:

include $(CLEAR_VARS)
LOCAL_MODULE           := app
LOCAL_SRC_FILES        := app.cpp
LOCAL_STATIC_LIBRARIES := ssl_static
include $(BUILD_SHARED_LIBRARY)

# If you don't need your project to build with NDKs older than r21, you can omit
# this block.
ifneq ($(call ndk-major-at-least,21),true)
    $(call import-add-path,$(NDK_GRADLE_INJECTED_IMPORT_PATH))
endif

$(call import-module,prefab/boringssl)

CMake

you can use crypto_static/ssl_static in your CMakeLists.txt. For example, if your application defines libapp.so and it uses crypto_static, your CMakeLists.txt file should include the following:

add_library(app SHARED app.cpp)

# Add these two lines.
find_package(boringssl REQUIRED CONFIG)
target_link_libraries(app boringssl::crypto_static)

Changelog

About

boringssl static library prefab for android

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Starlark 63.2%
  • CMake 16.5%
  • Makefile 15.1%
  • Java 4.2%
  • Other 1.0%