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 diff --git a/native/ios/Comm.xcodeproj/project.pbxproj b/native/ios/Comm.xcodeproj/project.pbxproj --- a/native/ios/Comm.xcodeproj/project.pbxproj +++ b/native/ios/Comm.xcodeproj/project.pbxproj @@ -77,6 +77,8 @@ CB7EF17E295C674300B17035 /* CommIOSNotifications.mm in Sources */ = {isa = PBXBuildFile; fileRef = CB7EF17D295C5D1800B17035 /* CommIOSNotifications.mm */; }; CB7EF180295C674300B17035 /* CommIOSNotificationsBridgeQueue.mm in Sources */ = {isa = PBXBuildFile; fileRef = CB7EF17B295C580500B17035 /* CommIOSNotificationsBridgeQueue.mm */; }; CB90951F29534B32002F2A7F /* CommSecureStore.mm in Sources */ = {isa = PBXBuildFile; fileRef = 71D4D7CB26C50B1000FCDBCD /* CommSecureStore.mm */; }; + CBCA09062A8E0E7400F75B3E /* StaffUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CBCA09052A8E0E6B00F75B3E /* StaffUtils.cpp */; }; + CBCA09072A8E0E7D00F75B3E /* StaffUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CBCA09052A8E0E6B00F75B3E /* StaffUtils.cpp */; }; CBDEC69B28ED867000C17588 /* GlobalDBSingleton.mm in Sources */ = {isa = PBXBuildFile; fileRef = CBDEC69A28ED867000C17588 /* GlobalDBSingleton.mm */; }; CBFE58292885852B003B94C9 /* ThreadOperations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CBFE58282885852B003B94C9 /* ThreadOperations.cpp */; }; D7DB6E0F85B2DBE15B01EC21 /* libPods-Comm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 994BEBDD4E4959F69CEA0BC3 /* libPods-Comm.a */; }; @@ -261,6 +263,8 @@ CB7EF17C295C580500B17035 /* CommIOSNotificationsBridgeQueue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommIOSNotificationsBridgeQueue.h; path = Comm/CommIOSNotifications/CommIOSNotificationsBridgeQueue.h; sourceTree = ""; }; CB7EF17D295C5D1800B17035 /* CommIOSNotifications.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = CommIOSNotifications.mm; path = Comm/CommIOSNotifications/CommIOSNotifications.mm; sourceTree = ""; }; CB90951929531663002F2A7F /* CommIOSNotifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommIOSNotifications.h; path = Comm/CommIOSNotifications/CommIOSNotifications.h; sourceTree = ""; }; + CBCA09042A8E0E6B00F75B3E /* StaffUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = StaffUtils.h; sourceTree = ""; }; + CBCA09052A8E0E6B00F75B3E /* StaffUtils.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = StaffUtils.cpp; sourceTree = ""; }; CBDEC69928ED859600C17588 /* GlobalDBSingleton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlobalDBSingleton.h; sourceTree = ""; }; CBDEC69A28ED867000C17588 /* GlobalDBSingleton.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = GlobalDBSingleton.mm; path = Comm/GlobalDBSingleton.mm; sourceTree = ""; }; CBFE58272885852B003B94C9 /* ThreadOperations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadOperations.h; path = PersistentStorageUtilities/ThreadOperationsUtilities/ThreadOperations.h; sourceTree = ""; }; @@ -392,6 +396,8 @@ 71BE84382636A944002849D2 /* Tools */ = { isa = PBXGroup; children = ( + CBCA09052A8E0E6B00F75B3E /* StaffUtils.cpp */, + CBCA09042A8E0E6B00F75B3E /* StaffUtils.h */, 7FBB2A7A29EEA2A4002C6493 /* Base64.cpp */, 7FBB2A7929EA752D002C6493 /* Base64.h */, 71B8CCBD26BD4DEB0040C0A2 /* CommSecureStore.h */, @@ -1036,6 +1042,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + CBCA09062A8E0E7400F75B3E /* StaffUtils.cpp in Sources */, 8ED8B5342A4DD4EB00D3DA26 /* CommQueryExecutor.cpp in Sources */, 8EF7756B2A7433630046A385 /* ThreadStore.cpp in Sources */, CB2689002A2DF58000EC7300 /* CommConstants.cpp in Sources */, @@ -1093,6 +1100,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + CBCA09072A8E0E7D00F75B3E /* StaffUtils.cpp in Sources */, CB3C0A3B2A125C8F009BD4DA /* NotificationsCryptoModule.cpp in Sources */, CB90951F29534B32002F2A7F /* CommSecureStore.mm in Sources */, CB38B48728771CE500171182 /* TemporaryMessageStorage.mm in Sources */,