builds
Some checks failed
release / build-and-upload (push) Has been cancelled

This commit is contained in:
404errordeveloper 2026-10-08 19:55:28 +02:00
parent 2fa8f2435f
commit 71d641eca6
5 changed files with 264 additions and 7 deletions

View file

@ -40,6 +40,92 @@ adb shell settings put system screen_off_timeout 1800000
Restore the timeout afterwards (default is usually 60000).
## Transparent capture (VPN on the phone)
When the phone must stay on a VPN (BBC + NordVPN UK, geo-locked apps, etc.),
**do not** use classic Wi‑Fi `http_proxy`. That fights the VPN tunnel.
Use **transparent** mode instead: root `iptables` redirects only the target
app’s TCP/443 into on-device `appproxy`. NordVPN (or any VPN) stays connected.
Nothing sets the global HTTP proxy.
### Why this shape
| Approach | VPN on phone | Sees HTTPS bodies (MPD / license) |
|---|---|---|
| Wi‑Fi `http_proxy` → appproxy | Often breaks / fights VPN | Yes |
| `tcpdump` / pcap on `tun0` only | Yes | No (TLS ciphertext) |
| **Transparent appproxy** | Yes | Yes |
| `drm capture --app …` for BBC | Yes (uses transparent under the hood) | Yes |
Install the binary on the phone, play while it records to
`/data/local/tmp/capture/<package>/`, then pull. Ctrl+C on the host stops
iptables and pulls into `outputs/transparent/<stamp>/`.
### Working flow
```powershell
# 1. NordVPN (or other VPN) ON on the phone — UK egress for BBC
# 2. CA once (or after reboot if the conscrypt mount dropped)
.\bin\drm.exe proxy install-ca --reinject
adb shell am force-stop <package> # e.g. bbc.iplayer.android
# 3. Start transparent MITM (VPN stays on)
.\bin\drm.exe proxy transparent --package <package>
# 4. Open the app and play on the phone
# 5. Ctrl+C when done → stops iptables + pulls captures
```
On Linux/macOS the same commands use `./bin/drm` instead of `.\bin\drm.exe`.
### On-device artifacts
```text
/data/local/tmp/capture/<package>/
cap.json structured mpd / license / auth / pssh when detected
traffic.jsonl every HTTP(S) exchange (-log-all)
appproxy.log [MPD] [LIC] [TPROXY] [PASS] lines
```
Pull without stopping the session:
```powershell
adb pull /data/local/tmp/capture/bbc.iplayer.android .\bbc-cap
```
### Cleanup (always, if interrupted)
A leftover REDIRECT breaks playback even after the host command exits. Clear it:
```powershell
.\bin\drm.exe proxy stop
adb shell "su -c 'sh /data/local/tmp/tproxy_iptables.sh stop; killall -9 appproxy 2>/dev/null; true'"
```
Do not leave a hung `drm capture` or `proxy transparent` in another terminal —
it will reinstall the redirect and break the app.
### CA cert/key mismatch
If start fails with `appproxy failed to start (transparent)`, check the log:
```powershell
adb shell "cat /data/local/tmp/capture/<package>/appproxy.log"
```
`CA: tls: private key does not match public key` means
`/data/local/tmp/appproxy-ca.key` does not match `appproxy-ca.crt`. Prefer the
matching legacy pair (certs are often identical):
```powershell
adb shell "su -c 'cp /data/local/tmp/rteproxy-ca.key /data/local/tmp/appproxy-ca.key; chmod 600 /data/local/tmp/appproxy-ca.key'"
```
Then re-run `proxy transparent`. Re-run `install-ca --reinject` and force-stop
the app so the trusted CA hash still matches the cert appproxy signs with.
## Three modes
### Passive — no module needed
@ -248,15 +334,20 @@ Also sanity-check that the KID you captured matches whatever you recorded in
|---|---|
| `tls: unknown certificate` in the app | CA not mounted into conscrypt; reinject, then force-stop the app |
| `timed out waiting for capture ([auth pid pssh mpd])` | playback never started, or `Hints` asks for a field this app does not send |
| `appproxy failed to start (transparent)` | see log; often CA key mismatch (`appproxy-ca.key` ≠ cert) — copy matching `rteproxy-ca.key` |
| App loads catalog but stream spins / fails after a capture | leftover `APPROXY_TPROXY` iptables REDIRECT — run cleanup above |
| `launch: ui node not found within Ns` | launch marker does not match — dump the tree and pick a resource id |
| `launch: exit status 1` | monkey raced a force-stop; usually transient, retry |
| `auto-play failed: ... not found` | UI changed, or the phone is on a different screen than expected |
| manifest field holds an EPG or config URL | add that host to `score.deny` |
| `CA inject skipped/failed` | transient after repeated runs; re-run `proxy reinject-ca` |
| Screen asleep mid-run | `adb shell svc power stayon true` |
| VPN on + classic `http_proxy` capture | use transparent mode instead (see above) |
Clear the phone's proxy if a run is interrupted:
Clear the phone's proxy / transparent redirect if a run is interrupted:
```bash
./bin/drm proxy stop
./bin/drm proxy clear-proxy
adb shell "su -c 'sh /data/local/tmp/tproxy_iptables.sh stop; killall -9 appproxy 2>/dev/null; true'"
```