Fix UNSUPPORTEDMETHOD: init SevenZipJBinding native libs, pass password to extractSlow
Build and Release / build (push) Has been cancelled
Build and Release / build (push) Has been cancelled
Root cause: SevenZip.initSevenZipFromPlatformJAR() was never called, so native compression codecs (RAR5, LZMA2, etc.) were not loaded. Archives could be opened (header parsing is pure Java) but all extractSlow() calls returned UNSUPPORTEDMETHOD because no native decoder was available. - Add ensureSevenZipInitialized() with lazy init before extraction - Pass password to extractSlow(outStream, password) for RAR5 compatibility - Add UNSUPPORTEDMETHOD -> legacy fallback in extractor.ts as safety net Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
eefb536cb3
commit
fa30e738d9
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
@@ -42,6 +42,7 @@ public final class JBindExtractorMain {
|
||||
private static final Pattern NUMBERED_ZIP_SPLIT_RE = Pattern.compile("(?i).*\\.zip\\.\\d{3}$");
|
||||
private static final Pattern OLD_ZIP_SPLIT_RE = Pattern.compile("(?i).*\\.z\\d{2,3}$");
|
||||
private static final Pattern SEVEN_ZIP_SPLIT_RE = Pattern.compile("(?i).*\\.7z\\.001$");
|
||||
private static volatile boolean sevenZipInitialized = false;
|
||||
|
||||
private JBindExtractorMain() {
|
||||
}
|
||||
@@ -204,7 +205,16 @@ public final class JBindExtractorMain {
|
||||
}
|
||||
}
|
||||
|
||||
private static synchronized void ensureSevenZipInitialized() throws Exception {
|
||||
if (sevenZipInitialized) {
|
||||
return;
|
||||
}
|
||||
SevenZip.initSevenZipFromPlatformJAR();
|
||||
sevenZipInitialized = true;
|
||||
}
|
||||
|
||||
private static void extractWithSevenZip(ExtractionRequest request, String password) throws Exception {
|
||||
ensureSevenZipInitialized();
|
||||
SevenZipArchiveContext context = null;
|
||||
try {
|
||||
context = openSevenZipArchive(request.archiveFile, password);
|
||||
@@ -269,7 +279,7 @@ public final class JBindExtractorMain {
|
||||
progress.advance(accounted);
|
||||
return data.length;
|
||||
}
|
||||
});
|
||||
}, password == null ? "" : password);
|
||||
|
||||
if (remaining[0] > 0) {
|
||||
progress.advance(remaining[0]);
|
||||
|
||||
Reference in New Issue
Block a user