fastlane-plugin-match_keystore 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49e735f7fda8b92409a84f94a1e826254555ee6b33a9f2333a8891e37fee25a5
4
- data.tar.gz: 1e8b9230a2e0f0d3f315d1c587e08589ab03308e3570adb8d703b6f84b65fce1
3
+ metadata.gz: 42c7915b7d46b87470d41acfd251257c04ce89460ac60a08318404530a1fbd24
4
+ data.tar.gz: 07f280f892d41adee35f025218da2a1eeb345f17c9cf27d2d027246f4b248940
5
5
  SHA512:
6
- metadata.gz: 5ce5971aa35734b0ce58746631d107db20833edb7d8d6fa2f1c9ae6a700efce48db7ca36f8ed59800a95ed6fae660001e3ec3477dc06090594ab8dca88d9c30c
7
- data.tar.gz: aa7171f32c1818427d0b8b8b6fc2f117e78aa7f688c53135099c80c1465762819c906e35f6adf91645f3b81f956c149fd3426c6a722496af199ff8d3b89dd4aa
6
+ metadata.gz: 85ff5b2dda6f5a38714a09aea05fb279ec87015e970860ac3238f10280d233195936b84ef617d6bfafca36ee9d164f4a1c6267d8ea76e75305a40f4d44b55627
7
+ data.tar.gz: f8e3fba2336ef34b35300d38535d2f5fbb5798af9efc50f268fa33a7a05282157f1a46755953eac2d99b362642560b8dc9e7b6255377a13e0fae9b5ebcfcd60d
data/README.md CHANGED
@@ -24,7 +24,6 @@ The keystore properties are encrypted with AES in order to secure sensitive data
24
24
 
25
25
  ```ruby
26
26
  lane :release_and_sign do |options|
27
-
28
27
  gradle(task: "clean")
29
28
  gradle(task: 'assemble', build_type: 'Release')
30
29
 
@@ -52,24 +52,28 @@ module Fastlane
52
52
 
53
53
  build_tools_last_version
54
54
  end
55
+
56
+ def self.check_openssl_version
57
+ output = `openssl version`
58
+ if !output.start_with?("OpenSSL")
59
+ raise "Please install OpenSSL 1.1.1 at least https://www.openssl.org/"
60
+ end
61
+ UI.message("OpenSSL version: " + output.strip)
62
+ end
55
63
 
56
64
  def self.gen_key(key_path, password)
57
65
  `rm -f #{key_path}`
58
- if OS.mac?
59
- `echo "#{password}" | openssl dgst -sha512 | cut -c1-128 > #{key_path}`
60
- else
61
- `echo "#{password}" | openssl dgst -sha512 | awk '{print $2}' | cut -c1-128 > #{key_path}`
62
- end
66
+ `echo "#{password}" | openssl dgst -sha512 | awk '{print $2}' | cut -c1-128 > #{key_path}`
63
67
  end
64
68
 
65
69
  def self.encrypt_file(clear_file, encrypt_file, key_path)
66
70
  `rm -f #{encrypt_file}`
67
- `openssl enc -aes-256-cbc -salt -in #{clear_file} -out #{encrypt_file} -pass file:#{key_path}`
71
+ `openssl enc -aes-256-cbc -salt -pbkdf2 -in #{clear_file} -out #{encrypt_file} -pass file:#{key_path}`
68
72
  end
69
73
 
70
74
  def self.decrypt_file(encrypt_file, clear_file, key_path)
71
75
  `rm -f #{clear_file}`
72
- `openssl enc -d -aes-256-cbc -in #{encrypt_file} -out #{clear_file} -pass file:#{key_path}`
76
+ `openssl enc -d -aes-256-cbc -pbkdf2 -in #{encrypt_file} -out #{clear_file} -pass file:#{key_path}`
73
77
  end
74
78
 
75
79
  def self.sign_apk(apk_path, keystore_path, key_password, alias_name, alias_password, zip_align)
@@ -151,21 +155,20 @@ module Fastlane
151
155
  raise "The environment variable ANDROID_HOME is not defined, or Android SDK is not installed!"
152
156
  end
153
157
 
158
+ # Check OpenSSL:
159
+ self.check_openssl_version
160
+
154
161
  dir_name = ENV['HOME'] + '/.match_keystore'
155
162
  unless File.directory?(dir_name)
156
163
  UI.message("Creating '.match_keystore' working directory...")
157
164
  FileUtils.mkdir_p(dir_name)
158
165
  end
159
166
 
160
- UI.message("OpenSSL version: ")
161
- puts `openssl version`
162
-
163
167
  key_path = dir_name + '/key.hex'
164
168
  if !File.file?(key_path)
165
- if ci_password.to_s.strip.empty?
166
- security_password = other_action.prompt(text: "Security password: ")
167
- else
168
- security_password = ci_password
169
+ security_password = other_action.prompt(text: "Security password: ", secure_text: true, ci_input: ci_password)
170
+ if security_password.to_s.strip.empty?
171
+ raise "Security password is not defined! Please use 'ci_password' parameter for CI."
169
172
  end
170
173
  UI.message "Generating security key..."
171
174
  self.gen_key(key_path, security_password)
@@ -211,8 +214,17 @@ module Fastlane
211
214
  end
212
215
 
213
216
  key_password = other_action.prompt(text: "Keystore Password: ")
217
+ if key_password.to_s.strip.empty?
218
+ raise "Keystore Password is not definined!"
219
+ end
214
220
  alias_name = other_action.prompt(text: "Keystore Alias name: ")
221
+ if alias_name.to_s.strip.empty?
222
+ raise "Keystore Alias name is not definined!"
223
+ end
215
224
  alias_password = other_action.prompt(text: "Keystore Alias password: ")
225
+ if alias_password.to_s.strip.empty?
226
+ raise "Keystore Alias password is not definined!"
227
+ end
216
228
 
217
229
  # https://developer.android.com/studio/publish/app-signing
218
230
  if !File.file?(existing_keystore)
@@ -326,7 +338,8 @@ module Fastlane
326
338
  def self.output
327
339
  [
328
340
  ['MATCH_KEYSTORE_PATH', 'File path of the Keystore fot the App.'],
329
- ['MATCH_KEYSTORE_ALIAS_NAME', 'Keystore Alias Name.']
341
+ ['MATCH_KEYSTORE_ALIAS_NAME', 'Keystore Alias Name.'],
342
+ ['MATCH_KEYSTORE_APK_SIGNED', 'Path of the signed APK.']
330
343
  ]
331
344
  end
332
345
 
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module MatchKeystore
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-match_keystore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christopher NEY
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-31 00:00:00.000000000 Z
11
+ date: 2020-04-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry