Skip to content

Commit

Permalink
fix: show method alias in "method not decompiled" messages (#410)
Browse files Browse the repository at this point in the history
  • Loading branch information
donlon authored and skylot committed Jan 6, 2019
1 parent 1ac2cdf commit fd3498a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion jadx-core/src/main/java/jadx/core/codegen/MethodGen.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import java.util.List;

import com.android.dx.rop.code.AccessFlags;
import jadx.core.dex.info.ClassInfo;
import jadx.core.utils.Utils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -165,8 +167,16 @@ public void addInstructions(CodeWriter code) throws CodegenException {
addFallbackMethodCode(code);
code.startLine("*/");

ClassInfo clsAlias = mth.getParentClass().getAlias();

code.startLine("throw new UnsupportedOperationException(\"Method not decompiled: ")
.add(mth.toString())
.add(clsAlias.makeFullClsName(clsAlias.getShortName(), true))
.add(".")
.add(mth.getAlias())
.add("(")
.add(Utils.listToString(mth.getMethodInfo().getArgumentsTypes()))
.add("):")
.add(mth.getMethodInfo().getReturnType().toString())
.add("\");");
} else {
RegionGen regionGen = new RegionGen(this);
Expand Down

0 comments on commit fd3498a

Please sign in to comment.