Class: AppInfo::Android
- Extended by:
- Forwardable
- Includes:
- Helper::HumanFileSize
- Defined in:
- lib/app_info/android.rb,
lib/app_info/android/signature.rb,
lib/app_info/android/signatures/v1.rb,
lib/app_info/android/signatures/v2.rb,
lib/app_info/android/signatures/v3.rb,
lib/app_info/android/signatures/v4.rb,
lib/app_info/android/signatures/base.rb,
lib/app_info/android/signatures/info.rb
Overview
Android base parser for apk and aab file
Defined Under Namespace
Modules: Signature
Constant Summary
Constants included from Helper::HumanFileSize
Helper::HumanFileSize::FILE_SIZE_UNITS
Instance Attribute Summary
Attributes inherited from File
Instance Method Summary collapse
- #activities ⇒ Object abstract
- #automotive? ⇒ Boolean
-
#certificates ⇒ Array<OpenSSL::PKCS7, nil>
deprecated
Deprecated.
Use #signatures
- #clear! ⇒ Object abstract
- #components ⇒ Object abstract
-
#contents ⇒ String
Contents path of contents.
- #device ⇒ Symbol
- #manifest ⇒ Object abstract
- #manufacturer ⇒ Symbol
- #name ⇒ Object abstract
- #platform ⇒ Symbol
- #resource ⇒ Object abstract
- #services ⇒ Object abstract
-
#signatures ⇒ Array<Hash>
Return multi version certifiates of signatures.
-
#signs ⇒ Array<OpenSSL::PKCS7, nil>
deprecated
Deprecated.
Use #signatures
-
#size(human_size: false) ⇒ Integer, String
return file size.
-
#tablet? ⇒ Boolean
False always false.
- #television? ⇒ Boolean
- #use_features ⇒ Object abstract
- #use_permissions ⇒ Object abstract
- #watch? ⇒ Boolean
- #zip ⇒ Object abstract
Methods included from Helper::HumanFileSize
#file_to_human_size, #number_to_human_size
Methods inherited from File
#format, #initialize, #not_implemented_error!
Constructor Details
This class inherits a constructor from AppInfo::File
Instance Method Details
#activities ⇒ Object
Subclass and override #use_permissions to implement.
94 95 96 |
# File 'lib/app_info/android.rb', line 94 def activities not_implemented_error!(__method__) end |
#automotive? ⇒ Boolean
79 80 81 |
# File 'lib/app_info/android.rb', line 79 def automotive? !!use_features&.include?('android.hardware.type.automotive') end |
#certificates ⇒ Array<OpenSSL::PKCS7, nil>
Use #signatures
Legacy v1 scheme certificates, it will remove soon.
125 126 127 |
# File 'lib/app_info/android.rb', line 125 def certificates @certificates ||= v1sign&.certificates || [] end |
#clear! ⇒ Object
Subclass and override #clear! to implement.
145 146 147 |
# File 'lib/app_info/android.rb', line 145 def clear! not_implemented_error!(__method__) end |
#components ⇒ Object
Subclass and override #use_permissions to implement.
104 105 106 |
# File 'lib/app_info/android.rb', line 104 def components not_implemented_error!(__method__) end |
#contents ⇒ String
Returns contents path of contents.
150 151 152 |
# File 'lib/app_info/android.rb', line 150 def contents @contents ||= ::File.join(Dir.mktmpdir, "AppInfo-android-#{SecureRandom.hex}") end |
#device ⇒ Symbol
Returns Device.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/app_info/android.rb', line 37 def device if watch? Device::Google::WATCH elsif television? Device::Google::TELEVISION elsif automotive? Device::Google::AUTOMOTIVE elsif tablet? Device::Google::TABLET else Device::Google::PHONE end end |
#manifest ⇒ Object
Subclass and override #manifest to implement.
130 131 132 |
# File 'lib/app_info/android.rb', line 130 def manifest not_implemented_error!(__method__) end |
#manufacturer ⇒ Symbol
Returns Manufacturer.
27 28 29 |
# File 'lib/app_info/android.rb', line 27 def manufacturer Manufacturer::GOOGLE end |
#name ⇒ Object
Subclass and override #name to implement.
52 53 54 |
# File 'lib/app_info/android.rb', line 52 def name not_implemented_error!(__method__) end |
#platform ⇒ Symbol
Returns Platform.
32 33 34 |
# File 'lib/app_info/android.rb', line 32 def platform Platform::ANDROID end |
#resource ⇒ Object
Subclass and override #resource to implement.
135 136 137 |
# File 'lib/app_info/android.rb', line 135 def resource not_implemented_error!(__method__) end |
#services ⇒ Object
Subclass and override #use_permissions to implement.
99 100 101 |
# File 'lib/app_info/android.rb', line 99 def services not_implemented_error!(__method__) end |
#signatures ⇒ Array<Hash>
Return multi version certifiates of signatures
111 112 113 |
# File 'lib/app_info/android.rb', line 111 def signatures @signatures ||= Android::Signature.verify(self) end |
#signs ⇒ Array<OpenSSL::PKCS7, nil>
Use #signatures
Legacy v1 scheme signatures, it will remove soon.
118 119 120 |
# File 'lib/app_info/android.rb', line 118 def signs @signs ||= v1sign&.signatures || [] end |
#size(human_size: false) ⇒ Integer, String
return file size
22 23 24 |
# File 'lib/app_info/android.rb', line 22 def size(human_size: false) file_to_human_size(@file, human_size: human_size) end |
#tablet? ⇒ Boolean
find a way to detect, no way!
Returns false always false.
59 60 61 62 63 64 65 66 |
# File 'lib/app_info/android.rb', line 59 def tablet? # Not works! # resource.first_package # .entries('bool') # .select{|e| e.name == 'isTablet' } # .size >= 1 false end |
#television? ⇒ Boolean
74 75 76 |
# File 'lib/app_info/android.rb', line 74 def television? !!use_features&.include?('android.software.leanback') end |
#use_features ⇒ Object
Subclass and override #use_features to implement.
84 85 86 |
# File 'lib/app_info/android.rb', line 84 def use_features not_implemented_error!(__method__) end |
#use_permissions ⇒ Object
Subclass and override #use_permissions to implement.
89 90 91 |
# File 'lib/app_info/android.rb', line 89 def not_implemented_error!(__method__) end |
#watch? ⇒ Boolean
69 70 71 |
# File 'lib/app_info/android.rb', line 69 def watch? !!use_features&.include?('android.hardware.type.watch') end |
#zip ⇒ Object
Subclass and override #zip to implement.
140 141 142 |
# File 'lib/app_info/android.rb', line 140 def zip not_implemented_error!(__method__) end |