Entitlements outside supportedTypes stay in the binary but their capability is never enabled on the App ID → late install failure
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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—supportedTypesis the parse registry.NetworkExtensionEntitlement.selfis commented out at line 23,AssociatedDomainsEntitlement.selfat line 20;DataProtectionEntitlement(defined at line 109) is missing from the list entirely.Entitlements.entitlements()decodes throughProtoCodableKeyValueContainer, 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 fromentitlements().- 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, andDeveloperServicesFetchProfileOperationreturns a profile that doesn't grant those entitlements. - Meanwhile the raw dictionary inside
Entitlementsretains unknown keys by design (the type's doc comment says so), andAutoSignersigns 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:182filters to free capabilities and rebuildsEntitlementsfrom 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:
xtool.ymlwithentitlementsPathpointing at a plist containingcom.apple.developer.networking.networkextension.xtool devbuilds and provisions with no warnings.- 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.networkextensionis often an array of extension kinds (e.g.["packet-tunnel-provider"]) or a bool, so the currentrawValue: Boolmodeling would need adjusting. - PR #334 does this for
AssociatedDomainsEntitlementonly. - 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.
- Ngôn ngữ chính
- Swift
- Star
- 5.5k
- Fork
- 163
- Merge trung bình
- 19 giờ 33 phút
- Pull request đã merge (30 ngày)
- 25
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của xtool-org/xtool
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Error: exited(127)Đang mởbug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
xtool-org/xtool#365 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
xtool-org/xtool#364 · 6 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của xtool-org/xtool
Issue tương tự
-
product / auth product / databases product / functions product / messaging product / storage product / vcs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
storage: eliminate force-unwraps and fatalError in continueStreamingUploadCó thể đã có người làm @chingor13 đã nhận hôm nay. Đang mởapi: storage type: cleanup
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
googleapis/google-cloud-swift#1527 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ci-failure ci:assertion test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openwatersio/slackwater-ios#811 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-assisted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
swiftlang/swift-testing#1979 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
foxglove/mcap#1907 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày