Support 7z extraction, and fix .xz extraction which would have crashed at runtime

Commons Compress declares its LZMA/LZMA2 support against org.tukaani:xz as an *optional* dependency, so nothing pulled it in transitively and nothing failed at build time. The app nevertheless advertised .xz as extractable, so the first user to open one would have got NoClassDefFoundError: org/tukaani/xz/FilterOptions. XZCompressorInputStream references org/tukaani/xz/XZInputStream directly. The library is now declared, and a round-trip test covers the path that was silently missing.

That same library is what 7z needs, and Commons Compress already ships a pure-Java 7z reader, so 7z extraction costs no native code and no further dependency. The docs had assumed the format was off limits and said so in three places, including the customer-facing store copy.

7z is the only format here that cannot arrive through a stream: its header sits at the end of the file, so the reader has to seek. That is now a capability the backend advertises, StorageSource.openSeekable: the all-files backend answers with a real FileChannel, the SAF fallback with null, so folder mode reports needs-a-seekable-file instead of failing obscurely. Entry names go through the same ArchivePath.safeRelativePath zip-slip guard. 7z creation stays deferred.
This commit is contained in:
2026-10-15 08:47:37 +02:00
parent a461be2a66
commit ba92cf392d
13 changed files with 326 additions and 51 deletions
+9 -3
View File
@@ -91,6 +91,12 @@ BROWSE ANYTHING
• Breadcrumb navigation and an in-folder search
• Hidden files on request
ANY SIZE OF SCREEN
• On a tablet or a wide window you get two panes: the folder list on the left, and what is
inside the folder you pick on the right — no jumping back and forth
• Pictures preview at full size beside the list, with their details
• The same layout on a phone, a 7-inch tablet and a 10-inch tablet
MANAGE YOUR FILES
• Copy, move, rename and delete, one item or many at once
• Create folders and edit text files in the built-in editor
@@ -102,9 +108,9 @@ FIND OUT WHERE THE SPACE WENT
• Spot the folder that is actually eating your storage, then act on it
ARCHIVES
• Create ZIP archives, and extract ZIP, TAR, TAR.GZ, GZ, BZ2 and XZ
• RAR and 7z are not supported — they need native code this app does not ship, and it says
so rather than failing with a strange error
• Create ZIP archives, and extract ZIP, TAR, TAR.GZ, GZ, BZ2, XZ and 7z
• RAR is not supported — it needs native code this app does not ship, and it says so rather
than failing with a strange error
PRIVATE BY DEFAULT
• No INTERNET permission. The app cannot send your data anywhere, because it has no way to.