Class: AppInfo::Protobuf::Manifest
- Inherits:
-
Node
- Object
- Base
- Node
- AppInfo::Protobuf::Manifest
show all
- Defined in:
- lib/app_info/protobuf/manifest.rb
Overview
Defined Under Namespace
Classes: Data, IntentFilter
Constant Summary
collapse
- COMPONENTS =
%w[activity activity-alias service receiver provider application].freeze
Instance Attribute Summary
Attributes inherited from Node
#attributes, #children, #name
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#initialize
#create_class, #define_instance_method
Class Method Details
.parse(io, resources = nil) ⇒ Object
115
116
117
118
|
# File 'lib/app_info/protobuf/manifest.rb', line 115
def self.parse(io, resources = nil)
doc = Aapt::Pb::XmlNode.decode(io)
new(doc, resources)
end
|
Instance Method Details
#activities ⇒ Object
136
137
138
|
# File 'lib/app_info/protobuf/manifest.rb', line 136
def activities
application.respond_to?(:activity) ? application.activity : []
end
|
#components ⇒ Object
130
131
132
133
134
|
# File 'lib/app_info/protobuf/manifest.rb', line 130
def components
application.children.select do |name, _|
COMPONENTS.include?(name.downcase)
end
end
|
#deep_links ⇒ Object
148
149
150
|
# File 'lib/app_info/protobuf/manifest.rb', line 148
def deep_links
intent_filters(search: :deep_links)
end
|
#icons ⇒ Object
144
145
146
|
# File 'lib/app_info/protobuf/manifest.rb', line 144
def icons
@resources.find(application.icon)
end
|
#label(locale: '') ⇒ Object
126
127
128
|
# File 'lib/app_info/protobuf/manifest.rb', line 126
def label(locale: '')
@resources.find(application.label, locale: locale).value || application.label
end
|
#package_name ⇒ Object
122
123
124
|
# File 'lib/app_info/protobuf/manifest.rb', line 122
def package_name
@package_name ||= package
end
|
#schemes ⇒ Object
152
153
154
|
# File 'lib/app_info/protobuf/manifest.rb', line 152
def schemes
intent_filters(search: :schemes)
end
|
#services ⇒ Object
140
141
142
|
# File 'lib/app_info/protobuf/manifest.rb', line 140
def services
application.respond_to?(:service) ? application.service : []
end
|