赞
踩
最近在做MTK Android 9.0 的投影项目,使用的是9269芯片,其中有一个功能是投影方位的设定,如正装正投、正装背投。但MTK目前软件架构上,数据耦合度还是很高,没有分离到数据分区,投影方位的设定耦合在/vendor/tvconfig/config/model/customer_1.ini文件中。而公版OTA又不支持差分升级,所以就想到了定制OTA包的方法,大致思路就是解压当前ZIP包,编辑,重新打包,签名。
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security$ls
adb media.pk8 mt5862_bga_1g-ota_update.zip platform.pk8 releasekey.pk8 shared.pk8 testkey.pk8 avb_keys media.x509.pem platform.x509.pem releasekey.x509.pem shared.x509.pem testkey.x509.pem
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security$
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security$mkdir ota_dir
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security$mv mt5862_bga_1g-ota_update.zip ota_dir/
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security/ota_dir$unzip mt5862_bga_1g-ota_update.zip
Archive: mt5862_bga_1g-ota_update.zip
signed by SignApk
extracting: META-INF/com/android/metadata
extracting: compatibility.zip
extracting: system.new.dat.br
extracting: system.patch.dat
extracting: vendor.new.dat.br
extracting: vendor.patch.dat
inflating: 3rd_a.img
inflating: 3rd_rw.img
inflating: FRC-R2.bin
inflating: META-INF/com/google/android/update-binary
inflating: META-INF/com/google/android/updater-script
inflating: RT_PM.bin
inflating: bl31.aes
inflating: boot.img
inflating: dtb.bin
inflating: factory_a.img
inflating: linux_rootfs_a.img
inflating: mboot.bin
inflating: rom_emmc_boot.bin
inflating: system.transfer.list
inflating: tee.aes
inflating: tvcertificate.img
inflating: tvconfig.img
inflating: tvservice.img
inflating: vendor.transfer.list
inflating: META-INF/com/android/otacert
builder@mm-android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security/ota_dir$
mv mt5862_bga_1g-ota_update.zip ../
目标:移除tvconfig文件,即OTA不升级此分区
package_extract_file("tvconfig.img", "/dev/block/platform/mstar_mci.0/by-name/tvconfig");
打开如下文件,后续重新签名后,签名文件要和此文件一致,否则OTA升级时候验证会失败
-----BEGIN CERTIFICATE-----
……省略……
XXXXXXXXXXXXXXXXXXXXXX/LfA==
-----END CERTIFICATE-----
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security$zip -qry update.unsigned.zip ota_dir/
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security$ls
adb media.x509.pem platform.pk8 releasekey.x509.pem testkey.pk8
avb_keys mt5862_bga_1g-ota_update.zip platform.x509.pem shared.pk8 testkey.x509.pem
media.pk8 ota_dir releasekey.pk8 shared.x509.pem update.unsigned.zip
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security$
builder@android(master):~/code/vendor/mediatek/proprietary_tv/open/common/security$java -Xmx512m -jar -Djava.library.path="/home/code/out/host/linux-x86/lib64/" /home/code/out/host/linux-x86/framework/signapk.jar -w releasekey.x509.pem releasekey.pk8 update.unsigned.zip update.signed.zip
-打开AOSP原生settings
关键的动作来袭……
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。