Device bricked after retry
See original GitHub issueSince the introduction of “firstRun”, the firmware inputStream is not recreated in case of error and service restarting. We are using the LegacyDFU on our oldest devices with .bin firmware for application update. With the new behaviour, we experimented an error when sending firmware to device with some Samsung smartphones :
Response received (Op Code = 3, Status = 6)
Device returned error after sending file (error 6): OPERATION FAILED
This is not the problem since the library handles it, closing connection and restarting the service but in the second attempt, the inputStream is not reinitiated.
If the inputStream (AssetInputStream) has been partially read, the .available() that is used to calculate the image size in bytes in the init of the service will return the size of the file minus the bytes already read.
The firmware size validation is based on this value, so the transfer is validated with a wrong size and the transmitted file is corrupted resulting in a bricked device.
Issue Analytics
- State:
- Created 5 years ago
- Comments:31 (16 by maintainers)

Top Related StackOverflow Question
Hi, managed to reproduce the issue on our side. Now I have something to test with. Let me come back to you when I find something.
Hello again, sorry for the delay, I was sick. Did you find any solution that makes the first attempt to work? If not (but I’d really like to find the root cause and have it fixed), I’ll revert the 1 sec delay and release 1.8.0 of the library. At least now it doesn’t brick your device.