Sha256: a6c54397dc1bc35eca24dfb6cf52538042272abafb51e5a8a627c126808d15cf
Contents?: true
Size: 867 Bytes
Versions: 3
Compression:
Stored size: 867 Bytes
Contents
# frozen_string_literal: true module Headdesk module Checks # # Make sure all <reciever> blocks in AndroidManifest.xml point to a Java class # that exists in the APK. # class Receiver include Check::APK describe 'All <receiver> blocks in AndroidManifest.xml point to valid Java classes' def call receivers = [] apk.android_manifest.xpath('//receiver').each do |receiver| receiver_name = receiver.attributes['name'].to_s fail_check unless: -> { apk.class?(receiver_name) } klass = apk.find_class(receiver_name) describe "#{receiver_name} has onReceive method" fail_check unless: -> { klass.method?('onReceive') } receivers << { name: receiver_name } end export receivers: receivers end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
headdesk-0.3.0 | lib/headdesk/checks/receiver.rb |
headdesk-0.2.0 | lib/headdesk/checks/receiver.rb |
headdesk-0.1.0 | lib/headdesk/checks/receiver.rb |