Class: AppInfo::Android::Signature::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/app_info/android/signatures/base.rb

Direct Known Subclasses

V1, V2, V3, V4

Constant Summary collapse

DESCRIPTION =
'APK Signature Scheme'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parser) ⇒ Base

Returns a new instance of Base.



19
20
21
22
# File 'lib/app_info/android/signatures/base.rb', line 19

def initialize(parser)
  @parser = parser
  @verified = false
end

Instance Attribute Details

#verifiedObject (readonly)

Returns the value of attribute verified.



17
18
19
# File 'lib/app_info/android/signatures/base.rb', line 17

def verified
  @verified
end

Class Method Details

.verify(parser) ⇒ Object



9
10
11
12
13
# File 'lib/app_info/android/signatures/base.rb', line 9

def self.verify(parser)
  instance = new(parser)
  instance.verify
  instance
end

Instance Method Details

#certificatesObject

This method is abstract.

Subclass and override #certificates to implement

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/app_info/android/signatures/base.rb', line 30

def certificates
  raise NotImplementedError, ".#{__method__} method implantation required in #{self.class}"
end

#descriptionObject



38
39
40
# File 'lib/app_info/android/signatures/base.rb', line 38

def description
  "#{DESCRIPTION} #{scheme}"
end

#loggerObject



42
43
44
# File 'lib/app_info/android/signatures/base.rb', line 42

def logger
  @parser.logger
end

#schemeObject



34
35
36
# File 'lib/app_info/android/signatures/base.rb', line 34

def scheme
  "v#{version}"
end

#verifyObject

This method is abstract.

Subclass and override #verify to implement

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/app_info/android/signatures/base.rb', line 25

def verify
  raise NotImplementedError, ".#{__method__} method implantation required in #{self.class}"
end