Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Entitlements outside supportedTypes stay in the binary but their capability is never enabled on the App ID → late install failure

オープン
#352 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
ios, swift
領域
devtools, mobile

調査の方向性

Start in Sources/XKit/Model/Entitlements/EntitlementTypes.swift, where supportedTypes lists the parse registry and NetworkExtensionEntitlement and DataProtectionEntitlement are missing or commented out. Then check DeveloperServicesAddAppOperation.swift around lines 88 and 182 to see how wanted capabilities are derived from parsed entitlements. Done means these entitlements survive parsing, their capabilities are requested for the App ID, and the value type handles the array and bool forms; PR #334 shows the pattern for AssociatedDomainsEntitlement.

索引モデルが issue の本文から書いたものです。

説明

If the project's entitlements file contains an entitlement whose type is not registered in EntitlementContainer.supportedTypes — today that's at least com.apple.developer.networking.networkextension and com.apple.developer.default-data-protection — xtool dev (device install) keeps the entitlement in the signed binary but never enables the matching capability on the App ID it registers. The device then rejects the install late, with an error that doesn't point at the cause. On free teams the entitlement is instead silently dropped and the feature just doesn't work.

Code trace
  • Sources/XKit/Model/Entitlements/EntitlementTypes.swift:15-30 — supportedTypes is the parse registry. NetworkExtensionEntitlement.self is commented out at line 23, AssociatedDomainsEntitlement.self at line 20; DataProtectionEntitlement (defined at line 109) is missing from the list entirely.
  • Entitlements.entitlements() decodes through ProtoCodableKeyValueContainer, which explicitly skips unknown keys (guard T.protoCodableType(for: key.stringValue) != nil else { continue } in xtool-core, ProtoCodableKeyValueContainer.swift:58-59). Unregistered entitlements never come back from entitlements().
  • Capability registration is computed only from parsed entitlements: Sources/XKit/DeveloperServices/App IDs/DeveloperServicesAddAppOperation.swift:88 — wantedCapabilitiesList = try entitlements.entitlements().compactMap(\.anyCapability). So the App ID never gets the network-extension / data-protection capability enabled, and DeveloperServicesFetchProfileOperation returns a profile that doesn't grant those entitlements.
  • Meanwhile the raw dictionary inside Entitlements retains unknown keys by design (the type's doc comment says so), and AutoSigner signs with that full mapping (Sources/XKit/Signer/AutoSigner.swift:85-92), so the binary does embed the entitlement.
  • Result for a paid team: binary entitlements ⊃ profile entitlements → install fails at device verification (the classic "entitlements not granted by the provisioning profile" class of error), long after configure/build succeeded with no warning.
  • Result for a free team: DeveloperServicesAddAppOperation.swift:182 filters to free capabilities and rebuilds Entitlements from the filtered list, silently discarding the entitlement from the binary.

The capability mappings for these entitlements already exist and are complete — Sources/XKit/DeveloperServices/App IDs/Entitlements/DeveloperServicesCapability.swift maps NetworkExtensionEntitlement → .networkExtensions and DataProtectionEntitlement → .dataProtection (with settings) — they're just unreachable because the types aren't registered.

Repro / expectations

A VPN or network-extension app with a paid team:

  1. xtool.yml with entitlementsPath pointing at a plist containing com.apple.developer.networking.networkextension.
  2. xtool dev builds and provisions with no warnings.
  3. The install on the device fails with an entitlement/profile mismatch error.

(I verified the code path statically; I haven't reproduced the device-side rejection on hardware.)

Suggested direction
  • Register the remaining entitlement types so their capabilities get provisioned. One caveat: the real-world value of com.apple.developer.networking.networkextension is often an array of extension kinds (e.g. ["packet-tunnel-provider"]) or a bool, so the current rawValue: Bool modeling would need adjusting.
  • PR #334 does this for AssociatedDomainsEntitlement only.
  • Independently of how many types get registered, a warning when an entitlements file contains keys xtool won't provision would turn this into a configure-time error instead of a late install failure — the set of entitlements Apple supports grows faster than this registry.
主要言語
Swift
スター
5.5k
フォーク
163
平均マージ
19時間 33分
マージ済み PR(30日)
25

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

xtool-org/xtool のほかの issue

xtool-org/xtool の issue をすべて見る

似ている issue

Swift の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。