Task architecture

Review Android Barcode Payloads Before Acting

Preserve raw and display barcode representations, classify optional parsed fields, and require separate destination, authorization, and user-review checks.

Review status: Fact and editorial QA complete; owner review pending · 2026-10-08 · Fact IDs: BARCODE-PAYLOAD-BOUNDARY-2026-10, ANDROID-DEEP-LINK-ENTRY-2026-10, ANDROID-PRIVACY-01

Direct answer

A barcode scan produces data to review; recognition is not authentication, permission, or a user decision to execute the encoded value. A barcode SDK may return several related representations: a symbology format, raw bytes, a decoded raw string when available, a display-oriented string, a value-type classification, and optional parsed fields. Keep them separate in the data model. The raw representation is useful for faithful inspection, the display representation is useful for a human-readable preview, and parsed objects are convenience interpretations. None establishes who created the code, whether its contents are current, whether a URL is trustworthy, or whether the user wants the app to open, save, call, connect, or import anything. For ML Kit Barcode Scanning on Android, the official API describes rawValue as the barcode value as encoded and says it is available when the content is UTF-8; use rawBytes when rawValue cannot be determined or the data is non-UTF-8. displayValue is a user-friendly representation and can omit encoded information. Barcode.getValueType reports the detected content category; if a structure cannot be parsed it may be classified as text, and a structure unknown to the SDK version may be unknown. Built-in parsers recognize only selected common formats. Therefore, preserve nullable fields and the exact SDK version. Do not replace raw bytes with display text, treat null as empty without recording the distinction, or assume every recognized QR payload maps to a parsed object. QR Code names a symbol family, not a universal payload schema. It can encode plain text, a Web URI, Wi-Fi setup, contact details, or other data. GS1 Digital Link is a separate URI syntax for GS1 identifiers; it is not synonymous with every QR, and a similar-looking URI still needs validation against applicable rules. GS1 data can also use other data carriers. Record scanner format separately from domain interpretation; do not describe every QR as a product identifier or every URL as a GS1 resolver link. Make decoding and action separate stages. First capture a stable scan record with frame or fixture identity, detected format, nullable raw bytes/string, display value, value type, parsed-field presence, scanner dependency/model mode, and a local timestamp if useful. Then show a preview that labels values as untrusted data. A URL should pass URI parsing, allowed scheme and host policy, and user confirmation before external navigation. A Wi-Fi payload should be shown in a review screen; do not connect automatically. Contact or calendar fields should be previewed and saved only after the user chooses. A payment-looking code, app link, or command-like string must not gain authority from the scanner's type classification. Do not use a digest as proof of issuer identity. A hash can detect a change relative to a separately trusted reference, but cannot say who issued it or whether the value is safe. Signatures or authenticated registries need an independent trust root and key lifecycle; the scanner supplies neither. Without a verified issuer mechanism, describe data as user-provided or camera-observed, not official. Keep raw codes out of analytics and ordinary logs: Wi-Fi payloads may contain credentials, contact data is personal, and URLs may carry account tokens. Choose scanner delivery deliberately. ML Kit documents bundled and unbundled options, the latter with a model delivery dependency. The API requires Android API 23 or higher. Neither option proves a full workflow or every configured format works offline on a device. Pin the dependency and record delivery mode; verify exact format configuration and readiness before describing an offline scan. Do not generalize one SDK version, Play-services state, phone, or image into Cove support or universal accuracy. Test payload parsing with synthetic bytes and recognition separately with controlled images. Cover UTF-8 and non-UTF-8 raw data where supported, null raw value, omitted display characters, multiline content, plain-text and URL QR codes, GS1 Digital Link syntax, malformed URI, unrecognized structures, and multiple barcodes. Assert output stays inert until user action. Verify secret masking and that ordinary diagnostics omit payloads. Image fixtures do not prove camera quality, device support, issuer authenticity, or other apps' behavior. This is an Android method, not a claim that Cove integrates a barcode scanner.

Two QR codes in one frame carry different payloads

An Android camera frame contains two separate QR codes on a printed card: one encodes a URL and the other a Wi-Fi configuration. The scanner returns distinct detections, but the app has not established an issuer or user-approved action for either one.

Decision

Keep two scan records with separate raw bytes and previews. Validate the URL and show the Wi-Fi details for review; do not connect or navigate automatically.

Expected outcome

Each code remains traceable to its own decoded representation and requires a separate user choice before any action.

Evidence to collect

The claim becomes reviewable only when the following evidence is attached to the same artifact and test run:

  • SDK and delivery mode identity
  • Nullable rawBytes/rawValue/displayValue fixtures
  • Parsed URI preview and action-confirmation outcomes

Task quality needs a versioned corpus and acceptance rules. Fluent sample output is not an accuracy result.

Implementation workflow

  1. Capture each scanner representation. Record format, rawBytes, nullable rawValue, displayValue, valueType, parsed-field presence, SDK version, and delivery mode separately. Do not discard raw data just because a formatted value is available.
  2. Classify syntax without assigning trust. Distinguish generic QR text or URLs from a validated GS1 Digital Link or another documented domain schema. Treat unknown, malformed, and unparsed payloads as data requiring review, not as permission to proceed.
  3. Preview sensitive fields safely. Show enough content for the user to identify the proposed operation while masking passwords, tokens, contact details, or other secrets by default. Keep raw payloads out of analytics and ordinary logs.
  4. Bind every action to explicit policy. Parse URIs, allow only expected schemes and hosts, and request confirmation before navigation. Wi-Fi, contacts, calendar, payment-like, and import payloads each need a separate review and action contract.
  5. Test parser and recognizer independently. Use synthetic raw-byte cases for nullable and partial fields, and separate controlled image tests for detection. Record SDK, dependency delivery mode, device/API and configured formats; do not turn one pass into a universal offline or accuracy claim.

Keep each transition observable. A failure should identify the stage, artifact, runtime, and recovery action without logging private user content.

Acceptance criteria

  • Raw bytes, decoded raw value, display value, format, value type and optional parsed objects remain distinct and preserve null or unsupported states.
  • A displayed URL, Wi-Fi configuration, contact, calendar event or payment-like payload never executes solely because the scanner recognized or categorized it.
  • URI validation, secret masking, user confirmation, persistent storage and diagnostic logging have explicit and separately tested policies.
  • QR symbology is not conflated with GS1 Digital Link semantics; SDK version and bundled/unbundled delivery are recorded without claiming universal offline readiness.
  • The article makes no claim that Cove has barcode integration, device support, issuer verification or measured recognition accuracy.

Decision table

DimensionChoice or evidenceHow to interpret it
rawBytes or rawValueRetain as the closest representation of encoded content and note null or encoding limitations.Useful for faithful parsing, but neither an authenticated issuer nor an authorized action.
displayValueUse for a human-readable preview and identify it as presentation output.May omit encoded content and should not replace raw data for verification.
SDK parsed fieldsUse as a typed convenience result, then validate each field against application policy.Built-in structures are limited; parser success does not prove trust or user consent.
GS1 Digital Link URIValidate syntax and GS1 application rules as a domain-specific interpretation.It is a standard URI syntax for GS1 identifiers, not a synonym for arbitrary QR content.

Failure patterns to prevent

  • Treating displayValue as complete payload
  • Equating QR format with GS1 or issuer identity
  • Executing a decoded URI without review

Also prevent silent fallback, unpinned artifacts, missing cancellation, and conclusions that combine unlike configurations. Store unsuccessful runs alongside successful ones.

Minimum reproducibility record

LayerRecord
DeviceManufacturer, model, chipset, RAM class, operating-system build
SoftwareApplication version and git commit
ModelFamily, variant, revision, format, file length, hash, quantization
RuntimeName, revision, requested backend, observed backend evidence
WorkloadFixture revision, input hash, prompt hash, output policy
OutcomeCompleted, failed, cancelled, fallback, and privacy-safe diagnostics

Release checklist

  • ☐ The primary query is answered without an unsupported number.
  • ☐ Every artifact and runtime is pinned.
  • ☐ The representative task and failure policy are explicit.
  • ☐ Lifecycle, cancellation, cleanup, and fallback are tested.
  • ☐ User-content and network boundaries are documented.
  • ☐ Result wording applies only to the recorded configuration.
  • ☐ The page links to raw method or evidence when results are added.

Sources and related evidence

Chinese deployment and troubleshooting content is organized in the .奇连 AI 端侧专题.

Frequently asked questions

Does displayValue show everything encoded in a barcode?

Not necessarily. The Android ML Kit API says displayValue is formatted for users and may omit encoded information. Preserve rawValue when available and rawBytes for content that cannot be represented as UTF-8; keep null states explicit.

Does a URL barcode prove that the site or issuer is legitimate?

No. Scanner recognition only reports decoded content and possibly a parsed URL field. Apply scheme and host rules, show the destination, and require the appropriate user action; issuer identity needs a separate trust mechanism.

Is every QR code a GS1 Digital Link?

No. QR is a barcode symbology that can carry many payload types. GS1 Digital Link defines a separate URI syntax for GS1 identifiers and data. Validate that interpretation under the applicable GS1 rules instead of guessing from appearance.

Does using a bundled scanner prove offline camera scanning?

No. Bundled and unbundled options change SDK delivery dependencies, but they do not alone prove camera integration, model readiness, configured-format support, or end-to-end offline behavior on a particular device. Test and report the exact version and path.