zhanghai / zhanghai/MaterialFiles

Extracting creates a directory even when not needed

Open
#1,267 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Kotlin
Stars
9k
Forks
736
PR merge metrics
No merged PRs in 30d

Description

Extracting archives from the context menu (three dots) causes Material Files to create a separate directory in the target location (presumably for tarbomb protection), even if there's only file (plain or directory) in the archive. This behavior can be confusing to users (have had a confused user report this to me).

Reproducing

  1. Download the examples onto your device.

    As you can see, neither example is a tarbomb.

  2. In Material Files, open the context menu for each and extract them somewhere.

Observed behavior

The following directory structure for extracted single_file.zip:

  • single_file (directory)
    • foo

The following directory structure for extracted single_dir.zip:

  • single_dir (directory)
    • foo (directory)
      • foo
      • bar

Expected behavior

The following directory structure for extracted single_file.zip:

  • foo

The following directory structure for extracted single_dir.zip:

  • foo (directory)
    • foo
    • bar

For actual tarbombs, the behavior should remain as it is.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the context-menu extraction flow and reproduce the behavior with the supplied single_file.zip and single_dir.zip examples. Compare extraction handling for archives with one top-level file or directory against actual tarbombs; done means the two examples extract directly while tarbomb protection remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.