sigh 0.3.0 → 0.3.1

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
  SHA1:
3
- metadata.gz: ef27c541a6d91c50a1a6230aa2dc3598456603b4
4
- data.tar.gz: a9cb32dca3f10b03502ee41589d54db9d7d1d6bb
3
+ metadata.gz: 61d15e7d1f74512038a9db3efd0c036e71cfef26
4
+ data.tar.gz: a304c8e59a70ea4fe86113b780cf91e45356bb92
5
5
  SHA512:
6
- metadata.gz: 2cfc39277183515956b30fcd2df642657f60ea084af41a3d8c248bc71f892440e6ffe8c62a1f787654f7ec24569f37fefcd9f68288c306af25697ec7ebafea53
7
- data.tar.gz: f53445cff10af39c000800130eeeb139734ddc92f05feb0c2c326c034556eb704be201424ebebea0e12c27e49c74a1d35551a51175dce67a6f6f4f6451884474
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> &bull;
42
42
  <a href="#installation">Installation</a> &bull;
43
43
  <a href="#usage">Usage</a> &bull;
44
+ <a href="#usage">Resign</a> &bull;
44
45
  <a href="#how-does-it-work">How does it work?</a> &bull;
45
46
  <a href="#tips">Tips</a> &bull;
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
- puts `#{command}`
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 = options.ipa || find_ipa || ask("Path to ipa file: ")
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}'. Available identities: \n\t#{installed_identies.join("\n\t")}\n"
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
- ask("Signing Identity (e.g. 'iPhone Distribution: SunApps GmbH (5A997XAHK2)'): ")
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
@@ -1,3 +1,3 @@
1
1
  module Sigh
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sigh
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Felix Krause