Commit d0aa1911 authored by Skylot's avatar Skylot

core: fix comodification exception

parent 039f6eeb
...@@ -21,7 +21,6 @@ import jadx.core.dex.nodes.MethodNode; ...@@ -21,7 +21,6 @@ import jadx.core.dex.nodes.MethodNode;
import jadx.core.utils.InstructionRemover; import jadx.core.utils.InstructionRemover;
import jadx.core.utils.exceptions.JadxException; import jadx.core.utils.exceptions.JadxException;
import java.util.Iterator;
import java.util.List; import java.util.List;
public class ClassModifier extends AbstractVisitor { public class ClassModifier extends AbstractVisitor {
...@@ -114,16 +113,13 @@ public class ClassModifier extends AbstractVisitor { ...@@ -114,16 +113,13 @@ public class ClassModifier extends AbstractVisitor {
} }
private static void removeSyntheticMethods(ClassNode cls) { private static void removeSyntheticMethods(ClassNode cls) {
for (Iterator<MethodNode> it = cls.getMethods().iterator(); it.hasNext(); ) { for (MethodNode mth : cls.getMethods()) {
MethodNode mth = it.next();
AccessInfo af = mth.getAccessFlags(); AccessInfo af = mth.getAccessFlags();
// remove bridge methods // remove bridge methods
if (af.isBridge() && af.isSynthetic() && !isMethodUniq(cls, mth)) { if (af.isBridge() && af.isSynthetic() && !isMethodUniq(cls, mth)) {
// TODO add more checks before method deletion // TODO add more checks before method deletion
it.remove(); mth.getAttributes().add(AttributeFlag.DONT_GENERATE);
} }
// remove synthetic constructor for inner non-static classes // remove synthetic constructor for inner non-static classes
if (af.isSynthetic() && af.isConstructor() && mth.getBasicBlocks().size() == 2) { if (af.isSynthetic() && af.isConstructor() && mth.getBasicBlocks().size() == 2) {
List<InsnNode> insns = mth.getBasicBlocks().get(0).getInstructions(); List<InsnNode> insns = mth.getBasicBlocks().get(0).getInstructions();
......
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