Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3380453
D6773.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6773.diff
View Options
diff --git a/native/android/app/src/cpp/PlatformSpecificTools.cpp b/native/android/app/src/cpp/PlatformSpecificTools.cpp
--- a/native/android/app/src/cpp/PlatformSpecificTools.cpp
+++ b/native/android/app/src/cpp/PlatformSpecificTools.cpp
@@ -24,6 +24,13 @@
}
return result;
}
+
+ static std::string getNotificationsCryptoAccountPath() {
+ static const auto cls = javaClassStatic();
+ static auto method =
+ cls->getStaticMethod<JString()>("getNotificationsCryptoAccountPath");
+ return method(cls)->toStdString();
+ }
};
namespace comm {
@@ -40,4 +47,12 @@
return std::string{"android"};
}
+std::string PlatformSpecificTools::getNotificationsCryptoAccountPath() {
+ std::string path;
+ NativeAndroidAccessProvider::runTask([&path]() {
+ path = PlatformSpecificToolsJavaClass::getNotificationsCryptoAccountPath();
+ });
+ return path;
+}
+
} // namespace comm
diff --git a/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h b/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h
--- a/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h
+++ b/native/cpp/CommonCpp/Tools/PlatformSpecificTools.h
@@ -8,6 +8,7 @@
public:
static void generateSecureRandomBytes(crypto::OlmBuffer &buffer, size_t size);
static std::string getDeviceOS();
+ static std::string getNotificationsCryptoAccountPath();
};
} // namespace comm
diff --git a/native/ios/Comm/PlatformSpecificTools.mm b/native/ios/Comm/PlatformSpecificTools.mm
--- a/native/ios/Comm/PlatformSpecificTools.mm
+++ b/native/ios/Comm/PlatformSpecificTools.mm
@@ -23,4 +23,18 @@
return std::string{"ios"};
}
+std::string PlatformSpecificTools::getNotificationsCryptoAccountPath() {
+ NSURL *groupUrl = [NSFileManager.defaultManager
+ containerURLForSecurityApplicationGroupIdentifier:@"group.app.comm"];
+ if (groupUrl == nil) {
+ throw std::runtime_error(
+ "Failed to resolve notifications crypto account path - could not find "
+ "groupUrl");
+ }
+ return std::string(
+ [[groupUrl
+ URLByAppendingPathComponent:@"comm_notifications_crypto_account"]
+ .path UTF8String]);
+}
+
}; // namespace comm
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Nov 28, 11:53 PM (21 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2595198
Default Alt Text
D6773.diff (2 KB)
Attached To
Mode
D6773: Extend PlatformSpecificTools CommonCpp api with an API to retrieve notifications olm account storage path
Attached
Detach File
Event Timeline
Log In to Comment