diff --git a/src/native/libs/System.Security.Cryptography.Native.Android/CMakeLists.txt b/src/native/libs/System.Security.Cryptography.Native.Android/CMakeLists.txt index f87db8a8c75b6..a277d5df3e5bd 100644 --- a/src/native/libs/System.Security.Cryptography.Native.Android/CMakeLists.txt +++ b/src/native/libs/System.Security.Cryptography.Native.Android/CMakeLists.txt @@ -33,7 +33,7 @@ set(NATIVECRYPTO_SOURCES add_library(System.Security.Cryptography.Native.Android SHARED - ${NATIVECRYPTO_SOURCES} pal_jni_onload.c + ${NATIVECRYPTO_SOURCES} ${VERSION_FILE_PATH} ) diff --git a/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.c index ee31a3ac58d64..243dbd1d9466d 100644 --- a/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.c +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.c @@ -689,10 +689,11 @@ int GetEnumAsInt(JNIEnv *env, jobject enumObj) return value; } -jint AndroidCryptoNative_InitLibraryOnLoad (JavaVM *vm, void *reserved) +JNIEXPORT jint JNICALL +JNI_OnLoad(JavaVM *vm, void *reserved) { (void)reserved; - LOG_DEBUG("%s in %s", __PRETTY_FUNCTION__, __FILE__); + LOG_INFO("JNI_OnLoad in pal_jni.c"); gJvm = vm; JNIEnv* env = GetJNIEnv(); diff --git a/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.h b/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.h index 5f7d7c002c414..79bc888224629 100644 --- a/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.h +++ b/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni.h @@ -605,11 +605,6 @@ jfieldID GetField(JNIEnv *env, bool isStatic, jclass klass, const char* name, co jfieldID GetOptionalField(JNIEnv *env, bool isStatic, jclass klass, const char* name, const char* sig) ARGS_NON_NULL_ALL; JNIEnv* GetJNIEnv(void); -// This is supposed to be called by embedders who link the **static** archive of this library. -// The function must be called from the embedder's `JNI_OnLoad` function prior to using any -// APIs in this library. -jint AndroidCryptoNative_InitLibraryOnLoad (JavaVM *vm, void *reserved); - int GetEnumAsInt(JNIEnv *env, jobject enumObj) ARGS_NON_NULL_ALL; void* xmalloc (size_t size) __mallocfunc __BIONIC_ALLOC_SIZE(1) __wur; diff --git a/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni_onload.c b/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni_onload.c deleted file mode 100644 index e2ecc9f3b8aa5..0000000000000 --- a/src/native/libs/System.Security.Cryptography.Native.Android/pal_jni_onload.c +++ /dev/null @@ -1,10 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -#include "pal_jni.h" - -JNIEXPORT jint JNICALL -JNI_OnLoad(JavaVM *vm, void *reserved) -{ - return AndroidCryptoNative_InitLibraryOnLoad (vm, reserved); -}