-
Notifications
You must be signed in to change notification settings - Fork 12
/
capabilities.go
66 lines (60 loc) · 3.12 KB
/
capabilities.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package profileutil
import (
"github.com/bitrise-io/go-utils/log"
"github.com/bitrise-io/go-xcode/plistutil"
)
// MatchTargetAndProfileEntitlements ...
func MatchTargetAndProfileEntitlements(targetEntitlements plistutil.PlistData, profileEntitlements plistutil.PlistData, profileType ProfileType) []string {
missingEntitlements := []string{}
for key := range targetEntitlements {
_, known := KnownProfileCapabilitiesMap[profileType][key]
if !known {
continue
}
_, found := profileEntitlements[key]
if !found {
missingEntitlements = append(missingEntitlements, key)
}
}
log.Debugf("Found %v entitlements from %v target", len(missingEntitlements), len(targetEntitlements))
return missingEntitlements
}
// KnownProfileCapabilitiesMap ...
var KnownProfileCapabilitiesMap = map[ProfileType]map[string]bool{
ProfileTypeMacOs: map[string]bool{
"com.apple.developer.networking.networkextension": true,
"com.apple.developer.icloud-container-environment": true,
"com.apple.developer.icloud-container-development-container-identifiers": true,
"com.apple.developer.aps-environment": true,
"keychain-access-groups": true,
"com.apple.developer.icloud-services": true,
"com.apple.developer.icloud-container-identifiers": true,
"com.apple.developer.networking.vpn.api": true,
"com.apple.developer.ubiquity-kvstore-identifier": true,
"com.apple.developer.ubiquity-container-identifiers": true,
"com.apple.developer.game-center": true,
"com.apple.application-identifier": true,
"com.apple.developer.team-identifier": true,
"com.apple.developer.maps": true,
},
ProfileTypeIos: map[string]bool{
"com.apple.developer.in-app-payments": true,
"com.apple.security.application-groups": true,
"com.apple.developer.default-data-protection": true,
"com.apple.developer.healthkit": true,
"com.apple.developer.homekit": true,
"com.apple.developer.networking.HotspotConfiguration": true,
"inter-app-audio": true,
"keychain-access-groups": true,
"com.apple.developer.networking.multipath": true,
"com.apple.developer.nfc.readersession.formats": true,
"com.apple.developer.networking.networkextension": true,
"aps-environment": true,
"com.apple.developer.associated-domains": true,
"com.apple.developer.siri": true,
"com.apple.developer.networking.vpn.api": true,
"com.apple.external-accessory.wireless-configuration": true,
"com.apple.developer.pass-type-identifiers": true,
"com.apple.developer.icloud-container-identifiers": true,
},
}