dexexception: not support version
Asked Answered
D

3

24

I was trying to convert apk to source code. When I entered below command

./d2j-dex2jar.sh classes.dex

I got this exception:

com.googlecode.d2j.DexException: not support version.
at com.googlecode.d2j.reader.DexFileReader.<init>(DexFileReader.java:151)
at com.googlecode.d2j.reader.DexFileReader.<init>(DexFileReader.java:211)
at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Dex2jarCmd.java:104)
at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:288)
at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Dex2jarCmd.java:32)

Version of my apk is Oreo and dexcompiler is dex2jar-2.0. As much as I Know this dexcompiler supports upto N version (correct me if I am wrong). I have searched about this exception, but I didn't find any answers.

Please help me to resolve this exception

Dichromaticism answered 2/4, 2018 at 7:19 Comment(2)
Try filing an issue with dex2jar? It sounds like it just needs to be updated.Matheson
The author is not active any more. there are 11 pull request to merge and 375 issues.Acetylate
M
51

I had the same problem. Used the updated version. Now it works fine.

https://github.com/DexPatcher/dex2jar/releases/download/v2.1-20171001-lanchon/dex-tools-2.1-20171001-lanchon.zip

Momism answered 26/4, 2018 at 14:57 Comment(2)
Link is outdated, releases can be found at github.com/DexPatcher/dex2jar/releasesWhinny
Thank you @nijave, i would recomend anyone to always search for the latest to avoid errors.Hartill
B
2

(2021) get the dex2jar-2.1.zip from this link https://github.com/pxb1988/dex2jar/releases first enter this command d2j-dex2jar -h then run the second command d2j-dex2jar "yourapkfile" .

Basham answered 5/11, 2021 at 12:43 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Psychosocial
A
0

I me the same problem.

Use the link from @john will work under android 8.

However my device is android 10 ( this is quit common ) .

In my experience, just change the header content of dex file (039 -> 036 or other supported version) sometimes ok, sometimes failed. it depends your apk uses new Java grammar or so.

Acetylate answered 17/3, 2021 at 1:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.