Search in sources :

Example 1 with Attribute

use of com.android.aapt.Resources.Attribute in project jadx by skylot.

the class ResProtoParser method parse.

private ProtoValue parse(Attribute a) {
    String format = XmlGenUtils.getAttrTypeAsString(a.getFormatFlags());
    List<ProtoValue> namedValues = new ArrayList<>(a.getSymbolCount());
    for (int i = 0; i < a.getSymbolCount(); i++) {
        Attribute.Symbol s = a.getSymbol(i);
        int type = s.getType();
        String name = s.getName().getName();
        String value = String.valueOf(s.getValue());
        namedValues.add(new ProtoValue(value).setName(name).setType(type));
    }
    return new ProtoValue(format).setNamedValues(namedValues);
}
Also used : Attribute(com.android.aapt.Resources.Attribute) ArrayList(java.util.ArrayList) ProtoValue(jadx.core.xmlgen.entry.ProtoValue)

Aggregations

Attribute (com.android.aapt.Resources.Attribute)1 ProtoValue (jadx.core.xmlgen.entry.ProtoValue)1 ArrayList (java.util.ArrayList)1