Skip to content

Asynchronous parsing of Android APKs for node.js w/ promise-based API

Notifications You must be signed in to change notification settings

scorpiodawg/node-apk-parser-promise

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-apk-parser-promise

This is a library to enable parsing and inspecting an Android APK file asynchronously via promises (using bluebird). It currently exposes information about:

  • the APK manifest (AndroidManifest.xml)
  • the signing certificate with details on the Issuer and Subject, whether or not it is signed with the Android debug certificate, as well as expiry status.

NOTE: This code is under development.

Install via NPM:

npm install --save node-apk-parser-promise

Usage

Basic usage via promises looks like this:

var reader;

require('node-apk-parser-promise')
  .load('./test.apk') // Start the open+read of the ZIP file
  .then((r) => {
    // Got an ApkReader object, cache it here for later use, or start reading
    // the manifest
    reader = r;
    return reader.readManifest();
  })
  .then((manifest) => {
    // Got the APK's AndroidManifest.xml object
    console.log(manifest);
    // Now read the certificate info
    return reader.readCertificate();
  })
  .then((certInfo) => {
    console.log(JSON.stringify(certInfo));
  })
  .catch((err) => {
    console.error("ERROR: " + err);
  })
  .finally(() => {
    reader && reader.close();
  });

Run node test/test-parse.js [path-to-apk] to see the output.

Credits

About

Asynchronous parsing of Android APKs for node.js w/ promise-based API

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%