fastlane-plugin-match_keystore 0.1.10 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cac1a24c49a6233b5fdd03dd8990957f72d394fadbeee931e88a58d0da45db3e
|
4
|
+
data.tar.gz: 69b75bd951e729c83b16410381553046983438d9bc3d4501598c74b9bdf78370
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f1f4143bd748ca19d6e48ef5fdbe38ba2f3069731abe810849cf0704ed999d66bc01846ad8cb919d6c6758460b7e54d51286471d43d9e53a6319b25559b93fa
|
7
|
+
data.tar.gz: ba9f612f57265b7724f88674ee6d187b5b3ddb87758a513b02b172b4372626f7989e5acedde6a288a6d59b9f68596af66c8684cc8b53151260b0a17f5fa5f260
|
@@ -55,7 +55,7 @@ module Fastlane
|
|
55
55
|
|
56
56
|
def self.get_build_tools
|
57
57
|
android_home = self.get_android_home()
|
58
|
-
build_tools_root = android_home
|
58
|
+
build_tools_root = File.join(android_home, '/build-tools')
|
59
59
|
|
60
60
|
sub_dirs = Dir.glob(File.join(build_tools_root, '*', ''))
|
61
61
|
build_tools_last_version = ''
|
@@ -75,18 +75,18 @@ module Fastlane
|
|
75
75
|
end
|
76
76
|
|
77
77
|
def self.gen_key(key_path, password)
|
78
|
-
`rm -f #{key_path}`
|
79
|
-
`echo "#{password}" | openssl dgst -sha512 | awk '{print $2}' | cut -c1-128 > #{key_path}`
|
78
|
+
`rm -f '#{key_path}'`
|
79
|
+
`echo "#{password}" | openssl dgst -sha512 | awk '{print $2}' | cut -c1-128 > '#{key_path}'`
|
80
80
|
end
|
81
81
|
|
82
82
|
def self.encrypt_file(clear_file, encrypt_file, key_path)
|
83
|
-
`rm -f #{encrypt_file}`
|
84
|
-
`openssl enc -aes-256-cbc -salt -pbkdf2 -in #{clear_file} -out #{encrypt_file} -pass file
|
83
|
+
`rm -f '#{encrypt_file}'`
|
84
|
+
`openssl enc -aes-256-cbc -salt -pbkdf2 -in '#{clear_file}' -out '#{encrypt_file}' -pass file:'#{key_path}'`
|
85
85
|
end
|
86
86
|
|
87
87
|
def self.decrypt_file(encrypt_file, clear_file, key_path)
|
88
|
-
`rm -f #{clear_file}`
|
89
|
-
`openssl enc -d -aes-256-cbc -pbkdf2 -in #{encrypt_file} -out #{clear_file} -pass file
|
88
|
+
`rm -f '#{clear_file}'`
|
89
|
+
`openssl enc -d -aes-256-cbc -pbkdf2 -in '#{encrypt_file}' -out '#{clear_file}' -pass file:'#{key_path}'`
|
90
90
|
end
|
91
91
|
|
92
92
|
def self.sign_apk(apk_path, keystore_path, key_password, alias_name, alias_password, zip_align)
|
@@ -96,8 +96,8 @@ module Fastlane
|
|
96
96
|
# https://developer.android.com/studio/command-line/zipalign
|
97
97
|
if zip_align == true
|
98
98
|
apk_path_aligned = apk_path.gsub(".apk", "-aligned.apk")
|
99
|
-
`rm -f #{apk_path_aligned}`
|
100
|
-
`#{build_tools_path}zipalign 4 #{apk_path} #{apk_path_aligned}`
|
99
|
+
`rm -f '#{apk_path_aligned}'`
|
100
|
+
`#{build_tools_path}zipalign 4 '#{apk_path}' '#{apk_path_aligned}'`
|
101
101
|
else
|
102
102
|
apk_path_aligned = apk_path
|
103
103
|
end
|
@@ -106,11 +106,11 @@ module Fastlane
|
|
106
106
|
apk_path_signed = apk_path_signed.gsub("--", "-")
|
107
107
|
|
108
108
|
# https://developer.android.com/studio/command-line/apksigner
|
109
|
-
`rm -f #{apk_path_signed}`
|
110
|
-
`#{build_tools_path}apksigner sign --ks #{keystore_path} --ks-key-alias '#{alias_name}' --ks-pass pass:'#{key_password}' --key-pass pass:'#{alias_password}' --v1-signing-enabled true --v2-signing-enabled true --out #{apk_path_signed} #{apk_path_aligned}`
|
109
|
+
`rm -f '#{apk_path_signed}'`
|
110
|
+
`#{build_tools_path}apksigner sign --ks '#{keystore_path}' --ks-key-alias '#{alias_name}' --ks-pass pass:'#{key_password}' --key-pass pass:'#{alias_password}' --v1-signing-enabled true --v2-signing-enabled true --out '#{apk_path_signed}' '#{apk_path_aligned}'`
|
111
111
|
|
112
|
-
`#{build_tools_path}apksigner verify #{apk_path_signed}`
|
113
|
-
`rm -f #{apk_path_aligned}`
|
112
|
+
`#{build_tools_path}apksigner verify '#{apk_path_signed}'`
|
113
|
+
`rm -f '#{apk_path_aligned}'`
|
114
114
|
|
115
115
|
apk_path_signed
|
116
116
|
end
|
@@ -228,7 +228,7 @@ module Fastlane
|
|
228
228
|
end
|
229
229
|
|
230
230
|
# Cloning GIT remote repository:
|
231
|
-
gitDir = repo_dir
|
231
|
+
gitDir = File.join(repo_dir, '/.git')
|
232
232
|
unless File.directory?(gitDir)
|
233
233
|
UI.message("Cloning remote Keystores repository...")
|
234
234
|
puts ''
|
@@ -240,15 +240,15 @@ module Fastlane
|
|
240
240
|
if package_name.to_s.strip.empty?
|
241
241
|
raise "Package name is not defined!"
|
242
242
|
end
|
243
|
-
keystoreAppDir = repo_dir
|
243
|
+
keystoreAppDir = File.join(repo_dir, package_name)
|
244
244
|
unless File.directory?(keystoreAppDir)
|
245
245
|
UI.message("Creating '#{package_name}' keystore directory...")
|
246
246
|
FileUtils.mkdir_p(keystoreAppDir)
|
247
247
|
end
|
248
248
|
|
249
|
-
keystore_path = keystoreAppDir
|
250
|
-
properties_path = keystoreAppDir
|
251
|
-
properties_encrypt_path = keystoreAppDir
|
249
|
+
keystore_path = File.join(keystoreAppDir, keystore_name)
|
250
|
+
properties_path = File.join(keystoreAppDir, properties_name)
|
251
|
+
properties_encrypt_path = File.join(keystoreAppDir, properties_encrypt_name)
|
252
252
|
|
253
253
|
# Load parameters from JSON for CI or Unit Tests:
|
254
254
|
if keystore_data != nil && File.file?(keystore_data)
|
@@ -298,11 +298,11 @@ module Fastlane
|
|
298
298
|
|
299
299
|
keytool_parts = [
|
300
300
|
"keytool -genkey -v",
|
301
|
-
"-keystore #{keystore_path}",
|
302
|
-
"-alias #{alias_name}",
|
301
|
+
"-keystore '#{keystore_path}'",
|
302
|
+
"-alias '#{alias_name}'",
|
303
303
|
"-keyalg RSA -keysize 2048 -validity 10000",
|
304
|
-
"-storepass #{alias_password}
|
305
|
-
"-keypass #{key_password}",
|
304
|
+
"-storepass '#{alias_password}'",
|
305
|
+
"-keypass '#{key_password}'",
|
306
306
|
"-dname \"CN=#{full_name}, OU=#{org_unit}, O=#{org}, L=#{city_locality}, S=#{state_province}, C=#{country}\"",
|
307
307
|
]
|
308
308
|
sh keytool_parts.join(" ")
|
@@ -317,6 +317,7 @@ module Fastlane
|
|
317
317
|
FileUtils.remove_dir(properties_path)
|
318
318
|
end
|
319
319
|
|
320
|
+
# Build URL:
|
320
321
|
store_file = git_url + '/' + package_name + '/' + keystore_name
|
321
322
|
|
322
323
|
out_file = File.new(properties_path, "w")
|
@@ -330,14 +331,14 @@ module Fastlane
|
|
330
331
|
File.delete(properties_path)
|
331
332
|
|
332
333
|
# Print Keystore data in repo:
|
333
|
-
keystore_info_path = keystoreAppDir
|
334
|
-
`yes "" | keytool -list -v -keystore #{keystore_path} -storepass #{key_password} > #{keystore_info_path}`
|
334
|
+
keystore_info_path = File.join(keystoreAppDir, keystore_info_name)
|
335
|
+
`yes "" | keytool -list -v -keystore '#{keystore_path}' -storepass '#{key_password}' > '#{keystore_info_path}'`
|
335
336
|
|
336
337
|
UI.message("Upload new Keystore to remote repository...")
|
337
338
|
puts ''
|
338
|
-
`cd #{repo_dir} && git add .`
|
339
|
-
`cd #{repo_dir} && git commit -m "[ADD] Keystore for app '#{package_name}'."`
|
340
|
-
`cd #{repo_dir} && git push`
|
339
|
+
`cd '#{repo_dir}' && git add .`
|
340
|
+
`cd '#{repo_dir}' && git commit -m "[ADD] Keystore for app '#{package_name}'."`
|
341
|
+
`cd '#{repo_dir}' && git push`
|
341
342
|
puts ''
|
342
343
|
|
343
344
|
else
|