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
- #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
107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/app_info/parser/ipa.rb', line 107 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
173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/app_info/parser/ipa.rb', line 173 def cleanup! return unless @contents FileUtils.rm_rf(@contents) @contents = nil @icons = nil @app_path = nil @metadata = nil @metadata_path = nil @info = nil end |
#device_type ⇒ Object
71 72 73 |
# File 'lib/app_info/parser/ipa.rb', line 71 def device_type info.device_type end |
#devices ⇒ Object
75 76 77 |
# File 'lib/app_info/parser/ipa.rb', line 75 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
95 96 97 |
# File 'lib/app_info/parser/ipa.rb', line 95 def distribution_name "#{profile_name} - #{team_name}" if profile_name && team_name end |
#expired_date ⇒ Object
91 92 93 |
# File 'lib/app_info/parser/ipa.rb', line 91 def expired_date mobileprovision.expired_date end |
#hide_developer_certificates ⇒ Object
125 126 127 |
# File 'lib/app_info/parser/ipa.rb', line 125 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
165 166 167 |
# File 'lib/app_info/parser/ipa.rb', line 165 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
152 153 154 155 |
# File 'lib/app_info/parser/ipa.rb', line 152 def return unless @metadata ||= CFPropertyList.native_types(CFPropertyList::List.new(file: ).value) end |
#metadata? ⇒ Boolean
157 158 159 |
# File 'lib/app_info/parser/ipa.rb', line 157 def File.exist?() end |
#metadata_path ⇒ Object
161 162 163 |
# File 'lib/app_info/parser/ipa.rb', line 161 def @metadata_path ||= File.join(@contents, 'iTunesMetadata.plist') end |
#mobileprovision ⇒ Object
129 130 131 132 133 134 135 136 |
# File 'lib/app_info/parser/ipa.rb', line 129 def mobileprovision return unless mobileprovision? return @mobileprovision if @mobileprovision file = AppInfo::Parser.mac? ? mobileprovision_path : nil @mobileprovision = MobileProvision.new(file) end |
#mobileprovision? ⇒ Boolean
138 139 140 |
# File 'lib/app_info/parser/ipa.rb', line 138 def mobileprovision? File.exist?mobileprovision_path end |
#mobileprovision_path ⇒ Object
142 143 144 145 146 147 148 149 150 |
# File 'lib/app_info/parser/ipa.rb', line 142 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 |
#profile_name ⇒ Object
87 88 89 |
# File 'lib/app_info/parser/ipa.rb', line 87 def profile_name mobileprovision.profile_name end |
#release_type ⇒ Object
99 100 101 102 103 104 105 |
# File 'lib/app_info/parser/ipa.rb', line 99 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
121 122 123 |
# File 'lib/app_info/parser/ipa.rb', line 121 def stored? ? true : false end |
#team_identifier ⇒ Object
83 84 85 |
# File 'lib/app_info/parser/ipa.rb', line 83 def team_identifier mobileprovision.team_identifier end |
#team_name ⇒ Object
79 80 81 |
# File 'lib/app_info/parser/ipa.rb', line 79 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 |