AGENT SKILL

bcsfe-save-roundtrip

Use when pulling, editing, or pushing a Battle Cats (EN, rooted BlueStacks) SAVE_DATA file - the byte-exact PowerShell + HOME-key flush pull, the headless BCSFE-Python library edit, and the in-place cat-redirect push that preserves uid 10065 and the SELinux app_data_file context. Includes the MSYS path-conversion 0-byte-truncation gotcha, the force-stop-before-push rule, and Ototo cannon fields.

License 许可
MIT
最近更新
2026-11-02
Stars
★ 0
Forks
0

01 前言 Front Matter

name
bcsfe-save-roundtrip
license
MIT
description
Use when pulling, editing, or pushing a Battle Cats (EN, rooted BlueStacks) SAVE_DATA file - the byte-exact PowerShell + HOME-key flush pull, the headless BCSFE-Python library edit, and the in-place cat-redirect push that preserves uid 10065 and the SELinux app_data_file context. Includes the MSYS path-conversion 0-byte-truncation gotcha, the force-stop-before-push rule, and Ototo cannon fields.

03 SKILL.md 正文

BCSFE Save Round-Trip (Battle Cats EN, rooted BlueStacks)

Edit the live Battle Cats EN save end to end: pull byte-exact, edit headlessly, push in place so uid + SELinux context survive. The non-obvious parts (RAM flush, in-place cat >, MSYS path mangling) are what bite.

Environment

  • Package jp.co.ponos.battlecatsen; save at /data/data/<pkg>/files/SAVE_DATA (~539 KB primary). Siblings: SAVE_DATA.OLD = BC's own rollback, BACKUP_SAVE_DATA = cloud/transfer, SAVE_DATA4 = secondary slot.
  • adb = C:\ADB\adb.exe, device 127.0.0.1:5555. App uid u0_a65 = numeric 10065. BCSFE-Python 3.3.0 venv: D:\ReverseTools\Android\BCSFE-Python\.venv.
  • Serial changes across BlueStacks restarts (emulator-5554 vs 127.0.0.1:5555) — adb devices first, then target -s <serial>.

PULL (byte-exact, no CRLF/MSYS mangling)

Do it in PowerShell, not git-bash (MSYS rewrites /data & /sdcard args). BC holds the save in RAM, so flush first:

& C:\ADB\adb.exe shell input keyevent KEYCODE_HOME   # backgrounding flushes to disk
Start-Sleep -Seconds 3                                # mtime should now ~= device clock
& C:\ADB\adb.exe shell "su -c 'cp /data/data/jp.co.ponos.battlecatsen/files/SAVE_DATA /sdcard/SAVE_DATA && chmod 666 /sdcard/SAVE_DATA'"
& C:\ADB\adb.exe pull /sdcard/SAVE_DATA D:\WSA\saves\SAVE_DATA

(Force-stop does not flush — only backgrounding does. Confirm freshness by mtime ≈ device clock.)

EDIT headlessly (no interactive menu)

from bcsfe import core
sf = core.SaveFile(core.Path(p).read())   # cc auto-detected as 'en'
# ... mutate parsed objects (sf.catfood, sf.ototo.cannons, ...) ...
sf.to_file(core.Path(out))                # re-serializes via to_data(), incl. checksum

For a human, open the editor with bcsfe -i <path> (-i/--input-path skips the load prompt).

PUSH safely (the non-obvious part)

  1. am force-stop <pkg> FIRST — else BC's autosave overwrites you.
  2. Back up on device: cp SAVE_DATA SAVE_DATA.before-<ts>.
  3. adb push to /sdcard, then overwrite in place with cat >:
su -c 'cat /sdcard/new_save > /data/data/jp.co.ponos.battlecatsen/files/SAVE_DATA; \
       chown 10065:10065 /data/data/jp.co.ponos.battlecatsen/files/SAVE_DATA; \
       chmod 660 /data/data/jp.co.ponos.battlecatsen/files/SAVE_DATA; \
       restorecon /data/data/jp.co.ponos.battlecatsen/files/SAVE_DATA'

The cat > reuses the existing inode, so owner + SELinux app_data_file context survive. A fresh cp/push as root lands root:root with the wrong context and BC rejects/resets the save. Then verify md5sum device == local. User reopens BC to load it.

MSYS PUSH GOTCHA (cost an empty-file wipe — also applies to event_0 pushes)

In git-bash, adb push <src> /sdcard/<dst> silently mangles the destination via MSYS path-conversion (/sdcard/... → C:/Program Files/Git/sdcard/...) so the push fails — and the in-place step cat /sdcard/<dst> > <devfile> opens <devfile> for write, truncating it to 0 bytes BEFORE cat runs, leaving the device file EMPTY (md5 d41d8cd98f00b204e9800998ecf8427e).

Fix: export MSYS_NO_PATHCONV=1 before any git-bash adb push/shell with /sdcard or /data args (or just do the push in PowerShell). Always md5sum the device file after the write — that is what catches the empty/wrong-content state.

Ototo cannon unlock (the "no equip button" fix)

sf.ototo.cannons = {cannon_id: Cannon(development, levels)} plus selected_parts (a [foundation, style, effect] triple per formation slot = the equip state). cannon_id 0 = basic; 1–7 = Slow Beam / Iron Wall / Thunderbolt / Waterblast / Holy / Breaker / Curse-blast. development: 0 none / 1 foundation / 2 style / 3 effect(full).

The in-game Change/customize button only appears once lines are developed past default — set development=3 and levels >= 1 (effects need level ≥ 1; merely building gives no effect). Editing the save does not auto-equip — the player still picks the Foundation/Style/Effect mix in the Ototo screen (Gamatoto → swipe left); it binds per formation slot.

Live-game care: read-only discovery is safe; prefer reversible save-edits over forcing unverified in-memory fields. On a "broken" state, kill all hooks + restart BC first, then restore the SAVE_DATA.before-* backup.

04 同仓库更多 Skills

Prekzursil
Prekzursil/agent-skills-toolchain

clarify-requirements

Resolve genuine pre-execution ambiguity by scanning repo context, generating 1-6 grounded options, and asking 1-3 focused questions via AskUserQuestion. NOT for mid-task use (injection risk); NOT when the goal is already unambiguous; use to disambiguate vague prompts before any file edits.

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

openmm-md

Run FREE, open-source, Windows-native GPU molecular dynamics via the openmm-md MCP (OpenMM + CUDA on the local NVIDIA GPU). Use for protein / protein-ligand MD when you want a free stack or are on Windows without a Schrodinger license. Covers the full workflow (prepare, solvate, minimize, equilibrate, production, analyze, mmgbsa) AND an honest decision guide vs Schrodinger Desmond, including how to run Desmond legitimately on Linux or a cloud GPU with a real license. This is a deliberately LESSER free alternative and does NOT replace the schrodinger MCP tools. Do NOT use it to pick a free tool when a validated FEP+, WaterMap, IFD-MD, or Prime MM-GBSA result is actually required.

Skill与智能体开发
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

visual-review

Take screenshots of web pages and UI using Playwright for visual review and iteration

演示文稿测试与质量
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

status

Diagnostic status report — shows metaswarm installation state, project setup, and potential issues

★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

start

Use when starting work on any task, when the user mentions metaswarm, or when the user wants to begin tracked development work

Skill与智能体开发
★ 0
Prekzursil
Prekzursil/agent-skills-toolchain

setup

Interactive project setup — detects your project, configures metaswarm, writes project-local files

★ 0