Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants