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
Instance Method Details
#basic_info ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/fir/util/parser/apk.rb', line 39 def basic_info @basic_info ||= begin manifest = @apk.manifest raise 'Failed to parse AndroidManifest.xml. The APK may be corrupted, repacked, or contain unsupported characters.' unless manifest { type: 'android', name: fetch_label, identifier: manifest.package_name, build: manifest.version_code.to_s, version: manifest.version_name.to_s } end @basic_info.reject! { |_k, v| v.nil? } @basic_info end |
#fetch_label ⇒ Object
63 64 65 66 67 |
# File 'lib/fir/util/parser/apk.rb', line 63 def fetch_label @apk.label rescue NoMethodError nil end |
#full_info(options) ⇒ Object
33 34 35 36 37 |
# File 'lib/fir/util/parser/apk.rb', line 33 def full_info() basic_info[:icons] = tmp_icons if .fetch(:full_info, false) basic_info end |
#tmp_icons ⇒ Object
57 58 59 60 61 |
# File 'lib/fir/util/parser/apk.rb', line 57 def tmp_icons @apk.icon.map { |_, data| generate_tmp_icon(data, :apk) } rescue StandardError [] end |