feat: simplify receiving and remove arbitrary limits

- Use fixed port 8787 and reconnect automatically after Wi-Fi loss
- Remove session expiry, APK expiry, size caps, and upload deadlines
- Replace manual keys with watch-approved browser access
- Improve streaming, storage recovery, and resource cleanup
- Preserve explicit Android installation consent
- Document retained safeguards and expand emulator coverage
This commit is contained in:
Meghdad committed 2026-10-15 19:50:10 +03:30
1 parent 1a64de5515
commit 6e41db2a74
41 files changed
+1241 -561

No files matched your search

+17 -6
View File
@@ -14,8 +14,8 @@
```sh
./gradlew :app:assembleDebug :app:assembleDebugAndroidTest :app:testDebugUnitTest :app:lint :app:bundleRelease
adb devices
python 3 scripts/test-emulators.py --watch emulator-5554 --skip-build
python 3 scripts/test-emulators.py --watch emulator-5554 --small --skip-build
python3 scripts/test-emulators.py --watch emulator-5554 --skip-build
python3 scripts/test-emulators.py --watch emulator-5554 --small --skip-build
```
Use actual serials from `adb devices`. The runner refuses serials that do not start with `emulator-` and requires the watch feature. It never selects a physical device. It connects the watch to the virtual AndroidWifi access point, installs only the app/test APKs and saves results under `app/build/reports/validation`. The small-screen run temporarily uses 192 dp and 1.3x font scaling, restoring the previous size, density and font setting in a finally block.
@@ -33,7 +33,7 @@ npm test --prefix web-tests
npm run format:check --prefix web-tests
```
These tests serve the actual bundled assets with a local API fixture and exercise 320/390/768/1440 px widths, both themes, manual session-key entry, file rejection, upload errors/retry, system-status transitions and cancellation. This isolates browser interactions; it does not stand in for watch networking. An existing Chromium executable can be selected with PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH.
These tests serve the actual bundled assets with a local API fixture and exercise 320/390/768/1440 px widths, both themes, watch-approval/denial/retry states without manual keys, empty-file rejection, a 64 MiB streamed browser upload, upload errors/retry, system-status transitions and cancellation. This isolates browser interactions; it does not stand in for watch networking. An existing Chromium executable can be selected with PLAYWRIGHT_CHROMIUM_EXECUTABLE_PATH.
Playwright and Prettier are development dependencies only, locked in web-tests/package-lock.json. There is no Node toolchain in the Android runtime or asset build. `npm run format --prefix web-tests` formats web assets and browser tests; use standard Kotlin formatting for native source.
@@ -42,12 +42,23 @@ Playwright and Prettier are development dependencies only, locked in web-tests/p
Complete Chrome’s first-run setup in the Android Emulator, leave Chrome open, and run:
```sh
python 3 scripts/test-emulators.py --watch emulator-5554 --browser emulator-5556 --skip-build
python3 scripts/test-emulators.py --watch emulator-5554 --browser emulator-5556 --skip-build
```
Both emulators must use the shared virtual Wi-Fi network. Android Emulator 36.5+ [supports direct communication between emulator instances](https://developer.android.com/studio/run/emulator-networking-interconnect). The runner starts Pakkit through its visible receiving action, reads the private link from the actual watch UI, connects Playwright to Chrome on the Android Emulator through a local ADB forward, and submits the signed QA fixture. Chrome sends the real XHR directly to the watch’s private Wi-Fi address. The test asserts watch review, then dismisses the fixture and ends the session. Debug forwarding is test infrastructure; no debug endpoint or test mode ships in Pakkit. The forward is removed afterward and the watch app is stopped even on failure.
Both emulators must use the shared virtual Wi-Fi network. Android Emulator 36.5+ [supports direct communication between emulator instances](https://developer.android.com/studio/run/emulator-networking-interconnect). The runner starts Pakkit through its visible receiving action, reads the fixed-port address from the actual watch UI, connects Playwright to Chrome on the Android Emulator through a local ADB forward, approves the browser using the visible **Allow browser** watch control, and submits the signed QA fixture. Chrome sends the real XHR directly to the watch’s private Wi-Fi address. The test asserts watch review, then dismisses the fixture and ends the session. Debug forwarding is test infrastructure; no debug endpoint or test mode ships in Pakkit. The forward is removed afterward and the watch app is stopped even on failure.
An uninitialized Chrome instance or isolated/older emulator network requires environment setup; the runner does not silently substitute mock transport. Keep private session URLs out of committed logs. Generated screenshots and API summaries live under app/build/reports/validation.
An uninitialized Chrome instance or isolated/older emulator network requires environment setup; the runner does not silently substitute mock transport. No URL token or manual session key is used. Generated screenshots and API summaries live under app/build/reports/validation.
## Large APK validation
Build the normal fixture, then generate a separately signed fixture with a stored 64 MiB asset:
```sh
python3 scripts/create-large-fixture.py
python3 scripts/test-emulators.py --watch emulator-5554 --browser emulator-5556 --large --skip-build
```
The resulting APK is about 66 MiB. `--bytes` can select another asset size based on the test device's actual storage. The generator copies and signs incrementally, does not modify source assets, and writes only under ignored app/build/qa. Chrome receives the test file in its own emulator storage; CDP selects that file directly, avoiding Playwright's unrelated 50 MB in-memory buffer limit. The real web app uploads the File using XHR. Generated large fixtures are never included in the app/test APK or release bundle. The runner removes the Chrome-side copy afterward.
## Fixture and release inspection