public void writeHeader(Dex.Section out) throws IOException { out.write(DexFormat.apiToMagic(DexFormat.API_NO_EXTENDED_OPCODES).getBytes("UTF-8")); out.writeInt(checksum); out.write(signature); out.writeInt(fileSize); out.writeInt(SizeOf.HEADER_ITEM); out.writeInt(DexFormat.ENDIAN_TAG); out.writeInt(linkSize); out.writeInt(linkOff); out.writeInt(mapList.off); out.writeInt(stringIds.size); out.writeInt((stringIds.exists() ? stringIds.off : 0)); out.writeInt(typeIds.size); out.writeInt((typeIds.exists() ? typeIds.off : 0)); out.writeInt(protoIds.size); out.writeInt((protoIds.exists() ? protoIds.off : 0)); out.writeInt(fieldIds.size); out.writeInt((fieldIds.exists() ? fieldIds.off : 0)); out.writeInt(methodIds.size); out.writeInt((methodIds.exists() ? methodIds.off : 0)); out.writeInt(classDefs.size); out.writeInt((classDefs.exists() ? classDefs.off : 0)); out.writeInt(dataSize); out.writeInt(dataOff); }
public void writeHeader(Dex.Section out) throws IOException { out.write(DexFormat.apiToMagic(DexFormat.API_NO_EXTENDED_OPCODES).getBytes("UTF-8")); out.writeInt(checksum); out.write(signature); out.writeInt(fileSize); out.writeInt(SizeOf.HEADER_ITEM); out.writeInt(DexFormat.ENDIAN_TAG); out.writeInt(linkSize); out.writeInt(linkOff); out.writeInt(mapList.off); out.writeInt(stringIds.size); out.writeInt((stringIds.exists() ? stringIds.off : 0)); out.writeInt(typeIds.size); out.writeInt((typeIds.exists() ? typeIds.off : 0)); out.writeInt(protoIds.size); out.writeInt((protoIds.exists() ? protoIds.off : 0)); out.writeInt(fieldIds.size); out.writeInt((fieldIds.exists() ? fieldIds.off : 0)); out.writeInt(methodIds.size); out.writeInt((methodIds.exists() ? methodIds.off : 0)); out.writeInt(classDefs.size); out.writeInt((classDefs.exists() ? classDefs.off : 0)); out.writeInt(dataSize); out.writeInt(dataOff); }
/** * Generates the signature and checksum of the dex file {@code out} and * writes them to the file. */ public void writeHashes() throws IOException { openSection(SIGNATURE_OFFSET).write(computeSignature(true)); openSection(CHECKSUM_OFFSET).writeInt(computeChecksum()); }
/** * Generates the signature and checksum of the dex file {@code out} and * writes them to the file. */ public void writeHashes() throws IOException { openSection(SIGNATURE_OFFSET).write(computeSignature(true)); openSection(CHECKSUM_OFFSET).writeInt(computeChecksum()); }