Android splash.img的制作

  1. 在device\qcom\common\display\logo下找到logo_gen.py
  2. 如果没有安装Python,先执行以下命令 sudo apt-get install python-imaging
  3. 将需要制作logo的图片拷贝到logo_gen.py的同级目录 需要注意的是图片分辨率应该与设备屏分辨率一致
  4. 运行如下命令生成splash.img,执行 python ./logo_gen.py logo.png
  5. 连上设备运行如下命令
    • adb reboot bootloader
    • fastboot flash splash splash.img
    • fastboot reboot
  6. 检查logo是否替换成功
  7. 操作步骤就是这么玩,需要有处理图片的环境,这个需要自己去搭建

生成就是splash.img

至于环境的搭建可以查看,我有一篇关于如何制作开机充电动画的那一篇介绍过。 

至于这个生成脚本是原生的,或者不太会使用就可以下载:链接: https://pan.baidu.com/s/1L7IKaFW1sa9-yZKMen8oow?pwd=g2f6 提取码: g2f6 

那么如果想制作到系统里面去该如何操作:

开机logo添加到编译中

  1. 将logo.png图片还放在该目录下device/qcom/common/display/logo/
  2. 修改vendor/qcom/build/tasks/generate_extra_images.mk:
  3. diff --git a/device/qcom/common/generate_extra_images.mk b/device/qcom/common/generate_extra_images.mk
    old mode 100644
    new mode 100755
    index 1bdab24..c7c5f8d
    --- a/device/qcom/common/generate_extra_images.mk
    +++ b/device/qcom/common/generate_extra_images.mk
    @@ -15,6 +15,7 @@ INSTALLED_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img
     INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img
     recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
     INSTALLED_USBIMAGE_TARGET := $(PRODUCT_OUT)/usbdisk.img
    +INSTALLED_SPLASHIMAGE_TARGET := $(PRODUCT_OUT)/splash.img
     endif

     #---------------------------------------------------------------------
    @@ -425,6 +426,30 @@ bootimage: $(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_SEC_BOOTIMAGE_TARGET)
     endif

     ###################################################################################################
    +#----------------------------------------------------------------------
    +# Compile splash.img
    +#----------------------------------------------------------------------
    +define build-splashimage-target
    +       $(hide) python device/qcom/common/display/logo/logo_gen.py device/qcom/common/display/logo/logo.png
    +       $(hide) cp splash.img $(PRODUCT_OUT)/
    +endef
    +
    +$(INSTALLED_SPLASHIMAGE_TARGET):
    +       $(build-splashimage-target)
    +
    +ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_SPLASHIMAGE_TARGET)
    +ALL_MODULES.$(LOCAL_MODULE).INSTALLED += $(INSTALLED_SPLASHIMAGE_TARGET)
    +
    +.PHONY:        splashimage
    +splashimage: $(INSTALLED_SPLASHIMAGE_TARGET)
    +

     ifeq ($(TARGET_BOOTIMG_SIGNED),true)
     .PHONY: otapackage
     

编译后out目录下会生成splash.img,修改烧录版本时的文件rawprogram0_16G.xml,找到label="splash"的这一项,将filename补上如下

physical_partition_number="0" size_in_KB="10240.0" sparse="false" start_byte_hex="0x8a82400" start_sector="283666"/>
参考:https://blog.csdn.net/weixin_44008788/article/details/111441491

你可能感兴趣的:(Android)