From f1e229193c13c071befc9ac5d8df66c282414622 Mon Sep 17 00:00:00 2001 From: Skylot Date: Fri, 27 Dec 2019 17:02:23 +0300 Subject: [PATCH] fix: resolve exception on assign inline --- .../jadx/core/dex/visitors/shrink/CodeShrinkVisitor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jadx-core/src/main/java/jadx/core/dex/visitors/shrink/CodeShrinkVisitor.java b/jadx-core/src/main/java/jadx/core/dex/visitors/shrink/CodeShrinkVisitor.java index 0ab722a76fb..1cfb9d64326 100644 --- a/jadx-core/src/main/java/jadx/core/dex/visitors/shrink/CodeShrinkVisitor.java +++ b/jadx-core/src/main/java/jadx/core/dex/visitors/shrink/CodeShrinkVisitor.java @@ -130,7 +130,13 @@ private static void assignInline(MethodNode mth, RegisterArg arg, InsnNode assig return; } - InsnArg replaceArg = InsnArg.wrapArg(assignInsn.copy()); + InsnArg replaceArg; + InsnType assignInsnType = assignInsn.getType(); + if (assignInsnType == InsnType.MOVE || assignInsnType == InsnType.CONST) { + replaceArg = assignInsn.getArg(0).duplicate(); + } else { + replaceArg = InsnArg.wrapArg(assignInsn.copy()); + } useInsn.replaceArg(useArg, replaceArg); assignInsn.add(AFlag.REMOVE);