Skip to content

Commit

Permalink
Add AAB format support
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecot committed Jan 24, 2024
1 parent c08caf0 commit 84d6392
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ identification.
### Package

- Adobe Integrated Runtime (AIR)
- Android App Bundle (AAB)
- Android Package (APK)
- AppImage
- Debian Binary Package (DEB)
Expand Down
Binary file added fixtures/package/sample.aab
Binary file not shown.
7 changes: 7 additions & 0 deletions src/formats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ formats! {
extension = "adf"
kind = Disk

format = AndroidAppBundle
name = "Android App Bundle"
short_name = "AAB"
media_type = "application/vnd.android.aab"
extension = "aab"
kind = Package

format = AndroidBinaryXml
name = "Android Binary XML"
short_name = "AXML"
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ identification.
- `reader-zip` - Enables [ZIP](`FileFormat::Zip`)-based file formats detection.
* [3D Manufacturing Format (3MF)](`FileFormat::ThreeDimensionalManufacturingFormat`)
* [Adobe Integrated Runtime (AIR)](`FileFormat::AdobeIntegratedRuntime`)
* [Android App Bundle (AAB)](`FileFormat::AndroidAppBundle`)
* [Android Package (APK)](`FileFormat::AndroidPackage`)
* [Autodesk 123D (123DX)](`FileFormat::Autodesk123d`)
* [Circuit Diagram Document (CDDX)](`FileFormat::CircuitDiagramDocument`)
Expand Down
1 change: 1 addition & 0 deletions src/readers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@ impl crate::FileFormat {
"AppManifest.xaml" => return Ok(Self::Xap),
"AppxManifest.xml" => return Ok(Self::WindowsAppPackage),
"AppxMetadata/AppxBundleManifest.xml" => return Ok(Self::WindowsAppBundle),
"BundleConfig.pb" => return Ok(Self::AndroidAppBundle),
"META-INF/AIR/application.xml" => return Ok(Self::AdobeIntegratedRuntime),
"META-INF/MANIFEST.MF" => fmt = Self::JavaArchive,
"META-INF/application.xml" => return Ok(Self::EnterpriseApplicationArchive),
Expand Down
7 changes: 7 additions & 0 deletions tests/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ fn test_adobe_integrated_runtime() {
assert_eq!(fmt, FileFormat::AdobeIntegratedRuntime);
}

#[cfg(feature = "reader-zip")]
#[test]
fn test_android_app_bundle() {
let fmt = FileFormat::from_file("fixtures/package/sample.aab").unwrap();
assert_eq!(fmt, FileFormat::AndroidAppBundle);
}

#[cfg(feature = "reader-zip")]
#[test]
fn test_android_package() {
Expand Down

0 comments on commit 84d6392

Please sign in to comment.