Class: FIR::Parser::Ipa::App
Instance Method Summary collapse
- #basic_info ⇒ Object
- #devices ⇒ Object
- #display_name ⇒ Object
- #distribution_name ⇒ Object
- #full_info(options) ⇒ Object
- #has_mobileprovision? ⇒ Boolean
- #hide_developer_certificates ⇒ Object
- #icons ⇒ Object
- #identifier ⇒ Object
- #info ⇒ Object
-
#initialize(path) ⇒ App
constructor
A new instance of App.
- #mobileprovision ⇒ Object
- #mobileprovision_path ⇒ Object
- #name ⇒ Object
- #release_type ⇒ Object
- #short_version ⇒ Object
- #tmp_icons ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(path) ⇒ App
Returns a new instance of App.
61 62 63 |
# File 'lib/fir/util/parser/ipa.rb', line 61 def initialize(path) @path = path end |
Instance Method Details
#basic_info ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/fir/util/parser/ipa.rb', line 73 def basic_info @basic_info ||= { type: 'ios', identifier: identifier, name: name, display_name: display_name, build: version.to_s, version: short_version.to_s, devices: devices, release_type: release_type, distribution_name: distribution_name } end |
#devices ⇒ Object
153 154 155 |
# File 'lib/fir/util/parser/ipa.rb', line 153 def devices mobileprovision['ProvisionedDevices'] if has_mobileprovision? end |
#display_name ⇒ Object
100 101 102 |
# File 'lib/fir/util/parser/ipa.rb', line 100 def display_name info['CFBundleDisplayName'] end |
#distribution_name ⇒ Object
157 158 159 |
# File 'lib/fir/util/parser/ipa.rb', line 157 def distribution_name "#{mobileprovision['Name']} - #{mobileprovision['TeamName']}" if has_mobileprovision? end |
#full_info(options) ⇒ Object
65 66 67 68 69 70 71 |
# File 'lib/fir/util/parser/ipa.rb', line 65 def full_info() if .fetch(:full_info, false) basic_info.merge!(icons: tmp_icons) end basic_info end |
#has_mobileprovision? ⇒ Boolean
141 142 143 |
# File 'lib/fir/util/parser/ipa.rb', line 141 def has_mobileprovision? File.file? mobileprovision_path end |
#hide_developer_certificates ⇒ Object
149 150 151 |
# File 'lib/fir/util/parser/ipa.rb', line 149 def hide_developer_certificates mobileprovision.delete('DeveloperCertificates') if has_mobileprovision? end |
#icons ⇒ Object
116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/fir/util/parser/ipa.rb', line 116 def icons @icons ||= begin icons = [] info['CFBundleIcons']['CFBundlePrimaryIcon']['CFBundleIconFiles'].each do |name| icons << get_image(name) icons << get_image("#{name}@2x") end icons.delete_if &:! rescue NoMethodError [] end end |
#identifier ⇒ Object
96 97 98 |
# File 'lib/fir/util/parser/ipa.rb', line 96 def identifier info['CFBundleIdentifier'] end |
#info ⇒ Object
87 88 89 90 |
# File 'lib/fir/util/parser/ipa.rb', line 87 def info @info ||= CFPropertyList.native_types( CFPropertyList::List.new(file: File.join(@path, 'Info.plist')).value) end |
#mobileprovision ⇒ Object
129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/fir/util/parser/ipa.rb', line 129 def mobileprovision return unless has_mobileprovision? return @mobileprovision if @mobileprovision cmd = "security cms -D -i \"#{mobileprovision_path}\"" begin @mobileprovision = CFPropertyList.native_types(CFPropertyList::List.new(data: `#{cmd}`).value) rescue CFFormatError @mobileprovision = {} end end |
#mobileprovision_path ⇒ Object
145 146 147 |
# File 'lib/fir/util/parser/ipa.rb', line 145 def mobileprovision_path @mobileprovision_path ||= File.join(@path, 'embedded.mobileprovision') end |
#name ⇒ Object
92 93 94 |
# File 'lib/fir/util/parser/ipa.rb', line 92 def name info['CFBundleName'] end |
#release_type ⇒ Object
161 162 163 164 165 166 167 168 169 |
# File 'lib/fir/util/parser/ipa.rb', line 161 def release_type if has_mobileprovision? if devices 'adhoc' else 'inhouse' end end end |
#short_version ⇒ Object
108 109 110 |
# File 'lib/fir/util/parser/ipa.rb', line 108 def short_version info['CFBundleShortVersionString'] end |
#tmp_icons ⇒ Object
112 113 114 |
# File 'lib/fir/util/parser/ipa.rb', line 112 def tmp_icons icons.map { |data| generate_tmp_icon(data) } end |
#version ⇒ Object
104 105 106 |
# File 'lib/fir/util/parser/ipa.rb', line 104 def version info['CFBundleVersion'] end |