Skip to content

entitlements: support NFC tag reading - #488

Open
MuTsunTsai wants to merge 1 commit into
xtool-org:mainfrom
MuTsunTsai:entitlements-nfc
Open

MuTsunTsai wants to merge 1 commit into
xtool-org:mainfrom
MuTsunTsai:entitlements-nfc

Conversation

@MuTsunTsai

@MuTsunTsai MuTsunTsai commented Dec 1, 2026 •

Copy link
Copy Markdown

What does this PR do?

xtool didn't know about the com.apple.developer.nfc.readersession.formats entitlement, so the App ID it manages never got the NFC Tag Reading capability (and enabling it manually in the developer portal doesn't help, since the capability sync removes it on the next run). The resulting development profile didn't include the entitlement, and installing failed with:

0xe8008015 (A valid provisioning profile for this executable was not found.)

This adds an NFCReaderSessionFormatsEntitlement type and maps it to the NFC_TAG_READING capability (paid teams only), following the same pattern as #377.

This covers NFC Tag Reading, the only NFC capability that can be enabled through the App Store Connect API. The other NFC-related entitlements are left out on purpose: HCE (com.apple.developer.nfc.hce*) and the NFC & SE Platform (com.apple.developer.secure-element-credential) are capabilities Apple grants on request, aren't in Apple's OpenAPI capability enum, and I have no way to test them. The ISO 7816 / FeliCa identifier lists are Info.plist keys, not entitlements, so they don't affect provisioning.

How was it tested?

Built xtool from this change on top of 2.0.0-beta.2 (via Linux/build.sh in Docker) and ran xtool dev on WSL2 (Ubuntu 24.04) with an App Store Connect API key on a paid team, for an Xcode project whose entitlements contain com.apple.developer.nfc.readersession.formats = [TAG].

  • Before: the App ID had no NFC capability, the profile lacked the entitlement, and installation failed every time with the error above.
  • After: the App ID got NFC Tag Reading, the profile included com.apple.developer.nfc.readersession.formats = [NDEF, TAG, PACE], installation succeeded on an iPhone 8 Plus (iOS 16.7), and starting an NFCTagReaderSession in the app shows the system scan sheet.

Not tested with Apple ID (password) login.

AI tool usage

How much of the code in this PR was AI-assisted? (check one)

  • 0 - No AI was used to write code
  • 1 - I was assisted by AI in writing code. I reviewed the finished result.
  • 2 - I set the AI going and left it to it; nobody has read the result - no review, or AI review only

Summary by CodeRabbit

  • New Features
    • Added support for the NFC reader-session formats entitlement, including its list of supported formats.
    • Associated the entitlement with NFC tag reading and marked the capability as non-free. This makes the entitlement available alongside other supported entitlement types and allows its format values to be read and written consistently.

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The change adds NFCReaderSessionFormatsEntitlement with a string-array raw value, registers it as a supported entitlement type, and maps it to the non-free NFC tag reading capability.

Changes: NFC Reader Session Formats Entitlement

Layer / File(s) Summary
Define and register the entitlement
Sources/XKit/Model/Entitlements/EntitlementTypes.swift
Adds the entitlement identifier and [String] raw value with single-value decoding and encoding. Adds the entitlement type to EntitlementContainer.supportedTypes.
Map the entitlement to its capability
Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift
Maps the entitlement to .nfcTagReading with isFree: false.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: kabiroberai

Merge Risk: Minimal · up to 008d1

This change adds NFC Tag Reading entitlement support so provisioning profiles keep the capability. It is small and additive, with no identified merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "entitlements: support NFC tag reading" matches the main change. The PR adds an NFCReaderSessionFormatsEntitlement type, registers it in EntitlementContainer.supportedTypes, and maps it to t…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "entitlements: support NFC tag reading" matches the main change. The PR adds an NFCReaderSessionFormatsEntitlement type, registers it in EntitlementContainer.supportedTypes, and maps it to the NFC_TAG_READING capability. The title is specific and concise, and it names the primary capability the PR enables.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 647252c3-460f-4874-802e-68b48ccf186e
Commits

Reviewing files that changed from the base of the PR and between a637309 and 008d197.

Files selected for processing: 2

  • Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift
  • Sources/XKit/Model/Entitlements/EntitlementTypes.swift

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

This branch has not been deployed

No deployments
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.

1 participant