Class: AppInfo::Apple
Overview
Apple base parser for ipa and macos file
Defined Under Namespace
Modules: ExportType
Constant Summary
Helper::HumanFileSize::FILE_SIZE_UNITS
Instance Attribute Summary
Attributes inherited from File
#file, #logger
Instance Method Summary
collapse
#tempdir, #unarchive
#file_to_human_size, #number_to_human_size
Methods inherited from File
#format, #initialize, #not_implemented_error!
Constructor Details
This class inherits a constructor from AppInfo::File
Instance Method Details
#app_path ⇒ Object
This method is abstract.
Subclass and override #app_path to implement.
178
179
180
|
# File 'lib/app_info/apple.rb', line 178
def app_path
not_implemented_error!(__method__)
end
|
#archs ⇒ Array<MachO>?
Also known as:
architectures
119
120
121
122
123
124
125
126
127
128
129
130
131
|
# File 'lib/app_info/apple.rb', line 119
def archs
return unless ::File.exist?(binary_path)
file = MachO.open(binary_path)
case file
when MachO::MachOFile
[file.cpusubtype]
else
file.machos.each_with_object([]) do |arch, obj|
obj << arch.cpusubtype
end
end
end
|
#build_type ⇒ String
return iOS build configuration, not correct in macOS app.
#build_version ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#bundle_id ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#bundle_name ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#clear! ⇒ Object
This method is abstract.
Subclass and override #clear! to implement.
183
184
185
|
# File 'lib/app_info/apple.rb', line 183
def clear!
not_implemented_error!(__method__)
end
|
#contents ⇒ String
Returns contents path of contents.
188
189
190
|
# File 'lib/app_info/apple.rb', line 188
def contents
@contents ||= unarchive(@file, prefix: format.to_s)
end
|
#device ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#devices ⇒ Object
89
90
|
# File 'lib/app_info/apple.rb', line 89
def_delegators :mobileprovision, :devices, :team_name, :team_identifier,
:profile_name, :expired_date
|
#display_name ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#distribution_name ⇒ String?
93
94
95
|
# File 'lib/app_info/apple.rb', line 93
def distribution_name
"#{profile_name} - #{team_name}" if profile_name && team_name
end
|
#expired_date ⇒ Object
89
90
|
# File 'lib/app_info/apple.rb', line 89
def_delegators :mobileprovision, :devices, :team_name, :team_identifier,
:profile_name, :expired_date
|
#hide_developer_certificates ⇒ nil
146
147
148
|
# File 'lib/app_info/apple.rb', line 146
def hide_developer_certificates
mobileprovision.delete('DeveloperCertificates') if mobileprovision?
end
|
#icons(_uncrush: true) ⇒ Object
This method is abstract.
Subclass and override #icons to implement.
135
136
137
|
# File 'lib/app_info/apple.rb', line 135
def icons(_uncrush: true)
not_implemented_error!(__method__)
end
|
#identifier ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
168
169
170
|
# File 'lib/app_info/apple.rb', line 168
def info
@info ||= InfoPlist.new(info_path)
end
|
#info_path ⇒ Object
173
174
175
|
# File 'lib/app_info/apple.rb', line 173
def info_path
not_implemented_error!(__method__)
end
|
#ipad? ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#iphone? ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#manufacturer ⇒ Symbol
30
31
32
|
# File 'lib/app_info/apple.rb', line 30
def manufacturer
Manufacturer::APPLE
end
|
#min_os_version ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#min_sdk_version ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
151
152
153
154
155
|
# File 'lib/app_info/apple.rb', line 151
def mobileprovision
return unless mobileprovision?
@mobileprovision ||= MobileProvision.new(mobileprovision_path)
end
|
#mobileprovision? ⇒ Boolean
158
159
160
|
# File 'lib/app_info/apple.rb', line 158
def mobileprovision?
::File.exist?(mobileprovision_path)
end
|
#mobileprovision_path ⇒ Object
163
164
165
|
# File 'lib/app_info/apple.rb', line 163
def mobileprovision_path
not_implemented_error!(__method__)
end
|
#name ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#profile_name ⇒ Object
89
90
|
# File 'lib/app_info/apple.rb', line 89
def_delegators :mobileprovision, :devices, :team_name, :team_identifier,
:profile_name, :expired_date
|
#release_type ⇒ String
98
99
100
101
102
103
104
|
# File 'lib/app_info/apple.rb', line 98
def release_type
if stored?
ExportType::APPSTORE
else
build_type
end
end
|
#release_version ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|
#size(human_size: false) ⇒ Integer, String
43
44
45
|
# File 'lib/app_info/apple.rb', line 43
def size(human_size: false)
file_to_human_size(@file, human_size: human_size)
end
|
#stored? ⇒ Boolean
This method is abstract.
Subclass and override #stored? to implement.
140
141
142
|
# File 'lib/app_info/apple.rb', line 140
def stored?
not_implemented_error!(__method__)
end
|
#team_identifier ⇒ Object
89
90
|
# File 'lib/app_info/apple.rb', line 89
def_delegators :mobileprovision, :devices, :team_name, :team_identifier,
:profile_name, :expired_date
|
#team_name ⇒ Object
89
90
|
# File 'lib/app_info/apple.rb', line 89
def_delegators :mobileprovision, :devices, :team_name, :team_identifier,
:profile_name, :expired_date
|
#universal? ⇒ Object
75
76
77
|
# File 'lib/app_info/apple.rb', line 75
def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?,
:build_version, :name, :release_version, :identifier, :bundle_id,
:display_name, :bundle_name, :min_sdk_version, :min_os_version
|