app-tools 1.10.1 → 1.11.0
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 +4 -4
- data/bin/resignipa +15 -12
- data/bin/xcarchive2ipa +6 -2
- data/lib/app_tools/version.rb +1 -1
- 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: b6eacf5d82043e7b7aed5b32b803a12ff284b661
|
4
|
+
data.tar.gz: 66d9989f247056f67a5f0a781b66babfe77cc853
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 678206ba7067d9fa8120aaff7b8dd080b91390975654ab5b6d1c9b8ba9799121ad23c20e58060d3668f986546237481e29f038686bff0b1ff84a2496a1a4c7ef
|
7
|
+
data.tar.gz: 04ed60ffbc58384af47c10f192f38b4f34deceedf490c71ecf152df7ddcf104a9b5e961d78ed299ae4c5c98737df39f596ffe8fc962063fcc69a3bfccf08d648
|
data/bin/resignipa
CHANGED
@@ -25,6 +25,7 @@ module AppTools
|
|
25
25
|
|
26
26
|
ipa_basename = File.basename(ipa_path)
|
27
27
|
profile_path = options[:p]
|
28
|
+
certificate_name = "iPhone Distribution: " + options[:c]
|
28
29
|
|
29
30
|
unless File.exist?(profile_path)
|
30
31
|
exit_now! "Must supply a valid provisioning profile"
|
@@ -53,7 +54,7 @@ module AppTools
|
|
53
54
|
end
|
54
55
|
|
55
56
|
## Creating a temp dir to work in
|
56
|
-
temp_dir = File.join(File.dirname(ipa_path), ipa_basename + '.tmp')
|
57
|
+
temp_dir = File.join(File.dirname(ipa_path), ipa_basename[0...-4] + '.resignipa.tmp')
|
57
58
|
contents_dir = File.join(temp_dir, "Contents")
|
58
59
|
|
59
60
|
FileUtils.rm_rf temp_dir
|
@@ -65,7 +66,6 @@ module AppTools
|
|
65
66
|
## Get all dirs to be signed
|
66
67
|
# See http://www.xgiovio.com/blog-photos-videos-other/blog/resign-your-ios-ipa-frameworks-and-plugins-included/
|
67
68
|
payload_dir = File.join(contents_dir, "Payload")
|
68
|
-
sign_dirs = `find -d #{payload_dir} \\( -name \\*.app -o -name \\*.framework -o -name \\*.appex -name \\*.dylib \\)`.split("\n")
|
69
69
|
|
70
70
|
## Embed the new provisioning profile
|
71
71
|
app_dir = `find -d #{payload_dir} -name \\*.app`.split("\n")
|
@@ -89,21 +89,24 @@ module AppTools
|
|
89
89
|
File.write(entitlements_path,
|
90
90
|
entitlements_data.to_plist(:plist_format => CFPropertyList::List::FORMAT_XML))
|
91
91
|
|
92
|
-
##
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
else
|
98
|
-
pid = Process.spawn("codesign", "-f", "-s", "iPhone Distribution: " + options[:c], "--entitlements", entitlements_path, sign_dir)
|
99
|
-
end
|
92
|
+
## Resign all the frameworks and libraries first ...
|
93
|
+
# http://stackoverflow.com/questions/25297638/how-do-i-codesign-a-swift-app-via-the-commandline
|
94
|
+
`find -d #{payload_dir} \\( -name \\*.framework -o -name \\*.dylib \\)`.split("\n").each do |sign_dir|
|
95
|
+
# See https://github.com/fastlane/sigh/blob/master/lib/assets/resign.sh#L412
|
96
|
+
pid = Process.spawn("codesign", "-f", "-s", certificate_name, sign_dir)
|
100
97
|
Process.wait(pid)
|
101
|
-
|
102
98
|
unless $?.exitstatus == 0
|
103
|
-
exit_now! "Failed to sign
|
99
|
+
exit_now! "Failed to sign #{sign_dir}"
|
104
100
|
end
|
105
101
|
end
|
106
102
|
|
103
|
+
## ... then resign the app
|
104
|
+
pid = Process.spawn("codesign", "-f", "-s", certificate_name, "--entitlements", entitlements_path, app_path)
|
105
|
+
Process.wait(pid)
|
106
|
+
unless $?.exitstatus == 0
|
107
|
+
exit_now! "Failed to sign #{sign_dir}"
|
108
|
+
end
|
109
|
+
|
107
110
|
## Repack
|
108
111
|
new_ipa_dir = File.join(File.dirname(ipa_path), ipa_basename + '.' + [*('a'..'z'),*('0'..'9')].shuffle[0,8].join)
|
109
112
|
new_ipa_path = File.expand_path(File.join(new_ipa_dir, File.basename(ipa_path)))
|
data/bin/xcarchive2ipa
CHANGED
@@ -26,7 +26,7 @@ module AppTools
|
|
26
26
|
xcarchive_path = File.expand_path(xcarchive_path)
|
27
27
|
app_name = Dir.entries(xcarchive_path + '/Products/Applications')[2]
|
28
28
|
app_base_name = app_name[0...-4]
|
29
|
-
tmp_path = File.dirname(xcarchive_path) + '/' + app_base_name + '.tmp'
|
29
|
+
tmp_path = File.dirname(xcarchive_path) + '/' + app_base_name + '.xcarchive2ipa.tmp'
|
30
30
|
|
31
31
|
if Dir.exists?(tmp_path)
|
32
32
|
FileUtils.rm_rf tmp_path
|
@@ -40,6 +40,10 @@ module AppTools
|
|
40
40
|
# Copy the SwiftSupport tree
|
41
41
|
FileUtils.cp_r xcarchive_path + '/SwiftSupport', tmp_path + '/SwiftSupport'
|
42
42
|
|
43
|
+
# HACK: Copy the Swift libraries into the Frameworks directory to make sure they match
|
44
|
+
# https://techblog.badoo.com/blog/2015/02/09/code-signing-and-distributing-swift/
|
45
|
+
FileUtils.cp_r xcarchive_path + '/SwiftSupport/iphoneos', tmp_path + '/Payload/' + app_name + '/Frameworks'
|
46
|
+
|
43
47
|
# Fix up the symbols
|
44
48
|
app_binary = xcarchive_path + '/Products/Applications/' + app_name + '/' + app_base_name
|
45
49
|
FileUtils.mkdir tmp_path + '/Symbols'
|
@@ -54,7 +58,7 @@ module AppTools
|
|
54
58
|
end
|
55
59
|
|
56
60
|
`cd #{tmp_path}; zip -r #{ipa_rel_path} *`
|
57
|
-
FileUtils.rm_rf tmp_path
|
61
|
+
#FileUtils.rm_rf tmp_path
|
58
62
|
puts ipa_path
|
59
63
|
end
|
60
64
|
|
data/lib/app_tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Lyon-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-06-
|
11
|
+
date: 2016-06-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|