Search in sources :

Example 1 with ConfigValue

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

the class ResProtoParser method parse.

private void parse(String packageName, List<Type> types) {
    for (Type type : types) {
        String typeName = type.getName();
        for (Entry entry : type.getEntryList()) {
            int id = entry.getEntryId().getId();
            String entryName = entry.getName();
            for (ConfigValue configValue : entry.getConfigValueList()) {
                String config = parse(configValue.getConfig());
                ResourceEntry resEntry = new ResourceEntry(id, packageName, typeName, entryName, config);
                resStorage.add(resEntry);
                ProtoValue protoValue;
                if (configValue.getValue().getValueCase() == Value.ValueCase.ITEM) {
                    protoValue = new ProtoValue(parse(configValue.getValue().getItem()));
                } else {
                    protoValue = parse(configValue.getValue().getCompoundValue());
                }
                resEntry.setProtoValue(protoValue);
            }
        }
    }
}
Also used : Type(com.android.aapt.Resources.Type) ResourceEntry(jadx.core.xmlgen.entry.ResourceEntry) Entry(com.android.aapt.Resources.Entry) ConfigValue(com.android.aapt.Resources.ConfigValue) ResourceEntry(jadx.core.xmlgen.entry.ResourceEntry) ProtoValue(jadx.core.xmlgen.entry.ProtoValue)

Aggregations

ConfigValue (com.android.aapt.Resources.ConfigValue)1 Entry (com.android.aapt.Resources.Entry)1 Type (com.android.aapt.Resources.Type)1 ProtoValue (jadx.core.xmlgen.entry.ProtoValue)1 ResourceEntry (jadx.core.xmlgen.entry.ResourceEntry)1