# Android wallet smoke (Abheben + Bezahlen)

Smokes always cover **withdraw first**, then **pay** (not pay-only).

| Leg | Default | What |
|-----|---------|------|
| **1 WITHDRAW** | on | `taler://withdraw/…` + Confirm/Abheben taps |
| **2 PAY** | on | `taler://pay…` / pay-template + Pay taps |

```bash
# needs adb device/emulator
./run-android-pay-smoke.sh
STACK=goa ./run-android-pay-smoke.sh
DO_PAY=0 ./run-android-pay-smoke.sh          # withdraw only
DO_WITHDRAW=0 DO_PAY=1 …                     # pay only (unusual)
```

APK: F-Droid **1.6.1** (`net.taler.wallet.fdroid`).

## 2) Source build + same tests

Builds `taler-android` at a git **ref** (`:wallet:assembleFdroidDebug`), then
runs the **same** smoke (install + withdraw/pay deep-links).

```bash
# default: inference fix branch (GOA withdraw reliability)
./run-android-build-and-smoke.sh
# tip of master
BRANCH=master ./run-android-build-and-smoke.sh
# self-build of published stable **tag** (same release as F-Droid 1.6.1)
BRANCH=wallet-1.6.1 LABEL=stable-self ./run-android-build-and-smoke.sh
SKIP_PULL=1 BRANCH=master ./run-android-build-and-smoke.sh
TALER_ANDROID_SRC=/path/to/taler-android ./run-android-build-and-smoke.sh
```

Built package id: `net.taler.wallet.fdroid.debug`.  
Needs `ANDROID_HOME` (e.g. `$HOME/Android/Sdk`), Java 17+, network for Maven.

## 2b) Variant matrix (published + stable self-build + master)

Runs several smokes so a single odd developer build cannot be the only sample:

| Variant | What |
|---------|------|
| Order | Variant | Severity | What |
|------|---------|----------|------|
| **1** | **stable-self** | WARN | **Only** self-build: current stable tag |
| **2** | **published** | age ≤14d → **BLOCKER**, else WARN | Current F-Droid APK |
| **3** | **older / milestones** | **always WARN** | F-Droid APKs nearest **3 / 6 / 9 / 12 months** (if still hosted) — **no self-build** |
| **4** | **master** | WARN | Rebuild `origin/master` |

**Self-build policy:** only **current published stable** (`stable-self`) + optional **master**.  
Historical versions: published F-Droid APK only; skip if APK gone.  
**Milestones:** `MILESTONE_DAYS="90 180 270 365"` (±50d), warn only.  
**Young releases** (≤ 14 days): hard blocker on fail.

```bash
./run-android-variant-matrix.sh
STACK=goa ./run-android-variant-matrix.sh
INCLUDE_OLDER=0 VARIANTS=stable-self,published,master ./run-android-variant-matrix.sh
# custom milestones (days):
MILESTONE_DAYS="90 180 270 365" ./run-android-variant-matrix.sh
```

Artifacts + `SUMMARY.txt` under `out-matrix-<timestamp>/`.

## 3) Graphical UI (vanilla)

Deep-link entry (≡ QR) **plus** multi-round uiautomator taps:

```bash
STACK=goa ./run-android-gui-smoke.sh
STACK=stage ./run-android-gui-smoke.sh
# after source build:
GUI=1 ./run-android-build-and-smoke.sh
```

## 4) Full GOA/stage chain (from `dev/hernani-inference/gui-workflows`)

Bank API mint → withdraw deep-link → taps → template pay → taps:

```bash
# needs explorer password + device
EXP_PW_FILE=$HOME/src/koopa/koopa-admin-secrets/koopa/host-root/taler-bank/bank-explorer-password.txt \
  STACK=goa PKG=net.taler.wallet.fdroid.debug \
  ./run-goa-gui-chain.sh

STACK=stage ./run-goa-gui-chain.sh
```

Canonical notes (minimal variant, **flags**, Linux defaults):
**[GUI-AUTOMATION-NOTES.md](./GUI-AUTOMATION-NOTES.md)**.

| Flag | Linux default | Meaning |
|------|---------------|---------|
| `AUTO_ANDROID` | `1` | Run Android adb/APK automation |
| `AUTO_GUI` | `1` | Graphical uiautomator drive (else deep-link only) |
| `AUTO_PLATFORM` | `auto` → `linux` | Host family; macOS can later pair with iOS out of tree |
| **`EMULATOR_HEADLESS`** | **`1`** | **No host window** (`-no-window`). Server-safe. |
| `EMULATOR_GPU` | `swiftshader_indirect` | Guest GLES still active for UI/taps/screenshots |
| `AUTO_START_EMULATOR` | `1` | Auto-start headless AVD if no adb device |
| `WINDOWED` | `0` | `WINDOWED=1` → show emulator window |

```bash
# headless AVD only (default path for servers)
./start-android-emulator.sh --wait
# windowed (laptops)
WINDOWED=1 ./start-android-emulator.sh --wait
```

See also parent [GIT-AUTOMATION-NOTES.md](../GIT-AUTOMATION-NOTES.md).
