AFK Journey Extractor

A read-only tool that extracts AFK Journey's on-device data into clean JSON.
Verified against macOS App Store build 1.6.11 · bundle id com.farlightgames.igame.ios
Docs: Overview · How-to · CLI reference · Architecture · Images · Integrations · Season cutover · Model & feed · Battle scripts

afkj-parser reads AFK Journey's local install (afkj-extract) and builds the feed stargazer imports (afkj-parse). Beside them it holds the calibration of stargazer's match-screenshot import and the season cutover runbook. It never modifies the game's files.

Role & scope This repo is the source of the feed stargazer imports: ./afkj-extract reads the game install and ./afkj-parse builds, checks and diffs the feed (CLI quick reference, Model & feed). The sibling ../AFKJourneyData/ export (another maintainer's) is a fallback source: ./afkj-parse build --source ../AFKJourneyData. afkj-data-viewer, which used to parse that export for stargazer, was retired and deleted. calibration/ (TypeScript, run on stargazer's toolchain) holds the match-screenshot import's sample screenshots, labels and reference builder, and tools/seasonal_icons.py converts a season's icons; both write into the image host chaldea, which only hosts what they make.

Status

The milestone table lives in one place, the README, so it can't drift.

Where the game data lives

The single most important finding: the loose .jsone files everyone reaches for first are config/map stubs — the data worth having is elsewhere, all inside the sandbox container.

DataSource (inside the container)Format
Hero / skill tables (Unit, Skill, SkillBuff, TavernPool, …)igame.pkg → Config/*.luaecompiled Lua 5.4 data modules
Localization (EN/CN hash → text)Config/AutoGenConfigBytes/LanguageDb*.bytesAutoGenConfig binary map
Index / nav tablesConfig/AutoGenConfigBytes/*.bytesAutoGenConfig binary map
Game version / small configloose *.jsoneBlowfish + LZ4 JSON
Textures (art) — incl. all 2D hero portraitsloose ui/** (hero art keyed by Unit ID + codename)ASTC (AST wrapper)
UI icons, frames, glyphs (class, faction, rarity, …)sprite atlases in Unity Addressables aa/iOS/*.lpakUnityFS, several bundles per file; ASTC pages (research tool only)
3D models, animation, FX, mapsUnity Addressables aa/iOS/*.lpakUnityFS (not read)

How each format is decoded is in Architecture (the design history is its section 11), and every kind of file on disk, with counts and sizes, is in Architecture → What's on disk.

How it flows

~/Library/Containers/<uuid>/Data/Documents/data [READ-ONLY] │ (resolved by bundle id — never by hardcoded path) │ ├─ AppInfo.jsone ───────────────► jsone ──► game version │ ├─ Config/AutoGenConfigBytes/ │ LanguageDb<LANG>.bytes ──► autogen ──► out/raw/locales/<lang>.json (present, or all 17 from the CDN) │ └─ igame.pkg (+ igame.pkg.bin) ─► pkg ──► Config/*.luae ─► luatable ─┐ │ (restricted Lua 5.4 VM Config/Array.luae ─► luatable ─► $arrayRef pool ───────────────┤ + Array-pool resolve) ▼ out/raw/tables/*.json (full rows, arrays inline) ui/**/*.png (AST/ASTC) ─► texture ──► out/raw/textures/**.png (opt-in: --only textures; (linear → sRGB) colors match in-game) Unit rows + ui/icon/hero ─► texture ──► out/images/heroes/<slug>.png (opt-in: --only portraits) Fairy rows + ui/icon/fairy ─► texture ──► out/images/artifacts/<slug>.png (opt-in: --only artifacts) CampPet → Unit + ui/icon/hero ─► texture ─► out/images/phantimals/<slug>.png (opt-in: --only phantimals) out/manifest.json ◄── latest invocation: versions, source, options, status, stats

Quick start

# one-time: install the three libraries
python3 -m pip install --user pycryptodome lz4 lupa

# run from the project folder (no package install needed)
cd ~/git-repos/afkj-parser
./afkj-extract --list                 # show source + plan, write nothing
./afkj-extract                        # extract data (tables + languages), read-only
./afkj-extract --verify ../AFKJourneyData   # diff localization vs the reference

./afkj-extract is a launcher that needs no install (equivalently PYTHONPATH=src python3 -m afkj_extract …). Textures are opt-in (--only textures); a bare run does tables + languages. Every run prints the resolved source … (read-only) and output … (write) up front, and refuses to run while the game is open. New to the terminal? Start with the plain-language How-to. Full command details: CLI reference.

The one hard rule Game files are read through a read-only source interface. Destination checks reject overlapping trees and unsafe output links; stage publication preserves previous output on normal failures. Use trusted local game files and one extraction process per output folder. See the safety model and its limits.

Documentation

How-to (start here) →

Plain-language, copy-paste steps for running the extractor — no coding background needed.

Architecture & internals →

The read-only safety model, the four format decoders, the Lua-table extraction deep-dive, package layout, and output format.

Images →

Colour, finding a hero's art, UI sprites, and the portrait, artifact and Phantimal exports with their checks.

Integrations →

The game's CDN, the update routine, what each season cutover takes from this repo, and updating away from the local machine.

Season cutover →

The cross-repo runbook for a new season: extract, icons, stargazer's data, text, targeting, and retiring the old season.

Model & feed →

The parse model's shapes, the JSON feed in out/api/, projection, text rendering, the gates, and the diff against the last import.

CLI reference →

Install, every flag, examples, output structure, workflows, and troubleshooting.