Class: FIR::Parser::Ipa::App
Instance Method Summary collapse
- #devices ⇒ Object
- #display_name ⇒ Object
- #distribution_name ⇒ 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
- #version ⇒ Object
Constructor Details
#initialize(path) ⇒ App
Returns a new instance of App.
60 61 62 |
# File 'lib/fir/util/parser.rb', line 60 def initialize(path) @path = path end |
Instance Method Details
#devices ⇒ Object
126 127 128 |
# File 'lib/fir/util/parser.rb', line 126 def devices mobileprovision['ProvisionedDevices'] if has_mobileprovision? end |
#display_name ⇒ Object
77 78 79 |
# File 'lib/fir/util/parser.rb', line 77 def display_name info['CFBundleDisplayName'] end |
#distribution_name ⇒ Object
130 131 132 |
# File 'lib/fir/util/parser.rb', line 130 def distribution_name "#{mobileprovision['Name']} - #{mobileprovision['TeamName']}" if has_mobileprovision? end |
#has_mobileprovision? ⇒ Boolean
114 115 116 |
# File 'lib/fir/util/parser.rb', line 114 def has_mobileprovision? File.file? mobileprovision_path end |
#hide_developer_certificates ⇒ Object
122 123 124 |
# File 'lib/fir/util/parser.rb', line 122 def hide_developer_certificates mobileprovision.delete('DeveloperCertificates') if has_mobileprovision? end |
#icons ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/fir/util/parser.rb', line 89 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 { |i| !i } rescue NoMethodError [] end end |
#identifier ⇒ Object
73 74 75 |
# File 'lib/fir/util/parser.rb', line 73 def identifier info['CFBundleIdentifier'] end |
#info ⇒ Object
64 65 66 67 |
# File 'lib/fir/util/parser.rb', line 64 def info @info ||= CFPropertyList.native_types( CFPropertyList::List.new(file: File.join(@path, 'Info.plist')).value) end |
#mobileprovision ⇒ Object
102 103 104 105 106 107 108 109 110 111 112 |
# File 'lib/fir/util/parser.rb', line 102 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
118 119 120 |
# File 'lib/fir/util/parser.rb', line 118 def mobileprovision_path @mobileprovision_path ||= File.join(@path, 'embedded.mobileprovision') end |
#name ⇒ Object
69 70 71 |
# File 'lib/fir/util/parser.rb', line 69 def name info['CFBundleName'] end |
#release_type ⇒ Object
134 135 136 137 138 139 140 141 142 |
# File 'lib/fir/util/parser.rb', line 134 def release_type if has_mobileprovision? if devices 'adhoc' else 'inhouse' end end end |
#short_version ⇒ Object
85 86 87 |
# File 'lib/fir/util/parser.rb', line 85 def short_version info['CFBundleShortVersionString'] end |
#version ⇒ Object
81 82 83 |
# File 'lib/fir/util/parser.rb', line 81 def version info['CFBundleVersion'] end |