Search in sources :

Example 1 with AttSignature

use of com.taobao.android.dx.cf.attrib.AttSignature in project atlas by alibaba.

the class StdAttributeFactory method signature.

/**
 * Parses a {@code Signature} attribute.
 */
private Attribute signature(DirectClassFile cf, int offset, int length, ParseObserver observer) {
    if (length != 2) {
        throwBadLength(2);
    }
    ByteArray bytes = cf.getBytes();
    ConstantPool pool = cf.getConstantPool();
    int idx = bytes.getUnsignedShort(offset);
    CstString cst = (CstString) pool.get(idx);
    Attribute result = new AttSignature(cst);
    if (observer != null) {
        observer.parsed(bytes, offset, 2, "signature: " + cst);
    }
    return result;
}
Also used : Attribute(com.taobao.android.dx.cf.iface.Attribute) AttSignature(com.taobao.android.dx.cf.attrib.AttSignature) ConstantPool(com.taobao.android.dx.rop.cst.ConstantPool) CstString(com.taobao.android.dx.rop.cst.CstString) ByteArray(com.taobao.android.dx.util.ByteArray)

Aggregations

AttSignature (com.taobao.android.dx.cf.attrib.AttSignature)1 Attribute (com.taobao.android.dx.cf.iface.Attribute)1 ConstantPool (com.taobao.android.dx.rop.cst.ConstantPool)1 CstString (com.taobao.android.dx.rop.cst.CstString)1 ByteArray (com.taobao.android.dx.util.ByteArray)1