npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

a2h-resource

v0.1.2

Published

One-shot Android APK resource decoder/extractor — pure Node.js, dependency-free.

Readme

a2h-resource

English | 简体中文

一个零依赖的 Node.js 工具,用一条命令解码整个 Android APK 的资源——把编译后的二进制 格式(AndroidManifest.xmlresources.arsc、编译后的 layout/drawable XML、9-patch PNG)还原成可读、真实命名、按限定符目录组织的资源文件。

  • 纯 JavaScript(ESM),无原生依赖、无运行时依赖。
  • Node.js >= 20
  • Apache-2.0 协议。

使用方法

node src/a2h-resource.js app.apk -o app-out
# 若已全局安装:
a2h-resource app.apk [-o <输出目录>]      # 默认输出目录:<apk 名>-out

它会跑完整条流水线:

  1. 解压 APK(内置 ZIP 读取器,不依赖外部 unzip)。
  2. 解码 AndroidManifest.xml 为文本,回填 id 引用(@id/…@style/…@android:…)并将常量人性化(wrap_contentgone 等)。
  3. 重建 res/ 目录树:把混淆的扁平文件还原为真实名,归入限定符目录 (drawable-xhdpi/values-zh-rCN/layout-v22/ 等),解码二进制 layout/color XML,并根据 npTc chunk 为 9-patch 重建边框。
  4. 重建 res/values*:strings(按 locale)、colors、dimens、bools、integers、 ids、<string-array>/<integer-array>/<array>,以及复杂 bag —— styles (含 parent + 解析后的 item)、attrs(format + enum/flag)、plurals
  5. 转换 每个 <vector> drawable 为 SVG,输出到 svg/
  6. 透传 其余所有文件(assets/lib/classes.dexMETA-INF/ 等)保持原样。
app-out/
  AndroidManifest.xml       解码 + 引用回填
  res/                      限定符目录、真实名、解码 XML、还原后的 9-patch
    values*/                strings、colors、dimens、styles、attrs、plurals……
  svg/                      VectorDrawable → SVG
  assets/ lib/ classes.dex  原样透传

作为库调用

import { extractApk } from 'a2h-resource';

const stats = extractApk('app.apk', 'app-out', { log: console.error });
// stats: { package, files, values, svg, ... }

协议

Apache-2.0。底层的 AXML/ARSC 解码器移植自 axml-main(Androguard),同为 Apache-2.0。