Class: AppInfo::IPA
Constant Summary
collapse
- DEFAULT_MOBILEPROVISION_FILE =
'embedded.mobileprovision'
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
89
90
91
|
# File 'lib/app_info/ipa.rb', line 89
def app_path
@app_path ||= Dir.glob(::File.join(contents, 'Payload', '*.app')).first
end
|
#binary_path ⇒ String
79
80
81
|
# File 'lib/app_info/ipa.rb', line 79
def binary_path
@binary_path ||= ::File.join(app_path, info.bundle_name)
end
|
#clear! ⇒ Object
112
113
114
115
116
117
118
119
120
121
122
123
124
125
|
# File 'lib/app_info/ipa.rb', line 112
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>
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# File 'lib/app_info/ipa.rb', line 94
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
84
85
86
|
# File 'lib/app_info/ipa.rb', line 84
def info_path
@info_path ||= ::File.join(app_path, 'Info.plist')
end
|
62
63
64
65
66
|
# File 'lib/app_info/ipa.rb', line 62
def metadata
return unless metadata?
@metadata ||= CFPropertyList.native_types(CFPropertyList::List.new(file: metadata_path).value)
end
|
69
70
71
|
# File 'lib/app_info/ipa.rb', line 69
def metadata?
::File.exist?(metadata_path)
end
|
74
75
76
|
# File 'lib/app_info/ipa.rb', line 74
def metadata_path
@metadata_path ||= ::File.join(contents, 'iTunesMetadata.plist')
end
|
#mobileprovision_path ⇒ String
52
53
54
55
56
57
58
59
|
# File 'lib/app_info/ipa.rb', line 52
def mobileprovision_path
@mobileprovision_path ||= ::File.join(@file, DEFAULT_MOBILEPROVISION_FILE)
unless ::File.exist?(@mobileprovision_path)
@mobileprovision_path = ::File.join(app_path, DEFAULT_MOBILEPROVISION_FILE)
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
|