ota添加升级校验文件实现

 

主要相关文件路径:

Workspace/rk3399/RK3399-JD4-Android7.1/build/core/Makefile

Workspace/rk3399/RK3399-JD4-Android7.1/build/tools/releasetools/ota_from_target_files.py

Workspace/rk3399/RK3399-JD4-Android7.1/device/rockchip/common/releasetools.py

 

1 在Workspace\rk3399\APK新增加校验文件nct_fac.ini,通过下面方式

修改:在rk3399_android7_1.sh中添加

export APP_MODEL=$APP_MODEL

#added by howard

gen_fac_ini

...

function gen_fac_ini()

{

echo -e "{\r\n\tProduct:${APP_MODEL}-B000\r\n}" > $BASEDIR/APK/${APP_MODEL}/nct_fac.ini

}

 

2 更改Workspace/rk3399/RK3399-JD4-Android7.1/build/core/Makefile

添加(说明,这里Makefile的./路径会定位到Workspace/rk3399/RK3399-JD4-Android7.1路径)

ifeq ($(INSTALLED_UBOOT_TARGET),)

$(info No uboot for uboot/uboot.img to otapackage)

else

$(hide) cp $(INSTALLED_UBOOT_TARGET) $(zip_root)/uboot.img

# howard

cp -rfvd ../APK/${APP_MODEL}/*.ini $(zip_root)/

@echo cp -rfvd ../APK/${APP_MODEL}/*.ini $(zip_root)/

@echo $(zip_root)

@echo pathssss: ../APK/${APP_MODEL}/.dat

endif

3 更改Workspace/rk3399/RK3399-JD4-Android7.1/device/rockchip/common/releasetools.py

(调用流程:Makefile-->ota_from_target_files.py-->releasetools.py)

+#howard added

+def InstallId(nct_fac_bin, input_zip, info):

+  common.ZipWriteStr(info.output_zip, "nct_fac.ini", nct_fac_bin)

+  info.script.Print("Writing nct_fac...")

+  info.script.WriteRawImage("/nct_fac", "nct_fac.ini")

+       

+#howard added

+  try:

+    nct_fac = info.input_zip.read("nct_fac.ini")

+    print "write nct_fac now..."

+    InstallId(nct_fac, info.input_zip, info)

+  except KeyError:

+    print "warning: no nct_fac.ini in input target_files; not flashing trust"

+#howard added

+  try:

+    nct_fac_target = info.target_zip.read("nct_fac.ini")

+  except KeyError:

+    nct_fac_target = None

+

+  try:

+    nct_fac_source = info.source_zip.read("nct_fac.ini")

+  except KeyError:

+    nct_fac_source = None

+  

+  if (nct_fac_target != None) and (nct_fac_target != nct_fac_source):

+    print "write nct_fac now..."

+    InstallTrust(nct_fac_target, info.target_zip, info)

+  else:

+    print "id unchanged; skipping"

 

4 在app中添加ReadZipFileContent.java文件,并通过接口读取升级校验文件

源文件资源包

https://download.csdn.net/download/yanhongfei268/17485172

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值