Fix UNSUPPORTEDMETHOD: init SevenZipJBinding native libs, pass password to extractSlow
Some checks are pending
Build and Release / build (push) Waiting to run

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:
Sucukdeluxe 2026-03-03 02:35:19 +01:00
parent eefb536cb3
commit fa30e738d9
12 changed files with 19 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "real-debrid-downloader",
"version": "1.5.46",
"version": "1.5.47",
"description": "Real-Debrid Downloader Desktop (Electron + React + TypeScript)",
"main": "build/main/main/main.js",
"author": "Sucukdeluxe",

View File

@ -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]);

View File

@ -1190,10 +1190,15 @@ async function runExternalExtract(
}
jvmFailureReason = jvmResult.errorText || "JVM-Extractor fehlgeschlagen";
if (backendMode === "jvm") {
const isUnsupportedMethod = jvmFailureReason.includes("UNSUPPORTEDMETHOD");
if (backendMode === "jvm" && !isUnsupportedMethod) {
throw new Error(jvmFailureReason);
}
logger.warn(`JVM-Extractor Fehler, fallback auf Legacy: ${jvmFailureReason}`);
if (isUnsupportedMethod) {
logger.warn(`JVM-Extractor: Komprimierungsmethode nicht unterstützt, fallback auf Legacy: ${path.basename(archivePath)}`);
} else {
logger.warn(`JVM-Extractor Fehler, fallback auf Legacy: ${jvmFailureReason}`);
}
}
}