Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't open folders with plus ("+") in the name #3560

Closed
infinity0 opened this issue Oct 9, 2022 · 4 comments · Fixed by #3661 · May be fixed by #3596
Closed

Can't open folders with plus ("+") in the name #3560

infinity0 opened this issue Oct 9, 2022 · 4 comments · Fixed by #3661 · May be fixed by #3596
Assignees
Labels
Area-FileOperations Related to file operations (e.g. moving, copying, renaming). Bounty Issue-Bug Related unexpected behavior or something worth investigating. Issue-Severe (high) Showstopper issues that require immediate attention
Milestone

Comments

@infinity0
Copy link

infinity0 commented Oct 9, 2022

To Reproduce
Steps to reproduce the behavior:

  1. Create a folder called "a+b".
  2. Tap on "a+b". Notice that Amaze tries to open "a b" instead.
  3. Using the system file manager, move or create some files in the "a+b" folder.
  4. Notice that Amaze still thinks "a b" contains 0 folders and 0 files.
  5. Via Amaze, try to move or create some files in the "a b" folder. You'll get "Operation unsuccessful" or some other error.

Expected behavior
Amaze should be opening the "a+b" folder.

This now has a bounty, here.

Please claim after a PR fixing this issue is accepted.
Remember that you can also back the issue adding to the bounty!

@infinity0
Copy link
Author

Bug exists on Amaze 3.8.2, latest version from F-Droid.

@infinity0
Copy link
Author

Amaze also cannot delete the folder either, presumably it is trying to delete "a b" instead and failing.

@VishnuSanal VishnuSanal added the Issue-Bug Related unexpected behavior or something worth investigating. label Oct 10, 2022
@EmmanuelMess EmmanuelMess added Issue-Severe (high) Showstopper issues that require immediate attention Area-FileOperations Related to file operations (e.g. moving, copying, renaming). labels Oct 16, 2022
@EmmanuelMess
Copy link
Member

This now has a bounty, here.

Please claim after a PR fixing this issue is accepted.
Remember that you can also back the issue adding to the bounty!

@stevealexr
Copy link

stevealexr commented Oct 26, 2022

It is caused by the url decoder in getPath() function in HybridFile.java. Instances of HybridFile are created in ListFilesCommand.kt. Then, they are converted to LayoutElementParcelable with the path provided by getPath() function. The function url decodes the stored path string in HybridFile which converts + to .

/**
 * Path accessor. Avoid direct access to path since path may have been URL encoded.
 *
 * @return URL decoded path
 */
public String getPath() {
    try {
      return URLDecoder.decode(path, "UTF-8");
    } catch (UnsupportedEncodingException ignored) {
      return path;
    }
}

Possible fixes:

  1. Remove the url decoder and ensure the provided path is already decoded in constructor.
  2. Expose the raw path string through a method.

@TranceLove TranceLove self-assigned this Jan 20, 2023
TranceLove added a commit to TranceLove/AmazeFileManager that referenced this issue Jan 22, 2023
With test cases, with test cases to prove TeamAmaze#2964 will work.

Fixes TeamAmaze#3560, fixes TeamAmaze#3636, fixes TeamAmaze#2964
TranceLove added a commit to TranceLove/AmazeFileManager that referenced this issue Jan 22, 2023
With test cases, with test cases to prove TeamAmaze#2964 will work.

Fixes TeamAmaze#3560, fixes TeamAmaze#3636, fixes TeamAmaze#2964
TranceLove added a commit to TranceLove/AmazeFileManager that referenced this issue Jan 22, 2023
With test cases, with test cases to prove TeamAmaze#2964 will work.

Fixes TeamAmaze#3560, fixes TeamAmaze#3636, fixes TeamAmaze#2964
TranceLove added a commit to TranceLove/AmazeFileManager that referenced this issue Jan 30, 2023
With test cases, with test cases to prove TeamAmaze#2964 will work.

Fixes TeamAmaze#3560, fixes TeamAmaze#3636, fixes TeamAmaze#2964
TranceLove added a commit to TranceLove/AmazeFileManager that referenced this issue Feb 5, 2023
With test cases, with test cases to prove TeamAmaze#2964 will work.

Fixes TeamAmaze#3560, fixes TeamAmaze#3636, fixes TeamAmaze#2964
TranceLove added a commit to TranceLove/AmazeFileManager that referenced this issue Feb 20, 2023
With test cases, with test cases to prove TeamAmaze#2964 will work.

Fixes TeamAmaze#3560, fixes TeamAmaze#3636, fixes TeamAmaze#2964
@VishalNehra VishalNehra added this to the v4.0 milestone Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-FileOperations Related to file operations (e.g. moving, copying, renaming). Bounty Issue-Bug Related unexpected behavior or something worth investigating. Issue-Severe (high) Showstopper issues that require immediate attention
Projects
None yet
6 participants