offline-game-revival

agent
Guvenlik Denetimi
Uyari
Health Gecti
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Community trust — 17 GitHub stars
Code Uyari
  • process.env — Environment variable access in skills/offline-game-revival/scripts/timewarp/examples/mini.test.js
  • fs module — File system access in skills/offline-game-revival/scripts/timewarp/timewarp.js
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

🎮 AI agent skill that revives shut-down mobile games as fully offline memorial builds — plus a zero-token pipeline that rescues lost game data from screenshots & screen recordings. 停服手游离线化 · 录屏抽帧OCR

README.md

🎮 Offline Game Revival

An AI agent skill that brings shut-down mobile games back to life — fully offline, on a real phone.

When the servers die, the game shouldn't.

English · 简体中文 · 繁體中文 · 日本語 · 한국어 · Español · Português · Français · Deutsch · Русский · Tiếng Việt · Bahasa Indonesia

Agent Skill
Claude Code
Engines
License
GitHub stars


Every year, hundreds of mobile games shut down. The APK still sits on players' phones — but without the server it can't log in, can't load a save, can't do anything. Years of stories, characters and memories become unreachable.

Offline Game Revival is a battle-tested playbook packaged as an Agent Skill. Point your coding agent (Claude Code and other agents that read SKILL.md) at a dead game's APK, and it knows how to turn it into a standalone memorial edition: install the APK, play the whole game, no network, no root, no PC, no runtime injection.

✨ What's inside

🩺 Can it be saved? Before any patch, answer three questions within half a day: are the game's rules on the phone, is the game itself inside the APK, and how much server-side data can be recovered. Story, idle and card games usually can be saved; games whose battles are computed on the server, or that download the game itself after first launch, usually can't.
🔍 Recon Unpack the APK, find the real logic layer (Lua / JS / C# transpiled), identify encryption and resource-integrity checks.
🧩 Anchor-asserted patching One build entry point. Every code replacement asserts its anchor — if the upstream package changes, the build fails loudly instead of shipping a silently broken patch.
🖥️ Local fake server Intercept the HTTP/JSON layer and answer hundreds of endpoints from a local save. A methodology for mapping every endpoint's caller and what it reads, then generating safe defaults.
📦 Repack & re-sign Recompute engine cache checksums, rebuild resource tables, zipalign, sign. Includes a reverse-engineered cache-checksum algorithm and loader patches for LayaAir native.
✅ On-device acceptance "The screen opens" ≠ "it works". State must actually change and survive a cold restart. Tutorial-driven testing: follow the game's own guide steps with real taps.
🎞️ Data rescue from screenshots & recordings (new) Server-side numbers (shop prices, gacha rates, rewards, card stats) die with the server. scripts/harvest.py turns tens of GB of player screenshots and screen recordings into a few hundred KB of categorized text — keyframes → near-duplicate removal → local OCR → per-screen grouping — fully offline, zero tokens, then scripts/llm_structure.py batches it through DeepSeek / OpenAI / Qwen / Kimi / local Ollama into merged JSON + CSV.
⏩ Time-travel tests (new) scripts/timewarp runs your fake server in a sandbox with a virtual clock: fast-forward days, restart the app, and audit every reward — if a response says "+50 gems" but the save didn't change, it fails. Simulate 30 days of play in a second and see on which day each gate becomes reachable. Zero dependencies.
🤝 Any agent, any model (new) Works with Claude Code, Codex, Cursor, Copilot, OpenCode, Gemini CLI… via SKILL.md + AGENTS.md. Ships scout / worker / verifier sub-agent roles so an expensive model makes the calls and cheap ones do the legwork. No agent at all? Paste prompts/chat-playbook.md into DeepSeek / ChatGPT and run the commands it gives you.
📚 Failure ledger 100 KB of real pitfalls: symptom → root cause → fix. Crashes from start-up races, UI that silently moved off-screen, pooled XHR objects "poisoned" by fake responses, saves that never hit disk…

🏆 Proven on real games

The playbook was distilled from reviving three commercial mobile games whose servers shut down:

  • Case A — Unity + Lua: full single-player memorial build, verified on a physical Android 14 phone.
  • Case B — LayaAir native + JavaScript: 315 server endpoints reimplemented locally, 700+ regression assertions, all major systems (story chapters, battles, gacha, pets, dating, tower, events) clicked through on a device.
  • Case C — Unity micro client (Mono + SLua): the APK held only about a quarter of the game's resources; the rest came from a player's phone backup. Half-encrypted Mono assemblies, a packer shell, and a local server written entirely in Lua.

A fourth game was dropped after half a day: the game itself was downloaded after first launch, and that download died with the server.

All three case studies are included (anonymized) in references/.

💸 What it cost

Most of the work was done with Claude Code on a subscription. To give a sense of scale, here is the token usage from the local session logs (sub-agents included), converted at Anthropic's public API prices. That is a conversion, not what was actually billed.

Case Calendar days Tokens At API list price
A — Unity + Lua 18 7.4 B ≈ $2,140
B — LayaAir native + JS 9 2.6 B ≈ $720
C — Unity micro client (Mono + SLua) 5 2.3 B ≈ $620
All game-revival work (A + B + C, plus one day of recon on a fourth game) 12.4 B ≈ $3,500

The table counts Claude only. With the Codex phase below added, the total is about $3,900.

  • 98.5% of the tokens are cache reads: every turn, the model re-reads the conversation so far, and that is billed at a small fraction of the normal input price. The text the model actually wrote is only about 35 M tokens. (Both figures are measured over all Claude usage in the same period, 14.1 B tokens, not per case.)
  • Case A started with about 10 days in Codex, backed by DeepSeek V4.1 Flash and GPT-6 Astra: about 2.25 B tokens, ≈ $420 at list price. DeepSeek took about 2.0 B tokens for only ≈ $27–54 (off-peak to peak price); GPT-6 Astra took about 0.26 B tokens for ≈ $387.
  • Counted up to 2026-10-25.

🚀 Install

Claude Code (plugin marketplace)

/plugin marketplace add Cynthia-wlan9509/offline-game-revival
/plugin install offline-game-revival@offline-game-revival

Any agent that supports Agent Skills (Claude Code, OpenAI Codex, Cursor, GitHub Copilot, OpenCode, Goose…) — copy the folder into that agent's skills directory:

git clone https://github.com/Cynthia-wlan9509/offline-game-revival
cp -r offline-game-revival/skills/offline-game-revival ~/.claude/skills/   # Claude Code
cp -r offline-game-revival/skills/offline-game-revival ~/.codex/skills/    # Codex

Other agents read AGENTS.md, which points them to the skill. Sub-agent roles are in agents/.

Chat only (DeepSeek / ChatGPT / Kimi web) — paste prompts/chat-playbook.md as your first message. The model becomes your lead engineer; you run the commands it gives you and paste back the output.

Then just ask: "This game's servers shut down — make it playable offline" or "Extract the shop prices and gacha rates from these 15 GB of screen recordings."

🎞️ Rescue data from screen recordings (standalone)

The harvester works without any agent:

pip install -r skills/offline-game-revival/scripts/requirements.txt
python skills/offline-game-revival/scripts/harvest.py ./player_recordings ./out --limit 50   # trial run
python skills/offline-game-revival/scripts/harvest.py ./player_recordings ./out              # full run, resumable
export DEEPSEEK_API_KEY=sk-...                                                                   # or OPENAI_API_KEY, DASHSCOPE_API_KEY…
python skills/offline-game-revival/scripts/llm_structure.py ./out --limit 2                       # structure 2 chunks, check quality
python skills/offline-game-revival/scripts/llm_structure.py ./out                                 # everything → out/structured/merged.json
  • Keyframes that matter: keeps a frame only when the screen changed and settled — skips transition animations and motion blur; long scrolling lists still get sampled.
  • Cross-source dedupe: the same screen from a screenshot and from a recording is merged (status bar ignored).
  • Local OCR (RapidOCR / ONNX, CPU-only, CJK + Latin) with boxes and reading order.
  • Output: for_llm/*.txt chunks + a ready-made prompt and JSON schema in media-harvest.md; llm_structure.py merges all answers and flags conflicting numbers.

⏩ Time-travel tests (standalone)

node skills/offline-game-revival/scripts/timewarp/examples/mini.test.js            # 51 passed
BUGGY=1 node skills/offline-game-revival/scripts/timewarp/examples/mini.test.js    # catches 3 planted bugs

Point timewarp.create({ files, entry, inventory, granted }) at your own fake server. Checklist of the time bugs worth testing (reset hour, sign-in loops, regen caps, timers, restart persistence): timewarp.md.

🌙 Night shift (second skill)

skills/night-shift lets the agent keep working through a to-do list while you sleep or are away for a few hours. Copy the fill-in NIGHT-RUN.md into your project, run the two-minute checklist, then start /loop with no interval. The agent paces its own wake-ups and works one item at a time, handing legwork to sub-agents. Every "done" needs evidence and gets its own commit. Anything it would have to ask you about gets the most conservative default, and it finishes with a five-part report. Nothing in it is game-specific.

In case C, the first night ran a little over 4 hours and verified 11 items on an emulator, each with a screenshot or log and a commit, dispatching 5 workers and using about half of one 5-hour usage window; another night it random-tapped the game 3,000 times on the emulator with zero crashes.

It relies on Claude Code desktop features (/loop, ScheduleWakeup, request_keep_awake, get_usage, start_session); the skill says how to fall back when one is missing (in the plain CLI: sub-agents instead of parallel sessions). The plugin install includes it; to copy it by hand: cp -r offline-game-revival/skills/night-shift ~/.claude/skills/.

🧭 Philosophy

  1. Patch at build time, not at runtime. A Frida script that "works" still needs to be injected forever. Changes baked into the package install and just work.
  2. Single entry point + anchor assertions. Silent skips ship broken builds.
  3. Artifacts are not source. Fix the patch script, never hand-edit the output.
  4. "It opens" is not "it works." Verify state changes, survive restarts, write down what's verified vs. merely implemented.

⚖️ Responsible use & disclaimer

This repository exists to study how games work and to preserve games whose official service has ended. It contains only methods and the author's own tools.

  • No builds, no assets, no keys. This repository contains no game assets, no game code, no decryption or signing keys and no modified installation packages. The author does not provide, sell or share modified builds. Please don't ask for them.
  • Do not spread modified builds. Anything you make with these methods is for your own personal, non-commercial use, on a copy you obtained lawfully. Do not upload, share, sell or rent modified installation packages, game assets or keys, and do not run a private server for others.
  • Only for games whose official service has permanently ended. Never use it on a live game, to cheat, to get around anti-cheat, or in any way that affects other players or the rights holder's business.
  • Follow the law where you live; you are responsible for your own use. Copyright and anti-circumvention laws differ by country. In the United States, for example, the DMCA (17 U.S.C. §1201) prohibits circumventing technical protection measures except under narrow exemptions, and in the EU decompiling software is allowed only in limited cases. Nothing here is legal advice, and nothing here says that any particular use is legal. If in doubt, ask a lawyer before you start.
  • No affiliation. Game names and trademarks belong to their owners. This project is not affiliated with or endorsed by any game company.
  • No warranty, no liability. Everything here is provided "as is" under the MIT License. To the maximum extent permitted by law, the author is not liable for any damage, data loss, account action or legal consequence that comes from using it.
  • Rights holders: if you believe anything here infringes your rights, please open an issue; it will be reviewed and removed promptly. If a game comes back officially, please support the official version.

By using the contents of this repository you agree to the above.

🤝 Contributing

Revived a game with this skill? Hit a new pitfall? New engine case studies (Cocos, Unreal, Godot, IL2CPP…) and new entries for the failure ledger are very welcome.

  • Report or ask: open an issue.
  • Change something: fork the repo, edit, and open a pull request. Every PR is reviewed before it is merged.
  • Help maintain it: after a few merged PRs, ask in an issue and you can be invited as a collaborator with write access.

What may and may not go into the repo (no game assets, no keys, no player data) is in CONTRIBUTING.md.

If this saved a game you loved, a ⭐ helps other players find it.

⭐ Star history

Star History Chart

📄 License

MIT

Keywords: game preservation · time travel testing · multi-agent · DeepSeek · ChatGPT · Codex · shut down game · server shutdown · offline mode · APK repack · Lua · LayaAir · Unity · reverse engineering for preservation · screen recording OCR · keyframe extraction · Claude Code skill · agent skills · 停服游戏 · 单机化 · 离线版 · 游戏保存 · 録画OCR · サービス終了 · 서비스 종료

Yorumlar (0)

Sonuc bulunamadi