Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Jadx does not load all classes (IndexOutOfBoundsException) #763

Closed
jpstotz opened this issue Oct 15, 2019 · 5 comments
Closed

[core] Jadx does not load all classes (IndexOutOfBoundsException) #763

jpstotz opened this issue Oct 15, 2019 · 5 comments
Labels
bug Core Issues in jadx-core module

Comments

@jpstotz
Copy link
Collaborator

jpstotz commented Oct 15, 2019

When loading apk of com.whatsapp 2.19.274 (452992) not all classes within the package X are loaded (and are therefore missing in the class tree). There is an exception which silently stops the loading process:

jadx.core.utils.exceptions.JadxRuntimeException: Error decode class: X.1cX
	at jadx.core.dex.nodes.ClassNode.<init>(ClassNode.java:126)
	at jadx.core.dex.nodes.DexNode.loadClasses(DexNode.java:58)
	at jadx.core.dex.nodes.RootNode.load(RootNode.java:85)
	at jadx.api.JadxDecompiler.load(JadxDecompiler.java:91)
	at jadx.gui.JadxWrapper.openFile(JadxWrapper.java:42)
	at jadx.gui.ui.MainWindow.open(MainWindow.java:281)
	at jadx.gui.ui.MainWindow.processCommandLineArgs(MainWindow.java:164)
	at jadx.gui.ui.MainWindow.init(MainWindow.java:157)
	at java.desktop/java.awt.event.InvocationEvent.dispatch$$$capture(InvocationEvent.java:313)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
	at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
	at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
	at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
	at java.base/java.util.Objects.checkIndex(Objects.java:372)
	at java.base/java.util.ArrayList.get(ArrayList.java:458)
	at java.base/java.util.Collections$UnmodifiableList.get(Collections.java:1310)
	at jadx.core.dex.nodes.MethodNode.parseSignature(MethodNode.java:211)
	at jadx.core.dex.nodes.MethodNode.initMethodTypes(MethodNode.java:177)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at jadx.core.dex.nodes.ClassNode.<init>(ClassNode.java:116)
	... 21 common frames omitted
@skylot
Copy link
Owner

skylot commented Oct 17, 2019

Fixed. Actually many methods in this app have a signature with an incorrect number of arguments. So, for now, I just ignore them.

@skylot skylot closed this as completed Oct 17, 2019
@jpstotz
Copy link
Collaborator Author

jpstotz commented Oct 17, 2019

@skylot Thank you for the fixes. I have a short question on the current master: I am using IntelliJ to develop Jadx, but when loading the current master IntelliJ shows an error on line 1:
import com.diffplug.spotless.LineEnding
in build.gradle. I don't know if this is a problem of my project configuration or a bug in IntelliJ. Are you aware of any problems regarding this import line?

@skylot
Copy link
Owner

skylot commented Oct 17, 2019

@jpstotz I also see this error but everything is work, so I think this is IntelliJ issue. In my experience IntelliJ always highlight something in gradle files, and different versions has different problems.
Also these issues force me to use Kotlin script (build.gradle.kts) in all new projects and I like it, much better than groovy :)

@jpstotz
Copy link
Collaborator Author

jpstotz commented Oct 17, 2019

@skylot Strange on my installation in this case other errors prevent me from building the project. But I found a workaround: move the import line directly before the spotless { section, or remove it and use the fully qualified notation: com.diffplug.spotless.LineEnding.UNIX instead. In both ways IntelliJ is satisfied.

@skylot
Copy link
Owner

skylot commented Oct 17, 2019

@jpstotz I think a fully qualified name is the best option. Can you make a PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

2 participants