Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for (MethodNode m : sourceNode.methods) {
- ListIterator<AbstractInsnNode> instructions = m.instructions.iterator();
- while (instructions.hasNext()) {
- AbstractInsnNode node = instructions.next();
- if (node instanceof MethodInsnNode) {
- MethodInsnNode call = (MethodInsnNode) node;
- if (call.owner.replace('/', '.').equals(data.source)) {
- call.owner = data.target.replace('.', '/');
- if (call.getOpcode() == INVOKEINTERFACE) {
- call.setOpcode(INVOKEVIRTUAL);
- call.itf = true;
- }
- }
- }
- }
- if (m.localVariables.size() > 0) {
- LocalVariableNode n = m.localVariables.get(0);
- if (n.name.equals("this")) {
- m.localVariables.get(0).desc = "L" + data.target.replace('.', '/') + ";";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment