Page MenuHomePhabricator

Implement JNI layer over NotificationsCryptoModule
ClosedPublic

Authored by marcin on May 18 2023, 8:55 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 7, 10:18 PM
Unknown Object (File)
Thu, Nov 7, 5:36 PM
Unknown Object (File)
Thu, Nov 7, 10:55 AM
Unknown Object (File)
Thu, Nov 7, 10:13 AM
Unknown Object (File)
Tue, Nov 5, 9:03 AM
Unknown Object (File)
Tue, Nov 5, 9:03 AM
Unknown Object (File)
Tue, Nov 5, 9:03 AM
Unknown Object (File)
Tue, Nov 5, 9:03 AM
Subscribers

Details

Summary

This differential implements JNI layer over NotificationsCryptoModule, so that native Android Java code can decrypt encrypted notifications

Test Plan
  1. Apply the following diff to CommNotificationsHandler.java: https://gist.github.com/marcinwasowicz/b90db78cb695e658ca3e2b1e1fd85c75
  2. Build the app and log in.
  3. Get cookie_id of the notifications olm session created for currently logged in android user (query db).
  4. Apply this diff to send.js file in keyserver (push directory). Remember to replace cookieID with data pulled from db in step 2.: https://gist.github.com/marcinwasowicz/873ec48a8b332c1e2324771d52e11ee0
  5. Send notification. Examine logs in Android Studio.

Example:

2023-05-18 18:03:35.098 12796-12842 COMM                    app.comm.android                     W  Encrypted sample: AwoguiD1LCV7sLJPq6lHWT5MARaNb3HEd+G/pIQzVyMqnw8QHiJAXQ0fCykph234akrN1RKigZzuDvfx4v++So74g7DoDCRLK+lMdtw06WMXuaGAAXVOOY2Ii63zLClgz7XE+me1qlWw766wN7al
2023-05-18 18:03:35.098 12796-12842 COMM                    app.comm.android                     W  Decrypted sample: This is data that is sent encrypted over the wire.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.May 18 2023, 9:10 AM
Harbormaster failed remote builds in B19484: Diff 26649!
tomek added inline comments.
native/android/app/src/cpp/NotificationsCryptoModuleJNIHelper.cpp
29 ↗(On Diff #26653)

Please add missing newlines.

This revision is now accepted and ready to land.May 22 2023, 2:32 AM