zhanghai / MaterialFiles

Material Design file manager for Android
https://play.google.com/store/apps/details?id=me.zhanghai.android.files
GNU General Public License v3.0
5.68k stars 383 forks source link

.tar and .xz support #804

Open AndroMaster436 opened 2 years ago

AndroMaster436 commented 2 years ago

Plz add support for opening .tar and .xz archives

zhanghai commented 2 years ago

Works fine for me. What exactly isn't working for you?

AndroMaster436 commented 2 years ago

Screenshot_2022-05-27-02-53-42-922_me zhanghai android files @zhanghai

zhanghai commented 2 years ago

I see. Yes, currently archive-only files are supported (e.g. .tar), but compressed-only files aren't (e.g. .xz but not .tar.xz). More logic will be needed to emulate such files as archives.

zhanghai commented 2 years ago

There is a problem though - if there is a file named simply .xz, what should be the name of its uncompress content?

AndroMaster436 commented 2 years ago

@zhanghai the archive contains a library in the .so format

zhanghai commented 2 years ago

I know, but I assume that's not an archive file, just a compressed file. TAR is an archive format which internally supports bundling multiple files together, with their names and contents, while XZ is just an extension showing that the file is compressed and doesn't necessarily have that structure.

I assume you would expect opening that file would show that it contains a file named frida-gadget-15.1.22-android-arm64.so, but I don't think that's the actual underlying format because the file isn't e.g. a TAR and there's no place to store that file name. So if you ever see that name, it's probably derived from the actual file by removing the .xz extension. Hence I was asking the question that, what should be the name of the contained file if the compressed file is simply named .xz, which is a perfectly legal file name.

groszdaniel commented 1 year ago

Perhaps don't support opening a plain .xz file like an archive, just support extracting it. The extracted file should have the same name as the original, just with the .xz removed. Currently that doesn't work either: it shows "Extracting 1", but it doesn't seem to do anything, and tapping on the "log" icon shows an exception.