编译升级包,差分包
- 编译升级包v0
source build/envsetup.sh
lunch 12
make -j16 otapackage
拷贝out/target/product/项目名/obj/PACKAGING/target_files_intermediates/目录下的zip包为version0.zip - 修改项目
- 编译升级包v1(类似步骤1)
- 编译差分包
build/tools/releasetools/ota_from_target_files -i version0.zip version1.zip update.zip
手动制作升级包(以升级logo.bin为例)
- 找一个同项目编译的差分包update.zip作为样本
- 删掉除(META-INF, type.txt, scatter.txt)以外的文件
- 修改/META-INF/com/google/android/updater-script的内容
ui_print("switch logo...");
show_progress(0.050000, 5);
ui_print("switch logo start...");
assert(package_extract_file("logo.bin", "/tmp/logo.bin"),
write_raw_image("/tmp/logo.bin", "logo"),
delete("/tmp/logo.bin"));
ui_print("switch logo end...");
show_progress(0.200000, 10); - 删除签名信息(META-INF目录下的三个文件)
- 添加logo.bin到update.zip的根目录
- 重新签名(注意1.在编译项目的环境下签名。注意2.参数-w是必须的)
java -jar out/host/linux-x86/framework/signapk.jar –w build/target/product/security/testkey.x509.pem build/target/product/security/testkey.pk8 update.zip signedupdate.zip
主要是留给自己看的,如有疑问请联系。
来源:oschina
链接:https://my.oschina.net/u/3085086/blog/795348