TeamWin / Team-Win-Recovery-Project

Core recovery files for the Team Win Recovery Project (T.W.R.P) - this is not up to date, please see https://github.com/TeamWin/android_bootable_recovery/
http://twrp.me
1.94k stars 740 forks source link

TRWP fails with ADB push and sideload of large file when using the latest ADB client from Google #1607

Open hselasky opened 3 years ago

hselasky commented 3 years ago

Device codename: a5y17lte TWRP version: 3.5.2

WHAT STEPS WILL REPRODUCE THE PROBLEM?

adb push and adb sideload of large file will fail, due to short data received.

WHAT IS THE EXPECTED RESULT?

The ADB server in TWRP must ignore so-called Zero Length Packets, ZLPs, received via USB. Google updated their ADB client to send ZLPs to flush data buffers regularly, due to a change in RX buffering in their ADB server.

Refer to the function should_perform_zero_transfer() at: https://github.com/aosp-mirror/platform_system_core/blob/platform-tools-29.0.6/adb/client/usb_libusb.cpp#L188

I can probably make a patch if someone can point out the USB code used for ADB in TWRP.

WHAT HAPPENS INSTEAD?

Transfer aborted. Google has confirmed this is a new feature and not a bug.

bigbiff commented 3 years ago

Hello, we use ADB from system_core for each build tree. This patch would need to be ported to all build trees we use starting with Lollipop.