Class: Souyuz::ApkSignCommandGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/souyuz/generators/apk_sign_command_generator.rb

Overview

Responsible for building the apksigner command

Class Method Summary collapse

Class Method Details

.detect_apksigner_executableObject



22
23
24
25
26
# File 'lib/souyuz/generators/apk_sign_command_generator.rb', line 22

def detect_apksigner_executable
  apksigner = File.join(Souyuz.config[:buildtools_path], 'apksigner')

  apksigner
end

.generateObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/souyuz/generators/apk_sign_command_generator.rb', line 5

def generate
  build_apk_path = Souyuz.cache[:build_apk_path]
  Souyuz.cache[:signed_apk_path] = "#{build_apk_path}-signed"

  parts = prefix
  parts << detect_apksigner_executable
  parts += options
  parts << Souyuz.cache[:aligned_apk_path]
  parts += pipe

  parts
end

.optionsObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/souyuz/generators/apk_sign_command_generator.rb', line 28

def options
  options = []
  options << "sign"
  options << "--verbose" if $verbose
  options << "--ks \"#{Souyuz.config[:keystore_path]}\""
  options << "--ks-pass \"pass:#{Souyuz.config[:keystore_password]}\""
  options << "--ks-key-alias \"#{Souyuz.config[:keystore_alias]}\""
  options << "--out \"#{Souyuz.cache[:signed_apk_path]}\""

  options
end

.pipeObject



40
41
42
43
44
# File 'lib/souyuz/generators/apk_sign_command_generator.rb', line 40

def pipe
  pipe = []

  pipe
end

.prefixObject



18
19
20
# File 'lib/souyuz/generators/apk_sign_command_generator.rb', line 18

def prefix
  [""]
end