This is a TypeScript project that extracts the packageName, versionCode, and versionName from an Android APK file by retrieving the AndroidManifest.xml file. This project can be used by both client side and node.
Installation and Setup
To install, follow these steps:
npm i apk-manifest-parserwhere you wish to install the package
- Import the package where you require it's use
import ManifestParser from 'apk-manifest-parser';
- Call the
extractApkManifestfunction passing in the apk file - this returns a promise so will need to follow up with a
.then()which returns an object
ManifestPackageDetailsor the error handler object
- If you wish to extract information other than the 3 currently supported, pass in an array of the names you wish to retrieve (i.e.
['packageName', 'customValue']), these results will be returned in the altOptions array.
If you would like to contribute to this project, feel free to create a pull request.
This project is licensed under the MIT License.