@Test public void testRun() { UnusedMethods um = new UnusedMethods(); um.run(group); }
@Override public void run(ClassGroup group) { for (ClassFile cf : group.getClasses()) { for (Method method : cf.getMethods()) { run(method); } } int count = 0; for (ClassFile cf : group.getClasses()) { boolean extendsApplet = extendsApplet(cf); for (Method method : new ArrayList<>(cf.getMethods())) { if (!Deob.isObfuscated(method.getName()) && !method.getName().equals("<init>")) { continue; } if (extendsApplet && method.getName().equals("<init>")) { continue; } if (!methods.contains(method)) { logger.debug("Removing unused method {}", method); cf.removeMethod(method); ++count; } } } logger.info("Removed {} methods", count); }
UnusedMethods implements Deobfuscator { @Override public void run(ClassGroup group) { for (ClassFile cf : group.getClasses()) { for (Method method : cf.getMethods()) { run(method); } } int count = 0; for (ClassFile cf : group.getClasses()) { boolean extendsApplet = extendsApplet(cf); for (Method method : new ArrayList<>(cf.getMethods())) { if (!Deob.isObfuscated(method.getName()) && !method.getName().equals("<init>")) { continue; } if (extendsApplet && method.getName().equals("<init>")) { continue; } if (!methods.contains(method)) { logger.debug("Removing unused method {}", method); cf.removeMethod(method); ++count; } } } logger.info("Removed {} methods", count); } }
UnusedMethods implements Deobfuscator { @Override public void run(ClassGroup group) { for (ClassFile cf : group.getClasses()) { for (Method method : cf.getMethods()) { run(method); } } int count = 0; for (ClassFile cf : group.getClasses()) { boolean extendsApplet = extendsApplet(cf); for (Method method : new ArrayList<>(cf.getMethods())) { if (!Deob.isObfuscated(method.getName()) && !method.getName().equals("<init>")) { continue; } if (extendsApplet && method.getName().equals("<init>")) { continue; } if (!methods.contains(method)) { logger.debug("Removing unused method {}", method); cf.removeMethod(method); ++count; } } } logger.info("Removed {} methods", count); }  }
UnusedMethods implements Deobfuscator { @Override public void run(ClassGroup group) { for (ClassFile cf : group.getClasses()) { for (Method method : cf.getMethods()) { run(method); } } int count = 0; for (ClassFile cf : group.getClasses()) { boolean extendsApplet = extendsApplet(cf); for (Method method : new ArrayList<>(cf.getMethods())) { if (!Deob.isObfuscated(method.getName()) && !method.getName().equals("<init>")) { continue; } if (extendsApplet && method.getName().equals("<init>")) { continue; } if (!methods.contains(method)) { logger.debug("Removing unused method {}", method); cf.removeMethod(method); ++count; } } } logger.info("Removed {} methods", count); }  @Override void run(ClassGroup group); }
UnusedMethods implements Deobfuscator { @Override public void run(ClassGroup group) { for (ClassFile cf : group.getClasses()) { for (Method method : cf.getMethods()) { run(method); } } int count = 0; for (ClassFile cf : group.getClasses()) { boolean extendsApplet = extendsApplet(cf); for (Method method : new ArrayList<>(cf.getMethods())) { if (!Deob.isObfuscated(method.getName()) && !method.getName().equals("<init>")) { continue; } if (extendsApplet && method.getName().equals("<init>")) { continue; } if (!methods.contains(method)) { logger.debug("Removing unused method {}", method); cf.removeMethod(method); ++count; } } } logger.info("Removed {} methods", count); }  @Override void run(ClassGroup group);  }