-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
java.lang.IllegalArgumentException: newPosition > limit: (67079825 > 8454316) #1653
Comments
@janecms do you want to prepare a PR for that issue? PR is always welcome 🙂 |
how to resole?? |
@sulab999 @janecms The best way to resolve an issue that is caused by a certain DEX/APK files is providing the APK file. @janecms In your original post you wrote |
Hey there! any updates about this? |
I know this was closed for lack of info but am getting it with the coospo CoospoRide app (current app com.onecoder.coosporide v2.5.31 does as well as prior versions). Was trying to figure out how it talks to my ble hardware but nothing gets decoded. App can be had off the Play store or from apkpure https://apkpure.com/coosporide/com.onecoder.coosporide One example error message from one of the fragment classes, but this seems to happen with pretty much all the classes. `/* JADX WARN: Failed to parse debug info
|
@draekko Thanks for providing a sample app. Which Jadx version have you used when the posted error occurred? I wasn't able to reproduce your problem using Jadx 1.5.0 and also not with latest stable version decompiling |
I tried 1.5.0 release which i've been using since it was released and tried the latest unstable build this morning. Java says this openjdk 21.0.4 2024-07-16 Using it on latest Ubuntu 24.04.1 LTS |
hmmm seems to have a different hash as the one i extracted off the device which i got it via the play store using aurora store for v2.5.31. 7a14391791d3d9666bc784083dabd109f1a3aa8f |
Same issue with the one from apkpure version locally, same has from the version i downloaded there. when i open up com.onecoder.coosporide.main.ChartFragment i get this for one example. package com.onecoder.coosporide.main;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.fragment.app.Fragment;
import com.onecoder.coosporide.databinding.ChartFragmentBinding;
import kotlin.Deprecated;
import kotlin.Metadata;
import kotlin.jvm.internal.DefaultConstructorMarker;
/* compiled from: ChartFragment.kt */
@Metadata(d1 = {"\u0000@\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0007\u0018\u0000 \u00142\u00020\u0001:\u0001\u0014B\u0005\u00a2\u0006\u0002\u0010\u0002J\u0016\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\b2\u0006\u0010\t\u001a\u00020\bJ\u0012\u0010\n\u001a\u00020\u000b2\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0017J&\u0010\u000e\u001a\u0004\u0018\u00010\u000f2\u0006\u0010\u0010\u001a\u00020\u00112\b\u0010\u0012\u001a\u0004\u0018\u00010\u00132\b\u0010\f\u001a\u0004\u0018\u00010\rH\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082.\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0015"}, d2 = {"Lcom/onecoder/coosporide/main/ChartFragment;", "Landroidx/fragment/app/Fragment;", "()V", "binding", "Lcom/onecoder/coosporide/databinding/ChartFragmentBinding;", "createCircleGradientDrawable", "Landroid/graphics/drawable/Drawable;", "startColor", "", "endColor", "onActivityCreated", "", "savedInstanceState", "Landroid/os/Bundle;", "onCreateView", "Landroid/view/View;", "inflater", "Landroid/view/LayoutInflater;", "container", "Landroid/view/ViewGroup;", "Companion", "app_prdRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
/* loaded from: classes6.dex */
public final class ChartFragment extends Fragment {
private ChartFragmentBinding binding;
/* renamed from: Companion, reason: from kotlin metadata */
public static final Companion INSTANCE = new Companion(null);
public static final int $stable = 8;
/* compiled from: ChartFragment.kt */
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002\u00a2\u0006\u0002\u0010\u0002J\u0006\u0010\u0003\u001a\u00020\u0004\u00a8\u0006\u0005"}, d2 = {"Lcom/onecoder/coosporide/main/ChartFragment$Companion;", "", "()V", "newInstance", "Lcom/onecoder/coosporide/main/ChartFragment;", "app_prdRelease"}, k = 1, mv = {1, 9, 0}, xi = 48)
/* loaded from: classes6.dex */
public static final class Companion {
/* JADX WARN: Failed to parse debug info
java.lang.IllegalArgumentException: newPosition > limit: (67042716 > 8843904)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:318)
at java.base/java.nio.Buffer.position(Buffer.java:293)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1094)
at jadx.plugins.input.dex.sections.SectionReader.absPos(SectionReader.java:82)
at jadx.plugins.input.dex.sections.debuginfo.DebugInfoParser.process(DebugInfoParser.java:84)
at jadx.plugins.input.dex.sections.DexCodeReader.getDebugInfo(DexCodeReader.java:118)
at jadx.core.dex.nodes.MethodNode.getDebugInfo(MethodNode.java:626)
at jadx.core.dex.visitors.debuginfo.DebugInfoAttachVisitor.visit(DebugInfoAttachVisitor.java:39)
*/
private Companion() {
}
/* JADX WARN: Failed to parse debug info
java.lang.IllegalArgumentException: newPosition > limit: (67042715 > 8843904)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:318)
at java.base/java.nio.Buffer.position(Buffer.java:293)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1094)
at jadx.plugins.input.dex.sections.SectionReader.absPos(SectionReader.java:82)
at jadx.plugins.input.dex.sections.debuginfo.DebugInfoParser.process(DebugInfoParser.java:84)
at jadx.plugins.input.dex.sections.DexCodeReader.getDebugInfo(DexCodeReader.java:118)
at jadx.core.dex.nodes.MethodNode.getDebugInfo(MethodNode.java:626)
at jadx.core.dex.visitors.debuginfo.DebugInfoAttachVisitor.visit(DebugInfoAttachVisitor.java:39)
*/
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
}
/* JADX WARN: Failed to parse debug info
java.lang.IllegalArgumentException: newPosition > limit: (67042714 > 8843904)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:318)
at java.base/java.nio.Buffer.position(Buffer.java:293)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1094)
at jadx.plugins.input.dex.sections.SectionReader.absPos(SectionReader.java:82)
at jadx.plugins.input.dex.sections.debuginfo.DebugInfoParser.process(DebugInfoParser.java:84)
at jadx.plugins.input.dex.sections.DexCodeReader.getDebugInfo(DexCodeReader.java:118)
at jadx.core.dex.nodes.MethodNode.getDebugInfo(MethodNode.java:626)
at jadx.core.dex.visitors.debuginfo.DebugInfoAttachVisitor.visit(DebugInfoAttachVisitor.java:39)
*/
public final ChartFragment newInstance() {
return null;
}
}
/* JADX WARN: Failed to parse debug info
java.lang.IllegalArgumentException: newPosition > limit: (67042710 > 8843904)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:318)
at java.base/java.nio.Buffer.position(Buffer.java:293)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1094)
at jadx.plugins.input.dex.sections.SectionReader.absPos(SectionReader.java:82)
at jadx.plugins.input.dex.sections.debuginfo.DebugInfoParser.process(DebugInfoParser.java:84)
at jadx.plugins.input.dex.sections.DexCodeReader.getDebugInfo(DexCodeReader.java:118)
at jadx.core.dex.nodes.MethodNode.getDebugInfo(MethodNode.java:626)
at jadx.core.dex.visitors.debuginfo.DebugInfoAttachVisitor.visit(DebugInfoAttachVisitor.java:39)
*/
public final Drawable createCircleGradientDrawable(int startColor, int endColor) {
return null;
}
/* JADX WARN: Failed to parse debug info
java.lang.IllegalArgumentException: newPosition > limit: (67042709 > 8843904)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:318)
at java.base/java.nio.Buffer.position(Buffer.java:293)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1094)
at jadx.plugins.input.dex.sections.SectionReader.absPos(SectionReader.java:82)
at jadx.plugins.input.dex.sections.debuginfo.DebugInfoParser.process(DebugInfoParser.java:84)
at jadx.plugins.input.dex.sections.DexCodeReader.getDebugInfo(DexCodeReader.java:118)
at jadx.core.dex.nodes.MethodNode.getDebugInfo(MethodNode.java:626)
at jadx.core.dex.visitors.debuginfo.DebugInfoAttachVisitor.visit(DebugInfoAttachVisitor.java:39)
*/
@Override // androidx.fragment.app.Fragment
@Deprecated(message = "Deprecated in Java")
public void onActivityCreated(Bundle savedInstanceState) {
}
/* JADX WARN: Failed to parse debug info
java.lang.IllegalArgumentException: newPosition > limit: (67042708 > 8843904)
at java.base/java.nio.Buffer.createPositionException(Buffer.java:318)
at java.base/java.nio.Buffer.position(Buffer.java:293)
at java.base/java.nio.ByteBuffer.position(ByteBuffer.java:1094)
at jadx.plugins.input.dex.sections.SectionReader.absPos(SectionReader.java:82)
at jadx.plugins.input.dex.sections.debuginfo.DebugInfoParser.process(DebugInfoParser.java:84)
at jadx.plugins.input.dex.sections.DexCodeReader.getDebugInfo(DexCodeReader.java:118)
at jadx.core.dex.nodes.MethodNode.getDebugInfo(MethodNode.java:626)
at jadx.core.dex.visitors.debuginfo.DebugInfoAttachVisitor.visit(DebugInfoAttachVisitor.java:39)
*/
@Override // androidx.fragment.app.Fragment
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
return null;
}
} |
Does jadx use JAVA_HOME or does it use the default path for the jdk? Edit: nevermind i figured out it does :) I just tried 11, 17, and 21 for openjdk java version, same results. |
Verified - com.onecoder.coosporide.main.ChartFragment causes multiple errors like java.lang.IllegalArgumentException: newPosition > limit: (67042709 > 8843904) in APK CoospoRide_2.5.31_APKPure.apk (SHA-1 hash 9F8D9CFED84E2514EBE644235B289E26A914C41D) from https://apkpure.com/coosporide/com.onecoder.coosporide Tested with latest unstable Jadx-gui version. |
As far as i can tell all the classes under com.onecoder.coosporide.* seem to be having the issue. |
@draekko, @jpstotz thanks for sample and issue confirm This issue caused by incorrect debug info offset in dex method code section.
So I also commit a similar check and now instead of error with stacktrace, simple warning is added: /* JADX WARN: Invalid debug info offset */
public final Drawable createCircleGradientDrawable(int startColor, int endColor) {
return null;
} Funny that here argument names comes from Kotlin metadata, which are not removed 🤣 |
Just tried apktool and all the smali code is nop'ed out as jackpwa mentioned, any suggestions on how i might go about to retrieve the code? Thanks in advance |
@draekko looks like this is not possible using only static analysis tools like jadx, so you also need a dynamic/runtime tool like frida to catch dex files restored/decrypted at runtime. ApkId report that this apk uses |
Thanks for the suggestion, will look into them. |
version 1.4.4
The Error info
/* JADX WARN: Failed to parse debug info
java.lang.IllegalArgumentException: newPosition > limit: (67079825 > 8454316)
at java.base/java.nio.Buffer.createPositionException(Unknown Source)
at java.base/java.nio.Buffer.position(Unknown Source)
at java.base/java.nio.ByteBuffer.position(Unknown Source)
at jadx.plugins.input.dex.sections.SectionReader.absPos(SectionReader.java:82)
at jadx.plugins.input.dex.sections.debuginfo.DebugInfoParser.process(DebugInfoParser.java:84)
at jadx.plugins.input.dex.sections.DexCodeReader.getDebugInfo(DexCodeReader.java:118)
at jadx.core.dex.nodes.MethodNode.getDebugInfo(MethodNode.java:564)
at jadx.core.dex.visitors.debuginfo.DebugInfoAttachVisitor.visit(DebugInfoAttachVisitor.java:39)
*/
Now, I think how to resole this question.
Thanks
The text was updated successfully, but these errors were encountered: