← Android resources
ARSC·Guide
All tools

The ARSC tool

resources.arsc, at the root of every APK, is the app's compiled resource table: every string, colour, dimension, style, array and file reference the code and the XML refer to by id (R.string.app_name = 0x7f090000), with one value per configuration (language, night mode, screen size, density, SDK level…). The tool lists the resources with a type filter, a configuration filter and a search; click a row to see every configuration's value, or the items of a style, array or plurals.

Strings in the resource table are a good place to look for API endpoints, keys and feature flags; references (@…) are shown by name when the table defines them.

  1. The format
  2. The ARSC library

1The format

Like binary XML, the table is a tree of chunks (type u16, header size u16, size u32, little-endian):

ChunkTypeContent
table0x0002The whole file: the package count, then the chunks below.
string pool0x0001The global pool of string values.
package0x0200Id (0x7f for the app), name, and two pools: type names (string, drawable…) and key names (app_name…).
type spec0x0202For one type, the configuration axes each entry varies on.
type0x0201One type in one configuration (ResTable_config), and its entries: an offset per index (u32, or u16 with the OFFSET16 flag), or (index, offset) pairs when SPARSE. An entry is a key and a Res_value, a bag (parent and (key, value) items, for styles, attrs, arrays and plurals), or compact (Android 14+, the key and type packed into the header).

A resource id is 0xPPTTEEEE: package, type (1-based) and entry index.

2The ARSC library

The parser is lib/arsc.js, a JavaScript module with no dependencies and no user interface. It exports the class ResourceTable: a parsed table is an instance, with the lookups as methods.

import { ResourceTable } from "../lib/arsc.js";
Method / propertyWhat it does
ResourceTable.parse(input)An ArrayBuffer or Uint8Array → a ResourceTable. Throws when the file is not a resource table; damaged chunks are listed in table.errors.
table.packages, valuePool, valueUtf8, errors, idToNameThe packages, the global string pool and its encoding, what could not be read, and a Map from each resource id to "type/name".
package{ id, idByte, name, typeNames, keyNames, types }; types is a Map from type id to { typeId, typeName, entryCount, specFlags, entries }, and entries a Map from index to an entry.
entry{ index, key, keyName, id, idHex, configs, defaultValue }: one value per configuration; defaultValue is the (default) one, or the first.
value{ label, kind, text, reference }: label is the configuration ("(default)", "fr", "night", "sw600dp-land"…), kind is "str", "num", "color", "ref" or "attr", and reference the id a reference points to. A bag is { label, complex: true, parent, items: [{ name, value }] }.
table.lookup(id){ package, type, entry, name } for a resource id, or null.
table.resourceName(id)"type/name", or null.
table.bagItemName(id)The name of a bag item's key: a plural quantity ("other"), an array index ("[2]"), an attr field, or a resource name.
ResourceTable.formatValue(type, data, valuePool)A Res_value as { kind, text, reference }.
import { ResourceTable } from "../lib/arsc.js";

const table = ResourceTable.parse(bytes);
const found = table.lookup(0x7f090000);
for (const value of found.entry.configs) {
	console.log(found.name, value.label, value.text);
}