Class: ProvisionProfile
- Inherits:
-
Object
- Object
- ProvisionProfile
- Defined in:
- lib/ipa_utilities/parsers.rb
Instance Method Summary collapse
- #apns_and_app_same_environment? ⇒ Boolean
- #apns_environment ⇒ Object
- #apns_gateway ⇒ Object
- #app_store_build? ⇒ Boolean
- #build_environment ⇒ Object
- #bundle_id ⇒ Object
- #certificates ⇒ Object
- #display_name ⇒ Object
-
#initialize(provision_path) ⇒ ProvisionProfile
constructor
A new instance of ProvisionProfile.
- #production_apns? ⇒ Boolean
- #provisioned_devices ⇒ Object
- #release_build? ⇒ Boolean
- #signing_entitlement(new_bundle_id) ⇒ Object
- #signing_identities ⇒ Object
- #task_allow? ⇒ Boolean
- #team_identifier ⇒ Object
- #team_name ⇒ Object
- #uuid ⇒ Object
Constructor Details
#initialize(provision_path) ⇒ ProvisionProfile
Returns a new instance of ProvisionProfile.
54 55 56 57 |
# File 'lib/ipa_utilities/parsers.rb', line 54 def initialize(provision_path) @provision_path = provision_path @data = CFPropertyList.native_types(read_profile) end |
Instance Method Details
#apns_and_app_same_environment? ⇒ Boolean
91 92 93 |
# File 'lib/ipa_utilities/parsers.rb', line 91 def apns_and_app_same_environment? release_build? == production_apns? end |
#apns_environment ⇒ Object
112 113 114 |
# File 'lib/ipa_utilities/parsers.rb', line 112 def apns_environment production_apns? ? "Production" : "Development (Sandbox)" end |
#apns_gateway ⇒ Object
116 117 118 |
# File 'lib/ipa_utilities/parsers.rb', line 116 def apns_gateway production_apns? ? "gateway.push.apple.com:2195" : "gateway.sandbox.push.apple.com:2195" end |
#app_store_build? ⇒ Boolean
87 88 89 |
# File 'lib/ipa_utilities/parsers.rb', line 87 def app_store_build? provisioned_devices.nil? end |
#build_environment ⇒ Object
120 121 122 123 124 125 126 |
# File 'lib/ipa_utilities/parsers.rb', line 120 def build_environment if release_build? app_store_build? ? "Distribution" : "AdHoc" else "Development" end end |
#bundle_id ⇒ Object
95 96 97 98 |
# File 'lib/ipa_utilities/parsers.rb', line 95 def bundle_id identifier = @data["Entitlements"]["application-identifier"] identifier[/#{team_identifier}\.(.*)/, 1] end |
#certificates ⇒ Object
67 68 69 |
# File 'lib/ipa_utilities/parsers.rb', line 67 def certificates @data["DeveloperCertificates"] end |
#display_name ⇒ Object
104 105 106 |
# File 'lib/ipa_utilities/parsers.rb', line 104 def display_name @data["Name"] end |
#production_apns? ⇒ Boolean
75 76 77 |
# File 'lib/ipa_utilities/parsers.rb', line 75 def production_apns? @data["Entitlements"]["aps-environment"] == "production" end |
#provisioned_devices ⇒ Object
71 72 73 |
# File 'lib/ipa_utilities/parsers.rb', line 71 def provisioned_devices @data["ProvisionedDevices"] end |
#release_build? ⇒ Boolean
79 80 81 |
# File 'lib/ipa_utilities/parsers.rb', line 79 def release_build? !@data["Entitlements"]["get-task-allow"] end |
#signing_entitlement(new_bundle_id) ⇒ Object
128 129 130 131 132 133 134 135 136 |
# File 'lib/ipa_utilities/parsers.rb', line 128 def signing_entitlement(new_bundle_id) bundle_to_write = "#{team_identifier}.#{new_bundle_id || bundle_id}" puts "Bundle identifier: #{bundle_to_write}" file_path = File.("#{__FILE__}/../../resources/Original.Entitlements.plist") file = File.read(file_path) file.sub!("BUNDLE_ID", bundle_to_write) file.sub!("GET_TASK_ALLOW", release_build? ? "false" : "true") end |
#signing_identities ⇒ Object
63 64 65 |
# File 'lib/ipa_utilities/parsers.rb', line 63 def signing_identities certificates.map { |identity| SigningIdentity.from_base64(Base64.encode64(identity)) } end |
#task_allow? ⇒ Boolean
83 84 85 |
# File 'lib/ipa_utilities/parsers.rb', line 83 def task_allow? @data["Entitlements"]["get-task-allow"] end |
#team_identifier ⇒ Object
108 109 110 |
# File 'lib/ipa_utilities/parsers.rb', line 108 def team_identifier @data["Entitlements"]["com.apple.developer.team-identifier"] end |
#team_name ⇒ Object
100 101 102 |
# File 'lib/ipa_utilities/parsers.rb', line 100 def team_name @data["TeamName"] end |
#uuid ⇒ Object
59 60 61 |
# File 'lib/ipa_utilities/parsers.rb', line 59 def uuid @data["UUID"] end |