zhanghai / zhanghai/MaterialFiles
Extraction fails with "Operation not permitted" for archives containing files with forbidden characters (e.g., colons)
@zhanghai is already working on this.
Since Apr 29, 2026.
- Dominant language
- Kotlin
- Stars
- 9k
- Forks
- 736
- PR merge metrics
- No merged PRs in 30d
Description
When attempting to extract certain archives, the process fails with an AccessDeniedException / "Operation not permitted" error. This occurs when the files inside the archive contain characters that are not allowed by the Android file system (such as colons :, question marks ?, or asterisks *).
Other file managers (like Samsung's My Files) handle this by automatically sanitizing/replacing the forbidden characters during extraction, allowing the extraction to succeed. Material Files currently attempts to write the file with the exact original name, causing the OS to block the operation.
Steps to Reproduce:
- Download an archive where the files inside it have forbidden characters.
- Open the archive in Material Files and attempt to extract it to a directory.
- Observe the error prompt.
Expected Behavior:
Material Files should automatically replace forbidden file name characters (like :) with allowed alternatives (like - or _) during extraction so the file can be written successfully. Alternatively, it should prompt the user to rename the file, rather than just failing with a vague permission error.
Actual Behavior:
Extraction fails with a java.nio.file.AccessDeniedException and the message "Operation not permitted".
Technical Context / Root Cause:
The archive file name uses an underscore (Tomodachi Life_ Living the Dream...), which is perfectly valid. However, the file contained inside the archive uses a colon (Tomodachi Life: Living the Dream...).
Android's primary storage (/storage/emulated/0/) uses a file system (FUSE/SDCardFS emulating FAT32/exFAT) that strictly forbids certain characters in file names. When Material Files tries to create the file with the colon : in its name, the Android OS denies the write operation, triggering the AccessDeniedException.
Device Info:
- App Version: 1.7.4
- Android Version: Android 16
- Device: Samsung Galaxy S26 Ultra
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.