Categories

The upgrade to android 4.4.3 seemed to fail on my Nexus 7 2013 tablet. All went well, the tablet downloaded the update, rebooted, and...... showed me a dead android indicating the update failed.

When rebooting the tablet it still was on 4.4.2.

So what to do when an update fails? Let's investigate!

The log of the update process is available in the folder /cache/recovery/last_log. Unfortunately you need to be root to access this folder, so looking at the file will only succeed on "Rooted" devices. Below the contents of the last_log found on my Device

As you can see the update failed because there seems to be something wrong with the file "debuggerd". It has "Unexpected contents". The update gives this message because the sha1-hash isn't what the update script expects. When android runs an update it patches the files on the filesystem, before patching it checks to see if the file it's gonna modify is the same as the original the patch is supposed to work against. At my tablet the hash of debuggerd is different from the original file that came with the 4.4.2 release of android.

Getting the file onto the device

While the first challenge was to find the correct version of the file, the next challenge is getting this version onto the device. I will be using a recovery image to perform this action. As my device is rooted it has an unlocked boot-loader.

Step 1, creating a backup of the current debuggerd file

It would be wise to create a backup of the current debuggerd file. Even when we know the current version isn't the correct one. To do this use the Android Development Kit (adb) to get a shell at the device. This will only work when you have a "Rooted" device. The default permissions on debuggerd are read-write only by root.

So connect the device to the computer and open a shell by executing: adb shell

If you want to create the backup somewhere else rather then at the /system partition it's not necessary to remount the /system partition.

Step 2, getting the correct version onto the device

The first step is to get the right version of debuggerd onto the device. As it is in use at the /system partition we can't copy it over the original. Else it would be just remounting the system partition read-write and copying it there. So the first step will be putting debuggerd at the sdcard using adb.

Just use the adb push command to push the correct version to the sdcard:

adb push debuggerd /mnt/sdcard/

Step 3, copying the correct version using openrecovery.

When the file is on the device we can copy it into the correct location (/system/bin). This can be done by using the openrecovery tool from Team Win. The latest version can be downloaded at [http://teamw.in/project/twrp2] I've used an older version for my Nexus device.

When you have the image for the recovery tool downloaded put your device in recovery mode (power off, power on while holding volume down).

When the device is in recovery mode (and connected to your computer execute the recovery image via fastboot)

When your device is booted from the recovery image we can copy the debuggerd file from the sdcard to the system partition. First we need to mount the system partition.

Use the "Mount option" and check the System option.

Now we can use the file manager to copy the debuggerd file from the sdcard to the folder /system/bin

Reboot the device and wait until it notifies you again that the android version can be updated (this can take a while because the regional update schedule will be used) and try again. Or flash the update yourself using the android tools.