fix: do not reopen zip file on every resource decode

This commit is contained in:
Skylot
2025-03-11 21:56:42 +00:00
parent d84f0389ec
commit 3209dbb7a4
6 changed files with 65 additions and 87 deletions
@@ -12,6 +12,7 @@ import jadx.api.plugins.resources.IResContainerFactory;
import jadx.core.dex.nodes.RootNode;
import jadx.core.xmlgen.ResContainer;
import jadx.plugins.input.aab.parsers.ResXmlProtoParser;
import jadx.zip.IZipEntry;
public class ProtoXmlResContainerFactory implements IResContainerFactory {
private ResXmlProtoParser xmlParser;
@@ -27,11 +28,11 @@ public class ProtoXmlResContainerFactory implements IResContainerFactory {
if (type != ResourceType.XML && type != ResourceType.MANIFEST) {
return null;
}
ResourceFile.ZipRef ref = resFile.getZipRef();
if (ref == null) {
IZipEntry zipEntry = resFile.getZipEntry();
if (zipEntry == null) {
return null;
}
boolean isFromAab = ref.getZipFile().getPath().contains(".aab");
boolean isFromAab = zipEntry.getZipFile().getPath().contains(".aab");
if (!isFromAab) {
return null;
}