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

feature: support decompress and list archive file with password #646

Merged
merged 24 commits into from
Sep 7, 2024

Conversation

ttys3
Copy link
Contributor

@ttys3 ttys3 commented Mar 24, 2024

resolve #576

there's a bug in unrar.rs I submitted a PR muja/unrar.rs#49

we need to wait upstream get merged so that we can have CJK filename support for rar files

@ttys3 ttys3 marked this pull request as draft March 24, 2024 06:29
@ttys3 ttys3 changed the title refactor: support decompress and list archive file with password [WIP] refactor: support decompress and list archive file with password Mar 24, 2024
@ttys3 ttys3 force-pushed the ttys3 branch 3 times, most recently from 443219b to 1f33cca Compare March 24, 2024 11:54
@ttys3 ttys3 force-pushed the ttys3 branch 4 times, most recently from 04edb66 to 3375d34 Compare April 2, 2024 16:58
@ttys3
Copy link
Contributor Author

ttys3 commented Apr 2, 2024

finally get tests issue on musl libc, aarch64, armv7 and macOS resolved.

@ttys3 ttys3 changed the title [WIP] refactor: support decompress and list archive file with password refactor: support decompress and list archive file with password Sep 1, 2024
@ttys3 ttys3 marked this pull request as ready for review September 1, 2024 18:48
@ttys3
Copy link
Contributor Author

ttys3 commented Sep 1, 2024

good news, After waiting for a rather long time, the upstream finally merged my PR.

we can continue this PR now

@ttys3 ttys3 changed the title refactor: support decompress and list archive file with password feature: support decompress and list archive file with password Sep 2, 2024
@ttys3
Copy link
Contributor Author

ttys3 commented Sep 2, 2024

all checks are green now, cheers!

I updated cross-rs image for aarch64-unknown-linux-gnu and armv7-unknown-linux-gnueabihf because its gcc version is too old.

see
https://github.com/cross-rs/cross/blob/4645d937bdae6952d9df38eff3ecb91fd719c3bd/README.md?plain=1#L323

image

Copy link
Member

@marcospb19 marcospb19 left a comment

Choose a reason for hiding this comment

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

Awesome PR! It covers a lot of things right and I appreciate the effort.

I updated cross-rs image for aarch64-unknown-linux-gnu and armv7-unknown-linux-gnueabihf because its gcc version is too old.

That's great!! I had no idea what was going on and this was blocking another PRs, that's a huge win, ty ty.


Although the PR is great, there is some rough edges to adjust.

I see you've done a hell lot for me in this one, so let me know if you want me to make the final adjustments for you 😉.

Cross.toml Outdated Show resolved Hide resolved
src/cli/args.rs Outdated Show resolved Hide resolved
src/archive/rar.rs Outdated Show resolved Hide resolved
src/archive/rar.rs Outdated Show resolved Hide resolved
src/archive/rar.rs Outdated Show resolved Hide resolved
src/archive/sevenz.rs Outdated Show resolved Hide resolved
src/archive/sevenz.rs Outdated Show resolved Hide resolved
src/archive/zip.rs Outdated Show resolved Hide resolved
src/archive/zip.rs Outdated Show resolved Hide resolved
src/archive/zip.rs Outdated Show resolved Hide resolved
Refactor password handling in archive functions to use &[u8] instead of impl AsRef<[u8]>. Include better error reporting for invalid UTF-8 passwords in 7z archives.
src/archive/zip.rs Outdated Show resolved Hide resolved
src/archive/sevenz.rs Outdated Show resolved Hide resolved
Handle errors for unsupported formats in RAR and 7z archives by returning appropriate error messages.
Update error handling for unrar-specific issues to use the new UnrarError type.
Replace enclosed_name with mangled_name fallback for robustness.
Refactor list_archive functions to return results directly for better error handling.
Simplify password handling by removing platform-specific code and utilizing ByteSlice for all conversions.
Simplify the list_archive function by combining archive creation and listing steps.
Remove the UnrarError variant from the Error enum as it's no longer used.
Copy link
Member

@marcospb19 marcospb19 left a comment

Choose a reason for hiding this comment

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

Thanks for the follow-ups and all the effort!

🎉

@marcospb19 marcospb19 merged commit a3d4f6a into ouch-org:main Sep 7, 2024
82 checks passed
@ttys3 ttys3 deleted the ttys3 branch September 7, 2024 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for encrypted archives
2 participants