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

Bad dex magic dex #58

Closed
downright-ux opened this issue Oct 15, 2021 · 4 comments
Closed

Bad dex magic dex #58

downright-ux opened this issue Oct 15, 2021 · 4 comments

Comments

@downright-ux
Copy link

downright-ux commented Oct 15, 2021

Hi,
I'm getting the following issue when running with APK's

INFO Initializing Redex...
error: /tmp/mt-static-cnhs17k0/build/redex-master/libredex/DexLoader.cpp:49: void validate_dex_header(const dex_header*, size_t, int): assertion `supported' failed.
Bad dex magic dex
039 for support_dex_version 37

Any help here would be great.

Thanks

@Securee
Copy link

Securee commented Oct 19, 2021

I resolved this issued by:
1、set up the development environment
2、before re-compiled the redex, add dex version 39 support in the redex\libredex\DexLoader.cpp
static void validate_dex_header(const dex_header* dh,
size_t dexsize,
int support_dex_version) {
bool supported = false;
switch (support_dex_version) {
case 39:
supported = supported ||
!memcmp(dh->magic, DEX_HEADER_DEXMAGIC_V39, sizeof(dh->magic));

case 38:
supported = supported ||
!memcmp(dh->magic, DEX_HEADER_DEXMAGIC_V38, sizeof(dh->magic));

3、modify the default support dex version to 39 in the source/MarianaTrench.cpp
void MarianaTrench::run(const program_options::variables_map& variables) {
...
context.stores = init(
boost::join(system_jar_paths, ","),
options.apk_directory(),
options.dex_directory(),
/* balloon / true,
/
support_dex_version */ 39);
4、build the mariana-trench

@arthaud
Copy link
Contributor

arthaud commented Nov 1, 2021

Redex might not support version 39. Please open an issue at https://github.com/facebook/redex

@downright-ux
Copy link
Author

We were able to get that working, Thank you.

@firmianay
Copy link

I have the same problem, is there an update?

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

4 participants