WIP: test(e2e): accept the scan fixture's raw bytes as Base64 text #29

Draft
james.maes wants to merge 2 commits from feat/e2e-scan-base64-extra into main
pull from: feat/e2e-scan-base64-extra
Owner

What

The E2E scanner driver (scanner-host/src/e2e only) now also reads the fixture's raw bytes from a string extra, io.qrun.mobile.scanner.e2e.raw_data_base64 (canonical padded Base64).

Why

adb shell am broadcast cannot send a byte-array extra, so a hand-fired emulator scan could not carry raw bytes. Echo refuses a GS1-128 duplication without them, which made GS1 untestable from the command line.

Behaviour

  • The existing byte-array extra io.qrun.mobile.scanner.e2e.raw_data is unchanged and wins when both are present.
  • Malformed or non-canonical Base64 leaves the read pending, so the broadcast is ignored.
  • Side effect, same file: an invalid AIM identifier used to throw IllegalArgumentException inside onReceive after the read was already cleared; it is now ignored the same way.
  • No change to the main, debug, qa, production or release source sets. The signed app still has no broadcast ingress.

Verified locally (Java 21, Windows)

  • :scanner-host:assembleE2e :scanner-host:testE2eUnitTest :scanner-host:lintE2e: build successful; 128 tests, 0 failures, 0 errors, 0 skipped (includes the new E2eRawDataTest, 3 tests); lint 0 errors, 1 warning (existing InsecureBaseConfiguration in the E2E network security config).
  • testDebugUnitTest :scanner-host:lintDebug :scanner-host:assembleDebug: build successful; scanner-host 125, core 60, mobileapp 65 tests, 0 failures; lint 0 errors, 0 warnings.
  • node scripts/ci/check-source-standards.mjs and node --test scripts/ci/scanner-echo-guards.test.mjs: pass.
  • On an API 35 emulator the E2E APK installs beside the signed app and reaches the server-selection screen. am to-intent-uri and the device's broadcast history show all four string extras (value with spaces, ]C1, Base64 with =) arriving intact from PowerShell 7 and Windows PowerShell 5.1.

Not verified

  • The new extra has not been delivered to an open scan screen: that needs a signed-in session. ScannerEndToEndTest (which uses the byte-array extra) was not run.
  • E2eRawDataTest lives in the new src/testE2e source set, which the shared CI workflow does not run (testDebugUnitTest only).

Note for reviewers

The E2E package signs in with io.qrun.mobile.scanner.e2e.oauth://callback/oauth2redirect (docs/AUTHENTICATION.md), not the normal scanner callback. A server that advertises only the normal callback offers the E2E build no browser sign-in; docs/EMULATOR.md now says so.

🤖 Generated with Claude Code

## What The E2E scanner driver (`scanner-host/src/e2e` only) now also reads the fixture's raw bytes from a string extra, `io.qrun.mobile.scanner.e2e.raw_data_base64` (canonical padded Base64). ## Why `adb shell am broadcast` cannot send a byte-array extra, so a hand-fired emulator scan could not carry raw bytes. Echo refuses a GS1-128 duplication without them, which made GS1 untestable from the command line. ## Behaviour - The existing byte-array extra `io.qrun.mobile.scanner.e2e.raw_data` is unchanged and wins when both are present. - Malformed or non-canonical Base64 leaves the read pending, so the broadcast is ignored. - Side effect, same file: an invalid AIM identifier used to throw `IllegalArgumentException` inside `onReceive` after the read was already cleared; it is now ignored the same way. - No change to the main, debug, qa, production or release source sets. The signed app still has no broadcast ingress. ## Verified locally (Java 21, Windows) - `:scanner-host:assembleE2e :scanner-host:testE2eUnitTest :scanner-host:lintE2e`: build successful; 128 tests, 0 failures, 0 errors, 0 skipped (includes the new `E2eRawDataTest`, 3 tests); lint 0 errors, 1 warning (existing `InsecureBaseConfiguration` in the E2E network security config). - `testDebugUnitTest :scanner-host:lintDebug :scanner-host:assembleDebug`: build successful; scanner-host 125, core 60, mobileapp 65 tests, 0 failures; lint 0 errors, 0 warnings. - `node scripts/ci/check-source-standards.mjs` and `node --test scripts/ci/scanner-echo-guards.test.mjs`: pass. - On an API 35 emulator the E2E APK installs beside the signed app and reaches the server-selection screen. `am to-intent-uri` and the device's broadcast history show all four string extras (value with spaces, `]C1`, Base64 with `=`) arriving intact from PowerShell 7 and Windows PowerShell 5.1. ## Not verified - The new extra has not been delivered to an open scan screen: that needs a signed-in session. `ScannerEndToEndTest` (which uses the byte-array extra) was not run. - `E2eRawDataTest` lives in the new `src/testE2e` source set, which the shared CI workflow does not run (`testDebugUnitTest` only). ## Note for reviewers The E2E package signs in with `io.qrun.mobile.scanner.e2e.oauth://callback/oauth2redirect` (docs/AUTHENTICATION.md), not the normal scanner callback. A server that advertises only the normal callback offers the E2E build no browser sign-in; docs/EMULATOR.md now says so. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
james.maes added 1 commit 2026-11-10 16:36:35 +00:00
test(e2e): accept the scan fixture's raw bytes as Base64 text
android / android (push) Failing after 4m0s
build / android (push) Failing after 4m0s
d5c3ac2d6a
adb shell am broadcast cannot send a byte-array extra, so a manual emulator
scan could not carry the raw bytes a GS1-128 duplication needs. The E2E
driver now also reads io.qrun.mobile.scanner.e2e.raw_data_base64 (canonical
padded Base64). The byte-array extra still wins when both are present.
Malformed Base64, and an invalid AIM identifier (which used to throw inside
the receiver), now leave the read pending so the broadcast is ignored.

E2E source set only: no change to main, debug, qa, production or release.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
james.maes added 1 commit 2026-11-10 16:48:04 +00:00
test(emu): emulator-only build type with the scan fixture under the normal application ID
android / android (push) Failing after 11m43s
build / android (push) Failing after 11m43s
0419cdea91
A server that registers only the normal scanner callback offers the E2E
package no sign-in, so the fixture could not be used against it. The new
`emu` build type (initWith debug, no applicationIdSuffix, versionNameSuffix
-emu, label "QQQ Mobile EMULATOR TEST") reuses the E2E fixture driver source
under io.qrun.mobile.scanner. It does not take the E2E manifest or network
security config: cleartext stays off and only system trust is used.

Because it carries the normal application ID, the fixture driver is now
created only for the disposable .e2e package (unchanged behaviour) or when
android.os.Build describes an SDK emulator image: HARDWARE goldfish or
ranchu, PRODUCT sdk_*, MODEL sdk_* or "Android SDK built for *", and a
FINGERPRINT naming that same product. Otherwise there is no driver.

Debug, qa and release source sets are unchanged and contain no ingress.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Some required checks failed
android / android (push) Failing after 11m43s
build / android (push) Failing after 11m43s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
This pull request is marked as a work in progress.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feat/e2e-scan-base64-extra:feat/e2e-scan-base64-extra
git checkout feat/e2e-scan-base64-extra
Sign in to join this conversation.