Package org.jf.dexlib2.writer.pool.ProtoPool

Examples of org.jf.dexlib2.writer.pool.ProtoPool.Key


        MethodAnalyzer methodAnalyzer = new MethodAnalyzer(classPath, method, inlineMethodResolver);

        Instruction deodexedInstruction = methodAnalyzer.getInstructions().get(0);
        Assert.assertEquals(Opcode.INVOKE_VIRTUAL, deodexedInstruction.getOpcode());

        MethodReference methodReference = (MethodReference)((Instruction35c)deodexedInstruction).getReference();
        Assert.assertEquals(method, methodReference);
    }
View Full Code Here


        MethodAnalyzer methodAnalyzer = new MethodAnalyzer(classPath, method, inlineMethodResolver);

        Instruction deodexedInstruction = methodAnalyzer.getInstructions().get(0);
        Assert.assertEquals(Opcode.INVOKE_STATIC, deodexedInstruction.getOpcode());

        MethodReference methodReference = (MethodReference)((Instruction35c)deodexedInstruction).getReference();
        Assert.assertEquals(method, methodReference);
    }
View Full Code Here

        MethodAnalyzer methodAnalyzer = new MethodAnalyzer(classPath, method, inlineMethodResolver);

        Instruction deodexedInstruction = methodAnalyzer.getInstructions().get(0);
        Assert.assertEquals(Opcode.INVOKE_DIRECT, deodexedInstruction.getOpcode());

        MethodReference methodReference = (MethodReference)((Instruction35c)deodexedInstruction).getReference();
        Assert.assertEquals(method, methodReference);
    }
View Full Code Here

        }

        if (instruction instanceof ReferenceInstruction) {
            ReferenceInstruction referenceInstruction = (ReferenceInstruction)instruction;
            try {
                Reference reference = referenceInstruction.getReference();

                String classContext = null;
                if (methodDef.classDef.options.useImplicitReferences) {
                    classContext = methodDef.method.getDefiningClass();
                }
View Full Code Here

    }

    @Override
    public boolean equals(@Nullable Object o) {
        if (o instanceof AnnotationEncodedValue) {
            AnnotationEncodedValue other = (AnnotationEncodedValue)o;
            return getType().equals(other.getType()) &&
                    getElements().equals(other.getElements());
        }
        return false;
    }
View Full Code Here

    @Override
    public int compareTo(@Nonnull EncodedValue o) {
        int res = Ints.compare(getValueType(), o.getValueType());
        if (res != 0) return res;
        AnnotationEncodedValue other = (AnnotationEncodedValue)o;
        res = getType().compareTo(other.getType());
        if (res != 0) return res;
        return CollectionUtils.compareAsSet(getElements(), other.getElements());
    }
View Full Code Here

        }
        if (signatureAnnotation == null) {
            return null;
        }

        ArrayEncodedValue signatureValues = null;
        for (AnnotationElement annotationElement: signatureAnnotation.getElements()) {
            if (annotationElement.getName().equals("value")) {
                EncodedValue encodedValue = annotationElement.getValue();
                if (encodedValue.getValueType() != ValueType.ARRAY) {
                    return null;
                }
                signatureValues = (ArrayEncodedValue)encodedValue;
                break;
            }
        }
        if (signatureValues == null) {
            return null;
        }

        StringBuilder sb = new StringBuilder();
        for (EncodedValue signatureValue: signatureValues.getValue()) {
            if (signatureValue.getValueType() != ValueType.STRING) {
                return null;
            }
            sb.append(((StringEncodedValue)signatureValue).getValue());
        }
View Full Code Here

        }

        ArrayEncodedValue signatureValues = null;
        for (AnnotationElement annotationElement: signatureAnnotation.getElements()) {
            if (annotationElement.getName().equals("value")) {
                EncodedValue encodedValue = annotationElement.getValue();
                if (encodedValue.getValueType() != ValueType.ARRAY) {
                    return null;
                }
                signatureValues = (ArrayEncodedValue)encodedValue;
                break;
            }
View Full Code Here

        ImmutableMethodImplementation methodImpl = new ImmutableMethodImplementation(1, instructions, null, null);
        ImmutableMethod method = new ImmutableMethod("Lblah;", "blah", null, "V", AccessFlags.PUBLIC.getValue(), null,
                methodImpl);

        ClassDef classDef = new ImmutableClassDef("Lblah;", AccessFlags.PUBLIC.getValue(), "Ljava/lang/Object;", null,
                null, null, null, null, null, ImmutableList.of(method));

        DexFile dexFile = new ImmutableDexFile(ImmutableList.of(classDef));

        ClassPath classPath = ClassPath.fromClassPath(ImmutableList.<String>of(), ImmutableList.<String>of(), dexFile,
View Full Code Here

        ImmutableMethodImplementation methodImpl = new ImmutableMethodImplementation(1, instructions, null, null);
        ImmutableMethod method = new ImmutableMethod("Lblah;", "blah", null, "V", AccessFlags.STATIC.getValue(), null,
                methodImpl);

        ClassDef classDef = new ImmutableClassDef("Lblah;", AccessFlags.PUBLIC.getValue(), "Ljava/lang/Object;", null,
                null, null, null, null, ImmutableList.of(method), null);

        DexFile dexFile = new ImmutableDexFile(ImmutableList.of(classDef));

        ClassPath classPath = ClassPath.fromClassPath(ImmutableList.<String>of(), ImmutableList.<String>of(), dexFile,
View Full Code Here

TOP

Related Classes of org.jf.dexlib2.writer.pool.ProtoPool.Key

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.