app-tools 1.17.1 → 1.17.2
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 +19 -17
- 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: d7418181eed0d491751761e1f201aafeef3a2388
|
4
|
+
data.tar.gz: 7d7f8acce95ab2aa638a935308eb81a7cfa00b94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5111ed8303cf29a017dd7e6f0fbac5fd82c0c14ca98b667be43443121ba7e234ce06f6b6dcac1a7849e7d60edb634edda9477074f9618d8d68acb7fab867cad
|
7
|
+
data.tar.gz: ca8a9158c1229f9c0ab0aece3cb412700265d20966084f7f7c45760af94a8319f649c9513470dc060455340089893bd8bd490011b94cd71098fcf14698a0dc4a
|
data/bin/resignipa
CHANGED
@@ -31,21 +31,20 @@ module AppTools
|
|
31
31
|
exit_now! "Must supply a valid provisioning profile"
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
info('Extract the entitlements from the provisioning profile')
|
35
35
|
cms_xml = `security cms -D -i "#{profile_path}"`
|
36
36
|
cms_data = CFPropertyList.native_types(CFPropertyList::List.new(:data => cms_xml).value)
|
37
37
|
entitlements_data = cms_data["Entitlements"]
|
38
38
|
|
39
|
-
|
39
|
+
info('Extracting the app .plist information from the IPA')
|
40
40
|
ipa_plist_data = nil
|
41
|
-
|
42
41
|
Zip::File.open(ipa_path) do |zip_file|
|
43
42
|
entry = zip_file.glob('Payload/*/Info.plist').first
|
44
43
|
plist = CFPropertyList::List.new(:data => entry.get_input_stream.read)
|
45
44
|
ipa_plist_data = CFPropertyList.native_types(plist.value)
|
46
45
|
end
|
47
46
|
|
48
|
-
|
47
|
+
info('Checking to make sure app id and entitlements id match')
|
49
48
|
entitlements_app_id = entitlements_data["application-identifier"]
|
50
49
|
ipa_app_id = ipa_plist_data["CFBundleIdentifier"]
|
51
50
|
|
@@ -53,25 +52,24 @@ module AppTools
|
|
53
52
|
exit_now!("Entitlements app id #{entitlements_app_id} doesn't match Info.plist identifier #{ipa_app_id}")
|
54
53
|
end
|
55
54
|
|
56
|
-
## Creating a temp dir to work in
|
57
55
|
temp_dir = File.join(File.dirname(ipa_path), ipa_basename[0...-4] + '.resignipa.tmp')
|
58
|
-
contents_dir = File.join(temp_dir, "Contents")
|
59
|
-
|
60
56
|
FileUtils.rm_rf temp_dir
|
61
57
|
FileUtils.mkdir temp_dir
|
58
|
+
info("Created a temp dir #{temp_dir}")
|
59
|
+
|
60
|
+
contents_dir = File.join(temp_dir, "Contents")
|
62
61
|
|
63
|
-
## Unzip the existing IPA into the temp dir
|
64
62
|
`unzip #{ipa_path} -d #{contents_dir}`
|
63
|
+
info("Unzipped the existing IPA into #{contents_dir}")
|
65
64
|
|
66
|
-
## Get all dirs to be signed
|
67
|
-
# See http://www.xgiovio.com/blog-photos-videos-other/blog/resign-your-ios-ipa-frameworks-and-plugins-included/
|
68
65
|
payload_dir = File.join(contents_dir, "Payload")
|
66
|
+
info("Created payload directory #{payload_dir}")
|
69
67
|
|
70
|
-
|
68
|
+
info("Embedding the new provisioning profile #{profile_path}")
|
71
69
|
app_dir = `find -d #{payload_dir} -name \\*.app`.split("\n")
|
72
70
|
FileUtils.cp profile_path, File.join(app_dir, "embedded.mobileprovision")
|
73
71
|
|
74
|
-
|
72
|
+
info("Getting associated-domain app entitlements, if any")
|
75
73
|
app_path = `find -d #{payload_dir} -name \\*.app`.chomp
|
76
74
|
app_entitlements_xml = `codesign -d --entitlements :- #{app_path}`
|
77
75
|
|
@@ -81,16 +79,20 @@ module AppTools
|
|
81
79
|
# TODO: What about other values?
|
82
80
|
if entitlements_data.has_key? "com.apple.developer.associated-domains"
|
83
81
|
entitlements_data["com.apple.developer.associated-domains"] = app_entitlements_data["com.apple.developer.associated-domains"]
|
82
|
+
info("Found and added associated-domain entitlements")
|
84
83
|
end
|
84
|
+
else
|
85
|
+
info("No associated-domain entitlements found")
|
85
86
|
end
|
86
87
|
|
87
|
-
## Write the entitlements file
|
88
88
|
entitlements_path = File.join(temp_dir, "entitlements.plist")
|
89
89
|
File.write(entitlements_path,
|
90
90
|
entitlements_data.to_plist(:plist_format => CFPropertyList::List::FORMAT_XML))
|
91
|
+
info("Wrote the entitlements file #{entitlements_path}")
|
91
92
|
|
92
|
-
|
93
|
-
# http://
|
93
|
+
info("Resigning all the frameworks and libraries")
|
94
|
+
# See http://www.xgiovio.com/blog-photos-videos-other/blog/resign-your-ios-ipa-frameworks-and-plugins-included/
|
95
|
+
# and http://stackoverflow.com/questions/25297638/how-do-i-codesign-a-swift-app-via-the-commandline
|
94
96
|
`find -d #{payload_dir} \\( -name \\*.framework -o -name \\*.dylib \\)`.split("\n").each do |sign_dir|
|
95
97
|
# See https://github.com/fastlane/sigh/blob/master/lib/assets/resign.sh#L412
|
96
98
|
pid = Process.spawn("codesign", "-f", "-s", certificate_name, sign_dir)
|
@@ -100,18 +102,18 @@ module AppTools
|
|
100
102
|
end
|
101
103
|
end
|
102
104
|
|
103
|
-
|
105
|
+
info("Resigning the app")
|
104
106
|
pid = Process.spawn("codesign", "-f", "-s", certificate_name, "--entitlements", entitlements_path, app_path)
|
105
107
|
Process.wait(pid)
|
106
108
|
unless $?.exitstatus == 0
|
107
109
|
exit_now! "Failed to sign #{sign_dir}"
|
108
110
|
end
|
109
111
|
|
110
|
-
## Repack
|
111
112
|
new_ipa_dir = File.join(File.dirname(ipa_path), ipa_basename + '.' + [*('a'..'z'),*('0'..'9')].shuffle[0,8].join)
|
112
113
|
new_ipa_path = File.expand_path(File.join(new_ipa_dir, File.basename(ipa_path)))
|
113
114
|
FileUtils.rm_rf new_ipa_dir
|
114
115
|
FileUtils.mkdir new_ipa_dir
|
116
|
+
info("Repacking #{new_ipa_path}")
|
115
117
|
|
116
118
|
# NOTE: The zip tool...
|
117
119
|
`cd #{contents_dir}; zip -r #{new_ipa_path} *`
|
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.17.
|
4
|
+
version: 1.17.2
|
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-09-
|
11
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|