Skip to content

Commit

Permalink
Add AppImage support
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecot committed Jan 23, 2024
1 parent 2670cc5 commit 7ad9d5f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ identification.

- Adobe Integrated Runtime (AIR)
- Android Package (APK)
- AppImage
- Debian Binary Package (DEB)
- Enterprise Application Archive (EAR)
- Google Chrome Extension (CRX)
Expand Down
Binary file added fixtures/package/sample.AppImage
Binary file not shown.
6 changes: 6 additions & 0 deletions src/formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ formats! {
extension = "parquet"
kind = Other

format = Appimage
name = "AppImage"
media_type = "application/x-appimage"
extension = "AppImage"
kind = Package

format = AppleDiskImage
name = "Apple Disk Image"
short_name = "DMG"
Expand Down
3 changes: 3 additions & 0 deletions src/signatures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,9 @@ signatures! {
format = AnimatedPortableNetworkGraphics
value = b"\x89PNG\r\n\x1A\n", b"acTL" offset = 37

format = Appimage
value = b"\x7FELF", b"AI\x02\x00\x00\x00\x00\x00" offset = 8

format = CdAudio
value = b"RIFF", b"CDDAfmt " offset = 8

Expand Down
6 changes: 6 additions & 0 deletions tests/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ fn test_android_package() {
assert_eq!(fmt, FileFormat::AndroidPackage);
}

#[test]
fn test_appimage() {
let fmt = FileFormat::from_file("fixtures/package/sample.AppImage").unwrap();
assert_eq!(fmt, FileFormat::Appimage);
}

#[test]
fn test_debian_binary_package() {
let fmt = FileFormat::from_file("fixtures/package/sample.deb").unwrap();
Expand Down

0 comments on commit 7ad9d5f

Please sign in to comment.