motion-provisioning 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +7 -0
- data/README.md +2 -0
- data/bin/export_private_key +0 -0
- data/lib/.DS_Store +0 -0
- data/lib/motion-provisioning/application.rb +1 -25
- data/lib/motion-provisioning/certificate.rb +17 -3
- data/lib/motion-provisioning/mobileprovision.rb +0 -37
- data/lib/motion-provisioning/version.rb +1 -1
- metadata +4 -10
- data/.gitignore +0 -10
- data/.rspec +0 -1
- data/Gemfile +0 -6
- data/Gemfile.lock +0 -106
- data/Rakefile +0 -71
- data/bin/console +0 -6
- data/bin/setup +0 -8
- data/motion-provisioning.gemspec +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 17e38a22761737ec400d582f7679ff12216138db
|
4
|
+
data.tar.gz: 2573196e24dd07f10b68f7b27c96d8f1ec4a2163
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0f4fb569b2e4cccf7f6347b0d093e981c90a7c622792fb85e520e2436df04622c07c714a3cd231422055117487243ed861db98cf6fc10edf3ed73455af5ee00
|
7
|
+
data.tar.gz: 11eb96cc59e6753f007e03769aabafef8ce6df4f2800e0be3797882df6d4f5116b666fdfc8c429e0dcebaf010c4d1404dc1ca9313aee0642199acd0323e4f58f
|
data/LICENSE.txt
CHANGED
@@ -44,3 +44,10 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
44
44
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
45
45
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
46
46
|
SOFTWARE.
|
47
|
+
|
48
|
+
This project contains modified code with copyright:
|
49
|
+
|
50
|
+
Copyright (c) 2003-2010,2012,2014 Apple Inc. All Rights Reserved.
|
51
|
+
|
52
|
+
Covered by the APPLE PUBLIC SOURCE LICENSE
|
53
|
+
(http://opensource.apple.com/license/apsl/)
|
data/README.md
CHANGED
Binary file
|
data/lib/.DS_Store
ADDED
Binary file
|
@@ -2,7 +2,7 @@ module MotionProvisioning
|
|
2
2
|
class Application
|
3
3
|
|
4
4
|
# Finds or create app for the given bundle id and name
|
5
|
-
def self.find_or_create(bundle_id: nil, name: nil, mac:
|
5
|
+
def self.find_or_create(bundle_id: nil, name: nil, mac: false)
|
6
6
|
app = Spaceship::Portal::App.find(bundle_id, mac: mac)
|
7
7
|
if app
|
8
8
|
app = app.details if app.features.nil?
|
@@ -23,30 +23,6 @@ module MotionProvisioning
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
# services = MotionProvisioning.services
|
27
|
-
|
28
|
-
# Disable all app services not enabled via entitlements
|
29
|
-
# app.enabled_features.each do |feature_id|
|
30
|
-
# # These services are always enabled and cannot be disabled
|
31
|
-
# next if ['inAppPurchase', 'gameCenter', 'push'].include?(feature_id)
|
32
|
-
# service = services.detect { |s| s.identifier == feature_id }
|
33
|
-
# if service.nil?
|
34
|
-
# Utils.log('Info', "Disabling unused app service '#{feature_id}' for '#{bundle_id}'")
|
35
|
-
# # To disable Data Protection we need to send an empty string as value
|
36
|
-
# value = feature_id == 'dataProtection' ? '' : false
|
37
|
-
# app.update_service(Spaceship::Portal::AppService.new(feature_id, value))
|
38
|
-
# end
|
39
|
-
# end
|
40
|
-
|
41
|
-
# # Enable all app services enabled via entitlements (or which have a different value)
|
42
|
-
# services.each do |service|
|
43
|
-
# value = service.identifier == 'dataProtection' ? 'complete' : true
|
44
|
-
# if app.features[service.identifier] != value
|
45
|
-
# Utils.log('Info', "Enabling app service '#{service.name.split("::").last}' for '#{bundle_id}'")
|
46
|
-
# app.update_service(Spaceship::Portal::AppService.new(service.identifier, value))
|
47
|
-
# end
|
48
|
-
# end
|
49
|
-
|
50
26
|
app
|
51
27
|
end
|
52
28
|
end
|
@@ -80,7 +80,7 @@ module MotionProvisioning
|
|
80
80
|
Utils.log("Error", "None of the available certificates (#{user_certificates.count}) is installed on the local machine. Revoking...")
|
81
81
|
|
82
82
|
# For distribution, ask before revoking
|
83
|
-
if self.type == :distribution
|
83
|
+
if self.type == :distribution
|
84
84
|
answer = Utils.ask("Info", "There are #{user_certificates.count} distribution certificates in your account, but none installed locally.\n" \
|
85
85
|
"Before revoking and creating a new one, ask other team members who might have them installed to share them with you.\n" \
|
86
86
|
"Do you want to continue revoking the certificates? (Y/n):")
|
@@ -104,8 +104,17 @@ module MotionProvisioning
|
|
104
104
|
end
|
105
105
|
# There are certificates on the server, and one of them is installed locally.
|
106
106
|
else
|
107
|
+
Utils.log("Info", "Found certificate '#{installed_certificate.name}' which is installed in the local machine.")
|
108
|
+
|
107
109
|
path = store_certificate_raw(installed_certificate.motionprovisioning_certContent ||installed_certificate.download_raw)
|
108
|
-
|
110
|
+
|
111
|
+
password = Utils.ask_password("Info", "Exporting private key from Keychain for certificate '#{installed_certificate.name}'. Choose a password (you will be asked for this password when importing this key into the Keychain in another machine):")
|
112
|
+
private_key_contents = private_key(common_name(path), sha1_fingerprint(path), password)
|
113
|
+
if private_key_contents.empty?
|
114
|
+
Utils.log("Error", "Could not export private key for certificate '#{installed_certificate.name}'.")
|
115
|
+
abort
|
116
|
+
end
|
117
|
+
File.write(private_key_path, private_key_contents)
|
109
118
|
|
110
119
|
# This certificate is installed on the local machine
|
111
120
|
Utils.log("Info", "Using certificate '#{installed_certificate.name}'.")
|
@@ -208,7 +217,7 @@ module MotionProvisioning
|
|
208
217
|
else
|
209
218
|
Utils.log("Warning", "You have just created a development certificate. If you want to use this certificate on another machine, transfer the private key (.p12) and certificate (.cer) files in your /provisioning folder and install them in the keychain.")
|
210
219
|
end
|
211
|
-
Utils.ask("Info", "Press any key to continue...")
|
220
|
+
Utils.ask("Info", "Press any key to continue...")
|
212
221
|
|
213
222
|
return cert_path
|
214
223
|
end
|
@@ -274,5 +283,10 @@ module MotionProvisioning
|
|
274
283
|
|
275
284
|
`#{command} 2>&1`
|
276
285
|
end
|
286
|
+
|
287
|
+
def private_key(name, fingerprint, password)
|
288
|
+
export_private_key = File.join(File.expand_path(__dir__), '../../bin/export_private_key')
|
289
|
+
`#{export_private_key} "#{name}" "#{fingerprint}" "#{password}"`.strip
|
290
|
+
end
|
277
291
|
end
|
278
292
|
end
|
@@ -14,15 +14,6 @@ module MotionProvisioning
|
|
14
14
|
self.certificates = []
|
15
15
|
self.enabled_services = []
|
16
16
|
|
17
|
-
entitlements_keys = hash['Entitlements'].keys
|
18
|
-
Service.constants.each do |constant_name|
|
19
|
-
service = Service.const_get(constant_name)
|
20
|
-
keys = service.mobileprovision_keys
|
21
|
-
if (keys - entitlements_keys).empty?
|
22
|
-
self.enabled_services << service
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
17
|
hash['DeveloperCertificates'].each do |certificate|
|
27
18
|
self.certificates << certificate.read
|
28
19
|
end
|
@@ -44,34 +35,6 @@ module MotionProvisioning
|
|
44
35
|
def valid?(certificate, app_entitlements)
|
45
36
|
return false if hash['ExpirationDate'] < DateTime.now
|
46
37
|
|
47
|
-
# entitlements = hash['Entitlements']
|
48
|
-
# # Remove entitlements that are not relevant for
|
49
|
-
# # Always true in development mobileprovision
|
50
|
-
# entitlements.delete('get-task-allow')
|
51
|
-
# # Always true in distribution mobileprovision
|
52
|
-
# entitlements.delete('beta-reports-active')
|
53
|
-
# entitlements.delete('application-identifier')
|
54
|
-
# entitlements.delete('com.apple.developer.team-identifier')
|
55
|
-
# # Always present, usually "$teamidentifier.*"
|
56
|
-
# entitlements.delete('keychain-access-groups')
|
57
|
-
# entitlements.delete('aps-environment')
|
58
|
-
|
59
|
-
# if app_entitlements != entitlements
|
60
|
-
# missing_in_app = entitlements.to_a - app_entitlements.to_a
|
61
|
-
# if missing_in_app.any?
|
62
|
-
# Utils.log("Error", "These entitlements are present in the provisioning profile but not in your app configuration:")
|
63
|
-
# puts missing_in_app
|
64
|
-
# end
|
65
|
-
|
66
|
-
# missing_in_profile = app_entitlements.to_a - entitlements.to_a
|
67
|
-
# if missing_in_profile.any?
|
68
|
-
# Utils.log("Error", "These entitlements are present in your app configuration but not in your provisioning profile:")
|
69
|
-
# puts missing_in_profile
|
70
|
-
# end
|
71
|
-
|
72
|
-
# return false
|
73
|
-
# end
|
74
|
-
|
75
38
|
if !certificates.include?(File.read(certificate))
|
76
39
|
Utils.log("Warning", "Your provisioning profile does not include your certificate. Repairing...")
|
77
40
|
return false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-provisioning
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Villacampa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: spaceship
|
@@ -144,15 +144,10 @@ executables: []
|
|
144
144
|
extensions: []
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
|
-
- ".gitignore"
|
148
|
-
- ".rspec"
|
149
|
-
- Gemfile
|
150
|
-
- Gemfile.lock
|
151
147
|
- LICENSE.txt
|
152
148
|
- README.md
|
153
|
-
-
|
154
|
-
-
|
155
|
-
- bin/setup
|
149
|
+
- bin/export_private_key
|
150
|
+
- lib/.DS_Store
|
156
151
|
- lib/motion-provisioning.rb
|
157
152
|
- lib/motion-provisioning/application.rb
|
158
153
|
- lib/motion-provisioning/certificate.rb
|
@@ -163,7 +158,6 @@ files:
|
|
163
158
|
- lib/motion-provisioning/tasks.rb
|
164
159
|
- lib/motion-provisioning/utils.rb
|
165
160
|
- lib/motion-provisioning/version.rb
|
166
|
-
- motion-provisioning.gemspec
|
167
161
|
homepage: https://github.com/HipByte/motion-provisioning
|
168
162
|
licenses:
|
169
163
|
- BSD
|
data/.gitignore
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color --require spec_helper --format d
|
data/Gemfile
DELETED
data/Gemfile.lock
DELETED
@@ -1,106 +0,0 @@
|
|
1
|
-
GIT
|
2
|
-
remote: git://github.com/sinisterchipmunk/rspec-prof.git
|
3
|
-
revision: 0a4d8ed998a3ab88d1a7b4a8f54a8d7faf6ee8c9
|
4
|
-
specs:
|
5
|
-
rspec-prof (0.0.6)
|
6
|
-
rspec (~> 3.0)
|
7
|
-
ruby-prof
|
8
|
-
|
9
|
-
PATH
|
10
|
-
remote: .
|
11
|
-
specs:
|
12
|
-
motion-provisioning (0.0.1)
|
13
|
-
plist
|
14
|
-
security
|
15
|
-
spaceship
|
16
|
-
|
17
|
-
GEM
|
18
|
-
remote: https://rubygems.org/
|
19
|
-
specs:
|
20
|
-
addressable (2.3.8)
|
21
|
-
builder (3.2.2)
|
22
|
-
colored (1.2)
|
23
|
-
commander (4.4.0)
|
24
|
-
highline (~> 1.7.2)
|
25
|
-
crack (0.4.3)
|
26
|
-
safe_yaml (~> 1.0.0)
|
27
|
-
credentials_manager (0.16.0)
|
28
|
-
colored
|
29
|
-
commander (>= 4.3.5)
|
30
|
-
highline (>= 1.7.1)
|
31
|
-
security
|
32
|
-
diff-lcs (1.2.5)
|
33
|
-
docile (1.1.5)
|
34
|
-
domain_name (0.5.20160615)
|
35
|
-
unf (>= 0.0.5, < 1.0.0)
|
36
|
-
faraday (0.9.2)
|
37
|
-
multipart-post (>= 1.2, < 3)
|
38
|
-
faraday-cookie_jar (0.0.6)
|
39
|
-
faraday (>= 0.7.4)
|
40
|
-
http-cookie (~> 1.0.0)
|
41
|
-
faraday_middleware (0.10.0)
|
42
|
-
faraday (>= 0.7.4, < 0.10)
|
43
|
-
fastimage (1.9.0)
|
44
|
-
addressable (~> 2.3.5)
|
45
|
-
highline (1.7.8)
|
46
|
-
http-cookie (1.0.2)
|
47
|
-
domain_name (~> 0.5)
|
48
|
-
json (2.0.2)
|
49
|
-
multi_xml (0.5.5)
|
50
|
-
multipart-post (2.0.0)
|
51
|
-
plist (3.2.0)
|
52
|
-
rake (10.5.0)
|
53
|
-
rspec (3.1.0)
|
54
|
-
rspec-core (~> 3.1.0)
|
55
|
-
rspec-expectations (~> 3.1.0)
|
56
|
-
rspec-mocks (~> 3.1.0)
|
57
|
-
rspec-core (3.1.7)
|
58
|
-
rspec-support (~> 3.1.0)
|
59
|
-
rspec-expectations (3.1.2)
|
60
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
61
|
-
rspec-support (~> 3.1.0)
|
62
|
-
rspec-mocks (3.1.3)
|
63
|
-
rspec-support (~> 3.1.0)
|
64
|
-
rspec-support (3.1.2)
|
65
|
-
rspec_junit_formatter (0.2.3)
|
66
|
-
builder (< 4)
|
67
|
-
rspec-core (>= 2, < 4, != 2.12.0)
|
68
|
-
ruby-prof (0.15.9)
|
69
|
-
safe_yaml (1.0.4)
|
70
|
-
security (0.1.3)
|
71
|
-
simplecov (0.12.0)
|
72
|
-
docile (~> 1.1.0)
|
73
|
-
json (>= 1.8, < 3)
|
74
|
-
simplecov-html (~> 0.10.0)
|
75
|
-
simplecov-html (0.10.0)
|
76
|
-
spaceship (0.29.1)
|
77
|
-
colored
|
78
|
-
credentials_manager (>= 0.9.0)
|
79
|
-
faraday (~> 0.9)
|
80
|
-
faraday-cookie_jar (~> 0.0.6)
|
81
|
-
faraday_middleware (~> 0.9)
|
82
|
-
fastimage (~> 1.6)
|
83
|
-
multi_xml (~> 0.5)
|
84
|
-
plist (~> 3.1)
|
85
|
-
unf (0.1.4)
|
86
|
-
unf_ext
|
87
|
-
unf_ext (0.0.7.2)
|
88
|
-
webmock (1.21.0)
|
89
|
-
addressable (>= 2.3.6)
|
90
|
-
crack (>= 0.3.2)
|
91
|
-
|
92
|
-
PLATFORMS
|
93
|
-
ruby
|
94
|
-
|
95
|
-
DEPENDENCIES
|
96
|
-
bundler (~> 1.12)
|
97
|
-
motion-provisioning!
|
98
|
-
rake (~> 10.0)
|
99
|
-
rspec (~> 3.1.0)
|
100
|
-
rspec-prof!
|
101
|
-
rspec_junit_formatter (~> 0.2.3)
|
102
|
-
simplecov
|
103
|
-
webmock (~> 1.21.0)
|
104
|
-
|
105
|
-
BUNDLED WITH
|
106
|
-
1.12.5
|
data/Rakefile
DELETED
@@ -1,71 +0,0 @@
|
|
1
|
-
require 'motion-provisioning'
|
2
|
-
|
3
|
-
desc "Generate the certificates needed by the test suite."
|
4
|
-
task :generate_certificates do
|
5
|
-
FileUtils.mkdir_p('spec/fixtures')
|
6
|
-
Dir.chdir('spec/fixtures') do
|
7
|
-
# Create the root certs
|
8
|
-
`openssl genrsa -out rootCA.p12 2048`
|
9
|
-
`openssl req -x509 -new -nodes -key rootCA.p12 -sha256 -days 1024 -out rootCA.pem -subj "/C=US/ST=California/L=San Francisco/O=Apple Inc./OU=IT Department/CN=MotionProvisioning ROOT"`
|
10
|
-
`security add-trusted-cert -k "#{Dir.home}/Library/Keychains/login.keychain" rootCA.pem`
|
11
|
-
`security import rootCA.pem`
|
12
|
-
|
13
|
-
[:ios, :mac].each do |platform|
|
14
|
-
[:development, :distribution].each do |type|
|
15
|
-
generate_certificate(platform, type)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
# Generates a certificate for the specified platform and type
|
22
|
-
def generate_certificate(platform, type)
|
23
|
-
`openssl genrsa -out #{platform}_#{type}_private_key.p12 2048`
|
24
|
-
`openssl req -new -key #{platform}_#{type}_private_key.p12 -out #{platform}_#{type}.csr -subj "/C=US/ST=California/L=San Francisco/CN=#{platform} #{type}: MotionProvisioning/O=MotionProvisioning/OU=IT Department"`
|
25
|
-
`openssl x509 -req -extfile openssl.conf -extensions 'my server exts' -in #{platform}_#{type}.csr -CA rootCA.pem -CAkey rootCA.p12 -CAcreateserial -outform der -out #{platform}_#{type}_certificate.cer -days 500 -sha256`
|
26
|
-
end
|
27
|
-
|
28
|
-
# Run this from time to time to ensure everything is running in the Real World
|
29
|
-
# like expected.
|
30
|
-
desc "Create all types of certificates and profiles using a real developer account."
|
31
|
-
task :production_test do
|
32
|
-
require "bundler/setup"
|
33
|
-
require "motion-provisioning"
|
34
|
-
require "fileutils"
|
35
|
-
|
36
|
-
MotionProvisioning.client
|
37
|
-
|
38
|
-
num = rand(9999)
|
39
|
-
ios_app_id = "com.hipbyte.iostest#{num}"
|
40
|
-
ios_app = MotionProvisioning::Application.find_or_create(bundle_id: ios_app_id, name: "My iOS Test App")
|
41
|
-
[:ios, :tvos].each do |platform|
|
42
|
-
[:distribution, :adhoc, :development, :development_free].each do |type|
|
43
|
-
free = type == :development_free
|
44
|
-
type = :development if type == :development_free
|
45
|
-
cert_type = type == :development ? :development : :distribution
|
46
|
-
MotionProvisioning.certificate(type: cert_type, platform: :ios, free: free)
|
47
|
-
MotionProvisioning.profile(bundle_identifier: ios_app_id,
|
48
|
-
platform: platform,
|
49
|
-
app_name: "My iOS Test App",
|
50
|
-
type: type,
|
51
|
-
free: free)
|
52
|
-
FileUtils.rm(Dir.glob('provisioning/*.cer'))
|
53
|
-
end
|
54
|
-
end
|
55
|
-
ios_app.delete!
|
56
|
-
|
57
|
-
num = rand(9999)
|
58
|
-
mac_app_id = "com.hipbyte.mactest#{num}"
|
59
|
-
mac_app = MotionProvisioning::Application.find_or_create(bundle_id: mac_app_id, name: "My macOS Test App", mac: true)
|
60
|
-
platform = :mac
|
61
|
-
[:distribution, :development].each do |type|
|
62
|
-
MotionProvisioning.certificate(type: type, platform: :mac)
|
63
|
-
MotionProvisioning.profile(bundle_identifier: mac_app_id,
|
64
|
-
platform: platform,
|
65
|
-
app_name: "My macOS Test App",
|
66
|
-
type: type)
|
67
|
-
FileUtils.rm(Dir.glob('provisioning/*.cer'))
|
68
|
-
end
|
69
|
-
mac_app.delete!
|
70
|
-
|
71
|
-
end
|
data/bin/console
DELETED
data/bin/setup
DELETED
data/motion-provisioning.gemspec
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
lib = File.expand_path('../lib', __FILE__)
|
3
|
-
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require 'motion-provisioning/version'
|
5
|
-
|
6
|
-
Gem::Specification.new do |spec|
|
7
|
-
spec.name = "motion-provisioning"
|
8
|
-
spec.version = MotionProvisioning::VERSION
|
9
|
-
spec.authors = ["Mark Villacampa"]
|
10
|
-
spec.email = ["m@markvillacampa.com"]
|
11
|
-
|
12
|
-
spec.summary = %q{Simplified provisioning for RubyMotion iOS, tvOS and macOS apps.}
|
13
|
-
spec.description = %q{A small library that manages certificates and profiles automatically, from the command line, with minimal configuration.}
|
14
|
-
spec.homepage = "https://github.com/HipByte/motion-provisioning"
|
15
|
-
spec.license = "BSD"
|
16
|
-
|
17
|
-
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|img)/}) }
|
18
|
-
spec.require_paths = ["lib"]
|
19
|
-
|
20
|
-
spec.add_dependency 'spaceship', '~> 0.30'
|
21
|
-
spec.add_dependency 'plist', '~> 3.2'
|
22
|
-
spec.add_dependency 'security', '~> 0.1'
|
23
|
-
spec.add_development_dependency 'bundler', '~> 1.12'
|
24
|
-
spec.add_development_dependency 'rake', '~> 10.0'
|
25
|
-
spec.add_development_dependency 'rspec', '~> 3.1'
|
26
|
-
spec.add_development_dependency 'rspec_junit_formatter', '~> 0.2'
|
27
|
-
spec.add_development_dependency 'webmock', '~> 1.21'
|
28
|
-
spec.add_development_dependency 'simplecov', '~> 0.12'
|
29
|
-
end
|