Android OTA相关资料地址

学习Android OTA相关

官方OTA文档

编译Android code

进入android 根目录

# first, build the target-files .zip
. build/envsetup.sh && lunch tardis-eng
mkdir dist_output
make dist DIST_DIR=dist_output #指定输出dist_output目录

Android 编译输出目录

android 编译生成的out目录结构剖析
Android out目录和linux启动Android流程

Androd ota package 生成

full package 目录
输出out/target/product/$(product_name)/obj/PACKAGING/target_files_intermediates/$(product_name)-target_files-eng.root.zip
make otapackage——会生成sd卡用的全部系统升级包,如
\out\target\product\slm753\obj\PACKAGING\target_files_intermediates\slm753-target_files-eng.Data.BU.zip
差分OTA 制作

$ ota_from_target_files.py  -i     Base.zip  New.zip  update.zip

在这里插入图片描述

Androd SW UPDATE LIFECYCLE

在这里插入图片描述

Android 下提供的工具

build/make/tools/releasetools$

add_img_to_target_files
Given a target-files zipfile that does not contain images (ie, does
not have an IMAGES/ top-level subdirectory), produce the images and
add them to the zipfile.

ota_from_target_files
Given a target-files zipfile, produces an OTA package that installs
that build. An incremental OTA is produced if -i is given, otherwise
a full OTA is produced.

build_image
Build image output_image_file from input_directory, properties_file, and target_out_dir

check_ota_package_signature
Verify a given OTA package with the specifed certificate.

check_target_file_signatures
Check the signatures of all APKs in a target_files .zip file. With
-c, compare the signatures of each package to the ones in a separate
target_files (usually a previously distributed build for the same
device) and flag any changes.

img_from_target_files
Given a target-files zipfile, produces an image zipfile suitable for
use with ‘fastboot update’.

Google在Android系统了提供了自己的二进制差分工具,bsdiff/bspatch,代码位于external/bsdiff目录下。
在Ubuntu系统上可以直接通过apt进行安装。
sudo apt-get install bsdiff
使用方法如下:
diff:
bsdiff oldfile newfile patch
patch:
bspatch oldfile newfile patch
虽然针对普通文件bsdiff/bspatch效率非常高。但对于一些压缩文件,由于压缩前内容非常小的变化会导致压缩后整个二进制文件产生非常巨大的变化,这样patch文件会非常大。如Android系统中常用的boot.img/recovery.img,本质上就是一块包含压缩和非压缩数据的二进制文件。
为了解决这个问题,Android也提供了imgdiff工具(bootable/recovery/applypatch)。在source文件中搜索压缩部分(0x1f8b0800),将其划分成多个小块
imgdiff工具使用

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值