FOTA OTA升级包制作方案:
./build/tools/releasetools/ota_from_target_files -k releasekey path -i 原始OTA包路径1 待升级OTA包路径2 生成的OTA包路径update.zip
FOTA OTA降级包制作方案
./build/tools/releasetools/ota_from_target_files --downgrade or --override_timestamp -k releasekey path -i 原始OTA包路径1 待降级OTA包路径2 生成的OTA包路径update.zip
-k releasekey 是编译android签名用文件
-i 参数带升级前后两个ota包
--downgrade
Intentionally generate an incremental OTA that updates from a newer
build to an older one (based on timestamp comparison). "post-timestamp"
will be replaced by "ota-downgrade=yes" in the metadata file. A data
wipe will always be enforced, so "ota-wipe=yes" will also be included in
the metadata file. The update-binary in the source build will be used in
the OTA package, unless --binary flag is specified. Please also check the
doc for --override_timestamp below.
--override_timestamp
Intentionally generate an incremental OTA that updates from a newer
build to an older one (based on timestamp comparison), by overriding the
timestamp in package metadata. This differs from --downgrade flag: we
know for sure this is NOT an actual downgrade case, but two builds are
cut in a reverse order. A legit use case is that we cut a new build C
(after having A and B), but want to enfore an update path of A -> C -> B.
Specifying --downgrade may not help since that would enforce a data wipe
for C -> B update. The value of "post-timestamp" will be set to the newer
timestamp plus one, so that the package can be pushed and applied.
--downgrade or --override_timestamp 参数错在差异简单一点:
--downgrade:data wipe will always be enforced, so "ota-wipe=yes" will also be included in the metadata file
所以--downgrade 会擦除整个data分区,最好不要用这个--downgrade。