Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Update DEX file magic #52

Open
neomafo88 opened this issue Aug 16, 2022 · 1 comment
Open

Update DEX file magic #52

neomafo88 opened this issue Aug 16, 2022 · 1 comment

Comments

@neomafo88
Copy link

neomafo88 commented Aug 16, 2022

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;
}
@mihaip
Copy link
Owner

mihaip commented Aug 22, 2022

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants