9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/fastlane/plugin/flint/helper/change_password.rb', line 9
def self.update(params: nil, from: nil, to: nil)
ensure_ui_interactive
from ||= ChangePassword.ask_password(message: "Old passphrase for Git Repo: ", confirm: false)
to ||= ChangePassword.ask_password(message: "New passphrase for Git Repo: ", confirm: true)
GitHelper.clear_changes
encrypt = Encrypt.new
workspace = GitHelper.clone(params[:git_url],
params[:shallow_clone],
manual_password: from,
skip_docs: params[:skip_docs],
branch: params[:git_branch],
git_full_name: params[:git_full_name],
git_user_email: params[:git_user_email],
clone_branch_directly: params[:clone_branch_directly],
encrypt: encrypt)
encrypt.clear_password(params[:git_url])
encrypt.store_password(params[:git_url], to)
if params[:app_identifier].kind_of?(Array)
app_identifiers = params[:app_identifier]
else
app_identifiers = params[:app_identifier].to_s.split(/\s*,\s*/).uniq
end
app_identifier = app_identifiers[0].gsub! '.', '_'
for cert_type in Flint.environments do
alias_name = "%s-%s" % [app_identifier, cert_type]
keystore_name = "%s.keystore" % alias_name
Flint::Generator.update_keystore_password(workspace, keystore_name, alias_name, from, to)
end
message = "[fastlane] Changed passphrase"
GitHelper.commit_changes(workspace, message, params[:git_url], params[:git_branch], nil, encrypt)
end
|