Commit baa14e9d authored by Skylot's avatar Skylot

Handle super call processing error

parent 918e566c
...@@ -19,6 +19,7 @@ import jadx.dex.trycatch.ExcHandlerAttr; ...@@ -19,6 +19,7 @@ import jadx.dex.trycatch.ExcHandlerAttr;
import jadx.dex.trycatch.ExceptionHandler; import jadx.dex.trycatch.ExceptionHandler;
import jadx.dex.trycatch.TryCatchBlock; import jadx.dex.trycatch.TryCatchBlock;
import jadx.utils.BlockUtils; import jadx.utils.BlockUtils;
import jadx.utils.exceptions.JadxRuntimeException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -61,8 +62,9 @@ public class ModVisitor extends AbstractVisitor { ...@@ -61,8 +62,9 @@ public class ModVisitor extends AbstractVisitor {
MethodInfo callMth = inv.getCallMth(); MethodInfo callMth = inv.getCallMth();
if (callMth.isConstructor()) { if (callMth.isConstructor()) {
ConstructorInsn co = new ConstructorInsn(mth, inv); ConstructorInsn co = new ConstructorInsn(mth, inv);
// don't call 'super' if parent 'Object'
if (co.isSuper()) { if (co.isSuper()) {
try {
// don't call 'super' if parent 'Object'
if (!co.getClassType().getFullName().equals(Consts.CLASS_OBJECT)) { if (!co.getClassType().getFullName().equals(Consts.CLASS_OBJECT)) {
for (int j = 0; j < co.getArgsCount(); j++) { for (int j = 0; j < co.getArgsCount(); j++) {
InsnArg arg = co.getArg(j); InsnArg arg = co.getArg(j);
...@@ -74,6 +76,11 @@ public class ModVisitor extends AbstractVisitor { ...@@ -74,6 +76,11 @@ public class ModVisitor extends AbstractVisitor {
mth.setSuperCall(co); mth.setSuperCall(co);
} }
remover.add(insn); remover.add(insn);
} catch (JadxRuntimeException e) {
// inline args into super fail
LOG.warn("Can't inline args into super call: " + inv + ", mth: " + mth);
replaceInsn(block, i, co);
}
} else if (co.isThis() && co.getArgsCount() == 0) { } else if (co.isThis() && co.getArgsCount() == 0) {
MethodNode defCo = mth.getParentClass().searchMethodById(co.getCallMth().getShortId()); MethodNode defCo = mth.getParentClass().searchMethodById(co.getCallMth().getShortId());
if (defCo == null || defCo.isNoCode()) { if (defCo == null || defCo.isNoCode()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment