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 @@ -115,6 +115,7 @@ "./src/cpp/ThreadOperationsJNIHelper.cpp" "./src/cpp/jsiInstaller.cpp" "./src/cpp/NotificationsCryptoModuleJNIHelper.cpp" + "./src/cpp/StaffUtilsJNIHelper.cpp" ) list(APPEND GENERATED_NATIVE_CODE diff --git a/native/android/app/src/cpp/StaffUtilsJNIHelper.cpp b/native/android/app/src/cpp/StaffUtilsJNIHelper.cpp new file mode 100644 --- /dev/null +++ b/native/android/app/src/cpp/StaffUtilsJNIHelper.cpp @@ -0,0 +1,14 @@ +#include +#include + +namespace comm { +bool StaffUtilsJNIHelper::isStaffRelease( + facebook::jni::alias_ref jThis) { + return StaffUtils::isStaffRelease(); +} + +void StaffUtilsJNIHelper::registerNatives() { + javaClassStatic()->registerNatives({makeNativeMethod( + "isStaffRelease", StaffUtilsJNIHelper::isStaffRelease)}); +} +} // 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 @@ -13,6 +13,7 @@ #include #include #include +#include namespace jni = facebook::jni; namespace jsi = facebook::jsi; @@ -82,5 +83,6 @@ comm::GlobalDBSingletonJNIHelper::registerNatives(); comm::DatabaseInitializerJNIHelper::registerNatives(); comm::NotificationsCryptoModuleJNIHelper::registerNatives(); + comm::StaffUtilsJNIHelper::registerNatives(); }); } diff --git a/native/android/app/src/main/java/app/comm/android/fbjni/StaffUtils.java b/native/android/app/src/main/java/app/comm/android/fbjni/StaffUtils.java new file mode 100644 --- /dev/null +++ b/native/android/app/src/main/java/app/comm/android/fbjni/StaffUtils.java @@ -0,0 +1,5 @@ +package app.comm.android.fbjni; + +public class StaffUtils { + public static native boolean isStaffRelease(); +} diff --git a/native/cpp/CommonCpp/Tools/CMakeLists.txt b/native/cpp/CommonCpp/Tools/CMakeLists.txt --- a/native/cpp/CommonCpp/Tools/CMakeLists.txt +++ b/native/cpp/CommonCpp/Tools/CMakeLists.txt @@ -6,11 +6,13 @@ set(TOOLS_HDRS "Base64.h" "WorkerThread.h" + "StaffUtils.h" ) set(TOOLS_SRCS "Base64.cpp" "WorkerThread.cpp" + "StaffUtils.cpp" ) add_library(comm-tools diff --git a/native/cpp/CommonCpp/Tools/StaffUtils.h b/native/cpp/CommonCpp/Tools/StaffUtils.h new file mode 100644 --- /dev/null +++ b/native/cpp/CommonCpp/Tools/StaffUtils.h @@ -0,0 +1,8 @@ +#pragma once + +namespace comm { +class StaffUtils { +public: + static bool isStaffRelease(); +}; +} // namespace comm diff --git a/native/cpp/CommonCpp/Tools/StaffUtils.cpp b/native/cpp/CommonCpp/Tools/StaffUtils.cpp new file mode 100644 --- /dev/null +++ b/native/cpp/CommonCpp/Tools/StaffUtils.cpp @@ -0,0 +1,7 @@ +#include "StaffUtils.h" + +namespace comm { +bool StaffUtils::isStaffRelease() { + return false; +} +} // namespace comm diff --git a/native/cpp/CommonCpp/Tools/StaffUtilsJNIHelper.h b/native/cpp/CommonCpp/Tools/StaffUtilsJNIHelper.h new file mode 100644 --- /dev/null +++ b/native/cpp/CommonCpp/Tools/StaffUtilsJNIHelper.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +namespace comm { +class StaffUtilsJNIHelper + : public facebook::jni::JavaClass { +public: + static auto constexpr kJavaDescriptor = "Lapp/comm/android/fbjni/StaffUtils;"; + static bool + isStaffRelease(facebook::jni::alias_ref jThis); + static void registerNatives(); +}; + +} // namespace comm