certstepper 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/certstepper.rb +35 -15
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a10e16af831fd8f23aad6b7823bca78111800ec8
|
4
|
+
data.tar.gz: 262bdc266edd1b8b1e762b9256040b5486742a7e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 938e94de0269b821dd132e4cbb6ddaac0b26d9c57886aa1b6d65784f7a8dea1e1f6aa59f89d3004e09fb5b0731afc8669b6d58842023b464c8f25fb82cb29b97
|
7
|
+
data.tar.gz: 4956383be018681aef60f91f0d5e2dde3179c043d9ee9be1470dccb40f47a402403166594c724816c7e3d291a91443c498d3e4884838eef507f33fc12a2ba5fd
|
data/lib/certstepper.rb
CHANGED
@@ -79,8 +79,8 @@ module CertStepper
|
|
79
79
|
|
80
80
|
opts.on('-t cert_type','--type cert_type','生成证书和配置文件的类型 development adhoc distribution') do |value|
|
81
81
|
if value.start_with? 'ad'
|
82
|
-
@options[:cert_type] = ""
|
83
|
-
@options[:profile_type] = "
|
82
|
+
@options[:cert_type] = "--adhoc"
|
83
|
+
@options[:profile_type] = ""
|
84
84
|
elsif value.start_with? 'dev'
|
85
85
|
@options[:cert_type] = "--development"
|
86
86
|
@options[:profile_type] = "--development"
|
@@ -143,17 +143,20 @@ module CertStepper
|
|
143
143
|
|
144
144
|
createKeychain cert_path
|
145
145
|
system "cert -u #{cert.email} -o #{cert_path} #{@options[:cert_type]}"
|
146
|
-
dealCert cert_path
|
146
|
+
dealCert cert , cert_path
|
147
147
|
|
148
148
|
|
149
149
|
system "produce -u #{cert.email} -a #{cert.profile_id} --app_name #{cert.profile_name} --skip_itc"
|
150
150
|
system "sigh -a #{cert.profile_id} -u #{cert.email} -o #{cert_path} #{@options[:profile_type]}"
|
151
151
|
#system "sigh -a #{cert.profile_id} -u #{cert.email} -o #{cert_path} --adhoc"
|
152
152
|
|
153
|
+
|
153
154
|
if !generateCertSuccessfully? cert
|
154
155
|
failed_cert_array << cert.email
|
155
156
|
end
|
156
157
|
|
158
|
+
deleteUnusefulFile cert_path
|
159
|
+
|
157
160
|
end
|
158
161
|
|
159
162
|
|
@@ -166,23 +169,38 @@ module CertStepper
|
|
166
169
|
|
167
170
|
end
|
168
171
|
|
172
|
+
end
|
173
|
+
|
174
|
+
def self.deleteUnusefulFile(de_path)
|
175
|
+
console_de_path = de_path.gsub /[\s]/ , "\\ "
|
176
|
+
Dir.entries(de_path).each do |file_name|
|
177
|
+
if file_name.end_with? '.cer'
|
178
|
+
file_path = "#{de_path}/#{file_name}"
|
179
|
+
system "rm #{console_de_path}/#{file_name}"
|
180
|
+
system "rm #{console_de_path}/#{File.basename(file_path,'.*')}.p12"
|
181
|
+
system "rm #{console_de_path}/#{File.basename(file_path,'.*')}.certSigningRequest"
|
182
|
+
end
|
183
|
+
end
|
169
184
|
|
170
185
|
end
|
171
186
|
|
172
187
|
def self.generateCertSuccessfully?(cert)
|
173
188
|
cert_path = @@root_path + "/#{cert.profile_name}"
|
189
|
+
puts cert_path
|
174
190
|
is_p12_exist = false
|
175
191
|
is_cer_exist = false
|
176
192
|
is_provision_exist = false
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
193
|
+
if File.exists? cert_path
|
194
|
+
Dir.entries(cert_path).each do |file_name|
|
195
|
+
if file_name.end_with? ".p12"
|
196
|
+
is_p12_exist = true
|
197
|
+
elsif file_name.end_with? ".cer"
|
198
|
+
is_cer_exist = true
|
199
|
+
elsif file_name.end_with? ".mobileprovision"
|
200
|
+
is_provision_exist = true
|
201
|
+
end
|
184
202
|
end
|
185
|
-
end
|
203
|
+
end
|
186
204
|
|
187
205
|
return is_p12_exist && is_cer_exist && is_provision_exist
|
188
206
|
end
|
@@ -211,7 +229,7 @@ module CertStepper
|
|
211
229
|
new_cert.password = line_content.strip
|
212
230
|
when 2
|
213
231
|
new_cert.profile_id = line_content.strip
|
214
|
-
new_cert.profile_name = line_content
|
232
|
+
new_cert.profile_name = line_content
|
215
233
|
end
|
216
234
|
index+=1
|
217
235
|
end
|
@@ -246,18 +264,20 @@ module CertStepper
|
|
246
264
|
system "security create-keychain -p 123456 #{@keychain_path}"
|
247
265
|
end
|
248
266
|
|
249
|
-
def self.dealCert(de_path)
|
267
|
+
def self.dealCert(cert,de_path)
|
250
268
|
console_de_path = de_path.gsub /[\s]/ , "\\ "
|
251
269
|
Dir.entries(de_path).each do |file_name|
|
252
270
|
if file_name.end_with? '.cer'
|
253
271
|
#system "security add-trusted-cert -r unspecified -k 123456 #{File.expand_path('~')}/Downloads/ios_development.cer"
|
254
|
-
system "security import #{
|
255
|
-
system "security export -k #{@keychain_path} -t certs -f pkcs12 -P 123 -o #{console_de_path}
|
272
|
+
system "security import #{console_de_path}/#{file_name} -k #{@keychain_path}"
|
273
|
+
system "security export -k #{@keychain_path} -t certs -f pkcs12 -P 123 -o #{console_de_path}/#{cert.profile_name}.p12"
|
256
274
|
system "security delete-keychain #{@keychain_path}"
|
275
|
+
|
257
276
|
end
|
258
277
|
end
|
259
278
|
end
|
260
279
|
|
280
|
+
|
261
281
|
def self.dealCertByChrome(root_path , profile_name)
|
262
282
|
system "security create-keychain -P 123456"
|
263
283
|
system "security add-trusted-cert -r unspecified -k 123456 #{File.expand_path('~')}/Downloads/ios_development.cer"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: certstepper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- chengkai
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cert
|