Class: AppInfo::IPA
Constant Summary
Helper::HumanFileSize::FILE_SIZE_UNITS
Instance Attribute Summary
Attributes inherited from File
#file, #logger
Instance Method Summary
collapse
Methods inherited from Apple
#archs, #build_type, #build_version, #bundle_id, #bundle_name, #contents, #device, #devices, #display_name, #distribution_name, #expired_date, #hide_developer_certificates, #identifier, #info, #ipad?, #iphone?, #manufacturer, #min_os_version, #min_sdk_version, #mobileprovision, #mobileprovision?, #name, #platform, #profile_name, #release_type, #release_version, #size, #team_identifier, #team_name, #universal?
#tempdir, #unarchive
#file_to_human_size, #number_to_human_size
Methods inherited from File
#device, #format, #initialize, #manufacturer, #not_implemented_error!, #platform, #size
Constructor Details
This class inherits a constructor from AppInfo::File
Instance Method Details
#app_path ⇒ String
88
89
90
|
# File 'lib/app_info/ipa.rb', line 88
def app_path
@app_path ||= Dir.glob(::File.join(contents, 'Payload', '*.app')).first
end
|
#binary_path ⇒ String
78
79
80
|
# File 'lib/app_info/ipa.rb', line 78
def binary_path
@binary_path ||= ::File.join(app_path, info.bundle_name)
end
|
#clear! ⇒ Object
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# File 'lib/app_info/ipa.rb', line 111
def clear!
return unless @contents
FileUtils.rm_rf(@contents)
@contents = nil
@app_path = nil
@info_path = nil
@info = nil
@metadata_path = nil
@metadata = nil
@icons_path = nil
@icons = nil
end
|
#frameworks ⇒ Array<Framework>
45
46
47
|
# File 'lib/app_info/ipa.rb', line 45
def frameworks
@frameworks ||= Framework.parse(app_path)
end
|
#icons(uncrush: true) ⇒ Array<Hash{Symbol => String, Array<Integer>}>
28
29
30
31
32
|
# File 'lib/app_info/ipa.rb', line 28
def icons(uncrush: true)
@icons ||= icons_path.each_with_object([]) do |file, obj|
obj << build_icon_metadata(file, uncrush: uncrush)
end
end
|
#icons_path ⇒ Array<String>
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
# File 'lib/app_info/ipa.rb', line 93
def icons_path
@icons_path ||= lambda {
icon_keys.each_with_object([]) do |name, icons|
filenames = info.try(:[], name)
.try(:[], 'CFBundlePrimaryIcon')
.try(:[], 'CFBundleIconFiles')
next if filenames.nil? || filenames.empty?
filenames.each do |filename|
Dir.glob(::File.join(app_path, "#{filename}*")).find_all.each do |file|
icons << file
end
end
end
}.call
end
|
#info_path ⇒ String
83
84
85
|
# File 'lib/app_info/ipa.rb', line 83
def info_path
@info_path ||= ::File.join(app_path, 'Info.plist')
end
|
61
62
63
64
65
|
# File 'lib/app_info/ipa.rb', line 61
def metadata
return unless metadata?
@metadata ||= CFPropertyList.native_types(CFPropertyList::List.new(file: metadata_path).value)
end
|
68
69
70
|
# File 'lib/app_info/ipa.rb', line 68
def metadata?
::File.exist?(metadata_path)
end
|
73
74
75
|
# File 'lib/app_info/ipa.rb', line 73
def metadata_path
@metadata_path ||= ::File.join(contents, 'iTunesMetadata.plist')
end
|
#mobileprovision_path ⇒ String
50
51
52
53
54
55
56
57
58
|
# File 'lib/app_info/ipa.rb', line 50
def mobileprovision_path
filename = 'embedded.mobileprovision'
@mobileprovision_path ||= ::File.join(@file, filename)
unless ::File.exist?(@mobileprovision_path)
@mobileprovision_path = ::File.join(app_path, filename)
end
@mobileprovision_path
end
|
#plugins ⇒ Array<Plugin>
40
41
42
|
# File 'lib/app_info/ipa.rb', line 40
def plugins
@plugins ||= Plugin.parse(app_path)
end
|
#stored? ⇒ Boolean
35
36
37
|
# File 'lib/app_info/ipa.rb', line 35
def stored?
!!metadata?
end
|