Android system custom boot logo and boot animation

Boot logo

The logo of the lk stage in the MTK ASOP is the first interface after booting, and is also called the U-boot logo. It and the Battery logo will be unified to generate logo.bin after compilation.

  • View the configuration file in the ASOP source directory:

vendor\mediatek\proprietary\bootable\bootloader\lk\project\8pbsp.mk

  • Options found:BOOT_LOGO := wuxganl

  • It can be seen that the directory where the boot logo is located is: vendor\mediatek\proprietary\bootable\bootloader\lk\dev\logo\wuxganl

To replace it with your own logo, it must be a bmp picture with 24 bits; the bmp picture must use the original picture file and cannot be compressed!

  • How to determine whether the bmp picture is compressed, you can open the bmp picture with a binary viewing tool and check the value of its 0x1E~ 0x21byte. If not 0x00000000, the bmp picture is in compressed bmp format.

note:

  1. The size of logo.bin is limited to 4M
  2. The image format of lk logo and kernel logo is RGB888
  3. The image compression order in logo.bin can be viewed in the lk/dev/logo/rules.mk file
  • After compiling the Android system, the wuxganl.raw file and the wuxganl directory will be generated in the /out/target/product/8p1bsp/obj/BOOTLOADER_OBJ/build-8p1bsp/dev/logo directory. There are .rawfiles for each picture in the wuxganl directory . It is used for program analysis and loading in the lk stage.

Boot animation

bootanimation.zipThe pictures in the compressed package constitute the Android boot animation, and all the pngpictures in the format are stored frame by frame .

  • The position in the ASOP source code is:frameworks/base/data/sounds
  • The position in the compiled system is: /system/media/(also in the output path of project source code compilation)

bootanimation.zip

It contains three parts: desc.txt , part0 and part1

  • desc.txt file, example

650 300 5
p 1 2 part0
p 0 2 part1

  1. 650 300 5
    represents the display resolution: width * height, 5 represents the number of frames displayed in one second
  2. p 1 2 part0 means
    that this stage will only be played once, the interval is 2 seconds, and the folder where the picture is played is part0
  3. p 0 2 part1
    represents loop playback, the playback interval is 2 seconds, and the folder where the played pictures are located is part1

There is the AllAudio.mk file in the frameworks/base/data/sounds directory. The statement in the file:
$(LOCAL_PATH)/bootanimation.zip:system/media/bootanimation.zip

The representative will copy the compressed package to the out/target/product/8p1bsp/system/media/ directory

Generate zip file

Do not compress and generate bootanimation.zip under the windows system, because after browsing the picture, windows will generate the hidden file Thumbs.db, which must be operated under the Linux system

zip -0qry -i \*.txt \*.png \*.wav @ ../bootanimation.zip *.txt part`

Add new boot animation

If you just replace the boot animation, just replace the bootanimation.zipold one in the source directory with the new one , but if you need to add a new boot animation, you need to modify the source code. The relevant source code is:

frameworks/base/cmds/bootanimation/BootAnimation.cpp

  • Put the new animation compression package in the source directory frameworks/base/data/sounds, and add a sentence to the BootAnimation.cpp source program:
static const char SYSTEM_BOOTANIMATION_NEW[] = "/system/media/bootanimation_new.zip";
  • The statement of loading animation in the BootAnimation.cpp source program is modified to:
part.animation = loadAnimation(SYSTEM_BOOTANIMATION_NEW));
  • Add newly added animation files to the frameworks/base/data/sounds/AllAudio.mk project file
    $(LOCAL_PATH)/bootanimation_new.zip:system/media/bootanimation_new.zip \

Guess you like

Origin blog.csdn.net/weixin_41388144/article/details/109405440