- 
                Notifications
    
You must be signed in to change notification settings  - Fork 286
 
Description
Since 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.