Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

CarlisleChan/gmssl_for_android

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

GmSSL for Android

环境:

  • macOS 10.15.6
  • AndroidStudio 4.0.1
  • NDK 21.3.6528147

编译

cd tools
# 记得修改 build-android-common 中 ANDROID_HOME 和 ANDROID_NDK_ROOT
./build-android-gmssl.sh

使用(静态依赖)

拷贝 out 下各平台下的 lib 中 的 .a 文件到 android 项目中的 libs 文件夹下

拷贝 include/openssl 到 android 项目中的 cpp

CMake

定义 ssl, crypto 作为 STATIC IMPORTED libraries

add_library(crypto STATIC IMPORTED)
set_target_properties(crypto PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libcrypto.a)

add_library(ssl STATIC IMPORTED)
set_target_properties(ssl PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/libs/${ANDROID_ABI}/libssl.a)

添加库关联

target_link_libraries( # Specifies the target library.
                       native-lib
                       ssl
                       crypto
                       )

具体可参考 GmSSLDemo

其他

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published