dex2jar icon indicating copy to clipboard operation
dex2jar copied to clipboard

Does dex2jar support multidex?

Open adipascu opened this issue 8 years ago • 13 comments

adipascu avatar Feb 29 '16 23:02 adipascu

dex2jar when given an apk as an input is only converting the classes.dex file into a jar, ignoring classes2.dex . Is there an option i can specify to make it convert all the .dex files in the apk into a single jar?

pradyukrish avatar Mar 03 '16 13:03 pradyukrish

You could dex2jar all the dex files manually and then merge the resulting jar files.

adipascu avatar Mar 03 '16 17:03 adipascu

@adi1133 as of 52f26c63f0ee3746373de069ca25004f47c32a89 you can directly run dex2jar on an apk with multidex support. all classes*.dex are convert to a single jar file.

d2j-dex2jar.sh the-apk-witch-mutidex.apk

pxb1988 avatar Mar 04 '16 08:03 pxb1988

It does not work for multiple dex apk

alading avatar Feb 17 '17 21:02 alading

jar2dex does not directly support multi-dex.

DulingLai avatar Aug 03 '17 01:08 DulingLai

FYI: This is the version that supports multi-dex https://github.com/pxb1988/dex2jar/releases/tag/2.1-nightly-26

I had to bump the JVM -Xms and -Xmx args (because I kept getting an OutOfMemoryError) by changing this line in d2j-dex2jar.sh:

java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Dex2jarCmd" "$@"

to this:

java -Xms1024m -Xmx3072m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Dex2jarCmd" "$@"

chutchut avatar Sep 22 '17 23:09 chutchut

as pxb1988 said (the effing author of dex2jar, he should know!), dex2jar supports multidex. those that thought otherwise were simply using outdated builds.

you can try my builds, they are much more recent: https://github.com/Lanchon/dex2jar/releases

Lanchon avatar Sep 23 '17 01:09 Lanchon

Are there plans to do a stable release of version 2.1? It would be great to get the multidex support into a stable build!

daj avatar Dec 19 '18 15:12 daj

why, would it make you sleep better? the problem is not lack of "stable" builds, which wont ever happen, but the lack of any official builds at all. dex2jar seems to be mostly abandon-ware. see note on my latest unofficial build here: https://github.com/DexPatcher/dex2jar/releases

Lanchon avatar Dec 19 '18 19:12 Lanchon

what is the command to run for multi dex

lordokeson avatar Apr 21 '20 13:04 lordokeson

@lordokeson

Download this build Change into file d2j-dex2jar.sh this line:

java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Dex2jarCmd" "$@"

to

java -Xms2048m -Xmx4096m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Dex2jarCmd" "$@"

and run command: d2j-dex2jar.sh some.apk

if you used windows then run: d2j-dex2jar.bat some.apk

m4xp1 avatar May 05 '20 08:05 m4xp1

thank you @m4xp1 for your reply, I am trying what you say but got this warning (WARN: ignored invalid inner class name , treat as anonymous inner class.) 3 times because I have four files .dex (and I have the impression that it only takes the first classes.dex)

Do you have a solution ?

thanks in advance

JeremyNoh avatar Aug 23 '21 21:08 JeremyNoh

I have the impression that it only takes the first classes.dex

wrong

Lanchon avatar Aug 24 '21 04:08 Lanchon