Search in sources :

Example 1 with Item

use of com.taobao.android.dx.dex.file.Item in project atlas by alibaba.

the class Main method computeReferencedResources.

private void computeReferencedResources() {
    for (Item genericItem : outputDex.getFieldIds().items()) {
        FieldIdItem item = (FieldIdItem) genericItem;
        CstType fieldClass = item.getDefiningClass();
        CstString fieldName = item.getRef().getNat().getName();
        if (fieldClass.getClassType().getDescriptor().contains("/R$")) {
            // We ignore the name of the containing class for simplicity.
            resourceNames.add(fieldName.getString());
        }
    }
}
Also used : Item(com.taobao.android.dx.dex.file.Item) ClassDefItem(com.taobao.android.dx.dex.file.ClassDefItem) FieldIdItem(com.taobao.android.dx.dex.file.FieldIdItem) FieldIdItem(com.taobao.android.dx.dex.file.FieldIdItem) CstType(com.taobao.android.dx.rop.cst.CstType) CstString(com.taobao.android.dx.rop.cst.CstString)

Aggregations

ClassDefItem (com.taobao.android.dx.dex.file.ClassDefItem)1 FieldIdItem (com.taobao.android.dx.dex.file.FieldIdItem)1 Item (com.taobao.android.dx.dex.file.Item)1 CstString (com.taobao.android.dx.rop.cst.CstString)1 CstType (com.taobao.android.dx.rop.cst.CstType)1