From 5dd25f04ef6653acbb84d1ce97d8629ae82fd996 Mon Sep 17 00:00:00 2001 From: Vasily Litvinov Date: Mon, 7 Apr 2014 23:25:57 +0400 Subject: [PATCH] Ignoring requests to load native conscrypt_jni library - it's linked statically --- src/classpath-android.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/classpath-android.cpp b/src/classpath-android.cpp index 94ca59b9e7..61984b0d56 100644 --- a/src/classpath-android.cpp +++ b/src/classpath-android.cpp @@ -59,7 +59,13 @@ loadLibrary(Thread* t, object, uintptr_t* arguments) THREAD_RUNTIME_ARRAY(t, char, n, length + 1); stringChars(t, name, RUNTIME_ARRAY_BODY(n)); - loadLibrary(t, "", RUNTIME_ARRAY_BODY(n), true, true); + /* org_conscrypt_NativeCrypto.o is linked statically, and in Avian build + the package is named org.conscrypt.NativeCrypto. When Android code sees + that name it thinks the library isn't linked as a part of Android, so it + tries to load in dynamically, but there's actually no need to, so we + just ignore this request. */ + if (strcmp(RUNTIME_ARRAY_BODY(n), "conscrypt_jni") != 0) { + loadLibrary(t, "", RUNTIME_ARRAY_BODY(n), true, true); } void JNICALL