protected String printLookupSwitchInsnNode(LookupSwitchInsnNode lin) { String line = nameOpcode(lin.opcode()) + ": \n"; List<?> keys = lin.keys; List<?> labels = lin.labels; for (int i = 0; i < keys.size(); i++) { int key = (Integer) keys.get(i); LabelNode label = (LabelNode) labels.get(i); line += " val: " + key + " -> " + "L" + resolveLabel(label) + "\n"; } line += " default" + " -> L" + resolveLabel(lin.dflt) + ""; return line; }
protected String printTableSwitchInsnNode(TableSwitchInsnNode tin) { String line = nameOpcode(tin.opcode()) + " \n"; List<?> labels = tin.labels; int count = 0; for (int i = tin.min; i < tin.max + 1; i++) { line += " val: " + i + " -> " + "L" + resolveLabel((LabelNode) labels.get(count++)) + "\n"; } line += " default" + " -> L" + resolveLabel(tin.dflt) + ""; return line; }
private void replaceObfuscatedMethodNames(AsmagicDiffVisitor dv) { for (MethodNode mn : dv.newMethods) { if (mn.visibleAnnotations != null) { for (Object oan : mn.visibleAnnotations) { AnnotationNode an = (AnnotationNode) oan; if (an.desc.contains("AsmagicMethodReplace")) { List<Object> vals = an.values; String alias = null; if (vals != null || vals.size() > 1) { alias = (String) vals.get(1); dv.methodsToReplace.put(alias, 1); mn.name = alias; } } } } } }
/** * It is assumed that ALL CLASSES regardless of nesting, have unique names In addition, it is * assumed that there is not multi-level nesting A SOURCE STRUCTURE OBJECT CAN ONLY HANDLE ONE * LEVEL OF CLASS NESTING * * @param targetClass * @param depth * @throws IOException */ private void findNestedInnerClasses(ClassNode2 targetClass, int depth) throws IOException { // saves the depth of a particular inner class depth++; // get the inner classes of a class List<InnerClassNode2> innerClassNodes = targetClass.innerClasses; // returns if there are no inner classes if (innerClassNodes == null) { return; } else { // if there are inner classes, each inner class is converted to a ClassStructure // object and stored in an ArrayList for (int i = 0; i < innerClassNodes.size(); i++) { classStructures.add(new ClassStructure(innerClassNodes.get(i).name, depth)); } } }
public JumpItem getJump(int level) { if (jumpStack.size() - level < 0) return null; if (jumpStack.size() - level >= jumpStack.size()) return null; return jumpStack.get(jumpStack.size() - level); }