Class: IpaParser::IpaFile

Inherits:
Object
  • Object
show all
Defined in:
lib/ipa-parser.rb

Constant Summary collapse

MAPPED_INFO_KEYS =
{
  name:                'CFBundleName',
  display_name:        'CFBundleDisplayName',
  identifier:          'CFBundleIdentifier',
  supported_platforms: 'CFBundleSupportedPlatforms',
  min_os_version:      'MinimumOSVersion',
  is_iphone:           'LSRequiresIPhoneOS',
  version:             'CFBundleVersion'
}

Instance Method Summary collapse

Constructor Details

#initialize(ipa_file) ⇒ IpaFile

Returns a new instance of IpaFile.



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ipa-parser.rb', line 24

def initialize(ipa_file)
  @ipa_file = Zip::File.open(ipa_file)
  info_plist = @ipa_file.glob('*\/Info.plist').first || @ipa_file.glob('Payload\/*\.app\/Info.plist').first
  if info_plist
    @plist_path = info_plist.name
    @plist_bin = info_plist.get_input_stream.read
    @plist = CFPropertyList::List.new(:data => @plist_bin)
  else
    raise "Cannot find Info.plist file"
  end
end

Instance Method Details

#infoObject



36
37
38
# File 'lib/ipa-parser.rb', line 36

def info
  CFPropertyList.native_types(@plist.value)
end