API Reference Overview
This section provides detailed documentation for all Node-APK exports.
Core Classes
| Class | Description |
|---|---|
| Apk | Main class for parsing APK files |
| Manifest | Parsed AndroidManifest.xml information |
| Certificate | Signing certificate with chain support |
| Resources | Resource table parser for strings, icons, etc. |
| XmlElement | Binary XML element representation |
Supporting Classes
| Class | Description |
|---|---|
Receiver | Broadcast receiver information |
Locale | Resource locale (language/country) |
Resource | Individual resource value with locale |
Source | Binary data source reader |
ZipEntry | ZIP entry handler |
Types
| Type | Description |
|---|---|
ResourceValue | Union type for resource values |
LabelOptions | Options for getLabel() method |
IconOptions | Options for getLauncherIcon() method |
IconDensity | Icon density values |
ChunkType | Binary chunk type enum |
BufferLoader | Function type for buffer loading |
Quick Reference
Apk
typescript
import { Apk } from "node-apk";
const apk = new Apk(pathOrBuffer);
// Manifest
const manifest = await apk.getManifestInfo();
// Certificate
const certs = await apk.getCertificateInfo();
// Resources
const resources = await apk.getResources();
// Helper methods
const label = await apk.getLabel(options?);
const icon = await apk.getLauncherIcon(options?);
// Extraction
const file = await apk.extract(path);Manifest
typescript
const manifest = await apk.getManifestInfo();
// Properties
manifest.package // string
manifest.versionCode // number
manifest.versionName // string
manifest.applicationLabel // string | number
manifest.applicationIcon // number
// Iterables
[...manifest.permissions] // string[]
[...manifest.receivers] // Receiver[]
// Raw access
manifest.raw // XmlElementCertificate
typescript
const certs = await apk.getCertificateInfo();
const cert = certs[0];
// Properties
cert.serial // string
cert.validFrom // Date
cert.validUntil // Date
cert.bytes // Buffer (DER encoded)
// Maps
cert.issuer.get("CN") // string | undefined
cert.subject.get("CN") // string | undefined
// Chain
cert.parent // Certificate | undefined
cert.chain // Certificate[]Resources
typescript
const resources = await apk.getResources();
// Resolve resource ID
const resolved = resources.resolve(0x7f040001);
// Resource[] with value and locale
// Access values
resolved[0]?.value // ResourceValue
resolved[0]?.locale // Locale | undefinedModule Structure
typescript
// Main exports
export { Apk } from "./apk.js";
export { Certificate } from "./certificate.js";
export { Manifest, Receiver } from "./android.js";
export { Locale, Resource, Resources } from "./resources.js";
export { XmlElement } from "./xml.js";
export { Source } from "./source.js";
export { ZipEntry, BufferLoader } from "./zip.js";
// Type exports
export {
Chunk,
ChunkType,
StringPool,
parseResourceValue,
type ResourceValue,
} from "./common.js";
// Additional type exports from apk.ts
export type {
LabelOptions,
IconOptions,
IconDensity,
} from "./apk.js";