Skip to content

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

@gagoit

Description

@gagoit

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions