Module: AppInfo

Extended by:
Helper::FileTypeDetection
Defined in:
lib/app_info.rb,
lib/app_info/pe.rb,
lib/app_info/aab.rb,
lib/app_info/apk.rb,
lib/app_info/hap.rb,
lib/app_info/ipa.rb,
lib/app_info/dsym.rb,
lib/app_info/file.rb,
lib/app_info/happ.rb,
lib/app_info/apple.rb,
lib/app_info/const.rb,
lib/app_info/error.rb,
lib/app_info/macos.rb,
lib/app_info/shell.rb,
lib/app_info/android.rb,
lib/app_info/version.rb,
lib/app_info/proguard.rb,
lib/app_info/harmonyos.rb,
lib/app_info/pack_info.rb,
lib/app_info/dsym/macho.rb,
lib/app_info/info_plist.rb,
lib/app_info/ipa/plugin.rb,
lib/app_info/certificate.rb,
lib/app_info/png_uncrush.rb,
lib/app_info/ipa/framework.rb,
lib/app_info/dsym/debug_info.rb,
lib/app_info/mobile_provision.rb,
lib/app_info/android/signature.rb,
lib/app_info/protobuf/manifest.rb,
lib/app_info/protobuf/resources.rb,
lib/app_info/core_ext/object/try.rb,
lib/app_info/android/signatures/v1.rb,
lib/app_info/android/signatures/v2.rb,
lib/app_info/android/signatures/v3.rb,
lib/app_info/android/signatures/v4.rb,
lib/app_info/android/signatures/base.rb,
lib/app_info/android/signatures/info.rb,
lib/app_info/core_ext/string/inflector.rb

Overview

Defined Under Namespace

Modules: Device, Format, Helper, Manufacturer, Platform, Protobuf Classes: AAB, APK, Android, Apple, Certificate, DSYM, Error, File, Framework, HAP, HAPP, HarmonyOS, IPA, InfoPlist, Macos, MobileProvision, NotFoundError, PE, PackInfo, Plugin, PngUncrush, Proguard, ProtobufParseError, Shell, UnknownFormatError

Constant Summary collapse

VERSION =
'3.2.0'

Class Attribute Summary collapse

Class Method Summary collapse

Methods included from Helper::FileTypeDetection

file_type

Class Attribute Details

.loggerObject



73
74
75
# File 'lib/app_info.rb', line 73

def logger
  @logger ||= Logger.new($stdout, level: :warn)
end

Class Method Details

.parse(file) {|parser| ... } ⇒ Object Also known as: dump

Get a new parser for automatic

Yields:

  • (parser)

Raises:



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/app_info.rb', line 43

def parse(file)
  raise NotFoundError, file unless ::File.exist?(file)

  parser = case file_type(file)
           when Format::IPA then IPA.new(file)
           when Format::APK then APK.new(file)
           when Format::AAB then AAB.new(file)
           when Format::HAP then HAP.new(file)
           when Format::HAPP then HAPP.new(file)
           when Format::MOBILEPROVISION then MobileProvision.new(file)
           when Format::DSYM then DSYM.new(file)
           when Format::PROGUARD then Proguard.new(file)
           when Format::MACOS then Macos.new(file)
           when Format::PE then PE.new(file)
           else
             raise UnknownFormatError, "Do not detect file format: #{file}"
           end

  return parser unless block_given?

  # call block and clear!
  yield parser
  parser.clear!
end

.parse?(file) ⇒ Boolean

Returns:

  • (Boolean)


69
70
71
# File 'lib/app_info.rb', line 69

def parse?(file)
  file_type(file) != Format::UNKNOWN
end