I have been playing around with Ubuntu on my Nexus 7 for a while, and decided yesterday to go back to stock android 4.2.2, so I downloaded the images from https://developers.google.com/android/nexus/images and extracted the zip file to my PC.
Restoring android 4.2.2
included in the package is a flash-all.bat file which contains all the commands which need to run so i thought great – i’ll just run it, go make a cup of tea and job done.
*** DO NOT RUN THE BATCH FILE! ***
The batch file doesn’t actually check the status of the commands it sends! Here’s what happened to me:
C:\Program Files (x86)\Android\android-sdk\platform-tools>flash-all.bat ... (bootloader) Bootloader is already unlocked OKAY [ 0.020s] finished. total time: 0.022s erasing 'boot'... OKAY [ 1.042s] finished. total time: 1.043s ******** Did you mean to fastboot format this partition? erasing 'cache'... OKAY [ 1.861s] finished. total time: 1.862s erasing 'recovery'... OKAY [ 0.975s] finished. total time: 0.978s ******** Did you mean to fastboot format this partition? erasing 'system'... OKAY [ 1.611s] finished. total time: 1.613s ******** Did you mean to fastboot format this partition? erasing 'userdata'... OKAY [ 12.114s] finished. total time: 12.116s sending 'bootloader' (2096 KB)... OKAY [ 0.279s] writing 'bootloader'... FAILED (status read failed (Too many links)) finished. total time: 0.849s rebooting into bootloader... FAILED (command write failed (Too many links)) finished. total time: 0.007s < waiting for device > ^CTerminate batch job (Y/N)? y
It’s sent the reboot command even though the bootloader failed to flash! So now i have an expensive paperweight 🙁
BATCH FILE DEVELOPERS, please make sure that your code has at least a ‘pause’ statement before doing things like rebooting so users can check the output before proceeding!!!