# Android Finance Automation Runbook — 2026-03-21

## Goal
Document everything learned while connecting Pipo to the Pixel 6a, automating Prex transfers via ADB, and partially exploring Personal Pay.

This file is intended as a handoff for the **next agent/model** so it can continue without rediscovering the same traps.

---

## Executive summary

### What worked
- OpenClaw Android node pairing to the Pixel 6a worked.
- ADB over Tailscale to the Pixel worked.
- Prex Argentina could be:
  - opened via ADB
  - navigated through major transfer flows
  - driven up to and through `Confirmar transferencia`
  - authenticated via PIN using **touchscreen tap coordinates** (not normal `input tap` in some protected screens)
- Successful transfers executed:
  - **$1.000,00** to `nachlakes.mp` / Mercado Pago
  - **$1.001,00** to `nachlakes.mp` / Mercado Pago
- A transfer of **$999,00** to **Ualá** was accidentally initiated because the wrong saved account row was selected.
  - It entered processing state (`En progreso`) with a visible COELSA ID.

### What failed or was flaky
- OpenClaw node alone is **not enough** for fine native app control.
- Prex PIN screens often ignore normal:
  - `adb shell input tap`
  - `adb shell input text`
- Google account flows in Personal Pay were flaky under ADB/webview control.
- It is easy to select the wrong saved account in Prex if rows are not confirmed visually first.

---

## Device / connectivity facts

### Pixel / tailnet
- Active device name seen in Tailscale during working session:
  - `pixel-6a-1`
  - tailnet IP: `100.120.158.43`
- Earlier/offline device also existed:
  - `pixel-6a`
  - old tailnet IP seen earlier: `100.77.44.46`
- ADB session that worked during most of the run:
  - device serial: `100.77.44.46:37733`
- Successful `adb devices -l` showed:
  - `product:bluejay`
  - `model:Pixel_6a`
  - `device:bluejay`

### Screen size
- Physical size detected:
  - `1080x2400`

### Android users
- `0` → `nachlakes`
- `12` → `Pipo`
- Also present:
  - `10` Lollapalooza
  - `11` Private space

---

## OpenClaw Android node findings

### Node pairing
- Pixel was successfully paired and connected as OpenClaw node.
- Node capabilities observed:
  - `calendar`
  - `camera`
  - `canvas`
  - `contacts`
  - `device`
  - `location`
  - `motion`
  - `notifications`
  - `photos`
  - `system`

### Important conclusion
OpenClaw node gives **context and observability**, but not enough native UI control for fintech flows.
For real app automation, **ADB is required**.

---

## ADB setup notes

### Installation on VPS
Installed with:
```bash
sudo apt-get install -y adb
```

### ADB pairing flow
Wireless debugging pairing was successfully completed.
Important distinction:
- one port is the **pairing port**
- another is the **ADB debug/connect port**

### Key lesson
Do not assume Tailscale visibility alone implies ADB connectivity.
You still need:
- wireless debugging enabled
- pairing port
- debug/connect port
- `adb` installed on host

---

## Prex Argentina — package + basic facts

### Package
- `air.PrexArgentina`

### General UI shape
- Large parts of the UI are rendered through a webview / hybrid shell.
- `uiautomator dump` can still expose useful text and clickable elements around key screens.

---

## Prex — successful high-level flow

### Home
Prex home showed:
- greeting to Ignacio
- ARS / USD balances
- actions: `Ingresar`, `Retirar`, `Transferir`, `Dólar`

### Transfer routes discovered
#### Generic alias/CBU/CVU route
Path:
- `Transferir`
- `Transferir a nueva cuenta`
- `Bancos y billeteras`
- field `CVU/CBU o alias`
- continue
- recipient summary
- amount
- optional message
- final summary
- `Confirmar transferencia`
- PIN prompt

#### Saved accounts route
Path:
- `Transferir`
- `Mis cuentas`
- `Ignacio Hernan Lagos`
- list of saved accounts

Saved accounts seen:
- `Billetera BIND PAGO S.A.`
- `Mercado Pago`
- `Lemon`
- `Ualá`

### Critical warning
The saved accounts route is faster but dangerous if the wrong row is tapped.
This caused the accidental Ualá transfer attempt.

---

## Prex — account details that were visibly confirmed

### Mercado Pago destination (correct)
Visible in final summary:
- recipient: `Ignacio Hernan Hilario Lagos Ruiz`
- alias: `nachlakes.mp`
- bank: `Mercado Pago`
- CVU/CBU: `0000003100093336841261`

### Ualá destination (wrong selected saved account)
Visible in final summary / status:
- recipient: `Ignacio Hernan Hilario Lagos Ruiz`
- alias: `ignaciolagosrui.uala`
- bank: `Ualá`
- CVU/CBU: `0000007900203455924596`

---

## Prex — money movement results observed

### Successful transfer 1
- amount: `$AR 1.000,00`
- destination: Mercado Pago / `nachlakes.mp`
- result screen text looked like:
  - `Transferiste $ 1.000,00`
  - success checkmark

### Transfer 2 accidentally to Ualá
- amount: `$AR 999,00`
- destination: Ualá (wrong saved account selected)
- later status screen showed:
  - `En progreso`
  - type: `PREX to UALÁ`
  - COELSA ID: `86VRPQ2GM11ZJZR02GLY0M`
  - note about accreditation possibly taking up to 72 business hours

### Successful transfer 3
- amount: `$AR 1.001,00`
- destination: Mercado Pago / `nachlakes.mp`
- result screen text:
  - `Transferiste $ 1.001,00`

---

## Prex — exact screens / sequence learned

### 1. Alias entry form
Text seen:
- `Ingresá los datos de la cuenta`
- field: `CVU/CBU o alias`
- button: `Continuar`

### 2. Recipient summary
For `nachlakes.mp`, app resolved and displayed:
- `Ignacio Hernan Hilario Lagos Ruiz`
- alias + bank + CVU/CBU
- button: `Confirmar`

### 3. Amount screen
Text seen:
- `¿Cuánto dinero querés enviar?`
- ARS amount field
- `Voy a pagar con`
- balance visible
- button: `Continuar`

### 4. Optional message screen
Text seen:
- `Escribí un mensaje para Ignacio Hernan Hilario Lagos Ruiz`
- `Mensaje (opcional)`
- button: `Continuar`

### 5. Final irreversible summary
Text seen:
- `Resumen`
- `Verificá los datos`
- destination section
- amount section
- button: `Confirmar transferencia`

### 6. PIN modal / overlay
Text seen:
- `Ignacio Hernan, ingresá tu PIN`

### 7. Success screen
Text seen example:
- `Transferiste $ 1.001,00`
- options:
  - `Compartir comprobante`
  - `Ir al inicio`

### 8. Processing screen (for pending transfer)
Text seen:
- `Tu transferencia está en curso`
- buttons:
  - `Consultar estado`
  - `Ir al inicio`

### 9. Transfer details status
Text seen:
- status `En progreso`
- amount `- $999,00`
- type `PREX to UALÁ`
- COELSA ID

---

## Prex — coordinate notes

**Important:** coordinates were not perfectly stable across every overlay/screen. They are good heuristics, not guaranteed forever.

### Prex home actions (1080x2400)
Approximate quick-action row:
- `Ingresar` area center ~ `(166, 1210)`
- `Retirar` area center ~ `(414, 1210)`
- `Transferir` area center ~ `(665, 1210)`
- `Dólar` area center ~ `(913, 1210)`

### Transfer list / main transfer page
- `Transferir a nueva cuenta` button was near bottom center around:
  - x ~ `540`
  - y ~ `2190`

### New account chooser
Two options appeared in the bottom panel:
- `Prex`
- `Bancos y billeteras`

The correct one for alias route was lower panel option around:
- x ~ `540`
- y ~ `2050`

### Alias field screen
Field tap that worked better:
- alias field area around `(540, 760)`

### Amount screen
Best tap to focus amount edit field:
- around `(800, 450)`

Button `Continuar` on one amount screen was around:
- x ~ `540`
- y ~ `1415`

### Final summary button
The `Confirmar transferencia` button was consistently near:
- x ~ `540`
- y ~ `2250`
(or button bounds around `[57,2190][1021,2316]` in one dump)

### Saved accounts list under Ignacio Hernan Lagos
Rows observed in order:
1. `Billetera BIND PAGO S.A.`
2. `Mercado Pago`
3. `Lemon`
4. `Ualá`

Approximate row centers (very rough, must verify visually if reused):
- owner card row tap to enter saved accounts: around `(540, 780)`
- second row (`Mercado Pago`) was attempted around `(540, 1055-1060)`

### Big lesson about saved accounts
Do **not** trust row taps blindly.
Always verify bank name on later summary:
- `Mercado Pago`
- or `Ualá`

---

## Prex PIN automation — critical findings

### Most important lesson
Protected PIN screens often ignored:
- `adb shell input tap`
- `adb shell input text`

What worked better:
- `adb shell input touchscreen tap X Y`
- with **multi-second pauses between digits**

### There were at least TWO different PIN keypad layouts
1. **Prex unlock/login PIN screen**
2. **Prex transfer confirmation PIN screen**

They had different Y positions.

### Transfer-confirm PIN keypad (one working layout)
Observed text bounds roughly indicated centers around:
- `1` ~ `(215, 755-763)`
- `2` ~ `(540, 755-763)`
- `4` ~ `(215, 971-978)`
- `9` ~ `(863, 1188-1194)`

Working sequence pattern for `2491` on one transfer-confirm overlay:
- `2` → `(540, 755)`
- `4` → `(215, 971)`
- `9` → `(863, 1188)`
- `1` → `(215, 755)`

### Login/unlock PIN keypad (different layout)
Observed centers roughly around:
- `1` ~ `(215, 931)`
- `2` ~ `(540, 931)`
- `4` ~ `(215, 1146)`
- `9` ~ `(863, 1362)`

Working pattern for unlock/login `2491`:
- `2` → `(540, 931)`
- `4` → `(215, 1146)`
- `9` → `(863, 1362)`
- `1` → `(215, 931)`

### Timing matters
What tended to work:
- `sleep 2` between digits
- then `sleep 6-8` after final digit

### Failure mode
If wrong coordinates or timing were used:
- only 1 or 2 dots filled
- or PIN seemed to reset to zero dots
- or nothing happened at all

---

## Personal Pay findings

### Package
- `ar.com.personalpay`

### User installation
The app existed for owner account but not initially for Pipo.
It was enabled for Pipo user 12 with:
```bash
adb -s <device> shell cmd package install-existing --user 12 ar.com.personalpay
```

### Launch for Pipo user
Launch activity resolved as:
- `ar.com.personalpay/.MainActivity`

Launch command used:
```bash
adb -s <device> shell am start --user 12 -n ar.com.personalpay/.MainActivity
```

### Early flow seen
1. notification permission prompt
2. welcome / onboarding
3. screen with:
   - `Iniciar sesión`
   - `Registrarse`

### Main mistake made
The automation kept entering the **registration funnel**, not the intended **login funnel**.
This caused wasted time.

### Google auth findings
- There is a Google flow.
- Google account chooser did appear correctly at one point.
- Visible rows in chooser:
  1. `Pipo — pipopipoleti@gmail.com`
  2. `Ignacio Lagos Ruiz — ignaciolagosruiz@gmail.com`
  3. `Use another account`
- Problem: taps on chooser / subsequent Google webview were unreliable under ADB.
- ADB text entry into the Google email field often corrupted the address, concatenating or mangling it.
- That led to errors like:
  - invalid concatenated email
  - `Couldn't find your Google Account`

### Where Personal Pay work ended
User completed login manually because automation through Google chooser/webview was too flaky.
No full Personal Pay transfer mapping was completed in this session.

---

## Key commands that were useful

### Check users
```bash
adb -s 100.77.44.46:37733 shell pm list users
```

### Check packages for specific user
```bash
adb -s 100.77.44.46:37733 shell pm list packages --user 12
```

### Enable owner-installed app for Pipo user
```bash
adb -s 100.77.44.46:37733 shell cmd package install-existing --user 12 ar.com.personalpay
```

### Launch app for Pipo user
```bash
adb -s 100.77.44.46:37733 shell am start --user 12 -n ar.com.personalpay/.MainActivity
```

### Screenshot
```bash
adb -s 100.77.44.46:37733 shell screencap -p /sdcard/x.png
adb -s 100.77.44.46:37733 pull /sdcard/x.png /home/ubuntu/.openclaw/workspace/x.png
```

### UI dump
```bash
adb -s 100.77.44.46:37733 shell uiautomator dump /sdcard/window.xml >/dev/null 2>&1
adb -s 100.77.44.46:37733 pull /sdcard/window.xml /home/ubuntu/.openclaw/workspace/window.xml
```

### Launch app via monkey
```bash
adb -s 100.77.44.46:37733 shell monkey -p air.PrexArgentina -c android.intent.category.LAUNCHER 1
```

### Tap via touchscreen path (preferred for protected flows)
```bash
adb -s 100.77.44.46:37733 shell input touchscreen tap X Y
```

---

## Operational rules learned

### Rule 1
For finance apps, the automation should work autonomously **until the last irreversible point**, then send screenshot + summary.

### Rule 2
For saved-account flows, always verify the bank name on summary before pressing final confirmation.
This matters because wrong row selection can silently switch:
- Mercado Pago
- Ualá
- Lemon
- etc.

### Rule 3
For Google auth inside app webviews/Play Services, account chooser taps are preferable to manual text entry.
Manual ADB text injection into Google sign-in fields is unreliable.

### Rule 4
On protected PIN screens, use:
- `input touchscreen tap`
- slow timing
- screen-specific coordinates

### Rule 5
When a transfer lands in `En progreso`, open `Consultar estado` and record any visible external transaction IDs (e.g. COELSA).

---

## Recommended next-agent tasks

1. **Normalize a reusable finance automation toolkit**
   - wrappers for screenshot
   - wrappers for uiautomator dump
   - wrappers for safe tap sequences
   - coordinate profiles per screen type

2. **Stabilize Google chooser/webview automation**
   - detect chooser reliably
   - tap account rows by visual/UI anchor
   - avoid manual email typing if possible

3. **Map Personal Pay fully**
   - home screen
   - transfer entry points
   - whether it has saved-account flows
   - whether PIN/biometric prompts appear

4. **Ledger / treasury layer**
   - maintain a central state of balances across fintech apps
   - decide optimal source account for transfers

---

## Prompt for the next agent

Use this prompt verbatim or as a base:

```text
You are taking over Android finance automation work on a Pixel 6a already connected via ADB over Tailscale.

Read this runbook first:
/home/ubuntu/.openclaw/workspace/android-finance-automation-runbook-2026-03-21.md

Your goals:
1. Continue from the current known setup without rediscovering old mistakes.
2. Use ADB as the primary control layer; OpenClaw node is context only.
3. For Prex, assume transfer automation works up to and through confirmation/PIN, but verify destination bank carefully before final action.
4. For Personal Pay, do NOT fall into the registration funnel if the task is login. Prefer:
   - Iniciar sesión
   - Google chooser
   - choose Ignacio Lagos Ruiz / ignaciolagosruiz@gmail.com
   - avoid manual email typing into Google webviews unless absolutely necessary.
5. Before any irreversible finance action, capture a screenshot and summarize:
   - amount
   - recipient
   - bank
   - button text
6. If a PIN screen appears, identify whether it is unlock/login PIN or transfer-confirm PIN before using coordinates.
7. Record all newly learned coordinates, package/activity names, and failure modes back into the runbook.

Be practical, careful, and do not repeat the known mistakes documented in the runbook.
```

---

## File location
This knowledge was saved here:
- `/home/ubuntu/.openclaw/workspace/android-finance-automation-runbook-2026-03-21.md`

Copy/paste that path directly to the next model.
