diff --git a/native/android/app/CMakeLists.txt b/native/android/app/CMakeLists.txt --- a/native/android/app/CMakeLists.txt +++ b/native/android/app/CMakeLists.txt @@ -71,6 +71,7 @@ # comm native mutual code ../../cpp/CommonCpp/NativeModules + ../../cpp/CommonCpp/NativeModules/InternalModules ../../cpp/CommonCpp/DatabaseManagers ../../cpp/CommonCpp/Tools ../../cpp/CommonCpp/grpc/_generated diff --git a/native/android/app/src/cpp/GlobalNetworkSingletonJNIHelper.cpp b/native/android/app/src/cpp/GlobalNetworkSingletonJNIHelper.cpp new file mode 100644 --- /dev/null +++ b/native/android/app/src/cpp/GlobalNetworkSingletonJNIHelper.cpp @@ -0,0 +1,7 @@ +#include "GlobalNetworkSingletonJNIHelper.h" + +namespace comm { +void GlobalNetworkSingletonJNIHelper::registerNatives() { +} + +} // namespace comm diff --git a/native/android/app/src/cpp/jsiInstaller.cpp b/native/android/app/src/cpp/jsiInstaller.cpp --- a/native/android/app/src/cpp/jsiInstaller.cpp +++ b/native/android/app/src/cpp/jsiInstaller.cpp @@ -1,5 +1,6 @@ #include "CommCoreModule.h" #include "CommSecureStore.h" +#include "GlobalNetworkSingletonJNIHelper.h" #include "SQLiteQueryExecutor.h" #include "jniHelpers.h" #include @@ -61,5 +62,8 @@ }; JNIEXPORT jint JNI_OnLoad(JavaVM *vm, void *) { - return jni::initialize(vm, [] { CommHybrid::registerNatives(); }); + return jni::initialize(vm, [] { + CommHybrid::registerNatives(); + comm::GlobalNetworkSingletonJNIHelper::registerNatives(); + }); } diff --git a/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java b/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java new file mode 100644 --- /dev/null +++ b/native/android/app/src/main/java/app/comm/android/fbjni/NetworkModule.java @@ -0,0 +1,3 @@ +package app.comm.android.fbjni; + +public class NetworkModule {} diff --git a/native/cpp/CommonCpp/NativeModules/InternalModules/GlobalNetworkSingletonJNIHelper.h b/native/cpp/CommonCpp/NativeModules/InternalModules/GlobalNetworkSingletonJNIHelper.h new file mode 100644 --- /dev/null +++ b/native/cpp/CommonCpp/NativeModules/InternalModules/GlobalNetworkSingletonJNIHelper.h @@ -0,0 +1,14 @@ +#pragma once + +#include + +namespace comm { +class GlobalNetworkSingletonJNIHelper + : public facebook::jni::JavaClass { +public: + static auto constexpr kJavaDescriptor = + "Lapp/comm/android/fbjni/NetworkModule;"; + + static void registerNatives(); +}; +} // namespace comm