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: Added support for opening and extracting mrpack files #14942

Merged
merged 1 commit into from Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Files.App (Package)/Package.appxmanifest
Expand Up @@ -142,6 +142,7 @@
<uap:FileType>.rar</uap:FileType>
<uap:FileType>.tar</uap:FileType>
<uap:FileType>.jar</uap:FileType>
<uap:FileType>.mrpack</uap:FileType>
</uap:SupportedFileTypes>
<uap:Logo>assets\archives\ExtensionIcon.png</uap:Logo>
</uap:FileTypeAssociation>
Expand Down
4 changes: 2 additions & 2 deletions src/Files.Shared/Helpers/FileExtensionHelpers.cs
Expand Up @@ -72,7 +72,7 @@ public static bool IsPowerShellFile(string fileExtensionToCheck)
/// <returns><c>true</c> if the fileExtensionToCheck is a zip bundle file; otherwise, <c>false</c>.</returns>
public static bool IsZipFile(string? fileExtensionToCheck)
{
return HasExtension(fileExtensionToCheck, ".zip", ".msix", ".appx", ".msixbundle", ".appxbundle", ".7z", ".rar", ".tar", ".mcpack", ".mcworld", ".jar", ".gz", ".lzh");
return HasExtension(fileExtensionToCheck, ".zip", ".msix", ".appx", ".msixbundle", ".appxbundle", ".7z", ".rar", ".tar", ".mcpack", ".mcworld", ".mrpack", ".jar", ".gz", ".lzh");
}

public static bool IsBrowsableZipFile(string? filePath, out string? ext)
Expand All @@ -85,7 +85,7 @@ public static bool IsBrowsableZipFile(string? filePath, out string? ext)
}

// Only extensions we want to browse
ext = new[] { ".zip", ".7z", ".rar", ".tar", ".gz", ".lzh", ".jar" }
ext = new[] { ".zip", ".7z", ".rar", ".tar", ".gz", ".lzh", ".mrpack", ".jar" }
.FirstOrDefault(x => filePath.Contains(x, StringComparison.OrdinalIgnoreCase));

return ext is not null;
Expand Down