Class: Fastlane::Actions::CryptexGenerateKeystoreAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb

Class Method Summary collapse

Class Method Details

.authorsObject



18
19
20
# File 'lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb', line 18

def self.authors
  ["Helmut Januschka"]
end

.available_optionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb', line 22

def self.available_options
  [
    FastlaneCore::ConfigItem.new(key: :password,
                                 env_name: "MATCH_KEYSTORE_PASSWORD",
                                 description: "Password for the Keystore",
                                 optional: true,
                                 is_string: true,
                                 default_value: ""),
    FastlaneCore::ConfigItem.new(key: :alias,
                                 env_name: "MATCH_KEYSTORE_ALIAS",
                                 description: "ALIAS for the Keystore",
                                 optional: true,
                                 is_string: true,
                                 default_value: ""),
    FastlaneCore::ConfigItem.new(key: :destination,
                                 env_name: "MATCH_KEYSTORE_DESTINATION",
                                 description: "Where to put decrypted keystore",
                                 optional: true,
                                 default_value: ""),
    FastlaneCore::ConfigItem.new(key: :fullname,
                                 env_name: "MATCH_KEYSTORE_FULLNAME",
                                 description: "Fullname of keystore owner",
                                 optional: true,
                                 is_string: true,
                                 default_value: ""),
    FastlaneCore::ConfigItem.new(key: :city,
                                 env_name: "MATCH_KEYSTORE_CITY",
                                 description: "City of keystore owner",
                                 optional: true,
                                 is_string: true,
                                 default_value: "")

  ]
end

.descriptionObject



14
15
16
# File 'lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb', line 14

def self.description
  "Generate a new Android Keystore"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


57
58
59
# File 'lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb', line 57

def self.is_supported?(platform)
  true
end

.run(params) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb', line 4

def self.run(params)
  require "fileutils"
  cmd = "keytool -genkey -v -keystore #{File.expand_path(params[:destination])} -storepass #{params[:password]} -keypass #{params[:password]} -alias #{params[:alias]} -dname 'CN=#{params[:fullname]},L=#{params[:city]}' -validity 10000"
  FastlaneCore::CommandExecutor.execute(command: cmd,
                                      print_all: true,
                                  print_command: true)

  params[:destination]
end