Class: AppInfo::Parser::IPA
Overview
IPA parser
Defined Under Namespace
Modules: ExportType
Instance Attribute Summary collapse
-
#app_path ⇒ Object
readonly
Returns the value of attribute app_path.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
- #build_type ⇒ Object
- #build_version ⇒ Object
- #bundle_name ⇒ Object
- #cleanup! ⇒ Object
- #device_type ⇒ Object
- #devices ⇒ Object
- #display_name ⇒ Object
- #distribution_name ⇒ Object
- #expired_date ⇒ Object
- #hide_developer_certificates ⇒ Object
- #icons ⇒ Object
- #identifier ⇒ Object (also: #bundle_id)
- #info ⇒ Object
-
#initialize(file) ⇒ IPA
constructor
A new instance of IPA.
- #ipad? ⇒ Boolean
- #iphone? ⇒ Boolean
- #metadata ⇒ Object
- #metadata? ⇒ Boolean
- #metadata_path ⇒ Object
-
#min_sdk_version ⇒ Object
Return the minimum OS version for the given application.
- #mobileprovision ⇒ Object
- #mobileprovision? ⇒ Boolean
- #mobileprovision_path ⇒ Object
- #name ⇒ Object
- #os ⇒ Object
- #profile_name ⇒ Object
- #release_type ⇒ Object
- #release_version ⇒ Object
- #stored? ⇒ Boolean
- #team_identifier ⇒ Object
- #team_name ⇒ Object
- #universal? ⇒ Boolean
Constructor Details
#initialize(file) ⇒ IPA
Returns a new instance of IPA.
22 23 24 25 |
# File 'lib/app_info/parser/ipa.rb', line 22 def initialize(file) @file = file @app_path = app_path end |
Instance Attribute Details
#app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
11 12 13 |
# File 'lib/app_info/parser/ipa.rb', line 11 def app_path @app_path end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
11 12 13 |
# File 'lib/app_info/parser/ipa.rb', line 11 def file @file end |
Instance Method Details
#build_type ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/app_info/parser/ipa.rb', line 114 def build_type return ExportType::UNKOWN unless AppInfo::Parser.mac? if mobileprovision? if devices ExportType::ADHOC else ExportType::INHOUSE end else ExportType::DEBUG end end |
#build_version ⇒ Object
43 44 45 |
# File 'lib/app_info/parser/ipa.rb', line 43 def build_version info.build_version end |
#bundle_name ⇒ Object
63 64 65 |
# File 'lib/app_info/parser/ipa.rb', line 63 def bundle_name info.bundle_name end |
#cleanup! ⇒ Object
180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/app_info/parser/ipa.rb', line 180 def cleanup! return unless @contents FileUtils.rm_rf(@contents) @contents = nil @icons = nil @app_path = nil = nil = nil @info = nil end |
#device_type ⇒ Object
78 79 80 |
# File 'lib/app_info/parser/ipa.rb', line 78 def device_type info.device_type end |
#devices ⇒ Object
82 83 84 |
# File 'lib/app_info/parser/ipa.rb', line 82 def devices mobileprovision.devices end |
#display_name ⇒ Object
59 60 61 |
# File 'lib/app_info/parser/ipa.rb', line 59 def display_name info.display_name end |
#distribution_name ⇒ Object
102 103 104 |
# File 'lib/app_info/parser/ipa.rb', line 102 def distribution_name "#{profile_name} - #{team_name}" if profile_name && team_name end |
#expired_date ⇒ Object
98 99 100 |
# File 'lib/app_info/parser/ipa.rb', line 98 def expired_date mobileprovision.expired_date end |
#hide_developer_certificates ⇒ Object
132 133 134 |
# File 'lib/app_info/parser/ipa.rb', line 132 def hide_developer_certificates mobileprovision.delete('DeveloperCertificates') if mobileprovision? end |
#icons ⇒ Object
67 68 69 |
# File 'lib/app_info/parser/ipa.rb', line 67 def icons info.icons end |
#identifier ⇒ Object Also known as: bundle_id
51 52 53 |
# File 'lib/app_info/parser/ipa.rb', line 51 def identifier info.identifier end |
#info ⇒ Object
172 173 174 |
# File 'lib/app_info/parser/ipa.rb', line 172 def info @info ||= InfoPlist.new(@app_path) end |
#ipad? ⇒ Boolean
35 36 37 |
# File 'lib/app_info/parser/ipa.rb', line 35 def ipad? info.ipad? end |
#iphone? ⇒ Boolean
31 32 33 |
# File 'lib/app_info/parser/ipa.rb', line 31 def iphone? info.iphone? end |
#metadata ⇒ Object
159 160 161 162 |
# File 'lib/app_info/parser/ipa.rb', line 159 def return unless ||= CFPropertyList.native_types(CFPropertyList::List.new(file: ).value) end |
#metadata? ⇒ Boolean
164 165 166 |
# File 'lib/app_info/parser/ipa.rb', line 164 def File.exist?() end |
#metadata_path ⇒ Object
168 169 170 |
# File 'lib/app_info/parser/ipa.rb', line 168 def ||= File.join(@contents, 'iTunesMetadata.plist') end |
#min_sdk_version ⇒ Object
Return the minimum OS version for the given application
74 75 76 |
# File 'lib/app_info/parser/ipa.rb', line 74 def min_sdk_version info.min_sdk_version end |
#mobileprovision ⇒ Object
136 137 138 139 140 141 142 143 |
# File 'lib/app_info/parser/ipa.rb', line 136 def mobileprovision return unless mobileprovision? return @mobileprovision if @mobileprovision file = AppInfo::Parser.mac? ? mobileprovision_path : nil @mobileprovision = MobileProvision.new(file) end |
#mobileprovision? ⇒ Boolean
145 146 147 |
# File 'lib/app_info/parser/ipa.rb', line 145 def mobileprovision? File.exist?mobileprovision_path end |
#mobileprovision_path ⇒ Object
149 150 151 152 153 154 155 156 157 |
# File 'lib/app_info/parser/ipa.rb', line 149 def mobileprovision_path filename = 'embedded.mobileprovision' @mobileprovision_path ||= File.join(@file, filename) unless File.exist?@mobileprovision_path @mobileprovision_path = File.join(app_path, filename) end @mobileprovision_path end |
#name ⇒ Object
55 56 57 |
# File 'lib/app_info/parser/ipa.rb', line 55 def name display_name || bundle_name end |
#os ⇒ Object
27 28 29 |
# File 'lib/app_info/parser/ipa.rb', line 27 def os Parser::Platform::IOS end |
#profile_name ⇒ Object
94 95 96 |
# File 'lib/app_info/parser/ipa.rb', line 94 def profile_name mobileprovision.profile_name end |
#release_type ⇒ Object
106 107 108 109 110 111 112 |
# File 'lib/app_info/parser/ipa.rb', line 106 def release_type if stored? ExportType::RELEASE else build_type end end |
#release_version ⇒ Object
47 48 49 |
# File 'lib/app_info/parser/ipa.rb', line 47 def release_version info.release_version end |
#stored? ⇒ Boolean
128 129 130 |
# File 'lib/app_info/parser/ipa.rb', line 128 def stored? ? true : false end |
#team_identifier ⇒ Object
90 91 92 |
# File 'lib/app_info/parser/ipa.rb', line 90 def team_identifier mobileprovision.team_identifier end |
#team_name ⇒ Object
86 87 88 |
# File 'lib/app_info/parser/ipa.rb', line 86 def team_name mobileprovision.team_name end |
#universal? ⇒ Boolean
39 40 41 |
# File 'lib/app_info/parser/ipa.rb', line 39 def universal? info.universal? end |