class Fastlane::Actions::CryptexGenerateKeystoreAction

Public Class Methods

authors() click to toggle source
# File lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb, line 18
def self.authors
  ["Helmut Januschka"]
end
available_options() click to toggle source
# 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
description() click to toggle source
# File lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb, line 14
def self.description
  "Generate a new Android Keystore"
end
is_supported?(platform) click to toggle source
# File lib/fastlane/plugin/cryptex/actions/cryptex_generate_keystore.rb, line 57
def self.is_supported?(platform)
  true
end
run(params) click to toggle source
# 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