wireshark/extcap
Florian Bezold 5ebc3277ed androiddump: Fix adb tcpdump PTY CR/LF handling
Devices running Android >= 7 have a different adb shell handling than
before:
- Before Android 7, adb always runs shell commands in a PTY
  (pseudoterminal), which automatically converts all \n to \r\n
- Since Android 7, adb no longer uses a PTY if a command is directly
  started (like 'tcpdump' in our case).

The original androiddump code reversed the PTY \r\n handling as for
older devices. Commit 66507b9 for bug 13510 removed that which supported
newer devices while breaking all older devices.

This fix tries to support both by first trying to use the new
"shell,raw:" adb command syntax. If that succeeds, adb/device must
support non-PTY shells and we don't reverse any \r\n.
If that fails, it's most likely an older device, and we fall back to the
original "shell:" command and enable \r\n reversal.

(To prevent misleading error popups in Wireshark, the warning log in
adb_send when the first attempt fails is changed to a debug log).

Ping-Bug: 13510
Change-Id: I7e0a4f594ebe5dde682cceb667330459337a0c9c
Reviewed-on: https://code.wireshark.org/review/24721
Reviewed-by: Mikael Kanstrup <mikael.kanstrup@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-18 14:45:49 +00:00
..
.editorconfig Move extcap EditorConfig settings to source dir 2016-03-23 00:24:52 +00:00
Makefile.am Fix (and chop) static build option 2017-11-19 20:16:50 +00:00
androiddump.c androiddump: Fix adb tcpdump PTY CR/LF handling 2017-12-18 14:45:49 +00:00
ciscodump.c ciscodump(extcap): fix 'packet' was marked unused but was used [-Wused-but-marked-unused] 2017-12-14 18:45:14 +00:00
extcap-base.c extcap: use SPDX identifiers for licences. 2017-11-12 18:27:24 +00:00
extcap-base.h extcap: use SPDX identifiers for licences. 2017-11-12 18:27:24 +00:00
randpktdump.c extcap: use SPDX identifiers for licences. 2017-11-12 18:27:24 +00:00
ssh-base.c extcap: use SPDX identifiers for licences. 2017-11-12 18:27:24 +00:00
ssh-base.h extcap: use SPDX identifiers for licences. 2017-11-12 18:27:24 +00:00
sshdump.c sshdump: remove extra option check. 2017-11-22 15:40:13 +00:00
udpdump.c udpdump: add space. 2017-11-15 10:51:57 +00:00