Class: PProf::Entitlements
- Inherits:
-
Object
- Object
- PProf::Entitlements
- Defined in:
- lib/pprof/entitlements.rb
Overview
Represents the list of entitlements in a Provisioning Profile
Instance Method Summary collapse
-
#[](key) ⇒ Object
Generic access to any entitlement by key.
-
#app_groups ⇒ Array<String>
The Application Groups registered in the entitlements.
-
#app_id ⇒ String
The full application identifier (including the team prefix), as specified in the entitlements.
-
#aps_environment ⇒ String
The Apple Push Service environment used for push notifications.
-
#beta_reports_active ⇒ Bool
Are Beta (TestFlight) reports active?.
-
#get_task_allow ⇒ Bool
The status of the ‘get-task-allow` flag.
-
#healthkit ⇒ Bool
True if the HealthKit entitlement is set.
-
#initialize(dict) ⇒ Entitlements
constructor
Create a new Entitlements object from the hash representation extracted from the Provisioning Profile.
-
#key?(key) ⇒ Boolean
(also: #has_key?)
Check if a given entitlement key is present.
-
#keychain_access_groups ⇒ Array<String>
The list of Keychain Access Groups.
-
#keys ⇒ Array<String>
The list of all entitlement keys, as String.
-
#team_id ⇒ String
The Team Identifier.
-
#to_hash ⇒ Hash
The hash representation of the entitlements (as represented in their PLIST form).
-
#to_s ⇒ String
The pretty-printed list of all entitlement keys and values (as a multi-line dashed list for human reading).
-
#ubiquity_container_identifiers ⇒ Array<String>
The Ubiquity Container identifiers, if at least one is enabled.
-
#ubiquity_kvstore_identifier ⇒ String
The Ubiquity Key-Value Store Identifier, if enabled.
Constructor Details
#initialize(dict) ⇒ Entitlements
Create a new Entitlements object from the hash representation extracted from the Provisioning Profile
13 14 15 |
# File 'lib/pprof/entitlements.rb', line 13 def initialize(dict) @dict = dict end |
Instance Method Details
#[](key) ⇒ Object
Generic access to any entitlement by key
94 95 96 |
# File 'lib/pprof/entitlements.rb', line 94 def [](key) @dict[key.to_s] end |
#app_groups ⇒ Array<String>
The Application Groups registered in the entitlements
57 58 59 |
# File 'lib/pprof/entitlements.rb', line 57 def app_groups @dict['com.apple.security.application-groups'] end |
#app_id ⇒ String
The full application identifier (including the team prefix), as specified in the entitlements
35 36 37 |
# File 'lib/pprof/entitlements.rb', line 35 def app_id @dict['application-identifier'] end |
#aps_environment ⇒ String
The Apple Push Service environment used for push notifications. Typically either ‘development’ or ‘production’, or ‘nil` if push isn’t enabled.
50 51 52 |
# File 'lib/pprof/entitlements.rb', line 50 def aps_environment @dict['aps-environment'] end |
#beta_reports_active ⇒ Bool
Are Beta (TestFlight) reports active?
64 65 66 |
# File 'lib/pprof/entitlements.rb', line 64 def beta_reports_active @dict['beta-reports-active'] end |
#get_task_allow ⇒ Bool
The status of the ‘get-task-allow` flag. True if we can attach a debugger to the executable, false if not.
28 29 30 |
# File 'lib/pprof/entitlements.rb', line 28 def get_task_allow # rubocop:disable Naming/AccessorMethodName @dict['get-task-allow'] end |
#healthkit ⇒ Bool
True if the HealthKit entitlement is set
71 72 73 |
# File 'lib/pprof/entitlements.rb', line 71 def healthkit @dict['com.apple.developer.healthkit'] end |
#key?(key) ⇒ Boolean Also known as: has_key?
Check if a given entitlement key is present
103 104 105 |
# File 'lib/pprof/entitlements.rb', line 103 def key?(key) @dict.key?(key.to_s) end |
#keychain_access_groups ⇒ Array<String>
The list of Keychain Access Groups
20 21 22 |
# File 'lib/pprof/entitlements.rb', line 20 def keychain_access_groups @dict['keychain-access-groups'] end |
#keys ⇒ Array<String>
The list of all entitlement keys, as String
112 113 114 |
# File 'lib/pprof/entitlements.rb', line 112 def keys @dict.keys.map(&:to_s) end |
#team_id ⇒ String
The Team Identifier
42 43 44 |
# File 'lib/pprof/entitlements.rb', line 42 def team_id @dict['com.apple.developer.team-identifier'] end |
#to_hash ⇒ Hash
The hash representation of the entitlements (as represented in their PLIST form)
119 120 121 |
# File 'lib/pprof/entitlements.rb', line 119 def to_hash @dict end |
#to_s ⇒ String
The pretty-printed list of all entitlement keys and values (as a multi-line dashed list for human reading)
127 128 129 130 131 |
# File 'lib/pprof/entitlements.rb', line 127 def to_s @dict.map do |key, value| "- #{key}: #{value}" end.join("\n") end |
#ubiquity_container_identifiers ⇒ Array<String>
The Ubiquity Container identifiers, if at least one is enabled
78 79 80 |
# File 'lib/pprof/entitlements.rb', line 78 def ubiquity_container_identifiers @dict['com.apple.developer.ubiquity-container-identifiers'] end |
#ubiquity_kvstore_identifier ⇒ String
The Ubiquity Key-Value Store Identifier, if enabled.
85 86 87 |
# File 'lib/pprof/entitlements.rb', line 85 def ubiquity_kvstore_identifier @dict['com.apple.developer.ubiquity-kvstore-identifier'] end |