Class: AppInfo::Protobuf::Manifest
- Inherits:
-
Node
show all
- Defined in:
- lib/app_info/protobuf/manifest.rb
Defined Under Namespace
Classes: Data
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
110
111
112
113
|
# File 'lib/app_info/protobuf/manifest.rb', line 110
def self.parse(io, resources = nil)
doc = Aapt::Pb::XmlNode.decode(io)
new(doc, resources)
end
|
Instance Method Details
#activities ⇒ Object
131
132
133
|
# File 'lib/app_info/protobuf/manifest.rb', line 131
def activities
application.activity
end
|
#components ⇒ Object
125
126
127
128
129
|
# File 'lib/app_info/protobuf/manifest.rb', line 125
def components
application.children.select do |name, _|
COMPONENTS.include?(name.downcase)
end
end
|
139
140
141
|
# File 'lib/app_info/protobuf/manifest.rb', line 139
def icons
@resources.find(application.icon)
end
|
#label(locale: '') ⇒ Object
121
122
123
|
# File 'lib/app_info/protobuf/manifest.rb', line 121
def label(locale: '')
@resources.find(application.label, locale: locale).value || application.label
end
|
#package_name ⇒ Object
117
118
119
|
# File 'lib/app_info/protobuf/manifest.rb', line 117
def package_name
@package_name ||= package
end
|
135
136
137
|
# File 'lib/app_info/protobuf/manifest.rb', line 135
def services
application.service
end
|