Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ labels: bug
- OS:
- Python version:
- Phone model and Android version:
- Output of `adbtouch info` (this shows the screen size and digitizer ranges):
- Output of `mthread info` (this shows the screen size and digitizer ranges):

```
paste here
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/device_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ panels and we can only fix what we can see.

**Does record and replay work?**

**Output of `adbtouch info`**
**Output of `mthread info`**

```
paste here
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ jobs:

| | |
|---|---|
| **Windows** | `AutoDraw-*-x64.msi` — installs like any other program, Start Menu entry included. The `.zip` is the same app with no installer. |
| **macOS** | `AutoDraw-*-arm64.dmg` for Apple Silicon, `AutoDraw-*-x64.dmg` for Intel. Drag it to Applications. |
| **Linux** | Run from source — see the [README](https://github.com/MAXAWER/AutoDraw-Sim#install-variants). |
| **Windows** | `MThreadDraw-*-x64.msi` — installs like any other program, Start Menu entry included. The `.zip` is the same app with no installer. |
| **macOS** | `MThreadDraw-*-arm64.dmg` for Apple Silicon, `MThreadDraw-*-x64.dmg` for Intel. Drag it to Applications. |
| **Linux** | Run from source — see the [README](https://github.com/MAXAWER/MThread-Draw#install-variants). |

Everything is included: Python, OpenCV and **adb** all travel inside
the application. There is nothing else to install and no Android SDK
Expand All @@ -157,7 +157,7 @@ jobs:
launch needs a right-click → **Open**, or:

```
xattr -dr com.apple.quarantine /Applications/AutoDraw.app
xattr -dr com.apple.quarantine /Applications/MThreadDraw.app
```

pypi:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ screen_tmp.png
# Local virtualenvs
.venv/

# Superseded by adbtouch/injector.jar, which ships inside the package
# Superseded by mthread/injector.jar, which ships inside the package
/injector/*.jar

# C# build output
Expand Down
8 changes: 4 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ generating the copy, and point them at `TERMS.md`. Running a modified version as
a hosted service carries the same obligation to publish.

Requests go to an issue titled "Licence request" at
<https://github.com/MAXAWER/AutoDraw-Sim/issues>.
<https://github.com/MAXAWER/MThread-Draw/issues>.

## What this project is

Two pieces that ship together:

- **`adbtouch`** — a Python library for synthetic touch input on Android over
- **`mthread`** — a Python library for synthetic touch input on Android over
ADB: tracing an image into strokes, drawing them, recording and replaying
gestures.
- **`AutoDraw`** — a desktop app on top of it.
- **`MThread Draw`** — a desktop app on top of it.

## How it draws, which is the part that surprises people

Expand All @@ -47,7 +47,7 @@ There are three paths into a device, picked automatically by
says, and `sendevent` then fails per line while the script exits cleanly.
`Device.supports_raw_touch` probes for it.
2. **`injector`** — a 3 KB jar (`injector/`, built by
`tools/build_injector.py` into `adbtouch/injector.jar`) run once through
`tools/build_injector.py` into `mthread/injector.jar`) run once through
`app_process` and fed points over stdin. This is the path that works
everywhere and the only one where the time between points is ours, which is
what makes both instant drawing and hand-like drawing possible.
Expand Down
27 changes: 20 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,31 @@

## Unreleased

- **The project is now MThread Draw.** Everything is renamed: `import adbtouch`
becomes `import mthread`, `autodraw` becomes `mthread_draw`, the console
script is `mthread` and the desktop entry point `mthread-draw`, the
distribution on PyPI is `mthread-draw`, the installer is
`MThreadDraw-x.y.z-x64.msi`, and the repository has moved to
`github.com/MAXAWER/MThread-Draw` — GitHub redirects the old address, but
update your remote. `AdbTouchError` is `MThreadError` and `ADBTOUCH_CACHE` is
`MTHREAD_CACHE`. There is no compatibility shim: this predates any release
under the old names other than a January pre-release of something else.
- `run.bat` could never fetch adb. Two backslashes had been lost from it long
ago, leaving it looking for `platform-tools<BEL>db.exe` and calling
`tools<FF>etch_platform_tools.py`.

- **Drawing works on devices that refuse raw touch events** - every recent
Pixel, where SELinux denies the shell domain write access to `/dev/input`.
`Device.supports_raw_touch` probes for it and the drawing path is picked
accordingly, instead of reporting success and doing nothing.
- **An on-device injector** (`adbtouch/injector.py`, built from `injector/`),
- **An on-device injector** (`mthread/injector.py`, built from `injector/`),
run once through `app_process` and fed points over stdin. One process for a
whole drawing rather than one per point, which is what makes realistic timing
possible at all. Measured on a Pixel 8 Pro: a 136-stroke, 1,679-point drawing
in about 19 seconds, against 3 minutes 40 through `input`.
- **`adbtouch.hand`** simulates hand drawing: rounded corners, a velocity
- **`mthread.hand`** simulates hand drawing: rounded corners, a velocity
profile, tremor, overshoot and a sensible stroke order.
- **`adbtouch.paths`** joins the fragments `findContours` returns back into
- **`mthread.paths`** joins the fragments `findContours` returns back into
strokes and drops specks - 215 strokes became 136 on the sample image, which
is both faster and cleaner.
- `tools/test_canvas.py`: a drawing canvas served to the device over
Expand All @@ -28,7 +41,7 @@ Packaging and presentation release; no behavioural changes to drawing or replay.
macOS `.dmg` for both Apple Silicon and Intel, built automatically from a tag.
- **Self-contained.** The packaged builds carry their own `adb`: no Android SDK,
no platform-tools download, no `PATH` to edit. `find_adb` looks inside the
bundle first, so an installed AutoDraw behaves the same everywhere.
bundle first, so an installed MThread Draw behaves the same everywhere.
- Packaged builds run a self-test before shipping, which imports the whole
application and runs the bundled adb.
- Optional PyPI publishing through trusted publishing — see
Expand All @@ -40,12 +53,12 @@ Packaging and presentation release; no behavioural changes to drawing or replay.
- Rewritten README: three-step quickstart, supported devices and emulators,
supported image formats.
- Versioning continues from the old `v1.0` ADB Painter tag rather than
restarting; `adbtouch` and `AutoDraw` share one version number.
restarting; `mthread` and `MThread Draw` share one version number.

## 0.2.0

- Split the `adbtouch` library out of the desktop app.
- Gesture recording and replay: `adbtouch record`, `adbtouch play`, and the
- Split the `mthread` library out of the desktop app.
- Gesture recording and replay: `mthread record`, `mthread play`, and the
Record tab in the app.
- Fixed touch mapping on devices whose digitizer resolution differs from the
display resolution.
Expand Down
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ generating the copy, and point them at `TERMS.md`. Running a modified version as
a hosted service carries the same obligation to publish.

Requests go to an issue titled "Licence request" at
<https://github.com/MAXAWER/AutoDraw-Sim/issues>.
<https://github.com/MAXAWER/MThread-Draw/issues>.

## What this project is

Two pieces that ship together:

- **`adbtouch`** — a Python library for synthetic touch input on Android over
- **`mthread`** — a Python library for synthetic touch input on Android over
ADB: tracing an image into strokes, drawing them, recording and replaying
gestures.
- **`AutoDraw`** — a desktop app on top of it.
- **`MThread Draw`** — a desktop app on top of it.

## How it draws, which is the part that surprises people

Expand All @@ -47,7 +47,7 @@ There are three paths into a device, picked automatically by
says, and `sendevent` then fails per line while the script exits cleanly.
`Device.supports_raw_touch` probes for it.
2. **`injector`** — a 3 KB jar (`injector/`, built by
`tools/build_injector.py` into `adbtouch/injector.jar`) run once through
`tools/build_injector.py` into `mthread/injector.jar`) run once through
`app_process` and fed points over stdin. This is the path that works
everywhere and the only one where the time between points is ours, which is
what makes both instant drawing and hand-like drawing possible.
Expand Down
22 changes: 11 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ including bug reports from phones we cannot test on ourselves.
## Getting set up

```bash
git clone https://github.com/MAXAWER/AutoDraw-Sim.git
cd AutoDraw-Sim
git clone https://github.com/MAXAWER/MThread-Draw.git
cd MThread-Draw
python -m pip install -e ".[gui,dev]"
python -m unittest discover -s tests
```
Expand All @@ -20,18 +20,18 @@ plain unit tests that run in under a second.

| Path | What lives there |
| --- | --- |
| `adbtouch/` | The library: device control, touch events, recording, replay. No GUI imports. |
| `adbtouch/touch.py` | Input-event codes and the display-to-digitizer coordinate mapping. |
| `adbtouch/recorder.py` | Parsing `getevent -t` output into a session. |
| `adbtouch/player.py` | Turning a session back into a timed shell script. |
| `adbtouch/vectorize.py` | Image to stroke paths. The only module that needs OpenCV. |
| `autodraw/` | The desktop app. Keep logic out of here; put it in the library with a test. |
| `mthread/` | The library: device control, touch events, recording, replay. No GUI imports. |
| `mthread/touch.py` | Input-event codes and the display-to-digitizer coordinate mapping. |
| `mthread/recorder.py` | Parsing `getevent -t` output into a session. |
| `mthread/player.py` | Turning a session back into a timed shell script. |
| `mthread/vectorize.py` | Image to stroke paths. The only module that needs OpenCV. |
| `mthread_draw/` | The desktop app. Keep logic out of here; put it in the library with a test. |
| `tests/` | Unit tests, standard library `unittest`, no pytest required. |

## Ground rules

- The library must keep working without OpenCV installed. Recording and replay
are stdlib-only on purpose, so `pip install adbtouch` stays lightweight.
are stdlib-only on purpose, so `pip install mthread` stays lightweight.
- Anything that can be tested without a phone should be. If you find yourself
unable to test a change, that usually means the logic wants pulling out of the
hardware path.
Expand All @@ -41,14 +41,14 @@ plain unit tests that run in under a second.

## Good first issues

Look for the [`good first issue`](https://github.com/MAXAWER/AutoDraw-Sim/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
Look for the [`good first issue`](https://github.com/MAXAWER/MThread-Draw/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22)
label. If none are open and you want something to do, the open ends listed at the
bottom of the README are all fair game.

## Reporting a device

If drawing lands in the wrong place on your phone, that is useful data. Open a
Device report issue with the output of `adbtouch info` - it prints the digitizer
Device report issue with the output of `mthread info` - it prints the digitizer
ranges we need to see.

## Licensing of contributions
Expand Down
Loading
Loading