Package org.jf.dexlib2.iface.reference

Examples of org.jf.dexlib2.iface.reference.MethodReference


        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

        ImmutableMethodImplementation methodImpl = new ImmutableMethodImplementation(1, instructions, null, null);
        ImmutableMethod method = new ImmutableMethod("Lblah;", "blah", null, "V", AccessFlags.PRIVATE.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

                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,
                15);
        InlineMethodResolver inlineMethodResolver = new CustomInlineMethodResolver(classPath, "Lblah;->blah()V");
        MethodAnalyzer methodAnalyzer = new MethodAnalyzer(classPath, method, inlineMethodResolver);
View Full Code Here

                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,
                15);
        InlineMethodResolver inlineMethodResolver = new CustomInlineMethodResolver(classPath, "Lblah;->blah()V");
        MethodAnalyzer methodAnalyzer = new MethodAnalyzer(classPath, method, inlineMethodResolver);
View Full Code Here

                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,
                15);
        InlineMethodResolver inlineMethodResolver = new CustomInlineMethodResolver(classPath, "Lblah;->blah()V");
        MethodAnalyzer methodAnalyzer = new MethodAnalyzer(classPath, method, inlineMethodResolver);
View Full Code Here

                        writer.writeUshort(offset);
                        exceptionHandlerOffsetMap.put(tryBlock.getExceptionHandlers(), offset);

                        // check if the last exception handler is a catch-all and adjust the size accordingly
                        int ehSize = tryBlock.getExceptionHandlers().size();
                        ExceptionHandler ehLast = tryBlock.getExceptionHandlers().get(ehSize-1);
                        if (ehLast.getExceptionType() == null) {
                            ehSize = ehSize * (-1) + 1;
                        }

                        // now let's layout the exception handlers, assuming that catch-all is always last
                        DexDataWriter.writeSleb128(ehBuf, ehSize);
View Full Code Here

    }

    @Override
    public boolean equals(@Nullable Object o) {
        if (o instanceof ExceptionHandler) {
            ExceptionHandler other = (ExceptionHandler)o;
            return Objects.equal(getExceptionType(), other.getExceptionType()) &&
                   (getHandlerCodeAddress() == other.getHandlerCodeAddress());
        }
        return false;
    }
View Full Code Here

        Assert.assertEquals(252, exceptionHandlers.get(0).getStartCodeAddress());
        Assert.assertEquals(752, exceptionHandlers.get(0).getCodeUnitCount());

        Assert.assertEquals(1, exceptionHandlers.get(0).getExceptionHandlers().size());

        ExceptionHandler exceptionHandler = exceptionHandlers.get(0).getExceptionHandlers().get(0);
        Assert.assertEquals(504, exceptionHandler.getHandlerCodeAddress());

        List<DebugItem> debugItems = Lists.newArrayList(impl.getDebugItems());

        Assert.assertEquals(5, debugItems.size());
View Full Code Here

        Label tryEnd = builder.getLabel("tryEnd");
        Label handler = builder.getLabel("handler");

        builder.addCatch(tryStart, tryEnd, handler);

        MethodImplementation impl = builder.getMethodImplementation();

        List<? extends Instruction> instructions = Lists.newArrayList(impl.getInstructions());
        Assert.assertEquals(1003, instructions.size());

        Assert.assertEquals(Opcode.GOTO_16, instructions.get(0).getOpcode());
        Assert.assertEquals(1004, ((OffsetInstruction)instructions.get(0)).getCodeOffset());

        Assert.assertEquals(Opcode.GOTO_16, instructions.get(501).getOpcode());
        Assert.assertEquals(502, ((OffsetInstruction)instructions.get(501)).getCodeOffset());

        List<? extends TryBlock<? extends ExceptionHandler>> exceptionHandlers = impl.getTryBlocks();

        Assert.assertEquals(1, exceptionHandlers.size());
        Assert.assertEquals(252, exceptionHandlers.get(0).getStartCodeAddress());
        Assert.assertEquals(752, exceptionHandlers.get(0).getCodeUnitCount());

        Assert.assertEquals(1, exceptionHandlers.get(0).getExceptionHandlers().size());

        ExceptionHandler exceptionHandler = exceptionHandlers.get(0).getExceptionHandlers().get(0);
        Assert.assertEquals(504, exceptionHandler.getHandlerCodeAddress());

        List<DebugItem> debugItems = Lists.newArrayList(impl.getDebugItems());

        Assert.assertEquals(5, debugItems.size());

        Assert.assertEquals(1, ((LineNumber)debugItems.get(0)).getLineNumber());
        Assert.assertEquals(2, debugItems.get(0).getCodeAddress());
View Full Code Here

TOP

Related Classes of org.jf.dexlib2.iface.reference.MethodReference

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.