Open ilpersi opened 8 months ago
Thanks for this very detailed issue report. I didn't notice it until right now. I don't have time to look into it currently, and it seems none of the maintainers don't either. It seems like a very nice thing to add though!
I don't currently have java development setup with and IDE and Android emulator, etc. But if someone would like to look into it, that would be great. I would be glad to help in any way I can as I know my way around the source code in this project.
Describe the bug When I run the snippet below the generated PNG file is corrupted.
The script is taken from the examples: https://github.com/vidstige/jadb/blob/fedca18ae1ca3e5167487f737e48877939ca8dc7/test/se/vidstige/jadb/test/integration/RealDeviceTestCases.java#L112
No error is raised during the run time.
I am able to correctly generate png file from the command prompt using a standard command like this:
adb.exe -s 127.0.0.1:5555 exec-out screencap -p > test.png
To Reproduce Steps to reproduce the behavior:
Expected behavior The generated file is a valid PNG.
Screenshots Hex dump of the corrupted file generated via jadb
Hex dump of the correct file generated via command line
You can notice differences starting from byte number 4 (value is 0d instead of 0a).
Other Notes Apparently this is a know issue and I've found a relevant topic in stack overflow. https://stackoverflow.com/questions/13578416/read-binary-stdout-data-like-screencap-data-from-adb-shell
Suggestion there is to use exec-out command, but apparently I am not able to make it work with jdb. Looking into open issues, this may be related to #149 and #150.
Desktop (please complete the following information):
Full class source