use of jadx.api.ResourceFile in project jadx by skylot.
the class RootNode method updateObfuscatedFiles.
private void updateObfuscatedFiles(ResTableParser parser, List<ResourceFile> resources) {
if (args.isSkipResources()) {
return;
}
long start = System.currentTimeMillis();
int renamedCount = 0;
ResourceStorage resStorage = parser.getResStorage();
ValuesParser valuesParser = new ValuesParser(parser.getStrings(), resStorage.getResourcesNames());
Map<String, ResourceEntry> entryNames = new HashMap<>();
for (ResourceEntry resEntry : resStorage.getResources()) {
String val = valuesParser.getSimpleValueString(resEntry);
if (val != null) {
entryNames.put(val, resEntry);
}
}
for (ResourceFile resource : resources) {
ResourceEntry resEntry = entryNames.get(resource.getOriginalName());
if (resEntry != null) {
resource.setAlias(resEntry);
renamedCount++;
}
}
if (LOG.isDebugEnabled()) {
LOG.debug("Renamed obfuscated resources: {}, duration: {}ms", renamedCount, System.currentTimeMillis() - start);
}
}
Aggregations