diff --git a/build-tools/scripts/generate-pinvoke-tables.sh b/build-tools/scripts/generate-pinvoke-tables.sh index 8b683650977..39eaf65eac7 100755 --- a/build-tools/scripts/generate-pinvoke-tables.sh +++ b/build-tools/scripts/generate-pinvoke-tables.sh @@ -3,7 +3,7 @@ MY_DIR="$(dirname $0)" HOST="$(uname | tr A-Z a-z)" NATIVE_DIR="${MY_DIR}/../../src/native" -MONODROID_SOURCE_DIR="${NATIVE_DIR}/monodroid" +MONODROID_SOURCE_DIR="${NATIVE_DIR}/pinvoke-override" GENERATOR_SOURCE="${MONODROID_SOURCE_DIR}/generate-pinvoke-tables.cc" GENERATOR_BINARY="${MONODROID_SOURCE_DIR}/generate-pinvoke-tables" TARGET_FILE="${MONODROID_SOURCE_DIR}/pinvoke-tables.include" diff --git a/src/native/CMakeLists.txt b/src/native/CMakeLists.txt index a62056514ca..afe07035bbe 100644 --- a/src/native/CMakeLists.txt +++ b/src/native/CMakeLists.txt @@ -145,7 +145,7 @@ file(REAL_PATH "../../" REPO_ROOT_DIR) set(EXTERNAL_DIR "${REPO_ROOT_DIR}/external") set(JAVA_INTEROP_SRC_PATH "${EXTERNAL_DIR}/Java.Interop/src/java-interop") set(LIBUNWIND_SOURCE_DIR "${EXTERNAL_DIR}/libunwind") - +set(ROBIN_MAP_DIR "${EXTERNAL_DIR}/robin-map") # # Include directories @@ -449,6 +449,7 @@ add_subdirectory(java-interop) add_subdirectory(xamarin-app-stub) add_subdirectory(runtime-base) add_subdirectory(tracing) +add_subdirectory(pinvoke-override) if(DEBUG_BUILD) add_subdirectory(xamarin-debug-app-helper) diff --git a/src/native/java-interop/CMakeLists.txt b/src/native/java-interop/CMakeLists.txt index 96510c4925f..bd142d4c1d0 100644 --- a/src/native/java-interop/CMakeLists.txt +++ b/src/native/java-interop/CMakeLists.txt @@ -37,10 +37,12 @@ target_compile_options( ${XA_COMMON_CXX_ARGS} ) -set_target_properties( - ${LIB_NAME} - PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -) +if(DEBUG_BUILD) + set_target_properties( + ${LIB_NAME} + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + ) +endif() xa_add_compile_definitions(${LIB_NAME}) diff --git a/src/native/libstub/CMakeLists.txt b/src/native/libstub/CMakeLists.txt index 16dc744ee95..70563594fc4 100644 --- a/src/native/libstub/CMakeLists.txt +++ b/src/native/libstub/CMakeLists.txt @@ -38,6 +38,7 @@ endmacro() xa_add_stub_library(c) xa_add_stub_library(m) +xa_add_stub_library(z) # These two are used by the marshal methods tracing library when linking libxamarin-app.so xa_add_stub_library(log) diff --git a/src/native/lz4/CMakeLists.txt b/src/native/lz4/CMakeLists.txt index fccd31776c8..75552bd5828 100644 --- a/src/native/lz4/CMakeLists.txt +++ b/src/native/lz4/CMakeLists.txt @@ -30,10 +30,12 @@ target_include_directories( "$" ) -set_target_properties( - ${LIB_NAME} - PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -) +if(DEBUG_BUILD) + set_target_properties( + ${LIB_NAME} + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + ) +endif() xa_add_compile_definitions(${LIB_NAME}) diff --git a/src/native/monodroid/CMakeLists.txt b/src/native/monodroid/CMakeLists.txt index 99c3aec2f54..e78ef196576 100644 --- a/src/native/monodroid/CMakeLists.txt +++ b/src/native/monodroid/CMakeLists.txt @@ -8,7 +8,7 @@ include(CheckCXXSymbolExists) # Paths set(BIONIC_SOURCES_DIR "${REPO_ROOT_DIR}/src-ThirdParty/bionic") -set(ROBIN_MAP_DIR "${EXTERNAL_DIR}/robin-map") +set(BUILD_STATIC_LIBRARY OFF) if(DEBUG_BUILD) # Convince NDK to really optimize our Debug builds. Without this, NDK's cmake toolchain definition @@ -17,6 +17,8 @@ if(DEBUG_BUILD) set(XA_COMPILER_FLAGS_DEBUG "-fno-limit-debug-info -O2") set(CMAKE_C_FLAGS_DEBUG ${XA_COMPILER_FLAGS_DEBUG}) set(CMAKE_CXX_FLAGS_DEBUG ${XA_COMPILER_FLAGS_DEBUG}) +elseif(NOT ANALYZERS_ENABLED) + set(BUILD_STATIC_LIBRARY ON) endif() # Library directories @@ -42,6 +44,7 @@ endif() # Sources string(TOLOWER ${CMAKE_BUILD_TYPE} XAMARIN_MONO_ANDROID_SUFFIX) set(XAMARIN_MONO_ANDROID_LIB "mono-android${CHECKED_BUILD_INFIX}.${XAMARIN_MONO_ANDROID_SUFFIX}") +set(XAMARIN_MONO_ANDROID_STATIC_LIB "${XAMARIN_MONO_ANDROID_LIB}-static") set(XAMARIN_MONODROID_SOURCES debug-constants.cc @@ -49,6 +52,7 @@ set(XAMARIN_MONODROID_SOURCES embedded-assemblies-zip.cc embedded-assemblies.cc globals.cc + internal-pinvokes.cc jni-remapping.cc mono-log-adapter.cc monodroid-glue.cc @@ -58,9 +62,7 @@ set(XAMARIN_MONODROID_SOURCES osbridge.cc pinvoke-override-api.cc runtime-util.cc - timing.cc timezones.cc - timing-internal.cc xamarin_getifaddrs.cc ) @@ -93,90 +95,107 @@ add_library( SHARED ${XAMARIN_MONODROID_SOURCES} ) -target_compile_definitions( - ${XAMARIN_MONO_ANDROID_LIB} - PRIVATE - HAVE_CONFIG_H - HAVE_LZ4 - JI_DLL_EXPORT - JI_NO_VISIBILITY - MONO_DLL_EXPORT - NET - TSL_NO_EXCEPTIONS -) - -if(DONT_INLINE) - target_compile_definitions( - ${XAMARIN_MONO_ANDROID_LIB} - PRIVATE - NO_INLINE +if(BUILD_STATIC_LIBRARY) + add_library( + ${XAMARIN_MONO_ANDROID_STATIC_LIB} + STATIC + ${XAMARIN_MONODROID_SOURCES} ) endif() -if(DEBUG_BUILD AND NOT DISABLE_DEBUG) +macro(lib_target_options TARGET_NAME) target_compile_definitions( - ${XAMARIN_MONO_ANDROID_LIB} + ${TARGET_NAME} PRIVATE - DEBUG + HAVE_CONFIG_H + HAVE_LZ4 + JI_DLL_EXPORT + JI_NO_VISIBILITY + MONO_DLL_EXPORT + NET + TSL_NO_EXCEPTIONS ) -endif() -if (ENABLE_TIMING) - target_compile_definitions( - ${XAMARIN_MONO_ANDROID_LIB} + if(DONT_INLINE) + target_compile_definitions( + ${TARGET_NAME} + PRIVATE + NO_INLINE + ) + endif() + + if(DEBUG_BUILD AND NOT DISABLE_DEBUG) + target_compile_definitions( + ${TARGET_NAME} + PRIVATE + DEBUG + ) + endif() + + if (ENABLE_TIMING) + target_compile_definitions( + ${TARGET_NAME} + PRIVATE + MONODROID_TIMING + ) + endif() + + target_compile_options( + ${TARGET_NAME} PRIVATE - MONODROID_TIMING + ${XA_DEFAULT_SYMBOL_VISIBILITY} + ${XA_COMMON_CXX_ARGS} ) -endif() -target_compile_options( - ${XAMARIN_MONO_ANDROID_LIB} - PRIVATE - ${XA_DEFAULT_SYMBOL_VISIBILITY} - ${XA_COMMON_CXX_ARGS} -) - -target_include_directories( - ${XAMARIN_MONO_ANDROID_LIB} BEFORE - PRIVATE - ${CMAKE_CURRENT_BINARY_DIR}/include - ${EXTERNAL_DIR} - ${ROBIN_MAP_DIR}/include -) + target_include_directories( + ${TARGET_NAME} BEFORE + PRIVATE + ${CMAKE_CURRENT_BINARY_DIR}/include + ${EXTERNAL_DIR} + ${ROBIN_MAP_DIR}/include + ) -target_include_directories( - ${XAMARIN_MONO_ANDROID_LIB} - SYSTEM PRIVATE - ${SYSROOT_CXX_INCLUDE_DIR} - ${MONO_RUNTIME_INCLUDE_DIR} - ${NATIVE_TRACING_INCLUDE_DIRS} - ${LIBUNWIND_INCLUDE_DIRS} -) + target_include_directories( + ${TARGET_NAME} + SYSTEM PRIVATE + ${SYSROOT_CXX_INCLUDE_DIR} + ${MONO_RUNTIME_INCLUDE_DIR} + ${NATIVE_TRACING_INCLUDE_DIRS} + ${LIBUNWIND_INCLUDE_DIRS} + ) -target_link_directories( - ${XAMARIN_MONO_ANDROID_LIB} - PRIVATE - ${NET_RUNTIME_DIR}/native -) + target_link_directories( + ${TARGET_NAME} + PRIVATE + ${NET_RUNTIME_DIR}/native + ) -target_link_options( - ${XAMARIN_MONO_ANDROID_LIB} - PRIVATE - ${XA_DEFAULT_SYMBOL_VISIBILITY} - ${XA_COMMON_CXX_LINKER_ARGS} - ${XA_CXX_DSO_LINKER_ARGS} -) + target_link_options( + ${TARGET_NAME} + PRIVATE + ${XA_DEFAULT_SYMBOL_VISIBILITY} + ${XA_COMMON_CXX_LINKER_ARGS} + ${XA_CXX_DSO_LINKER_ARGS} + ) -target_link_libraries( - ${XAMARIN_MONO_ANDROID_LIB} - ${LINK_LIBS} - xa::xamarin-app - ${SHARED_LIB_NAME} - xa::runtime-base - xa::java-interop - xa::lz4 - -lmonosgen-2.0 - -llog -) + target_link_libraries( + ${TARGET_NAME} + ${LINK_LIBS} + xa::xamarin-app + ${SHARED_LIB_NAME} + xa::runtime-base + xa::java-interop + xa::pinvoke-override-precompiled + xa::lz4 + -lmonosgen-2.0 + -llog + ) +endmacro () +lib_target_options(${XAMARIN_MONO_ANDROID_LIB}) xa_add_compile_definitions(${XAMARIN_MONO_ANDROID_LIB}) + +if(BUILD_STATIC_LIBRARY) + lib_target_options(${XAMARIN_MONO_ANDROID_STATIC_LIB}) + xa_add_compile_definitions(${XAMARIN_MONO_ANDROID_STATIC_LIB}) +endif() diff --git a/src/native/monodroid/embedded-assemblies.cc b/src/native/monodroid/embedded-assemblies.cc index 07eddf61114..57733c6349e 100644 --- a/src/native/monodroid/embedded-assemblies.cc +++ b/src/native/monodroid/embedded-assemblies.cc @@ -33,6 +33,7 @@ #include "xamarin-app.hh" #include "cpp-util.hh" #include "monodroid-glue-internal.hh" +#include "monodroid-state.hh" #include "startup-aware-lock.hh" #include "timing-internal.hh" #include "search.hh" @@ -179,7 +180,7 @@ EmbeddedAssemblies::map_runtime_file (XamarinAndroidBundledAssembly& file) noexc close (fd); } - if (MonodroidRuntime::is_startup_in_progress ()) { + if (MonodroidState::is_startup_in_progress ()) { file.data = static_cast(map_info.area); } else { uint8_t *expected_null = nullptr; diff --git a/src/native/monodroid/internal-pinvoke-api.cc b/src/native/monodroid/internal-pinvoke-api.cc deleted file mode 100644 index 365e88b28f6..00000000000 --- a/src/native/monodroid/internal-pinvoke-api.cc +++ /dev/null @@ -1,343 +0,0 @@ -#include -#include -#include - -#include "xa-internal-api.hh" - -constexpr int TRUE = 1; -constexpr int FALSE = 0; - -using namespace xamarin::android; - -static MonoAndroidInternalCalls *internal_calls = nullptr; - -MONO_API bool -_monodroid_init_internal_api (MonoAndroidInternalCalls *api) -{ - if (api == nullptr) - return false; - - delete internal_calls; - internal_calls = api; - return true; -} - -MONO_API void -_monodroid_shutdown_internal_api () -{ - if (internal_calls == nullptr) - return; - - delete internal_calls; - internal_calls = nullptr; -} - -MONO_API int -_monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap) -{ - return internal_calls->monodroid_getifaddrs (ifap); -} - -MONO_API void -_monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa) -{ - internal_calls->monodroid_freeifaddrs (ifa); -} - -MONO_API void -_monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit) -{ - internal_calls->monodroid_detect_cpu_and_architecture (built_for_cpu, running_on_cpu, is64bit); -} - -// !DO NOT REMOVE! Used by Mono BCL (System.Net.NetworkInformation.NetworkInterface) -// https://github.com/mono/mono/blob/e59c1cd70f4a7171a0ff5e1f9f4937985d6a4d8d/mcs/class/System/System.Net.NetworkInformation/LinuxNetworkInterface.cs#L250-L261 -MONO_API mono_bool -_monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up) -{ - return internal_calls->monodroid_get_network_interface_up_state (ifname, is_up); -} - -/* !DO NOT REMOVE! Used by Mono BCL (System.Net.NetworkInformation.NetworkInterface) */ -MONO_API mono_bool -_monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast) -{ - return internal_calls->monodroid_get_network_interface_supports_multicast (ifname, supports_multicast); -} - -/* !DO NOT REMOVE! Used by Mono BCL (System.Net.NetworkInformation.UnixIPInterfaceProperties) */ -MONO_API int -_monodroid_get_dns_servers (void **dns_servers_array) -{ - return internal_calls->monodroid_get_dns_servers (dns_servers_array); -} - -// -// DO NOT REMOVE: used by Android.Runtime.Logger -// -MONO_API unsigned int -monodroid_get_log_categories () -{ - return internal_calls->monodroid_get_log_categories (); -} - -// -// DO NOT REMOVE: used by Android.Runtime.JNIEnv -// -MONO_API void -monodroid_log (LogLevel level, LogCategories category, const char *message) -{ - internal_calls->monodroid_log (level, category, message); -} - -/* Invoked by: - - System.Core.dll!System.TimeZoneInfo.Android.GetDefaultTimeZoneName - https://github.com/mono/mono/blob/e59c1cd70f4a7171a0ff5e1f9f4937985d6a4d8d/mcs/class/corlib/System/TimeZoneInfo.Android.cs#L569-L594 - - Mono.Android.dll!Android.Runtime.AndroidEnvironment.GetDefaultTimeZone -*/ - -MONO_API void -monodroid_free (void *ptr) -{ - free (ptr); -} - -// Used by https://github.com/mono/mono/blob/e59c1cd70f4a7171a0ff5e1f9f4937985d6a4d8d/mcs/class/corlib/System/TimeZoneInfo.Android.cs#L569-L594 -MONO_API int -monodroid_get_system_property (const char *name, char **value) -{ - return internal_calls->monodroid_get_system_property (name, value); -} - -// Used by Mono.Android.dll!Java.Interop.Runtime.MaxGlobalReferenceCount -MONO_API int -_monodroid_max_gref_get (void) -{ - return internal_calls->monodroid_max_gref_get (); -} - -// Used by Mono.Android.dll!Java.Interop.Runtime.GlobalReferenceCount -MONO_API int -_monodroid_gref_get (void) -{ - return internal_calls->monodroid_gref_get (); -} - -// Used by Mono.Android.dll!Java.Interop.Runtime.WeakGlobalReferenceCount -MONO_API int -_monodroid_weak_gref_get (void) -{ - return internal_calls->monodroid_weak_gref_get (); -} - -// Used by Mono.Android.dll!Android.Runtime.JNIEnv -MONO_API void -_monodroid_gref_log (const char *message) -{ - internal_calls->monodroid_gref_log (message); -} - -MONO_API int -_monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) -{ - return internal_calls->monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); -} - -MONO_API void -_monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - internal_calls->monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); -} - -MONO_API void -_monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) -{ - internal_calls->monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); -} - -MONO_API void -_monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - internal_calls->monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); -} - -MONO_API void -_monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - internal_calls->monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); -} - -MONO_API void -_monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - internal_calls->monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); -} - -MONO_API void -_monodroid_gc_wait_for_bridge_processing (void) -{ - internal_calls->monodroid_gc_wait_for_bridge_processing (); -} - -/* !DO NOT REMOVE! Used by Mono BCL */ -MONO_API int -_monodroid_get_android_api_level (void) -{ - return internal_calls->monodroid_get_android_api_level (); -} - -/* Can be called by a native debugger to break the wait on startup */ -MONO_API void -monodroid_clear_gdb_wait (void) -{ - internal_calls->monodroid_clear_gdb_wait (); -} - -MONO_API void* -_monodroid_get_identity_hash_code (JNIEnv *env, void *v) -{ - return internal_calls->monodroid_get_identity_hash_code (env, v); -} - -MONO_API void* -_monodroid_timezone_get_default_id (void) -{ - return internal_calls->monodroid_timezone_get_default_id (); -} - -MONO_API void -_monodroid_counters_dump (const char *format, ...) -{ - va_list args; - va_start (args, format); - internal_calls->dump_counters (format, args); - va_end (args); -} - -MONO_API int -monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) -{ - return internal_calls->monodroid_embedded_assemblies_set_assemblies_prefix (prefix); -} - -MONO_API managed_timing_sequence* -monodroid_timing_start (const char *message) -{ - return internal_calls->monodroid_timing_start (message); -} - -MONO_API void -monodroid_timing_stop (managed_timing_sequence *sequence, const char *message) -{ - internal_calls->monodroid_timing_stop (sequence, message); -} - -MONO_API void -monodroid_strfreev (char **str_array) -{ - internal_calls->monodroid_strfreev (str_array); -} - -MONO_API char** -monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens) -{ - return internal_calls->monodroid_strsplit (str, delimiter, max_tokens); -} - -MONO_API char* -monodroid_strdup_printf (const char *format, ...) -{ - va_list args; - - va_start (args, format); - char *ret = internal_calls->monodroid_strdup_printf (format, args); - va_end (args); - - return ret; -} - -MONO_API char* -monodroid_TypeManager_get_java_class_name (jclass klass) -{ - return internal_calls->monodroid_TypeManager_get_java_class_name (klass); -} - -MONO_API void -monodroid_store_package_name (const char *name) -{ - internal_calls->monodroid_store_package_name (name); -} - -MONO_API int -monodroid_get_namespaced_system_property (const char *name, char **value) -{ - return internal_calls->monodroid_get_namespaced_system_property (name, value); -} - -MONO_API FILE* -monodroid_fopen (const char* filename, const char* mode) -{ - return internal_calls->monodroid_fopen (filename, mode); -} - -MONO_API int -send_uninterrupted (int fd, void *buf, int len) -{ - return internal_calls->send_uninterrupted (fd, buf, len); -} - -MONO_API int -recv_uninterrupted (int fd, void *buf, int len) -{ - return internal_calls->recv_uninterrupted (fd, buf, len); -} - -MONO_API void -set_world_accessable (const char *path) -{ - internal_calls->set_world_accessable (path); -} - -MONO_API void -create_public_directory (const char *dir) -{ - internal_calls->create_public_directory (dir); -} - -MONO_API char* -path_combine (const char *path1, const char *path2) -{ - return internal_calls->path_combine (path1, path2); -} - -MONO_API void* -monodroid_dylib_mono_new ([[maybe_unused]] const char *libmono_path) -{ - return nullptr; -} - -MONO_API void -monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports) -{ - // no-op -} - -/* - this function is used from JavaInterop and should be treated as public API - https://github.com/dotnet/java-interop/blob/master/src/java-interop/java-interop-gc-bridge-mono.c#L266 - - it should also accept libmono_path = nullptr parameter -*/ -MONO_API int -monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path) -{ - if (mono_imports == nullptr) - return FALSE; - return TRUE; -} - -MONO_API void* -monodroid_get_dylib (void) -{ - return nullptr; -} diff --git a/src/native/monodroid/internal-pinvokes.cc b/src/native/monodroid/internal-pinvokes.cc new file mode 100644 index 00000000000..d79681b7545 --- /dev/null +++ b/src/native/monodroid/internal-pinvokes.cc @@ -0,0 +1,343 @@ +#include "android-system.hh" +#include "globals.hh" +#include "internal-pinvokes.hh" +#include "jni-remapping.hh" + +using namespace xamarin::android; +using namespace xamarin::android::internal; + +unsigned int +monodroid_get_log_categories () +{ + return log_categories; +} + +int +monodroid_get_system_property (const char *name, char **value) +{ + return AndroidSystem::monodroid_get_system_property (name, value); +} + +int +monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) +{ + embeddedAssemblies.set_assemblies_prefix (prefix); + return 0; +} + +void +monodroid_log (LogLevel level, LogCategories category, const char *message) +{ + switch (level) { + case LogLevel::Verbose: + case LogLevel::Debug: + log_debug_nocheck (category, message); + break; + + case LogLevel::Info: + log_info_nocheck (category, message); + break; + + case LogLevel::Warn: + case LogLevel::Silent: // warn is always printed + log_warn (category, message); + break; + + case LogLevel::Error: + log_error (category, message); + break; + + case LogLevel::Fatal: + log_fatal (category, message); + break; + + default: + case LogLevel::Unknown: + case LogLevel::Default: + log_info_nocheck (category, message); + break; + } +} + +void +monodroid_free (void *ptr) +{ + free (ptr); +} + +int +_monodroid_max_gref_get () +{ + return static_cast(AndroidSystem::get_max_gref_count ()); +} + +int +_monodroid_gref_get () +{ + return osBridge.get_gc_gref_count (); +} + + +void +_monodroid_gref_log (const char *message) +{ + osBridge._monodroid_gref_log (message); +} + +int +_monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) +{ + return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); +} + +void +_monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) +{ + osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); +} + +int +_monodroid_weak_gref_get () +{ + return osBridge.get_gc_weak_gref_count (); +} + +void +_monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) +{ + osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); +} + +void +_monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) +{ + osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); +} + +void +_monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) +{ + osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); +} + +void +_monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) +{ + osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); +} + +void +_monodroid_gc_wait_for_bridge_processing () +{ + mono_gc_wait_for_bridge_processing (); +} + +int +_monodroid_get_android_api_level () +{ + return monodroidRuntime.get_android_api_level (); +} + +void +monodroid_clear_gdb_wait () +{ + monodroidRuntime.set_monodroid_gdb_wait (false); +} + +void* +_monodroid_get_identity_hash_code (JNIEnv *env, void *v) +{ + intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); + return (void*) rv; +} + +void* +_monodroid_timezone_get_default_id () +{ + JNIEnv *env = osBridge.ensure_jnienv (); + jmethodID getDefault = env->GetStaticMethodID (monodroidRuntime.get_java_class_TimeZone (), "getDefault", "()Ljava/util/TimeZone;"); + jmethodID getID = env->GetMethodID (monodroidRuntime.get_java_class_TimeZone (), "getID", "()Ljava/lang/String;"); + jobject d = env->CallStaticObjectMethod (monodroidRuntime.get_java_class_TimeZone (), getDefault); + jstring id = reinterpret_cast (env->CallObjectMethod (d, getID)); + const char *mutf8 = env->GetStringUTFChars (id, nullptr); + + if (mutf8 == nullptr) { + log_error (LOG_DEFAULT, "Failed to convert Java TimeZone ID to UTF8 (out of memory?)"); + env->DeleteLocalRef (id); + env->DeleteLocalRef (d); + return nullptr; + } + + char *def_id = strdup (mutf8); + + env->ReleaseStringUTFChars (id, mutf8); + env->DeleteLocalRef (id); + env->DeleteLocalRef (d); + + return def_id; +} + +void +_monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args) +{ +#if !defined (NET) + monodroidRuntime.dump_counters_v (format, args); +#endif // ndef NET +} + +managed_timing_sequence* +monodroid_timing_start (const char *message) +{ + if (timing == nullptr) + return nullptr; + + managed_timing_sequence *ret = timing->get_available_sequence (); + if (message != nullptr) { + log_write (LOG_TIMING, LogLevel::Info, message); + } + ret->period.mark_start (); + + return ret; +} + +void +monodroid_timing_stop (managed_timing_sequence *sequence, const char *message) +{ + static constexpr const char DEFAULT_MESSAGE[] = "Managed Timing"; + + if (sequence == nullptr) + return; + + sequence->period.mark_end (); + Timing::info (sequence->period, message == nullptr ? DEFAULT_MESSAGE : message); + timing->release_sequence (sequence); +} + +char** +monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens) +{ + return Util::monodroid_strsplit (str, delimiter, max_tokens); +} + +void +monodroid_strfreev (char **str_array) +{ + Util::monodroid_strfreev (str_array); +} + +char* +monodroid_strdup_printf (const char *format, ...) +{ + va_list args; + + va_start (args, format); + char *ret = Util::monodroid_strdup_vprintf (format, args); + va_end (args); + + return ret; +} + +char* +monodroid_TypeManager_get_java_class_name (jclass klass) +{ + return monodroidRuntime.get_java_class_name_for_TypeManager (klass); +} + +int +monodroid_get_namespaced_system_property (const char *name, char **value) +{ + return static_cast(AndroidSystem::monodroid_get_system_property (name, value)); +} + +FILE* +monodroid_fopen (const char* filename, const char* mode) +{ + return Util::monodroid_fopen (filename, mode); +} + +int +send_uninterrupted (int fd, void *buf, int len) +{ + if (len < 0) + len = 0; + return Util::send_uninterrupted (fd, buf, static_cast(len)); +} + +int +recv_uninterrupted (int fd, void *buf, int len) +{ + if (len < 0) + len = 0; + return static_cast(Util::recv_uninterrupted (fd, buf, static_cast(len))); +} + +void +set_world_accessable (const char *path) +{ + Util::set_world_accessable (path); +} + +void +create_public_directory (const char *dir) +{ + Util::create_public_directory (dir); +} + +char* +path_combine (const char *path1, const char *path2) +{ + return Util::path_combine (path1, path2); +} + +void* +monodroid_dylib_mono_new ([[maybe_unused]] const char *libmono_path) +{ + return nullptr; +} + +void +monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports) +{ + // no-op +} + +/* + this function is used from JavaInterop and should be treated as public API + https://github.com/dotnet/java-interop/blob/master/src/java-interop/java-interop-gc-bridge-mono.c#L266 + + it should also accept libmono_path = nullptr parameter + */ +int +monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path) +{ + if (mono_imports == nullptr) + return FALSE; + return TRUE; +} + +void* +monodroid_get_dylib () +{ + return nullptr; +} + +const char* +_monodroid_lookup_replacement_type (const char *jniSimpleReference) +{ + return JniRemapping::lookup_replacement_type (jniSimpleReference); +} + +const JniRemappingReplacementMethod* +_monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature) +{ + return JniRemapping::lookup_replacement_method_info (jniSourceType, jniMethodName, jniMethodSignature); +} + +void +monodroid_log_traces (uint32_t kind, const char *first_line) +{ + JNIEnv *env = osBridge.ensure_jnienv (); + auto tk = static_cast(kind); + + monodroidRuntime.log_traces (env, tk, first_line); +} diff --git a/src/native/monodroid/monodroid-glue-internal.hh b/src/native/monodroid/monodroid-glue-internal.hh index d4ad09a2991..8d736017200 100644 --- a/src/native/monodroid/monodroid-glue-internal.hh +++ b/src/native/monodroid/monodroid-glue-internal.hh @@ -11,6 +11,7 @@ #include "timing.hh" #include "cpp-util.hh" #include "xxhash.hh" +#include "monodroid-dl.hh" #include #include @@ -49,21 +50,6 @@ extern mono_bool mono_opt_aot_lazy_assembly_load; namespace xamarin::android::internal { - struct PinvokeEntry - { - hash_t hash; - const char *name; - void *func; - }; - - struct string_hash - { - force_inline xamarin::android::hash_t operator() (std::string const& s) const noexcept - { - return xamarin::android::xxhash::hash (s.c_str (), s.length ()); - } - }; - // Values must be identical to those in src/Mono.Android/Android.Runtime/RuntimeNativeMethods.cs enum class TraceKind : uint32_t { @@ -75,27 +61,7 @@ namespace xamarin::android::internal class MonodroidRuntime { - using pinvoke_api_map = tsl::robin_map< - std::string, - void*, - string_hash, - std::equal_to, - std::allocator>, - true - >; - - using pinvoke_api_map_ptr = pinvoke_api_map*; - using pinvoke_library_map = tsl::robin_map< - std::string, - pinvoke_api_map_ptr, - string_hash, - std::equal_to, - std::allocator>, - true - >; - using load_assemblies_context_type = MonoAssemblyLoadContextGCHandle; - static constexpr pinvoke_library_map::size_type LIBRARY_MAP_INITIAL_BUCKET_COUNT = 1; #if defined (DEBUG) struct RuntimeOptions { @@ -146,18 +112,6 @@ namespace xamarin::android::internal static constexpr size_t SMALL_STRING_PARSE_BUFFER_LEN = 50; static constexpr bool is_running_on_desktop = false; - static constexpr std::string_view mono_component_debugger_name { "libmono-component-debugger.so" }; - static constexpr hash_t mono_component_debugger_hash = xxhash::hash (mono_component_debugger_name); - - static constexpr std::string_view mono_component_hot_reload_name { "libmono-component-hot_reload.so" }; - static constexpr hash_t mono_component_hot_reload_hash = xxhash::hash (mono_component_hot_reload_name); - - static constexpr std::string_view mono_component_diagnostics_tracing_name { "libmono-component-diagnostics_tracing.so" }; - static constexpr hash_t mono_component_diagnostics_tracing_hash = xxhash::hash (mono_component_diagnostics_tracing_name); - - static constexpr std::string_view xamarin_native_tracing_name { "libxamarin-native-tracing.so" }; - static constexpr hash_t xamarin_native_tracing_name_hash = xxhash::hash (xamarin_native_tracing_name); - public: static constexpr int XA_LOG_COUNTERS = MONO_COUNTER_JIT | MONO_COUNTER_METADATA | MONO_COUNTER_GC | MONO_COUNTER_GENERICS | MONO_COUNTER_INTERP; @@ -170,11 +124,6 @@ namespace xamarin::android::internal jint Java_JNI_OnLoad (JavaVM *vm, void *reserved); - static bool is_startup_in_progress () noexcept - { - return startup_in_progress; - } - int get_android_api_level () const { return android_api_level; @@ -215,19 +164,12 @@ namespace xamarin::android::internal unsigned int convert_dl_flags (int flags); static void cleanup_runtime_config (MonovmRuntimeConfigArguments *args, void *user_data); - static void* load_library_symbol (const char *library_name, const char *symbol_name, void **dso_handle = nullptr) noexcept; - static void* load_library_entry (std::string const& library_name, std::string const& entrypoint_name, pinvoke_api_map_ptr api_map) noexcept; - static void load_library_entry (const char *library_name, const char *entrypoint_name, PinvokeEntry &entry, void **dso_handle) noexcept; - static void* fetch_or_create_pinvoke_map_entry (std::string const& library_name, std::string const& entrypoint_name, hash_t entrypoint_name_hash, pinvoke_api_map_ptr api_map, bool need_lock) noexcept; - static PinvokeEntry* find_pinvoke_address (hash_t hash, const PinvokeEntry *entries, size_t entry_count) noexcept; - static void* handle_other_pinvoke_request (const char *library_name, hash_t library_name_hash, const char *entrypoint_name, hash_t entrypoint_name_hash) noexcept; - static void* monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name); template static void load_symbol (void *handle, const char *name, TFunc*& fnptr) noexcept { char *err = nullptr; - void *symptr = monodroid_dlsym (handle, name, &err, nullptr); + void *symptr = MonodroidDl::monodroid_dlsym (handle, name, &err, nullptr); if (symptr == nullptr) { log_warn (LOG_DEFAULT, "Failed to load symbol '%s' library with handle %p. %s", name, handle, err == nullptr ? "Unknown error" : err); @@ -238,13 +180,6 @@ namespace xamarin::android::internal fnptr = reinterpret_cast(symptr); } - static void* monodroid_dlopen_ignore_component_or_load (hash_t hash, const char *name, int flags, char **err) noexcept; - static void* monodroid_dlopen (const char *name, int flags, char **err) noexcept; - static void* monodroid_dlopen (const char *name, int flags, char **err, void *user_data) noexcept; - static void* monodroid_dlsym (void *handle, const char *name, char **err, void *user_data); - static void* monodroid_dlopen_log_and_return (void *handle, char **err, const char *full_name, bool free_memory, bool need_api_init = false); - static DSOCacheEntry* find_dso_cache_entry (hash_t hash) noexcept; - int LocalRefsAreIndirect (JNIEnv *env, jclass runtimeClass, int version); void create_xdg_directory (jstring_wrapper& home, size_t home_len, std::string_view const& relative_path, std::string_view const& environment_variable_name) noexcept; void create_xdg_directories_and_environment (jstring_wrapper &homeDir); @@ -341,20 +276,12 @@ namespace xamarin::android::internal * able to switch our different contexts from different threads. */ int current_context_id = -1; - static bool startup_in_progress; jnienv_register_jni_natives_fn jnienv_register_jni_natives = nullptr; MonoAssemblyLoadContextGCHandle default_alc = nullptr; - static xamarin::android::mutex pinvoke_map_write_lock; - static pinvoke_library_map other_pinvoke_map; static MonoCoreRuntimeProperties monovm_core_properties; MonovmRuntimeConfigArguments runtime_config_args; - - static void *system_native_library_handle; - static void *system_security_cryptography_native_android_library_handle; - static void *system_io_compression_native_library_handle; - static xamarin::android::mutex dso_handle_write_lock; }; } #endif diff --git a/src/native/monodroid/monodroid-glue.cc b/src/native/monodroid/monodroid-glue.cc index 7faa8dd4051..f8f0339a162 100644 --- a/src/native/monodroid/monodroid-glue.cc +++ b/src/native/monodroid/monodroid-glue.cc @@ -46,10 +46,7 @@ #include #endif -//#include "java-interop-util.h" #include "logger.hh" - -//#include "monodroid.h" #include "util.hh" #include "debug.hh" #include "embedded-assemblies.hh" @@ -58,37 +55,26 @@ #include "globals.hh" #include "xamarin-app.hh" #include "timing.hh" -//#include "xa-internal-api-impl.hh" #include "build-info.hh" #include "monovm-properties.hh" -#include "startup-aware-lock.hh" #include "timing-internal.hh" -#include "search.hh" #include "runtime-util.hh" - -//#include "xamarin_getifaddrs.h" - +#include "monodroid-state.hh" +#include "pinvoke-override-api.hh" #include "cpp-util.hh" #include "strings.hh" -#include "java-interop-dlfcn.h" - using namespace microsoft::java_interop; using namespace xamarin::android; using namespace xamarin::android::internal; -xamarin::android::mutex MonodroidRuntime::pinvoke_map_write_lock; - MonoCoreRuntimeProperties MonodroidRuntime::monovm_core_properties = { .trusted_platform_assemblies = nullptr, .app_paths = nullptr, .native_dll_search_directories = nullptr, - .pinvoke_override = &MonodroidRuntime::monodroid_pinvoke_override + .pinvoke_override = &PinvokeOverride::monodroid_pinvoke_override }; -xamarin::android::mutex MonodroidRuntime::dso_handle_write_lock; -bool MonodroidRuntime::startup_in_progress = true; - void MonodroidRuntime::thread_start ([[maybe_unused]] MonoProfiler *prof, [[maybe_unused]] uintptr_t tid) { @@ -1003,173 +989,6 @@ setup_gc_logging (void) } #endif -force_inline unsigned int -MonodroidRuntime::convert_dl_flags (int flags) -{ - unsigned int lflags = (flags & static_cast (MONO_DL_LOCAL)) - ? JAVA_INTEROP_LIB_LOAD_LOCALLY - : JAVA_INTEROP_LIB_LOAD_GLOBALLY; - return lflags; -} - -force_inline DSOCacheEntry* -MonodroidRuntime::find_dso_cache_entry (hash_t hash) noexcept -{ - auto equal = [](DSOCacheEntry const& entry, hash_t key) -> bool { return entry.hash == key; }; - auto less_than = [](DSOCacheEntry const& entry, hash_t key) -> bool { return entry.hash < key; }; - ssize_t idx = Search::binary_search (hash, dso_cache, application_config.number_of_dso_cache_entries); - if (idx >= 0) { - return &dso_cache[idx]; - } - - return nullptr; -} - -force_inline void* -MonodroidRuntime::monodroid_dlopen_log_and_return (void *handle, char **err, const char *full_name, bool free_memory, [[maybe_unused]] bool need_api_init) -{ - if (handle == nullptr && err != nullptr) { - const char *load_error = dlerror (); - if (load_error == nullptr) { - load_error = "Unknown error"; - } - *err = Util::monodroid_strdup_printf ("Could not load library '%s'. %s", full_name, load_error); - } - - if (free_memory) { - delete[] full_name; - } - - return handle; -} - -force_inline void* -MonodroidRuntime::monodroid_dlopen_ignore_component_or_load ([[maybe_unused]] hash_t name_hash, const char *name, int flags, char **err) noexcept -{ - if (startup_in_progress) { - auto ignore_component = [&](const char *label, MonoComponent component) -> bool { - if ((application_config.mono_components_mask & component) != component) { - log_info (LOG_ASSEMBLY, "Mono '%s' component requested but not packaged, ignoring", label); - return true; - } - - return false; - }; - - switch (name_hash) { - case mono_component_debugger_hash: - if (ignore_component ("Debugger", MonoComponent::Debugger)) { - return nullptr; - } - break; - - case mono_component_hot_reload_hash: - if (ignore_component ("Hot Reload", MonoComponent::HotReload)) { - return nullptr; - } - break; - - case mono_component_diagnostics_tracing_hash: - if (ignore_component ("Diagnostics Tracing", MonoComponent::Tracing)) { - return nullptr; - } - break; - } - } - - unsigned int dl_flags = monodroidRuntime.convert_dl_flags (flags); - void * handle = AndroidSystem::load_dso_from_any_directories (name, dl_flags); - if (handle != nullptr) { - return monodroid_dlopen_log_and_return (handle, err, name, false /* name_needs_free */); - } - - handle = AndroidSystem::load_dso (name, dl_flags, false /* skip_existing_check */); - return monodroid_dlopen_log_and_return (handle, err, name, false /* name_needs_free */); -} - -force_inline void* -MonodroidRuntime::monodroid_dlopen (const char *name, int flags, char **err) noexcept -{ - hash_t name_hash = xxhash::hash (name, strlen (name)); - log_debug (LOG_ASSEMBLY, "monodroid_dlopen: hash for name '%s' is 0x%zx", name, name_hash); - DSOCacheEntry *dso = find_dso_cache_entry (name_hash); - log_debug (LOG_ASSEMBLY, "monodroid_dlopen: hash match %sfound, DSO name is '%s'", dso == nullptr ? "not " : "", dso == nullptr ? "" : dso->name); - - if (dso == nullptr) { - // DSO not known at build time, try to load it - return monodroid_dlopen_ignore_component_or_load (name_hash, name, flags, err); - } else if (dso->handle != nullptr) { - return monodroid_dlopen_log_and_return (dso->handle, err, dso->name, false /* name_needs_free */); - } - - if (dso->ignore) { - log_info (LOG_ASSEMBLY, "Request to load '%s' ignored, it is known not to exist", dso->name); - return nullptr; - } - - StartupAwareLock lock (dso_handle_write_lock); -#if defined (RELEASE) - if (AndroidSystem::is_embedded_dso_mode_enabled ()) { - DSOApkEntry *apk_entry = dso_apk_entries; - for (size_t i = 0; i < application_config.number_of_shared_libraries; i++) { - if (apk_entry->name_hash != dso->real_name_hash) { - apk_entry++; - continue; - } - - android_dlextinfo dli; - dli.flags = ANDROID_DLEXT_USE_LIBRARY_FD | ANDROID_DLEXT_USE_LIBRARY_FD_OFFSET; - dli.library_fd = apk_entry->fd; - dli.library_fd_offset = apk_entry->offset; - dso->handle = android_dlopen_ext (dso->name, flags, &dli); - - if (dso->handle != nullptr) { - return monodroid_dlopen_log_and_return (dso->handle, err, dso->name, false /* name_needs_free */); - } - break; - } - } -#endif - unsigned int dl_flags = monodroidRuntime.convert_dl_flags (flags); - dso->handle = AndroidSystem::load_dso_from_any_directories (dso->name, dl_flags); - - if (dso->handle != nullptr) { - return monodroid_dlopen_log_and_return (dso->handle, err, dso->name, false /* name_needs_free */); - } - - dso->handle = AndroidSystem::load_dso_from_any_directories (name, dl_flags); - return monodroid_dlopen_log_and_return (dso->handle, err, name, false /* name_needs_free */); -} - -void* -MonodroidRuntime::monodroid_dlopen (const char *name, int flags, char **err, [[maybe_unused]] void *user_data) noexcept -{ - if (name == nullptr) { - log_warn (LOG_ASSEMBLY, "monodroid_dlopen got a null name. This is not supported in NET+"); - return nullptr; - } - - return monodroid_dlopen (name, flags, err); -} - -void* -MonodroidRuntime::monodroid_dlsym (void *handle, const char *name, char **err, [[maybe_unused]] void *user_data) -{ - void *s; - char *e = nullptr; - - s = java_interop_lib_symbol (handle, name, &e); - - if (!s && err) { - *err = Util::monodroid_strdup_printf ("Could not find symbol '%s': %s", name, e); - } - if (e) { - java_interop_free (e); - } - - return s; -} - inline void MonodroidRuntime::set_environment_variable_for_directory (const char *name, jstring_wrapper &value, bool createDirectory, mode_t mode) { @@ -1650,7 +1469,7 @@ MonodroidRuntime::Java_mono_android_Runtime_initInternal (JNIEnv *env, jclass kl } AndroidSystem::setup_process_args (runtimeApks); - mono_dl_fallback_register (monodroid_dlopen, monodroid_dlsym, nullptr, nullptr); + mono_dl_fallback_register (MonodroidDl::monodroid_dlopen, MonodroidDl::monodroid_dlsym, nullptr, nullptr); set_profile_options (); @@ -1731,7 +1550,7 @@ MonodroidRuntime::Java_mono_android_Runtime_initInternal (JNIEnv *env, jclass kl xamarin_app_init (env, get_function_pointer_at_runtime); } #endif // def RELEASE && def ANDROID && def NET - startup_in_progress = false; + MonodroidState::mark_startup_done (); } JNIEXPORT jint JNICALL diff --git a/src/native/monodroid/monodroid-tracing.cc b/src/native/monodroid/monodroid-tracing.cc index 8269501abd6..477fa2e7890 100644 --- a/src/native/monodroid/monodroid-tracing.cc +++ b/src/native/monodroid/monodroid-tracing.cc @@ -25,9 +25,9 @@ MonodroidRuntime::log_traces (JNIEnv *env, TraceKind kind, const char *first_lin std::lock_guard lock (tracing_init_lock); char *err = nullptr; - void *handle = monodroid_dlopen (xamarin_native_tracing_name.data (), MONO_DL_EAGER, &err, nullptr); + void *handle = MonodroidDl::monodroid_dlopen (SharedConstants::xamarin_native_tracing_name.data (), MONO_DL_EAGER, &err, nullptr); if (handle == nullptr) { - log_warn (LOG_DEFAULT, "Failed to load native tracing library '%s'. %s", xamarin_native_tracing_name, err == nullptr ? "Unknown error" : err); + log_warn (LOG_DEFAULT, "Failed to load native tracing library '%s'. %s", SharedConstants::xamarin_native_tracing_name, err == nullptr ? "Unknown error" : err); } else { load_symbol (handle, "xa_get_native_backtrace", _xa_get_native_backtrace); load_symbol (handle, "xa_get_managed_backtrace", _xa_get_managed_backtrace); diff --git a/src/native/monodroid/pinvoke-override-api.cc b/src/native/monodroid/pinvoke-override-api.cc index 8813e98f40c..6adc0815491 100644 --- a/src/native/monodroid/pinvoke-override-api.cc +++ b/src/native/monodroid/pinvoke-override-api.cc @@ -5,6 +5,7 @@ #include #include "globals.hh" +#include "monodroid-dl.hh" #include "monodroid-glue.hh" #include "monodroid-glue-internal.hh" #include "timing.hh" @@ -13,563 +14,7 @@ #include "xxhash.hh" #include "startup-aware-lock.hh" #include "jni-remapping.hh" - -extern "C" { - int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); - void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); -} - -mono_bool _monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up); -mono_bool _monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast); -int _monodroid_get_dns_servers (void **dns_servers_array); +#include "internal-pinvokes.hh" using namespace xamarin::android; using namespace xamarin::android::internal; - -void* MonodroidRuntime::system_native_library_handle = nullptr; -void* MonodroidRuntime::system_security_cryptography_native_android_library_handle = nullptr; -void* MonodroidRuntime::system_io_compression_native_library_handle = nullptr; - -static unsigned int -monodroid_get_log_categories () -{ - return log_categories; -} - -static int -monodroid_get_system_property (const char *name, char **value) -{ - return AndroidSystem::monodroid_get_system_property (name, value); -} - -static int -monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) -{ - embeddedAssemblies.set_assemblies_prefix (prefix); - return 0; -} - -static void -monodroid_log (LogLevel level, LogCategories category, const char *message) -{ - switch (level) { - case LogLevel::Verbose: - case LogLevel::Debug: - log_debug_nocheck (category, message); - break; - - case LogLevel::Info: - log_info_nocheck (category, message); - break; - - case LogLevel::Warn: - case LogLevel::Silent: // warn is always printed - log_warn (category, message); - break; - - case LogLevel::Error: - log_error (category, message); - break; - - case LogLevel::Fatal: - log_fatal (category, message); - break; - - default: - case LogLevel::Unknown: - case LogLevel::Default: - log_info_nocheck (category, message); - break; - } -} - -static void -monodroid_free (void *ptr) -{ - free (ptr); -} - -static int -_monodroid_max_gref_get () -{ - return static_cast(AndroidSystem::get_max_gref_count ()); -} - -static int -_monodroid_gref_get () -{ - return osBridge.get_gc_gref_count (); -} - - -static void -_monodroid_gref_log (const char *message) -{ - osBridge._monodroid_gref_log (message); -} - -static int -_monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) -{ - return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); -} - -static void -_monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); -} - -static int -_monodroid_weak_gref_get () -{ - return osBridge.get_gc_weak_gref_count (); -} - -static void -_monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); -} - -static void -_monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); -} - -static void -_monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); -} - -static void -_monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); -} - -static void -_monodroid_gc_wait_for_bridge_processing () -{ - mono_gc_wait_for_bridge_processing (); -} - -static int -_monodroid_get_android_api_level () -{ - return monodroidRuntime.get_android_api_level (); -} - -static void -monodroid_clear_gdb_wait () -{ - monodroidRuntime.set_monodroid_gdb_wait (false); -} - -static void* -_monodroid_get_identity_hash_code (JNIEnv *env, void *v) -{ - intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); - return (void*) rv; -} - -static void* -_monodroid_timezone_get_default_id () -{ - JNIEnv *env = osBridge.ensure_jnienv (); - jmethodID getDefault = env->GetStaticMethodID (monodroidRuntime.get_java_class_TimeZone (), "getDefault", "()Ljava/util/TimeZone;"); - jmethodID getID = env->GetMethodID (monodroidRuntime.get_java_class_TimeZone (), "getID", "()Ljava/lang/String;"); - jobject d = env->CallStaticObjectMethod (monodroidRuntime.get_java_class_TimeZone (), getDefault); - jstring id = reinterpret_cast (env->CallObjectMethod (d, getID)); - const char *mutf8 = env->GetStringUTFChars (id, nullptr); - - if (mutf8 == nullptr) { - log_error (LOG_DEFAULT, "Failed to convert Java TimeZone ID to UTF8 (out of memory?)"); - env->DeleteLocalRef (id); - env->DeleteLocalRef (d); - return nullptr; - } - - char *def_id = strdup (mutf8); - - env->ReleaseStringUTFChars (id, mutf8); - env->DeleteLocalRef (id); - env->DeleteLocalRef (d); - - return def_id; -} - -static void -_monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args) -{ -#if !defined (NET) - monodroidRuntime.dump_counters_v (format, args); -#endif // ndef NET -} - -static managed_timing_sequence* -monodroid_timing_start (const char *message) -{ - if (timing == nullptr) - return nullptr; - - managed_timing_sequence *ret = timing->get_available_sequence (); - if (message != nullptr) { - log_write (LOG_TIMING, LogLevel::Info, message); - } - ret->period.mark_start (); - - return ret; -} - -static void -monodroid_timing_stop (managed_timing_sequence *sequence, const char *message) -{ - static constexpr const char DEFAULT_MESSAGE[] = "Managed Timing"; - - if (sequence == nullptr) - return; - - sequence->period.mark_end (); - Timing::info (sequence->period, message == nullptr ? DEFAULT_MESSAGE : message); - timing->release_sequence (sequence); -} - -static char** -monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens) -{ - return Util::monodroid_strsplit (str, delimiter, max_tokens); -} - -static void -monodroid_strfreev (char **str_array) -{ - Util::monodroid_strfreev (str_array); -} - -static char* -monodroid_strdup_printf (const char *format, ...) -{ - va_list args; - - va_start (args, format); - char *ret = Util::monodroid_strdup_vprintf (format, args); - va_end (args); - - return ret; -} - -static char* -monodroid_TypeManager_get_java_class_name (jclass klass) -{ - return monodroidRuntime.get_java_class_name_for_TypeManager (klass); -} - -static int -monodroid_get_namespaced_system_property (const char *name, char **value) -{ - return static_cast(AndroidSystem::monodroid_get_system_property (name, value)); -} - -static FILE* -monodroid_fopen (const char* filename, const char* mode) -{ - return Util::monodroid_fopen (filename, mode); -} - -static int -send_uninterrupted (int fd, void *buf, int len) -{ - if (len < 0) - len = 0; - return Util::send_uninterrupted (fd, buf, static_cast(len)); -} - -static int -recv_uninterrupted (int fd, void *buf, int len) -{ - if (len < 0) - len = 0; - return static_cast(Util::recv_uninterrupted (fd, buf, static_cast(len))); -} - -static void -set_world_accessable (const char *path) -{ - Util::set_world_accessable (path); -} - -static void -create_public_directory (const char *dir) -{ - Util::create_public_directory (dir); -} - -static char* -path_combine (const char *path1, const char *path2) -{ - return Util::path_combine (path1, path2); -} - -static void* -monodroid_dylib_mono_new ([[maybe_unused]] const char *libmono_path) -{ - return nullptr; -} - -static void -monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports) -{ - // no-op -} - -/* - this function is used from JavaInterop and should be treated as public API - https://github.com/dotnet/java-interop/blob/master/src/java-interop/java-interop-gc-bridge-mono.c#L266 - - it should also accept libmono_path = nullptr parameter -*/ -static int -monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path) -{ - if (mono_imports == nullptr) - return FALSE; - return TRUE; -} - -static void* -monodroid_get_dylib (void) -{ - return nullptr; -} - -static const char* -_monodroid_lookup_replacement_type (const char *jniSimpleReference) -{ - return JniRemapping::lookup_replacement_type (jniSimpleReference); -} - -static const JniRemappingReplacementMethod* -_monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature) -{ - return JniRemapping::lookup_replacement_method_info (jniSourceType, jniMethodName, jniMethodSignature); -} - -static void -monodroid_log_traces (uint32_t kind, const char *first_line) -{ - JNIEnv *env = osBridge.ensure_jnienv (); - auto tk = static_cast(kind); - - monodroidRuntime.log_traces (env, tk, first_line); -} - -#include "pinvoke-tables.include" - -MonodroidRuntime::pinvoke_library_map MonodroidRuntime::other_pinvoke_map (MonodroidRuntime::LIBRARY_MAP_INITIAL_BUCKET_COUNT); - -force_inline void* -MonodroidRuntime::load_library_symbol (const char *library_name, const char *symbol_name, void **dso_handle) noexcept -{ - void *lib_handle = dso_handle == nullptr ? nullptr : *dso_handle; - - if (lib_handle == nullptr) { - lib_handle = monodroid_dlopen (library_name, MONO_DL_LOCAL, nullptr, nullptr); - if (lib_handle == nullptr) { - log_warn (LOG_ASSEMBLY, "Shared library '%s' not loaded, p/invoke '%s' may fail", library_name, symbol_name); - return nullptr; - } - - if (dso_handle != nullptr) { - void *expected_null = nullptr; - if (!__atomic_compare_exchange (dso_handle, &expected_null, &lib_handle, false /* weak */, __ATOMIC_ACQUIRE /* success_memorder */, __ATOMIC_RELAXED /* xxxfailure_memorder */)) { - log_debug (LOG_ASSEMBLY, "Library '%s' handle already cached by another thread", library_name); - } - } - } - - void *entry_handle = monodroid_dlsym (lib_handle, symbol_name, nullptr, nullptr); - if (entry_handle == nullptr) { - log_warn (LOG_ASSEMBLY, "Symbol '%s' not found in shared library '%s', p/invoke may fail", symbol_name, library_name); - return nullptr; - } - - return entry_handle; -} - -// `pinvoke_map_write_lock` MUST be held when calling this method -force_inline void* -MonodroidRuntime::load_library_entry (std::string const& library_name, std::string const& entrypoint_name, pinvoke_api_map_ptr api_map) noexcept -{ - // Make sure some other thread hasn't just added the entry - auto iter = api_map->find (entrypoint_name); - if (iter != api_map->end () && iter->second != nullptr) { - return iter->second; - } - - void *entry_handle = load_library_symbol (library_name.c_str (), entrypoint_name.c_str ()); - if (entry_handle == nullptr) { - // error already logged - return nullptr; - } - - log_debug (LOG_ASSEMBLY, "Caching p/invoke entry %s @ %s", library_name.c_str (), entrypoint_name.c_str ()); - (*api_map)[entrypoint_name] = entry_handle; - return entry_handle; -} - -force_inline void -MonodroidRuntime::load_library_entry (const char *library_name, const char *entrypoint_name, PinvokeEntry &entry, void **dso_handle) noexcept -{ - void *entry_handle = load_library_symbol (library_name, entrypoint_name, dso_handle); - void *expected_null = nullptr; - - bool already_loaded = !__atomic_compare_exchange ( - /* ptr */ &entry.func, - /* expected */ &expected_null, - /* desired */ &entry_handle, - /* weak */ false, - /* success_memorder */ __ATOMIC_ACQUIRE, - /* failure_memorder */ __ATOMIC_RELAXED - ); - - if (already_loaded) { - log_debug (LOG_ASSEMBLY, "Entry '%s' from library '%s' already loaded by another thread", entrypoint_name, library_name); - } -} - -force_inline void* -MonodroidRuntime::fetch_or_create_pinvoke_map_entry (std::string const& library_name, std::string const& entrypoint_name, hash_t entrypoint_name_hash, pinvoke_api_map_ptr api_map, bool need_lock) noexcept -{ - auto iter = api_map->find (entrypoint_name, entrypoint_name_hash); - if (iter != api_map->end () && iter->second != nullptr) { - return iter->second; - } - - if (!need_lock) { - return load_library_entry (library_name, entrypoint_name, api_map); - } - - StartupAwareLock lock (pinvoke_map_write_lock); - return load_library_entry (library_name, entrypoint_name, api_map); -} - -force_inline PinvokeEntry* -MonodroidRuntime::find_pinvoke_address (hash_t hash, const PinvokeEntry *entries, size_t entry_count) noexcept -{ - while (entry_count > 0) { - const PinvokeEntry *ret = entries + (entry_count / 2); - - std::strong_ordering result = hash <=> ret->hash; - if (result < 0) { - entry_count /= 2; - } else if (result > 0) { - entries = ret + 1; - entry_count -= entry_count / 2 + 1; - } else { - return const_cast(ret); - } - } - - return nullptr; -} - -force_inline void* -MonodroidRuntime::handle_other_pinvoke_request (const char *library_name, hash_t library_name_hash, const char *entrypoint_name, hash_t entrypoint_name_hash) noexcept -{ - std::string lib_name {library_name}; - std::string entry_name {entrypoint_name}; - - auto iter = other_pinvoke_map.find (lib_name, library_name_hash); - void *handle = nullptr; - if (iter == other_pinvoke_map.end ()) { - StartupAwareLock lock (pinvoke_map_write_lock); - - pinvoke_api_map_ptr lib_map; - // Make sure some other thread hasn't just added the map - iter = other_pinvoke_map.find (lib_name, library_name_hash); - if (iter == other_pinvoke_map.end () || iter->second == nullptr) { - lib_map = new pinvoke_api_map (1); - other_pinvoke_map[lib_name] = lib_map; - } else { - lib_map = iter->second; - } - - handle = fetch_or_create_pinvoke_map_entry (lib_name, entry_name, entrypoint_name_hash, lib_map, /* need_lock */ false); - } else { - if (iter->second == nullptr) [[unlikely]] { - log_warn (LOG_ASSEMBLY, "Internal error: null entry in p/invoke map for key '%s'", library_name); - return nullptr; // fall back to `monodroid_dlopen` - } - - handle = fetch_or_create_pinvoke_map_entry (lib_name, entry_name, entrypoint_name_hash, iter->second, /* need_lock */ true); - } - - return handle; -} - -void* -MonodroidRuntime::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) -{ - if (library_name == nullptr || entrypoint_name == nullptr) { - return nullptr; - } - - hash_t library_name_hash = xxhash::hash (library_name, strlen (library_name)); - hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); - - if (library_name_hash == java_interop_library_hash || library_name_hash == xa_internal_api_library_hash) { - PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes, internal_pinvokes_count); - - if (entry == nullptr) [[unlikely]] { - log_fatal (LOG_ASSEMBLY, "Internal p/invoke symbol '%s @ %s' (hash: 0x%zx) not found in compile-time map.", library_name, entrypoint_name, entrypoint_hash); - log_fatal (LOG_ASSEMBLY, "compile-time map contents:"); - for (size_t i = 0; i < internal_pinvokes_count; i++) { - PinvokeEntry const& e = internal_pinvokes[i]; - log_fatal (LOG_ASSEMBLY, "\t'%s'=%p (hash: 0x%zx)", e.name, e.func, e.hash); - } - Helpers::abort_application (); - } - - return entry->func; - } - - // The order of statements below should be kept in the descending probability of occurrence order (as much as - // possible, of course). `libSystem.Native` is requested during early startup for each MAUI app, so its - // probability is higher, just as it's more likely that `libSystem.Security.Cryptography.Android` will be used - // in an app rather than `libSystem.IO.Compression.Native` - void **dotnet_dso_handle; // Set to a non-null value only for dotnet shared libraries - if (library_name_hash == system_native_library_hash) { - dotnet_dso_handle = &system_native_library_handle; - } else if (library_name_hash == system_security_cryptography_native_android_library_hash) { - dotnet_dso_handle = &system_security_cryptography_native_android_library_handle; - } else if (library_name_hash == system_io_compression_native_library_hash) { - dotnet_dso_handle = &system_io_compression_native_library_handle; - } else { - dotnet_dso_handle = nullptr; - } - - if (dotnet_dso_handle != nullptr) { - PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes, dotnet_pinvokes_count); - if (entry != nullptr) { - if (entry->func != nullptr) { - return entry->func; - } - - load_library_entry (library_name, entrypoint_name, *entry, dotnet_dso_handle); - if (entry->func == nullptr) { - log_fatal (LOG_ASSEMBLY, "Failed to load symbol '%s' from shared library '%s'", entrypoint_name, library_name); - return nullptr; // let Mono deal with the fallout - } - - return entry->func; - } - - // It's possible we don't have an entry for some `dotnet` p/invoke, fall back to the slow path below - log_debug (LOG_ASSEMBLY, "Symbol '%s' in library '%s' not found in the generated tables, falling back to slow path", entrypoint_name, library_name); - } - - return handle_other_pinvoke_request (library_name, library_name_hash, entrypoint_name, entrypoint_hash); -} diff --git a/src/native/monodroid/pinvoke-tables.include b/src/native/monodroid/pinvoke-tables.include deleted file mode 100644 index b422e0917a6..00000000000 --- a/src/native/monodroid/pinvoke-tables.include +++ /dev/null @@ -1,993 +0,0 @@ -// -// Autogenarated file. DO NOT EDIT. -// -// To regenerate run ../../../build-tools/scripts/generate-pinvoke-tables.sh on Linux or macOS -// A compiler with support for C++20 ranges is required -// - -#include - -#if INTPTR_MAX == INT64_MAX -//64-bit internal p/invoke table -static PinvokeEntry internal_pinvokes[] = { - {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, - {0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, - {0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, - {0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, - {0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, - {0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, - {0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, - {0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, - {0x3c5532ecdab53f89, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, - {0x423c8f539a2c56d2, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, - {0x4b1956138764939a, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, - {0x4d5b5b488f736058, "path_combine", reinterpret_cast(&path_combine)}, - {0x5a2614d15e2fdc2e, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, - {0x5f0b4e426eff086b, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, - {0x709af13cbfbe2e75, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, - {0x70ae32c9a4f1ad2c, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, - {0x70fc9bab8d56666d, "create_public_directory", reinterpret_cast(&create_public_directory)}, - {0x78514771a67ad724, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, - {0x9099a4b95e3c3a89, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, - {0x958cdb6fd9d1b67b, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, - {0xa6ec846592d99536, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, - {0xa7f58f3ee428cc6b, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, - {0xae3df96dda0143bd, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, - {0xb6222d90af401865, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, - {0xb8306f71b963cd3d, "monodroid_log", reinterpret_cast(&monodroid_log)}, - {0xbc90bafd5ff9c99e, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, - {0xbe5a300beec69c35, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, - {0xbfbb924fbe190616, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, - {0xc2a21d3f6c8ccc24, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, - {0xc5b4690e13898fa3, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, - {0xcc873ea8493d1dd5, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, - {0xce439cfbe29dec11, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, - {0xd1e121b94ea63f2e, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, - {0xd5151b00eb33d85e, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, - {0xda517ef392b6a888, "java_interop_free", reinterpret_cast(&java_interop_free)}, - {0xe27b9849b7e982cb, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0xe370a0d91cd63bc0, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, - {0xe78f1161604ae672, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, - {0xe86307aac9a2631a, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, - {0xebc2c68e10075cc9, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, - {0xee83e38e479aeff1, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, - {0xf3048baf83034541, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, - {0xf41c48df6f9be476, "monodroid_free", reinterpret_cast(&monodroid_free)}, - {0xf5a918ef520db207, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, - {0xf5ed87b004005892, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, - {0xf8798f762db15bba, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, - {0xfa90326712e7e7c4, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, - {0xfdc17c4ea8335ffd, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0xff010b3140f54d3f, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, -}; -//64-bit DotNet p/invoke table -static PinvokeEntry dotnet_pinvokes[] = { - {0x99f2ee02463000, "CompressionNative_Crc32", nullptr}, - {0xb38afc8bfe830b, "SystemNative_Bind", nullptr}, - {0x190fe65d8736dcb, "SystemNative_TryGetIPPacketInformation", nullptr}, - {0x1c8b86562ad5772, "SystemNative_Receive", nullptr}, - {0x202543f28ecaf06, "SystemNative_Abort", nullptr}, - {0x25abeafa88904a2, "SystemNative_SetPosixSignalHandler", nullptr}, - {0x33158212a812caf, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, - {0x3511e36d0a6c1b5, "SystemNative_LockFileRegion", nullptr}, - {0x375a0e90c77ca35, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, - {0x37b9dd562235e42, "SystemNative_MSync", nullptr}, - {0x3a5df4793dd3230, "SystemNative_INotifyInit", nullptr}, - {0x581df5b0a00c422, "SystemNative_SetRLimit", nullptr}, - {0x598db66ca39c41f, "AndroidCryptoNative_EcKeyUpRef", nullptr}, - {0x5b5ab451ff38f8e, "SystemNative_GetMaximumAddressSize", nullptr}, - {0x656cac62ccc9e3c, "AndroidCryptoNative_X509GetContentType", nullptr}, - {0x6861b5336291d12, "SystemNative_PathConf", nullptr}, - {0x690c4347972024f, "AndroidCryptoNative_Aes256Gcm", nullptr}, - {0x6a1f4deffa02c30, "SystemNative_LowLevelMonitor_Acquire", nullptr}, - {0x7b5579ab0499b1f, "AndroidCryptoNative_RsaSize", nullptr}, - {0x7ce8a9b967dd269, "SystemNative_Read", nullptr}, - {0x7f0e1227c9c0225, "CryptoNative_EvpMdCtxDestroy", nullptr}, - {0x8352ae4bba2b83b, "SystemNative_SetSendTimeout", nullptr}, - {0x98bd27a7461321d, "SystemNative_Dup", nullptr}, - {0x9a39fbf59eed9f9, "CryptoNative_EvpSha1", nullptr}, - {0xa4aeeaff9ca2d10, "BrotliDecoderDecompressStream", nullptr}, - {0xa906c14ca5834bc, "SystemNative_GetEUid", nullptr}, - {0xac9f9c1abb62a92, "SystemNative_Log", nullptr}, - {0xadb2441bcfcdfe9, "SystemNative_CreateThread", nullptr}, - {0xafbf5c69d1badc0, "SystemNative_SetTerminalInvalidationHandler", nullptr}, - {0xba897b7abe67b16, "SystemNative_FcntlSetPipeSz", nullptr}, - {0xc305c22ce7ab8a0, "SystemNative_SetSockOpt", nullptr}, - {0xc79e924361c15ca, "SystemNative_RealPath", nullptr}, - {0xcaba893801c6a6f, "AndroidCryptoNative_Aes256Ecb", nullptr}, - {0xcbe6d3d22131194, "AndroidCryptoNative_SetRsaParameters", nullptr}, - {0xef8dd67e25bac53, "SystemNative_GetWindowSize", nullptr}, - {0xfa0899cf8d00a87, "SystemNative_MkDir", nullptr}, - {0xfe7079441ac127e, "SystemNative_CreateSocketEventPort", nullptr}, - {0x1027786cdd9a3e9c, "AndroidCryptoNative_Aes192Cbc", nullptr}, - {0x10d733abd1fd94bb, "SystemNative_TryChangeSocketEventRegistration", nullptr}, - {0x114b8384553f5418, "SystemNative_GetSystemTimeAsTicks", nullptr}, - {0x11b6f4f0aafeda95, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, - {0x11cc73f2926d4064, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, - {0x121bc483ac26f5f8, "SystemNative_GetGroupName", nullptr}, - {0x12d65f9f65b01497, "SystemNative_GetRawSockOpt", nullptr}, - {0x12eaf09505dc19fd, "SystemNative_FStat", nullptr}, - {0x13577369f5ec4b0a, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, - {0x1399413d8a7d9dd8, "SystemNative_GetAddressFamily", nullptr}, - {0x13a1c2de7fb2519f, "SystemNative_CloseSocketEventPort", nullptr}, - {0x146cd1dc4fb2ba58, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, - {0x14b7e3527b60e83f, "CryptoNative_ErrErrorStringN", nullptr}, - {0x15bd710d3a9b3b0c, "CryptoNative_EvpDigestFinalEx", nullptr}, - {0x176e22ea7c580dae, "SystemNative_ReadDirR", nullptr}, - {0x185f5d25252c3c72, "SystemNative_FAllocate", nullptr}, - {0x18f7da5f584b5b59, "SystemNative_PReadV", nullptr}, - {0x1948a0cf88329c2f, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, - {0x1ac95b02f23933cc, "SystemNative_CanGetHiddenFlag", nullptr}, - {0x1d1bb0528d517729, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, - {0x1d4dcbc06728e689, "SystemNative_Close", nullptr}, - {0x1d6d4278ffbbab77, "SystemNative_Pipe", nullptr}, - {0x1d8d6a688fc5bfb3, "SystemNative_SendFile", nullptr}, - {0x1e6228e955989698, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, - {0x1e8edcc515cd23f9, "CryptoNative_EvpDigestOneShot", nullptr}, - {0x1f1c61a157636aad, "SystemNative_Stat", nullptr}, - {0x1f45ac9d3c6b1554, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, - {0x1f7d2360a1cdcbff, "AndroidCryptoNative_SSLStreamCreate", nullptr}, - {0x1f849e45a3014a9f, "SystemNative_GetIPv6Address", nullptr}, - {0x1f9361fc7b624c1b, "SystemNative_LowLevelMonitor_Wait", nullptr}, - {0x205a31e661496019, "CryptoNative_ErrGetErrorAlloc", nullptr}, - {0x20784dcc7e9cee75, "BrotliGetTransforms", nullptr}, - {0x218fce505a140c55, "AndroidCryptoNative_EcDsaVerify", nullptr}, - {0x2291e0ba4e1b55b0, "SystemNative_LStat", nullptr}, - {0x23ac2a4c4d1c744e, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, - {0x24f840f903a26ded, "SystemNative_ConvertErrorPalToPlatform", nullptr}, - {0x24ff74e427d0626e, "SystemNative_GetErrNo", nullptr}, - {0x254905036a0061cf, "SystemNative_CreateSocketEventBuffer", nullptr}, - {0x255c4a2e297fd9f5, "SystemNative_INotifyAddWatch", nullptr}, - {0x267c94097a3bf1f3, "AndroidCryptoNative_CipherDestroy", nullptr}, - {0x27944922cd8283ca, "CryptoNative_EvpSha384", nullptr}, - {0x2795a01c2c64aea1, "CryptoNative_HmacReset", nullptr}, - {0x27f3d9266af2b315, "SystemNative_GetIPv4Address", nullptr}, - {0x2925953889c48cab, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, - {0x2a49948ae20571cb, "SystemNative_SchedGetAffinity", nullptr}, - {0x2c352dd7c367e438, "CryptoNative_EvpSha512", nullptr}, - {0x2c7e5e179cc917cb, "AndroidCryptoNative_DsaSizeSignature", nullptr}, - {0x2c8da1192c5d7d2b, "SystemNative_FLock", nullptr}, - {0x2d64b1ac218cf29e, "SystemNative_AlignedRealloc", nullptr}, - {0x2e1102c297588e10, "BrotliEncoderDestroyInstance", nullptr}, - {0x2e429d96a9fc92bd, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, - {0x2fdcf708ff792105, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, - {0x307db94ae9f929e5, "CryptoNative_GetMaxMdSize", nullptr}, - {0x31027564deeb71b0, "AndroidCryptoNative_Aes128Cbc", nullptr}, - {0x3319a5483b3cc1fc, "SystemNative_GetRLimit", nullptr}, - {0x3424ffcb69ecef57, "SystemNative_Unlink", nullptr}, - {0x346a9bb11364833c, "SystemNative_DrainAutoreleasePool", nullptr}, - {0x35169e67cc0f8529, "SystemNative_GetIPv6MulticastOption", nullptr}, - {0x359205b4a10fa780, "SystemNative_LowLevelMonitor_Destroy", nullptr}, - {0x35c1fa8dffcbbd8c, "CryptoNative_EvpDigestReset", nullptr}, - {0x36128eed665b1923, "SystemNative_ShmUnlink", nullptr}, - {0x364dcf65ae63adff, "SystemNative_GetSocketErrorOption", nullptr}, - {0x3757b327944abb54, "SystemNative_EnablePosixSignalHandling", nullptr}, - {0x38b4bd21127ceffd, "SystemNative_StrErrorR", nullptr}, - {0x38c7de719e8ae69d, "SystemNative_RmDir", nullptr}, - {0x391bbbb9bbde4455, "SystemNative_SetIPv4MulticastOption", nullptr}, - {0x3a7245f3ea476bf7, "SystemNative_SNPrintF", nullptr}, - {0x3ae92e4198427b0d, "SystemNative_ReadLink", nullptr}, - {0x3e0de839e6cfa6e5, "SystemNative_Accept", nullptr}, - {0x3e7cf9a4789a31c7, "SystemNative_FChflags", nullptr}, - {0x3f19a16a3230b551, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, - {0x3f49b6278f04ae84, "SystemNative_Disconnect", nullptr}, - {0x3fba15600bf0f229, "SystemNative_SetEUid", nullptr}, - {0x401935ffc3454bb1, "AndroidCryptoNative_X509PublicKey", nullptr}, - {0x403e1bc0b3baba84, "CompressionNative_Inflate", nullptr}, - {0x40bfa1211f5f6f9c, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, - {0x41b6e7f32da99fa9, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, - {0x41c169fb0e30a390, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, - {0x41c1f2c9153639af, "SystemNative_FUTimens", nullptr}, - {0x420718c398131a55, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, - {0x42339dd2717504d9, "SystemNative_GetLingerOption", nullptr}, - {0x42783107bf2935ec, "SystemNative_FreeHostEntry", nullptr}, - {0x42eb0578a9d62b78, "SystemNative_GetFormatInfoForMountPoint", nullptr}, - {0x43741165a5ba60d5, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, - {0x44ccb27979f980ce, "SystemNative_AlignedAlloc", nullptr}, - {0x44f1a5c46033eec2, "SystemNative_SysLog", nullptr}, - {0x469898c8d892af83, "BrotliEncoderCompress", nullptr}, - {0x483b434d7b089c7e, "SystemNative_Write", nullptr}, - {0x4845e1c76265acc9, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, - {0x484a3a445bdb14fc, "SystemNative_GetOSArchitecture", nullptr}, - {0x4909639a9d87bdb5, "SystemNative_AlignedFree", nullptr}, - {0x49e3ba95feb79c6c, "SystemNative_SetAddressFamily", nullptr}, - {0x4a7272ac9d117f2d, "AndroidCryptoNative_EcKeyDestroy", nullptr}, - {0x4b00795bbeea6f60, "SystemNative_SetIPv6Address", nullptr}, - {0x4be7ceca50f3298c, "SystemNative_LowLevelMonitor_Create", nullptr}, - {0x4bec4a1d7dfd4cf7, "SystemNative_GetUnixRelease", nullptr}, - {0x4bfff22801b209ca, "SystemNative_LChflags", nullptr}, - {0x4c22cc4f2b1dab26, "SystemNative_SetPriority", nullptr}, - {0x4c5d96426f92c29d, "CryptoNative_HmacUpdate", nullptr}, - {0x4d6361e5095cff36, "AndroidCryptoNative_DsaSign", nullptr}, - {0x4d74053b37e582fa, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, - {0x501daf7e3a890220, "AndroidCryptoNative_X509ChainBuild", nullptr}, - {0x523240c01d14ad50, "SystemNative_GetPeerID", nullptr}, - {0x52794f1118d32f08, "SystemNative_GetUnixVersion", nullptr}, - {0x52fc107ebdb6fcc7, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, - {0x5381564d2c06c0a3, "SystemNative_SysConf", nullptr}, - {0x556bc89d2d4dfc85, "SystemNative_GetDeviceIdentifiers", nullptr}, - {0x558250d199e906bb, "CryptoNative_ErrReasonErrorString", nullptr}, - {0x5592a052ceb4caf6, "SystemNative_GetProcessPath", nullptr}, - {0x55fe2620f63d83d8, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, - {0x574d77a68ec3e488, "SystemNative_GetEnv", nullptr}, - {0x5755d1cd0c158620, "BrotliDecoderSetParameter", nullptr}, - {0x580dda20ac9e83c6, "BrotliEncoderSetParameter", nullptr}, - {0x583db0344a1cd715, "SystemNative_GetActiveUdpListeners", nullptr}, - {0x5908581fe73717f0, "SystemNative_InterfaceNameToIndex", nullptr}, - {0x5916efc3e1e49137, "CryptoNative_ErrPeekError", nullptr}, - {0x5a114024ecd1162c, "CryptoNative_EvpDigestUpdate", nullptr}, - {0x5a305cf2a314d6a6, "SystemNative_FTruncate", nullptr}, - {0x5a337d9cc7d8bcfd, "CryptoNative_HmacCurrent", nullptr}, - {0x5d503db70d17dad2, "BrotliEncoderIsFinished", nullptr}, - {0x5dd1d1d024378765, "CryptoNative_EvpMdSize", nullptr}, - {0x5e53b688fede3216, "SystemNative_GetControlCharacters", nullptr}, - {0x5fa62856bdbba9c0, "SystemNative_GetPort", nullptr}, - {0x5fd29ac523ff6e3d, "AndroidCryptoNative_SSLStreamRelease", nullptr}, - {0x5ffae3c8023a80b8, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, - {0x600b4418896f7808, "SystemNative_Exit", nullptr}, - {0x6089f0c8112eb3d9, "SystemNative_InitializeConsoleBeforeRead", nullptr}, - {0x613307e537d462db, "SystemNative_GetReadDirRBufferSize", nullptr}, - {0x61bacd7170fd8c9b, "SystemNative_SchedSetAffinity", nullptr}, - {0x61f3ce1b18b20d6f, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, - {0x62351df42d842942, "SystemNative_GetSignalForBreak", nullptr}, - {0x6393d30aceaa6df2, "SystemNative_PWriteV", nullptr}, - {0x639e6e938ec8d9f2, "SystemNative_GetPeerUserName", nullptr}, - {0x6448f0806bd3a338, "SystemNative_FreeEnviron", nullptr}, - {0x648a9b317bc64fe0, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, - {0x650eddee76c6b8da, "SystemNative_GetHostName", nullptr}, - {0x652badfba5d61929, "SystemNative_FcntlSetFD", nullptr}, - {0x66e049fe27bf91ea, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, - {0x6792c0a7ea5d19c9, "BrotliEncoderTakeOutput", nullptr}, - {0x67a8868ef592a3fd, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, - {0x67a9b5bbce322f8c, "AndroidCryptoNative_Des3Cbc", nullptr}, - {0x67d2cd86792b1d0c, "SystemNative_Realloc", nullptr}, - {0x67e9d60481f4be06, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, - {0x68df81a8fb5bf442, "SystemNative_GetSockOpt", nullptr}, - {0x68f3fe6083c0355b, "SystemNative_GetLoadLibraryError", nullptr}, - {0x69ad99fac0467f64, "SystemNative_Link", nullptr}, - {0x6a59d9242cd31785, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, - {0x6b9097385aa77917, "SystemNative_FSync", nullptr}, - {0x6b9bce16ba8e845f, "SystemNative_Malloc", nullptr}, - {0x6d566e1f6e5a2d8f, "BrotliDefaultAllocFunc", nullptr}, - {0x6dbd90e9cc86310b, "AndroidCryptoNative_CipherFinalEx", nullptr}, - {0x6dfd40c2dd0d7382, "AndroidCryptoNative_RsaUpRef", nullptr}, - {0x6e2c1caff08e6e2d, "SystemNative_ReadStdin", nullptr}, - {0x6ee05d5e8650e56c, "SystemNative_DisablePosixSignalHandling", nullptr}, - {0x6f990f1f7bc80630, "AndroidCryptoNative_RsaCreate", nullptr}, - {0x70f907b97d3fe059, "AndroidCryptoNative_Aes192Ccm", nullptr}, - {0x7150f0eb40797bb3, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, - {0x724820d307055ed1, "CryptoNative_HmacFinal", nullptr}, - {0x729afe37cdb8ae8f, "SystemNative_Connect", nullptr}, - {0x730ae9a7469a7321, "SystemNative_GetAllMountPoints", nullptr}, - {0x7356b141407d261e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, - {0x742da00b2dbf435d, "SystemNative_LoadLibrary", nullptr}, - {0x74ec4a8d869776ad, "AndroidCryptoNative_Aes128Ccm", nullptr}, - {0x758dfbf057da0da0, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, - {0x7975d1d7029cf1a3, "AndroidCryptoNative_Aes128Gcm", nullptr}, - {0x79f5c24afbd04af1, "AndroidCryptoNative_Aes256Cbc", nullptr}, - {0x7a37e0d077f2dfe5, "AndroidCryptoNative_DsaGenerateKey", nullptr}, - {0x7af1f52a7a632e95, "BrotliDecoderTakeOutput", nullptr}, - {0x7d5273ad530e7298, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, - {0x7d7ee4bce74d4de9, "SystemNative_GetDomainSocketSizes", nullptr}, - {0x7e1766c6df3ad261, "SystemNative_MUnmap", nullptr}, - {0x7e4bdf46d4ff9f11, "SystemNative_MkNod", nullptr}, - {0x7ec328b6ba9eab8a, "SystemNative_WaitForSocketEvents", nullptr}, - {0x7fa96d0284954375, "AndroidCryptoNative_X509Decode", nullptr}, - {0x80ef5040fdcc248d, "BrotliEncoderMaxCompressedSize", nullptr}, - {0x813bedf08c3388d4, "AndroidCryptoNative_Aes128Cfb8", nullptr}, - {0x84b5542f0da03584, "SystemNative_GetIPSocketAddressSizes", nullptr}, - {0x84c8a7489b37fea0, "SystemNative_GetPlatformSignalNumber", nullptr}, - {0x84cc0301870c37ce, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, - {0x8502eeba98158e79, "SystemNative_FcntlSetIsNonBlocking", nullptr}, - {0x8530d37777969db6, "SystemNative_SetKeypadXmit", nullptr}, - {0x8537eeb56d41402b, "CompressionNative_DeflateReset", nullptr}, - {0x85d0033bc38bb4bb, "SystemNative_MAdvise", nullptr}, - {0x868e09dc7dfea364, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, - {0x870191ad244b8069, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, - {0x87019b7831c0c34c, "AndroidCryptoNative_Aes192Gcm", nullptr}, - {0x87c447e7f873cff0, "AndroidCryptoNative_X509ChainValidate", nullptr}, - {0x889350f209555ecb, "SystemNative_MkdTemp", nullptr}, - {0x88a08b60b80c70cc, "SystemNative_FChMod", nullptr}, - {0x88cfeefc903f9d60, "CryptoNative_EvpDigestCurrent", nullptr}, - {0x8bcabce135063bed, "SystemNative_OpenDir", nullptr}, - {0x8df448aee6e8fa5e, "SystemNative_WaitPidExitedNoHang", nullptr}, - {0x8e96cb02418947cc, "SystemNative_FcntlGetPipeSz", nullptr}, - {0x8fb6ed14ee0256bc, "SystemNative_GetTimestamp", nullptr}, - {0x8ffe2d950d138c01, "SystemNative_SchedGetCpu", nullptr}, - {0x9039632237d70ae7, "AndroidCryptoNative_NewGlobalReference", nullptr}, - {0x9161ade1206fd86e, "AndroidCryptoNative_Aes256Cfb128", nullptr}, - {0x9167a072639a7c95, "AndroidCryptoNative_Aes256Ccm", nullptr}, - {0x91f065ec0d3aec55, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, - {0x93a8bec488055608, "SystemNative_GetPwNamR", nullptr}, - {0x95a0e2fc5c0cb49e, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, - {0x95a4cb8563cc6b14, "SystemNative_ShmOpen", nullptr}, - {0x9856fa59ed936b73, "SystemNative_GetSid", nullptr}, - {0x996ada1c038aabba, "SystemNative_MksTemps", nullptr}, - {0x9991a277809ef205, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, - {0x99a840c495204202, "SystemNative_GetBytesAvailable", nullptr}, - {0x99e3660fc483d7be, "CryptoNative_GetRandomBytes", nullptr}, - {0x9aa9eaee3dd8b23b, "SystemNative_GetIPv4MulticastOption", nullptr}, - {0x9aaaad33b28af82f, "SystemNative_SetSignalForBreak", nullptr}, - {0x9aab07f824659d3e, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, - {0x9c3e8b890033819a, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, - {0x9c832cd7fcbf2de0, "SystemNative_MkFifo", nullptr}, - {0x9d2cb31282abd3d9, "SystemNative_GetNetworkInterfaces", nullptr}, - {0x9e25ebf4f61cc299, "SystemNative_ChDir", nullptr}, - {0x9e79166979634030, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, - {0x9edddf30d660eff4, "AndroidCryptoNative_Aes192Ecb", nullptr}, - {0x9fb01da1222e905a, "SystemNative_IsATty", nullptr}, - {0xa1e881a63614507e, "SystemNative_INotifyRemoveWatch", nullptr}, - {0xa2254fea4d8b6909, "SystemNative_MMap", nullptr}, - {0xa272b5349013d9ef, "CryptoNative_EvpSha256", nullptr}, - {0xa2d7790a850024c0, "SystemNative_GetNumRoutes", nullptr}, - {0xa302613a430248b8, "SystemNative_GetGroups", nullptr}, - {0xa308025a784497df, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, - {0xa56532a23755cd87, "SystemNative_StdinReady", nullptr}, - {0xa56954e28eb9a9c9, "AndroidCryptoNative_Des3Cfb8", nullptr}, - {0xa57e18f82abd5958, "BrotliDecoderDestroyInstance", nullptr}, - {0xa5eda72b95fe78c3, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, - {0xa89b70c38d3ba079, "CryptoNative_HmacCreate", nullptr}, - {0xa89ec9958d999483, "SystemNative_GetCwd", nullptr}, - {0xa8bdc3e7ee898dfc, "SystemNative_Shutdown", nullptr}, - {0xa93eb533acf7564d, "AndroidCryptoNative_DesEcb", nullptr}, - {0xa961e8db31830e16, "AndroidCryptoNative_Aes192Cfb8", nullptr}, - {0xabdcf2f74d210f35, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, - {0xac11eab9d9c31b01, "SystemNative_UTimensat", nullptr}, - {0xac7725c652a5fb5b, "SystemNative_CopyFile", nullptr}, - {0xad1a2d6575cdd4e3, "AndroidCryptoNative_SSLStreamWrite", nullptr}, - {0xad228cdc4edb11d6, "SystemNative_CloseDir", nullptr}, - {0xadc6889903a2d6f4, "SystemNative_Rename", nullptr}, - {0xae320903718eb45d, "SystemNative_MapTcpState", nullptr}, - {0xaf72b94c4acee897, "BrotliDecoderHasMoreOutput", nullptr}, - {0xaf9706efc72c3904, "SystemNative_SetIPv6MulticastOption", nullptr}, - {0xafd9f6338cdbadd4, "SystemNative_GetHostEntryForName", nullptr}, - {0xafe3d21bbaa71464, "CompressionNative_DeflateEnd", nullptr}, - {0xb0b66a7145de350d, "SystemNative_Access", nullptr}, - {0xb0df46ff09c57741, "AndroidCryptoNative_GetRsaParameters", nullptr}, - {0xb0e18377ed603e0b, "SystemNative_GetGroupList", nullptr}, - {0xb1c394b9992bd67d, "AndroidCryptoNative_EcDsaSign", nullptr}, - {0xb1ff12f3bd735982, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, - {0xb361006446f560e8, "SystemNative_LogError", nullptr}, - {0xb3e1e5e50cde576e, "BrotliEncoderVersion", nullptr}, - {0xb41fa43cc5c261cb, "BrotliDecoderGetErrorCode", nullptr}, - {0xb4996dd1aba38200, "AndroidCryptoNative_EcDsaSize", nullptr}, - {0xb516027cb59e6541, "BrotliDecoderIsFinished", nullptr}, - {0xb575ec01a7a79f8f, "AndroidCryptoNative_DesCfb8", nullptr}, - {0xb600c44028c1743d, "SystemNative_Socket", nullptr}, - {0xb632e9bc6f7be0a9, "SystemNative_GetSockName", nullptr}, - {0xb6540b73eff28747, "SystemNative_SetRawSockOpt", nullptr}, - {0xb66be1550d27bfb4, "AndroidCryptoNative_GetECCurveParameters", nullptr}, - {0xb69c3cc8b9f6a724, "BrotliDecoderIsUsed", nullptr}, - {0xb6ab9abf7887911f, "SystemNative_ReadEvents", nullptr}, - {0xb73c597de01bc0b2, "SystemNative_GetPwUidR", nullptr}, - {0xb78af5975603cd20, "SystemNative_Sync", nullptr}, - {0xb7bbbe2c16a565c6, "SystemNative_Calloc", nullptr}, - {0xb828d9e7df5437a5, "BrotliDecoderErrorString", nullptr}, - {0xba2f6d298f3be8bc, "CryptoNative_EvpMd5", nullptr}, - {0xbb3343826d504870, "SystemNative_GetBootTimeTicks", nullptr}, - {0xbb5e970ecb6745da, "SystemNative_SymLink", nullptr}, - {0xbbd20cce92ec2c12, "SystemNative_FcntlGetFD", nullptr}, - {0xbcd9e53d2d288094, "SystemNative_GetNameInfo", nullptr}, - {0xbd5a0be2f7904089, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, - {0xbd89ef4df5486744, "SystemNative_Send", nullptr}, - {0xbdbbd2898347c0d1, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, - {0xbdd3128e77381b01, "SystemNative_EnumerateInterfaceAddresses", nullptr}, - {0xbe8df478de07c6d8, "BrotliDefaultFreeFunc", nullptr}, - {0xc00ebc097b776c1f, "SystemNative_GetPriority", nullptr}, - {0xc036b23d88fad91b, "SystemNative_iOSSupportVersion", nullptr}, - {0xc0bb2dd0c5b74436, "CryptoNative_EnsureOpenSslInitialized", nullptr}, - {0xc10e411c989a9314, "CompressionNative_Deflate", nullptr}, - {0xc11cd661db8be230, "AndroidCryptoNative_Des3Cfb64", nullptr}, - {0xc183a0550feea0d6, "BrotliEncoderCompressStream", nullptr}, - {0xc19b94823ea1d39e, "CryptoNative_HmacOneShot", nullptr}, - {0xc1b8a5f1c799e4bb, "BrotliGetDictionary", nullptr}, - {0xc1c679eefc134d31, "SystemNative_LowLevelMonitor_Release", nullptr}, - {0xc2d5e1c465b2f5b6, "AndroidCryptoNative_DsaSizeP", nullptr}, - {0xc3145e336c38379b, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, - {0xc3c10021b10ba455, "SystemNative_GetEGid", nullptr}, - {0xc3fe9394fe1f3f02, "SystemNative_GetSocketType", nullptr}, - {0xc560d9947ab2a34d, "SystemNative_RegisterForSigChld", nullptr}, - {0xc5bed971846027de, "SystemNative_GetCpuUtilization", nullptr}, - {0xc69433678dd341ca, "SystemNative_ForkAndExecProcess", nullptr}, - {0xc7815e0476511544, "AndroidCryptoNative_X509Encode", nullptr}, - {0xc7ae1b8d93af5d73, "SystemNative_ChMod", nullptr}, - {0xc7d536c0e7eb3fe2, "SystemNative_FreeSocketEventBuffer", nullptr}, - {0xc7f81d5b58b65ac0, "BrotliEncoderCreateInstance", nullptr}, - {0xc87a5ee4869035c6, "SystemNative_UninitializeConsoleAfterRead", nullptr}, - {0xc8a52a8b6d96b32b, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, - {0xc93df58ae5457bfd, "SystemNative_GetControlMessageBufferSize", nullptr}, - {0xc956e528f995739c, "SystemNative_ReceiveMessage", nullptr}, - {0xca001af79c0d7a8b, "CompressionNative_InflateEnd", nullptr}, - {0xca48c3927c202794, "AndroidCryptoNative_GetECKeyParameters", nullptr}, - {0xcaae6d345ba32c7b, "SystemNative_Kill", nullptr}, - {0xcaec08aa13779f7f, "SystemNative_GetEnviron", nullptr}, - {0xcaf599a20538b10b, "SystemNative_SetWindowSize", nullptr}, - {0xcb4bcdafdc81d116, "AndroidCryptoNative_CipherCreatePartial", nullptr}, - {0xcbbb90469d28cded, "SystemNative_SearchPath", nullptr}, - {0xcc433093c073719e, "AndroidCryptoNative_SSLStreamRead", nullptr}, - {0xcc43d880192dd6ff, "SystemNative_ConvertErrorPlatformToPal", nullptr}, - {0xcc788c0474c3e178, "SystemNative_LSeek", nullptr}, - {0xcd5d8a63493f5e38, "CompressionNative_InflateInit2_", nullptr}, - {0xcdcb014df9a6eae2, "SystemNative_SetPort", nullptr}, - {0xce36e2e1a139a020, "SystemNative_GetDefaultTimeZone", nullptr}, - {0xce6ddfe40fed99d9, "SystemNative_PRead", nullptr}, - {0xce9f8a6ac705faa5, "AndroidCryptoNative_X509DecodeCollection", nullptr}, - {0xceba527295694651, "BrotliDecoderCreateInstance", nullptr}, - {0xd392d6ed5dcc111c, "SystemNative_GetDomainName", nullptr}, - {0xd55437b16dc84f3b, "SystemNative_GetIPv4GlobalStatistics", nullptr}, - {0xd5c063a90ae882c1, "AndroidCryptoNative_CipherIsSupported", nullptr}, - {0xd7d818c7640598dc, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, - {0xd7f1a8f616897ace, "AndroidCryptoNative_Aes256Cfb8", nullptr}, - {0xd88be8f9e9f28e90, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, - {0xd8976692c4c68818, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, - {0xd8a9e47b6ca78448, "CryptoNative_ErrPeekLastError", nullptr}, - {0xd9bd0b370726ce34, "AndroidCryptoNative_CipherReset", nullptr}, - {0xda05c57c78aa6706, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, - {0xda38bffa1d16cdd6, "SystemNative_SetLingerOption", nullptr}, - {0xda4898a26933f73d, "AndroidCryptoNative_DsaVerify", nullptr}, - {0xda6b3192974ca60e, "SystemNative_Open", nullptr}, - {0xdab5eb45815daabc, "SystemNative_GetAtOutOfBandMark", nullptr}, - {0xdae32aac0c0d305c, "SystemNative_ReadProcessStatusInfo", nullptr}, - {0xdbb4752ed23670f0, "AndroidCryptoNative_DesCbc", nullptr}, - {0xdbee22594fa8c585, "SystemNative_CreateAutoreleasePool", nullptr}, - {0xdc51159ffe70b0e0, "BrotliDecoderVersion", nullptr}, - {0xdd4c03f06ce96e04, "AndroidCryptoNative_RsaDestroy", nullptr}, - {0xdde06993f87d6ffc, "AndroidCryptoNative_Aes128Cfb128", nullptr}, - {0xde1e22dd097f799c, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, - {0xde259001bf54e6f1, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, - {0xdec5c7544d2c8cb1, "AndroidCryptoNative_GetDsaParameters", nullptr}, - {0xdf650444c8af0763, "SystemNative_FcntlGetIsNonBlocking", nullptr}, - {0xdfede2defd776f7e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, - {0xe059239741e0011a, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, - {0xe0a170d2b947a8fc, "SystemNative_SendMessage", nullptr}, - {0xe0a601fd89d9b279, "SystemNative_SetErrNo", nullptr}, - {0xe0f34ce89fd38aef, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, - {0xe20c29fb8b19da7b, "SystemNative_Listen", nullptr}, - {0xe36a157177b2db08, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, - {0xe44f737a5bebdd90, "SystemNative_SetIPv4Address", nullptr}, - {0xe582a4a60bb74c35, "SystemNative_GetProcAddress", nullptr}, - {0xe604fca300068c0c, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, - {0xe6838f2add787bfe, "SystemNative_FreeLibrary", nullptr}, - {0xe73aeaf9e3a10343, "SystemNative_PWrite", nullptr}, - {0xe78ff100d1d73d99, "SystemNative_SetReceiveTimeout", nullptr}, - {0xe853ecfe4d402ed0, "SystemNative_Poll", nullptr}, - {0xea5e6653389b924a, "CompressionNative_DeflateInit2_", nullptr}, - {0xea61d6c040267b2d, "BrotliSetDictionaryData", nullptr}, - {0xeaafb7963ceb9bf4, "SystemNative_GetTcpGlobalStatistics", nullptr}, - {0xeab45239fb3f138d, "AndroidCryptoNative_GetBigNumBytes", nullptr}, - {0xead798b3c60b390e, "CompressionNative_InflateReset", nullptr}, - {0xec67e4076662c2de, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, - {0xef71ee101b3ece96, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, - {0xeff5d014640ae969, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, - {0xf0045895a9043221, "SystemNative_SearchPath_TempDirectory", nullptr}, - {0xf0ec052da6c5fa70, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, - {0xf1577384f409ea85, "AndroidCryptoNative_BigNumToBinary", nullptr}, - {0xf2c7fa39bf166188, "SystemNative_Free", nullptr}, - {0xf38b47e43f352491, "SystemNative_GetUdpGlobalStatistics", nullptr}, - {0xf432f105a045b088, "CryptoNative_ErrClearError", nullptr}, - {0xf4dea312f71c5ff2, "AndroidCryptoNative_Aes128Ecb", nullptr}, - {0xf4f5526ddc32beac, "CryptoNative_HmacDestroy", nullptr}, - {0xf57f81262f07542c, "AndroidCryptoNative_Des3Ecb", nullptr}, - {0xf6ede5d5d8729315, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, - {0xf75d4fdd6e749a84, "BrotliTransformDictionaryWord", nullptr}, - {0xf7b334768844b502, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, - {0xf85b8ffeba9b06c1, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, - {0xf870179a8d8d1872, "SystemNative_PosixFAdvise", nullptr}, - {0xf8c983dd21ef9fe6, "SystemNative_GetPid", nullptr}, - {0xf96bc1e7e15e69f2, "AndroidCryptoNative_CipherUpdate", nullptr}, - {0xf970881d4fa83e07, "AndroidCryptoNative_CipherCreate", nullptr}, - {0xf9c3d216226b3355, "AndroidCryptoNative_CipherSetTagLength", nullptr}, - {0xf9dea6e72f1fffc9, "CryptoNative_EvpMdCtxCreate", nullptr}, - {0xfa26b86cedf66721, "SystemNative_Sysctl", nullptr}, - {0xfaa7766eaa2c54a5, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, - {0xfb3e394cc613f202, "SystemNative_GetPeerName", nullptr}, - {0xfbb57319454b1074, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, - {0xfc0bad2b1528000f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, - {0xfcdeea476953780c, "AndroidCryptoNative_Aes192Cfb128", nullptr}, - {0xfd2cdd99f11de76c, "AndroidCryptoNative_EcKeyGetSize", nullptr}, - {0xfd4f2784ec1c98aa, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, - {0xfe3dd06281f7cd1f, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, - {0xff28b3bec4f32a2c, "SystemNative_GetFileSystemType", nullptr}, - {0xff9b8d95b0e209fb, "BrotliEncoderHasMoreOutput", nullptr}, - {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, -}; - -constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; -constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; -constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; -constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; -constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; -#else -//32-bit internal p/invoke table -static PinvokeEntry internal_pinvokes[] = { - {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, - {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, - {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, - {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, - {0x2a0e1744, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, - {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, - {0x2f7d0f53, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, - {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, - {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, - {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, - {0x395808e5, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, - {0x42b41fe4, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, - {0x434ad3e4, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, - {0x4b58e0da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, - {0x501befde, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, - {0x501ebdc2, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, - {0x7a6909a0, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, - {0x7c94dbf5, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, - {0x8f6837ec, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, - {0x9070e02c, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, - {0x910452d0, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, - {0x934790b1, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, - {0x9a734f16, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, - {0x9b7b9290, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, - {0x9c5b24a8, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, - {0xa04e5d1c, "monodroid_free", reinterpret_cast(&monodroid_free)}, - {0xa11d71da, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, - {0xa7ea4a5f, "path_combine", reinterpret_cast(&path_combine)}, - {0xad511c82, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, - {0xb02468aa, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, - {0xbe8d7701, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, - {0xc0d097a7, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, - {0xc439b5d7, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, - {0xc5146c54, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, - {0xc58eafa5, "java_interop_free", reinterpret_cast(&java_interop_free)}, - {0xd3b5d2c1, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, - {0xd78c749d, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, - {0xd91f3619, "create_public_directory", reinterpret_cast(&create_public_directory)}, - {0xe215a17c, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, - {0xe4c3ee19, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, - {0xe7e77ca5, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, - {0xea2184e3, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, - {0xf4079b4a, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, - {0xf5a0ac55, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, - {0xf61941c3, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, - {0xf6ca4b3b, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, - {0xfa1832a6, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, - {0xfa4e32ca, "monodroid_log", reinterpret_cast(&monodroid_log)}, - {0xfdc3ae2a, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, -}; -//32-bit DotNet p/invoke table -static PinvokeEntry dotnet_pinvokes[] = { - {0xaf6b1c, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, - {0xc89820, "CompressionNative_InflateReset", nullptr}, - {0x1733089, "SystemNative_SetTerminalInvalidationHandler", nullptr}, - {0x1dd1f00, "AndroidCryptoNative_Aes192Cfb8", nullptr}, - {0x23a0578, "AndroidCryptoNative_NewGlobalReference", nullptr}, - {0x2f05496, "SystemNative_GetPeerName", nullptr}, - {0x3295077, "SystemNative_MapTcpState", nullptr}, - {0x3d9bc5f, "SystemNative_Unlink", nullptr}, - {0x3e12cb4, "SystemNative_INotifyInit", nullptr}, - {0x5b0fb1d, "SystemNative_InitializeConsoleBeforeRead", nullptr}, - {0x80f30b4, "BrotliDecoderTakeOutput", nullptr}, - {0x84ccf89, "SystemNative_MSync", nullptr}, - {0x8c636a2, "SystemNative_FcntlSetPipeSz", nullptr}, - {0x8de5b3d, "SystemNative_GetSid", nullptr}, - {0x92bf2d9, "AndroidCryptoNative_EcKeyGetSize", nullptr}, - {0xaa46d20, "SystemNative_SNPrintF", nullptr}, - {0xaa7c86e, "SystemNative_Exit", nullptr}, - {0xb6a80bd, "SystemNative_SetAddressFamily", nullptr}, - {0xbdd984d, "SystemNative_SetWindowSize", nullptr}, - {0xcc59904, "CryptoNative_HmacDestroy", nullptr}, - {0xd5ca844, "SystemNative_CreateSocketEventPort", nullptr}, - {0xd98d741, "SystemNative_Kill", nullptr}, - {0xfc48476, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, - {0x10d108c9, "SystemNative_FreeHostEntry", nullptr}, - {0x1165644f, "SystemNative_GetOSArchitecture", nullptr}, - {0x11778651, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, - {0x1178ebdd, "CryptoNative_EvpDigestFinalEx", nullptr}, - {0x11a2796d, "SystemNative_GetTcpGlobalStatistics", nullptr}, - {0x12fdf5c3, "SystemNative_ConvertErrorPlatformToPal", nullptr}, - {0x1348bf25, "AndroidCryptoNative_SSLStreamWrite", nullptr}, - {0x1376985b, "SystemNative_SetSockOpt", nullptr}, - {0x13925de2, "SystemNative_GetLingerOption", nullptr}, - {0x13f565a9, "SystemNative_GetControlMessageBufferSize", nullptr}, - {0x142a08a1, "SystemNative_PosixFAdvise", nullptr}, - {0x17549123, "SystemNative_Connect", nullptr}, - {0x17a5d095, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, - {0x17b96c39, "SystemNative_FreeSocketEventBuffer", nullptr}, - {0x1904820d, "SystemNative_GetHostEntryForName", nullptr}, - {0x19b6a696, "AndroidCryptoNative_X509DecodeCollection", nullptr}, - {0x1a302b28, "SystemNative_SchedSetAffinity", nullptr}, - {0x1ab1248e, "SystemNative_GetHostName", nullptr}, - {0x1bf277c4, "SystemNative_WaitForSocketEvents", nullptr}, - {0x1c4778bf, "SystemNative_AlignedFree", nullptr}, - {0x1cb466df, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, - {0x1cf7b52c, "SystemNative_MAdvise", nullptr}, - {0x1eb6eaaa, "CryptoNative_GetRandomBytes", nullptr}, - {0x1ebc63c1, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, - {0x1f186646, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, - {0x1f1cd573, "AndroidCryptoNative_Des3Cfb64", nullptr}, - {0x1f998744, "AndroidCryptoNative_Aes128Cfb128", nullptr}, - {0x1fdcd1e0, "CryptoNative_ErrPeekError", nullptr}, - {0x212e38c4, "SystemNative_GetUdpGlobalStatistics", nullptr}, - {0x22011e2b, "SystemNative_SetLingerOption", nullptr}, - {0x224ebd71, "SystemNative_Listen", nullptr}, - {0x2253b591, "BrotliGetTransforms", nullptr}, - {0x226eec4d, "SystemNative_Abort", nullptr}, - {0x229f73d4, "AndroidCryptoNative_RsaUpRef", nullptr}, - {0x22bbb587, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, - {0x2304e65b, "SystemNative_SetRLimit", nullptr}, - {0x23cfcfb0, "BrotliTransformDictionaryWord", nullptr}, - {0x260a3e8d, "CompressionNative_DeflateInit2_", nullptr}, - {0x289b5430, "SystemNative_Log", nullptr}, - {0x28d95a99, "SystemNative_CanGetHiddenFlag", nullptr}, - {0x28f3db4b, "SystemNative_ShmUnlink", nullptr}, - {0x2af6aa40, "SystemNative_Access", nullptr}, - {0x2b117055, "BrotliDecoderDecompress", nullptr}, - {0x2b7293c5, "SystemNative_GetTimestamp", nullptr}, - {0x2b747a9c, "SystemNative_MkNod", nullptr}, - {0x2bc9ff5e, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, - {0x2c4415fd, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, - {0x2c467430, "AndroidCryptoNative_GetECCurveParameters", nullptr}, - {0x2d21ad97, "SystemNative_GetReadDirRBufferSize", nullptr}, - {0x2d6e4a1c, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, - {0x2e66f31b, "BrotliDecoderDestroyInstance", nullptr}, - {0x2eb28fb6, "SystemNative_GetIPv4Address", nullptr}, - {0x2ff73621, "CryptoNative_ErrReasonErrorString", nullptr}, - {0x30af09b7, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, - {0x31120969, "SystemNative_Malloc", nullptr}, - {0x3374b950, "SystemNative_GetLoadLibraryError", nullptr}, - {0x349c5a8f, "SystemNative_GetNetworkInterfaces", nullptr}, - {0x354aa58f, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, - {0x363c0010, "CryptoNative_EvpDigestUpdate", nullptr}, - {0x367eee31, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, - {0x38575bc5, "SystemNative_GetUnixRelease", nullptr}, - {0x388a31d4, "SystemNative_PathConf", nullptr}, - {0x3a238b9f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, - {0x3a861d34, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, - {0x3af56a10, "AndroidCryptoNative_RsaSize", nullptr}, - {0x3bf3d465, "SystemNative_GetIPv6MulticastOption", nullptr}, - {0x3cb49aae, "SystemNative_GetPwNamR", nullptr}, - {0x3d150bdf, "AndroidCryptoNative_Aes128Ecb", nullptr}, - {0x3da52690, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, - {0x3de52faf, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, - {0x3df8d649, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, - {0x3e175e7c, "AndroidCryptoNative_Aes256Cfb128", nullptr}, - {0x3e273961, "SystemNative_StrErrorR", nullptr}, - {0x3e48f022, "SystemNative_GetMaximumAddressSize", nullptr}, - {0x3e778b38, "BrotliDecoderVersion", nullptr}, - {0x3ea31c40, "SystemNative_GetAddressFamily", nullptr}, - {0x3efdb5a0, "SystemNative_SendMessage", nullptr}, - {0x3f47618f, "CryptoNative_EnsureOpenSslInitialized", nullptr}, - {0x3f793993, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, - {0x40b0026c, "CompressionNative_DeflateEnd", nullptr}, - {0x40e64bdd, "CryptoNative_ErrClearError", nullptr}, - {0x413b9801, "SystemNative_Read", nullptr}, - {0x41818c1d, "SystemNative_GetPriority", nullptr}, - {0x41cf0c16, "AndroidCryptoNative_CipherCreate", nullptr}, - {0x42955366, "SystemNative_Disconnect", nullptr}, - {0x42afcfbb, "AndroidCryptoNative_CipherCreatePartial", nullptr}, - {0x430352b3, "SystemNative_GetNameInfo", nullptr}, - {0x43f6cea1, "AndroidCryptoNative_DesCfb8", nullptr}, - {0x4543d533, "AndroidCryptoNative_EcDsaVerify", nullptr}, - {0x45f09dca, "AndroidCryptoNative_CipherSetTagLength", nullptr}, - {0x477f60cf, "SystemNative_OpenDir", nullptr}, - {0x47a82b4e, "SystemNative_AlignedRealloc", nullptr}, - {0x48c17c9b, "SystemNative_Sysctl", nullptr}, - {0x493888ee, "CompressionNative_Crc32", nullptr}, - {0x494ef6d4, "SystemNative_GetIPv4MulticastOption", nullptr}, - {0x496f1885, "SystemNative_GetSocketErrorOption", nullptr}, - {0x49c2af32, "SystemNative_GetBootTimeTicks", nullptr}, - {0x49c81782, "SystemNative_MkDir", nullptr}, - {0x4a4ef46f, "SystemNative_FcntlGetFD", nullptr}, - {0x4b78d330, "CryptoNative_HmacCurrent", nullptr}, - {0x4c6d50ba, "SystemNative_GetIPv4GlobalStatistics", nullptr}, - {0x4ca38207, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, - {0x4cb997ae, "BrotliEncoderCompress", nullptr}, - {0x4d1a35d1, "SystemNative_LowLevelMonitor_Release", nullptr}, - {0x4d75bb15, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, - {0x4dbf0c74, "SystemNative_CreateSocketEventBuffer", nullptr}, - {0x4e4d4f2a, "SystemNative_SetIPv6Address", nullptr}, - {0x4f6011da, "SystemNative_GetPort", nullptr}, - {0x4f6c3726, "SystemNative_FcntlGetIsNonBlocking", nullptr}, - {0x50309413, "SystemNative_GetPeerUserName", nullptr}, - {0x50e88639, "CryptoNative_HmacUpdate", nullptr}, - {0x514e739b, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, - {0x52590509, "AndroidCryptoNative_Aes128Cbc", nullptr}, - {0x526c9f90, "SystemNative_GetNumRoutes", nullptr}, - {0x52896a81, "SystemNative_ChMod", nullptr}, - {0x5600bd0d, "AndroidCryptoNative_SSLStreamCreate", nullptr}, - {0x561fb6ff, "SystemNative_FStat", nullptr}, - {0x56993aa9, "SystemNative_SetKeypadXmit", nullptr}, - {0x57bdcc46, "SystemNative_Open", nullptr}, - {0x581adfc6, "SystemNative_GetSignalForBreak", nullptr}, - {0x5906e1ba, "SystemNative_Close", nullptr}, - {0x591c5746, "AndroidCryptoNative_EcKeyUpRef", nullptr}, - {0x59840533, "AndroidCryptoNative_X509Decode", nullptr}, - {0x5989ad17, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, - {0x599921d3, "SystemNative_SysConf", nullptr}, - {0x59b67f4d, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, - {0x59e712d5, "SystemNative_MkdTemp", nullptr}, - {0x5a492732, "SystemNative_FcntlSetFD", nullptr}, - {0x5ccc38dd, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, - {0x5e9ef1a2, "SystemNative_GetAtOutOfBandMark", nullptr}, - {0x5eb4f827, "SystemNative_LockFileRegion", nullptr}, - {0x5ed67634, "SystemNative_GetPwUidR", nullptr}, - {0x5f706f52, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, - {0x5fc58bed, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, - {0x60571eb9, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, - {0x6068baa0, "AndroidCryptoNative_GetRsaParameters", nullptr}, - {0x608ee1a5, "SystemNative_Calloc", nullptr}, - {0x60c353e5, "SystemNative_SetPosixSignalHandler", nullptr}, - {0x613c0080, "AndroidCryptoNative_Aes192Ccm", nullptr}, - {0x626db703, "SystemNative_LStat", nullptr}, - {0x6288dd9a, "SystemNative_SetSignalForBreak", nullptr}, - {0x62a36e75, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, - {0x639b2b1d, "AndroidCryptoNative_DsaVerify", nullptr}, - {0x6436999d, "AndroidCryptoNative_SSLStreamRead", nullptr}, - {0x6441bc65, "CryptoNative_EvpSha256", nullptr}, - {0x64f12e5b, "BrotliDecoderIsFinished", nullptr}, - {0x661c5218, "SystemNative_GetDomainName", nullptr}, - {0x6661a841, "BrotliDecoderDecompressStream", nullptr}, - {0x674bdf7f, "SystemNative_DisablePosixSignalHandling", nullptr}, - {0x679dd832, "SystemNative_SetPort", nullptr}, - {0x679f9b4e, "SystemNative_FcntlGetPipeSz", nullptr}, - {0x67de0842, "SystemNative_Dup", nullptr}, - {0x687726ff, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, - {0x68bdc398, "SystemNative_INotifyAddWatch", nullptr}, - {0x68c949a0, "AndroidCryptoNative_X509GetContentType", nullptr}, - {0x68f9f52f, "AndroidCryptoNative_CipherIsSupported", nullptr}, - {0x6907c8eb, "BrotliEncoderSetParameter", nullptr}, - {0x6adb646e, "SystemNative_ReadDirR", nullptr}, - {0x6b5343a0, "SystemNative_SetErrNo", nullptr}, - {0x6bbd3d10, "SystemNative_GetRLimit", nullptr}, - {0x6be1e33d, "SystemNative_EnumerateInterfaceAddresses", nullptr}, - {0x6cda2cf8, "SystemNative_SetSendTimeout", nullptr}, - {0x6d48392a, "SystemNative_Stat", nullptr}, - {0x6ece5fe6, "SystemNative_GetPid", nullptr}, - {0x6ef4e421, "AndroidCryptoNative_CipherDestroy", nullptr}, - {0x6f695cb8, "SystemNative_RmDir", nullptr}, - {0x6fa886b1, "SystemNative_GetSockName", nullptr}, - {0x708e7911, "SystemNative_SetIPv4Address", nullptr}, - {0x70d4f7e6, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, - {0x70e91ddd, "SystemNative_FChMod", nullptr}, - {0x71698a7f, "SystemNative_GetDomainSocketSizes", nullptr}, - {0x7243c4b4, "AndroidCryptoNative_Des3Cfb8", nullptr}, - {0x759f5b1e, "AndroidCryptoNative_Aes256Cfb8", nullptr}, - {0x75b11f61, "BrotliDecoderGetErrorCode", nullptr}, - {0x76e97b2e, "SystemNative_Rename", nullptr}, - {0x77cb373b, "SystemNative_GetIPSocketAddressSizes", nullptr}, - {0x78c1eb52, "AndroidCryptoNative_Des3Ecb", nullptr}, - {0x7a0529c1, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, - {0x7ad3b820, "AndroidCryptoNative_Aes192Cfb128", nullptr}, - {0x7cb19137, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, - {0x7d0c477d, "CryptoNative_ErrPeekLastError", nullptr}, - {0x7d2bb98a, "SystemNative_MksTemps", nullptr}, - {0x7de70253, "SystemNative_ConvertErrorPalToPlatform", nullptr}, - {0x7e882ae5, "BrotliEncoderIsFinished", nullptr}, - {0x7f5d9e25, "SystemNative_MUnmap", nullptr}, - {0x80deced4, "SystemNative_CreateAutoreleasePool", nullptr}, - {0x81a5efac, "SystemNative_SetEUid", nullptr}, - {0x82484cbf, "CryptoNative_EvpDigestOneShot", nullptr}, - {0x8289a6f7, "BrotliDefaultFreeFunc", nullptr}, - {0x83dad9bf, "SystemNative_Pipe", nullptr}, - {0x83db1b72, "CryptoNative_EvpDigestCurrent", nullptr}, - {0x84662605, "CompressionNative_Deflate", nullptr}, - {0x8526c9e8, "SystemNative_SetRawSockOpt", nullptr}, - {0x8574b133, "AndroidCryptoNative_Aes192Ecb", nullptr}, - {0x88a7558d, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, - {0x8bdaf06c, "SystemNative_GetWindowSize", nullptr}, - {0x8bfcd7ba, "CompressionNative_Inflate", nullptr}, - {0x8d38b733, "SystemNative_LSeek", nullptr}, - {0x8f4e59f1, "SystemNative_ReadStdin", nullptr}, - {0x909e12ee, "SystemNative_SearchPath", nullptr}, - {0x910b7740, "SystemNative_GetFormatInfoForMountPoint", nullptr}, - {0x913a3d68, "SystemNative_GetDeviceIdentifiers", nullptr}, - {0x9216d936, "SystemNative_GetGroupName", nullptr}, - {0x94477030, "AndroidCryptoNative_Aes256Ccm", nullptr}, - {0x95e99740, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, - {0x960d4fc0, "SystemNative_GetDefaultTimeZone", nullptr}, - {0x966f54af, "CryptoNative_EvpSha384", nullptr}, - {0x9787b4b4, "CryptoNative_EvpMdSize", nullptr}, - {0x98105435, "SystemNative_GetIPv6Address", nullptr}, - {0x984edaf1, "AndroidCryptoNative_RsaDestroy", nullptr}, - {0x9852b0fa, "SystemNative_INotifyRemoveWatch", nullptr}, - {0x98954db8, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, - {0x98ca7f1c, "SystemNative_ChDir", nullptr}, - {0x990163b4, "SystemNative_Receive", nullptr}, - {0x996952b3, "AndroidCryptoNative_CipherFinalEx", nullptr}, - {0x9a005080, "SystemNative_Bind", nullptr}, - {0x9a84ffd3, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, - {0x9abfce84, "SystemNative_GetEnviron", nullptr}, - {0x9bda7eb1, "SystemNative_ReadProcessStatusInfo", nullptr}, - {0x9cd6cae8, "AndroidCryptoNative_SSLStreamRelease", nullptr}, - {0x9d102d58, "CompressionNative_InflateEnd", nullptr}, - {0x9d7f4af6, "SystemNative_ReceiveMessage", nullptr}, - {0x9dc3baed, "SystemNative_LowLevelMonitor_Destroy", nullptr}, - {0x9e366e9c, "SystemNative_InterfaceNameToIndex", nullptr}, - {0x9e717f20, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, - {0x9f47b32d, "SystemNative_ShmOpen", nullptr}, - {0xa0db1858, "SystemNative_GetEnv", nullptr}, - {0xa1295a9f, "SystemNative_MkFifo", nullptr}, - {0xa1bec9da, "SystemNative_LogError", nullptr}, - {0xa1d774fc, "BrotliEncoderHasMoreOutput", nullptr}, - {0xa2430b33, "SystemNative_SearchPath_TempDirectory", nullptr}, - {0xa25daa0e, "BrotliSetDictionaryData", nullptr}, - {0xa2d2f390, "SystemNative_TryChangeSocketEventRegistration", nullptr}, - {0xa4636764, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, - {0xa477c74e, "SystemNative_TryGetIPPacketInformation", nullptr}, - {0xa635da0f, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, - {0xa691d151, "AndroidCryptoNative_Aes192Cbc", nullptr}, - {0xa72ce322, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, - {0xa826eabe, "SystemNative_FcntlSetIsNonBlocking", nullptr}, - {0xa829138a, "SystemNative_GetProcessPath", nullptr}, - {0xa8701bcf, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, - {0xa8da7ba1, "BrotliEncoderVersion", nullptr}, - {0xa936bc40, "AndroidCryptoNative_EcDsaSize", nullptr}, - {0xa9c29be5, "SystemNative_SetIPv6MulticastOption", nullptr}, - {0xa9c84a4a, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, - {0xaa2f32ad, "SystemNative_FTruncate", nullptr}, - {0xab37a684, "CryptoNative_HmacCreate", nullptr}, - {0xab3d1641, "AndroidCryptoNative_DesEcb", nullptr}, - {0xabe6739f, "BrotliGetDictionary", nullptr}, - {0xacc26fa4, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, - {0xacc28460, "SystemNative_GetProcAddress", nullptr}, - {0xad7fbde5, "SystemNative_FUTimens", nullptr}, - {0xae443204, "SystemNative_GetSockOpt", nullptr}, - {0xae449ad1, "BrotliDecoderIsUsed", nullptr}, - {0xafb02e71, "BrotliEncoderMaxCompressedSize", nullptr}, - {0xb01e9c27, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, - {0xb030a893, "SystemNative_LowLevelMonitor_Acquire", nullptr}, - {0xb0e270a0, "BrotliEncoderDestroyInstance", nullptr}, - {0xb22a12be, "BrotliEncoderCreateInstance", nullptr}, - {0xb26f05b6, "SystemNative_PWrite", nullptr}, - {0xb2965ccd, "CryptoNative_GetMaxMdSize", nullptr}, - {0xb2985645, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, - {0xb4110b14, "AndroidCryptoNative_DsaGenerateKey", nullptr}, - {0xb427959c, "SystemNative_FLock", nullptr}, - {0xb439ebdb, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, - {0xb444f04a, "SystemNative_Accept", nullptr}, - {0xb448a24a, "SystemNative_SymLink", nullptr}, - {0xb4e5c37d, "SystemNative_UTimensat", nullptr}, - {0xb5a5754a, "SystemNative_UninitializeConsoleAfterRead", nullptr}, - {0xb5db6a51, "SystemNative_PWriteV", nullptr}, - {0xb628f475, "SystemNative_GetBytesAvailable", nullptr}, - {0xb7041ffa, "SystemNative_GetControlCharacters", nullptr}, - {0xb7cc3cd1, "AndroidCryptoNative_DesCbc", nullptr}, - {0xb80f233c, "SystemNative_FSync", nullptr}, - {0xb84914f1, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, - {0xb862b34e, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, - {0xb884b933, "SystemNative_StdinReady", nullptr}, - {0xb96c2133, "SystemNative_GetErrNo", nullptr}, - {0xb97add7d, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, - {0xb9e6cb2c, "SystemNative_RealPath", nullptr}, - {0xba284ef4, "CryptoNative_EvpSha1", nullptr}, - {0xbb06f5e1, "AndroidCryptoNative_Aes192Gcm", nullptr}, - {0xbb25ff40, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, - {0xbb2ca4f3, "SystemNative_Link", nullptr}, - {0xbb92466f, "SystemNative_AlignedAlloc", nullptr}, - {0xbd658356, "CryptoNative_ErrErrorStringN", nullptr}, - {0xbdbf2140, "SystemNative_SchedGetAffinity", nullptr}, - {0xbec8a3f2, "SystemNative_FChflags", nullptr}, - {0xbf4eeb78, "AndroidCryptoNative_GetBigNumBytes", nullptr}, - {0xbf9766c3, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, - {0xbfa0ce53, "SystemNative_GetPlatformSignalNumber", nullptr}, - {0xbfaad12d, "BrotliDecoderSetParameter", nullptr}, - {0xc090b1d3, "CryptoNative_EvpSha512", nullptr}, - {0xc0d66913, "SystemNative_GetUnixVersion", nullptr}, - {0xc11dec94, "SystemNative_FAllocate", nullptr}, - {0xc1243135, "AndroidCryptoNative_Aes128Gcm", nullptr}, - {0xc1e4e6f6, "AndroidCryptoNative_BigNumToBinary", nullptr}, - {0xc25ffc33, "BrotliEncoderCompressStream", nullptr}, - {0xc3812682, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, - {0xc3dcc3a0, "AndroidCryptoNative_SetRsaParameters", nullptr}, - {0xc3e6ff56, "SystemNative_LowLevelMonitor_Create", nullptr}, - {0xc475f41c, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, - {0xc4ac1723, "AndroidCryptoNative_Aes256Cbc", nullptr}, - {0xc55548f2, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, - {0xc57b40fa, "SystemNative_LoadLibrary", nullptr}, - {0xc6d5929c, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, - {0xc6f2fb9e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, - {0xc717b16e, "CryptoNative_EvpMdCtxDestroy", nullptr}, - {0xc746b70c, "AndroidCryptoNative_DsaSign", nullptr}, - {0xc7f0668d, "CompressionNative_DeflateReset", nullptr}, - {0xc83527e0, "CryptoNative_HmacReset", nullptr}, - {0xc89ccd22, "SystemNative_SchedGetCpu", nullptr}, - {0xc8cce896, "SystemNative_GetSocketType", nullptr}, - {0xc8e06b20, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, - {0xc9b017c8, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, - {0xca5aab33, "SystemNative_Sync", nullptr}, - {0xcb458400, "CryptoNative_ErrGetErrorAlloc", nullptr}, - {0xcb746e5c, "SystemNative_SetIPv4MulticastOption", nullptr}, - {0xcb85cd8e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, - {0xccc0dd15, "SystemNative_RegisterForSigChld", nullptr}, - {0xcdfb627d, "SystemNative_FreeLibrary", nullptr}, - {0xce91e293, "SystemNative_GetGroupList", nullptr}, - {0xcf9bcc75, "AndroidCryptoNative_Aes256Gcm", nullptr}, - {0xcfa9e6f1, "AndroidCryptoNative_GetDsaParameters", nullptr}, - {0xcff9b341, "SystemNative_GetSystemTimeAsTicks", nullptr}, - {0xd199e841, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, - {0xd24d4849, "SystemNative_Socket", nullptr}, - {0xd298c3b3, "SystemNative_Write", nullptr}, - {0xd378ba49, "CryptoNative_EvpMd5", nullptr}, - {0xd473c64c, "SystemNative_SetReceiveTimeout", nullptr}, - {0xd4b91180, "SystemNative_ForkAndExecProcess", nullptr}, - {0xd6d7b4fb, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, - {0xd71d8c66, "AndroidCryptoNative_Aes256Ecb", nullptr}, - {0xd7ee326b, "AndroidCryptoNative_EcKeyDestroy", nullptr}, - {0xd818a523, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, - {0xd9458396, "BrotliDecoderCreateInstance", nullptr}, - {0xdaaa19b2, "SystemNative_GetAllMountPoints", nullptr}, - {0xdac67152, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, - {0xdad29aeb, "AndroidCryptoNative_CipherUpdate", nullptr}, - {0xdaf0460a, "SystemNative_SendFile", nullptr}, - {0xdbbf4917, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, - {0xdbdce4ef, "BrotliDefaultAllocFunc", nullptr}, - {0xdbe13a57, "SystemNative_GetCpuUtilization", nullptr}, - {0xdc3cbeec, "CryptoNative_HmacOneShot", nullptr}, - {0xdcaddb21, "AndroidCryptoNative_GetECKeyParameters", nullptr}, - {0xdd274c15, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, - {0xdd445632, "AndroidCryptoNative_X509ChainValidate", nullptr}, - {0xddd58443, "SystemNative_PReadV", nullptr}, - {0xdea9b9dc, "SystemNative_EnablePosixSignalHandling", nullptr}, - {0xdf4f1977, "AndroidCryptoNative_X509PublicKey", nullptr}, - {0xdf80df75, "SystemNative_iOSSupportVersion", nullptr}, - {0xe121bac7, "SystemNative_GetPeerID", nullptr}, - {0xe169faa6, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, - {0xe1b8b44f, "SystemNative_Send", nullptr}, - {0xe2a0d0de, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, - {0xe4a78efb, "SystemNative_SetPriority", nullptr}, - {0xe4dba4f6, "SystemNative_GetCwd", nullptr}, - {0xe4f87d25, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, - {0xe50c82b4, "SystemNative_CreateThread", nullptr}, - {0xe58ed8fe, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, - {0xe5ef37b3, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, - {0xe770cb3f, "SystemNative_CopyFile", nullptr}, - {0xe7a9a106, "CompressionNative_InflateInit2_", nullptr}, - {0xe7bd8dd1, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, - {0xe890cf58, "AndroidCryptoNative_EcDsaSign", nullptr}, - {0xe8b2ec8d, "BrotliDecoderErrorString", nullptr}, - {0xe972fbd9, "SystemNative_GetEGid", nullptr}, - {0xea86f52f, "BrotliEncoderTakeOutput", nullptr}, - {0xeb0d0522, "SystemNative_LowLevelMonitor_Wait", nullptr}, - {0xebacbf92, "AndroidCryptoNative_Aes128Cfb8", nullptr}, - {0xec31140d, "BrotliDecoderHasMoreOutput", nullptr}, - {0xec51a1b4, "SystemNative_LChflags", nullptr}, - {0xed6cc182, "CryptoNative_EvpMdCtxCreate", nullptr}, - {0xee74a5ad, "AndroidCryptoNative_DsaSizeP", nullptr}, - {0xef48c2eb, "CryptoNative_EvpDigestReset", nullptr}, - {0xef5890c7, "AndroidCryptoNative_Des3Cbc", nullptr}, - {0xefb38c9f, "SystemNative_Poll", nullptr}, - {0xefd277f7, "CryptoNative_HmacFinal", nullptr}, - {0xf06b440b, "AndroidCryptoNative_DsaSizeSignature", nullptr}, - {0xf0919525, "AndroidCryptoNative_CipherReset", nullptr}, - {0xf0e499c4, "SystemNative_PRead", nullptr}, - {0xf1bb5b47, "SystemNative_ReadLink", nullptr}, - {0xf23e6314, "AndroidCryptoNative_RsaCreate", nullptr}, - {0xf2a49cf0, "SystemNative_CloseSocketEventPort", nullptr}, - {0xf39b1c3a, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, - {0xf3b9c879, "AndroidCryptoNative_X509Encode", nullptr}, - {0xf432ab33, "SystemNative_CloseDir", nullptr}, - {0xf4a5a1c8, "SystemNative_SysLog", nullptr}, - {0xf500c9d3, "SystemNative_GetActiveUdpListeners", nullptr}, - {0xf57828fb, "SystemNative_IsATty", nullptr}, - {0xf6141499, "AndroidCryptoNative_X509ChainBuild", nullptr}, - {0xf629d20f, "SystemNative_Shutdown", nullptr}, - {0xf6b01c6b, "SystemNative_FreeEnviron", nullptr}, - {0xf6bfedad, "SystemNative_ReadEvents", nullptr}, - {0xf91cf365, "AndroidCryptoNative_Aes128Ccm", nullptr}, - {0xf94a4828, "SystemNative_GetEUid", nullptr}, - {0xf993f426, "SystemNative_Free", nullptr}, - {0xfa97914b, "SystemNative_MMap", nullptr}, - {0xfad61722, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, - {0xfb89157f, "SystemNative_GetGroups", nullptr}, - {0xfc83423c, "SystemNative_GetRawSockOpt", nullptr}, - {0xfe2f2c47, "SystemNative_DrainAutoreleasePool", nullptr}, - {0xfeb6c5c7, "SystemNative_WaitPidExitedNoHang", nullptr}, - {0xff3b4cfa, "SystemNative_GetFileSystemType", nullptr}, - {0xff975200, "SystemNative_Realloc", nullptr}, -}; - -constexpr hash_t java_interop_library_hash = 0x6e36e350; -constexpr hash_t xa_internal_api_library_hash = 0x13c9bd62; -constexpr hash_t system_native_library_hash = 0x5b9ade60; -constexpr hash_t system_io_compression_native_library_hash = 0xafe3142c; -constexpr hash_t system_security_cryptography_native_android_library_hash = 0x93625cd; -#endif - -constexpr size_t internal_pinvokes_count = 49; -constexpr size_t dotnet_pinvokes_count = 428; diff --git a/src/native/monodroid/xa-internal-api-impl.hh b/src/native/monodroid/xa-internal-api-impl.hh deleted file mode 100644 index 51df4b41a1a..00000000000 --- a/src/native/monodroid/xa-internal-api-impl.hh +++ /dev/null @@ -1,54 +0,0 @@ -// Dear Emacs, this is a -*- C++ -*- header -#ifndef __XA_INTERNAL_API_IMPL_HH -#define __XA_INTERNAL_API_IMPL_HH - -#include "xa-internal-api.hh" - -namespace xamarin::android::internal -{ - class MonoAndroidInternalCalls_Impl final : public MonoAndroidInternalCalls - { - public: - virtual mono_bool monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up) final override; - virtual mono_bool monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast) final override; - virtual int monodroid_get_dns_servers (void **dns_servers_array) final override; - virtual int monodroid_getifaddrs (_monodroid_ifaddrs **ifap) final override; - virtual void monodroid_freeifaddrs (_monodroid_ifaddrs *ifa) final override; - virtual void monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit) final override; - virtual unsigned int monodroid_get_log_categories () final override; - virtual void monodroid_log (LogLevel level, LogCategories category, const char *message) final override; - virtual int monodroid_get_system_property (const char *name, char **value) final override; - virtual int monodroid_max_gref_get () final override; - virtual int monodroid_gref_get () final override; - virtual void monodroid_gref_log (const char *message) final override; - virtual int monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) final override; - virtual void monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) final override; - virtual int monodroid_weak_gref_get () final override; - virtual void monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) final override; - virtual void monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) final override; - virtual void monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) final override; - virtual void monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) final override; - virtual void monodroid_gc_wait_for_bridge_processing () final override; - virtual int monodroid_get_android_api_level () final override; - virtual void monodroid_clear_gdb_wait () final override; - virtual void* monodroid_get_identity_hash_code (JNIEnv *env, void *v) final override; - virtual void* monodroid_timezone_get_default_id () final override; - virtual void dump_counters (const char *format, va_list args) final override; - virtual int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) final override; - virtual managed_timing_sequence* monodroid_timing_start (const char *message) final override; - virtual void monodroid_timing_stop (managed_timing_sequence *sequence, const char *message) final override; - virtual void monodroid_strfreev (char **str_array) final override; - virtual char** monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens) final override; - virtual char* monodroid_strdup_printf (const char *format, va_list args) final override; - virtual char* monodroid_TypeManager_get_java_class_name (jclass klass) final override; - virtual void monodroid_store_package_name (const char *name) final override; - virtual int monodroid_get_namespaced_system_property (const char *name, char **value) final override; - virtual FILE* monodroid_fopen (const char* filename, const char* mode) final override; - virtual int send_uninterrupted (int fd, void *buf, int len) final override; - virtual int recv_uninterrupted (int fd, void *buf, int len) final override; - virtual void set_world_accessable (const char *path) final override; - virtual void create_public_directory (const char *dir) final override; - virtual char* path_combine (const char *path1, const char *path2) final override; - }; -} -#endif // __XA_INTERNAL_API_IMPL_HH diff --git a/src/native/monodroid/xa-internal-api.cc b/src/native/monodroid/xa-internal-api.cc deleted file mode 100644 index df1349c35c7..00000000000 --- a/src/native/monodroid/xa-internal-api.cc +++ /dev/null @@ -1,347 +0,0 @@ -#ifdef WINDOWS -#include -#include -#include -#include -#include -#include -#endif // defined(WINDOWS) - -#include "globals.hh" -#include "xa-internal-api-impl.hh" - -#if defined (WINDOWS) -#define WINDOWS_UNUSED_ARG [[maybe_unused]] -#else -#define WINDOWS_UNUSED_ARG -#endif - -using namespace xamarin::android; -using namespace xamarin::android::internal; - -void _monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit); -mono_bool _monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up); -mono_bool _monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast); -int _monodroid_get_dns_servers (void **dns_servers_array); -int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); -void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); - -mono_bool -MonoAndroidInternalCalls_Impl::monodroid_get_network_interface_up_state (WINDOWS_UNUSED_ARG const char *ifname, WINDOWS_UNUSED_ARG mono_bool *is_up) -{ -#ifdef WINDOWS - return FALSE; -#else // !defined(WINDOWS) - return ::_monodroid_get_network_interface_up_state (ifname, is_up); -#endif // defined(WINDOWS) -} - -mono_bool -MonoAndroidInternalCalls_Impl::monodroid_get_network_interface_supports_multicast (WINDOWS_UNUSED_ARG const char *ifname, WINDOWS_UNUSED_ARG mono_bool *supports_multicast) -{ -#ifdef WINDOWS - return FALSE; -#else // !defined(WINDOWS) - return ::_monodroid_get_network_interface_supports_multicast (ifname, supports_multicast); -#endif // defined(WINDOWS) -} - -int -MonoAndroidInternalCalls_Impl::monodroid_get_dns_servers (WINDOWS_UNUSED_ARG void **dns_servers_array) -{ -#ifdef WINDOWS - return FALSE; -#else // !defined(WINDOWS) - return ::_monodroid_get_dns_servers (dns_servers_array); -#endif // defined(WINDOWS) -} - -int -MonoAndroidInternalCalls_Impl::monodroid_getifaddrs (WINDOWS_UNUSED_ARG struct _monodroid_ifaddrs **ifap) -{ -#ifdef WINDOWS - return -1; -#else // !defined(WINDOWS) - return ::_monodroid_getifaddrs (ifap); -#endif // defined(WINDOWS) -} - -void -MonoAndroidInternalCalls_Impl::monodroid_freeifaddrs (WINDOWS_UNUSED_ARG struct _monodroid_ifaddrs *ifa) -{ -#ifndef WINDOWS - ::_monodroid_freeifaddrs (ifa); -#endif // defined(WINDOWS) -} - -void -MonoAndroidInternalCalls_Impl::monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit) -{ - ::_monodroid_detect_cpu_and_architecture (built_for_cpu, running_on_cpu, is64bit); -} - -unsigned int -MonoAndroidInternalCalls_Impl::monodroid_get_log_categories () -{ - return log_categories; -} - -void -MonoAndroidInternalCalls_Impl::monodroid_log (LogLevel level, LogCategories category, const char *message) -{ - switch (level) { - case LogLevel::Verbose: - case LogLevel::Debug: - log_debug_nocheck (category, message); - break; - - case LogLevel::Info: - log_info_nocheck (category, message); - break; - - case LogLevel::Warn: - case LogLevel::Silent: // warn is always printed - log_warn (category, message); - break; - - case LogLevel::Error: - log_error (category, message); - break; - - case LogLevel::Fatal: - log_fatal (category, message); - break; - - default: - case LogLevel::Unknown: - case LogLevel::Default: - log_info_nocheck (category, message); - break; - } -} - -int -MonoAndroidInternalCalls_Impl::monodroid_get_system_property (const char *name, char **value) -{ - return androidSystem.monodroid_get_system_property (name, value); -} - -int -MonoAndroidInternalCalls_Impl::monodroid_max_gref_get () -{ - return static_cast(androidSystem.get_max_gref_count ()); -} - -int -MonoAndroidInternalCalls_Impl::monodroid_gref_get () -{ - return osBridge.get_gc_gref_count (); -} - -int -MonoAndroidInternalCalls_Impl::monodroid_weak_gref_get () -{ - return osBridge.get_gc_weak_gref_count (); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_gref_log (const char *message) -{ - osBridge._monodroid_gref_log (message); -} - -int -MonoAndroidInternalCalls_Impl::monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) -{ - return osBridge._monodroid_gref_log_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_gref_log_delete (handle, type, threadName, threadId, from, from_writable); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_weak_gref_new (curHandle, curType, newHandle, newType, threadName, threadId, from, from_writable); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_weak_gref_delete (handle, type, threadName, threadId, from, from_writable); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_lref_log_new (lrefc, handle, type, threadName, threadId, from, from_writable); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) -{ - osBridge._monodroid_lref_log_delete (lrefc, handle, type, threadName, threadId, from, from_writable); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_gc_wait_for_bridge_processing () -{ - mono_gc_wait_for_bridge_processing (); -} - -int -MonoAndroidInternalCalls_Impl::monodroid_get_android_api_level () -{ - return monodroidRuntime.get_android_api_level (); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_clear_gdb_wait () -{ - monodroidRuntime.set_monodroid_gdb_wait (false); -} - -void* -MonoAndroidInternalCalls_Impl::monodroid_get_identity_hash_code (JNIEnv *env, void *v) -{ - intptr_t rv = env->CallStaticIntMethod (monodroidRuntime.get_java_class_System (), monodroidRuntime.get_java_class_method_System_identityHashCode (), v); - return (void*) rv; -} - -void* -MonoAndroidInternalCalls_Impl::monodroid_timezone_get_default_id () -{ - JNIEnv *env = osBridge.ensure_jnienv (); - jmethodID getDefault = env->GetStaticMethodID (monodroidRuntime.get_java_class_TimeZone (), "getDefault", "()Ljava/util/TimeZone;"); - jmethodID getID = env->GetMethodID (monodroidRuntime.get_java_class_TimeZone (), "getID", "()Ljava/lang/String;"); - jobject d = env->CallStaticObjectMethod (monodroidRuntime.get_java_class_TimeZone (), getDefault); - jstring id = reinterpret_cast (env->CallObjectMethod (d, getID)); - const char *mutf8 = env->GetStringUTFChars (id, nullptr); - char *def_id = strdup (mutf8); - - env->ReleaseStringUTFChars (id, mutf8); - env->DeleteLocalRef (id); - env->DeleteLocalRef (d); - - return def_id; -} - -void -MonoAndroidInternalCalls_Impl::dump_counters (const char *format, va_list args) -{ - monodroidRuntime.dump_counters_v (format, args); -} - -int -MonoAndroidInternalCalls_Impl::monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) -{ - embeddedAssemblies.set_assemblies_prefix (prefix); - return 0; -} - -managed_timing_sequence* -MonoAndroidInternalCalls_Impl::monodroid_timing_start (const char *message) -{ - if (timing == nullptr) - return nullptr; - - managed_timing_sequence *ret = timing->get_available_sequence (); - if (message != nullptr) { - log_write (LOG_TIMING, LogLevel::Info, message); - } - ret->period.mark_start (); - - return ret; -} - -void -MonoAndroidInternalCalls_Impl::monodroid_timing_stop (managed_timing_sequence *sequence, const char *message) -{ - static constexpr const char DEFAULT_MESSAGE[] = "Managed Timing"; - - if (sequence == nullptr) - return; - - sequence->period.mark_end (); - Timing::info (sequence->period, message == nullptr ? DEFAULT_MESSAGE : message); - timing->release_sequence (sequence); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_strfreev (char **str_array) -{ - utils.monodroid_strfreev (str_array); -} - -char** -MonoAndroidInternalCalls_Impl::monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens) -{ - return utils.monodroid_strsplit (str, delimiter, max_tokens); -} - -char* -MonoAndroidInternalCalls_Impl::monodroid_strdup_printf (const char *format, va_list args) -{ - return utils.monodroid_strdup_vprintf (format, args); -} - -char* -MonoAndroidInternalCalls_Impl::monodroid_TypeManager_get_java_class_name (jclass klass) -{ - return monodroidRuntime.get_java_class_name_for_TypeManager (klass); -} - -void -MonoAndroidInternalCalls_Impl::monodroid_store_package_name (const char *name) -{ - utils.monodroid_store_package_name (name); -} - -int -MonoAndroidInternalCalls_Impl::monodroid_get_namespaced_system_property (const char *name, char **value) -{ - return static_cast(androidSystem.monodroid_get_system_property (name, value)); -} - -FILE* -MonoAndroidInternalCalls_Impl::monodroid_fopen (const char* filename, const char* mode) -{ - return utils.monodroid_fopen (filename, mode); -} - -int -MonoAndroidInternalCalls_Impl::send_uninterrupted (int fd, void *buf, int len) -{ - if (len < 0) - len = 0; - return utils.send_uninterrupted (fd, buf, static_cast(len)); -} - -int -MonoAndroidInternalCalls_Impl::recv_uninterrupted (int fd, void *buf, int len) -{ - if (len < 0) - len = 0; - return static_cast(utils.recv_uninterrupted (fd, buf, static_cast(len))); -} - -void -MonoAndroidInternalCalls_Impl::set_world_accessable (const char *path) -{ - utils.set_world_accessable (path); -} - -void -MonoAndroidInternalCalls_Impl::create_public_directory (const char *dir) -{ - utils.create_public_directory (dir); -} - -char* -MonoAndroidInternalCalls_Impl::path_combine (const char *path1, const char *path2) -{ - return utils.path_combine (path1, path2); -} diff --git a/src/native/monodroid/xa-internal-api.hh b/src/native/monodroid/xa-internal-api.hh deleted file mode 100644 index 8569161a686..00000000000 --- a/src/native/monodroid/xa-internal-api.hh +++ /dev/null @@ -1,72 +0,0 @@ -// Dear Emacs, this is a -*- C++ -*- header -#ifndef __XA_INTERNAL_API_HH -#define __XA_INTERNAL_API_HH - -#include -#include -#include - -#include "monodroid.h" -#include "logger.hh" -#include "timing.hh" -#include "xamarin_getifaddrs.h" - -namespace xamarin::android -{ - class MonoAndroidInternalCalls - { - public: - static constexpr char INIT_FUNCTION_NAME[] = "_monodroid_init_internal_api"; - static constexpr char SHUTDOWN_FUNCTION_NAME[] = "_monodroid_shutdown_internal_api"; - - // To shush compiler warnings - virtual ~MonoAndroidInternalCalls () - {} - - public: - virtual mono_bool monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up) = 0; - virtual mono_bool monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast) = 0; - virtual int monodroid_get_dns_servers (void **dns_servers_array) = 0; - virtual int monodroid_getifaddrs (_monodroid_ifaddrs **ifap) = 0; - virtual void monodroid_freeifaddrs (_monodroid_ifaddrs *ifa) = 0; - virtual void monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit) = 0; - virtual unsigned int monodroid_get_log_categories () = 0; - virtual void monodroid_log (LogLevel level, LogCategories category, const char *message) = 0; - virtual int monodroid_get_system_property (const char *name, char **value) = 0; - virtual int monodroid_max_gref_get () = 0; - virtual int monodroid_gref_get () = 0; - virtual void monodroid_gref_log (const char *message) = 0; - virtual int monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) = 0; - virtual void monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) = 0; - virtual int monodroid_weak_gref_get () = 0; - virtual void monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable) = 0; - virtual void monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) = 0; - virtual void monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) = 0; - virtual void monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable) = 0; - virtual void monodroid_gc_wait_for_bridge_processing () = 0; - virtual int monodroid_get_android_api_level () = 0; - virtual void monodroid_clear_gdb_wait () = 0; - virtual void* monodroid_get_identity_hash_code (JNIEnv *env, void *v) = 0; - virtual void* monodroid_timezone_get_default_id () = 0; - virtual void dump_counters (const char *format, va_list args) = 0; - virtual int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix) = 0; - virtual managed_timing_sequence* monodroid_timing_start (const char *message) = 0; - virtual void monodroid_timing_stop (managed_timing_sequence *sequence, const char *message) = 0; - virtual void monodroid_strfreev (char **str_array) = 0; - virtual char** monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens) = 0; - virtual char* monodroid_strdup_printf (const char *format, va_list args) = 0; - virtual char* monodroid_TypeManager_get_java_class_name (jclass klass) = 0; - virtual void monodroid_store_package_name (const char *name) = 0; - virtual int monodroid_get_namespaced_system_property (const char *name, char **value) = 0; - virtual FILE* monodroid_fopen (const char* filename, const char* mode) = 0; - virtual int send_uninterrupted (int fd, void *buf, int len) = 0; - virtual int recv_uninterrupted (int fd, void *buf, int len) = 0; - virtual void set_world_accessable (const char *path) = 0; - virtual void create_public_directory (const char *dir) = 0; - virtual char* path_combine (const char *path1, const char *path2) = 0; - }; - - typedef bool (*external_api_init_fn) (MonoAndroidInternalCalls *api); - typedef void (*external_api_shutdown_fn) (); -} -#endif // __XA_INTERNAL_API_HH diff --git a/src/native/pinvoke-override/CMakeLists.txt b/src/native/pinvoke-override/CMakeLists.txt new file mode 100644 index 00000000000..85e25d78e85 --- /dev/null +++ b/src/native/pinvoke-override/CMakeLists.txt @@ -0,0 +1,94 @@ +set(LIB_NAME_PRECOMPILED pinvoke-override-precompiled) +set(LIB_ALIAS_PRECOMPILED xa::pinvoke-override-precompiled) + +set(LIB_NAME_DYNAMIC pinvoke-override-dynamic) +set(LIB_ALIAS_DYNAMIC xa::pinvoke-override-dynamic) + +set(XA_PINVOKE_OVERRIDE_PRECOMPILED_SOURCES + precompiled.cc +) +add_clang_check_sources("${XA_PINVOKE_OVERRIDE_PRECOMPILED_SOURCES}") + +set(XA_PINVOKE_OVERRIDE_COMMON_SOURCES + common.cc +) + +set(XA_PINVOKE_OVERRIDE_DYNAMIC_SOURCES + dynamic.cc +) +add_clang_check_sources("${XA_PINVOKE_OVERRIDE_DYNAMIC_SOURCES}") + +list(APPEND POTENTIAL_LOCAL_COMPILER_ARGS + -ffunction-sections + -fdata-sections +) + +xa_check_c_args(PINVOKE_OVERRIDE_CXX_ARGS "${POTENTIAL_LOCAL_COMPILER_ARGS}") + +macro(create_library _libname _alias _sources) + add_library( + ${_libname} + STATIC + ${_sources} + ${XA_PINVOKE_OVERRIDE_COMMON_SOURCES} + ) + + add_library(${_alias} ALIAS ${_libname}) + + target_compile_definitions( + ${_libname} + PRIVATE + TSL_NO_EXCEPTIONS + ) + + target_compile_options( + ${_libname} + PRIVATE + ${XA_COMMON_CXX_ARGS} + ${PINVOKE_OVERRIDE_CXX_ARGS} + ) + + target_include_directories( + ${_libname} + PRIVATE + ${ROBIN_MAP_DIR}/include + ) + + target_include_directories( + ${_libname} + PUBLIC + "$" + ) + + target_include_directories( + ${_libname} + SYSTEM PRIVATE + ${SYSROOT_CXX_INCLUDE_DIR} + ${MONO_RUNTIME_INCLUDE_DIR} + ) + + target_link_libraries( + ${_libname} + PRIVATE + ${SHARED_LIB_NAME} + xa::xamarin-app + xa::runtime-base + ) + + xa_add_compile_definitions(${_libname}) +endmacro() + +create_library(${LIB_NAME_PRECOMPILED} ${LIB_ALIAS_PRECOMPILED} ${XA_PINVOKE_OVERRIDE_PRECOMPILED_SOURCES}) +create_library(${LIB_NAME_DYNAMIC} ${LIB_ALIAS_DYNAMIC} ${XA_PINVOKE_OVERRIDE_DYNAMIC_SOURCES}) + +target_compile_definitions( + ${LIB_NAME_PRECOMPILED} + PRIVATE + PRECOMPILED +) + +set_target_properties( + ${LIB_NAME_PRECOMPILED} + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" +) diff --git a/src/native/pinvoke-override/common.cc b/src/native/pinvoke-override/common.cc new file mode 100644 index 00000000000..aaf56d38ee7 --- /dev/null +++ b/src/native/pinvoke-override/common.cc @@ -0,0 +1,6 @@ +#include "pinvoke-override-api.hh" + +using namespace xamarin::android; + +PinvokeOverride::pinvoke_library_map PinvokeOverride::other_pinvoke_map (PinvokeOverride::LIBRARY_MAP_INITIAL_BUCKET_COUNT); +xamarin::android::mutex PinvokeOverride::pinvoke_map_write_lock; diff --git a/src/native/pinvoke-override/dynamic.cc b/src/native/pinvoke-override/dynamic.cc new file mode 100644 index 00000000000..447606650f5 --- /dev/null +++ b/src/native/pinvoke-override/dynamic.cc @@ -0,0 +1,2 @@ +#define PINVOKE_OVERRIDE_INLINE [[gnu::noinline]] +#include "pinvoke-override-api.hh" diff --git a/src/native/monodroid/generate-pinvoke-tables.cc b/src/native/pinvoke-override/generate-pinvoke-tables.cc similarity index 90% rename from src/native/monodroid/generate-pinvoke-tables.cc rename to src/native/pinvoke-override/generate-pinvoke-tables.cc index 0c132d5461b..b5c436c6374 100644 --- a/src/native/monodroid/generate-pinvoke-tables.cc +++ b/src/native/pinvoke-override/generate-pinvoke-tables.cc @@ -84,6 +84,44 @@ const std::vector internal_pinvoke_names = { }; const std::vector dotnet_pinvoke_names = { + // libSystem.Globalization.Native.so + "GlobalizationNative_ChangeCase", + "GlobalizationNative_ChangeCaseInvariant", + "GlobalizationNative_ChangeCaseTurkish", + "GlobalizationNative_CloseSortHandle", + "GlobalizationNative_CompareString", + "GlobalizationNative_EndsWith", + "GlobalizationNative_EnumCalendarInfo", + "GlobalizationNative_GetCalendarInfo", + "GlobalizationNative_GetCalendars", + "GlobalizationNative_GetDefaultLocaleName", + "GlobalizationNative_GetICUVersion", + "GlobalizationNative_GetJapaneseEraStartDate", + "GlobalizationNative_GetLatestJapaneseEra", + "GlobalizationNative_GetLocaleInfoGroupingSizes", + "GlobalizationNative_GetLocaleInfoInt", + "GlobalizationNative_GetLocaleInfoString", + "GlobalizationNative_GetLocaleName", + "GlobalizationNative_GetLocales", + "GlobalizationNative_GetLocaleTimeFormat", + "GlobalizationNative_GetSortHandle", + "GlobalizationNative_GetSortKey", + "GlobalizationNative_GetSortVersion", + "GlobalizationNative_GetTimeZoneDisplayName", + "GlobalizationNative_IanaIdToWindowsId", + "GlobalizationNative_IndexOf", + "GlobalizationNative_InitICUFunctions", + "GlobalizationNative_InitOrdinalCasingPage", + "GlobalizationNative_IsNormalized", + "GlobalizationNative_IsPredefinedLocale", + "GlobalizationNative_LastIndexOf", + "GlobalizationNative_LoadICU", + "GlobalizationNative_NormalizeString", + "GlobalizationNative_StartsWith", + "GlobalizationNative_ToAscii", + "GlobalizationNative_ToUnicode", + "GlobalizationNative_WindowsIdToIanaId", + // libSystem.IO.Compression.Native.so "BrotliDecoderCreateInstance", "BrotliDecoderDecompress", @@ -117,11 +155,9 @@ const std::vector dotnet_pinvoke_names = { "CompressionNative_Deflate", "CompressionNative_DeflateEnd", "CompressionNative_DeflateInit2_", - "CompressionNative_DeflateReset", "CompressionNative_Inflate", "CompressionNative_InflateEnd", "CompressionNative_InflateInit2_", - "CompressionNative_InflateReset", // libSystem.Native.so "SystemNative_Abort", @@ -140,6 +176,7 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_CloseSocketEventPort", "SystemNative_ConfigureTerminalForChildProcess", "SystemNative_Connect", + "SystemNative_Connectx", "SystemNative_ConvertErrorPalToPlatform", "SystemNative_ConvertErrorPlatformToPal", "SystemNative_CopyFile", @@ -210,7 +247,6 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_GetHostName", "SystemNative_GetIcmpv4GlobalStatistics", "SystemNative_GetIcmpv6GlobalStatistics", - "SystemNative_GetIPSocketAddressSizes", "SystemNative_GetIPv4Address", "SystemNative_GetIPv4GlobalStatistics", "SystemNative_GetIPv4MulticastOption", @@ -227,7 +263,6 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_GetOSArchitecture", "SystemNative_GetPeerID", "SystemNative_GetPeerName", - "SystemNative_GetPeerUserName", "SystemNative_GetPid", "SystemNative_GetPlatformSignalNumber", "SystemNative_GetPort", @@ -241,6 +276,7 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_GetRLimit", "SystemNative_GetSid", "SystemNative_GetSignalForBreak", + "SystemNative_GetSocketAddressSizes", "SystemNative_GetSocketErrorOption", "SystemNative_GetSocketType", "SystemNative_GetSockName", @@ -249,7 +285,9 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_GetSystemTimeAsTicks", "SystemNative_GetTcpGlobalStatistics", "SystemNative_GetTimestamp", + "SystemNative_GetTimeZoneData", "SystemNative_GetUdpGlobalStatistics", + "SystemNative_GetUInt64OSThreadId", "SystemNative_GetUnixRelease", "SystemNative_GetUnixVersion", "SystemNative_GetWindowSize", @@ -289,6 +327,7 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_MkNod", "SystemNative_MksTemps", "SystemNative_MMap", + "SystemNative_MProtect", "SystemNative_MSync", "SystemNative_MUnmap", "SystemNative_Open", @@ -312,6 +351,7 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_RealPath", "SystemNative_Receive", "SystemNative_ReceiveMessage", + "SystemNative_ReceiveSocketError", "SystemNative_RegisterForSigChld", "SystemNative_Rename", "SystemNative_RmDir", @@ -348,6 +388,8 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_ShmUnlink", "SystemNative_Shutdown", "SystemNative_SNPrintF", + "SystemNative_SNPrintF_1I", + "SystemNative_SNPrintF_1S", "SystemNative_Socket", "SystemNative_Stat", "SystemNative_StdinReady", @@ -359,6 +401,7 @@ const std::vector dotnet_pinvoke_names = { "SystemNative_SysLog", "SystemNative_TryChangeSocketEventRegistration", "SystemNative_TryGetIPPacketInformation", + "SystemNative_TryGetUInt32OSThreadId", "SystemNative_UninitializeConsoleAfterRead", "SystemNative_Unlink", "SystemNative_UTimensat", @@ -434,6 +477,7 @@ const std::vector dotnet_pinvoke_names = { "AndroidCryptoNative_GetECKeyParameters", "AndroidCryptoNative_GetRsaParameters", "AndroidCryptoNative_NewGlobalReference", + "AndroidCryptoNative_Pbkdf2", "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", "AndroidCryptoNative_RsaCreate", "AndroidCryptoNative_RsaDestroy", @@ -448,6 +492,7 @@ const std::vector dotnet_pinvoke_names = { "AndroidCryptoNative_SSLGetSupportedProtocols", "AndroidCryptoNative_SSLStreamCreate", "AndroidCryptoNative_SSLStreamCreateWithCertificates", + "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", "AndroidCryptoNative_SSLStreamGetApplicationProtocol", "AndroidCryptoNative_SSLStreamGetCipherSuite", "AndroidCryptoNative_SSLStreamGetPeerCertificate", @@ -479,13 +524,17 @@ const std::vector dotnet_pinvoke_names = { "AndroidCryptoNative_X509DecodeCollection", "AndroidCryptoNative_X509Encode", "AndroidCryptoNative_X509ExportPkcs7", + "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", "AndroidCryptoNative_X509GetContentType", + "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", "AndroidCryptoNative_X509PublicKey", "AndroidCryptoNative_X509StoreAddCertificate", "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", "AndroidCryptoNative_X509StoreContainsCertificate", + "AndroidCryptoNative_X509StoreDeleteEntry", "AndroidCryptoNative_X509StoreEnumerateCertificates", "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", + "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", "AndroidCryptoNative_X509StoreOpenDefault", "AndroidCryptoNative_X509StoreRemoveCertificate", "CryptoNative_EnsureOpenSslInitialized", @@ -501,6 +550,7 @@ const std::vector dotnet_pinvoke_names = { "CryptoNative_EvpDigestReset", "CryptoNative_EvpDigestUpdate", "CryptoNative_EvpMd5", + "CryptoNative_EvpMdCtxCopyEx", "CryptoNative_EvpMdCtxCreate", "CryptoNative_EvpMdCtxDestroy", "CryptoNative_EvpMdSize", @@ -517,6 +567,7 @@ const std::vector dotnet_pinvoke_names = { "CryptoNative_HmacOneShot", "CryptoNative_HmacReset", "CryptoNative_HmacUpdate", + "Java_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate", }; template @@ -541,14 +592,14 @@ struct PinvokeEntry void print (std::ostream& os, std::string comment, std::string variable_name, auto const& seq) { - os << "//" << comment << '\n'; - os << "static PinvokeEntry " << variable_name << "[] = {" << std::endl; + os << "\t//" << comment << '\n'; + os << "\tstd::array " << variable_name << " {{" << std::endl; for (auto const& elem : seq) { - os << "\t{" << elem << "}," << std::endl; + os << "\t\t{" << elem << "}," << std::endl; } - os << "};" << std::endl; + os << "\t}};" << std::endl << std::endl; } template @@ -601,6 +652,7 @@ void write_library_name_hashes (Hash (*hasher)(const char*, size_t), std::ostrea write_library_name_hash (hasher, output, "libSystem.Native", "system_native"); write_library_name_hash (hasher, output, "libSystem.IO.Compression.Native", "system_io_compression_native"); write_library_name_hash (hasher, output, "libSystem.Security.Cryptography.Native.Android", "system_security_cryptography_native_android"); + write_library_name_hash (hasher, output, "libSystem.Globalization.Native", "system_globalization_native"); } int main (int argc, char **argv) @@ -655,8 +707,10 @@ int main (int argc, char **argv) output << "// A compiler with support for C++20 ranges is required" << std::endl; output << "//" << std::endl << std::endl; + output << "#include " << std::endl; output << "#include " << std::endl << std::endl; + output << "namespace {" << std::endl; output << "#if INTPTR_MAX == INT64_MAX" << std::endl; print (output, "64-bit internal p/invoke table", "internal_pinvokes", internal_pinvokes64); print (output, "64-bit DotNet p/invoke table", "dotnet_pinvokes", dotnet_pinvokes64); @@ -674,6 +728,7 @@ int main (int argc, char **argv) output << "constexpr size_t internal_pinvokes_count = " << std::dec << std::noshowbase << internal_pinvoke_names.size () << ";" << std::endl; output << "constexpr size_t dotnet_pinvokes_count = " << std::dec << std::noshowbase << dotnet_pinvoke_names.size () << ";" << std::endl; + output << "} // end of anonymous namespace" << std::endl; return have_collisions ? 1 : 0; } diff --git a/src/native/pinvoke-override/pinvoke-override-api-impl.hh b/src/native/pinvoke-override/pinvoke-override-api-impl.hh new file mode 100644 index 00000000000..9e14dc14ac4 --- /dev/null +++ b/src/native/pinvoke-override/pinvoke-override-api-impl.hh @@ -0,0 +1,157 @@ +#pragma once + +#if !defined(PINVOKE_OVERRIDE_INLINE) +#warning The PINVOKE_OVERRIDE_INLINE macro must be defined before including this header file +#define PINVOKE_OVERRIDE_INLINE inline +#endif + +#include + +#include "logger.hh" +#include "monodroid-dl.hh" +#include "pinvoke-override-api.hh" +#include "startup-aware-lock.hh" + +namespace xamarin::android { + PINVOKE_OVERRIDE_INLINE void* + PinvokeOverride::load_library_symbol (const char *library_name, const char *symbol_name, void **dso_handle) noexcept + { + void *lib_handle = dso_handle == nullptr ? nullptr : *dso_handle; + + if (lib_handle == nullptr) { + lib_handle = internal::MonodroidDl::monodroid_dlopen (library_name, MONO_DL_LOCAL, nullptr, nullptr); + if (lib_handle == nullptr) { + log_warn (LOG_ASSEMBLY, "Shared library '%s' not loaded, p/invoke '%s' may fail", library_name, symbol_name); + return nullptr; + } + + if (dso_handle != nullptr) { + void *expected_null = nullptr; + if (!__atomic_compare_exchange (dso_handle, &expected_null, &lib_handle, false /* weak */, __ATOMIC_ACQUIRE /* success_memorder */, __ATOMIC_RELAXED /* xxxfailure_memorder */)) { + log_debug (LOG_ASSEMBLY, "Library '%s' handle already cached by another thread", library_name); + } + } + } + + void *entry_handle = internal::MonodroidDl::monodroid_dlsym (lib_handle, symbol_name, nullptr, nullptr); + if (entry_handle == nullptr) { + log_warn (LOG_ASSEMBLY, "Symbol '%s' not found in shared library '%s', p/invoke may fail", symbol_name, library_name); + return nullptr; + } + + return entry_handle; + } + + // `pinvoke_map_write_lock` MUST be held when calling this method + PINVOKE_OVERRIDE_INLINE void* + PinvokeOverride::load_library_entry (std::string const& library_name, std::string const& entrypoint_name, pinvoke_api_map_ptr api_map) noexcept + { + // Make sure some other thread hasn't just added the entry + auto iter = api_map->find (entrypoint_name); + if (iter != api_map->end () && iter->second != nullptr) { + return iter->second; + } + + void *entry_handle = load_library_symbol (library_name.c_str (), entrypoint_name.c_str ()); + if (entry_handle == nullptr) { + // error already logged + return nullptr; + } + + log_debug (LOG_ASSEMBLY, "Caching p/invoke entry %s @ %s", library_name.c_str (), entrypoint_name.c_str ()); + (*api_map)[entrypoint_name] = entry_handle; + return entry_handle; + } + + PINVOKE_OVERRIDE_INLINE void + PinvokeOverride::load_library_entry (const char *library_name, const char *entrypoint_name, PinvokeEntry &entry, void **dso_handle) noexcept + { + void *entry_handle = load_library_symbol (library_name, entrypoint_name, dso_handle); + void *expected_null = nullptr; + + bool already_loaded = !__atomic_compare_exchange ( + /* ptr */ &entry.func, + /* expected */ &expected_null, + /* desired */ &entry_handle, + /* weak */ false, + /* success_memorder */ __ATOMIC_ACQUIRE, + /* failure_memorder */ __ATOMIC_RELAXED + ); + + if (already_loaded) { + log_debug (LOG_ASSEMBLY, "Entry '%s' from library '%s' already loaded by another thread", entrypoint_name, library_name); + } + } + + PINVOKE_OVERRIDE_INLINE void* + PinvokeOverride::fetch_or_create_pinvoke_map_entry (std::string const& library_name, std::string const& entrypoint_name, hash_t entrypoint_name_hash, pinvoke_api_map_ptr api_map, bool need_lock) noexcept + { + auto iter = api_map->find (entrypoint_name, entrypoint_name_hash); + if (iter != api_map->end () && iter->second != nullptr) { + return iter->second; + } + + if (!need_lock) { + return load_library_entry (library_name, entrypoint_name, api_map); + } + + internal::StartupAwareLock lock (pinvoke_map_write_lock); + return load_library_entry (library_name, entrypoint_name, api_map); + } + + PINVOKE_OVERRIDE_INLINE + PinvokeEntry* + PinvokeOverride::find_pinvoke_address (hash_t hash, const PinvokeEntry *entries, size_t entry_count) noexcept + { + while (entry_count > 0) { + const size_t mid = entry_count / 2; + const PinvokeEntry *const ret = entries + mid; + const std::strong_ordering result = hash <=> ret->hash; + + if (result < 0) { + entry_count = mid; + } else if (result > 0) { + entries = ret + 1; + entry_count -= mid + 1; + } else { + return const_cast(ret); + } + } + + return nullptr; + } + + PINVOKE_OVERRIDE_INLINE void* + PinvokeOverride::handle_other_pinvoke_request (const char *library_name, hash_t library_name_hash, const char *entrypoint_name, hash_t entrypoint_name_hash) noexcept + { + std::string lib_name {library_name}; + std::string entry_name {entrypoint_name}; + + auto iter = other_pinvoke_map.find (lib_name, library_name_hash); + void *handle = nullptr; + if (iter == other_pinvoke_map.end ()) { + internal::StartupAwareLock lock (pinvoke_map_write_lock); + + pinvoke_api_map_ptr lib_map; + // Make sure some other thread hasn't just added the map + iter = other_pinvoke_map.find (lib_name, library_name_hash); + if (iter == other_pinvoke_map.end () || iter->second == nullptr) { + lib_map = new pinvoke_api_map (1); + other_pinvoke_map[lib_name] = lib_map; + } else { + lib_map = iter->second; + } + + handle = fetch_or_create_pinvoke_map_entry (lib_name, entry_name, entrypoint_name_hash, lib_map, /* need_lock */ false); + } else { + if (iter->second == nullptr) [[unlikely]] { + log_warn (LOG_ASSEMBLY, "Internal error: null entry in p/invoke map for key '%s'", library_name); + return nullptr; // fall back to `monodroid_dlopen` + } + + handle = fetch_or_create_pinvoke_map_entry (lib_name, entry_name, entrypoint_name_hash, iter->second, /* need_lock */ true); + } + + return handle; + } +} diff --git a/src/native/pinvoke-override/pinvoke-override-api.hh b/src/native/pinvoke-override/pinvoke-override-api.hh new file mode 100644 index 00000000000..8ee17540204 --- /dev/null +++ b/src/native/pinvoke-override/pinvoke-override-api.hh @@ -0,0 +1,91 @@ +#pragma once + +#include + +#include "cppcompat.hh" +#include "xxhash.hh" + +// NDEBUG causes robin_map.h not to include which, in turn, prevents indirect inclusion of . +// conflicts with our std::mutex definition in cppcompat.hh +#if !defined (NDEBUG) +#define NDEBUG +#define NDEBUG_UNDEFINE +#endif + +// hush some compiler warnings +#if defined (__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wunused-parameter" +#endif // __clang__ + +#include + +#if defined (__clang__) +#pragma clang diagnostic pop +#endif // __clang__ + +#if defined (NDEBUG_UNDEFINE) +#undef NDEBUG +#undef NDEBUG_UNDEFINE +#endif + +namespace xamarin::android { + struct PinvokeEntry + { + hash_t hash; + const char *name; + void *func; + }; + + struct string_hash + { + force_inline xamarin::android::hash_t operator() (std::string const& s) const noexcept + { + return xamarin::android::xxhash::hash (s.c_str (), s.length ()); + } + }; + + class PinvokeOverride + { + using pinvoke_api_map = tsl::robin_map< + std::string, + void*, + string_hash, + std::equal_to, + std::allocator>, + true + >; + + using pinvoke_api_map_ptr = pinvoke_api_map*; + using pinvoke_library_map = tsl::robin_map< + std::string, + pinvoke_api_map_ptr, + string_hash, + std::equal_to, + std::allocator>, + true + >; + + static inline constexpr pinvoke_library_map::size_type LIBRARY_MAP_INITIAL_BUCKET_COUNT = 1; + + public: + static void* load_library_symbol (const char *library_name, const char *symbol_name, void **dso_handle = nullptr) noexcept; + static void* load_library_entry (std::string const& library_name, std::string const& entrypoint_name, pinvoke_api_map_ptr api_map) noexcept; + static void load_library_entry (const char *library_name, const char *entrypoint_name, PinvokeEntry &entry, void **dso_handle) noexcept; + static void* fetch_or_create_pinvoke_map_entry (std::string const& library_name, std::string const& entrypoint_name, hash_t entrypoint_name_hash, pinvoke_api_map_ptr api_map, bool need_lock) noexcept; + static PinvokeEntry* find_pinvoke_address (hash_t hash, const PinvokeEntry *entries, size_t entry_count) noexcept; + static void* handle_other_pinvoke_request (const char *library_name, hash_t library_name_hash, const char *entrypoint_name, hash_t entrypoint_name_hash) noexcept; + static void* monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name); + + private: + static xamarin::android::mutex pinvoke_map_write_lock; + static pinvoke_library_map other_pinvoke_map; + +#if defined(PRECOMPILED) + static inline void *system_native_library_handle = nullptr; + static inline void *system_security_cryptography_native_android_library_handle = nullptr; + static inline void *system_io_compression_native_library_handle = nullptr; + static inline void *system_globalization_native_library_handle = nullptr; +#endif + }; +} diff --git a/src/native/pinvoke-override/pinvoke-tables.include b/src/native/pinvoke-override/pinvoke-tables.include new file mode 100644 index 00000000000..6327692e265 --- /dev/null +++ b/src/native/pinvoke-override/pinvoke-tables.include @@ -0,0 +1,1100 @@ +// +// Autogenarated file. DO NOT EDIT. +// +// To regenerate run ../../../build-tools/scripts/generate-pinvoke-tables.sh on Linux or macOS +// A compiler with support for C++20 ranges is required +// + +#include +#include + +namespace { +#if INTPTR_MAX == INT64_MAX + //64-bit internal p/invoke table + std::array internal_pinvokes {{ + {0x452e23128e42f0a, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, + {0xa50ce5de13bf8b5, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, + {0x19055d65edfd668e, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, + {0x2b3b0ca1d14076da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, + {0x2fbe68718cf2510d, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, + {0x3ade4348ac8ce0fa, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, + {0x3b2467e7eadd4a6a, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, + {0x3b8097af56b5361f, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, + {0x3c5532ecdab53f89, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, + {0x423c8f539a2c56d2, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, + {0x4b1956138764939a, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, + {0x4d5b5b488f736058, "path_combine", reinterpret_cast(&path_combine)}, + {0x5a2614d15e2fdc2e, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, + {0x5f0b4e426eff086b, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, + {0x709af13cbfbe2e75, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, + {0x70ae32c9a4f1ad2c, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, + {0x70fc9bab8d56666d, "create_public_directory", reinterpret_cast(&create_public_directory)}, + {0x78514771a67ad724, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, + {0x9099a4b95e3c3a89, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, + {0x958cdb6fd9d1b67b, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, + {0xa6ec846592d99536, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, + {0xa7f58f3ee428cc6b, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, + {0xae3df96dda0143bd, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, + {0xb6222d90af401865, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, + {0xb8306f71b963cd3d, "monodroid_log", reinterpret_cast(&monodroid_log)}, + {0xbc90bafd5ff9c99e, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, + {0xbe5a300beec69c35, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, + {0xbfbb924fbe190616, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, + {0xc2a21d3f6c8ccc24, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, + {0xc5b4690e13898fa3, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, + {0xcc873ea8493d1dd5, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, + {0xce439cfbe29dec11, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, + {0xd1e121b94ea63f2e, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, + {0xd5151b00eb33d85e, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, + {0xda517ef392b6a888, "java_interop_free", reinterpret_cast(&java_interop_free)}, + {0xe27b9849b7e982cb, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, + {0xe370a0d91cd63bc0, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, + {0xe78f1161604ae672, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, + {0xe86307aac9a2631a, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, + {0xebc2c68e10075cc9, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, + {0xee83e38e479aeff1, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, + {0xf3048baf83034541, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, + {0xf41c48df6f9be476, "monodroid_free", reinterpret_cast(&monodroid_free)}, + {0xf5a918ef520db207, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, + {0xf5ed87b004005892, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, + {0xf8798f762db15bba, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, + {0xfa90326712e7e7c4, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, + {0xfdc17c4ea8335ffd, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, + {0xff010b3140f54d3f, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, + }}; + + //64-bit DotNet p/invoke table + std::array dotnet_pinvokes {{ + {0x99f2ee02463000, "CompressionNative_Crc32", nullptr}, + {0xb38afc8bfe830b, "SystemNative_Bind", nullptr}, + {0x190fe65d8736dcb, "SystemNative_TryGetIPPacketInformation", nullptr}, + {0x1c8b86562ad5772, "SystemNative_Receive", nullptr}, + {0x202543f28ecaf06, "SystemNative_Abort", nullptr}, + {0x25abeafa88904a2, "SystemNative_SetPosixSignalHandler", nullptr}, + {0x33158212a812caf, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, + {0x3511e36d0a6c1b5, "SystemNative_LockFileRegion", nullptr}, + {0x375a0e90c77ca35, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, + {0x37b9dd562235e42, "SystemNative_MSync", nullptr}, + {0x3a5df4793dd3230, "SystemNative_INotifyInit", nullptr}, + {0x3d24547fa4fc31b, "SystemNative_GetUInt64OSThreadId", nullptr}, + {0x410f8526b1edfc3, "GlobalizationNative_GetLocaleInfoInt", nullptr}, + {0x47302bd7e277183, "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", nullptr}, + {0x581df5b0a00c422, "SystemNative_SetRLimit", nullptr}, + {0x598db66ca39c41f, "AndroidCryptoNative_EcKeyUpRef", nullptr}, + {0x5b5ab451ff38f8e, "SystemNative_GetMaximumAddressSize", nullptr}, + {0x656cac62ccc9e3c, "AndroidCryptoNative_X509GetContentType", nullptr}, + {0x6861b5336291d12, "SystemNative_PathConf", nullptr}, + {0x690c4347972024f, "AndroidCryptoNative_Aes256Gcm", nullptr}, + {0x6a1f4deffa02c30, "SystemNative_LowLevelMonitor_Acquire", nullptr}, + {0x7b5579ab0499b1f, "AndroidCryptoNative_RsaSize", nullptr}, + {0x7ce8a9b967dd269, "SystemNative_Read", nullptr}, + {0x7f0e1227c9c0225, "CryptoNative_EvpMdCtxDestroy", nullptr}, + {0x8352ae4bba2b83b, "SystemNative_SetSendTimeout", nullptr}, + {0x98bd27a7461321d, "SystemNative_Dup", nullptr}, + {0x9a39fbf59eed9f9, "CryptoNative_EvpSha1", nullptr}, + {0xa4aeeaff9ca2d10, "BrotliDecoderDecompressStream", nullptr}, + {0xa906c14ca5834bc, "SystemNative_GetEUid", nullptr}, + {0xac9f9c1abb62a92, "SystemNative_Log", nullptr}, + {0xadb2441bcfcdfe9, "SystemNative_CreateThread", nullptr}, + {0xafbf5c69d1badc0, "SystemNative_SetTerminalInvalidationHandler", nullptr}, + {0xba897b7abe67b16, "SystemNative_FcntlSetPipeSz", nullptr}, + {0xc305c22ce7ab8a0, "SystemNative_SetSockOpt", nullptr}, + {0xc79e924361c15ca, "SystemNative_RealPath", nullptr}, + {0xcaba893801c6a6f, "AndroidCryptoNative_Aes256Ecb", nullptr}, + {0xcbe6d3d22131194, "AndroidCryptoNative_SetRsaParameters", nullptr}, + {0xe7e93cf9237e1f2, "GlobalizationNative_ToAscii", nullptr}, + {0xef8dd67e25bac53, "SystemNative_GetWindowSize", nullptr}, + {0xfa0899cf8d00a87, "SystemNative_MkDir", nullptr}, + {0xfe7079441ac127e, "SystemNative_CreateSocketEventPort", nullptr}, + {0x1027786cdd9a3e9c, "AndroidCryptoNative_Aes192Cbc", nullptr}, + {0x10d733abd1fd94bb, "SystemNative_TryChangeSocketEventRegistration", nullptr}, + {0x114b8384553f5418, "SystemNative_GetSystemTimeAsTicks", nullptr}, + {0x119a38c3e288a233, "SystemNative_SNPrintF_1S", nullptr}, + {0x11b6f4f0aafeda95, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, + {0x11cc73f2926d4064, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, + {0x121bc483ac26f5f8, "SystemNative_GetGroupName", nullptr}, + {0x12d65f9f65b01497, "SystemNative_GetRawSockOpt", nullptr}, + {0x12eaf09505dc19fd, "SystemNative_FStat", nullptr}, + {0x13577369f5ec4b0a, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, + {0x1399413d8a7d9dd8, "SystemNative_GetAddressFamily", nullptr}, + {0x13a1c2de7fb2519f, "SystemNative_CloseSocketEventPort", nullptr}, + {0x146cd1dc4fb2ba58, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, + {0x14b7e3527b60e83f, "CryptoNative_ErrErrorStringN", nullptr}, + {0x15bd710d3a9b3b0c, "CryptoNative_EvpDigestFinalEx", nullptr}, + {0x176e22ea7c580dae, "SystemNative_ReadDirR", nullptr}, + {0x18580a4592ed1ea6, "GlobalizationNative_GetSortKey", nullptr}, + {0x185f5d25252c3c72, "SystemNative_FAllocate", nullptr}, + {0x18d6b5e9fec9b0dc, "SystemNative_Connectx", nullptr}, + {0x18f7da5f584b5b59, "SystemNative_PReadV", nullptr}, + {0x1948a0cf88329c2f, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, + {0x1ac95b02f23933cc, "SystemNative_CanGetHiddenFlag", nullptr}, + {0x1d1bb0528d517729, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, + {0x1d4dcbc06728e689, "SystemNative_Close", nullptr}, + {0x1d6d4278ffbbab77, "SystemNative_Pipe", nullptr}, + {0x1d8d6a688fc5bfb3, "SystemNative_SendFile", nullptr}, + {0x1e6228e955989698, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, + {0x1e8edcc515cd23f9, "CryptoNative_EvpDigestOneShot", nullptr}, + {0x1f1c61a157636aad, "SystemNative_Stat", nullptr}, + {0x1f45ac9d3c6b1554, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, + {0x1f72f52873ced9c9, "GlobalizationNative_InitOrdinalCasingPage", nullptr}, + {0x1f7d2360a1cdcbff, "AndroidCryptoNative_SSLStreamCreate", nullptr}, + {0x1f849e45a3014a9f, "SystemNative_GetIPv6Address", nullptr}, + {0x1f9361fc7b624c1b, "SystemNative_LowLevelMonitor_Wait", nullptr}, + {0x205a31e661496019, "CryptoNative_ErrGetErrorAlloc", nullptr}, + {0x20784dcc7e9cee75, "BrotliGetTransforms", nullptr}, + {0x2178ba302d0c5f1c, "GlobalizationNative_GetCalendars", nullptr}, + {0x218fce505a140c55, "AndroidCryptoNative_EcDsaVerify", nullptr}, + {0x2291e0ba4e1b55b0, "SystemNative_LStat", nullptr}, + {0x23ac2a4c4d1c744e, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, + {0x24f840f903a26ded, "SystemNative_ConvertErrorPalToPlatform", nullptr}, + {0x24ff74e427d0626e, "SystemNative_GetErrNo", nullptr}, + {0x254905036a0061cf, "SystemNative_CreateSocketEventBuffer", nullptr}, + {0x255c4a2e297fd9f5, "SystemNative_INotifyAddWatch", nullptr}, + {0x267c94097a3bf1f3, "AndroidCryptoNative_CipherDestroy", nullptr}, + {0x27944922cd8283ca, "CryptoNative_EvpSha384", nullptr}, + {0x2795a01c2c64aea1, "CryptoNative_HmacReset", nullptr}, + {0x27f3d9266af2b315, "SystemNative_GetIPv4Address", nullptr}, + {0x2925953889c48cab, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, + {0x2a49948ae20571cb, "SystemNative_SchedGetAffinity", nullptr}, + {0x2b45d7cdf6e8e0c7, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, + {0x2c352dd7c367e438, "CryptoNative_EvpSha512", nullptr}, + {0x2c7e5e179cc917cb, "AndroidCryptoNative_DsaSizeSignature", nullptr}, + {0x2c8da1192c5d7d2b, "SystemNative_FLock", nullptr}, + {0x2d64b1ac218cf29e, "SystemNative_AlignedRealloc", nullptr}, + {0x2e1102c297588e10, "BrotliEncoderDestroyInstance", nullptr}, + {0x2e429d96a9fc92bd, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, + {0x2fdcf708ff792105, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, + {0x301c465c1ac0adf9, "SystemNative_MProtect", nullptr}, + {0x307db94ae9f929e5, "CryptoNative_GetMaxMdSize", nullptr}, + {0x31027564deeb71b0, "AndroidCryptoNative_Aes128Cbc", nullptr}, + {0x32e594690358a960, "GlobalizationNative_GetLocaleInfoString", nullptr}, + {0x3319a5483b3cc1fc, "SystemNative_GetRLimit", nullptr}, + {0x3424ffcb69ecef57, "SystemNative_Unlink", nullptr}, + {0x346a9bb11364833c, "SystemNative_DrainAutoreleasePool", nullptr}, + {0x35169e67cc0f8529, "SystemNative_GetIPv6MulticastOption", nullptr}, + {0x359205b4a10fa780, "SystemNative_LowLevelMonitor_Destroy", nullptr}, + {0x35c1fa8dffcbbd8c, "CryptoNative_EvpDigestReset", nullptr}, + {0x36128eed665b1923, "SystemNative_ShmUnlink", nullptr}, + {0x364dcf65ae63adff, "SystemNative_GetSocketErrorOption", nullptr}, + {0x3757b327944abb54, "SystemNative_EnablePosixSignalHandling", nullptr}, + {0x38b4bd21127ceffd, "SystemNative_StrErrorR", nullptr}, + {0x38c7de719e8ae69d, "SystemNative_RmDir", nullptr}, + {0x391bbbb9bbde4455, "SystemNative_SetIPv4MulticastOption", nullptr}, + {0x3a7245f3ea476bf7, "SystemNative_SNPrintF", nullptr}, + {0x3ae92e4198427b0d, "SystemNative_ReadLink", nullptr}, + {0x3e0de839e6cfa6e5, "SystemNative_Accept", nullptr}, + {0x3e7cf9a4789a31c7, "SystemNative_FChflags", nullptr}, + {0x3f19a16a3230b551, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, + {0x3f49b6278f04ae84, "SystemNative_Disconnect", nullptr}, + {0x3fba15600bf0f229, "SystemNative_SetEUid", nullptr}, + {0x401935ffc3454bb1, "AndroidCryptoNative_X509PublicKey", nullptr}, + {0x403e1bc0b3baba84, "CompressionNative_Inflate", nullptr}, + {0x40bfa1211f5f6f9c, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, + {0x40d61d78487edb08, "GlobalizationNative_GetICUVersion", nullptr}, + {0x41b6e7f32da99fa9, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, + {0x41c169fb0e30a390, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, + {0x41c1f2c9153639af, "SystemNative_FUTimens", nullptr}, + {0x420718c398131a55, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, + {0x42339dd2717504d9, "SystemNative_GetLingerOption", nullptr}, + {0x42783107bf2935ec, "SystemNative_FreeHostEntry", nullptr}, + {0x42eb0578a9d62b78, "SystemNative_GetFormatInfoForMountPoint", nullptr}, + {0x4360eb8a25122eee, "GlobalizationNative_StartsWith", nullptr}, + {0x43741165a5ba60d5, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, + {0x44ccb27979f980ce, "SystemNative_AlignedAlloc", nullptr}, + {0x44f1a5c46033eec2, "SystemNative_SysLog", nullptr}, + {0x469898c8d892af83, "BrotliEncoderCompress", nullptr}, + {0x483b434d7b089c7e, "SystemNative_Write", nullptr}, + {0x4845e1c76265acc9, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, + {0x484a3a445bdb14fc, "SystemNative_GetOSArchitecture", nullptr}, + {0x4909639a9d87bdb5, "SystemNative_AlignedFree", nullptr}, + {0x49e3ba95feb79c6c, "SystemNative_SetAddressFamily", nullptr}, + {0x4a7272ac9d117f2d, "AndroidCryptoNative_EcKeyDestroy", nullptr}, + {0x4b00795bbeea6f60, "SystemNative_SetIPv6Address", nullptr}, + {0x4bd4b1c0803c8c55, "GlobalizationNative_GetLocaleName", nullptr}, + {0x4be7ceca50f3298c, "SystemNative_LowLevelMonitor_Create", nullptr}, + {0x4bec4a1d7dfd4cf7, "SystemNative_GetUnixRelease", nullptr}, + {0x4bfff22801b209ca, "SystemNative_LChflags", nullptr}, + {0x4c22cc4f2b1dab26, "SystemNative_SetPriority", nullptr}, + {0x4c5d96426f92c29d, "CryptoNative_HmacUpdate", nullptr}, + {0x4d6361e5095cff36, "AndroidCryptoNative_DsaSign", nullptr}, + {0x4d74053b37e582fa, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, + {0x4f22643b9509cc12, "GlobalizationNative_IsNormalized", nullptr}, + {0x501daf7e3a890220, "AndroidCryptoNative_X509ChainBuild", nullptr}, + {0x507983f11ffec7a8, "GlobalizationNative_GetTimeZoneDisplayName", nullptr}, + {0x509ff12da4e77259, "SystemNative_GetSocketAddressSizes", nullptr}, + {0x523240c01d14ad50, "SystemNative_GetPeerID", nullptr}, + {0x52794f1118d32f08, "SystemNative_GetUnixVersion", nullptr}, + {0x52fc107ebdb6fcc7, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, + {0x5381564d2c06c0a3, "SystemNative_SysConf", nullptr}, + {0x54ec3421ab70a40a, "Java_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate", nullptr}, + {0x556bc89d2d4dfc85, "SystemNative_GetDeviceIdentifiers", nullptr}, + {0x558250d199e906bb, "CryptoNative_ErrReasonErrorString", nullptr}, + {0x5592a052ceb4caf6, "SystemNative_GetProcessPath", nullptr}, + {0x55fe2620f63d83d8, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, + {0x56e982948d00f10d, "GlobalizationNative_IndexOf", nullptr}, + {0x574d77a68ec3e488, "SystemNative_GetEnv", nullptr}, + {0x5755d1cd0c158620, "BrotliDecoderSetParameter", nullptr}, + {0x580dda20ac9e83c6, "BrotliEncoderSetParameter", nullptr}, + {0x583db0344a1cd715, "SystemNative_GetActiveUdpListeners", nullptr}, + {0x5908581fe73717f0, "SystemNative_InterfaceNameToIndex", nullptr}, + {0x5916efc3e1e49137, "CryptoNative_ErrPeekError", nullptr}, + {0x5a114024ecd1162c, "CryptoNative_EvpDigestUpdate", nullptr}, + {0x5a305cf2a314d6a6, "SystemNative_FTruncate", nullptr}, + {0x5a337d9cc7d8bcfd, "CryptoNative_HmacCurrent", nullptr}, + {0x5d503db70d17dad2, "BrotliEncoderIsFinished", nullptr}, + {0x5dd1d1d024378765, "CryptoNative_EvpMdSize", nullptr}, + {0x5e53b688fede3216, "SystemNative_GetControlCharacters", nullptr}, + {0x5fa62856bdbba9c0, "SystemNative_GetPort", nullptr}, + {0x5fd29ac523ff6e3d, "AndroidCryptoNative_SSLStreamRelease", nullptr}, + {0x5ffae3c8023a80b8, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, + {0x600b4418896f7808, "SystemNative_Exit", nullptr}, + {0x6089f0c8112eb3d9, "SystemNative_InitializeConsoleBeforeRead", nullptr}, + {0x613307e537d462db, "SystemNative_GetReadDirRBufferSize", nullptr}, + {0x61bacd7170fd8c9b, "SystemNative_SchedSetAffinity", nullptr}, + {0x61f3ce1b18b20d6f, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, + {0x62351df42d842942, "SystemNative_GetSignalForBreak", nullptr}, + {0x635327a9b09a910d, "GlobalizationNative_NormalizeString", nullptr}, + {0x6393d30aceaa6df2, "SystemNative_PWriteV", nullptr}, + {0x6448f0806bd3a338, "SystemNative_FreeEnviron", nullptr}, + {0x648a9b317bc64fe0, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, + {0x650eddee76c6b8da, "SystemNative_GetHostName", nullptr}, + {0x652badfba5d61929, "SystemNative_FcntlSetFD", nullptr}, + {0x66e049fe27bf91ea, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, + {0x6792c0a7ea5d19c9, "BrotliEncoderTakeOutput", nullptr}, + {0x67a8868ef592a3fd, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, + {0x67a9b5bbce322f8c, "AndroidCryptoNative_Des3Cbc", nullptr}, + {0x67d2cd86792b1d0c, "SystemNative_Realloc", nullptr}, + {0x67e9d60481f4be06, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, + {0x68df81a8fb5bf442, "SystemNative_GetSockOpt", nullptr}, + {0x68f3fe6083c0355b, "SystemNative_GetLoadLibraryError", nullptr}, + {0x69ad99fac0467f64, "SystemNative_Link", nullptr}, + {0x6a59d9242cd31785, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, + {0x6ac3aeecfc75bfad, "GlobalizationNative_GetSortVersion", nullptr}, + {0x6b9097385aa77917, "SystemNative_FSync", nullptr}, + {0x6b9bce16ba8e845f, "SystemNative_Malloc", nullptr}, + {0x6bc18fbbbf267e2a, "SystemNative_ReceiveSocketError", nullptr}, + {0x6d566e1f6e5a2d8f, "BrotliDefaultAllocFunc", nullptr}, + {0x6dbd90e9cc86310b, "AndroidCryptoNative_CipherFinalEx", nullptr}, + {0x6dfd40c2dd0d7382, "AndroidCryptoNative_RsaUpRef", nullptr}, + {0x6e2c1caff08e6e2d, "SystemNative_ReadStdin", nullptr}, + {0x6ee05d5e8650e56c, "SystemNative_DisablePosixSignalHandling", nullptr}, + {0x6f990f1f7bc80630, "AndroidCryptoNative_RsaCreate", nullptr}, + {0x70f907b97d3fe059, "AndroidCryptoNative_Aes192Ccm", nullptr}, + {0x7150f0eb40797bb3, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, + {0x724820d307055ed1, "CryptoNative_HmacFinal", nullptr}, + {0x729afe37cdb8ae8f, "SystemNative_Connect", nullptr}, + {0x730ae9a7469a7321, "SystemNative_GetAllMountPoints", nullptr}, + {0x7356b141407d261e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, + {0x742da00b2dbf435d, "SystemNative_LoadLibrary", nullptr}, + {0x74ec4a8d869776ad, "AndroidCryptoNative_Aes128Ccm", nullptr}, + {0x7559feb379d38da5, "SystemNative_GetTimeZoneData", nullptr}, + {0x758dfbf057da0da0, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, + {0x77ca6a148e5a51d9, "GlobalizationNative_IanaIdToWindowsId", nullptr}, + {0x7975d1d7029cf1a3, "AndroidCryptoNative_Aes128Gcm", nullptr}, + {0x79f5c24afbd04af1, "AndroidCryptoNative_Aes256Cbc", nullptr}, + {0x7a37e0d077f2dfe5, "AndroidCryptoNative_DsaGenerateKey", nullptr}, + {0x7a4d912694906c9c, "GlobalizationNative_ToUnicode", nullptr}, + {0x7af1f52a7a632e95, "BrotliDecoderTakeOutput", nullptr}, + {0x7d5273ad530e7298, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, + {0x7d7ee4bce74d4de9, "SystemNative_GetDomainSocketSizes", nullptr}, + {0x7e1766c6df3ad261, "SystemNative_MUnmap", nullptr}, + {0x7e4bdf46d4ff9f11, "SystemNative_MkNod", nullptr}, + {0x7e5fa2f70891c7fe, "GlobalizationNative_ChangeCaseTurkish", nullptr}, + {0x7ec328b6ba9eab8a, "SystemNative_WaitForSocketEvents", nullptr}, + {0x7fa96d0284954375, "AndroidCryptoNative_X509Decode", nullptr}, + {0x80ef5040fdcc248d, "BrotliEncoderMaxCompressedSize", nullptr}, + {0x813bedf08c3388d4, "AndroidCryptoNative_Aes128Cfb8", nullptr}, + {0x84c8a7489b37fea0, "SystemNative_GetPlatformSignalNumber", nullptr}, + {0x84cc0301870c37ce, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, + {0x8502eeba98158e79, "SystemNative_FcntlSetIsNonBlocking", nullptr}, + {0x8530d37777969db6, "SystemNative_SetKeypadXmit", nullptr}, + {0x85d0033bc38bb4bb, "SystemNative_MAdvise", nullptr}, + {0x868e09dc7dfea364, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, + {0x870191ad244b8069, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, + {0x87019b7831c0c34c, "AndroidCryptoNative_Aes192Gcm", nullptr}, + {0x87c447e7f873cff0, "AndroidCryptoNative_X509ChainValidate", nullptr}, + {0x889350f209555ecb, "SystemNative_MkdTemp", nullptr}, + {0x88a08b60b80c70cc, "SystemNative_FChMod", nullptr}, + {0x88cfeefc903f9d60, "CryptoNative_EvpDigestCurrent", nullptr}, + {0x8bcabce135063bed, "SystemNative_OpenDir", nullptr}, + {0x8df448aee6e8fa5e, "SystemNative_WaitPidExitedNoHang", nullptr}, + {0x8e96cb02418947cc, "SystemNative_FcntlGetPipeSz", nullptr}, + {0x8fb6ed14ee0256bc, "SystemNative_GetTimestamp", nullptr}, + {0x8ffe2d950d138c01, "SystemNative_SchedGetCpu", nullptr}, + {0x9039632237d70ae7, "AndroidCryptoNative_NewGlobalReference", nullptr}, + {0x9161ade1206fd86e, "AndroidCryptoNative_Aes256Cfb128", nullptr}, + {0x9167a072639a7c95, "AndroidCryptoNative_Aes256Ccm", nullptr}, + {0x91f065ec0d3aec55, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, + {0x93a8bec488055608, "SystemNative_GetPwNamR", nullptr}, + {0x95a0e2fc5c0cb49e, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, + {0x95a4cb8563cc6b14, "SystemNative_ShmOpen", nullptr}, + {0x9856fa59ed936b73, "SystemNative_GetSid", nullptr}, + {0x996ada1c038aabba, "SystemNative_MksTemps", nullptr}, + {0x9991a277809ef205, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, + {0x99a840c495204202, "SystemNative_GetBytesAvailable", nullptr}, + {0x99e3660fc483d7be, "CryptoNative_GetRandomBytes", nullptr}, + {0x9aa9eaee3dd8b23b, "SystemNative_GetIPv4MulticastOption", nullptr}, + {0x9aaaad33b28af82f, "SystemNative_SetSignalForBreak", nullptr}, + {0x9aab07f824659d3e, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, + {0x9c3e8b890033819a, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, + {0x9c832cd7fcbf2de0, "SystemNative_MkFifo", nullptr}, + {0x9d2cb31282abd3d9, "SystemNative_GetNetworkInterfaces", nullptr}, + {0x9e25ebf4f61cc299, "SystemNative_ChDir", nullptr}, + {0x9e79166979634030, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, + {0x9edddf30d660eff4, "AndroidCryptoNative_Aes192Ecb", nullptr}, + {0x9fb01da1222e905a, "SystemNative_IsATty", nullptr}, + {0xa193402ff5140ac1, "GlobalizationNative_GetCalendarInfo", nullptr}, + {0xa1e881a63614507e, "SystemNative_INotifyRemoveWatch", nullptr}, + {0xa2254fea4d8b6909, "SystemNative_MMap", nullptr}, + {0xa272b5349013d9ef, "CryptoNative_EvpSha256", nullptr}, + {0xa2d7790a850024c0, "SystemNative_GetNumRoutes", nullptr}, + {0xa302613a430248b8, "SystemNative_GetGroups", nullptr}, + {0xa308025a784497df, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, + {0xa56532a23755cd87, "SystemNative_StdinReady", nullptr}, + {0xa56954e28eb9a9c9, "AndroidCryptoNative_Des3Cfb8", nullptr}, + {0xa57e18f82abd5958, "BrotliDecoderDestroyInstance", nullptr}, + {0xa5eda72b95fe78c3, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, + {0xa831a683f743e417, "GlobalizationNative_WindowsIdToIanaId", nullptr}, + {0xa89b70c38d3ba079, "CryptoNative_HmacCreate", nullptr}, + {0xa89ec9958d999483, "SystemNative_GetCwd", nullptr}, + {0xa8bdc3e7ee898dfc, "SystemNative_Shutdown", nullptr}, + {0xa93eb533acf7564d, "AndroidCryptoNative_DesEcb", nullptr}, + {0xa94b1cf083978da9, "CryptoNative_EvpMdCtxCopyEx", nullptr}, + {0xa961e8db31830e16, "AndroidCryptoNative_Aes192Cfb8", nullptr}, + {0xaa8f0f87ae474ffe, "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", nullptr}, + {0xabdcf2f74d210f35, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, + {0xac11eab9d9c31b01, "SystemNative_UTimensat", nullptr}, + {0xac5c6a70d140a4bf, "GlobalizationNative_GetLocaleTimeFormat", nullptr}, + {0xac7725c652a5fb5b, "SystemNative_CopyFile", nullptr}, + {0xad1a2d6575cdd4e3, "AndroidCryptoNative_SSLStreamWrite", nullptr}, + {0xad228cdc4edb11d6, "SystemNative_CloseDir", nullptr}, + {0xadc6889903a2d6f4, "SystemNative_Rename", nullptr}, + {0xae320903718eb45d, "SystemNative_MapTcpState", nullptr}, + {0xae82e9ceae24192d, "AndroidCryptoNative_Pbkdf2", nullptr}, + {0xaf72b94c4acee897, "BrotliDecoderHasMoreOutput", nullptr}, + {0xaf9706efc72c3904, "SystemNative_SetIPv6MulticastOption", nullptr}, + {0xafd9f6338cdbadd4, "SystemNative_GetHostEntryForName", nullptr}, + {0xafe3d21bbaa71464, "CompressionNative_DeflateEnd", nullptr}, + {0xb0b66a7145de350d, "SystemNative_Access", nullptr}, + {0xb0df46ff09c57741, "AndroidCryptoNative_GetRsaParameters", nullptr}, + {0xb0e18377ed603e0b, "SystemNative_GetGroupList", nullptr}, + {0xb1c394b9992bd67d, "AndroidCryptoNative_EcDsaSign", nullptr}, + {0xb1ff12f3bd735982, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, + {0xb361006446f560e8, "SystemNative_LogError", nullptr}, + {0xb3e1e5e50cde576e, "BrotliEncoderVersion", nullptr}, + {0xb41fa43cc5c261cb, "BrotliDecoderGetErrorCode", nullptr}, + {0xb4996dd1aba38200, "AndroidCryptoNative_EcDsaSize", nullptr}, + {0xb516027cb59e6541, "BrotliDecoderIsFinished", nullptr}, + {0xb575ec01a7a79f8f, "AndroidCryptoNative_DesCfb8", nullptr}, + {0xb600c44028c1743d, "SystemNative_Socket", nullptr}, + {0xb632e9bc6f7be0a9, "SystemNative_GetSockName", nullptr}, + {0xb6540b73eff28747, "SystemNative_SetRawSockOpt", nullptr}, + {0xb66be1550d27bfb4, "AndroidCryptoNative_GetECCurveParameters", nullptr}, + {0xb69c3cc8b9f6a724, "BrotliDecoderIsUsed", nullptr}, + {0xb6ab9abf7887911f, "SystemNative_ReadEvents", nullptr}, + {0xb73c597de01bc0b2, "SystemNative_GetPwUidR", nullptr}, + {0xb78af5975603cd20, "SystemNative_Sync", nullptr}, + {0xb7bbbe2c16a565c6, "SystemNative_Calloc", nullptr}, + {0xb81236cd1fe85cc9, "GlobalizationNative_GetLatestJapaneseEra", nullptr}, + {0xb828d9e7df5437a5, "BrotliDecoderErrorString", nullptr}, + {0xb95350c7ec77bc72, "GlobalizationNative_ChangeCase", nullptr}, + {0xba2f6d298f3be8bc, "CryptoNative_EvpMd5", nullptr}, + {0xbb3343826d504870, "SystemNative_GetBootTimeTicks", nullptr}, + {0xbb5e970ecb6745da, "SystemNative_SymLink", nullptr}, + {0xbbd20cce92ec2c12, "SystemNative_FcntlGetFD", nullptr}, + {0xbcd9e53d2d288094, "SystemNative_GetNameInfo", nullptr}, + {0xbd5a0be2f7904089, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, + {0xbd89ef4df5486744, "SystemNative_Send", nullptr}, + {0xbdbbd2898347c0d1, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, + {0xbdd3128e77381b01, "SystemNative_EnumerateInterfaceAddresses", nullptr}, + {0xbe8df478de07c6d8, "BrotliDefaultFreeFunc", nullptr}, + {0xc00ebc097b776c1f, "SystemNative_GetPriority", nullptr}, + {0xc036b23d88fad91b, "SystemNative_iOSSupportVersion", nullptr}, + {0xc0bb2dd0c5b74436, "CryptoNative_EnsureOpenSslInitialized", nullptr}, + {0xc10e411c989a9314, "CompressionNative_Deflate", nullptr}, + {0xc11cd661db8be230, "AndroidCryptoNative_Des3Cfb64", nullptr}, + {0xc183a0550feea0d6, "BrotliEncoderCompressStream", nullptr}, + {0xc19b94823ea1d39e, "CryptoNative_HmacOneShot", nullptr}, + {0xc1b8a5f1c799e4bb, "BrotliGetDictionary", nullptr}, + {0xc1c679eefc134d31, "SystemNative_LowLevelMonitor_Release", nullptr}, + {0xc287daf58054a21d, "GlobalizationNative_EndsWith", nullptr}, + {0xc2d5e1c465b2f5b6, "AndroidCryptoNative_DsaSizeP", nullptr}, + {0xc3145e336c38379b, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, + {0xc3c10021b10ba455, "SystemNative_GetEGid", nullptr}, + {0xc3fe9394fe1f3f02, "SystemNative_GetSocketType", nullptr}, + {0xc560d9947ab2a34d, "SystemNative_RegisterForSigChld", nullptr}, + {0xc5bed971846027de, "SystemNative_GetCpuUtilization", nullptr}, + {0xc69433678dd341ca, "SystemNative_ForkAndExecProcess", nullptr}, + {0xc7815e0476511544, "AndroidCryptoNative_X509Encode", nullptr}, + {0xc7ae1b8d93af5d73, "SystemNative_ChMod", nullptr}, + {0xc7d536c0e7eb3fe2, "SystemNative_FreeSocketEventBuffer", nullptr}, + {0xc7f81d5b58b65ac0, "BrotliEncoderCreateInstance", nullptr}, + {0xc87a5ee4869035c6, "SystemNative_UninitializeConsoleAfterRead", nullptr}, + {0xc8a52a8b6d96b32b, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, + {0xc8b772178f955d87, "GlobalizationNative_GetSortHandle", nullptr}, + {0xc93df58ae5457bfd, "SystemNative_GetControlMessageBufferSize", nullptr}, + {0xc956e528f995739c, "SystemNative_ReceiveMessage", nullptr}, + {0xca001af79c0d7a8b, "CompressionNative_InflateEnd", nullptr}, + {0xca48c3927c202794, "AndroidCryptoNative_GetECKeyParameters", nullptr}, + {0xcaae6d345ba32c7b, "SystemNative_Kill", nullptr}, + {0xcaec08aa13779f7f, "SystemNative_GetEnviron", nullptr}, + {0xcaf599a20538b10b, "SystemNative_SetWindowSize", nullptr}, + {0xcb4bcdafdc81d116, "AndroidCryptoNative_CipherCreatePartial", nullptr}, + {0xcbbb90469d28cded, "SystemNative_SearchPath", nullptr}, + {0xcc433093c073719e, "AndroidCryptoNative_SSLStreamRead", nullptr}, + {0xcc43d880192dd6ff, "SystemNative_ConvertErrorPlatformToPal", nullptr}, + {0xcc788c0474c3e178, "SystemNative_LSeek", nullptr}, + {0xcd5d8a63493f5e38, "CompressionNative_InflateInit2_", nullptr}, + {0xcdcb014df9a6eae2, "SystemNative_SetPort", nullptr}, + {0xce36e2e1a139a020, "SystemNative_GetDefaultTimeZone", nullptr}, + {0xce6ddfe40fed99d9, "SystemNative_PRead", nullptr}, + {0xce9f8a6ac705faa5, "AndroidCryptoNative_X509DecodeCollection", nullptr}, + {0xceba527295694651, "BrotliDecoderCreateInstance", nullptr}, + {0xd0899515dfe85287, "GlobalizationNative_LoadICU", nullptr}, + {0xd185dfe303ab91dd, "GlobalizationNative_CompareString", nullptr}, + {0xd392d6ed5dcc111c, "SystemNative_GetDomainName", nullptr}, + {0xd5264d57a926edfb, "GlobalizationNative_InitICUFunctions", nullptr}, + {0xd55437b16dc84f3b, "SystemNative_GetIPv4GlobalStatistics", nullptr}, + {0xd5c063a90ae882c1, "AndroidCryptoNative_CipherIsSupported", nullptr}, + {0xd7d818c7640598dc, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, + {0xd7f1a8f616897ace, "AndroidCryptoNative_Aes256Cfb8", nullptr}, + {0xd88be8f9e9f28e90, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, + {0xd8976692c4c68818, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, + {0xd8a9e47b6ca78448, "CryptoNative_ErrPeekLastError", nullptr}, + {0xd995e71361e6ed2e, "GlobalizationNative_IsPredefinedLocale", nullptr}, + {0xd9bd0b370726ce34, "AndroidCryptoNative_CipherReset", nullptr}, + {0xda05c57c78aa6706, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, + {0xda38bffa1d16cdd6, "SystemNative_SetLingerOption", nullptr}, + {0xda4898a26933f73d, "AndroidCryptoNative_DsaVerify", nullptr}, + {0xda6b3192974ca60e, "SystemNative_Open", nullptr}, + {0xdab5eb45815daabc, "SystemNative_GetAtOutOfBandMark", nullptr}, + {0xdae32aac0c0d305c, "SystemNative_ReadProcessStatusInfo", nullptr}, + {0xdbb4752ed23670f0, "AndroidCryptoNative_DesCbc", nullptr}, + {0xdbee22594fa8c585, "SystemNative_CreateAutoreleasePool", nullptr}, + {0xdc51159ffe70b0e0, "BrotliDecoderVersion", nullptr}, + {0xdc780005b0d39711, "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", nullptr}, + {0xdd4c03f06ce96e04, "AndroidCryptoNative_RsaDestroy", nullptr}, + {0xdde06993f87d6ffc, "AndroidCryptoNative_Aes128Cfb128", nullptr}, + {0xde1e22dd097f799c, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, + {0xde259001bf54e6f1, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, + {0xdec5c7544d2c8cb1, "AndroidCryptoNative_GetDsaParameters", nullptr}, + {0xdf650444c8af0763, "SystemNative_FcntlGetIsNonBlocking", nullptr}, + {0xdfede2defd776f7e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, + {0xe059239741e0011a, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, + {0xe072da8f2d921f53, "GlobalizationNative_GetDefaultLocaleName", nullptr}, + {0xe0a170d2b947a8fc, "SystemNative_SendMessage", nullptr}, + {0xe0a601fd89d9b279, "SystemNative_SetErrNo", nullptr}, + {0xe0f34ce89fd38aef, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, + {0xe1930d112ce74c9e, "SystemNative_TryGetUInt32OSThreadId", nullptr}, + {0xe20c29fb8b19da7b, "SystemNative_Listen", nullptr}, + {0xe36a157177b2db08, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, + {0xe44f737a5bebdd90, "SystemNative_SetIPv4Address", nullptr}, + {0xe582a4a60bb74c35, "SystemNative_GetProcAddress", nullptr}, + {0xe604fca300068c0c, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, + {0xe6838f2add787bfe, "SystemNative_FreeLibrary", nullptr}, + {0xe73aeaf9e3a10343, "SystemNative_PWrite", nullptr}, + {0xe78ff100d1d73d99, "SystemNative_SetReceiveTimeout", nullptr}, + {0xe853ecfe4d402ed0, "SystemNative_Poll", nullptr}, + {0xea21aa1f2b2a671c, "GlobalizationNative_LastIndexOf", nullptr}, + {0xea5e6653389b924a, "CompressionNative_DeflateInit2_", nullptr}, + {0xea61d6c040267b2d, "BrotliSetDictionaryData", nullptr}, + {0xeaafb7963ceb9bf4, "SystemNative_GetTcpGlobalStatistics", nullptr}, + {0xeab45239fb3f138d, "AndroidCryptoNative_GetBigNumBytes", nullptr}, + {0xec67e4076662c2de, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, + {0xee4dd111dc8d98f3, "GlobalizationNative_GetJapaneseEraStartDate", nullptr}, + {0xef71ee101b3ece96, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, + {0xeff5d014640ae969, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, + {0xf0045895a9043221, "SystemNative_SearchPath_TempDirectory", nullptr}, + {0xf0658a22dd5ede19, "SystemNative_SNPrintF_1I", nullptr}, + {0xf0ec052da6c5fa70, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, + {0xf1577384f409ea85, "AndroidCryptoNative_BigNumToBinary", nullptr}, + {0xf2c7fa39bf166188, "SystemNative_Free", nullptr}, + {0xf2d074e0aeca51ce, "GlobalizationNative_GetLocales", nullptr}, + {0xf3693f3cadb9b6f4, "GlobalizationNative_EnumCalendarInfo", nullptr}, + {0xf38b47e43f352491, "SystemNative_GetUdpGlobalStatistics", nullptr}, + {0xf432f105a045b088, "CryptoNative_ErrClearError", nullptr}, + {0xf4dea312f71c5ff2, "AndroidCryptoNative_Aes128Ecb", nullptr}, + {0xf4f5526ddc32beac, "CryptoNative_HmacDestroy", nullptr}, + {0xf57f81262f07542c, "AndroidCryptoNative_Des3Ecb", nullptr}, + {0xf63fa2bfce5c4f80, "GlobalizationNative_GetLocaleInfoGroupingSizes", nullptr}, + {0xf6ede5d5d8729315, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, + {0xf75d4fdd6e749a84, "BrotliTransformDictionaryWord", nullptr}, + {0xf7b334768844b502, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, + {0xf85b8ffeba9b06c1, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, + {0xf870179a8d8d1872, "SystemNative_PosixFAdvise", nullptr}, + {0xf8c983dd21ef9fe6, "SystemNative_GetPid", nullptr}, + {0xf96bc1e7e15e69f2, "AndroidCryptoNative_CipherUpdate", nullptr}, + {0xf970881d4fa83e07, "AndroidCryptoNative_CipherCreate", nullptr}, + {0xf9c3d216226b3355, "AndroidCryptoNative_CipherSetTagLength", nullptr}, + {0xf9dea6e72f1fffc9, "CryptoNative_EvpMdCtxCreate", nullptr}, + {0xfa21f0a127c9dce9, "GlobalizationNative_ChangeCaseInvariant", nullptr}, + {0xfa2669c25616a8ff, "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", nullptr}, + {0xfa26b86cedf66721, "SystemNative_Sysctl", nullptr}, + {0xfaa7766eaa2c54a5, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, + {0xfacf02f439426705, "GlobalizationNative_CloseSortHandle", nullptr}, + {0xfb3e394cc613f202, "SystemNative_GetPeerName", nullptr}, + {0xfbb57319454b1074, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, + {0xfc0bad2b1528000f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, + {0xfcdeea476953780c, "AndroidCryptoNative_Aes192Cfb128", nullptr}, + {0xfd2cdd99f11de76c, "AndroidCryptoNative_EcKeyGetSize", nullptr}, + {0xfd4f2784ec1c98aa, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, + {0xfe3dd06281f7cd1f, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, + {0xff28b3bec4f32a2c, "SystemNative_GetFileSystemType", nullptr}, + {0xff9b8d95b0e209fb, "BrotliEncoderHasMoreOutput", nullptr}, + {0xffce9341c40b2b73, "BrotliDecoderDecompress", nullptr}, + }}; + + +constexpr hash_t java_interop_library_hash = 0x54568ec36068e6b6; +constexpr hash_t xa_internal_api_library_hash = 0x43fd1b21148361b2; +constexpr hash_t system_native_library_hash = 0x4cd7bd0032e920e1; +constexpr hash_t system_io_compression_native_library_hash = 0x9190f4cb761b1d3c; +constexpr hash_t system_security_cryptography_native_android_library_hash = 0x1848c0093f0afd8; +constexpr hash_t system_globalization_native_library_hash = 0x28b5c8fca080abd5; +#else + //32-bit internal p/invoke table + std::array internal_pinvokes {{ + {0xb7a486a, "monodroid_TypeManager_get_java_class_name", reinterpret_cast(&monodroid_TypeManager_get_java_class_name)}, + {0xf562bd9, "monodroid_embedded_assemblies_set_assemblies_prefix", reinterpret_cast(&monodroid_embedded_assemblies_set_assemblies_prefix)}, + {0x1a8eab17, "_monodroid_get_identity_hash_code", reinterpret_cast(&_monodroid_get_identity_hash_code)}, + {0x227a2636, "monodroid_get_namespaced_system_property", reinterpret_cast(&monodroid_get_namespaced_system_property)}, + {0x2a0e1744, "java_interop_strdup", reinterpret_cast(&java_interop_strdup)}, + {0x2aea7c33, "_monodroid_max_gref_get", reinterpret_cast(&_monodroid_max_gref_get)}, + {0x2f7d0f53, "_monodroid_get_android_api_level", reinterpret_cast(&_monodroid_get_android_api_level)}, + {0x30b9487b, "_monodroid_get_dns_servers", reinterpret_cast(&_monodroid_get_dns_servers)}, + {0x3227d81a, "monodroid_timing_start", reinterpret_cast(&monodroid_timing_start)}, + {0x333d4835, "_monodroid_lookup_replacement_method_info", reinterpret_cast(&_monodroid_lookup_replacement_method_info)}, + {0x395808e5, "monodroid_dylib_mono_free", reinterpret_cast(&monodroid_dylib_mono_free)}, + {0x42b41fe4, "send_uninterrupted", reinterpret_cast(&send_uninterrupted)}, + {0x434ad3e4, "_monodroid_getifaddrs", reinterpret_cast(&_monodroid_getifaddrs)}, + {0x4b58e0da, "monodroid_get_dylib", reinterpret_cast(&monodroid_get_dylib)}, + {0x501befde, "monodroid_clear_gdb_wait", reinterpret_cast(&monodroid_clear_gdb_wait)}, + {0x501ebdc2, "monodroid_dylib_mono_init", reinterpret_cast(&monodroid_dylib_mono_init)}, + {0x7a6909a0, "_monodroid_counters_dump", reinterpret_cast(&_monodroid_counters_dump)}, + {0x7c94dbf5, "monodroid_fopen", reinterpret_cast(&monodroid_fopen)}, + {0x8f6837ec, "monodroid_strdup_printf", reinterpret_cast(&monodroid_strdup_printf)}, + {0x9070e02c, "_monodroid_lref_log_delete", reinterpret_cast(&_monodroid_lref_log_delete)}, + {0x910452d0, "monodroid_timing_stop", reinterpret_cast(&monodroid_timing_stop)}, + {0x934790b1, "monodroid_strsplit", reinterpret_cast(&monodroid_strsplit)}, + {0x9a734f16, "_monodroid_weak_gref_get", reinterpret_cast(&_monodroid_weak_gref_get)}, + {0x9b7b9290, "monodroid_get_system_property", reinterpret_cast(&monodroid_get_system_property)}, + {0x9c5b24a8, "_monodroid_weak_gref_new", reinterpret_cast(&_monodroid_weak_gref_new)}, + {0xa04e5d1c, "monodroid_free", reinterpret_cast(&monodroid_free)}, + {0xa11d71da, "monodroid_strfreev", reinterpret_cast(&monodroid_strfreev)}, + {0xa7ea4a5f, "path_combine", reinterpret_cast(&path_combine)}, + {0xad511c82, "_monodroid_timezone_get_default_id", reinterpret_cast(&_monodroid_timezone_get_default_id)}, + {0xb02468aa, "_monodroid_gref_get", reinterpret_cast(&_monodroid_gref_get)}, + {0xbe8d7701, "_monodroid_gref_log_new", reinterpret_cast(&_monodroid_gref_log_new)}, + {0xc0d097a7, "_monodroid_lref_log_new", reinterpret_cast(&_monodroid_lref_log_new)}, + {0xc439b5d7, "_monodroid_lookup_replacement_type", reinterpret_cast(&_monodroid_lookup_replacement_type)}, + {0xc5146c54, "_monodroid_gref_log_delete", reinterpret_cast(&_monodroid_gref_log_delete)}, + {0xc58eafa5, "java_interop_free", reinterpret_cast(&java_interop_free)}, + {0xd3b5d2c1, "_monodroid_freeifaddrs", reinterpret_cast(&_monodroid_freeifaddrs)}, + {0xd78c749d, "monodroid_get_log_categories", reinterpret_cast(&monodroid_get_log_categories)}, + {0xd91f3619, "create_public_directory", reinterpret_cast(&create_public_directory)}, + {0xe215a17c, "_monodroid_weak_gref_delete", reinterpret_cast(&_monodroid_weak_gref_delete)}, + {0xe4c3ee19, "monodroid_log_traces", reinterpret_cast(&monodroid_log_traces)}, + {0xe7e77ca5, "_monodroid_gref_log", reinterpret_cast(&_monodroid_gref_log)}, + {0xea2184e3, "_monodroid_gc_wait_for_bridge_processing", reinterpret_cast(&_monodroid_gc_wait_for_bridge_processing)}, + {0xf4079b4a, "monodroid_dylib_mono_new", reinterpret_cast(&monodroid_dylib_mono_new)}, + {0xf5a0ac55, "set_world_accessable", reinterpret_cast(&set_world_accessable)}, + {0xf61941c3, "recv_uninterrupted", reinterpret_cast(&recv_uninterrupted)}, + {0xf6ca4b3b, "_monodroid_get_network_interface_supports_multicast", reinterpret_cast(&_monodroid_get_network_interface_supports_multicast)}, + {0xfa1832a6, "_monodroid_detect_cpu_and_architecture", reinterpret_cast(&_monodroid_detect_cpu_and_architecture)}, + {0xfa4e32ca, "monodroid_log", reinterpret_cast(&monodroid_log)}, + {0xfdc3ae2a, "_monodroid_get_network_interface_up_state", reinterpret_cast(&_monodroid_get_network_interface_up_state)}, + }}; + + //32-bit DotNet p/invoke table + std::array dotnet_pinvokes {{ + {0xaf6b1c, "AndroidCryptoNative_RsaPrivateDecrypt", nullptr}, + {0x1733089, "SystemNative_SetTerminalInvalidationHandler", nullptr}, + {0x1dd1f00, "AndroidCryptoNative_Aes192Cfb8", nullptr}, + {0x23a0578, "AndroidCryptoNative_NewGlobalReference", nullptr}, + {0x2f05496, "SystemNative_GetPeerName", nullptr}, + {0x3295077, "SystemNative_MapTcpState", nullptr}, + {0x3d9bc5f, "SystemNative_Unlink", nullptr}, + {0x3e12cb4, "SystemNative_INotifyInit", nullptr}, + {0x5b0fb1d, "SystemNative_InitializeConsoleBeforeRead", nullptr}, + {0x80f30b4, "BrotliDecoderTakeOutput", nullptr}, + {0x84ccf89, "SystemNative_MSync", nullptr}, + {0x8c636a2, "SystemNative_FcntlSetPipeSz", nullptr}, + {0x8de5b3d, "SystemNative_GetSid", nullptr}, + {0x92bf2d9, "AndroidCryptoNative_EcKeyGetSize", nullptr}, + {0xaa46d20, "SystemNative_SNPrintF", nullptr}, + {0xaa7c86e, "SystemNative_Exit", nullptr}, + {0xb6a80bd, "SystemNative_SetAddressFamily", nullptr}, + {0xbdd984d, "SystemNative_SetWindowSize", nullptr}, + {0xcc59904, "CryptoNative_HmacDestroy", nullptr}, + {0xd5ca844, "SystemNative_CreateSocketEventPort", nullptr}, + {0xd98d741, "SystemNative_Kill", nullptr}, + {0xdfe3e26, "SystemNative_Connectx", nullptr}, + {0xfc48476, "SystemNative_GetNonCryptographicallySecureRandomBytes", nullptr}, + {0x10d108c9, "SystemNative_FreeHostEntry", nullptr}, + {0x1165644f, "SystemNative_GetOSArchitecture", nullptr}, + {0x11778651, "SystemNative_ConfigureTerminalForChildProcess", nullptr}, + {0x1178ebdd, "CryptoNative_EvpDigestFinalEx", nullptr}, + {0x11a2796d, "SystemNative_GetTcpGlobalStatistics", nullptr}, + {0x11d9981e, "SystemNative_MProtect", nullptr}, + {0x12105897, "GlobalizationNative_NormalizeString", nullptr}, + {0x12b01cc9, "GlobalizationNative_IsNormalized", nullptr}, + {0x12fdf5c3, "SystemNative_ConvertErrorPlatformToPal", nullptr}, + {0x1348bf25, "AndroidCryptoNative_SSLStreamWrite", nullptr}, + {0x1376985b, "SystemNative_SetSockOpt", nullptr}, + {0x13925de2, "SystemNative_GetLingerOption", nullptr}, + {0x13f565a9, "SystemNative_GetControlMessageBufferSize", nullptr}, + {0x142a08a1, "SystemNative_PosixFAdvise", nullptr}, + {0x16d98313, "GlobalizationNative_IndexOf", nullptr}, + {0x17549123, "SystemNative_Connect", nullptr}, + {0x17a5d095, "AndroidCryptoNative_SSLStreamGetApplicationProtocol", nullptr}, + {0x17b96c39, "SystemNative_FreeSocketEventBuffer", nullptr}, + {0x1904820d, "SystemNative_GetHostEntryForName", nullptr}, + {0x19b6a696, "AndroidCryptoNative_X509DecodeCollection", nullptr}, + {0x1a302b28, "SystemNative_SchedSetAffinity", nullptr}, + {0x1aa4105d, "GlobalizationNative_GetSortKey", nullptr}, + {0x1ab1248e, "SystemNative_GetHostName", nullptr}, + {0x1bf277c4, "SystemNative_WaitForSocketEvents", nullptr}, + {0x1c4778bf, "SystemNative_AlignedFree", nullptr}, + {0x1cb466df, "AndroidCryptoNative_RsaGenerateKeyEx", nullptr}, + {0x1cf7b52c, "SystemNative_MAdvise", nullptr}, + {0x1eb6eaaa, "CryptoNative_GetRandomBytes", nullptr}, + {0x1ebc63c1, "AndroidCryptoNative_X509ChainDestroyContext", nullptr}, + {0x1f186646, "AndroidCryptoNative_CipherSetKeyAndIV", nullptr}, + {0x1f1cd573, "AndroidCryptoNative_Des3Cfb64", nullptr}, + {0x1f998744, "AndroidCryptoNative_Aes128Cfb128", nullptr}, + {0x1fdcd1e0, "CryptoNative_ErrPeekError", nullptr}, + {0x212e38c4, "SystemNative_GetUdpGlobalStatistics", nullptr}, + {0x218fa94a, "AndroidCryptoNative_X509StoreDeleteEntry", nullptr}, + {0x22011e2b, "SystemNative_SetLingerOption", nullptr}, + {0x224ebd71, "SystemNative_Listen", nullptr}, + {0x2253b591, "BrotliGetTransforms", nullptr}, + {0x226eec4d, "SystemNative_Abort", nullptr}, + {0x229f73d4, "AndroidCryptoNative_RsaUpRef", nullptr}, + {0x22bbb587, "AndroidCryptoNative_SSLStreamGetPeerCertificate", nullptr}, + {0x2304e65b, "SystemNative_SetRLimit", nullptr}, + {0x23cfcfb0, "BrotliTransformDictionaryWord", nullptr}, + {0x260a3e8d, "CompressionNative_DeflateInit2_", nullptr}, + {0x289b5430, "SystemNative_Log", nullptr}, + {0x28d95a99, "SystemNative_CanGetHiddenFlag", nullptr}, + {0x28f3db4b, "SystemNative_ShmUnlink", nullptr}, + {0x2af6aa40, "SystemNative_Access", nullptr}, + {0x2b117055, "BrotliDecoderDecompress", nullptr}, + {0x2b7293c5, "SystemNative_GetTimestamp", nullptr}, + {0x2b747a9c, "SystemNative_MkNod", nullptr}, + {0x2bc9ff5e, "AndroidCryptoNative_SSLStreamGetProtocol", nullptr}, + {0x2c4415fd, "AndroidCryptoNative_AeadCipherFinalEx", nullptr}, + {0x2c467430, "AndroidCryptoNative_GetECCurveParameters", nullptr}, + {0x2d21ad97, "SystemNative_GetReadDirRBufferSize", nullptr}, + {0x2d6e4a1c, "AndroidCryptoNative_X509StoreRemoveCertificate", nullptr}, + {0x2e66f31b, "BrotliDecoderDestroyInstance", nullptr}, + {0x2eb28fb6, "SystemNative_GetIPv4Address", nullptr}, + {0x2f7d80dd, "GlobalizationNative_WindowsIdToIanaId", nullptr}, + {0x2ff73621, "CryptoNative_ErrReasonErrorString", nullptr}, + {0x30af09b7, "AndroidCryptoNative_DecodeRsaSubjectPublicKeyInfo", nullptr}, + {0x31120969, "SystemNative_Malloc", nullptr}, + {0x3374b950, "SystemNative_GetLoadLibraryError", nullptr}, + {0x34867c2f, "SystemNative_TryGetUInt32OSThreadId", nullptr}, + {0x349c5a8f, "SystemNative_GetNetworkInterfaces", nullptr}, + {0x354aa58f, "AndroidCryptoNative_DsaKeyCreateByExplicitParameters", nullptr}, + {0x363c0010, "CryptoNative_EvpDigestUpdate", nullptr}, + {0x367eee31, "AndroidCryptoNative_SSLStreamIsLocalCertificateUsed", nullptr}, + {0x38406fa3, "GlobalizationNative_ChangeCaseInvariant", nullptr}, + {0x38575bc5, "SystemNative_GetUnixRelease", nullptr}, + {0x388a31d4, "SystemNative_PathConf", nullptr}, + {0x3a238b9f, "AndroidCryptoNative_RsaVerificationPrimitive", nullptr}, + {0x3a861d34, "SystemNative_GetNativeIPInterfaceStatistics", nullptr}, + {0x3af56a10, "AndroidCryptoNative_RsaSize", nullptr}, + {0x3b286185, "GlobalizationNative_ChangeCaseTurkish", nullptr}, + {0x3bf3d465, "SystemNative_GetIPv6MulticastOption", nullptr}, + {0x3cb49aae, "SystemNative_GetPwNamR", nullptr}, + {0x3d150bdf, "AndroidCryptoNative_Aes128Ecb", nullptr}, + {0x3d823979, "GlobalizationNative_ToUnicode", nullptr}, + {0x3da52690, "SystemNative_FcntlCanGetSetPipeSz", nullptr}, + {0x3de52faf, "AndroidCryptoNative_CipherUpdateAAD", nullptr}, + {0x3df8d649, "SystemNative_SetDelayedSigChildConsoleConfigurationHandler", nullptr}, + {0x3e175e7c, "AndroidCryptoNative_Aes256Cfb128", nullptr}, + {0x3e273961, "SystemNative_StrErrorR", nullptr}, + {0x3e48f022, "SystemNative_GetMaximumAddressSize", nullptr}, + {0x3e778b38, "BrotliDecoderVersion", nullptr}, + {0x3ea31c40, "SystemNative_GetAddressFamily", nullptr}, + {0x3efdb5a0, "SystemNative_SendMessage", nullptr}, + {0x3f47618f, "CryptoNative_EnsureOpenSslInitialized", nullptr}, + {0x3f793993, "SystemNative_LowLevelMonitor_Signal_Release", nullptr}, + {0x40b0026c, "CompressionNative_DeflateEnd", nullptr}, + {0x40e64bdd, "CryptoNative_ErrClearError", nullptr}, + {0x413b9801, "SystemNative_Read", nullptr}, + {0x41818c1d, "SystemNative_GetPriority", nullptr}, + {0x41cf0c16, "AndroidCryptoNative_CipherCreate", nullptr}, + {0x42955366, "SystemNative_Disconnect", nullptr}, + {0x42afcfbb, "AndroidCryptoNative_CipherCreatePartial", nullptr}, + {0x430352b3, "SystemNative_GetNameInfo", nullptr}, + {0x43f6cea1, "AndroidCryptoNative_DesCfb8", nullptr}, + {0x4543d533, "AndroidCryptoNative_EcDsaVerify", nullptr}, + {0x45a00971, "GlobalizationNative_CloseSortHandle", nullptr}, + {0x45f09dca, "AndroidCryptoNative_CipherSetTagLength", nullptr}, + {0x46268e76, "GlobalizationNative_GetCalendarInfo", nullptr}, + {0x477f60cf, "SystemNative_OpenDir", nullptr}, + {0x47a82b4e, "SystemNative_AlignedRealloc", nullptr}, + {0x48c17c9b, "SystemNative_Sysctl", nullptr}, + {0x493888ee, "CompressionNative_Crc32", nullptr}, + {0x494ef6d4, "SystemNative_GetIPv4MulticastOption", nullptr}, + {0x496f1885, "SystemNative_GetSocketErrorOption", nullptr}, + {0x49c2af32, "SystemNative_GetBootTimeTicks", nullptr}, + {0x49c81782, "SystemNative_MkDir", nullptr}, + {0x49f60a0f, "GlobalizationNative_GetLocales", nullptr}, + {0x4a4ef46f, "SystemNative_FcntlGetFD", nullptr}, + {0x4a98a396, "GlobalizationNative_GetLocaleInfoInt", nullptr}, + {0x4b78d330, "CryptoNative_HmacCurrent", nullptr}, + {0x4c2eae6c, "GlobalizationNative_EnumCalendarInfo", nullptr}, + {0x4c6d50ba, "SystemNative_GetIPv4GlobalStatistics", nullptr}, + {0x4ca38207, "AndroidCryptoNative_X509StoreEnumerateTrustedCertificates", nullptr}, + {0x4cb997ae, "BrotliEncoderCompress", nullptr}, + {0x4d1a35d1, "SystemNative_LowLevelMonitor_Release", nullptr}, + {0x4d75bb15, "SystemNative_WaitIdAnyExitedNoHangNoWait", nullptr}, + {0x4dbf0c74, "SystemNative_CreateSocketEventBuffer", nullptr}, + {0x4e4d4f2a, "SystemNative_SetIPv6Address", nullptr}, + {0x4f6011da, "SystemNative_GetPort", nullptr}, + {0x4f6c3726, "SystemNative_FcntlGetIsNonBlocking", nullptr}, + {0x50e88639, "CryptoNative_HmacUpdate", nullptr}, + {0x514e739b, "AndroidCryptoNative_EcKeyCreateByExplicitParameters", nullptr}, + {0x52590509, "AndroidCryptoNative_Aes128Cbc", nullptr}, + {0x526c9f90, "SystemNative_GetNumRoutes", nullptr}, + {0x52896a81, "SystemNative_ChMod", nullptr}, + {0x538521c9, "GlobalizationNative_IanaIdToWindowsId", nullptr}, + {0x54d6c29d, "GlobalizationNative_GetJapaneseEraStartDate", nullptr}, + {0x5600bd0d, "AndroidCryptoNative_SSLStreamCreate", nullptr}, + {0x561fb6ff, "SystemNative_FStat", nullptr}, + {0x564f6794, "AndroidCryptoNative_Pbkdf2", nullptr}, + {0x56993aa9, "SystemNative_SetKeypadXmit", nullptr}, + {0x57bdcc46, "SystemNative_Open", nullptr}, + {0x581adfc6, "SystemNative_GetSignalForBreak", nullptr}, + {0x5906e1ba, "SystemNative_Close", nullptr}, + {0x591c5746, "AndroidCryptoNative_EcKeyUpRef", nullptr}, + {0x59840533, "AndroidCryptoNative_X509Decode", nullptr}, + {0x5989ad17, "SystemNative_GetIcmpv4GlobalStatistics", nullptr}, + {0x599921d3, "SystemNative_SysConf", nullptr}, + {0x59b67f4d, "AndroidCryptoNative_SSLGetSupportedProtocols", nullptr}, + {0x59e712d5, "SystemNative_MkdTemp", nullptr}, + {0x5a492732, "SystemNative_FcntlSetFD", nullptr}, + {0x5ccc38dd, "AndroidCryptoNative_SSLStreamGetPeerCertificates", nullptr}, + {0x5e9ef1a2, "SystemNative_GetAtOutOfBandMark", nullptr}, + {0x5eb4f827, "SystemNative_LockFileRegion", nullptr}, + {0x5ed67634, "SystemNative_GetPwUidR", nullptr}, + {0x5efc6409, "SystemNative_ReceiveSocketError", nullptr}, + {0x5f706f52, "AndroidCryptoNative_RsaSignPrimitive", nullptr}, + {0x5fc58bed, "SystemNative_GetEstimatedTcpConnectionCount", nullptr}, + {0x60571eb9, "AndroidCryptoNative_SSLSupportsApplicationProtocolsConfiguration", nullptr}, + {0x6068baa0, "AndroidCryptoNative_GetRsaParameters", nullptr}, + {0x608ee1a5, "SystemNative_Calloc", nullptr}, + {0x60c353e5, "SystemNative_SetPosixSignalHandler", nullptr}, + {0x613c0080, "AndroidCryptoNative_Aes192Ccm", nullptr}, + {0x626db703, "SystemNative_LStat", nullptr}, + {0x6288dd9a, "SystemNative_SetSignalForBreak", nullptr}, + {0x62a36e75, "AndroidCryptoNative_X509ChainGetErrorCount", nullptr}, + {0x639b2b1d, "AndroidCryptoNative_DsaVerify", nullptr}, + {0x6436999d, "AndroidCryptoNative_SSLStreamRead", nullptr}, + {0x6441bc65, "CryptoNative_EvpSha256", nullptr}, + {0x64f12e5b, "BrotliDecoderIsFinished", nullptr}, + {0x661c5218, "SystemNative_GetDomainName", nullptr}, + {0x6661a841, "BrotliDecoderDecompressStream", nullptr}, + {0x66b5bf9d, "GlobalizationNative_IsPredefinedLocale", nullptr}, + {0x674bdf7f, "SystemNative_DisablePosixSignalHandling", nullptr}, + {0x679dd832, "SystemNative_SetPort", nullptr}, + {0x679f9b4e, "SystemNative_FcntlGetPipeSz", nullptr}, + {0x67de0842, "SystemNative_Dup", nullptr}, + {0x687726ff, "AndroidCryptoNative_EcKeyGetCurveName", nullptr}, + {0x68bdc398, "SystemNative_INotifyAddWatch", nullptr}, + {0x68c949a0, "AndroidCryptoNative_X509GetContentType", nullptr}, + {0x68f9f52f, "AndroidCryptoNative_CipherIsSupported", nullptr}, + {0x6907c8eb, "BrotliEncoderSetParameter", nullptr}, + {0x6adb646e, "SystemNative_ReadDirR", nullptr}, + {0x6b5343a0, "SystemNative_SetErrNo", nullptr}, + {0x6bbd3d10, "SystemNative_GetRLimit", nullptr}, + {0x6be1e33d, "SystemNative_EnumerateInterfaceAddresses", nullptr}, + {0x6cda2cf8, "SystemNative_SetSendTimeout", nullptr}, + {0x6d48392a, "SystemNative_Stat", nullptr}, + {0x6ece5fe6, "SystemNative_GetPid", nullptr}, + {0x6ef4e421, "AndroidCryptoNative_CipherDestroy", nullptr}, + {0x6f18d737, "GlobalizationNative_InitICUFunctions", nullptr}, + {0x6f695cb8, "SystemNative_RmDir", nullptr}, + {0x6fa886b1, "SystemNative_GetSockName", nullptr}, + {0x6fc36e5f, "GlobalizationNative_StartsWith", nullptr}, + {0x708e7911, "SystemNative_SetIPv4Address", nullptr}, + {0x70d4f7e6, "SystemNative_GetActiveTcpConnectionInfos", nullptr}, + {0x70e91ddd, "SystemNative_FChMod", nullptr}, + {0x71698a7f, "SystemNative_GetDomainSocketSizes", nullptr}, + {0x7243c4b4, "AndroidCryptoNative_Des3Cfb8", nullptr}, + {0x758dd6aa, "SystemNative_GetTimeZoneData", nullptr}, + {0x759f5b1e, "AndroidCryptoNative_Aes256Cfb8", nullptr}, + {0x75b11f61, "BrotliDecoderGetErrorCode", nullptr}, + {0x76e97b2e, "SystemNative_Rename", nullptr}, + {0x78c1eb52, "AndroidCryptoNative_Des3Ecb", nullptr}, + {0x7a0529c1, "SystemNative_InitializeTerminalAndSignalHandling", nullptr}, + {0x7a4012d2, "GlobalizationNative_GetICUVersion", nullptr}, + {0x7aa30494, "Java_net_dot_android_crypto_DotnetProxyTrustManager_verifyRemoteCertificate", nullptr}, + {0x7ad3b820, "AndroidCryptoNative_Aes192Cfb128", nullptr}, + {0x7cb19137, "SystemNative_GetIcmpv6GlobalStatistics", nullptr}, + {0x7d0c477d, "CryptoNative_ErrPeekLastError", nullptr}, + {0x7d2bb98a, "SystemNative_MksTemps", nullptr}, + {0x7de70253, "SystemNative_ConvertErrorPalToPlatform", nullptr}, + {0x7e882ae5, "BrotliEncoderIsFinished", nullptr}, + {0x7e9a677b, "GlobalizationNative_GetSortVersion", nullptr}, + {0x7f5d9e25, "SystemNative_MUnmap", nullptr}, + {0x80d5027e, "CryptoNative_EvpMdCtxCopyEx", nullptr}, + {0x80deced4, "SystemNative_CreateAutoreleasePool", nullptr}, + {0x81a5efac, "SystemNative_SetEUid", nullptr}, + {0x82484cbf, "CryptoNative_EvpDigestOneShot", nullptr}, + {0x8289a6f7, "BrotliDefaultFreeFunc", nullptr}, + {0x83dad9bf, "SystemNative_Pipe", nullptr}, + {0x83db1b72, "CryptoNative_EvpDigestCurrent", nullptr}, + {0x84662605, "CompressionNative_Deflate", nullptr}, + {0x8526c9e8, "SystemNative_SetRawSockOpt", nullptr}, + {0x8574b133, "AndroidCryptoNative_Aes192Ecb", nullptr}, + {0x85abed93, "GlobalizationNative_GetCalendars", nullptr}, + {0x8808879d, "AndroidCryptoNative_X509StoreGetPrivateKeyEntry", nullptr}, + {0x88a7558d, "SystemNative_GetDefaultSearchOrderPseudoHandle", nullptr}, + {0x8ba80ef4, "GlobalizationNative_InitOrdinalCasingPage", nullptr}, + {0x8bdaf06c, "SystemNative_GetWindowSize", nullptr}, + {0x8bfcd7ba, "CompressionNative_Inflate", nullptr}, + {0x8d38b733, "SystemNative_LSeek", nullptr}, + {0x8f4e59f1, "SystemNative_ReadStdin", nullptr}, + {0x8f628a8d, "GlobalizationNative_CompareString", nullptr}, + {0x909e12ee, "SystemNative_SearchPath", nullptr}, + {0x910b7740, "SystemNative_GetFormatInfoForMountPoint", nullptr}, + {0x913a3d68, "SystemNative_GetDeviceIdentifiers", nullptr}, + {0x9216d936, "SystemNative_GetGroupName", nullptr}, + {0x94477030, "AndroidCryptoNative_Aes256Ccm", nullptr}, + {0x95e99740, "AndroidCryptoNative_SSLStreamInitialize", nullptr}, + {0x960d4fc0, "SystemNative_GetDefaultTimeZone", nullptr}, + {0x966f54af, "CryptoNative_EvpSha384", nullptr}, + {0x96912459, "AndroidCryptoNative_X509GetCertificateForPrivateKeyEntry", nullptr}, + {0x9787b4b4, "CryptoNative_EvpMdSize", nullptr}, + {0x98105435, "SystemNative_GetIPv6Address", nullptr}, + {0x984edaf1, "AndroidCryptoNative_RsaDestroy", nullptr}, + {0x9852b0fa, "SystemNative_INotifyRemoveWatch", nullptr}, + {0x98954db8, "AndroidCryptoNative_X509StoreOpenDefault", nullptr}, + {0x98ca7f1c, "SystemNative_ChDir", nullptr}, + {0x990163b4, "SystemNative_Receive", nullptr}, + {0x996952b3, "AndroidCryptoNative_CipherFinalEx", nullptr}, + {0x9a005080, "SystemNative_Bind", nullptr}, + {0x9a84ffd3, "AndroidCryptoNative_ChaCha20Poly1305", nullptr}, + {0x9abfce84, "SystemNative_GetEnviron", nullptr}, + {0x9bda7eb1, "SystemNative_ReadProcessStatusInfo", nullptr}, + {0x9cd6cae8, "AndroidCryptoNative_SSLStreamRelease", nullptr}, + {0x9d102d58, "CompressionNative_InflateEnd", nullptr}, + {0x9d2f90cf, "GlobalizationNative_GetLatestJapaneseEra", nullptr}, + {0x9d7f4af6, "SystemNative_ReceiveMessage", nullptr}, + {0x9dc3baed, "SystemNative_LowLevelMonitor_Destroy", nullptr}, + {0x9e366e9c, "SystemNative_InterfaceNameToIndex", nullptr}, + {0x9e717f20, "SystemNative_LChflagsCanSetHiddenFlag", nullptr}, + {0x9f47b32d, "SystemNative_ShmOpen", nullptr}, + {0x9feb81cb, "SystemNative_SNPrintF_1I", nullptr}, + {0xa0db1858, "SystemNative_GetEnv", nullptr}, + {0xa1295a9f, "SystemNative_MkFifo", nullptr}, + {0xa1bec9da, "SystemNative_LogError", nullptr}, + {0xa1d774fc, "BrotliEncoderHasMoreOutput", nullptr}, + {0xa2430b33, "SystemNative_SearchPath_TempDirectory", nullptr}, + {0xa25daa0e, "BrotliSetDictionaryData", nullptr}, + {0xa2d2f390, "SystemNative_TryChangeSocketEventRegistration", nullptr}, + {0xa39be756, "GlobalizationNative_LoadICU", nullptr}, + {0xa4636764, "AndroidCryptoNative_X509ChainCreateContext", nullptr}, + {0xa477c74e, "SystemNative_TryGetIPPacketInformation", nullptr}, + {0xa635da0f, "AndroidCryptoNative_SSLStreamShutdown", nullptr}, + {0xa691d151, "AndroidCryptoNative_Aes192Cbc", nullptr}, + {0xa72ce322, "AndroidCryptoNative_DeleteGlobalReference", nullptr}, + {0xa8074d4c, "GlobalizationNative_GetSortHandle", nullptr}, + {0xa826eabe, "SystemNative_FcntlSetIsNonBlocking", nullptr}, + {0xa829138a, "SystemNative_GetProcessPath", nullptr}, + {0xa8701bcf, "AndroidCryptoNative_SSLStreamRequestClientAuthentication", nullptr}, + {0xa8da7ba1, "BrotliEncoderVersion", nullptr}, + {0xa936bc40, "AndroidCryptoNative_EcDsaSize", nullptr}, + {0xa9c29be5, "SystemNative_SetIPv6MulticastOption", nullptr}, + {0xa9c84a4a, "AndroidCryptoNative_X509ExportPkcs7", nullptr}, + {0xaa13ec2b, "GlobalizationNative_GetLocaleInfoGroupingSizes", nullptr}, + {0xaa2f32ad, "SystemNative_FTruncate", nullptr}, + {0xab37a684, "CryptoNative_HmacCreate", nullptr}, + {0xab3d1641, "AndroidCryptoNative_DesEcb", nullptr}, + {0xabe6739f, "BrotliGetDictionary", nullptr}, + {0xacc26fa4, "AndroidCryptoNative_SSLStreamCreateWithCertificates", nullptr}, + {0xacc28460, "SystemNative_GetProcAddress", nullptr}, + {0xad7fbde5, "SystemNative_FUTimens", nullptr}, + {0xae443204, "SystemNative_GetSockOpt", nullptr}, + {0xae449ad1, "BrotliDecoderIsUsed", nullptr}, + {0xae8752e4, "GlobalizationNative_ToAscii", nullptr}, + {0xafb02e71, "BrotliEncoderMaxCompressedSize", nullptr}, + {0xb01e9c27, "AndroidCryptoNative_SSLStreamSetEnabledProtocols", nullptr}, + {0xb030a893, "SystemNative_LowLevelMonitor_Acquire", nullptr}, + {0xb0e270a0, "BrotliEncoderDestroyInstance", nullptr}, + {0xb22a12be, "BrotliEncoderCreateInstance", nullptr}, + {0xb26f05b6, "SystemNative_PWrite", nullptr}, + {0xb2965ccd, "CryptoNative_GetMaxMdSize", nullptr}, + {0xb2985645, "AndroidCryptoNative_X509StoreEnumerateCertificates", nullptr}, + {0xb4110b14, "AndroidCryptoNative_DsaGenerateKey", nullptr}, + {0xb427959c, "SystemNative_FLock", nullptr}, + {0xb439ebdb, "AndroidCryptoNative_RegisterRemoteCertificateValidationCallback", nullptr}, + {0xb444f04a, "SystemNative_Accept", nullptr}, + {0xb448a24a, "SystemNative_SymLink", nullptr}, + {0xb4e5c37d, "SystemNative_UTimensat", nullptr}, + {0xb584e8fb, "GlobalizationNative_GetTimeZoneDisplayName", nullptr}, + {0xb5a5754a, "SystemNative_UninitializeConsoleAfterRead", nullptr}, + {0xb5db6a51, "SystemNative_PWriteV", nullptr}, + {0xb628f475, "SystemNative_GetBytesAvailable", nullptr}, + {0xb7041ffa, "SystemNative_GetControlCharacters", nullptr}, + {0xb7cc3cd1, "AndroidCryptoNative_DesCbc", nullptr}, + {0xb7ebdf2c, "AndroidCryptoNative_X509IsKeyStorePrivateKeyEntry", nullptr}, + {0xb80f233c, "SystemNative_FSync", nullptr}, + {0xb84914f1, "SystemNative_EnumerateGatewayAddressesForInterface", nullptr}, + {0xb862b34e, "AndroidCryptoNative_CipherSetNonceLength", nullptr}, + {0xb884b933, "SystemNative_StdinReady", nullptr}, + {0xb96c2133, "SystemNative_GetErrNo", nullptr}, + {0xb97add7d, "SystemNative_CreateNetworkChangeListenerSocket", nullptr}, + {0xb9e6cb2c, "SystemNative_RealPath", nullptr}, + {0xba284ef4, "CryptoNative_EvpSha1", nullptr}, + {0xbb06f5e1, "AndroidCryptoNative_Aes192Gcm", nullptr}, + {0xbb25ff40, "AndroidCryptoNative_SSLStreamSetTargetHost", nullptr}, + {0xbb2ca4f3, "SystemNative_Link", nullptr}, + {0xbb92466f, "SystemNative_AlignedAlloc", nullptr}, + {0xbd658356, "CryptoNative_ErrErrorStringN", nullptr}, + {0xbdbf2140, "SystemNative_SchedGetAffinity", nullptr}, + {0xbec8a3f2, "SystemNative_FChflags", nullptr}, + {0xbf4eeb78, "AndroidCryptoNative_GetBigNumBytes", nullptr}, + {0xbf9766c3, "AndroidCryptoNative_SSLStreamHandshake", nullptr}, + {0xbfa0ce53, "SystemNative_GetPlatformSignalNumber", nullptr}, + {0xbfaad12d, "BrotliDecoderSetParameter", nullptr}, + {0xc090b1d3, "CryptoNative_EvpSha512", nullptr}, + {0xc0d66913, "SystemNative_GetUnixVersion", nullptr}, + {0xc11dec94, "SystemNative_FAllocate", nullptr}, + {0xc1243135, "AndroidCryptoNative_Aes128Gcm", nullptr}, + {0xc1e4e6f6, "AndroidCryptoNative_BigNumToBinary", nullptr}, + {0xc25ffc33, "BrotliEncoderCompressStream", nullptr}, + {0xc3812682, "AndroidCryptoNative_X509ChainGetErrors", nullptr}, + {0xc3dcc3a0, "AndroidCryptoNative_SetRsaParameters", nullptr}, + {0xc3e6ff56, "SystemNative_LowLevelMonitor_Create", nullptr}, + {0xc475f41c, "AndroidCryptoNative_X509StoreContainsCertificate", nullptr}, + {0xc4ac1723, "AndroidCryptoNative_Aes256Cbc", nullptr}, + {0xc55548f2, "SystemNative_HandleNonCanceledPosixSignal", nullptr}, + {0xc57b40fa, "SystemNative_LoadLibrary", nullptr}, + {0xc5a83c28, "AndroidCryptoNative_SSLStreamCreateWithKeyStorePrivateKeyEntry", nullptr}, + {0xc6d5929c, "SystemNative_LowLevelMonitor_TimedWait", nullptr}, + {0xc6f2fb9e, "AndroidCryptoNative_X509ChainSetCustomTrustStore", nullptr}, + {0xc717b16e, "CryptoNative_EvpMdCtxDestroy", nullptr}, + {0xc746b70c, "AndroidCryptoNative_DsaSign", nullptr}, + {0xc83527e0, "CryptoNative_HmacReset", nullptr}, + {0xc89ccd22, "SystemNative_SchedGetCpu", nullptr}, + {0xc8cce896, "SystemNative_GetSocketType", nullptr}, + {0xc8e06b20, "AndroidCryptoNative_X509ChainGetCertificates", nullptr}, + {0xc9b017c8, "AndroidCryptoNative_EcKeyCreateByOid", nullptr}, + {0xca4dad90, "GlobalizationNative_ChangeCase", nullptr}, + {0xca5aab33, "SystemNative_Sync", nullptr}, + {0xcb458400, "CryptoNative_ErrGetErrorAlloc", nullptr}, + {0xcb746e5c, "SystemNative_SetIPv4MulticastOption", nullptr}, + {0xcb85cd8e, "AndroidCryptoNative_EcdhDeriveKey", nullptr}, + {0xccc0dd15, "SystemNative_RegisterForSigChld", nullptr}, + {0xcdfb627d, "SystemNative_FreeLibrary", nullptr}, + {0xce91e293, "SystemNative_GetGroupList", nullptr}, + {0xcf0912c8, "GlobalizationNative_GetLocaleTimeFormat", nullptr}, + {0xcf9bcc75, "AndroidCryptoNative_Aes256Gcm", nullptr}, + {0xcfa9e6f1, "AndroidCryptoNative_GetDsaParameters", nullptr}, + {0xcff9b341, "SystemNative_GetSystemTimeAsTicks", nullptr}, + {0xd199e841, "SystemNative_GetEstimatedUdpListenerCount", nullptr}, + {0xd24d4849, "SystemNative_Socket", nullptr}, + {0xd298c3b3, "SystemNative_Write", nullptr}, + {0xd378ba49, "CryptoNative_EvpMd5", nullptr}, + {0xd473c64c, "SystemNative_SetReceiveTimeout", nullptr}, + {0xd4b91180, "SystemNative_ForkAndExecProcess", nullptr}, + {0xd6d7b4fb, "AndroidCryptoNative_X509ChainGetCertificateCount", nullptr}, + {0xd71d8c66, "AndroidCryptoNative_Aes256Ecb", nullptr}, + {0xd7ee326b, "AndroidCryptoNative_EcKeyDestroy", nullptr}, + {0xd818a523, "AndroidCryptoNative_CipherCtxSetPadding", nullptr}, + {0xd9458396, "BrotliDecoderCreateInstance", nullptr}, + {0xda040de4, "GlobalizationNative_EndsWith", nullptr}, + {0xdaaa19b2, "SystemNative_GetAllMountPoints", nullptr}, + {0xdac67152, "AndroidCryptoNative_X509StoreAddCertificate", nullptr}, + {0xdad29aeb, "AndroidCryptoNative_CipherUpdate", nullptr}, + {0xdaf0460a, "SystemNative_SendFile", nullptr}, + {0xdbbf4917, "AndroidCryptoNative_SSLStreamGetCipherSuite", nullptr}, + {0xdbdce4ef, "BrotliDefaultAllocFunc", nullptr}, + {0xdbe13a57, "SystemNative_GetCpuUtilization", nullptr}, + {0xdc3cbeec, "CryptoNative_HmacOneShot", nullptr}, + {0xdcaddb21, "AndroidCryptoNative_GetECKeyParameters", nullptr}, + {0xdd274c15, "AndroidCryptoNative_RsaPublicEncrypt", nullptr}, + {0xdd445632, "AndroidCryptoNative_X509ChainValidate", nullptr}, + {0xddd58443, "SystemNative_PReadV", nullptr}, + {0xdea9b9dc, "SystemNative_EnablePosixSignalHandling", nullptr}, + {0xdf0260d8, "GlobalizationNative_GetLocaleInfoString", nullptr}, + {0xdf4f1977, "AndroidCryptoNative_X509PublicKey", nullptr}, + {0xdf5d3dc8, "GlobalizationNative_GetDefaultLocaleName", nullptr}, + {0xdf80df75, "SystemNative_iOSSupportVersion", nullptr}, + {0xe121bac7, "SystemNative_GetPeerID", nullptr}, + {0xe169faa6, "AndroidCryptoNative_SSLStreamSetApplicationProtocols", nullptr}, + {0xe1b8b44f, "SystemNative_Send", nullptr}, + {0xe2a0d0de, "SystemNative_GetSpaceInfoForMountPoint", nullptr}, + {0xe4a78efb, "SystemNative_SetPriority", nullptr}, + {0xe4dba4f6, "SystemNative_GetCwd", nullptr}, + {0xe4f87d25, "AndroidCryptoNative_SSLStreamVerifyHostname", nullptr}, + {0xe50c82b4, "SystemNative_CreateThread", nullptr}, + {0xe58ed8fe, "SystemNative_PlatformSupportsDualModeIPv4PacketInfo", nullptr}, + {0xe5ef37b3, "AndroidCryptoNative_DsaSignatureFieldSize", nullptr}, + {0xe70a3634, "GlobalizationNative_GetLocaleName", nullptr}, + {0xe770cb3f, "SystemNative_CopyFile", nullptr}, + {0xe7a9a106, "CompressionNative_InflateInit2_", nullptr}, + {0xe7bd8dd1, "AndroidCryptoNative_EcKeyCreateByKeyParameters", nullptr}, + {0xe890cf58, "AndroidCryptoNative_EcDsaSign", nullptr}, + {0xe8b2ec8d, "BrotliDecoderErrorString", nullptr}, + {0xe972fbd9, "SystemNative_GetEGid", nullptr}, + {0xe9bc4e53, "SystemNative_SNPrintF_1S", nullptr}, + {0xea86f52f, "BrotliEncoderTakeOutput", nullptr}, + {0xeb0d0522, "SystemNative_LowLevelMonitor_Wait", nullptr}, + {0xebacbf92, "AndroidCryptoNative_Aes128Cfb8", nullptr}, + {0xec31140d, "BrotliDecoderHasMoreOutput", nullptr}, + {0xec51a1b4, "SystemNative_LChflags", nullptr}, + {0xed6cc182, "CryptoNative_EvpMdCtxCreate", nullptr}, + {0xee74a5ad, "AndroidCryptoNative_DsaSizeP", nullptr}, + {0xef48c2eb, "CryptoNative_EvpDigestReset", nullptr}, + {0xef5890c7, "AndroidCryptoNative_Des3Cbc", nullptr}, + {0xefb38c9f, "SystemNative_Poll", nullptr}, + {0xefd277f7, "CryptoNative_HmacFinal", nullptr}, + {0xf06b440b, "AndroidCryptoNative_DsaSizeSignature", nullptr}, + {0xf0919525, "AndroidCryptoNative_CipherReset", nullptr}, + {0xf0e499c4, "SystemNative_PRead", nullptr}, + {0xf1bb5b47, "SystemNative_ReadLink", nullptr}, + {0xf23e6314, "AndroidCryptoNative_RsaCreate", nullptr}, + {0xf2a49cf0, "SystemNative_CloseSocketEventPort", nullptr}, + {0xf39b1c3a, "SystemNative_GetCryptographicallySecureRandomBytes", nullptr}, + {0xf3b9c879, "AndroidCryptoNative_X509Encode", nullptr}, + {0xf432ab33, "SystemNative_CloseDir", nullptr}, + {0xf4a5a1c8, "SystemNative_SysLog", nullptr}, + {0xf500c9d3, "SystemNative_GetActiveUdpListeners", nullptr}, + {0xf57828fb, "SystemNative_IsATty", nullptr}, + {0xf5918f53, "SystemNative_GetSocketAddressSizes", nullptr}, + {0xf6141499, "AndroidCryptoNative_X509ChainBuild", nullptr}, + {0xf629d20f, "SystemNative_Shutdown", nullptr}, + {0xf6b01c6b, "SystemNative_FreeEnviron", nullptr}, + {0xf6bfedad, "SystemNative_ReadEvents", nullptr}, + {0xf91cf365, "AndroidCryptoNative_Aes128Ccm", nullptr}, + {0xf94a4828, "SystemNative_GetEUid", nullptr}, + {0xf993f426, "SystemNative_Free", nullptr}, + {0xfa97914b, "SystemNative_MMap", nullptr}, + {0xfad61722, "AndroidCryptoNative_X509StoreAddCertificateWithPrivateKey", nullptr}, + {0xfae25aa7, "GlobalizationNative_LastIndexOf", nullptr}, + {0xfb89157f, "SystemNative_GetGroups", nullptr}, + {0xfc83423c, "SystemNative_GetRawSockOpt", nullptr}, + {0xfd9099cc, "SystemNative_GetUInt64OSThreadId", nullptr}, + {0xfe2f2c47, "SystemNative_DrainAutoreleasePool", nullptr}, + {0xfeb6c5c7, "SystemNative_WaitPidExitedNoHang", nullptr}, + {0xff3b4cfa, "SystemNative_GetFileSystemType", nullptr}, + {0xff975200, "SystemNative_Realloc", nullptr}, + }}; + + +constexpr hash_t java_interop_library_hash = 0x6e36e350; +constexpr hash_t xa_internal_api_library_hash = 0x13c9bd62; +constexpr hash_t system_native_library_hash = 0x5b9ade60; +constexpr hash_t system_io_compression_native_library_hash = 0xafe3142c; +constexpr hash_t system_security_cryptography_native_android_library_hash = 0x93625cd; +constexpr hash_t system_globalization_native_library_hash = 0xa66f1e5a; +#endif + +constexpr size_t internal_pinvokes_count = 49; +constexpr size_t dotnet_pinvokes_count = 477; +} // end of anonymous namespace diff --git a/src/native/pinvoke-override/precompiled.cc b/src/native/pinvoke-override/precompiled.cc new file mode 100644 index 00000000000..d82d7bd4341 --- /dev/null +++ b/src/native/pinvoke-override/precompiled.cc @@ -0,0 +1,75 @@ +#include "internal-pinvokes.hh" + +#define PINVOKE_OVERRIDE_INLINE [[gnu::always_inline]] inline +#include "pinvoke-override-api-impl.hh" + +using namespace xamarin::android; + +#include "pinvoke-tables.include" + +[[gnu::flatten]] +void* +PinvokeOverride::monodroid_pinvoke_override (const char *library_name, const char *entrypoint_name) +{ + if (library_name == nullptr || entrypoint_name == nullptr) { + return nullptr; + } + + hash_t library_name_hash = xxhash::hash (library_name, strlen (library_name)); + hash_t entrypoint_hash = xxhash::hash (entrypoint_name, strlen (entrypoint_name)); + + if (library_name_hash == java_interop_library_hash || library_name_hash == xa_internal_api_library_hash) { + PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, internal_pinvokes.data (), internal_pinvokes_count); + + if (entry == nullptr) [[unlikely]] { + log_fatal (LOG_ASSEMBLY, "Internal p/invoke symbol '%s @ %s' (hash: 0x%zx) not found in compile-time map.", library_name, entrypoint_name, entrypoint_hash); + log_fatal (LOG_ASSEMBLY, "compile-time map contents:"); + for (size_t i = 0; i < internal_pinvokes_count; i++) { + PinvokeEntry const& e = internal_pinvokes[i]; + log_fatal (LOG_ASSEMBLY, "\t'%s'=%p (hash: 0x%zx)", e.name, e.func, e.hash); + } + Helpers::abort_application (); + } + + return entry->func; + } + + // The order of statements below should be kept in the descending probability of occurrence order (as much as + // possible, of course). `libSystem.Native` is requested during early startup for each MAUI app, so its + // probability is higher, just as it's more likely that `libSystem.Security.Cryptography.Android` will be used + // in an app rather than `libSystem.IO.Compression.Native` + void **dotnet_dso_handle; // Set to a non-null value only for dotnet shared libraries + if (library_name_hash == system_native_library_hash) { + dotnet_dso_handle = &system_native_library_handle; + } else if (library_name_hash == system_security_cryptography_native_android_library_hash) { + dotnet_dso_handle = &system_security_cryptography_native_android_library_handle; + } else if (library_name_hash == system_io_compression_native_library_hash) { + dotnet_dso_handle = &system_io_compression_native_library_handle; + } else if (library_name_hash == system_globalization_native_library_hash) { + dotnet_dso_handle = &system_globalization_native_library_handle; + } else { + dotnet_dso_handle = nullptr; + } + + if (dotnet_dso_handle != nullptr) { + PinvokeEntry *entry = find_pinvoke_address (entrypoint_hash, dotnet_pinvokes.data (), dotnet_pinvokes_count); + if (entry != nullptr) { + if (entry->func != nullptr) { + return entry->func; + } + + load_library_entry (library_name, entrypoint_name, *entry, dotnet_dso_handle); + if (entry->func == nullptr) { + log_fatal (LOG_ASSEMBLY, "Failed to load symbol '%s' from shared library '%s'", entrypoint_name, library_name); + return nullptr; // let Mono deal with the fallout + } + + return entry->func; + } + + // It's possible we don't have an entry for some `dotnet` p/invoke, fall back to the slow path below + log_debug (LOG_ASSEMBLY, "Symbol '%s' in library '%s' not found in the generated tables, falling back to slow path", entrypoint_name, library_name); + } + + return handle_other_pinvoke_request (library_name, library_name_hash, entrypoint_name, entrypoint_hash); +} diff --git a/src/native/runtime-base/CMakeLists.txt b/src/native/runtime-base/CMakeLists.txt index 85e75163f60..9a1ccaf64e3 100644 --- a/src/native/runtime-base/CMakeLists.txt +++ b/src/native/runtime-base/CMakeLists.txt @@ -6,6 +6,8 @@ set(XA_RUNTIME_BASE_SOURCES cpu-arch-detect.cc logger.cc shared-constants.cc + timing.cc + timing-internal.cc util.cc ) add_clang_check_sources("${XA_RUNTIME_BASE_SOURCES}") @@ -52,10 +54,12 @@ target_link_libraries( xa::xamarin-app ) -set_target_properties( - ${LIB_NAME} - PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" -) +if(DEBUG_BUILD) + set_target_properties( + ${LIB_NAME} + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + ) +endif() xa_add_compile_definitions(${LIB_NAME}) diff --git a/src/native/runtime-base/internal-pinvokes.hh b/src/native/runtime-base/internal-pinvokes.hh new file mode 100644 index 00000000000..b224a007cda --- /dev/null +++ b/src/native/runtime-base/internal-pinvokes.hh @@ -0,0 +1,63 @@ +#pragma once + +#include + +#include +#include +#include +#include + +#include "log_types.hh" +#include "timing.hh" +#include "xamarin-app.hh" +#include "xamarin_getifaddrs.h" + +int _monodroid_getifaddrs (struct _monodroid_ifaddrs **ifap); +void _monodroid_freeifaddrs (struct _monodroid_ifaddrs *ifa); + +mono_bool _monodroid_get_network_interface_up_state (const char *ifname, mono_bool *is_up); +mono_bool _monodroid_get_network_interface_supports_multicast (const char *ifname, mono_bool *supports_multicast); +int _monodroid_get_dns_servers (void **dns_servers_array); + +unsigned int monodroid_get_log_categories (); +int monodroid_get_system_property (const char *name, char **value); +int monodroid_embedded_assemblies_set_assemblies_prefix (const char *prefix); +void monodroid_log (xamarin::android::LogLevel level, LogCategories category, const char *message); +void monodroid_free (void *ptr); +int _monodroid_max_gref_get (); +int _monodroid_gref_get (); +void _monodroid_gref_log (const char *message); +int _monodroid_gref_log_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable); +void _monodroid_gref_log_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); +int _monodroid_weak_gref_get (); +void _monodroid_weak_gref_new (jobject curHandle, char curType, jobject newHandle, char newType, const char *threadName, int threadId, const char *from, int from_writable); +void _monodroid_weak_gref_delete (jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); +void _monodroid_lref_log_new (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); +void _monodroid_lref_log_delete (int lrefc, jobject handle, char type, const char *threadName, int threadId, const char *from, int from_writable); +void _monodroid_gc_wait_for_bridge_processing (); +int _monodroid_get_android_api_level (); +void monodroid_clear_gdb_wait (); +void* _monodroid_get_identity_hash_code (JNIEnv *env, void *v); +void* _monodroid_timezone_get_default_id (); +void _monodroid_counters_dump ([[maybe_unused]] const char *format, [[maybe_unused]] va_list args); +xamarin::android::managed_timing_sequence* monodroid_timing_start (const char *message); +void monodroid_timing_stop (xamarin::android::managed_timing_sequence *sequence, const char *message); +char** monodroid_strsplit (const char *str, const char *delimiter, size_t max_tokens); +void monodroid_strfreev (char **str_array); +char* monodroid_strdup_printf (const char *format, ...); +char* monodroid_TypeManager_get_java_class_name (jclass klass); +int monodroid_get_namespaced_system_property (const char *name, char **value); +FILE* monodroid_fopen (const char* filename, const char* mode); +int send_uninterrupted (int fd, void *buf, int len); +int recv_uninterrupted (int fd, void *buf, int len); +void set_world_accessable (const char *path); +void create_public_directory (const char *dir); +char* path_combine (const char *path1, const char *path2); +void* monodroid_dylib_mono_new ([[maybe_unused]] const char *libmono_path); +void monodroid_dylib_mono_free ([[maybe_unused]] void *mono_imports); +int monodroid_dylib_mono_init (void *mono_imports, [[maybe_unused]] const char *libmono_path); +void* monodroid_get_dylib (); +const char* _monodroid_lookup_replacement_type (const char *jniSimpleReference); +const JniRemappingReplacementMethod* _monodroid_lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature); +void monodroid_log_traces (uint32_t kind, const char *first_line); +void _monodroid_detect_cpu_and_architecture (unsigned short *built_for_cpu, unsigned short *running_on_cpu, unsigned char *is64bit); diff --git a/src/native/runtime-base/monodroid-dl.hh b/src/native/runtime-base/monodroid-dl.hh new file mode 100644 index 00000000000..4c9143e537e --- /dev/null +++ b/src/native/runtime-base/monodroid-dl.hh @@ -0,0 +1,182 @@ +#pragma once + +#include +#include + +#include +#include +#include +#include + +#include "android-system.hh" +#include "monodroid-state.hh" +#include "search.hh" +#include "shared-constants.hh" +#include "startup-aware-lock.hh" +#include "util.hh" + +namespace xamarin::android::internal +{ + class MonodroidDl + { + static inline xamarin::android::mutex dso_handle_write_lock; + + static unsigned int convert_dl_flags (int flags) noexcept + { + unsigned int lflags = (flags & static_cast (MONO_DL_LOCAL)) + ? microsoft::java_interop::JAVA_INTEROP_LIB_LOAD_LOCALLY + : microsoft::java_interop::JAVA_INTEROP_LIB_LOAD_GLOBALLY; + return lflags; + } + + static DSOCacheEntry* find_dso_cache_entry (hash_t hash) noexcept + { + auto equal = [](DSOCacheEntry const& entry, hash_t key) -> bool { return entry.hash == key; }; + auto less_than = [](DSOCacheEntry const& entry, hash_t key) -> bool { return entry.hash < key; }; + ssize_t idx = Search::binary_search (hash, dso_cache, application_config.number_of_dso_cache_entries); + if (idx >= 0) { + return &dso_cache[idx]; + } + + return nullptr; + } + + static void* monodroid_dlopen_log_and_return (void *handle, char **err, const char *full_name, bool free_memory) + { + if (handle == nullptr && err != nullptr) { + const char *load_error = dlerror (); + if (load_error == nullptr) { + load_error = "Unknown error"; + } + *err = Util::monodroid_strdup_printf ("Could not load library '%s'. %s", full_name, load_error); + } + + if (free_memory) { + delete[] full_name; + } + + return handle; + } + + static void* monodroid_dlopen_ignore_component_or_load ([[maybe_unused]] hash_t name_hash, const char *name, int flags, char **err) noexcept + { + if (MonodroidState::is_startup_in_progress ()) { + auto ignore_component = [&](const char *label, MonoComponent component) -> bool { + if ((application_config.mono_components_mask & component) != component) { + log_info (LOG_ASSEMBLY, "Mono '%s' component requested but not packaged, ignoring", label); + return true; + } + + return false; + }; + + switch (name_hash) { + case SharedConstants::mono_component_debugger_hash: + if (ignore_component ("Debugger", MonoComponent::Debugger)) { + return nullptr; + } + break; + + case SharedConstants::mono_component_hot_reload_hash: + if (ignore_component ("Hot Reload", MonoComponent::HotReload)) { + return nullptr; + } + break; + + case SharedConstants::mono_component_diagnostics_tracing_hash: + if (ignore_component ("Diagnostics Tracing", MonoComponent::Tracing)) { + return nullptr; + } + break; + } + } + + unsigned int dl_flags = convert_dl_flags (flags); + void * handle = AndroidSystem::load_dso_from_any_directories (name, dl_flags); + if (handle != nullptr) { + return monodroid_dlopen_log_and_return (handle, err, name, false /* name_needs_free */); + } + + handle = AndroidSystem::load_dso (name, dl_flags, false /* skip_existing_check */); + return monodroid_dlopen_log_and_return (handle, err, name, false /* name_needs_free */); + } + + public: + [[gnu::flatten]] + static void* monodroid_dlopen (const char *name, int flags, char **err, [[maybe_unused]] void *user_data) noexcept + { + if (name == nullptr) { + log_warn (LOG_ASSEMBLY, "monodroid_dlopen got a null name. This is not supported in NET+"); + return nullptr; + } + + hash_t name_hash = xxhash::hash (name, strlen (name)); + log_debug (LOG_ASSEMBLY, "monodroid_dlopen: hash for name '%s' is 0x%zx", name, name_hash); + DSOCacheEntry *dso = find_dso_cache_entry (name_hash); + log_debug (LOG_ASSEMBLY, "monodroid_dlopen: hash match %sfound, DSO name is '%s'", dso == nullptr ? "not " : "", dso == nullptr ? "" : dso->name); + + if (dso == nullptr) { + // DSO not known at build time, try to load it + return monodroid_dlopen_ignore_component_or_load (name_hash, name, flags, err); + } else if (dso->handle != nullptr) { + return monodroid_dlopen_log_and_return (dso->handle, err, dso->name, false /* name_needs_free */); + } + + if (dso->ignore) { + log_info (LOG_ASSEMBLY, "Request to load '%s' ignored, it is known not to exist", dso->name); + return nullptr; + } + + StartupAwareLock lock (dso_handle_write_lock); +#if defined (RELEASE) + if (AndroidSystem::is_embedded_dso_mode_enabled ()) { + DSOApkEntry *apk_entry = dso_apk_entries; + for (size_t i = 0; i < application_config.number_of_shared_libraries; i++) { + if (apk_entry->name_hash != dso->real_name_hash) { + apk_entry++; + continue; + } + + android_dlextinfo dli; + dli.flags = ANDROID_DLEXT_USE_LIBRARY_FD | ANDROID_DLEXT_USE_LIBRARY_FD_OFFSET; + dli.library_fd = apk_entry->fd; + dli.library_fd_offset = apk_entry->offset; + dso->handle = android_dlopen_ext (dso->name, flags, &dli); + + if (dso->handle != nullptr) { + return monodroid_dlopen_log_and_return (dso->handle, err, dso->name, false /* name_needs_free */); + } + break; + } + } +#endif + unsigned int dl_flags = convert_dl_flags (flags); + dso->handle = AndroidSystem::load_dso_from_any_directories (dso->name, dl_flags); + + if (dso->handle != nullptr) { + return monodroid_dlopen_log_and_return (dso->handle, err, dso->name, false /* name_needs_free */); + } + + dso->handle = AndroidSystem::load_dso_from_any_directories (name, dl_flags); + return monodroid_dlopen_log_and_return (dso->handle, err, name, false /* name_needs_free */); + } + + [[gnu::flatten]] + static void* monodroid_dlsym (void *handle, const char *name, char **err, [[maybe_unused]] void *user_data) + { + void *s; + char *e = nullptr; + + s = microsoft::java_interop::java_interop_lib_symbol (handle, name, &e); + + if (!s && err) { + *err = Util::monodroid_strdup_printf ("Could not find symbol '%s': %s", name, e); + } + if (e) { + java_interop_free (e); + } + + return s; + } + }; +} diff --git a/src/native/runtime-base/monodroid-state.hh b/src/native/runtime-base/monodroid-state.hh new file mode 100644 index 00000000000..642e35cb120 --- /dev/null +++ b/src/native/runtime-base/monodroid-state.hh @@ -0,0 +1,21 @@ +#pragma once + +namespace xamarin::android::internal +{ + class MonodroidState + { + public: + static bool is_startup_in_progress () noexcept + { + return startup_in_progress; + } + + static void mark_startup_done () + { + startup_in_progress = false; + } + + private: + inline static bool startup_in_progress = true; + }; +} diff --git a/src/native/monodroid/search.hh b/src/native/runtime-base/search.hh similarity index 94% rename from src/native/monodroid/search.hh rename to src/native/runtime-base/search.hh index be6a24437e4..2baf54d33d6 100644 --- a/src/native/monodroid/search.hh +++ b/src/native/runtime-base/search.hh @@ -1,12 +1,10 @@ // Dear Emacs, this is a -*- C++ -*- header -#if !defined (__SEARCH_HH) -#define __SEARCH_HH +#pragma once #include #include "platform-compat.hh" #include "xxhash.hh" -#include "logger.hh" namespace xamarin::android::internal { class Search final @@ -58,4 +56,3 @@ namespace xamarin::android::internal { } }; } -#endif // ndef __SEARCH_HH diff --git a/src/native/runtime-base/shared-constants.hh b/src/native/runtime-base/shared-constants.hh index bc8461f59f0..d2c0cfcd08d 100644 --- a/src/native/runtime-base/shared-constants.hh +++ b/src/native/runtime-base/shared-constants.hh @@ -3,6 +3,7 @@ #include #include "cpp-util.hh" +#include "xxhash.hh" namespace xamarin::android::internal { @@ -111,6 +112,18 @@ namespace xamarin::android::internal static constexpr std::string_view LOG_CATEGORY_NAME_MONODROID_NETWORK { "monodroid-network" }; static constexpr std::string_view LOG_CATEGORY_NAME_MONODROID_NETLINK { "monodroid-netlink" }; static constexpr std::string_view LOG_CATEGORY_NAME_ERROR { "*error*" }; + + static constexpr std::string_view mono_component_debugger_name { "libmono-component-debugger.so" }; + static constexpr hash_t mono_component_debugger_hash = xxhash::hash (mono_component_debugger_name); + + static constexpr std::string_view mono_component_hot_reload_name { "libmono-component-hot_reload.so" }; + static constexpr hash_t mono_component_hot_reload_hash = xxhash::hash (mono_component_hot_reload_name); + + static constexpr std::string_view mono_component_diagnostics_tracing_name { "libmono-component-diagnostics_tracing.so" }; + static constexpr hash_t mono_component_diagnostics_tracing_hash = xxhash::hash (mono_component_diagnostics_tracing_name); + + static constexpr std::string_view xamarin_native_tracing_name { "libxamarin-native-tracing.so" }; + static constexpr hash_t xamarin_native_tracing_name_hash = xxhash::hash (xamarin_native_tracing_name); }; } #endif // __SHARED_CONSTANTS_HH diff --git a/src/native/monodroid/startup-aware-lock.hh b/src/native/runtime-base/startup-aware-lock.hh similarity index 79% rename from src/native/monodroid/startup-aware-lock.hh rename to src/native/runtime-base/startup-aware-lock.hh index 9e09d4d69ec..e1fac78389f 100644 --- a/src/native/monodroid/startup-aware-lock.hh +++ b/src/native/runtime-base/startup-aware-lock.hh @@ -1,7 +1,8 @@ #ifndef __STARTUP_AWARE_LOCK_HH #define __STARTUP_AWARE_LOCK_HH -#include "globals.hh" +#include "cppcompat.hh" +#include "monodroid-state.hh" namespace xamarin::android::internal { @@ -11,7 +12,7 @@ namespace xamarin::android::internal explicit StartupAwareLock (xamarin::android::mutex &m) : lock (m) { - if (MonodroidRuntime::is_startup_in_progress ()) { + if (MonodroidState::is_startup_in_progress ()) { // During startup we run without threads, do nothing return; } @@ -21,7 +22,7 @@ namespace xamarin::android::internal ~StartupAwareLock () { - if (MonodroidRuntime::is_startup_in_progress ()) { + if (MonodroidState::is_startup_in_progress ()) { return; } diff --git a/src/native/monodroid/timing-internal.cc b/src/native/runtime-base/timing-internal.cc similarity index 100% rename from src/native/monodroid/timing-internal.cc rename to src/native/runtime-base/timing-internal.cc diff --git a/src/native/monodroid/timing-internal.hh b/src/native/runtime-base/timing-internal.hh similarity index 99% rename from src/native/monodroid/timing-internal.hh rename to src/native/runtime-base/timing-internal.hh index 87fca5e1589..10da5de5162 100644 --- a/src/native/monodroid/timing-internal.hh +++ b/src/native/runtime-base/timing-internal.hh @@ -12,6 +12,7 @@ #include "strings.hh" #include "util.hh" #include "shared-constants.hh" +#include "monodroid-state.hh" namespace xamarin::android::internal { @@ -150,7 +151,7 @@ namespace xamarin::android::internal TimingEvent &ev = events[index]; mark (ev.start); ev.kind = kind; - ev.before_managed = MonodroidRuntime::is_startup_in_progress (); + ev.before_managed = MonodroidState::is_startup_in_progress (); ev.more_info = nullptr; return index; diff --git a/src/native/monodroid/timing.cc b/src/native/runtime-base/timing.cc similarity index 93% rename from src/native/monodroid/timing.cc rename to src/native/runtime-base/timing.cc index 023b16271ec..a0e8e1699f2 100644 --- a/src/native/monodroid/timing.cc +++ b/src/native/runtime-base/timing.cc @@ -1,3 +1,4 @@ +#include "timing.hh" #include "timing-internal.hh" using namespace xamarin::android; diff --git a/src/native/monodroid/timing.hh b/src/native/runtime-base/timing.hh similarity index 100% rename from src/native/monodroid/timing.hh rename to src/native/runtime-base/timing.hh diff --git a/src/native/monodroid/xamarin_getifaddrs.h b/src/native/runtime-base/xamarin_getifaddrs.h similarity index 98% rename from src/native/monodroid/xamarin_getifaddrs.h rename to src/native/runtime-base/xamarin_getifaddrs.h index a916d7a7999..b39c1fae9d0 100644 --- a/src/native/monodroid/xamarin_getifaddrs.h +++ b/src/native/runtime-base/xamarin_getifaddrs.h @@ -1,7 +1,7 @@ #ifndef __XAMARIN_GETIFADDRS_H #define __XAMARIN_GETIFADDRS_H -#include "monodroid.h" +#include /* We're implementing getifaddrs behavior, this is the structure we use. It is exactly the same as * struct ifaddrs defined in ifaddrs.h but since bionics doesn't have it we need to mirror it here. diff --git a/src/native/shared/CMakeLists.txt b/src/native/shared/CMakeLists.txt index 248e4f4cc49..1c0a4804d15 100644 --- a/src/native/shared/CMakeLists.txt +++ b/src/native/shared/CMakeLists.txt @@ -65,11 +65,13 @@ macro(lib_target_options TARGET_NAME) ${XA_COMMON_CXX_ARGS} ) - set_target_properties( - ${TARGET_NAME} - PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" - ) + if(DEBUG_BUILD) + set_target_properties( + ${TARGET_NAME} + PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + ) + endif() xa_add_compile_definitions(${TARGET_NAME}) endmacro()