app-info-parser is a parser for parsing .ipa
or .apk
files. It will return the information with json from AndroidManifest.xml
or Info.plist
.
npm install app-info-parser
# or yarn
yarn add app-info-parser
const AppInfoParser = require('app-info-parser')
const parser = new AppInfoParser('../packages/test.apk') // or xxx.ipa
parser.parse().then(result => {
console.log('app info ----> ', result)
console.log('icon base64 ----> ', result.icon)
}).catch(err => {
console.log('err ----> ', err)
})
<input type="file" name="file" id="file" onchange="fileSelect()">
<script src="/dist/app-info-parser.js"></script>
<script>
function fileSelect () {
const files = document.getElementById('file').files
const parser = new AppInfoParser(files[0])
parser.parse().then(result => {
console.log('app info ----> ', result)
console.log('icon base64 ----> ', result.icon)
}).catch(err => {
console.log('err ----> ', err)
})
}
</script>
You can use demand loading, when you only need one parser.
const ApkParser = require('app-info-parser/src/apk')
const parser = new ApkParser('../packages/test.apk')
parser.parse().then(result => {
console.log('app info ----> ', result)
console.log('icon base64 ----> ', result.icon)
}).catch(err => {
console.log('err ----> ', err)
})
const IpaParser = require('app-info-parser/src/ipa')
const parser = new IpaParser('../packages/test.ipa')
parser.parse().then(result => {
console.log('app info ----> ', result)
console.log('icon base64 ----> ', result.icon)
}).catch(err => {
console.log('err ----> ', err)
})
constructor(file)
file
Blob or File in browser, Path in Node
parse: () => Promise<Object>
A function return a promise, which resolving the parse result
MIT