With npm do:
npm install node-aapt --save
Using a callback:
const packageInfo = require('node-aapt');
packageInfo('/path/to/your/ExampleApp.apk', (err, data) => {
if (err) {
// something went wrong
} else {
console.log(data);
}
});
Using a promise:
const packageInfo = require('node-aapt');
packageInfo('/path/to/your/ExampleApp.apk')
.then (data => {
console.log(data)
})
.catch (err) {
// something went wrong
}
In the console output you will see something like this:
{ packageName: 'com.example.app',
versionCode: '12',
versionName: '1.2.3' }
Type: String
Path to your APK file.
Type: function (err, data)
Type: Object
It contains the parsed data obtained from aapt tool.
MIT © Makarian Vladyslav