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

Fix: Fixed issue where it didn't work to open password protected archives #12708

Merged
merged 41 commits into from Jul 9, 2023

Conversation

gave92
Copy link
Member

@gave92 gave92 commented Jun 24, 2023

Resolved / Related Issues

  • 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 Bug: Cannot open password-protected 7-Zip files #12105

Validation
How did you test these changes?

  • 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?
  • Did you implement any design changes to an existing feature?
    • CredentialDialog was modified to only show password field for zip files
  • 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 gave92 marked this pull request as draft June 24, 2023 08:29
@gave92 gave92 marked this pull request as ready for review June 24, 2023 09:30
@QuaintMako
Copy link
Contributor

QuaintMako commented Jul 1, 2023

@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.

@gave92
Copy link
Member Author

gave92 commented Jul 4, 2023

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

@yaira2 yaira2 requested a review from QuaintMako July 7, 2023 14:12
@d2dyno1
Copy link
Member

d2dyno1 commented Jul 7, 2023

Would it be possible to use the new storage abstractions?

@gave92
Copy link
Member Author

gave92 commented Jul 7, 2023

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.

@d2dyno1
Copy link
Member

d2dyno1 commented Jul 7, 2023

Alright, I agree 👍

@yaira2 yaira2 changed the title Fix: Fixed an issue where it didn't work to open password protected zip files Fix: Fixed issue where it didn't work to open password protected zip files Jul 9, 2023
@yaira2 yaira2 changed the title Fix: Fixed issue where it didn't work to open password protected zip files Fix: Fixed issue where it didn't work to open password protected zip files Jul 9, 2023
@yaira2 yaira2 changed the title Fix: Fixed issue where it didn't work to open password protected zip files Fix: Fixed issue where it didn't always work to open password protected archives Jul 9, 2023
Copy link
Contributor

@QuaintMako QuaintMako left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the big work on the refactoring @gave92 and sorry for the late answer.

@yaira2 yaira2 merged commit 0b89468 into files-community:main Jul 9, 2023
2 checks passed
@yaira2 yaira2 changed the title Fix: Fixed issue where it didn't always work to open password protected archives Fix: Fixed issue where it didn't work to open password protected archives Jul 9, 2023
@gave92 gave92 deleted the issue_12105 branch July 9, 2023 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Cannot open password-protected 7-Zip files
4 participants