Class: Parser::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
77 78 79 |
# File 'lib/fir/patches/parser_patch.rb', line 77 def initialize(path) @path = path end |
Instance Method Details
#devices ⇒ Object
143 144 145 |
# File 'lib/fir/patches/parser_patch.rb', line 143 def devices mobileprovision['ProvisionedDevices'] if has_mobileprovision? end |
#display_name ⇒ Object
94 95 96 |
# File 'lib/fir/patches/parser_patch.rb', line 94 def display_name info['CFBundleDisplayName'] end |
#distribution_name ⇒ Object
147 148 149 |
# File 'lib/fir/patches/parser_patch.rb', line 147 def distribution_name "#{mobileprovision['Name']} - #{mobileprovision['TeamName']}" if has_mobileprovision? end |
#has_mobileprovision? ⇒ Boolean
131 132 133 |
# File 'lib/fir/patches/parser_patch.rb', line 131 def has_mobileprovision? File.file? mobileprovision_path end |
#hide_developer_certificates ⇒ Object
139 140 141 |
# File 'lib/fir/patches/parser_patch.rb', line 139 def hide_developer_certificates mobileprovision.delete('DeveloperCertificates') if has_mobileprovision? end |
#icons ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/fir/patches/parser_patch.rb', line 106 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
90 91 92 |
# File 'lib/fir/patches/parser_patch.rb', line 90 def identifier info['CFBundleIdentifier'] end |
#info ⇒ Object
81 82 83 84 |
# File 'lib/fir/patches/parser_patch.rb', line 81 def info @info ||= CFPropertyList.native_types( CFPropertyList::List.new(file: File.join(@path, 'Info.plist')).value) end |
#mobileprovision ⇒ Object
119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/fir/patches/parser_patch.rb', line 119 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
135 136 137 |
# File 'lib/fir/patches/parser_patch.rb', line 135 def mobileprovision_path @mobileprovision_path ||= File.join(@path, 'embedded.mobileprovision') end |
#name ⇒ Object
86 87 88 |
# File 'lib/fir/patches/parser_patch.rb', line 86 def name info['CFBundleName'] end |
#release_type ⇒ Object
151 152 153 154 155 156 157 158 159 |
# File 'lib/fir/patches/parser_patch.rb', line 151 def release_type if has_mobileprovision? if devices 'adhoc' else 'inhouse' end end end |
#short_version ⇒ Object
102 103 104 |
# File 'lib/fir/patches/parser_patch.rb', line 102 def short_version info['CFBundleShortVersionString'] end |
#version ⇒ Object
98 99 100 |
# File 'lib/fir/patches/parser_patch.rb', line 98 def version info['CFBundleVersion'] end |