dex-method-counts icon indicating copy to clipboard operation
dex-method-counts copied to clipboard

Update DEX file magic

Open neomafo88 opened this issue 3 years ago • 1 comments

https://github.com/mihaip/dex-method-counts/blob/master/src/com/android/dexdeps/DexData.java#L571-L572

static class HeaderItem {
  public static final byte[] DEX_FILE_MAGIC = { 0x64, 0x65, 0x78, 0x0a, 0x30, 0x33 }; // , 0x??, 0x00 };
}

private static boolean verifyMagic(byte[] magic) {
  return Arrays.equals(Arrays.copyOfRange(magic,0,HeaderItem.DEX_FILE_MAGIC.length), HeaderItem.DEX_FILE_MAGIC)
  && magic[HeaderItem.DEX_FILE_MAGIC.length] >= 0x30
  && magic[HeaderItem.DEX_FILE_MAGIC.length+1] == 0x00;
}

neomafo88 avatar Aug 16 '22 05:08 neomafo88

Guessing you're asking for the magic values to be updated with more recent versions. https://android.googlesource.com/platform/dalvik.git/+/67b37246c3edd037abc4b4af7e616e335aa64544/tools/dexdeps/src/com/android/dexdeps/DexData.java#547 has the complete list.

I'm no longer using or maintaining this tool, but if you would like to submit a PR with the updates, I'm happy to review it.

mihaip avatar Aug 22 '22 04:08 mihaip