Module: Android::Utils
- Defined in:
- lib/android/utils.rb
Overview
Utility methods
Class Method Summary collapse
-
.apk?(path) ⇒ Boolean
path is apk file or not.
-
.cert?(data) ⇒ Boolean
data is cert file or not.
-
.dex?(data) ⇒ Boolean
data is dex file or not.
-
.elf?(data) ⇒ Boolean
data is elf file or not.
-
.valid_dex?(data) ⇒ Boolean
data is valid dex file or not.
Class Method Details
.apk?(path) ⇒ Boolean
path is apk file or not.
9 10 11 12 13 14 15 16 |
# File 'lib/android/utils.rb', line 9 def self.apk?(path) begin Apk.new(path) return true rescue return false end end |
.cert?(data) ⇒ Boolean
data is cert file or not.
30 31 32 33 34 |
# File 'lib/android/utils.rb', line 30 def self.cert?(data) data[0..1] == "\x30\x82" rescue false end |
.dex?(data) ⇒ Boolean
data is dex file or not.
39 40 41 42 43 |
# File 'lib/android/utils.rb', line 39 def self.dex?(data) data[0..7] == "\x64\x65\x78\x0a\x30\x33\x35\x00" # "dex\n035\0" rescue false end |
.elf?(data) ⇒ Boolean
data is elf file or not.
21 22 23 24 25 |
# File 'lib/android/utils.rb', line 21 def self.elf?(data) data[0..3] == "\x7f\x45\x4c\x46" rescue false end |