From e9d9ee25c6941df9d3bfaee2cfe84aaeb875645b Mon Sep 17 00:00:00 2001 From: a2geek Date: Sun, 1 Nov 2026 18:38:50 -0600 Subject: [PATCH] Found some ShrinkIt archives that have HTML tags prepending the actual file (which somehow appear to be fine). Adjusted the detection routine. --- .../archive/shrinkit/ShrinkitFileStoreFactory.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ac-api/src/main/java/org/applecommander/archive/shrinkit/ShrinkitFileStoreFactory.java b/lib/ac-api/src/main/java/org/applecommander/archive/shrinkit/ShrinkitFileStoreFactory.java index cd6781b7..2ab349a9 100644 --- a/lib/ac-api/src/main/java/org/applecommander/archive/shrinkit/ShrinkitFileStoreFactory.java +++ b/lib/ac-api/src/main/java/org/applecommander/archive/shrinkit/ShrinkitFileStoreFactory.java @@ -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)); + }); + } } }