[GH-ISSUE #101] Binary UnifiedPush messages should not be converted to attachments #83

Closed
opened 2026-05-07 00:19:42 +02:00 by BreizhHardware · 4 comments

Originally created by @binwiederhier on GitHub (Jan 17, 2022).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/101

Originally created by @binwiederhier on GitHub (Jan 17, 2022). Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/101
Author
Owner

@binwiederhier commented on GitHub (Jan 17, 2022):

Server side github.com/binwiederhier/ntfy@4ceb058a40

<!-- gh-comment-id:1014801697 --> @binwiederhier commented on GitHub (Jan 17, 2022): Server side https://github.com/binwiederhier/ntfy/commit/4ceb058a40de18ccd8b5c8e8dc89adb694a25f24
Author
Owner

@binwiederhier commented on GitHub (Jan 18, 2022):

This is done in both main branches.

<!-- gh-comment-id:1014969251 --> @binwiederhier commented on GitHub (Jan 18, 2022): This is done in both main branches.
Author
Owner

@karmanyaahm commented on GitHub (Jan 18, 2022):

So I tested out the android app, and it didn't seem to work with flutter's byte decoding things, so I made this commit to ntfy for debugging: github.com/karmanyaahm/ntfy-android@f96fec2ff3

After that, I sent messages with dd if=/dev/urandom bs=8 count=1 | curl -d @- http://localhost/upABC?up=1

and monitored the logs printed by the above commit by running adb logcat | grep Ntfy2.

There, I could see something like the following

01-17 20:50:26.144  3617  3678 D Ntfy2   : [85, 27, -63, -2, -93, 62, 98, 113]
01-17 20:50:26.144  3617  3678 D Ntfy2   : [85, 27, -17, -65, -67, -17, -65, -67, -17, -65, -67, 62, 98, 113]

The output from the base64 array print was the correct (albeit signed) bytes, while the output after encoding into a string and decoding was the second weird one. The second output was also the same as what up-flutter-example saw when decoding the string to bytes.

So, this makes it seem like converting the byte array derived from base64 into a string is causing some corruption of the data. The effects are also inconsistent based on the input (random) data, so different characters are being processed differently.

I have no idea why any of this is happening, or whether it is even reproducible on different devices.

<!-- gh-comment-id:1015027246 --> @karmanyaahm commented on GitHub (Jan 18, 2022): So I tested out the android app, and it didn't seem to work with flutter's byte decoding things, so I made this commit to ntfy for debugging: https://github.com/karmanyaahm/ntfy-android/commit/f96fec2ff36c342c9b22538e4cc3f1bda8f5385f After that, I sent messages with `dd if=/dev/urandom bs=8 count=1 | curl -d @- http://localhost/upABC?up=1` and monitored the logs printed by the above commit by running `adb logcat | grep Ntfy2`. There, I could see something like the following ```log 01-17 20:50:26.144 3617 3678 D Ntfy2 : [85, 27, -63, -2, -93, 62, 98, 113] 01-17 20:50:26.144 3617 3678 D Ntfy2 : [85, 27, -17, -65, -67, -17, -65, -67, -17, -65, -67, 62, 98, 113] ``` The output from the base64 array print was the correct (albeit signed) bytes, while the output after encoding into a string and decoding was the second weird one. The second output was also the same as what up-flutter-example saw when decoding the string to bytes. So, this makes it seem like converting the byte array derived from base64 into a string is causing some corruption of the data. The effects are also inconsistent based on the input (random) data, so different characters are being processed differently. I have no idea why any of this is happening, or whether it is even reproducible on different devices.
Author
Owner

@karmanyaahm commented on GitHub (Jan 18, 2022):

https://stackoverflow.com/a/9098905/8919142 💭

<!-- gh-comment-id:1015030474 --> @karmanyaahm commented on GitHub (Jan 18, 2022): https://stackoverflow.com/a/9098905/8919142 :thought_balloon:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ntfy#83
No description provided.