Konloch / Konloch/bytecode-viewer
error after dex2jar - java.lang.StringIndexOutOfBoundsException:
- Dominant language
- Java
- Stars
- 15.6k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
The error appears during the dex2jar decompiling of the apk. Then it proceeds to show only partial decompiled code. Some classes are still not showing. Any suggestions?
https://the.bytecode.club - Created by @Konloch - Bytecode Viewer 2.9.22, Fat-Jar: true
Start up took 0 seconds
I: Using Apktool 2.3.0 on WYhdEGYwnGvNUsjsjfnQzjiPBsTgwUTY.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /root/.Bytecode-Viewer/bcv_temp/vehRXjxUsrFA/1.apk
I: Regular manifest package...
I: Decoding file-resources...
S: Could not decode file, replacing by FALSE value: font/gt_eesti_display_regular.ttf
S: Could not decode file, replacing by FALSE value: font/gt_eesti_display_bold.ttf
S: Could not decode file, replacing by FALSE value: font/gt_eesti_text_regular.ttf
S: Could not decode file, replacing by FALSE value: font/gt_eesti_text_bold.ttf
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling classes3.dex...
I: Baksmaling classes4.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...
dex2jar /root/.Bytecode-Viewer/bcv_temp/WYhdEGYwnGvNUsjsjfnQzjiPBsTgwUTY.apk -> ./WYhdEGYwnGvNUsjsjfnQzjiPBsTgwUTY-dex2jar.jar
java.lang.StringIndexOutOfBoundsException: begin 1, end -1, length 2
at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319)
at java.base/java.lang.String.substring(String.java:1874)
at org.a.a.b.a.a(Unknown Source)
at org.a.a.b.a.b(Unknown Source)
at org.a.a.a.b.mapSignature(Unknown Source)
at org.a.a.a.d.visitField(Unknown Source)
at org.a.a.f.visitField(Unknown Source)
at com.googlecode.d2j.dex.Dex2Asm.convertField(Unknown Source)
at com.googlecode.d2j.dex.Dex2Asm.convertClass(Unknown Source)
at com.googlecode.d2j.dex.Dex2Asm.convertDex(Unknown Source)
at com.googlecode.d2j.dex.Dex2jar.doTranslate(Unknown Source)
at com.googlecode.d2j.dex.Dex2jar.to(Unknown Source)
at com.googlecode.dex2jar.tools.Dex2jarCmd.doCommandLine(Unknown Source)
at com.googlecode.dex2jar.tools.BaseCmd.doMain(Unknown Source)
at com.googlecode.dex2jar.tools.Dex2jarCmd.main(Unknown Source)
at the.bytecode.club.bytecodeviewer.util.Dex2Jar.dex2Jar(Dex2Jar.java:54)
at the.bytecode.club.bytecodeviewer.BytecodeViewer$8.run(BytecodeViewer.java:957)
Contributor guide
Research direction
Start at Dex2Jar.java:54 and BytecodeViewer.java:957, then trace the dex2jar conversion reported in the stack trace. Reproduce the failure with the affected APK or a comparable multi-dex APK and inspect the failing field-signature path. Done means the conversion no longer aborts with StringIndexOutOfBoundsException and the missing classes are accounted for.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- mobile-dev, reverse-engineering
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100