Class: AppInfo::Apple
- Extended by:
- Forwardable
- Includes:
- Helper::Archive, Helper::HumanFileSize
- Defined in:
- lib/app_info/apple.rb
Overview
Apple base parser for ipa and macos file
Defined Under Namespace
Modules: ExportType
Constant Summary
Constants included from Helper::HumanFileSize
Helper::HumanFileSize::FILE_SIZE_UNITS
Instance Attribute Summary
Attributes inherited from File
Instance Method Summary collapse
- #app_path ⇒ Object abstract
- #archs ⇒ Array<MachO>? (also: #architectures)
-
#build_type ⇒ String
return iOS build configuration, not correct in macOS app.
- #build_version ⇒ Object
- #bundle_id ⇒ Object
- #bundle_name ⇒ Object
- #clear! ⇒ Object abstract
-
#contents ⇒ String
Contents path of contents.
- #device ⇒ Object
- #devices ⇒ Object
- #display_name ⇒ Object
- #distribution_name ⇒ String?
- #expired_date ⇒ Object
-
#hide_developer_certificates ⇒ nil
force remove developer certificate data from #mobileprovision method.
- #icons(_uncrush: true) ⇒ Object abstract
- #identifier ⇒ Object
- #info ⇒ InfoPlist
- #info_path ⇒ Object abstract
- #ipad? ⇒ Object
- #iphone? ⇒ Object
- #manufacturer ⇒ Symbol
- #min_os_version ⇒ Object
- #min_sdk_version ⇒ Object
- #mobileprovision ⇒ MobileProvision
- #mobileprovision? ⇒ Boolean
- #mobileprovision_path ⇒ Object abstract
- #name ⇒ Object
- #platform ⇒ Object
- #profile_name ⇒ Object
- #release_type ⇒ String
- #release_version ⇒ Object
-
#size(human_size: false) ⇒ Integer, String
return file size.
- #stored? ⇒ Boolean abstract
- #team_identifier ⇒ Object
- #team_name ⇒ Object
- #universal? ⇒ Object
Methods included from Helper::Archive
Methods included from Helper::HumanFileSize
#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
Subclass and override #app_path to implement.
179 180 181 |
# File 'lib/app_info/apple.rb', line 179 def app_path not_implemented_error!(__method__) end |
#archs ⇒ Array<MachO>? Also known as: architectures
120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/app_info/apple.rb', line 120 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.
109 110 111 112 113 114 115 116 117 |
# File 'lib/app_info/apple.rb', line 109 def build_type if mobileprovision? return ExportType::RELEASE if macos? devices ? ExportType::ADHOC : ExportType::ENTERPRISE else ExportType::DEBUG end end |
#build_version ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#bundle_id ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#bundle_name ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#clear! ⇒ Object
Subclass and override #clear! to implement.
184 185 186 |
# File 'lib/app_info/apple.rb', line 184 def clear! not_implemented_error!(__method__) end |
#contents ⇒ String
Returns contents path of contents.
189 190 191 |
# File 'lib/app_info/apple.rb', line 189 def contents @contents ||= unarchive(@file, prefix: format.to_s) end |
#device ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#devices ⇒ Object
90 91 |
# File 'lib/app_info/apple.rb', line 90 def_delegators :mobileprovision, :devices, :team_name, :team_identifier, :profile_name, :expired_date |
#display_name ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#distribution_name ⇒ String?
94 95 96 |
# File 'lib/app_info/apple.rb', line 94 def distribution_name "#{profile_name} - #{team_name}" if profile_name && team_name end |
#expired_date ⇒ Object
90 91 |
# File 'lib/app_info/apple.rb', line 90 def_delegators :mobileprovision, :devices, :team_name, :team_identifier, :profile_name, :expired_date |
#hide_developer_certificates ⇒ nil
force remove developer certificate data from #mobileprovision method
147 148 149 |
# File 'lib/app_info/apple.rb', line 147 def hide_developer_certificates mobileprovision.delete('DeveloperCertificates') if mobileprovision? end |
#icons(_uncrush: true) ⇒ Object
Subclass and override #icons to implement.
136 137 138 |
# File 'lib/app_info/apple.rb', line 136 def icons(_uncrush: true) not_implemented_error!(__method__) end |
#identifier ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#info ⇒ InfoPlist
169 170 171 |
# File 'lib/app_info/apple.rb', line 169 def info @info ||= InfoPlist.new(info_path) end |
#info_path ⇒ Object
Subclass and override #info_path to implement.
174 175 176 |
# File 'lib/app_info/apple.rb', line 174 def info_path not_implemented_error!(__method__) end |
#ipad? ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#iphone? ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#manufacturer ⇒ Symbol
Returns Manufacturer.
30 31 32 |
# File 'lib/app_info/apple.rb', line 30 def manufacturer Manufacturer::APPLE end |
#min_os_version ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#min_sdk_version ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#mobileprovision ⇒ MobileProvision
152 153 154 155 156 |
# File 'lib/app_info/apple.rb', line 152 def mobileprovision return unless mobileprovision? @mobileprovision ||= MobileProvision.new(mobileprovision_path) end |
#mobileprovision? ⇒ Boolean
159 160 161 |
# File 'lib/app_info/apple.rb', line 159 def mobileprovision? ::File.exist?(mobileprovision_path) end |
#mobileprovision_path ⇒ Object
Subclass and override #mobileprovision_path to implement.
164 165 166 |
# File 'lib/app_info/apple.rb', line 164 def mobileprovision_path not_implemented_error!(__method__) end |
#name ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#platform ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#profile_name ⇒ Object
90 91 |
# File 'lib/app_info/apple.rb', line 90 def_delegators :mobileprovision, :devices, :team_name, :team_identifier, :profile_name, :expired_date |
#release_type ⇒ String
99 100 101 102 103 104 105 |
# File 'lib/app_info/apple.rb', line 99 def release_type if stored? ExportType::APPSTORE else build_type end end |
#release_version ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |
#size(human_size: false) ⇒ Integer, String
return file size
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
Subclass and override #stored? to implement.
141 142 143 |
# File 'lib/app_info/apple.rb', line 141 def stored? not_implemented_error!(__method__) end |
#team_identifier ⇒ Object
90 91 |
# File 'lib/app_info/apple.rb', line 90 def_delegators :mobileprovision, :devices, :team_name, :team_identifier, :profile_name, :expired_date |
#team_name ⇒ Object
90 91 |
# File 'lib/app_info/apple.rb', line 90 def_delegators :mobileprovision, :devices, :team_name, :team_identifier, :profile_name, :expired_date |
#universal? ⇒ Object
75 76 77 78 |
# File 'lib/app_info/apple.rb', line 75 def_delegators :info, :device, :platform, :iphone?, :ipad?, :universal?, :macos?, :appletv?, :build_version, :name, :release_version, :identifier, :bundle_id, :display_name, :bundle_name, :min_sdk_version, :min_os_version, :url_schemes, :query_schemes, :background_modes |