dex2jar
dex2jar copied to clipboard
Does dex2jar support multidex?
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?
You could dex2jar all the dex files manually and then merge the resulting jar files.
@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
It does not work for multiple dex apk
jar2dex does not directly support multi-dex.
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" "$@"
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
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!
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
what is the command to run for multi dex
@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
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
I have the impression that it only takes the first classes.dex
wrong