Ipa-Reader icon indicating copy to clipboard operation
Ipa-Reader copied to clipboard

Update initialize method in IpaFile to get correct information: version, name, bundle_identifier

Open gagoit opened this issue 11 years ago • 0 comments

With current code, this gem gets wrong information about name, version, and bundle_identifier. It should be updated like this:

in https://github.com/schlu/Ipa-Reader/blob/master/lib/ipa_reader/ipa_file.rb#L11

require "zip/zip"
module IpaReader
  class IpaFile
    attr_accessor :plist, :file_path
    def initialize(file_path)
      self.file_path = file_path
      info_plist_file = nil
      regex = /Payload\/[^\/]+.app\/Info.plist/
      Zip::ZipFile.foreach(file_path) { |f| info_plist_file = f if f.name.match(regex) }
      cf_plist = CFPropertyList::List.new(:data => info_plist_file.get_input_stream.read, :format =>      CFPropertyList::List::FORMAT_BINARY)
      self.plist = cf_plist.value.to_rb
    end
  end
end

gagoit avatar Nov 17 '14 12:11 gagoit