tterrag1098

Untitled

May 15th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. for (MethodNode m : sourceNode.methods) {
  2. ListIterator<AbstractInsnNode> instructions = m.instructions.iterator();
  3. while (instructions.hasNext()) {
  4. AbstractInsnNode node = instructions.next();
  5. if (node instanceof MethodInsnNode) {
  6. MethodInsnNode call = (MethodInsnNode) node;
  7. if (call.owner.replace('/', '.').equals(data.source)) {
  8. call.owner = data.target.replace('.', '/');
  9. if (call.getOpcode() == INVOKEINTERFACE) {
  10. call.setOpcode(INVOKEVIRTUAL);
  11. call.itf = true;
  12. }
  13. }
  14. }
  15. }
  16.  
  17. if (m.localVariables.size() > 0) {
  18. LocalVariableNode n = m.localVariables.get(0);
  19. if (n.name.equals("this")) {
  20. m.localVariables.get(0).desc = "L" + data.target.replace('.', '/') + ";";
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment