diff --git a/android/CMakeLists.txt b/android/CMakeLists.txt new file mode 100644 index 0000000..d31c90c --- /dev/null +++ b/android/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.6) +project(flutter_openssl_crypto) +find_package(openssl REQUIRED CONFIG) +add_library(${PROJECT_NAME} SHARED empty.c) +target_link_libraries(${PROJECT_NAME} PRIVATE openssl::crypto) diff --git a/android/build.gradle b/android/build.gradle index e268f2e..71cab22 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -32,9 +32,26 @@ android { } defaultConfig { minSdkVersion 16 + + externalNativeBuild { + cmake { + arguments "-DANDROID_STL=c++_shared" + } + } + } + + externalNativeBuild { + cmake { + path "CMakeLists.txt" + } + } + + buildFeatures { + prefab true } } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" + implementation "com.android.ndk.thirdparty:openssl:1.1.1g-alpha-1" } diff --git a/android/empty.c b/android/empty.c new file mode 100644 index 0000000..e69de29 diff --git a/ios/flutter_openssl_crypto.podspec b/ios/flutter_openssl_crypto.podspec index 308bb0b..8f96256 100644 --- a/ios/flutter_openssl_crypto.podspec +++ b/ios/flutter_openssl_crypto.podspec @@ -20,4 +20,6 @@ A new flutter plugin project. # Flutter.framework does not contain a i386 slice. s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } s.swift_version = '5.0' + + s.dependency 'OpenSSL-Universal' end