Skills von pixel: software-development/android-debugging-from-termux

This commit is contained in:
2026-11-08 14:36:58 +01:00
parent ce916c746a
commit 6b28139c1f
2 changed files with 30 additions and 0 deletions
@@ -27,6 +27,11 @@ Key context that is easy to get wrong:
exist — any tool that needs `sh` (most Java-based `app_process` wrappers: `content`, exist — any tool that needs `sh` (most Java-based `app_process` wrappers: `content`,
`cmd` on some builds) silently fails with "cannot execute: required file not found". `cmd` on some builds) silently fails with "cannot execute: required file not found".
- `logcat` works fine via absolute path. - `logcat` works fine via absolute path.
- Hermes exports `LD_LIBRARY_PATH` pointing at its bundled runtime libs; Termux's own `python`/`pip` then load a mismatched libpython (`dlopen failed: cannot locate symbol _PyType_AllocNoTrack`). Run Termux Python tools with `env -u LD_LIBRARY_PATH …` (or `unset LD_LIBRARY_PATH` first in the command). Plain `python` in PATH is Hermes's venv (no pip) — use `/data/data/com.termux/files/usr/bin/python`.
- pip installs that compile Rust wheels (pydantic-core, cryptography) take 5–10 min on-device: start them with `terminal(background=true, notify=true)` and log to a file, because a foreground timeout kills pip mid-build.
## Security / spyware check (MVT)
Install MVT into its own venv, check app IDs against the IOCs right away (works without ADB), then do the full `check-adb` once wireless debugging is paired (§4). Recipe and the IOC matcher are in `references/mvt-spyware-check.md`. Report to the user in German plain text: IOC hits, unknown-installer apps worth a look, and what was NOT covered yet.
## Tailscale / tailnet connectivity ## Tailscale / tailnet connectivity
- Non-root Termux tailscaled usually runs `--tun=userspace-networking` → proxy-only (SOCKS5/HTTP on localhost); stock Android browsers don't use local proxies, so browser access to tailnet names needs the official Tailscale app (real VpnService) or a TUN-capable proxy client. - Non-root Termux tailscaled usually runs `--tun=userspace-networking` → proxy-only (SOCKS5/HTTP on localhost); stock Android browsers don't use local proxies, so browser access to tailnet names needs the official Tailscale app (real VpnService) or a TUN-capable proxy client.
@@ -0,0 +1,25 @@
# MVT (mvt-project) on the phone itself, from Termux
## Install (verified)
```bash
unset LD_LIBRARY_PATH
pkg install -y python-pip python-cryptography rust # rust is needed for the pydantic-core build
/data/data/com.termux/files/usr/bin/python -m venv --system-site-packages --without-pip ~/mvt-venv
# run in the background, it takes several minutes:
env -u LD_LIBRARY_PATH ~/mvt-venv/bin/python -m pip install mvt > ~/mvt-install.log 2>&1
env -u LD_LIBRARY_PATH ~/mvt-venv/bin/mvt-android download-iocs # -> ~/.local/share/mvt/indicators/*.stix2
```
- `--without-pip`: venv's ensurepip fails here. The system pip is reused through `--system-site-packages`.
- If even plain Termux python fails to `import array`, run `pkg upgrade python` (a partial upgrade leaves lib-dynload out of sync).
## Quick check without ADB (app IDs vs IOCs)
```bash
/system/bin/pm list packages -f -i -U > ~/pkgs.txt
```
Line format: `package:<apk path>=<pkg> installer=<x> uid:<n>`. Parse the package with `\.apk=(\S+)\s+installer`. Pull the IOC app IDs from the STIX `pattern` fields with the regex `app:id\s*=\s*'([^']+)'`, then intersect the two sets.
Also list the `/data/app` packages with `installer=null`. These are sideloaded via adb or restored from a backup, so mention them as "worth a look", not as a finding.
Limits: this check covers app IDs only. Processes, logs, SMS/URLs, files and settings need `mvt-android check-adb` (or androidqf) over a paired ADB session.
## Full scan
Pair via wireless debugging (SKILL.md §4), then:
`env -u LD_LIBRARY_PATH ~/mvt-venv/bin/mvt-android check-adb --output ~/mvt-out`