Java Code Examples for com.android.dx.rop.code.AccessFlags#ACC_ABSTRACT

The following examples show how to use com.android.dx.rop.code.AccessFlags#ACC_ABSTRACT . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BlockDumper.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public void endParsingMember(ByteArray bytes, int offset, String name,
        String descriptor, Member member) {
    if (!(member instanceof Method)) {
        return;
    }

    if (!shouldDumpMethod(name)) {
        return;
    }

    if ((member.getAccessFlags() & (AccessFlags.ACC_ABSTRACT |
            AccessFlags.ACC_NATIVE)) != 0) {
        return;
    }

    ConcreteMethod meth =
        new ConcreteMethod((Method) member, classFile, true, true);

    if (rop) {
        ropDump(meth);
    } else {
        regularDump(meth);
    }
}
 
Example 2
Source File: BlockDumper.java    From Box with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public void endParsingMember(ByteArray bytes, int offset, String name,
        String descriptor, Member member) {
    if (!(member instanceof Method)) {
        return;
    }

    if (!shouldDumpMethod(name)) {
        return;
    }

    if ((member.getAccessFlags() & (AccessFlags.ACC_ABSTRACT |
            AccessFlags.ACC_NATIVE)) != 0) {
        return;
    }

    ConcreteMethod meth =
        new ConcreteMethod((Method) member, classFile, true, true);

    if (rop) {
        ropDump(meth);
    } else {
        regularDump(meth);
    }
}
 
Example 3
Source File: BlockDumper.java    From buck with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override
public void endParsingMember(ByteArray bytes, int offset, String name,
        String descriptor, Member member) {
    if (!(member instanceof Method)) {
        return;
    }

    if (!shouldDumpMethod(name)) {
        return;
    }

    if ((member.getAccessFlags() & (AccessFlags.ACC_ABSTRACT |
            AccessFlags.ACC_NATIVE)) != 0) {
        return;
    }

    ConcreteMethod meth =
        new ConcreteMethod((Method) member, classFile, true, true);

    if (rop) {
        ropDump(meth);
    } else {
        regularDump(meth);
    }
}
 
Example 4
Source File: EncodedMethod.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public int encode(DexFile file, AnnotatedOutput out,
        int lastIndex, int dumpSeq) {
    int methodIdx = file.getMethodIds().indexOf(method);
    int diff = methodIdx - lastIndex;
    int accessFlags = getAccessFlags();
    int codeOff = OffsettedItem.getAbsoluteOffsetOr0(code);
    boolean hasCode = (codeOff != 0);
    boolean shouldHaveCode = (accessFlags &
            (AccessFlags.ACC_ABSTRACT | AccessFlags.ACC_NATIVE)) == 0;

    /*
     * Verify that code appears if and only if a method is
     * declared to have it.
     */
    if (hasCode != shouldHaveCode) {
        throw new UnsupportedOperationException(
                "code vs. access_flags mismatch");
    }

    if (out.annotates()) {
        out.annotate(0, String.format("  [%x] %s", dumpSeq,
                        method.toHuman()));
        out.annotate(Leb128.unsignedLeb128Size(diff),
                "    method_idx:   " + Hex.u4(methodIdx));
        out.annotate(Leb128.unsignedLeb128Size(accessFlags),
                "    access_flags: " +
                AccessFlags.methodString(accessFlags));
        out.annotate(Leb128.unsignedLeb128Size(codeOff),
                "    code_off:     " + Hex.u4(codeOff));
    }

    out.writeUleb128(diff);
    out.writeUleb128(accessFlags);
    out.writeUleb128(codeOff);

    return methodIdx;
}
 
Example 5
Source File: EncodedMethod.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public int encode(DexFile file, AnnotatedOutput out,
        int lastIndex, int dumpSeq) {
    int methodIdx = file.getMethodIds().indexOf(method);
    int diff = methodIdx - lastIndex;
    int accessFlags = getAccessFlags();
    int codeOff = OffsettedItem.getAbsoluteOffsetOr0(code);
    boolean hasCode = (codeOff != 0);
    boolean shouldHaveCode = (accessFlags &
            (AccessFlags.ACC_ABSTRACT | AccessFlags.ACC_NATIVE)) == 0;

    /*
     * Verify that code appears if and only if a method is
     * declared to have it.
     */
    if (hasCode != shouldHaveCode) {
        throw new UnsupportedOperationException(
                "code vs. access_flags mismatch");
    }

    if (out.annotates()) {
        out.annotate(0, String.format("  [%x] %s", dumpSeq,
                        method.toHuman()));
        out.annotate(Leb128.unsignedLeb128Size(diff),
                "    method_idx:   " + Hex.u4(methodIdx));
        out.annotate(Leb128.unsignedLeb128Size(accessFlags),
                "    access_flags: " +
                AccessFlags.methodString(accessFlags));
        out.annotate(Leb128.unsignedLeb128Size(codeOff),
                "    code_off:     " + Hex.u4(codeOff));
    }

    out.writeUleb128(diff);
    out.writeUleb128(accessFlags);
    out.writeUleb128(codeOff);

    return methodIdx;
}
 
Example 6
Source File: EncodedMethod.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public int encode(DexFile file, AnnotatedOutput out,
        int lastIndex, int dumpSeq) {
    int methodIdx = file.getMethodIds().indexOf(method);
    int diff = methodIdx - lastIndex;
    int accessFlags = getAccessFlags();
    int codeOff = OffsettedItem.getAbsoluteOffsetOr0(code);
    boolean hasCode = (codeOff != 0);
    boolean shouldHaveCode = (accessFlags &
            (AccessFlags.ACC_ABSTRACT | AccessFlags.ACC_NATIVE)) == 0;

    /*
     * Verify that code appears if and only if a method is
     * declared to have it.
     */
    if (hasCode != shouldHaveCode) {
        throw new UnsupportedOperationException(
                "code vs. access_flags mismatch");
    }

    if (out.annotates()) {
        out.annotate(0, String.format("  [%x] %s", dumpSeq,
                        method.toHuman()));
        out.annotate(Leb128.unsignedLeb128Size(diff),
                "    method_idx:   " + Hex.u4(methodIdx));
        out.annotate(Leb128.unsignedLeb128Size(accessFlags),
                "    access_flags: " +
                AccessFlags.methodString(accessFlags));
        out.annotate(Leb128.unsignedLeb128Size(codeOff),
                "    code_off:     " + Hex.u4(codeOff));
    }

    out.writeUleb128(diff);
    out.writeUleb128(accessFlags);
    out.writeUleb128(codeOff);

    return methodIdx;
}
 
Example 7
Source File: EncodedMethod.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public int encode(DexFile file, AnnotatedOutput out,
        int lastIndex, int dumpSeq) {
    int methodIdx = file.getMethodIds().indexOf(method);
    int diff = methodIdx - lastIndex;
    int accessFlags = getAccessFlags();
    int codeOff = OffsettedItem.getAbsoluteOffsetOr0(code);
    boolean hasCode = (codeOff != 0);
    boolean shouldHaveCode = (accessFlags &
            (AccessFlags.ACC_ABSTRACT | AccessFlags.ACC_NATIVE)) == 0;

    /*
     * Verify that code appears if and only if a method is
     * declared to have it.
     */
    if (hasCode != shouldHaveCode) {
        throw new UnsupportedOperationException(
                "code vs. access_flags mismatch");
    }

    if (out.annotates()) {
        out.annotate(0, String.format("  [%x] %s", dumpSeq,
                        method.toHuman()));
        out.annotate(Leb128.unsignedLeb128Size(diff),
                "    method_idx:   " + Hex.u4(methodIdx));
        out.annotate(Leb128.unsignedLeb128Size(accessFlags),
                "    access_flags: " +
                AccessFlags.methodString(accessFlags));
        out.annotate(Leb128.unsignedLeb128Size(codeOff),
                "    code_off:     " + Hex.u4(codeOff));
    }

    out.writeUleb128(diff);
    out.writeUleb128(accessFlags);
    out.writeUleb128(codeOff);

    return methodIdx;
}
 
Example 8
Source File: AccessInfo.java    From Box with Apache License 2.0 4 votes vote down vote up
public boolean isAbstract() {
	return (accFlags & AccessFlags.ACC_ABSTRACT) != 0;
}
 
Example 9
Source File: AccessInfo.java    From Box with Apache License 2.0 4 votes vote down vote up
public boolean isAbstract() {
	return (accFlags & AccessFlags.ACC_ABSTRACT) != 0;
}