Class: FIR::Parser::Apk
- Includes:
- Common
- Defined in:
- lib/fir/util/parser/apk.rb
Instance Method Summary collapse
- #basic_info ⇒ Object
- #fetch_label ⇒ Object
- #full_info(options) ⇒ Object
-
#initialize(path) ⇒ Apk
constructor
A new instance of Apk.
- #tmp_icons ⇒ Object
Methods included from Common
Constructor Details
#initialize(path) ⇒ Apk
Returns a new instance of Apk.
9 10 11 12 |
# File 'lib/fir/util/parser/apk.rb', line 9 def initialize(path) Zip.warn_invalid_date = false @apk = ::Android::Apk.new(path) end |
Instance Method Details
#basic_info ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/fir/util/parser/apk.rb', line 20 def basic_info @basic_info ||= { type: 'android', name: fetch_label, identifier: @apk.manifest.package_name, build: @apk.manifest.version_code.to_s, version: @apk.manifest.version_name.to_s } @basic_info.reject! { |_k, v| v.nil? } @basic_info end |
#fetch_label ⇒ Object
39 40 41 42 43 |
# File 'lib/fir/util/parser/apk.rb', line 39 def fetch_label @apk.label rescue NoMethodError nil end |
#full_info(options) ⇒ Object
14 15 16 17 18 |
# File 'lib/fir/util/parser/apk.rb', line 14 def full_info() basic_info[:icons] = tmp_icons if .fetch(:full_info, false) basic_info end |
#tmp_icons ⇒ Object
33 34 35 36 37 |
# File 'lib/fir/util/parser/apk.rb', line 33 def tmp_icons @apk.icon.map { |_, data| generate_tmp_icon(data, :apk) } rescue StandardError [] end |