Sha256: f83516d72074d89be23357f05aa73b4f9f9105251920fccdef6445123410165a
Contents?: true
Size: 1 KB
Versions: 42
Compression:
Stored size: 1 KB
Contents
# frozen_string_literal: true require_relative './common' module FIR module Parser class Apk include Parser::Common def initialize(path) Zip.warn_invalid_date = false @apk = ::Android::Apk.new(path) end def full_info(options) basic_info[:icons] = tmp_icons if options.fetch(:full_info, false) basic_info end 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 # @apk.icon is a hash, { icon_name: icon_binary_data } def tmp_icons @apk.icon.map { |_, data| generate_tmp_icon(data, :apk) } rescue StandardError [] end def fetch_label @apk.label rescue NoMethodError nil end end end end
Version data entries
42 entries across 42 versions & 3 rubygems