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;
}
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;
}
}
}
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;
}
Aggregations