Files icon indicating copy to clipboard operation
Files copied to clipboard

Fix: Fixed an issue where it didn't work to open password protected zip files

Open gave92 opened this issue 1 year ago • 2 comments

Resolved / Related Issues

  • [x] Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers. Closes #12105

Validation How did you test these changes?

  • [x] Did you build the app and test your changes?
  • [ ] Did you check for accessibility? You can use Accessibility Insights for this.
  • [ ] Did you remove any strings from the en-us resource file?
    • [ ] Did you search the solution to see if the string is still being used?
  • [x] Did you implement any design changes to an existing feature?
    • [x] CredentialDialog was modified to only show password field for zip files
  • [x] Are there any other steps that were used to validate these changes?
    1. Tested browsing end extracting the attached archives (a rar with no password, a 7z with password "pass" and encrypted file names, a zip with password "pass"
    2. Tested browsing FTP drives

Screenshots (optional)

test_zips.zip

gave92 avatar Jun 24 '23 08:06 gave92

/azp run

gave92 avatar Jun 24 '23 09:06 gave92

Commenter does not have sufficient privileges for PR 12708 in repo files-community/Files

azure-pipelines[bot] avatar Jun 24 '23 09:06 azure-pipelines[bot]

@gave92 do you think a new helper class along the lines of src/Files.App/Filesystem/StorageFileHelpers/PasswordProtectedItemHelpers.cs could work to refactor the common methods?

Second idea would be to create a new class named PasswordProtectedBaseStorage : BaseStorageFile, IPasswordProtected and have the methods inside. Then, make the concerned classes inherit it. BaseStorageFile being abstract, we can also have PasswordProtectedBaseStorage be abstract as well, hence ensuring no idea will ever be concerned by it.

Before going down the path of the second idea, we could use input from @yaira2 and @d2dyno1.

QuaintMako avatar Jul 01 '23 21:07 QuaintMako

Ok this is about the best I can think of to reduce code duplication (using default interface implementations).

gave92 avatar Jul 04 '23 09:07 gave92

Would it be possible to use the new storage abstractions?

d2dyno1 avatar Jul 07 '23 20:07 d2dyno1

I'd rather merge it like this and then work on switching to the alternate abstractions for each storage item. It's a lot of work & testing to do everything in one swoop.

gave92 avatar Jul 07 '23 21:07 gave92

Alright, I agree 👍

d2dyno1 avatar Jul 07 '23 21:07 d2dyno1