class PProf::Entitlements
Represents the list of entitlements in a Provisioning Profile
Public Class Methods
Create a new Entitlements
object from the hash representation extracted from the Provisioning Profile
@param [Hash] dict
The hash representation of the entitlements, typically extracted from the Provisioning Profile.
# File lib/pprof/entitlements.rb, line 11 def initialize(dict) @dict = dict end
Public Instance Methods
Generic access to any entitlement by key
@param [#to_s] key
The entitlement key to read
# File lib/pprof/entitlements.rb, line 92 def [](key) @dict[key.to_s] end
The Application Groups registered in the entitlements
@return [Array<String>]
# File lib/pprof/entitlements.rb, line 55 def app_groups @dict['com.apple.security.application-groups'] end
The full application identifier (including the team prefix), as specified in the entitlements
@return [String]
# File lib/pprof/entitlements.rb, line 33 def app_id @dict['application-identifier'] end
The Apple Push Service environment used for push notifications. Typically either 'development' or 'production', or `nil` if push isn't enabled.
@return [String]
# File lib/pprof/entitlements.rb, line 48 def aps_environment @dict['aps-environment'] end
Are Beta (TestFlight) reports active?
@return [Bool]
# File lib/pprof/entitlements.rb, line 62 def beta_reports_active @dict['beta-reports-active'] end
The status of the `get-task-allow` flag. True if we can attach a debugger to the executable, false if not.
@return [Bool]
# File lib/pprof/entitlements.rb, line 26 def get_task_allow @dict['get-task-allow'] end
Check if a given entitlement key is present
@param [#to_s] key
The key to check
# File lib/pprof/entitlements.rb, line 101 def has_key?(key) @dict.has_key?(key.to_s) end
True if the HealthKit entitlement is set
@return [Bool]
# File lib/pprof/entitlements.rb, line 69 def healthkit @dict['com.apple.developer.healthkit'] end
The list of Keychain Access Groups
@return [Array<String>]
# File lib/pprof/entitlements.rb, line 18 def keychain_access_groups @dict['keychain-access-groups'] end
The list of all entitlement keys, as String
@return [Array<String>]
# File lib/pprof/entitlements.rb, line 109 def keys @dict.keys.map(&:to_s) end
The Team Identifier
@return [String]
# File lib/pprof/entitlements.rb, line 40 def team_id @dict['com.apple.developer.team-identifier'] end
The hash representation of the entitlements (as represented in their PLIST form)
@return [Hash]
# File lib/pprof/entitlements.rb, line 116 def to_hash @dict end
The pretty-printed list of all entitlement keys and values (as a multi-line dashed list for human reading)
@return [String]
# File lib/pprof/entitlements.rb, line 124 def to_s @dict.map do |key, value| "- #{key}: #{value}" end.join("\n") end
The Ubiquity Container identifiers, if at least one is enabled
@return [Array<String>]
# File lib/pprof/entitlements.rb, line 76 def ubiquity_container_identifiers @dict['com.apple.developer.ubiquity-container-identifiers'] end
The Ubiquity Key-Value Store Identifier, if enabled.
@return [String]
# File lib/pprof/entitlements.rb, line 83 def ubiquity_kvstore_identifier @dict['com.apple.developer.ubiquity-kvstore-identifier'] end