# Phase F Android feasibility spike

This is an installable Capacitor 8 harness, not the Phase G product shell. It proves the two uncertain Android runtime capabilities with the real engine and adapters:

- the five `auto` stores run through the shared `PoliteCore` over native `CapacitorHttp`;
- Autodoc runs cold and warm through a persistent, per-store Android `WebView` and shared `CookieManager` session.

The native project targets API 36 and requires Android 7 (API 24) or newer. The generated debug APK is unsigned for distribution and debug-signed for local installation.

## Build

From the repository root:

```sh
npm install
npm run package:android:spike
```

The APK is written to `android/app/build/outputs/apk/debug/app-debug.apk`.

## Carrier-IP device gate

Use a physical Android phone. Enable USB debugging, disable Wi-Fi, and confirm ordinary browsing works over mobile data. Then:

```sh
adb devices
adb install -r android/app/build/outputs/apk/debug/app-debug.apk
adb logcat -c
adb shell am start -n lv.carp.partscomparator.spike/.MainActivity
```

The harness starts automatically with query `W71252`. Allow up to two minutes for all open stores and Autodoc's cold WebView navigation. If it shows **Show challenge**, tap it, complete the store's own challenge, then tap **Close and retry**.

Capture the machine-readable result:

```sh
adb logcat -d | rg 'PHASE_F_RESULT|PHASE_F_FATAL'
```

The Phase F gate passes when:

- `state` is `passed`;
- each of `partsale`, `xparts`, `eoltas`, `carparts`, and `handler` has `ok: true` and at least one offer;
- both Autodoc probes have `ok: true` and at least one offer, demonstrating that the retained WebView session works immediately when warm.

A result of `needs-solve` is not a failed native capability: complete the visible solve and let the harness retry. A persistent Autodoc failure after a successful solve selects the documented Android-v1 fallback: open stores only, with walled stores labelled desktop-only.

## Recorded result

**PASS · 2026-07-15.** The owner ran the complete harness on a Pixel 10a running Android 17 over carrier data. Every open-store and cold/warm Autodoc check passed. Phase G retains the full Android store set.
