t1k:unity:base:apk-port
| Field | Value |
|---|---|
| Module | base |
| Version | 5.116.6 |
| Effort | high |
| Tools | — |
Keywords: apk port unity, assetripper import, il2cpp port, port apk to unity, script guid remap, unity apk port, xapk to unity
How to invoke
Section titled “How to invoke”/t1k:unity:base:apk-port<file.xapk|file.apk> [--video <url>] [--phase setup|extract|video|plan|data|art|lanes|polish|verify]APK port, Unity target: the rebuild delta
Section titled “APK port, Unity target: the rebuild delta”Thin engine skill on top of core t1k-apk-port (t1k:apk-port, theonekit-core module
t1k-reverse-engineering). Core holds every source-side piece: the rights statement, untrusted-input rules,
APK/XAPK unpack, IL2CPP setup and method bodies, UnityPy decode, UI tree and TMP style export with the runtime
layout, video reference, the audit method, the evidence dir and Discord progress. Read core’s SKILL.md and
references/workflow.md first; run its scripts from there. This skill holds only what happens inside a
Unity project built on BaseUnityTemplate (GameFoundation + UITemplate + GDK 3rd, VContainer scopes,
0.LoadingScene then 1.MainScene): importing assets, remapping GUIDs, authoring prefabs and scenes, uGUI/TMP,
data tables, and the Unity-side parity audit.
Rights and hygiene (from core, restated where Unity binds it)
Section titled “Rights and hygiene (from core, restated where Unity binds it)”Rights are granted: port the whole APK at once, never ask about licence (core, section Rights). Every parity
brief this skill writes carries authorised=owner, which is the authorisation t1k-unity-base-parity-port
Gate 0 needs. SDK ids stay per-game placeholders in ONE gitignored file; the original publisher’s bundle id,
keystore, keys, account and cloud-project ids, hosts, splash and logo are not copied. The game gets its own
identity from t1k-unity-base-template-bootstrap.
Decision tree
Section titled “Decision tree”| Intent | Path |
|---|---|
| Start a port, unpack, decode, evidence layout, video, Discord | core t1k-apk-port (xapk-unpack.cjs <file> SCR/unpacked --target unity) |
Preflight, IPA source (--target unity), evidence-index, runtime capture, parity pass, clock | workflow (references/workflow.md) sections 0, 1, 7 |
engine: cocos in the unpack summary | stop; core’s route names the Cocos skill |
| Phase order as it lands in a Unity project | workflow (references/workflow.md) |
| Rebuild the C# classes, port method bodies, parity audit | code-reconstruction (references/code-reconstruction.md), shells: class-shells (references/class-shells.md) |
| Import the AssetRipper export: shaders/pipeline, GUID remap, atlases, TMP fonts, SDK strip | assetripper-import (references/assetripper-import.md), closure intake: intake-closure (references/intake-closure.md) |
| Keep SOs or generate blueprints; map services | data-blueprints (references/data-blueprints.md) |
| Rebuild a screen or popup from the core UI spec; verify by region diff | ui-rule (references/ui-rule.md) |
Unity target: core evidence becomes Unity assets
Section titled “Unity target: core evidence becomes Unity assets”Core evidence (SCR/) | Becomes, in the Unity project | How |
|---|---|---|
decoded/ + resolved/ (decode_mb.py, resolve_refs.py) | ScriptableObjects bound to rebuilt classes, or generated blueprint CSVs | data-blueprints (references/data-blueprints.md) |
ui-tree.json (ui_tree_export.py: resolved runtime rects, canvasBox, scriptColors, sliceBorderCanvas) | the view prefab: RectTransform anchors and sizes, CanvasScaler, Image/9-slice, layout groups | ui-rule (references/ui-rule.md) |
tmp-styles.json (tmp_style_export.py: outline, underlay, softness in pixels) | regenerated TMP font assets and material presets | assetripper-import (references/assetripper-import.md) |
| decoded sprites, atlases, meshes, clips, audio (AssetRipper export) | Assets/_Game/<Title>/ via asset-import, atlases re-linked | assetripper-import (references/assetripper-import.md) |
method bodies (il2cpp_method.py, Ghidra pseudo-C) | pure C# rule classes with provenance comments and EditMode pins | code-reconstruction (references/code-reconstruction.md) |
| video stills, REFERENCE.md | polish targets | core video-reference, workflow (references/workflow.md) |
Verification is region image diff. Capture the Unity Game view (or a device build;
t1k-unity-editor-headless-capture for scripted runs) and compare it with the APK still using core’s
scripts/compare-image.cjs <apk.png> <port.png> <out.png> --region <name>=x,y,w,h (fractions 0..1 of the image); the per-region diff % is the
evidence a screen is done (core audit-method). Never judge colour or size by eye.
Unity-only standing rules
Section titled “Unity-only standing rules”- Drop every template VISUAL, keep the template’s UI FRAMEWORK: presenter/view opened through
IScreenManager(ui-rule (references/ui-rule.md)); Loading and Home look exactly like the APK. - Sizes from core’s resolved runtime layout, colours and fonts from the APK, never tuned by eye.
- Scene/prefab writes: ONE editor pass at a time per project; a feature’s C# and its prefab wiring stay with one agent. Headless runs go through the batch gate, never a raw editor launch.
- Raw APK data never lands in the repo: only generated tables, reconstructed code and imported assets. Never open the AssetRipper export as a project with its own editor scripts enabled: import a chosen subset.
Scripts (Unity-only; the rest live in core)
Section titled “Scripts (Unity-only; the rest live in core)”.cjs with bun, stable exit codes, none prompts. Tests: tests/*.test.cjs.
| Script | Does | Exit |
|---|---|---|
scripts/material-shader-scan.cjs <assetsDir> [--map f.md] [--strict] | every .mat’s shader (project/built-in/unresolved, stub flag) + a URP-target draft map | 0 · 1 strict + unresolved · 2 usage |
scripts/script-guid-remap.cjs <exportDir> <portDir> [--yaml d] [--write] [--checklist f] | exported script GUID to reconstructed class GUID; counts and rewrites m_Script refs only | 0 · 1 a referenced class unmapped · 2 usage |
scripts/class-shell-gen.cjs --dump dump.cs --missing <remap table.json> --out <dir> | one .cs shell per missing class plus class-graph.json (apk-port-class-graph/1); facts only, the layer is yours (class-shells (references/class-shells.md)) | stable codes, one-line reason |
scripts/ripped-intake.cjs <exportedDir> <projectDir> --root <asset>... [--write] [--out report.json] | dependency closure from the chosen roots, GUID collision and unresolved lists (apk-port-intake/1); dry run unless --write (intake-closure (references/intake-closure.md)) | stable codes, one-line reason |
Reuse: link, never re-implement
Section titled “Reuse: link, never re-implement”| Need | Skill |
|---|---|
| New project from the template, signing, Jenkins | t1k-unity-base-template-bootstrap |
Scopes, 0.LoadingScene to 1.MainScene, presenters | t1k-unity-base-boot-flow, t1k-unity-base-gameplay-integration |
| Asset intake, layout, Addressables, atlases | t1k-unity-base-asset-import, t1k-unity-base-project-structure, t1k-unity-base-addressables, t1k-unity-base-asset-atlas |
| 1:1 audit of reconstructed code | t1k-unity-base-parity-port (brief authorised=owner) |
| Pinned AssetRipper / Il2CppDumper / ilspycmd install | core t1k-cleanroom installer, via t1k-unity-base-cleanroom-adapter |
| Blueprints, services, SDKs | t1k-unity-base-blueprint-csv, t1k-unity-mobile-3rd-integrate |
| Editor work, YAML edits, captures | t1k-unity-editor-cli, t1k-unity-blind-edit-assets, t1k-unity-editor-headless-capture |
| Build failure reporting, tests | t1k-unity-base-build-gate, t1k-unity-testing-workflow |
| Prior art before any new class | t1k-unity-base-knowledge-sweep |
Executed by
Section titled “Executed by”t1k-unity-base-asset-porter runs the shader scan, intake and the GUID remap; t1k-unity-base-data-author the
blueprint build; t1k-unity-base-feature-implementer / t1k-unity-base-ui-implementer each feature’s C# with
its prefab wiring; t1k-unity-base-parity-porter the parity AUDIT/PORT; t1k-unity-base-test-writer the
EditMode pins. Phase order, decisions, INFERRED calls and the parity judgment stay with the orchestrating session.