https://github.com/qucumbah/aab-parser
Parser for Android app bundles
https://github.com/qucumbah/aab-parser
aab android npm typescript
Last synced: about 1 month ago
JSON representation
Parser for Android app bundles
- Host: GitHub
- URL: https://github.com/qucumbah/aab-parser
- Owner: qucumbah
- License: mit
- Created: 2021-08-19T08:53:09.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-03-05T06:02:08.000Z (over 4 years ago)
- Last Synced: 2025-03-06T00:19:15.007Z (over 1 year ago)
- Topics: aab, android, npm, typescript
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/aab-parser
- Size: 50.8 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# aab-parser
[](https://github.com/qucumbah/aab-parser/actions/workflows/npm-publish.yml)
[](https://www.npmjs.com/package/aab-parser)
[](https://www.npmjs.com/package/aab-parser)
A lightweight Android app bundle parser written in Typescript with asynchronous interface. Works on pure Node JS, doesn't require additional installation of JDK.
## API
### `Manifest` type
This interface represents a subset of AAB attributes.
Only these fields are represented:
| Attribute | Description | Type |
| --- | --- | --- |
| versionCode | A positive integer used as an internal version number | number |
| versionName | A string used as the version number shown to users | string |
| packageName | A unique application ID, such as com.example.myapp | string |
| compiledSdkVersion | Which Android SDK version was used to compile the app | number |
| compiledSdkVersionCodename | Target Android version | number |
### `parseAabManifest` function
This function accepts either a path to the aab, or a buffer with app bundle content.
Asynchronously parses the app bundle manifest and returns it as an instance of `Manifest`.
### `parseAabManifestJSON` function
This function accepts either a path to the aab, or a buffer with app bundle content.
Asynchronously parses the app bundle manifest and returns it a plain JSON object. This object contains more fields compared to an instance of `Manifest`, but it's not typed.
## Usage example
```ts
const aabParser = require('aab-parser');
const manifest: aabParser.Manifest = await aabParser.parseAabManifest('./bundle.aab');
console.log(manifest);
```
Result:
```
{
versionCode: 3830,
versionName: '1.0.0',
packageName: 'com.abtt.testandroidapp',
compiledSdkVersion: 29,
compiledSdkVersionCodename: 10
}
```