class PProf::Entitlements

Represents the list of entitlements in a Provisioning Profile

Public Class Methods

new(dict) click to toggle source

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

[](key) click to toggle source

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
app_groups() click to toggle source

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
app_id() click to toggle source

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
aps_environment() click to toggle source

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
beta_reports_active() click to toggle source

Are Beta (TestFlight) reports active?

@return [Bool]

# File lib/pprof/entitlements.rb, line 62
def beta_reports_active
  @dict['beta-reports-active']
end
get_task_allow() click to toggle source

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
has_key?(key) click to toggle source

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
healthkit() click to toggle source

True if the HealthKit entitlement is set

@return [Bool]

# File lib/pprof/entitlements.rb, line 69
def healthkit
  @dict['com.apple.developer.healthkit']
end
keychain_access_groups() click to toggle source

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
keys() click to toggle source

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
team_id() click to toggle source

The Team Identifier

@return [String]

# File lib/pprof/entitlements.rb, line 40
def team_id
  @dict['com.apple.developer.team-identifier']
end
to_hash() click to toggle source

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
to_s() click to toggle source

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
ubiquity_container_identifiers() click to toggle source

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
ubiquity_kvstore_identifier() click to toggle source

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