Documentation
¶
Overview ¶
cmd/attack_record is a MACRO RECORDER + REPLAYER for ClashGO.
Record mode (-mode=record -out macro.json):
Captures the device screen into a GoCV window. Every left-click on the window is BOTH forwarded to the device via adb shell input tap AND appended to an in-memory tap list with a relative timestamp. Press 's' to save the tap list to disk and quit, 'q' to discard. The user drives the attack; the tool watches. ~200ms round-trip per tap is normal (PC click → adb → emulator).
Replay mode (-mode=replay -in macro.json):
Reads the JSON tap list and emits device taps at the recorded cadence. Use relative timestamps (ms_since_start) so pauses, pauses-to-zoom, etc. are preserved.
Why this exists: lets the user "teach by demonstration". Play an attack once manually, save the macro, replay N times on N different bases. No code-level coordination, no YAML strategy authoring — record writes a flat time-ordered tap list, replay is purely procedural.
Output schema (macro.json):
{
"meta": {"width": <int>, "height": <int>}, // device dim at record time
"taps": [{"t": <ms_since_start>, "x": <px>, "y": <px>}]
}
Caveats (intentional, not bugs):
- Coordinates are device-pixel, recorded from whatever screen the user recorded on. Macros recorded on 1280×720 are NOT portable to 860×732. Same device + same resolution assumed.
- Single tap only. Drags/swipes for siege targeting are out of scope for v1; siege with pre-set target = single tap works.
- The cursor position when the user clicks on the PC window is what gets sent. Misses happen if the user clicks off-image.
Click to show internal directories.
Click to hide internal directories.