Found some ShrinkIt archives that have HTML tags prepending the actual file (which somehow appear to be fine). Adjusted the detection routine.

This commit is contained in:
a2geek committed 2026-11-01 18:38:50 -06:00
1 parent d4c8ac7862
commit e9d9ee25c6
1 file changed
+8
@@ -37,5 +37,13 @@ public class ShrinkitFileStoreFactory implements FileStoreFactory {
if (Arrays.equals(ByteConstants.NUFILE_ID, buffer.asBytes())) {
ctx.fileStores.add(new ShrinkitFileStore(ctx.source));
}
else if (buffer.getUnsignedByte(0) == '<') {
// Sometimes it gets wrapped in HTML (how??); want to leave the other legit
// embeddings alone (Binary II, for example).
buffer = ctx.source.readBytes(0, 0x100);
buffer.scan(ByteConstants.NUFILE_ID, 0).ifPresent(_ -> {
ctx.fileStores.add(new ShrinkitFileStore(ctx.source));
});
}
}
}