Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
adbkit-apkreader
Advanced tools
adbkit-apkreader provides a Node.js API for extracting information from Android APK files. For example, it allows you to read the AndroidManifest.xml
of an existing APK file.
Install via NPM:
npm install --save adbkit-apkreader
Note that while adbkit-apkreader is written in CoffeeScript, it is compiled to JavaScript before being published to NPM, which means that you are not required to use CoffeeScript.
AndroidManifest.xml
of an APKconst util = require('util')
const ApkReader = require('adbkit-apkreader')
ApkReader.open('HelloApp.apk')
.then(reader => reader.readManifest())
.then(manifest => console.log(util.inspect(manifest, { depth: null })))
Alternate syntax to manually creating an ApkReader instance. Currently, only files are supported, but support for streams might be added at some point.
Note that currently this method cannot reject as the file is opened lazily, but this may change in the future and therefore returns a Promise for fewer future compatibility issues. On a related node, calling the constructor directly is still possible, but discouraged.
Promise
that resolves with an ApkReader
instance.Reads and parses the AndroidManifest.xml
file inside the APK and returns a simplified object representation of it.
Promise
that resolves with a JavaScript Object
representation of the manifest. See example output below. Rejects on error (e.g. if parsing was unsuccessful).{ versionCode: 1,
versionName: '1.0',
package: 'com.example.hello.helloapp.app',
usesPermissions: [],
permissions: [],
permissionTrees: [],
permissionGroups: [],
instrumentation: null,
usesSdk: { minSdkVersion: 7, targetSdkVersion: 19 },
usesConfiguration: null,
usesFeatures: [],
supportsScreens: null,
compatibleScreens: [],
supportsGlTextures: [],
application:
{ theme: 'resourceId:0x7f0b0000',
label: 'resourceId:0x7f0a000e',
icon: 'resourceId:0x7f020057',
debuggable: true,
allowBackup: true,
activities:
[ { label: 'resourceId:0x7f0a000e',
name: 'com.example.hello.helloapp.app.MainActivity',
intentFilters:
[ { actions: [ { name: 'android.intent.action.MAIN' } ],
categories: [ { name: 'android.intent.category.LAUNCHER' } ],
data: [] } ],
metaData: [] } ],
activityAliases: [],
launcherActivities:
[ { label: 'resourceId:0x7f0a000e',
name: 'com.example.hello.helloapp.app.MainActivity',
intentFilters:
[ { actions: [ { name: 'android.intent.action.MAIN' } ],
categories: [ { name: 'android.intent.category.LAUNCHER' } ],
data: [] } ],
metaData: [] } ],
services: [],
receivers: [],
providers: [],
usesLibraries: [] } }
Reads and parses the binary XML file at the given path inside the APK file. Attempts to be somewhat compatible with the DOM API.
AndroidManifest.xml
as the path would parse the manifest (but you'll probably want to use reader.readManifestSync()
instead).Promise
that resolves with a JavaScript Object
representation of the root node of the XML file. All nodes including the root node have the properties listed below. Rejects on error (e.g. if parsing was unsuccessful).
null
if none.1
for element nodes, 2
for attribute nodes, and 4
for CData sections.null
, String
, Boolean
, Number
or even an Object
for the most complex types.String
representation of the type of the value.See CONTRIBUTING.md.
See LICENSE.
Copyright © The OpenSTF Project. All Rights Reserved.
2.0.0 (2017-01-24)
It was discovered that our previous Zip parser, adm-zip, could not handle all valid Zip formats. We've therefore switched to yauzl which provides an asynchronous interface. Therefore the following breaking API changes were required:
ApkReader.readFile()
with a Promise-returning ApkReader.open()
which describes it better, and we have no way of supporting the previous synchronous method with the new dependency.ApkReader.readManifestSync()
with a Promise-returning ApkReader.readManifest()
as we have no way of supporting the synchronous method with the new dependency.ApkReader.readXmlSync()
with a Promise-returning ApkReader.readXml()
as we have no way of supporting the synchronous method with the new dependency.FAQs
Extracts information from APK files.
The npm package adbkit-apkreader receives a total of 40,813 weekly downloads. As such, adbkit-apkreader popularity was classified as popular.
We found that adbkit-apkreader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.