/** * Generates the signature and checksum of the dex file {@code out} and * writes them to the file. */ public void writeHashes(DexBuffer dex) throws IOException { byte[] signature = computeSignature(dex); dex.open(SIGNATURE_OFFSET).write(signature); int checksum = computeChecksum(dex); dex.open(CHECKSUM_OFFSET).writeInt(checksum); } }