Skip to content

Guard unknown-profile targets and a full target list - #57

Merged
i12bp8 merged 1 commit into
i12bp8:mainfrom
Hoggormino:unknown-tag-guards
Sep 17, 2026
Merged

i12bp8 merged 1 commit into
i12bp8:mainfrom
Hoggormino:unknown-tag-guards

Conversation

@Hoggormino

@Hoggormino Hoggormino commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A tag whose type code is not in the profile table gets a zeroed profile: kind Unknown, 0x0, Mono. NFC scan, targets.txt and web_job.txt all create such targets. Because only Segment tags were excluded, these targets were offered Set Text, Set Image and WiFi Plugins. Set Text on a 0x0 job reaches malloc(0), which official and Momentum firmware treat as a fatal error.

  • Set Text, Set Image and WiFi Plugins are offered only for dot-matrix profiles found in the table. Every one of the 28 dot-matrix entries, including type 1626, keeps them.
  • Show Tag Info says the type is not in the profile table and which actions are hidden, instead of "Size: 0x0" and "Color: Mono".
  • A 0x0 text job is refused before either sized text path allocates.
  • Manual barcode entry with all 16 slots used shows "Target List Full". It used to open Target Actions with selected_target -1, where Show Tag Info and LED Test index targets[-1].
  • Widget buttons call back on press, short press and release, so the "Unsupported Tag" Back button went back twice. It now acts on the short press only.

Independent of #56 and #54; merges cleanly with both.

Verification

  • Builds with zero warnings against release SDK 1.4.3 (API 87.1) and dev SDK 7f0b6e1c (API 88.2).
  • A host check of the old and new graphics predicate over the whole profile table: only unknown profiles change.
  • New strings measured against the firmware's u8g2 fonts; all fit.
  • Hardware (Flipper Zero, Momentum mntm-012, API 87.1): entering a barcode whose type code is not in the profile table shows "Unsupported Tag", and one press of the on-screen Back button returns to Targeted Payloads. Before this change the same press went back twice, landing on the main menu.

🤖 Generated with Claude Code

A tag whose type code is not in the profile table gets a zeroed profile:
kind Unknown, 0x0, Mono. NFC scan, targets.txt and web_job.txt (and the
unreachable phone-sync code) all create such targets, and because only
Segment was excluded they were offered Set Text, Set Image and WiFi
Plugins. Set Text on a 0x0 job reaches malloc(0), which the firmware
treats as a fatal error.

- Offer Set Text, Set Image and WiFi Plugins only for dot-matrix
  profiles found in the table; the app has no display size for others.
- Show Tag Info says the type is not in the profile table and which
  actions are hidden, instead of reporting "Size: 0x0" and "Color: Mono".
- Refuse a 0x0 text job before either sized text path allocates.
- Manual barcode entry with all 16 slots used now shows "Target List
  Full". It used to open Target Actions with selected_target -1, where
  Show Tag Info and LED Test index targets[-1].
- Widget buttons call back on press, short press and release, so the
  Back button went back twice. Act on the short press only.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants