主要相关文件路径:
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