Package org.jf.dexlib2.iface.instruction

Examples of org.jf.dexlib2.iface.instruction.Instruction


            int outParamCount = 0;
            int codeUnitCount = 0;
            for (Instruction instruction: instructions) {
                codeUnitCount += instruction.getCodeUnits();
                if (instruction.getOpcode().referenceType == ReferenceType.METHOD) {
                    ReferenceInstruction refInsn = (ReferenceInstruction)instruction;
                    MethodReference methodRef = (MethodReference)refInsn.getReference();
                    int paramCount = MethodUtil.getParameterRegisterCount(methodRef, InstructionUtil.isInvokeStatic(instruction.getOpcode()));
                    if (paramCount > outParamCount) {
                        outParamCount = paramCount;
                    }
                }
View Full Code Here


                        Opcode.MOVE,
                        Opcode.MOVE,
                        Opcode.MOVE,
                        Opcode.ARRAY_PAYLOAD});

        Instruction31t referent = (Instruction31t)instructions.get(0);
        Assert.assertEquals(6, referent.getCodeOffset());
    }
View Full Code Here

                    Opcode.MOVE,
                    Opcode.MOVE,
                    Opcode.NOP,
                    Opcode.ARRAY_PAYLOAD});

        Instruction31t referent = (Instruction31t)instructions.get(0);
        Assert.assertEquals(8, referent.getCodeOffset());
    }
View Full Code Here

                        Opcode.PACKED_SWITCH});

        OffsetInstruction gotoInstruction = (OffsetInstruction)instructions.get(0);
        Assert.assertEquals(12, gotoInstruction.getCodeOffset());

        PackedSwitchPayload payload = (PackedSwitchPayload)instructions.get(2);
        Assert.assertEquals(3, payload.getSwitchElements().size());
        Assert.assertEquals(-16, payload.getSwitchElements().get(0).getOffset());
        Assert.assertEquals(-2, payload.getSwitchElements().get(1).getOffset());
        Assert.assertEquals(-1, payload.getSwitchElements().get(2).getOffset());

        OffsetInstruction referent = (OffsetInstruction)instructions.get(7);
        Assert.assertEquals(-14, referent.getCodeOffset());
    }
View Full Code Here

                        Opcode.SPARSE_SWITCH});

        OffsetInstruction gotoInstruction = (OffsetInstruction)instructions.get(0);
        Assert.assertEquals(16, gotoInstruction.getCodeOffset());

        SparseSwitchPayload payload = (SparseSwitchPayload)instructions.get(2);
        Assert.assertEquals(3, payload.getSwitchElements().size());
        Assert.assertEquals(-20, payload.getSwitchElements().get(0).getOffset());
        Assert.assertEquals(-2, payload.getSwitchElements().get(1).getOffset());
        Assert.assertEquals(-1, payload.getSwitchElements().get(2).getOffset());

        OffsetInstruction referent = (OffsetInstruction)instructions.get(7);
        Assert.assertEquals(-18, referent.getCodeOffset());
    }
View Full Code Here

                                    return null;
                                }

                                DexBackedField item = new DexBackedField(reader, DexBackedClassDef.this,
                                        previousIndex, staticInitialValueIterator, annotationIterator);
                                FieldReference currentField = previousField;
                                FieldReference nextField = ImmutableFieldReference.of(item);

                                previousField = nextField;
                                previousIndex = item.fieldIndex;

                                if (skipDuplicates && currentField != null && currentField.equals(nextField)) {
View Full Code Here

                                    return null;
                                }

                                DexBackedField item = new DexBackedField(reader, DexBackedClassDef.this,
                                        previousIndex, annotationIterator);
                                FieldReference currentField = previousField;
                                FieldReference nextField = ImmutableFieldReference.of(item);

                                previousField = nextField;
                                previousIndex = item.fieldIndex;

                                if (skipDuplicates && currentField != null && currentField.equals(nextField)) {
View Full Code Here

    }

    @Override
    public boolean equals(@Nullable Object o) {
        if (o instanceof FieldReference) {
            FieldReference other = (FieldReference)o;
            return getDefiningClass().equals(other.getDefiningClass()) &&
                   getName().equals(other.getName()) &&
                   getType().equals(other.getType());

        }
        return false;
    }
View Full Code Here

                                    return null;
                                }

                                DexBackedMethod item = new DexBackedMethod(reader, DexBackedClassDef.this,
                                        previousIndex, methodAnnotationIterator, parameterAnnotationIterator);
                                MethodReference currentMethod = previousMethod;
                                MethodReference nextMethod = ImmutableMethodReference.of(item);

                                previousMethod = nextMethod;
                                previousIndex = item.methodIndex;

                                if (skipDuplicates && currentMethod != null && currentMethod.equals(nextMethod)) {
View Full Code Here

                                    return null;
                                }

                                DexBackedMethod item = new DexBackedMethod(reader, DexBackedClassDef.this,
                                        previousIndex, methodAnnotationIterator, parameterAnnotationIterator);
                                MethodReference currentMethod = previousMethod;
                                MethodReference nextMethod = ImmutableMethodReference.of(item);

                                previousMethod = nextMethod;
                                previousIndex = item.methodIndex;

                                if (skipDuplicates && currentMethod != null && currentMethod.equals(nextMethod)) {
View Full Code Here

TOP

Related Classes of org.jf.dexlib2.iface.instruction.Instruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.