pxb1988 / dex2jar

Tools to work with android .dex and java .class files
Apache License 2.0
12.36k stars 2.12k forks source link

jar2dex min sdk version issue #603

Open misterti opened 1 year ago

misterti commented 1 year ago

I used dex2jar to get the jar, then immediately running jar2dex gives this error: defining a static interface method requires --min-sdk-version >= 24 (currently 13) Actually it's a set of warnings which eventually gives fatal error: Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow

What is this referring to?

ThexXTURBOXx commented 1 year ago

You need to run jar2dex with the following parameter: --min-sdk-version 24 (or some number bigger than 24). For the last exception, you need to provide more information, i.e., the complete stack trace. But first, please try running jar2dex with that parameter above

misterti commented 1 year ago

There is no jar2dex executable in the package, only d2j-jar2dex.bat/sh script, which doesn't accept this parameter

misterti commented 1 year ago

i found --sdk switch, i don't know how i missed it. There is no warning anymore, but the fatal error is still there. How do i go about it?

The stack that is currently output from the command is:

Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow

UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.RuntimeException: Translation has been interrupted at com.android.dx.command.dexer.Main.processAllFiles(Main.java:614) at com.android.dx.command.dexer.Main.runMonoDex(Main.java:310) at com.android.dx.command.dexer.Main.runDx(Main.java:288) at com.android.dx.command.dexer.Main.main(Main.java:244) at com.android.dx.command.Main.main(Main.java:95) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.googlecode.dex2jar.tools.Jar2Dex.doCommandLine(Jar2Dex.java:84) at com.googlecode.dex2jar.tools.BaseCmd.doMain(BaseCmd.java:297) at com.googlecode.dex2jar.tools.Jar2Dex.main(Jar2Dex.java:14) Caused by: java.lang.InterruptedException: Too many errors at com.android.dx.command.dexer.Main.processAllFiles(Main.java:606) ... 11 more

misterti commented 1 year ago

So i see now that i used ThexXTURBOXx/dex2jar v72 which is from your repository @ThexXTURBOXx. This one indeed supports --sdk switch, while this version does not. Should i open new issue at your repo?

google-mirror commented 2 months ago

java -Xms512m -Xmx2048m -cp "%CP%" com.android.dx.command.Main --dex --min-sdk-version=24 --no-strict

vramasam commented 1 month ago

Hello @misterti @ThexXTURBOXx

Can you please help here what is the potential reason for this issue. I used SNAPSHOT 2.2 , where I didn't face this issue, now trying to update latest 2.4 getting this error. Kindly provide valuable input.

MacBook-Pro dex2jar-2.0 % ./d2j-jar2dex.sh -msdk 26 -o /decompiled/classes.dex /tempFiles/temp72439770942451111143483395049041/outputJar17271700864936955404584632897090_merged.jar jar2dex /tempFiles/temp72439770942451111143483395049041/outputJar17271700864936955404584632897090_merged.jar -> /decompiled/classes.dex call com.android.dx.command.Main.main[--min-sdk-version=26, --dex, --no-strict, --output=/decompiled/classes.dex, /tempFiles/temp72439770942451111143483395049041/outputJar17271700864936955404584632897090_merged.jar] Uncaught translation error: com.android.dx.cf.code.SimException: stack: overflow 1 error; aborting MacBook-Pro dex2jar-2.0 %