Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] Don't include JNI_OnLoad in libSystem.Security.Cryptography.Native.Android.a #103231

Merged
merged 7 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ set(NATIVECRYPTO_SOURCES

add_library(System.Security.Cryptography.Native.Android
SHARED
${NATIVECRYPTO_SOURCES}
${NATIVECRYPTO_SOURCES} pal_jni_onload.c
${VERSION_FILE_PATH}
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -689,11 +689,10 @@ int GetEnumAsInt(JNIEnv *env, jobject enumObj)
return value;
}

JNIEXPORT jint JNICALL
JNI_OnLoad(JavaVM *vm, void *reserved)
jint AndroidCryptoNative_InitLibraryOnLoad (JavaVM *vm, void *reserved)
{
(void)reserved;
LOG_INFO("JNI_OnLoad in pal_jni.c");
LOG_DEBUG("%s in %s", __PRETTY_FUNCTION__, __FILE__);
gJvm = vm;

JNIEnv* env = GetJNIEnv();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,11 @@ 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);
akoeplinger marked this conversation as resolved.
Show resolved Hide resolved

int GetEnumAsInt(JNIEnv *env, jobject enumObj) ARGS_NON_NULL_ALL;

void* xmalloc (size_t size) __mallocfunc __BIONIC_ALLOC_SIZE(1) __wur;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// 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"
grendello marked this conversation as resolved.
Show resolved Hide resolved

JNIEXPORT jint JNICALL
JNI_OnLoad(JavaVM *vm, void *reserved)
{
return AndroidCryptoNative_InitLibraryOnLoad (vm, reserved);
}
Loading