The first step is to create bootanimation.zip
1.1. Picture format
It is recommended to use images in jpg or png format
1.2. Picture naming rules
When there are multiple pictures, the Android display logo is displayed in the order of the numerical value of the picture name; when naming the picture, you need to pay attention to the number at the end of the name, and fill in 0 according to the number of digits in the total number of pictures, and the high bit needs to be added before Add a 0;
- There are 9 pictures named: 01.png ~ 09.png
- There are 10 pictures, named: 001.png ~ 010.png
- There are 100 pictures, named: 0001.png ~ 0100.png;
1.3、desc.txt
- 480 350
represents the resolution of the image - 5
represents the frame rate of picture playback - p 1 0 first
1 is to loop once
0, the interval is 0,
first is the corresponding folder name - p 0 0 second
0 is an infinite loop
0, the interval is 0,
second is the second directory of the same level
1.4. Package into zip compressed package
- The compression format is zip
- Compression method is storage
Step 2: Copy bootanimation.zip to system/media/bootanimation
2.1. Use adb to copy
2.1.1、adb push bootanimation.zip /system/media/
Solution: Unlock DM-verity
DM-verity is an important part of Android system security. It can ensure that the contents of Android's vendor and system image files are true and reliable. So if the DM-verity function is turned on, then if we modify the system partition or vendor partition of the android system through fastboot, an error will occur during DM-verity verification, so DM-verity needs to be unlocked before fastboot.
-
adb reboot bootloader
-
fastboot flashing unlock
-
fastboot reboot
-
adb root
-
adb disable-verity
-
adb reboot
-
adb root
-
adb remount
2.1.2. Restart the device
2.2. Copy the source code mk file
2.2.1. Put the bootanimation.zip package under /android10/device/google/bootanimation/
- The folder bootanimation was created by myself
2.2.2. Build/target/product/media_system.mk file to execute the copy function
- Execute copy code
#bootAnimation
$(warning "copy 10 Bootanimation.mk")
PRODUCT_COPY_FILES += \
device/google/bootanimation/bootanimation.zip:system/media/bootanimation.zip
- You need to add $(warning “copy 10 Bootanimation.mk”) so that you can know whether copy is actually executed during compilation.
- At the beginning, the copy logic was added to the full_base.mk file, but when compiling, it was found that it was not executed. It was found that media_system.mk was related to media, so in the end, the copy logic was added to the file.
2.2.3. Burn to the real Pixel 3 device
- source build/setupenv.sh
- lunch 21
- make -j8
- adb reboot bootloader
- fastboot flashall -w