Android: Create & Use Your Own Bootanimation

These are my experiences on a rooted Acer E39 (a.k.a liquid E700) with Android 4.4.2 (kitkat).
I hope they apply to other models & Android versions, too.
Most of the work (except where indicated otherwise) was done on an Arch Linux desktop computer.

First of all you should have an idea what sort of animation you want.
Let's assume you have downloaded, created or modified a GIF animation. However, the bootanimation needs to consist of separate images - they can be PNG or JPG (maybe other formats, too).

I have used a very simple GIF animation from preloaders.net (site has since gone commercial) and changed the colors to black and Holo blue. You can download the finished bootanimation here.

Explode GIF animation to individual images (but make sure each image is a complete image)

We need to explode the GIF in a way that every resulting image looks like what one would see when looking at the animation (usually each new layer does not contain the whole image, but only the bits that change).
We also (most probably) need to resize the images to fit our phone's resolution.

This is possible to achieve with gimp.

  • Open the gif animation in gimp
  • To resize the canvas, use Image => Canvas Size...
  • From the menu, choose Filter => Animation => Unoptimize
  • This should create a new layered image
  • From the menu, choose File => Export Layers...

That's it really.

Unfortunately gimp seems to insist on giving overly complicated names to the resulting files, but a batch renaming tool like gprename can be applied afterwards.

Putting it all together

So you have an idea of what the animation will look like (e.g. a non-looped intro part, and a continuously looped ending) - all you need now is to create a folder structure, add a simple text file, and zip it all together.
There's a very good description of the whole process here - it doesn't seem to have changed at all in the last 6 years.

Zip the files, and push bootanimation.zip

Very important:

  • desc.txt must be in the root of the zip file! no subfolders!

  • the file must be zipped without compression. An appropriate command, executed from inside the folder that contains desc.txt and image folders: zip -r -0 bootanimation.zip .

  • Pushing the file to the phone should be trivial, but getting it copied to /system/media might pose a riddle, because

    • one needs to be root for that (and /system needs to be remounted rw)
    • external storage isn't accessible while being root
    • adb cannot push with root privileges
  • For me, the solution was to a) ... (lost in the mists of time, but I do remember that the trusty Ghost Commander was involved)

  • File permissions must be -rw-r--r-- and the file owner must be root (group root)

1st Try: Get boot.img from device - (Didn't work)

After reading this article...
In my case, this amounted to:

su
cat /dev/block/platform/mtk-msdc.0/mmcblk0boot0 > /storage/sdcard1/boot0.img
cat /dev/block/platform/mtk-msdc.0/mmcblk0boot1 > /storage/sdcard1/boot1.img

... I managed to extract something but couldn't do anything with it.
But I still got good & important information from that article, so I am including it here.

2nd Try: Get logo.bin, modify it, create an update.zip (under Windows)

This article helped.
The keyword seems to be "any Mediatek processor phone with custom recovery" (clockworkmod in my case).
Here is a direct link to the software download.

I extracted the file in a Windows 7 virtual machine, there's an executable inside it.

The example logo.bin is of no use, since it is for a different device.
So, how to get my phone's original logo.bin? After some searching I found the original firmware image (of the whole operating system) here.
It doesn't matter much because I only used the logo.bin, but that doesn't look like a trustworthy source. I just found out it's possible to get the original ROMs from acer's website.

Download the zip, open it, extract logo.bin, and proceed as outlined in the previously mentioned article. The software complains about files being of wrong size, but I just pressed "Ignore". Edited the .png images to my liking, created ("Make") an update.zip, moved it to the root of my phone's external storage, rebooted into recovery, chose "Apply update.zip"... Voilá. Worked on the first try, phone is not bricked (I admit I was anticipating the worst).