|
|
|
@ -36,13 +36,14 @@ class Signer {
|
|
|
|
|
val ai = ObjectMapper().readValue(File(Avb.getJsonFileName(cfg.info.output)), AVBInfo::class.java)
|
|
|
|
|
val alg = Algorithms.get(ai.header!!.algorithm_type.toInt())
|
|
|
|
|
val bootDesc = ai.auxBlob!!.hashDescriptors[0]
|
|
|
|
|
val newAvbInfo = ObjectMapper().readValue(File(getJsonFileName(cfg.info.output)), AVBInfo::class.java)
|
|
|
|
|
|
|
|
|
|
//our signer
|
|
|
|
|
File(cfg.info.output + ".clear").copyTo(File(cfg.info.output + ".signed"))
|
|
|
|
|
Avb().addHashFooter(cfg.info.output + ".signed",
|
|
|
|
|
info2.imageSize,
|
|
|
|
|
partition_name = bootDesc.partition_name,
|
|
|
|
|
newAvbInfo = ObjectMapper().readValue(File(getJsonFileName(cfg.info.output)), AVBInfo::class.java))
|
|
|
|
|
newAvbInfo = newAvbInfo)
|
|
|
|
|
//original signer
|
|
|
|
|
CommandLine.parse("$avbtool add_hash_footer").apply {
|
|
|
|
|
addArguments("--image ${cfg.info.output}.signed2")
|
|
|
|
@ -54,6 +55,11 @@ class Signer {
|
|
|
|
|
if (alg.defaultKey.isNotBlank()) {
|
|
|
|
|
addArguments("--key ${alg.defaultKey}")
|
|
|
|
|
}
|
|
|
|
|
newAvbInfo.auxBlob?.let { newAuxblob ->
|
|
|
|
|
newAuxblob.propertyDescriptor.forEach { newProp ->
|
|
|
|
|
addArguments(arrayOf("--prop", "${newProp.key}:${newProp.value}"))
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
addArgument("--internal_release_string")
|
|
|
|
|
addArgument(ai.header!!.release_string, false)
|
|
|
|
|
log.warn(this.toString())
|
|
|
|
|