lib/app_info/ipa.rb in app-info-2.0.0.rc1 vs lib/app_info/ipa.rb in app-info-2.0.0

- old
+ new

@@ -1,7 +1,8 @@ # frozen_string_literal: true +require 'macho' require 'pngdefry' require 'fileutils' require 'cfpropertylist' require 'app_info/util' @@ -125,10 +126,25 @@ else ExportType::DEBUG end end + def archs + return unless File.exist?(bundle_path) + + file = MachO.open(bundle_path) + case file + when MachO::MachOFile + [file.cpusubtype] + else + file.machos.each_with_object([]) do |arch, obj| + obj << arch.cpusubtype + end + end + end + alias architectures archs + def stored? metadata? ? true : false end def hide_developer_certificates @@ -166,9 +182,13 @@ File.exist?(metadata_path) end def metadata_path @metadata_path ||= File.join(contents, 'iTunesMetadata.plist') + end + + def bundle_path + @bundle_path ||= File.join(app_path, info.bundle_name) end def info @info ||= InfoPlist.new(app_path) end