lib/app_info/parser/apk.rb in app-info-1.1.2 vs lib/app_info/parser/apk.rb in app-info-2.0.0.beta1
- old
+ new
@@ -27,10 +27,11 @@
end
def os
Parser::Platform::ANDROID
end
+ alias file_type os
def build_version
manifest.version_code.to_s
end
@@ -43,10 +44,12 @@
end
def bundle_id
manifest.package_name
end
+ alias identifier bundle_id
+ alias package_name bundle_id
def device_type
if wear?
Device::WATCH
elsif tv?
@@ -72,11 +75,14 @@
def min_sdk_version
manifest.min_sdk_ver
end
def target_sdk_version
- manifest.doc.elements['/manifest/uses-sdk'].attributes['targetSdkVersion'].to_i
+ manifest.doc
+ .elements['/manifest/uses-sdk']
+ .attributes['targetSdkVersion']
+ .to_i
end
def use_permissions
manifest.use_permissions
end
@@ -96,15 +102,15 @@
obj << Certificate.new(path, certificate)
end
end
def activities
- components.select {|c| c.type == 'activity' }
+ components.select { |c| c.type == 'activity' }
end
def services
- components.select {|c| c.type == 'service' }
+ components.select { |c| c.type == 'service' }
end
def components
manifest.components
end
@@ -143,37 +149,35 @@
end
@icons
end
- alias identifier bundle_id
- alias package_name bundle_id
- alias device_type os
-
private
def manifest_values(path, key = 'name')
values = []
manifest.doc.each_element(path) do |elem|
values << elem.attributes[key]
end
values.uniq
end
+ # Android Certificate
class Certificate
attr_reader :path, :certificate
def initialize(path, certificate)
@path = path
@certificate = certificate
end
- end # /Certificate
+ end
+ # Android Sign
class Sign
attr_reader :path, :sign
def initialize(path, sign)
@path = path
@sign = sign
end
- end # /Certificate
- end # /APK
- end # /Parser
-end # /AppInfo
+ end
+ end
+ end
+end