diff --git a/bbootimg/src/main/kotlin/Signer.kt b/bbootimg/src/main/kotlin/Signer.kt index e705329..7634856 100644 --- a/bbootimg/src/main/kotlin/Signer.kt +++ b/bbootimg/src/main/kotlin/Signer.kt @@ -62,7 +62,7 @@ class Signer { } addArgument("--internal_release_string") addArgument(ai.header!!.release_string, false) - log.warn(this.toString()) + log.info(this.toString()) File(cfg.info.output + ".clear").copyTo(File(cfg.info.output + ".signed2")) DefaultExecutor().execute(this) diff --git a/bbootimg/src/main/kotlin/avb/desc/HashDescriptor.kt b/bbootimg/src/main/kotlin/avb/desc/HashDescriptor.kt index abcd3cd..33db39c 100644 --- a/bbootimg/src/main/kotlin/avb/desc/HashDescriptor.kt +++ b/bbootimg/src/main/kotlin/avb/desc/HashDescriptor.kt @@ -23,13 +23,11 @@ class HashDescriptor(var flags: UInt = 0U, : Descriptor(TAG, 0U, 0) { var flagsInterpretation: String = "" get() { - var ret = "" - if (this.flags and Header.HashDescriptorFlags.AVB_HASH_DESCRIPTOR_FLAGS_DO_NOT_USE_AB.inFlags.toUInt() == 1U) { - ret += "1:no-A/B system" + return if (this.flags and Header.HashDescriptorFlags.AVB_HASH_DESCRIPTOR_FLAGS_DO_NOT_USE_AB.inFlags.toUInt() == 1U) { + "1:no-A/B system" } else { - ret += "0:A/B system" + "0:A/B system" } - return ret } constructor(data: InputStream, seq: Int = 0) : this() { @@ -90,6 +88,7 @@ class HashDescriptor(var flags: UInt = 0U, it.read(randomSalt) log.warn("salt is empty, using random salt[$expectedDigestSize]: " + Helper.toHexString(randomSalt)) this.salt = randomSalt + this.salt_len = this.salt.size.toUInt() } } else { log.info("preset salt[${this.salt.size}] is valid: ${Hex.encodeHexString(this.salt)}") @@ -113,6 +112,7 @@ class HashDescriptor(var flags: UInt = 0U, }.digest() log.info("Digest(salt + file): " + Helper.toHexString(newDigest)) this.digest = newDigest + this.digest_len = this.digest.size.toUInt() } return this diff --git a/bbootimg/src/main/kotlin/bootimg/Packer.kt b/bbootimg/src/main/kotlin/bootimg/Packer.kt index 22dd563..a18de02 100644 --- a/bbootimg/src/main/kotlin/bootimg/Packer.kt +++ b/bbootimg/src/main/kotlin/bootimg/Packer.kt @@ -156,7 +156,7 @@ class Packer { val googleCmd = info2.toCommandLine().apply { addArgument(cfg.info.output + ".google") } - log.warn(googleCmd.toString()) + log.info(googleCmd.toString()) DefaultExecutor().execute(googleCmd) val ourHash = hashFileAndSize(cfg.info.output + ".clear") diff --git a/doc/additional_tricks.md b/doc/additional_tricks.md index 7be4ee2..ddd69c2 100644 --- a/doc/additional_tricks.md +++ b/doc/additional_tricks.md @@ -58,3 +58,7 @@ This part is contributed by @Surendrajat, thanks! #### libsparse: output\_file.cpp *typeof* is missing in macos clang++, need to change it to *decltype* instead. + +## using pre-packed ramdisk.img.gz +place 'ramdisk.img.gz' in directory, delete "root/", program will use it as prebuilt. + diff --git a/integrationTest.py b/integrationTest.py index be034bf..3be0b26 100755 --- a/integrationTest.py +++ b/integrationTest.py @@ -72,6 +72,12 @@ def verifySingleDir(inResourceDir, inImageDir): cleanUp() verifySingleJson(jsonFile) cleanUp() + pyFiles = glob.glob(os.path.join(resDir, imgDir) + "/*.py") + for pyFile in pyFiles: + cleanUp() + log.warning("calling %s" % pyFile) + subprocess.check_call(pyFile, shell = True) + cleanUp() def decompressXZ(inFile, outFile): with lzma.open(inFile) as f: @@ -102,6 +108,9 @@ def main(): # from volunteers verifySingleDir(resDir, "recovery_image_from_s-trace") + # 10 + verifySingleDir(resDir, "10.0.0_coral-qq1d.200205.002") + log.info(successLogo) if __name__ == "__main__": diff --git a/src/integrationTest/resources b/src/integrationTest/resources index 2b95308..b38a8c9 160000 --- a/src/integrationTest/resources +++ b/src/integrationTest/resources @@ -1 +1 @@ -Subproject commit 2b95308b91c2c0a564451b744354b2ef1428311d +Subproject commit b38a8c9e9763aefa1584e80b866efb0173cae04b