/** * Returns the next opcode after to the given node, ignoring label and line * number nodes * * @param node the node to look up the next opcode for * @return the next opcode, or {@link Opcodes#NOP} if no next node was found */ public static int getNextOpcode(@NonNull AbstractInsnNode node) { AbstractInsnNode next = getNextInstruction(node); if (next != null) { return next.getOpcode(); } else { return Opcodes.NOP; } }
private static boolean containsSimpleSdkCheck(@NonNull MethodNode method) { // Look for a compiled version of "if (Build.VERSION.SDK_INT op N) {" InsnList nodes = method.instructions; for (int i = 0, n = nodes.size(); i < n; i++) { AbstractInsnNode instruction = nodes.get(i); if (isSdkVersionLookup(instruction)) { AbstractInsnNode bipush = getNextInstruction(instruction); if (bipush != null && bipush.getOpcode() == Opcodes.BIPUSH) { AbstractInsnNode ifNode = getNextInstruction(bipush); if (ifNode != null && ifNode.getType() == AbstractInsnNode.JUMP_INSN) { return true; } } } } return false; }
private static boolean containsSimpleSdkCheck(@NonNull MethodNode method) { // Look for a compiled version of "if (Build.VERSION.SDK_INT op N) {" InsnList nodes = method.instructions; for (int i = 0, n = nodes.size(); i < n; i++) { AbstractInsnNode instruction = nodes.get(i); if (isSdkVersionLookup(instruction)) { AbstractInsnNode bipush = getNextInstruction(instruction); if (bipush != null && bipush.getOpcode() == Opcodes.BIPUSH) { AbstractInsnNode ifNode = getNextInstruction(bipush); if (ifNode != null && ifNode.getType() == AbstractInsnNode.JUMP_INSN) { return true; } } } } return false; }
AbstractInsnNode next = LintUtils.getNextInstruction(from); if (next != null && next.getType() == AbstractInsnNode.VAR_INSN) { next = LintUtils.getNextInstruction(next); if (next != null && next.getType() == AbstractInsnNode.METHOD_INSN) { MethodInsnNode method = (MethodInsnNode) next; if (method.name.equals(IS_HELD_METHOD) && method.owner.equals(WAKELOCK_OWNER)) { AbstractInsnNode next = LintUtils.getNextInstruction(from); if (next != null) { super.add(from, next);
AbstractInsnNode next = LintUtils.getNextInstruction(from); if (next != null && next.getType() == AbstractInsnNode.VAR_INSN) { next = LintUtils.getNextInstruction(next); if (next != null && next.getType() == AbstractInsnNode.METHOD_INSN) { MethodInsnNode method = (MethodInsnNode) next; if (method.name.equals(IS_HELD_METHOD) && method.owner.equals(WAKELOCK_OWNER)) { AbstractInsnNode next = LintUtils.getNextInstruction(from); if (next != null) { super.add(from, next);
AbstractInsnNode next = getNextInstruction(node); if (next != null && next.getOpcode() == Opcodes.INVOKEVIRTUAL && CLASS_CONSTRUCTOR.equals(method.name)
AbstractInsnNode next = getNextInstruction(node); if (next != null && next.getOpcode() == Opcodes.INVOKEVIRTUAL && CLASS_CONSTRUCTOR.equals(method.name)
&& node.owner.equals(classNode.name)) { AbstractInsnNode target = getNextInstruction(node); while (target != null) { if (target.getOpcode() == Opcodes.LOOKUPSWITCH) { target = getNextInstruction(target);
&& node.owner.equals(classNode.name)) { AbstractInsnNode target = getNextInstruction(node); while (target != null) { if (target.getOpcode() == Opcodes.LOOKUPSWITCH) { target = getNextInstruction(target);
AbstractInsnNode next = LintUtils.getNextInstruction(instruction); if (next != null && next.getType() == AbstractInsnNode.FIELD_INSN) { FieldInsnNode fieldRef = (FieldInsnNode) next;