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 @@ -111,6 +111,7 @@ file(GLOB_RECURSE MODULE_NATIVE_CODE "../../cpp/CommonCpp/NativeModules/**/*.cpp") file(GLOB MODULE_ROOT_NATIVE_CODE "../../cpp/CommonCpp/NativeModules/*.cpp") file(GLOB TOOLS_NATIVE_CODE "../../cpp/CommonCpp/Tools/*.cpp") +file(GLOB NOTIFICATIONS_NATIVE_CODE "../../cpp/CommonCpp/Notifications/**/*.cpp") add_library( # Sets the name of the library @@ -138,6 +139,7 @@ ${MODULE_NATIVE_CODE} ${MODULE_ROOT_NATIVE_CODE} ${TOOLS_NATIVE_CODE} + ${NOTIFICATIONS_NATIVE_CODE} ) set(BUILD_DIR ${CMAKE_SOURCE_DIR}/build) @@ -179,6 +181,8 @@ ../../cpp/CommonCpp/NativeModules/PersistentStorageUtilities/MessageOperationsUtilities/MessageSpecs ../../cpp/CommonCpp/DatabaseManagers ../../cpp/CommonCpp/Tools + ../../cpp/CommonCpp/Notifications + ../../cpp/CommonCpp/Notifications/BackgroundDataStorage # native rust library ${native_rust_library_include_dir} diff --git a/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.h b/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.h new file mode 100644 --- /dev/null +++ b/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.h @@ -0,0 +1,27 @@ +#pragma once + +#include "../../CryptoTools/CryptoModule.h" + +#include + +namespace comm { +class NotificationsCryptoModule { + const static std::string secureStoreNotificationsAccountDataKey; + const static std::string notificationsCryptoAccountID; + + static void serializeAndFlushCryptoModule( + crypto::CryptoModule &cryptoModule, + const std::string &path, + const std::string &picklingKey, + const std::string &callingProcessName); + static crypto::CryptoModule deserializeCryptoModule( + const std::string &path, + const std::string &picklingKey); + +public: + static void + initializeNotificationsCryptoAccount(const std::string &callingProcessName); + static void clearSensitiveData(); + static std::string getNotificationsIdentityKeys(); +}; +} // 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 @@ -182,6 +182,7 @@ B7906F6C27209091009BBBF5 /* Thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Thread.h; sourceTree = ""; }; B7E937CA26F448E700022A7C /* Media.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Media.h; sourceTree = ""; }; C562A7004903539402D988CE /* Pods-Comm.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Comm.release.xcconfig"; path = "Target Support Files/Pods-Comm/Pods-Comm.release.xcconfig"; sourceTree = ""; }; + CB24361629A397AB00FEC4E1 /* NotificationsCryptoModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NotificationsCryptoModule.h; path = Notifications/BackgroundDataStorage/NotificationsCryptoModule.h; sourceTree = ""; }; CB30C12327D0ACF700FBE8DE /* NotificationService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NotificationService.entitlements; sourceTree = ""; }; CB38B4792877179A00171182 /* NonBlockingLock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NonBlockingLock.h; path = Comm/TemporaryMessageStorage/NonBlockingLock.h; sourceTree = ""; }; CB38B47B287718A200171182 /* NonBlockingLock.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; name = NonBlockingLock.mm; path = Comm/TemporaryMessageStorage/NonBlockingLock.mm; sourceTree = ""; }; @@ -330,6 +331,7 @@ 71BE84372636A944002849D2 /* CommonCpp */ = { isa = PBXGroup; children = ( + CB24361429A3978800FEC4E1 /* Notifications */, 71F971B4270726C000DDC5BF /* _generated */, 71BF5B6A26B3FCFF00EDE27D /* CryptoTools */, 71BE84382636A944002849D2 /* Tools */, @@ -513,6 +515,22 @@ name = ExpoModulesProviders; sourceTree = ""; }; + CB24361429A3978800FEC4E1 /* Notifications */ = { + isa = PBXGroup; + children = ( + CB24361529A3979500FEC4E1 /* BackgroundDataStorage */, + ); + name = Notifications; + sourceTree = ""; + }; + CB24361529A3979500FEC4E1 /* BackgroundDataStorage */ = { + isa = PBXGroup; + children = ( + CB24361629A397AB00FEC4E1 /* NotificationsCryptoModule.h */, + ); + name = BackgroundDataStorage; + sourceTree = ""; + }; CB38B4782877177B00171182 /* TemporaryMessageStorage */ = { isa = PBXGroup; children = (