Search in sources :

Example 1 with ValuesParser

use of jadx.core.xmlgen.entry.ValuesParser in project jadx by skylot.

the class ResTableParser method makeDump.

public CodeWriter makeDump() throws IOException {
    CodeWriter writer = new CodeWriter();
    writer.add("app package: ").add(resStorage.getAppPackage());
    writer.startLine();
    ValuesParser vp = new ValuesParser(strings, resStorage.getResourcesNames());
    for (ResourceEntry ri : resStorage.getResources()) {
        writer.startLine(ri + ": " + vp.getValueString(ri));
    }
    writer.finish();
    return writer;
}
Also used : ResourceEntry(jadx.core.xmlgen.entry.ResourceEntry) ValuesParser(jadx.core.xmlgen.entry.ValuesParser) CodeWriter(jadx.core.codegen.CodeWriter)

Example 2 with ValuesParser

use of jadx.core.xmlgen.entry.ValuesParser in project jadx by skylot.

the class BinaryXMLParser method decode.

void decode() throws IOException {
    int size = is.readInt32();
    while (is.getPos() < size) {
        int type = is.readInt16();
        switch(type) {
            case RES_NULL_TYPE:
                // NullType is just doing nothing
                break;
            case RES_STRING_POOL_TYPE:
                strings = parseStringPoolNoType();
                valuesParser = new ValuesParser(strings, resNames);
                break;
            case RES_XML_RESOURCE_MAP_TYPE:
                parseResourceMap();
                break;
            case RES_XML_START_NAMESPACE_TYPE:
                parseNameSpace();
                break;
            case RES_XML_CDATA_TYPE:
                parseCData();
                break;
            case RES_XML_END_NAMESPACE_TYPE:
                parseNameSpaceEnd();
                break;
            case RES_XML_START_ELEMENT_TYPE:
                parseElement();
                break;
            case RES_XML_END_ELEMENT_TYPE:
                parseElementEnd();
                break;
            default:
                die("Type: 0x" + Integer.toHexString(type) + " not yet implemented");
                break;
        }
    }
}
Also used : ValuesParser(jadx.core.xmlgen.entry.ValuesParser)

Example 3 with ValuesParser

use of jadx.core.xmlgen.entry.ValuesParser in project jadx by skylot.

the class ResTableParser method decodeFiles.

public ResContainer decodeFiles(InputStream inputStream) throws IOException {
    decode(inputStream);
    ValuesParser vp = new ValuesParser(strings, resStorage.getResourcesNames());
    ResXmlGen resGen = new ResXmlGen(resStorage, vp);
    ResContainer res = ResContainer.multiFile("res");
    res.setContent(makeDump());
    res.getSubFiles().addAll(resGen.makeResourcesXml());
    return res;
}
Also used : ValuesParser(jadx.core.xmlgen.entry.ValuesParser)

Aggregations

ValuesParser (jadx.core.xmlgen.entry.ValuesParser)3 CodeWriter (jadx.core.codegen.CodeWriter)1 ResourceEntry (jadx.core.xmlgen.entry.ResourceEntry)1