From 27c3022a2c029a18c3ce25915b4233caf823d6a0 Mon Sep 17 00:00:00 2001 From: Mu-Tsun Tsai Date: Sat, 5 Dec 2026 01:54:57 +0800 Subject: [PATCH 1/2] entitlements: support NFC tag reading (#488) ## 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 - [x] **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. --- .../DeveloperServicesCapability.swift | 6 ++++++ .../Model/Entitlements/EntitlementTypes.swift | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift b/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift index 05aad380..610bf818 100644 --- a/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift +++ b/Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift @@ -123,6 +123,12 @@ extension MultipathEntitlement: EntitlementWithCapability { } } +extension NFCReaderSessionFormatsEntitlement: EntitlementWithCapability { + var capability: DeveloperServicesCapability { + DeveloperServicesCapability(.nfcTagReading, isFree: false) + } +} + extension NetworkExtensionEntitlement: EntitlementWithCapability { var capability: DeveloperServicesCapability { DeveloperServicesCapability(.networkExtensions, isFree: false) diff --git a/Sources/XKit/Model/Entitlements/EntitlementTypes.swift b/Sources/XKit/Model/Entitlements/EntitlementTypes.swift index 7bc1ea5f..1ecbcbea 100644 --- a/Sources/XKit/Model/Entitlements/EntitlementTypes.swift +++ b/Sources/XKit/Model/Entitlements/EntitlementTypes.swift @@ -30,6 +30,7 @@ extension EntitlementContainer { HomeKitEntitlement.self, HealthKitEntitlement.self, AppleSignInEntitlement.self, + NFCReaderSessionFormatsEntitlement.self, ] } @@ -115,6 +116,21 @@ public struct AppleSignInEntitlement: Entitlement, RawRepresentable { } } +public struct NFCReaderSessionFormatsEntitlement: Entitlement, RawRepresentable { + public static let identifier = "com.apple.developer.nfc.readersession.formats" + + public var rawValue: [String] + public init(rawValue: [String]) { self.rawValue = rawValue } + + public init(from decoder: Decoder) throws { + rawValue = try decoder.singleValueContainer().decode([String].self) + } + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + try container.encode(rawValue) + } +} + public enum APSEnvironmentEntitlement: String, Entitlement { public static let identifier = "aps-environment" From 85d52b47c033220844c72eafdc58bb66547db0cd Mon Sep 17 00:00:00 2001 From: "ios-linux-sync[bot]" Date: Sat, 5 Dec 2026 08:07:59 +0000 Subject: [PATCH 2/2] chore(sync): record upstream metadata for xtool-org/xtool@27c3022a2c02 --- .github/upstream-sync-state.json | 45 +++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/.github/upstream-sync-state.json b/.github/upstream-sync-state.json index b3c4ff7c..634270de 100644 --- a/.github/upstream-sync-state.json +++ b/.github/upstream-sync-state.json @@ -2,8 +2,47 @@ "upstream_repo": "xtool-org/xtool", "upstream_branch": "main", "upstream_sha": "27c3022a2c029a18c3ce25915b4233caf823d6a0", - "maintained_branch": "main", + "maintained_branch": "verify/upstream-sync-e2e", + "maintained_base_sha": "fb23eaeaf435e733775102c64984aee34d499601", + "commits_merged": 1, "latest_upstream_release": "2.0.0-beta.2", - "synced_at_utc": "2026-12-05T07:48:00Z", - "status": "initialized" + "recent_upstream_releases": [ + { + "tag": "2.0.0-beta.2", + "name": "v2.0.0-beta.2", + "prerelease": true, + "published_at": "2026-11-25T08:46:38Z", + "url": "https://github.com/xtool-org/xtool/releases/tag/2.0.0-beta.2" + }, + { + "tag": "2.0.0-beta.1", + "name": "v2.0.0-beta.1", + "prerelease": true, + "published_at": "2026-11-16T05:33:55Z", + "url": "https://github.com/xtool-org/xtool/releases/tag/2.0.0-beta.1" + }, + { + "tag": "1.24.0", + "name": "v1.24.0", + "prerelease": false, + "published_at": "2026-10-26T00:18:19Z", + "url": "https://github.com/xtool-org/xtool/releases/tag/1.24.0" + }, + { + "tag": "1.23.0", + "name": "v1.23.0", + "prerelease": false, + "published_at": "2026-10-22T21:29:36Z", + "url": "https://github.com/xtool-org/xtool/releases/tag/1.23.0" + }, + { + "tag": "1.22.2", + "name": "v1.22.2", + "prerelease": false, + "published_at": "2026-10-14T00:30:10Z", + "url": "https://github.com/xtool-org/xtool/releases/tag/1.22.2" + } + ], + "synced_at_utc": "2026-12-05T08:07:58.295979+00:00", + "status": "pending_review" }