Fota包生成步骤
在Android系统编译(make)完成后,执行 make otapackage即可生成制作差分包所需的target package。
target包路径:android/out/target/product/msm_xxxx/target_files-package.zip
解压target_files-package.zip后,会看到一个ota_target_files.zip,这是制作Fota包需要的ota包。
Fota包是利用base版本(刷在手机中版本)ota_target_files.zip和目标版本的ota_target_files.zip进行制作的。
将base版本的ota_target_files.zip重命名为base.zip,目标版本的ota_target_files.zip重命名为target.zip,将base.zip复制到目标版本target_files-package.zip的解压目录,然后在该目录下执行Fota生成命令。
Fota生成命令:
使用testkey签名Fota包:
./build/tools/releasetools/ota_from_target_files -v --block -p out/host/linux-x86 -k build/target/product/security/testkey -i base.zip target.zip update.zip
使用releasekey签名Fota包:
./build/tools/releasetools/ota_from_target_files -v --block -p out/host/linux-x86 -k build/target/product/security/releasekey -i base.zip target.zip update.zip
对update包重新签名:
java -Xmx2048m -Djava.library.path=out/host/linux-x86/lib64 -jar out/host/linux-x86/framework/signapk.jar -w build/target/product/security/releasekey.x509.pem build/target/product/security/releasekey.pk8 update.zip update1.zip
Note:不同平台Fota包的生成命令可能存在差异。
问题
在Fota的生成过程中,我遇到过如下问题:
错误log:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/huangxiaobin/fota/0112/build/tools/releasetools/blockimgdiff.py", line 1535, in SplitLargeApks
src_name, tgt_name, imgdiff_output)
AssertionError: Failed to create imgdiff patch between //system/app/FactoryTest/FactoryTest.apk and //system/app/FactoryTest/FactoryTest.apk:
W/ziparchive(