xdevl / node-apk

A library to parse Android application's manifest and signature
MIT License
21 stars 5 forks source link

How to get apk icon #2

Closed grace618 closed 3 years ago

grace618 commented 3 years ago

How to get apk icon and name

xdevl commented 3 years ago

Hi there, this is already mentioned in the README but just in case you missed it:

const apk = new Apk("yourapplication.apk");
const iconBytes = Promise.all<Manifest, Resources>([apk.getManifestInfo(), apk.getResources()])
    .then(([manifest, resources])) => {
        // resolve and extract the first application icon found
        return apk.extract(resources.resolve(manifest.applicationIcon)[0]);
    }