当前位置: 首页 > news >正文

MTK APP实现动态修改logo和开机动画

MTK APP实现动态修改logo和开机动画

  • 前言
  • 一、修改对新分区的权限
    • 1.修改开机动画对新分区的权限
    • 2.修改系统APP对新分区的权限
    • 3.修改SE权限,不然编译会报错
    • 4.修改开机动画文件,让其加载新分区中的文件
  • 二、系统APP代码使用
    • 1.系统app修改开机logo
    • 2.系统app修改开机动画
    • 3.系统app修改开机音乐
  • 三、如何定制开机logo
  • 总结


前言

之前写过如何动态替换开机logo的MTK修改动态切换开机logo,恢复出厂设置不还原
以及OTA升级开机logo的MTK android10修改Logo OTA AB分区
但是又有需求,动态替换开机动画,开机logo,不随OTA升级变化,但是开机动画实际上是在system分区中的,OTA升级如果有修改,就会替换,而且,开机动画文件是只读文件,就相出了一个方法, 新建一个分区,把开机动画放入新分区中,这个分区不加入OTA升级,
先看新加分区的修改MTK Android10添加分区
不同平台或者android版本的话,大部分是一样的,修改思路相同


一、修改对新分区的权限

1.修改开机动画对新分区的权限

diff --git a/alps/device/mediatek/sepolicy/basic/non_plat/mtkbootanimation.te b/alps/device/mediatek/sepolicy/basic/non_plat/mtkbootanimation.te
index 491cf8eada..a378ead82e 100755
--- a/alps/device/mediatek/sepolicy/basic/non_plat/mtkbootanimation.te
+++ b/alps/device/mediatek/sepolicy/basic/non_plat/mtkbootanimation.te
@@ -51,6 +51,8 @@ allow mtkbootanimation proc_perfmgr:file {open read ioctl};allow mtkbootanimation mediaextractor:dir search;allow mtkbootanimation debugfs_ion:dir search;
+allow mtkbootanimation xunye_file:dir rw_dir_perms;
+allow mtkbootanimation xunye_file:file { read write open ioctl map};allow mediaserver mtkbootanimation:dir search;allowxperm mtkbootanimation proc_ged:file ioctl { proc_ged_ioctls };

2.修改系统APP对新分区的权限

diff --git a/alps/device/mediatek/sepolicy/bsp/non_plat/system_app.te b/alps/device/mediatek/sepolicy/bsp/non_plat/system_app.te
index 20cffc85b6..566650df89 100755
--- a/alps/device/mediatek/sepolicy/bsp/non_plat/system_app.te
+++ b/alps/device/mediatek/sepolicy/bsp/non_plat/system_app.te
@@ -253,3 +253,7 @@ allow system_app ttyS_device:chr_file { rw_file_perms };allow system_app app_data_file:file { rw_file_perms };+# add for xunye
+allow system_app xunye_file:file { getattr unlink open read write create };
+allow system_app xunye_file:dir rw_dir_perms;这里包括了systemapp对logo.bin的修改权限
diff --git a/alps/device/mediatek/mt8168/sepolicy/basic/system_app.te b/alps/device/mediatek/mt8168/sepolicy/basic/system_app.te
index 319bd99c59..378aa02a98 100644
--- a/alps/device/mediatek/mt8168/sepolicy/basic/system_app.te
+++ b/alps/device/mediatek/mt8168/sepolicy/basic/system_app.te
@@ -14,3 +14,9 @@ allow system_app system_data_file:file create;allow system_app system_data_file:dir write;allow system_app system_data_file:dir read;allow system_app system_data_file:dir add_name;
+allow system_app apk_data_file:dir write;
+allow system_app logo_block_device:blk_file write;
+allow system_app logo_block_device:blk_file read;
+allow system_app logo_block_device:blk_file open;
+allow system_app logo_block_device:blk_file getattr;
+allow system_app xunye_file:file setattr;

3.修改SE权限,不然编译会报错

diff --git a/alps/system/sepolicy/prebuilts/api/29.0/public/app.te b/alps/system/sepolicy/prebuilts/api/29.0/public/app.te
index d5a079b769..aa094cd2cc 100644
--- a/alps/system/sepolicy/prebuilts/api/29.0/public/app.te
+++ b/alps/system/sepolicy/prebuilts/api/29.0/public/app.te
@@ -371,7 +371,7 @@ binder_call({ appdomain -coredomain }, ashmemd)neverallow { appdomain -bluetooth -network_stack } self:capability_class_set *;# Block device access.
-neverallow appdomain dev_type:blk_file { read write };
+neverallow { appdomain -system_app } dev_type:blk_file { read write };# Access to any of the following character devices.neverallow appdomain {
@@ -467,7 +467,7 @@ neverallow {appdomain -system_app} system_data_file:dir_file_class_set# Write to various other parts of /data.neverallow appdomain drm_data_file:dir_file_class_set{ create write setattr relabelfrom relabelto append unlink link rename };
-neverallow { appdomain -platform_app }
+neverallow { appdomain -platform_app -system_app}apk_data_file:dir_file_class_set{ create write setattr relabelfrom relabelto append unlink link rename };neverallow { appdomain -platform_app }
diff --git a/alps/system/sepolicy/prebuilts/api/29.0/public/domain.te b/alps/system/sepolicy/prebuilts/api/29.0/public/domain.te
index f348701819..ef839d1e6d 100644
--- a/alps/system/sepolicy/prebuilts/api/29.0/public/domain.te
+++ b/alps/system/sepolicy/prebuilts/api/29.0/public/domain.te
@@ -818,6 +818,7 @@ full_treble_only(`# /data/vendorneverallow {coredomain
+       -domain-appdomain # TODO(b/34980020) remove exemption for appdomain-data_between_core_and_vendor_violators-init
@@ -836,6 +837,7 @@ full_treble_only(`-vold_prepare_subdirs} {data_file_type
+         -data_file_type-core_data_file_type# TODO(b/72998741) Remove exemption. Further restricted in a subsequent# neverallow. Currently only getattr and search are allowed.
diff --git a/alps/system/sepolicy/public/app.te b/alps/system/sepolicy/public/app.te
index d5a079b769..aa094cd2cc 100644
--- a/alps/system/sepolicy/public/app.te
+++ b/alps/system/sepolicy/public/app.te
@@ -371,7 +371,7 @@ binder_call({ appdomain -coredomain }, ashmemd)neverallow { appdomain -bluetooth -network_stack } self:capability_class_set *;# Block device access.
-neverallow appdomain dev_type:blk_file { read write };
+neverallow { appdomain -system_app } dev_type:blk_file { read write };# Access to any of the following character devices.neverallow appdomain {
@@ -467,7 +467,7 @@ neverallow {appdomain -system_app} system_data_file:dir_file_class_set# Write to various other parts of /data.neverallow appdomain drm_data_file:dir_file_class_set{ create write setattr relabelfrom relabelto append unlink link rename };
-neverallow { appdomain -platform_app }
+neverallow { appdomain -platform_app -system_app}apk_data_file:dir_file_class_set{ create write setattr relabelfrom relabelto append unlink link rename };neverallow { appdomain -platform_app }
diff --git a/alps/system/sepolicy/public/domain.te b/alps/system/sepolicy/public/domain.te
index f348701819..ef839d1e6d 100644
--- a/alps/system/sepolicy/public/domain.te
+++ b/alps/system/sepolicy/public/domain.te
@@ -818,6 +818,7 @@ full_treble_only(`# /data/vendorneverallow {coredomain
+       -domain-appdomain # TODO(b/34980020) remove exemption for appdomain-data_between_core_and_vendor_violators-init
@@ -836,6 +837,7 @@ full_treble_only(`-vold_prepare_subdirs} {data_file_type
+         -data_file_type-core_data_file_type# TODO(b/72998741) Remove exemption. Further restricted in a subsequent# neverallow. Currently only getattr and search are allowed.

4.修改开机动画文件,让其加载新分区中的文件

复制文件到新分区中

diff --git a/alps/device/mediateksample/xxxxxxxx/device.mk b/alps/device/mediateksample/xxxxxxxx/device.mk
index 22e9bdc759..8fd857fd9c 100755
--- a/alps/device/mediateksample/xxxxxxxx/device.mk
+++ b/alps/device/mediateksample/xxxxxxxx/device.mk
@@ -277,6 +277,9 @@ PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists, vendor/het/appPRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists, vendor/het/app/ClifeScreenReceive/lib/libndkbitmap.so:system/lib/libndkbitmap.so)PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists, vendor/het/app/ClifeScreenReceive/lib/libsfftranscoder.so:system/lib/libsfftranscoder.so)+PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists, vendor/het/images/1024_600/bootanimation.zip:xunye/media/bootanimation.zip)
+PRODUCT_COPY_FILES += $(call add-to-product-copy-files-if-exists, vendor/het/audios/bootaudio.mp3:xunye/media/bootaudio.mp3)

修改bootanimation.cpp ,这个其实比较简单, 把默认加载system/media的目录改成xunye/media即可;

diff --git a/alps/vendor/mediatek/proprietary/operator/frameworks/bootanimation/MtkBootanimation/BootAnimation.cpp b/alps/vendor/mediatek/proprietary/operator/frameworks/bootanimation/MtkBootanimation/BootAnimation.cpp
index 5ebc874a13..927944e61f 100755
--- a/alps/vendor/mediatek/proprietary/operator/frameworks/bootanimation/MtkBootanimation/BootAnimation.cpp
+++ b/alps/vendor/mediatek/proprietary/operator/frameworks/bootanimation/MtkBootanimation/BootAnimation.cpp
@@ -121,12 +121,12 @@ static const char* mResourcePath[MNC_COUNT][PATH_COUNT] =#if !(defined(MSSI_MTK_CARRIEREXPRESS_PACK) && defined(MTK_TER_SERVICE))static const char* mAudioPath[2][PATH_COUNT] =
-    {{"/system/media/bootaudio.mp3", "/custom/media/bootaudio.mp3", "/data/local/bootaudio.mp3"} , /*  bootaudio path  */
-     {"/system/media/shutaudio.mp3", "/custom/media/shutaudio.mp3", "/data/local/shutaudio.mp3"} /*  shutaudio path  */
+    {{"/xunye/media/bootaudio.mp3", "/custom/media/bootaudio.mp3", "/data/local/bootaudio.mp3"} , /*  bootaudio path  */
+     {"/xunye/media/shutaudio.mp3", "/custom/media/shutaudio.mp3", "/data/local/shutaudio.mp3"} /*  shutaudio path  */};#endifstatic const char* myAudioPath[2] =
-    {"/system/media/bootaudio.mp3", "/system/media/1/bootaudio.mp3"};
+    {"/xunye/media/bootaudio.mp3", "/system/media/1/bootaudio.mp3"};namespace android {@@ -136,10 +136,10 @@ static const char SYSTEM_SHUTANIMATION_FILE[] = "/system/media/shutanimation.zipstatic const char CUSTOM_SHUTANIMATION_FILE[] = "/custom/media/shutanimation.zip";static const char USER_SHUTANIMATION_FILE[] = "/data/local/shutanimation.zip";-static const char OEM_BOOTANIMATION_FILE[] = "/oem/media/bootanimation.zip";
+static const char OEM_BOOTANIMATION_FILE[] = "/xunye/media/bootanimation.zip";static const char SYSTEM_BOOTANIMATION_FILE[] = "/system/media/bootanimation.zip";static const char SYSTEM_ENCRYPTED_BOOTANIMATION_FILE[] = "/system/media/bootanimation-encrypted.zip";
-static const char OEM_SHUTDOWNANIMATION_FILE[] = "/oem/media/shutdownanimation.zip";
+static const char OEM_SHUTDOWNANIMATION_FILE[] = "/xunye/media/shutdownanimation.zip";static const char SYSTEM_SHUTDOWNANIMATION_FILE[] = "/system/media/shutdownanimation.zip";static const char SYSTEM_DATA_DIR_PATH[] = "/data/system";
@@ -535,6 +535,7 @@ status_t BootAnimation::readyToRun() {for (const char* f : (bBootOrShutDown ? bootFiles : shutdownFiles)) {if (access(f, R_OK) == 0) {mZipFileName = f;
+                       ALOGE(" bootFiles mZipFileName f=%s",f);return NO_ERROR;}}
@@ -1097,7 +1098,7 @@ bool BootAnimation::movie()if(strcmp(nvram_logo_index, "1") == 0){mZipFileName="/system/media/1/bootanimation.zip";}
-       
+       ALOGE("movie mZipFileName: %s", mZipFileName.string());Animation* animation = loadAnimation(mZipFileName);if (animation == NULL)return false;

二、系统APP代码使用

1.系统app修改开机logo

public static void copyLogoBin() {File srcFile = new File("/sdcard/logo.bin");if(!srcFile.exists())return;String logoPath = "dev/block/platform/bootdevice/by-name/logo";
//        String logoPath = "/dev/block/mmcblk0p19";Log.e("logo","logoPath="+logoPath);File dstFile =  new File(logoPath);OutputStream os = null;try {FileInputStream is = new FileInputStream(srcFile);os = new BufferedOutputStream(new FileOutputStream(dstFile, false));int curSize = 0;byte[] data = new byte[1024];for (int len; (len = is.read(data)) != -1; ) {os.write(data, 0, len);curSize += len;}} catch (Exception e) {e.printStackTrace();}finally {try {if (os != null) {os.close();}} catch (IOException e) {e.printStackTrace();}
//            srcFile.delete();}}

2.系统app修改开机动画

public static void copyLogoBootanimation() {File srcFile = new File("/sdcard/bootanimation.zip");if(!srcFile.exists())return;String logoPath = "/xunye/media/bootanimation.zip";
//        String logoPath = "/dev/block/mmcblk0p19";Log.e("logo","BootanimationPath="+logoPath);File dstFile =  new File(logoPath);if(dstFile.exists())dstFile.delete();try {dstFile.createNewFile();} catch (IOException e) {throw new RuntimeException(e);}try {Os.chmod(dstFile.getAbsolutePath(), 0777);} catch (ErrnoException e) {e.printStackTrace();}OutputStream os = null;try {FileInputStream is = new FileInputStream(srcFile);os = new BufferedOutputStream(new FileOutputStream(dstFile, false));int curSize = 0;byte[] data = new byte[1024];for (int len; (len = is.read(data)) != -1; ) {os.write(data, 0, len);curSize += len;}} catch (Exception e) {e.printStackTrace();}finally {try {if (os != null) {os.close();}} catch (IOException e) {e.printStackTrace();}
//            srcFile.delete();}}

3.系统app修改开机音乐

public static void copyBootAudio() {File srcFile = new File("/sdcard/bootaudio.mp3");if(!srcFile.exists())return;String logoPath = "/xunye/media/bootaudio.mp3";
//        String logoPath = "/dev/block/mmcblk0p19";Log.e("logo","bootaudio.mp3 Path="+logoPath);File dstFile =  new File(logoPath);if(dstFile.exists())dstFile.delete();try {dstFile.createNewFile();} catch (IOException e) {throw new RuntimeException(e);}try {Os.chmod(dstFile.getAbsolutePath(), 0777);} catch (ErrnoException e) {e.printStackTrace();}OutputStream os = null;try {FileInputStream is = new FileInputStream(srcFile);os = new BufferedOutputStream(new FileOutputStream(dstFile, false));int curSize = 0;byte[] data = new byte[1024];for (int len; (len = is.read(data)) != -1; ) {os.write(data, 0, len);curSize += len;}} catch (Exception e) {e.printStackTrace();}finally {try {if (os != null) {os.close();}} catch (IOException e) {e.printStackTrace();}
//            srcFile.delete();}}

三、如何定制开机logo

需要几个文件,在linux下编译
vendor/mediatek/proprietary/bootable/bootloader/lk/dev/logo/tool/bmp_to_raw
vendor/mediatek/proprietary/bootable/bootloader/lk/dev/logo/tool/zpipe
vendor/mediatek/proprietary/bootable/bootloader/lk/dev/logo/img_hdr_logo.cfg
vendor/mediatek/proprietary/bootable/bootloader/lk/scripts/mkimage
然后复制一下logo.bin编译的脚本,修改成make_logo.sh文件
如下

#!/bin/bashif [ "$1" = "" ]; thenecho "Please input BOOT_LOGO name,"echo "xunye"exit
fiBASELOGO=$1
BOOT_LOGO_RESOURCE=boot_logo.raw
echo "BASELOGO=${BASELOGO}"# step 1 make hdplus1560_uboot.raw  hdplus1560_kernel.raw
echo "===================step 1 bmp_to_raw make uboot and kernel raw===================="
#./bmp_to_raw  ./${BASELOGO}/${BASELOGO}_kernel.raw  logo.bmp
#./bmp_to_raw  ./${BASELOGO}/${BASELOGO}_uboot.raw   logo.bmp./bmp_to_raw ./temp0.raw ./${BASELOGO}/"${BASELOGO}_uboot".bmp
./bmp_to_raw ./temp1.raw ./${BASELOGO}/"${BASELOGO}_battery".bmp
./bmp_to_raw ./temp2.raw ./${BASELOGO}/"${BASELOGO}_low_battery".bmp
./bmp_to_raw ./temp3.raw ./${BASELOGO}/"${BASELOGO}_charger_ov".bmp
./bmp_to_raw ./temp4.raw ./${BASELOGO}/"${BASELOGO}_num_0".bmp
./bmp_to_raw ./temp5.raw ./${BASELOGO}/"${BASELOGO}_num_1".bmp
./bmp_to_raw ./temp6.raw ./${BASELOGO}/"${BASELOGO}_num_2".bmp
./bmp_to_raw ./temp7.raw ./${BASELOGO}/"${BASELOGO}_num_3".bmp
./bmp_to_raw ./temp8.raw ./${BASELOGO}/"${BASELOGO}_num_4".bmp
./bmp_to_raw ./temp9.raw ./${BASELOGO}/"${BASELOGO}_num_5".bmp
./bmp_to_raw ./temp10.raw ./${BASELOGO}/"${BASELOGO}_num_6".bmp
./bmp_to_raw ./temp11.raw ./${BASELOGO}/"${BASELOGO}_num_7".bmp
./bmp_to_raw ./temp12.raw ./${BASELOGO}/"${BASELOGO}_num_8".bmp
./bmp_to_raw ./temp13.raw ./${BASELOGO}/"${BASELOGO}_num_9".bmp
./bmp_to_raw ./temp14.raw ./${BASELOGO}/"${BASELOGO}_num_percent".bmp
./bmp_to_raw ./temp15.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_01".bmp
./bmp_to_raw ./temp16.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_02".bmp
./bmp_to_raw ./temp17.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_03".bmp
./bmp_to_raw ./temp18.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_04".bmp
./bmp_to_raw ./temp19.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_05".bmp
./bmp_to_raw ./temp20.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_06".bmp
./bmp_to_raw ./temp21.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_07".bmp
./bmp_to_raw ./temp22.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_08".bmp
./bmp_to_raw ./temp23.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_09".bmp
./bmp_to_raw ./temp24.raw ./${BASELOGO}/"${BASELOGO}_bat_animation_10".bmp
./bmp_to_raw ./temp25.raw ./${BASELOGO}/"${BASELOGO}_bat_10_01".bmp
./bmp_to_raw ./temp26.raw ./${BASELOGO}/"${BASELOGO}_bat_10_02".bmp
./bmp_to_raw ./temp27.raw ./${BASELOGO}/"${BASELOGO}_bat_10_03".bmp
./bmp_to_raw ./temp28.raw ./${BASELOGO}/"${BASELOGO}_bat_10_04".bmp
./bmp_to_raw ./temp29.raw ./${BASELOGO}/"${BASELOGO}_bat_10_05".bmp
./bmp_to_raw ./temp30.raw ./${BASELOGO}/"${BASELOGO}_bat_10_06".bmp
./bmp_to_raw ./temp31.raw ./${BASELOGO}/"${BASELOGO}_bat_10_07".bmp
./bmp_to_raw ./temp32.raw ./${BASELOGO}/"${BASELOGO}_bat_10_08".bmp
./bmp_to_raw ./temp33.raw ./${BASELOGO}/"${BASELOGO}_bat_10_09".bmp
./bmp_to_raw ./temp34.raw ./${BASELOGO}/"${BASELOGO}_bat_10_10".bmp
./bmp_to_raw ./temp35.raw ./${BASELOGO}/"${BASELOGO}_bat_bg".bmp
./bmp_to_raw ./temp36.raw ./${BASELOGO}/"${BASELOGO}_bat_img".bmp
./bmp_to_raw ./temp37.raw ./${BASELOGO}/"${BASELOGO}_bat_100".bmp
./bmp_to_raw ./temp38.raw ./${BASELOGO}/"${BASELOGO}_kernel".bmp
./bmp_to_raw ./temp39.raw ./${BASELOGO}/"${BASELOGO}_uboot_clife".bmp
./bmp_to_raw ./temp40.raw ./${BASELOGO}/"${BASELOGO}_kernel_clife".bmp
echo "=========done"# step 2 zpipe all raw to boot_logo.raw
echo "===================step 2 zpipe all raws get ${BASELOGO}.raw===================="
#./zpipe -l 9 ${BOOT_LOGO_RESOURCE} ./${BASELOGO}/${BASELOGO}_uboot.raw ./${BASELOGO}/${BASELOGO}_uboot_clife.raw ./${BASELOGO}/${BASELOGO}_battery.raw ./${BASELOGO}/${BASELOGO}_low_battery.raw  ./${BASELOGO}/${BASELOGO}_charger_ov.raw ./${BASELOGO}/${BASELOGO}_num_0.raw ./${BASELOGO}/${BASELOGO}_num_1.raw ./${BASELOGO}/${BASELOGO}_num_2.raw ./${BASELOGO}/${BASELOGO}_num_3.raw ./${BASELOGO}/${BASELOGO}_num_4.raw ./${BASELOGO}/${BASELOGO}_num_5.raw ./${BASELOGO}/${BASELOGO}_num_6.raw ./${BASELOGO}/${BASELOGO}_num_7.raw ./${BASELOGO}/${BASELOGO}_num_8.raw ./${BASELOGO}/${BASELOGO}_num_9.raw ./${BASELOGO}/${BASELOGO}_num_percent.raw ./${BASELOGO}/${BASELOGO}_bat_animation_01.raw ./${BASELOGO}/${BASELOGO}_bat_animation_02.raw ./${BASELOGO}/${BASELOGO}_bat_animation_03.raw ./${BASELOGO}/${BASELOGO}_bat_animation_04.raw ./${BASELOGO}/${BASELOGO}_bat_animation_05.raw ./${BASELOGO}/${BASELOGO}_bat_animation_06.raw ./${BASELOGO}/${BASELOGO}_bat_animation_07.raw ./${BASELOGO}/${BASELOGO}_bat_animation_08.raw ./${BASELOGO}/${BASELOGO}_bat_animation_09.raw ./${BASELOGO}/${BASELOGO}_bat_animation_10.raw ./${BASELOGO}/${BASELOGO}_bat_10_01.raw ./${BASELOGO}/${BASELOGO}_bat_10_02.raw ./${BASELOGO}/${BASELOGO}_bat_10_03.raw ./${BASELOGO}/${BASELOGO}_bat_10_04.raw ./${BASELOGO}/${BASELOGO}_bat_10_05.raw ./${BASELOGO}/${BASELOGO}_bat_10_06.raw ./${BASELOGO}/${BASELOGO}_bat_10_07.raw ./${BASELOGO}/${BASELOGO}_bat_10_08.raw ./${BASELOGO}/${BASELOGO}_bat_10_09.raw ./${BASELOGO}/${BASELOGO}_bat_10_10.raw ./${BASELOGO}/${BASELOGO}_bat_bg.raw ./${BASELOGO}/${BASELOGO}_bat_img.raw ./${BASELOGO}/${BASELOGO}_bat_100.raw ./${BASELOGO}/${BASELOGO}_kernel.raw ./${BASELOGO}/${BASELOGO}_kernel_clife.raw
./zpipe -l 9 ${BOOT_LOGO_RESOURCE} temp0.raw temp1.raw temp2.raw temp3.raw temp4.raw temp5.raw temp6.raw temp7.raw temp8.raw temp9.raw temp10.raw temp11.raw temp12.raw temp13.raw temp14.raw temp15.raw temp16.raw temp17.raw temp18.raw temp19.raw temp20.raw temp21.raw temp22.raw temp23.raw temp24.raw temp25.raw temp26.raw temp27.raw temp28.raw temp29.raw temp30.raw temp31.raw temp32.raw temp33.raw temp34.raw temp35.raw temp36.raw temp37.raw temp38.raw temp39.raw temp40.raw 
rm -rf ./temp0.raw ./temp1.raw ./temp2.raw ./temp3.raw ./temp4.raw ./temp5.raw ./temp6.raw ./temp7.raw ./temp8.raw ./temp9.raw ./temp10.raw ./temp11.raw ./temp12.raw ./temp13.raw ./temp14.raw ./temp15.raw ./temp16.raw ./temp17.raw ./temp18.raw ./temp19.raw ./temp20.raw ./temp21.raw ./temp22.raw ./temp23.raw ./temp24.raw ./temp25.raw ./temp26.raw ./temp27.raw ./temp28.raw ./temp29.raw ./temp30.raw ./temp31.raw ./temp32.raw ./temp33.raw ./temp34.raw ./temp35.raw ./temp36.raw ./temp37.raw ./temp38.raw ./temp39.raw ./temp40.raw ./bootlogo.raw 
echo "conversion finished"echo "=========done"# step 3 make logo.bin
echo "===================step 3 make logo.bin===================="
./mkimage ${BOOT_LOGO_RESOURCE} img_hdr_logo.cfg  > logo.bin
echo "all=========done"rm  ${BOOT_LOGO_RESOURCE} -rf

在这里插入图片描述
编译的时候,替换xunye文件夹中的xxxxxx_uboot.bmp,xxxxxx_kernel.bmp两个文件,即logo图片
./make_logo.sh xunye就行,生成的logo.bin放入sd卡中替换

总结

logo.bin没有修改,动态修改logo.bin,只是修改了系统app对logo分区的修改权限;
开机动画与开机音乐是加入到新分区中的,然后对新分区修改SE权限,和读写权限,让系统APP能够修改,同时该分区不随OTA升级,所以用户即使替换了,升级之后也没有变化;

相关文章:

MTK APP实现动态修改logo和开机动画

MTK APP实现动态修改logo和开机动画 前言一、修改对新分区的权限1.修改开机动画对新分区的权限2.修改系统APP对新分区的权限3.修改SE权限,不然编译会报错4.修改开机动画文件,让其加载新分区中的文件 二、系统APP代码使用1.系统app修改开机logo2.系统app修改开机动画…...

Spring核心扩展点BeanDefinitionRegistryPostProcessor源码分析

我们知道,只要在一个Java类上加上Component、Service、Controller等注解,就可以被加载到Spring容器中,除了以上方式,加了Bean和Import好像也可以将对象添加到Spring容器中,究竟Spring是如何实现这些功能的呢&#xff1…...

C++实现AC自动机,剪枝、双数组压缩字典树!详解双数组前缀树(Double-Array Trie)剪枝字典树(Patricia Trie)

代码在:github.com/becomequantum 最近研究了一下字典树,什么AC自动机,双数组压缩字典树,剪枝字典树都自己写代码实现了一下。这本该是本科学数据结构时该玩明白的东西,我到现在才会玩。本视频主要介绍一下双数组和剪…...

防火墙规则顺序解决方案

防火墙是保护网络免受攻击的第一道防线,防火墙对互联网和公司IT网络之间的流量拥有绝对控制权,防火墙规则的配置处理调节流量的关键任务。 这些规则会仔细检查传入和传出流量,并根据规则中提到的条件允许或阻止它,防火墙规则越严…...

ZC-CLS381RGB颜色识别+8x8点阵指示(完)

文章目录 前言一、信号关联说明二、演示视频 前言 在前面两篇博客中,分别阐述了如何配置WS2812 RGB 8x8点阵,和如何配置颜色识别模块,本文将说明如何级联两个模块,以及演示两个模块级联后的运行效果。 一、信号关联说明 已知WS28…...

Stanford CS224N - word2vec

最近在听Stanford放出来的Stanford CS224N NLP with Deep Learning这门课,弥补一下之前nlp这块基础知识的一些不清楚的地方,顺便巩固一下基础知识😁 关于word2vec: 1.为什么要把单词表示成向量 一开始人们造了一个类似于词典表…...

华为云云耀云服务器L实例评测|windows系统3389防爆破之安全加固教程

为什么要选择华为云云耀云服务器L实例: 华为云在全国范围内建立了多个数据中心,这些数据中心之间相互冗余,以确保高可靠性和可用性,用户可以选择最适合的区域来部署应用程序,以实现更好的性能和延迟。 相对于传统的物…...

零基础如何自学C#?

前言 本文来源于知乎的一个提问,提问的是一个大一软件工程专业的学生,他想要自学C#但是不知道该怎么去学,这让他感到很迷茫,希望有人能给他一些建议和提供一些学习方向。 个人建议 确认目标:自学C#首先你需要大概了解…...

Spring5学习笔记之整合MyBatis

✅作者简介:大家好,我是Leo,热爱Java后端开发者,一个想要与大家共同进步的男人😉😉 🍎个人主页:Leo的博客 💞当前专栏: Spring专栏 ✨特色专栏: M…...

GO 语言的方法??

GO 中的方法是什么? 前面我们有分享到 GO 语言的函数,他是一等公民,那么 GO 语言中的方法和函数有什么区别呢? GO 语言中的方法实际上和函数是类似的,只不过在函数的基础上多了一个参数,这个参数在 GO 语…...

【JavaEE】 多线程-初阶

多线程-初阶 1. 认识线程 1.1 概念 1) 线程是什么 多个线程组成了一个进程,线程好比是一跟光纤中的一个玻璃丝,进程是整根光纤。 一个进程中的线程共享这个进程中的资源(内存、硬盘) 2) 为什么需要线程 单核CPU发展出现瓶颈…...

小程序OCR身份证识别

使用两种OCR识别:小程序和腾讯云 1.基于微信小程序OCR插件实现身份证拍照、上传并OCR识别的示例: 首先,在小程序中添加身份证拍照的功能,可以使用wx.chooseImage()选择照片并使用wx.uploadFile()上传,代码如下&#…...

【算法学习】归并算法Merge Sort总结

归并排序思路简单,速度仅次于快速排序,为稳定排序算法,一般用于对总体无序,但是各子项相对有序的数列。 1. 基本思想 归并排序使用分治思想,分治模式下每一层递归有三个步骤: 分解(divide)&a…...

Swager如何使用

Swager是一个API文档自动生成工具,可以用于生成API接口文档,供开发者和用户查看和使用。它可以通过描述API接口的规范,自动生成API文档,使得API接口的发布和使用变得更加简单和规范。 下面是使用Swagger的步骤: 首先…...

DHorse v1.4.2 发布,基于 k8s 的发布平台

版本说明 优化特性 在集群列表增加集群版本;修改Jvm的GC指标名; 解决问题 解决shell脚本换行符的问题;解决部署历史列表页,环境名展示错误的问题;解决指标收集功能的异常; 升级指南 升级指南 DHorse…...

Java使用JJWT令牌

最近在B站大学学习Java开发&#xff0c;刚好学到登入验证&#xff0c;在使用JJWT令牌时踩了一些坑&#xff0c;在这里把代码和依赖给出&#xff0c;希望后来者得以借鉴。 依赖 <dependency><groupId>io.jsonwebtoken</groupId><artifactId>jjwt-api&l…...

“第四十四天”

这道题也不是难&#xff0c;但可能会忽略一种情况&#xff0c;当最大小出现在首位的时候&#xff0c;那个时候如果进行交换的话&#xff0c;大小值可能出现覆盖的情况&#xff0c;最终导致丢失最大值或者最小值&#xff0c;比如最大值 10 在第一位&#xff0c;最小值 0 随意&am…...

Unity Mono和.Net平台浮点算法的区别

static void TestFloat(){{//float speed2.0f/20;float speed 0.1f;float distance 2.0f;long needTime (long)(distance / speed);Log.Debug($"needTime{needTime}"); #if UNITY_EDITORif (needTime ! 19) #elseif (needTime ! 20)//.Net服务器和安卓手机 #endif…...

【SA8295P 源码分析 (二)】64 - QNX 与 Android GVM 显示 Dump 图片方法汇总

【SA8295P 源码分析】64 - QNX 与 Android GVM 显示 Dump 图片方法汇总 一、QNX侧1.1 surfacedump 功能1.2 screenshot 功能二、Android GVM 侧2.1 screencap -p 导出 PNG 图片2.2 screencap 不加 -p 参数,导出 RGB32 图片2.3 dumpsys SurfaceFlinger --display-id 方法系列文…...

shell命令以及运行原理和lLinux权限

shell命令以及运行原理 什么是shell shell是操作系统的外壳程序统称&#xff0c;我们是通过shell去和操作系统沟通的。 从技术角度&#xff0c;shell最简单的定义就是命令行解释器&#xff0c;主要包含两个功能&#xff1a; 将使用者的命令翻译给核心处理 将核心的处理结果…...

斯坦福JSKarel编程机器人使用介绍

斯坦福JSKarel编程机器人使用介绍 为了避免被编程语言固有的复杂性所困扰&#xff0c;有一个被称为卡雷尔&#xff08;Karel&#xff09;机器人的微型世界&#xff08;microworld&#xff09;的简化环境&#xff0c;可以让编程初学者从中学习理解编程的基本概念&#xff0c;而…...

SpringBoot中pom.xml不引入依赖, 怎么使用parent父项目的依赖

在Spring Boot项目中&#xff0c;如果你想使用父项目的依赖&#xff0c;而不想在pom.xml中显式引入依赖&#xff0c;你可以使用Maven的继承机制。 首先&#xff0c;确保你的Spring Boot项目是一个子项目&#xff0c;即它继承自一个父项目。要实现这一点&#xff0c;在pom.xml文…...

基于vue3+ts5+vue-router4+pinia2的PC端项目搭建教程

导语&#xff1a;在日常开发中&#xff0c;有时候会在项目中引入 ts 来解决一些 js 的问题&#xff0c;下面就简单介绍一下如何使用 vue3tsrouterpinia 来搭建一个项目。 目录 简介创建安装配置实战 简介 vue3 目前是常用的 vue 版本&#xff0c;提供了组合式 API 以及一些新…...

6个无版权、免费、高清图片素材库

找免费无版权图片素材&#xff0c;就上这6个网站&#xff0c;超高质量&#xff0c;可商用&#xff0c;赶紧收藏&#xff01; 1、菜鸟图库 https://www.sucai999.com/pic.html?vNTYwNDUx 网站主要为新手设计师提供免费素材&#xff0c;这些素材的质量都很高&#xff0c;类别也…...

什么是响应式设计?响应式设计的基本原理是什么?如何兼容低版本的 IE?

什么是响应式设计: 响应式设计&#xff08;Responsive Design&#xff09;是一种Web设计和开发方法&#xff0c;旨在使网站在不同设备和屏幕尺寸上都能提供一致的用户体验。响应式设计的目标是适应多种终端&#xff0c;包括桌面计算机、笔记本电脑、平板电脑和移动设备&#x…...

LeetCode 2906. 构造乘积矩阵【前后缀分解,数组】中等

本文属于「征服LeetCode」系列文章之一&#xff0c;这一系列正式开始于2021/08/12。由于LeetCode上部分题目有锁&#xff0c;本系列将至少持续到刷完所有无锁题之日为止&#xff1b;由于LeetCode还在不断地创建新题&#xff0c;本系列的终止日期可能是永远。在这一系列刷题文章…...

vue3+koa+axios实现前后端通信

vue3koaaxios实现前后端通信 写了一个小demo来实现前后端通信,涉及跨域问题&#xff0c;非常简单可以给大家平时开发的时候参考 服务端&#xff1a; 目录结构如下&#xff1a; router index.js // router的入口文件 // 引入路由 const Router require("koa-router&quo…...

Required MultipartFile parameter ‘file‘ is not present

出现这个原因我们首先想到的是加一个RequestParam("file")&#xff0c;但是还有可能的原因是因为我们的名字有错误 <span class"input-group-addon must">模板上传 </span> <input id"uploadFileUpdate" name"importFileU…...

vue3后台管理系统之layout组件的搭建

1.1静态布局 <template><div class"layout_container"><!-- 左侧导航 --><div class"layout_slider"></div><!-- 顶部导航 --><div class"layout_tabbar"></div><!-- 内容展示区 --><…...

Minio 文件上传(后端处理同文件判断,同一文件秒传)

记录minio 文件上传 MinIO提供多个语言版本SDK的支持&#xff0c;下边找到java版本的文档&#xff1a; 地址&#xff1a;https://docs.min.io/docs/java-client-quickstart-guide.html maven依赖如下&#xff1a; XML <dependency><groupId>io.minio</groupId…...