Search in sources :

Example 16 with CstNat

use of com.android.dx.rop.cst.CstNat in project J2ME-Loader by nikita36078.

the class MemberIdItem method writeTo.

/**
 * {@inheritDoc}
 */
@Override
public final void writeTo(DexFile file, AnnotatedOutput out) {
    TypeIdsSection typeIds = file.getTypeIds();
    StringIdsSection stringIds = file.getStringIds();
    CstNat nat = cst.getNat();
    int classIdx = typeIds.indexOf(getDefiningClass());
    int nameIdx = stringIds.indexOf(nat.getName());
    int typoidIdx = getTypoidIdx(file);
    if (out.annotates()) {
        out.annotate(0, indexString() + ' ' + cst.toHuman());
        out.annotate(2, "  class_idx: " + Hex.u2(classIdx));
        out.annotate(2, String.format("  %-10s %s", getTypoidName() + ':', Hex.u2(typoidIdx)));
        out.annotate(4, "  name_idx:  " + Hex.u4(nameIdx));
    }
    out.writeShort(classIdx);
    out.writeShort(typoidIdx);
    out.writeInt(nameIdx);
}
Also used : CstNat(com.android.dx.rop.cst.CstNat)

Aggregations

CstNat (com.android.dx.rop.cst.CstNat)16 CstString (com.android.dx.rop.cst.CstString)10 CstType (com.android.dx.rop.cst.CstType)10 ParseException (com.android.dx.cf.iface.ParseException)6 CstMethodRef (com.android.dx.rop.cst.CstMethodRef)6 AttEnclosingMethod (com.android.dx.cf.attrib.AttEnclosingMethod)4 Annotation (com.android.dx.rop.annotation.Annotation)4 AnnotationsList (com.android.dx.rop.annotation.AnnotationsList)4 ConstantPool (com.android.dx.rop.cst.ConstantPool)4 ByteArray (com.android.dx.util.ByteArray)4 Attribute (com.android.dx.cf.iface.Attribute)2 Member (com.android.dx.cf.iface.Member)2 StdAttributeList (com.android.dx.cf.iface.StdAttributeList)2 ClassDefItem (com.android.dx.dex.file.ClassDefItem)2 EncodedMethod (com.android.dx.dex.file.EncodedMethod)2 Annotations (com.android.dx.rop.annotation.Annotations)2 RegisterSpec (com.android.dx.rop.code.RegisterSpec)2 Constant (com.android.dx.rop.cst.Constant)2 CstAnnotation (com.android.dx.rop.cst.CstAnnotation)2 CstArray (com.android.dx.rop.cst.CstArray)2