packing of boot.img with avbtool now supports property descriptors

now avbtool can pack exactly the same boot.img.signed as our Signer
if it has only prop-desc and hash-desc
pull/41/head
cfig 5 years ago
parent 40a31fd655
commit 75af56ad57
No known key found for this signature in database
GPG Key ID: B104C307F0FDABB7

@ -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())

Loading…
Cancel
Save