sigh 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -0
- data/bin/sigh +2 -1
- data/lib/sigh/resign.rb +28 -7
- data/lib/sigh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61d15e7d1f74512038a9db3efd0c036e71cfef26
|
4
|
+
data.tar.gz: a304c8e59a70ea4fe86113b780cf91e45356bb92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53aeceee5e87ce12575206aa057c958f3e92ee45b201d6889a46950475cd62a82bcf1a6806b73afef06e0245ae56b8f4f5b92e47902698fc8c06f926544ec0c8
|
7
|
+
data.tar.gz: c0bf64dfb5015e2f1ae1c1498e9128cfd2ca54e71b86b6e13d67315eb8e4af0def41306ad9e818ce46bad06a38d3a55ca8f152f34873396292764bbc26510298
|
data/README.md
CHANGED
@@ -41,6 +41,7 @@ Get in contact with the developer on Twitter: [@KrauseFx](https://twitter.com/Kr
|
|
41
41
|
<a href="#features">Features</a> •
|
42
42
|
<a href="#installation">Installation</a> •
|
43
43
|
<a href="#usage">Usage</a> •
|
44
|
+
<a href="#usage">Resign</a> •
|
44
45
|
<a href="#how-does-it-work">How does it work?</a> •
|
45
46
|
<a href="#tips">Tips</a> •
|
46
47
|
<a href="#need-help">Need help?</a>
|
@@ -123,9 +124,23 @@ By default, ```sigh``` will include all certificates on development profiles, an
|
|
123
124
|
|
124
125
|
sigh -c "SunApps GmbH"
|
125
126
|
|
127
|
+
Or identify be expire date if you're using the same names for multiple certificates
|
126
128
|
|
127
129
|
sigh -d "Nov 11, 2017"
|
128
130
|
|
131
|
+
# Resign
|
132
|
+
|
133
|
+
If you generated your `ipa` file but want to apply a different code signing onto the ipa file, you can use `sigh resign`:
|
134
|
+
|
135
|
+
|
136
|
+
sigh resign
|
137
|
+
|
138
|
+
`sigh` will find the ipa file and the provisioning profile for you if they are located in the current folder.
|
139
|
+
|
140
|
+
You can pass more information using the command line:
|
141
|
+
|
142
|
+
sigh resign ./path/app.ipa -i "iPhone Distribution: Felix Krause" -p "my.mobileprovision"
|
143
|
+
|
129
144
|
## Environment Variables
|
130
145
|
In case you prefer environment variables:
|
131
146
|
|
data/bin/sigh
CHANGED
@@ -71,9 +71,10 @@ class SighApplication
|
|
71
71
|
c.syntax = 'sigh resign'
|
72
72
|
c.description = 'Resigns an existing ipa file with the given provisioning profile'
|
73
73
|
c.option '-i', '--signing_identity STRING', String, 'The signing identity to use. Must match the one defined in the provisioning profile.'
|
74
|
+
c.option '-p', '--provisioning_profile STRING', String, 'The path to the provisioning profile which should be used'
|
74
75
|
|
75
76
|
c.action do |args, options|
|
76
|
-
Sigh::Resign.new.run(options)
|
77
|
+
Sigh::Resign.new.run(options, args)
|
77
78
|
end
|
78
79
|
end
|
79
80
|
|
data/lib/sigh/resign.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
module Sigh
|
2
2
|
# Resigns an existing ipa file
|
3
3
|
class Resign
|
4
|
-
def run(options)
|
5
|
-
get_inputs(options)
|
4
|
+
def run(options, args)
|
5
|
+
get_inputs(options, args)
|
6
6
|
|
7
7
|
command = [
|
8
8
|
@resign_path,
|
@@ -13,17 +13,25 @@ module Sigh
|
|
13
13
|
].join(' ')
|
14
14
|
|
15
15
|
puts command.magenta
|
16
|
-
|
16
|
+
output = `#{command}`
|
17
|
+
puts output
|
18
|
+
if output.include?"Assuming Distribution Identity"
|
19
|
+
Helper.log.info "Successfully signed #{@ipa}!".green
|
20
|
+
else
|
21
|
+
Helper.log.fatal "Something went wrong while code signing #{@ipa}".red
|
22
|
+
end
|
17
23
|
end
|
18
24
|
|
19
|
-
def get_inputs(options)
|
25
|
+
def get_inputs(options, args)
|
20
26
|
@resign_path = File.join(Helper.gem_path, 'lib', 'assets', 'resign.sh')
|
21
27
|
raise "Could not find resign.sh file. Please try re-installing the gem.".red unless File.exists?@resign_path
|
22
28
|
|
23
|
-
@ipa =
|
29
|
+
@ipa = args.first || find_ipa || ask("Path to ipa file: ")
|
30
|
+
validate_ipa_file!
|
24
31
|
@signing_identity = options.signing_identity || ask_for_signing_identity
|
25
32
|
validate_signing_identity
|
26
33
|
@provisioning_profile = options.provisioning_profile || find_provisioning_profile || ask("Path to provisioning file: ")
|
34
|
+
validate_provisioning_file!
|
27
35
|
end
|
28
36
|
|
29
37
|
def find_ipa
|
@@ -34,15 +42,28 @@ module Sigh
|
|
34
42
|
Dir[File.join(Dir.pwd, "*.mobileprovision")].sort { |a,b| File.mtime(a) <=> File.mtime(b) }.first
|
35
43
|
end
|
36
44
|
|
45
|
+
def validate_ipa_file!
|
46
|
+
raise "ipa file could not be found or is not an ipa file (#{@ipa})".red unless (File.exists?(@ipa) and @ipa.end_with?".ipa")
|
47
|
+
end
|
48
|
+
|
49
|
+
def validate_provisioning_file!
|
50
|
+
raise "Provisioning profile file could not be found or is not a .mobileprovision file (#{@provisioning_profile})".red unless (File.exists?(@provisioning_profile) and @provisioning_profile.end_with?".mobileprovision")
|
51
|
+
end
|
52
|
+
|
37
53
|
def validate_signing_identity
|
38
54
|
while not installed_identies.include?@signing_identity
|
39
|
-
Helper.log.error "Couldn't find signing identity '#{@signing_identity}'.
|
55
|
+
Helper.log.error "Couldn't find signing identity '#{@signing_identity}'."
|
40
56
|
@signing_identity = ask_for_signing_identity
|
41
57
|
end
|
42
58
|
end
|
43
59
|
|
60
|
+
def print_available_identities
|
61
|
+
Helper.log.info "Available identities: \n\t#{installed_identies.join("\n\t")}\n"
|
62
|
+
end
|
63
|
+
|
44
64
|
def ask_for_signing_identity
|
45
|
-
|
65
|
+
print_available_identities
|
66
|
+
ask("Signing Identity: ")
|
46
67
|
end
|
47
68
|
|
48
69
|
# Array of available signing identities
|
data/lib/sigh/version.rb
CHANGED