fastlane-plugin-ipa_info 0.3.3 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7637c1ed34d8ba1fc4c366a6132db01f88324711
|
4
|
+
data.tar.gz: 43eff47bf3acb21346831d20f353756b96f2ddf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2cfb451c376f36e0eb5d648946f6c9b46a371a2af57095dba9d606f67579e9725fec7992a757c6790e1c44c24ea49b933c11c497e472d770bcbb6a8b77d3daf
|
7
|
+
data.tar.gz: cc46175667618806b618a8d7f9eebd9248da9acefb51d42286d47792004705b690c9cc0ad70ebeddd139eb0ff8bf560fb06bcea765f28d1c9a5fb43d107481a8
|
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'ipa_analyzer'
|
2
1
|
require 'json'
|
3
2
|
|
4
3
|
module Fastlane
|
@@ -8,28 +7,21 @@ module Fastlane
|
|
8
7
|
@file = params[:ipa_file]
|
9
8
|
UI.user_error!('You have to set path an ipa file') unless @file
|
10
9
|
|
11
|
-
|
12
|
-
|
13
|
-
ipa_info.open!
|
14
|
-
ipa_info_result = ipa_info.collect_info_plist_info[:content]
|
15
|
-
provision_info_result = ipa_info.collect_provision_info[:content]
|
16
|
-
ipa_info.close
|
17
|
-
rescue e
|
18
|
-
UI.user_error!(e.message)
|
19
|
-
end
|
10
|
+
# result
|
11
|
+
info_result = Helper::IpaAnalyzeHelper.analyze(@file)
|
20
12
|
|
21
13
|
# show build environment info
|
22
|
-
rows = Helper::IpaInfoHelper.build_environment_information(ipa_info_result:
|
14
|
+
rows = Helper::IpaInfoHelper.build_environment_information(ipa_info_result: info_result[:plist_info])
|
23
15
|
summary_table = Helper::IpaInfoHelper.summary_table(title: "Build Environment", rows: rows)
|
24
16
|
puts(summary_table)
|
25
17
|
|
26
18
|
# show ipa info
|
27
|
-
rows = Helper::IpaInfoHelper.ipa_information(ipa_info_result:
|
19
|
+
rows = Helper::IpaInfoHelper.ipa_information(ipa_info_result: info_result[:plist_info])
|
28
20
|
summary_table = Helper::IpaInfoHelper.summary_table(title: "ipa Information", rows: rows)
|
29
21
|
puts(summary_table)
|
30
22
|
|
31
23
|
# certificate info
|
32
|
-
rows = Helper::IpaInfoHelper.certificate_information(provision_info_result:
|
24
|
+
rows = Helper::IpaInfoHelper.certificate_information(provision_info_result: info_result[:provisiong_info])
|
33
25
|
summary_table = Helper::IpaInfoHelper.summary_table(title: "Mobile Provision", rows: rows)
|
34
26
|
puts(summary_table)
|
35
27
|
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'tempfile'
|
2
|
+
require 'zip'
|
3
|
+
require 'zip/filesystem'
|
4
|
+
require 'plist'
|
5
|
+
require 'fastlane_core/ui/ui'
|
6
|
+
|
7
|
+
module Fastlane
|
8
|
+
module Helper
|
9
|
+
class IpaAnalyzeHelper
|
10
|
+
def self.analyze(ipa_path)
|
11
|
+
ipa_zipfile = Zip::File.open(ipa_path)
|
12
|
+
app_folder_path = find_app_folder_path_in_ipa(ipa_path)
|
13
|
+
ipa_zipfile.close
|
14
|
+
|
15
|
+
# path
|
16
|
+
mobileprovision_entry = ipa_zipfile.find_entry("#{app_folder_path}/embedded.mobileprovision")
|
17
|
+
UI.user_error!("mobileprovision not found in #{ipa_path}") unless mobileprovision_entry
|
18
|
+
info_plist_entry = ipa_zipfile.find_entry("#{app_folder_path}/Info.plist")
|
19
|
+
UI.user_error!("Info.plist not found in #{ipa_path}") unless info_plist_entry
|
20
|
+
|
21
|
+
return {
|
22
|
+
provisiong_info: self.analyze_mobileprovisioning(mobileprovision_entry, ipa_zipfile),
|
23
|
+
plist_info: self.analyze_info_plist(info_plist_entry, ipa_zipfile)
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Info plist
|
28
|
+
def self.analyze_info_plist(info_plist_entry, ipa_zipfile)
|
29
|
+
result = {}
|
30
|
+
|
31
|
+
tempfile = Tempfile.new(::File.basename(info_plist_entry.name))
|
32
|
+
begin
|
33
|
+
ipa_zipfile.extract(info_plist_entry, tempfile.path) { true }
|
34
|
+
UI.user_error!("Failed to convert binary Plist to XML") unless system("plutil -convert xml1 '#{tempfile.path}'")
|
35
|
+
|
36
|
+
plist = Plist.parse_xml(tempfile.path)
|
37
|
+
|
38
|
+
plist.each do |key, value|
|
39
|
+
parse_value = value.class == Hash || value.class == Array ? value : value.to_s
|
40
|
+
|
41
|
+
result[key] = parse_value
|
42
|
+
end
|
43
|
+
rescue StandardError => e
|
44
|
+
UI.user_error!(e.message)
|
45
|
+
ensure
|
46
|
+
tempfile.close && tempfile.unlink
|
47
|
+
end
|
48
|
+
return result
|
49
|
+
end
|
50
|
+
|
51
|
+
# mobileprovisioning
|
52
|
+
def self.analyze_mobileprovisioning(mobileprovision_entry, ipa_zipfile)
|
53
|
+
result = {}
|
54
|
+
|
55
|
+
tempfile = Tempfile.new(::File.basename(mobileprovision_entry.name))
|
56
|
+
begin
|
57
|
+
ipa_zipfile.extract(mobileprovision_entry, tempfile.path) { true }
|
58
|
+
plist = Plist.parse_xml(`security cms -D -i #{tempfile.path}`)
|
59
|
+
|
60
|
+
plist.each do |key, value|
|
61
|
+
next if key == 'DeveloperCertificates'
|
62
|
+
|
63
|
+
parse_value = value.class == Hash || value.class == Array ? value : value.to_s
|
64
|
+
|
65
|
+
result[key] = parse_value
|
66
|
+
end
|
67
|
+
rescue StandardError => e
|
68
|
+
UI.user_error!(e.message)
|
69
|
+
ensure
|
70
|
+
tempfile.close && tempfile.unlink
|
71
|
+
end
|
72
|
+
return result
|
73
|
+
end
|
74
|
+
|
75
|
+
# return app folder path
|
76
|
+
def self.find_app_folder_path_in_ipa(ipa_path)
|
77
|
+
return "Payload/#{File.basename(ipa_path, File.extname(ipa_path))}.app"
|
78
|
+
end
|
79
|
+
|
80
|
+
private_class_method :find_app_folder_path_in_ipa
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -14,6 +14,7 @@ module Fastlane
|
|
14
14
|
# add os name and version
|
15
15
|
[%w[BuildMachineOSBuild MacOS]].each do |key, name|
|
16
16
|
mac_os_build = ipa_info_result[key]
|
17
|
+
|
17
18
|
mac_os_version = self.macos_build_to_macos_version(build: mac_os_build)
|
18
19
|
mac_os_name = self.macos_version_to_os_name(version: mac_os_version)
|
19
20
|
rows << [name, "#{mac_os_name} #{mac_os_version} (#{mac_os_build})"]
|
@@ -55,18 +56,28 @@ module Fastlane
|
|
55
56
|
end
|
56
57
|
|
57
58
|
# macOS build number to macOS version
|
58
|
-
# @return macOS version(
|
59
|
+
# @return macOS version(High Sierra or higher)
|
59
60
|
def self.macos_build_to_macos_version(build:)
|
60
|
-
# reference https://support.apple.com/ja-jp/HT201260
|
61
61
|
case build
|
62
|
-
#macOS
|
63
|
-
when "
|
62
|
+
# macOS Catalina
|
63
|
+
when "19C57" then
|
64
|
+
"10.15.2"
|
65
|
+
when "19B88" then
|
66
|
+
"10.15.1"
|
67
|
+
when "19A583", "19A602" then
|
68
|
+
"10.15"
|
69
|
+
# macOS Mojave
|
70
|
+
when "18G84", "18G103", "18G1012" then
|
71
|
+
"10.14.6"
|
72
|
+
when "18F132", "18F203" then
|
73
|
+
"10.14.5"
|
74
|
+
when "18E226", "18E227" then
|
64
75
|
"10.14.4"
|
65
|
-
when "18D42", "18D109" then
|
76
|
+
when "18D42", "18D43", "18D109" then
|
66
77
|
"10.14.3"
|
67
78
|
when "18C54" then
|
68
79
|
"10.14.2"
|
69
|
-
when "18B75" then
|
80
|
+
when "18B75", "18B2107", "18B3094" then
|
70
81
|
"10.14.1"
|
71
82
|
when "18A391" then
|
72
83
|
"10.14"
|
@@ -85,21 +96,6 @@ module Fastlane
|
|
85
96
|
"10.13.1"
|
86
97
|
when "17A365", "17A405" then
|
87
98
|
"10.13"
|
88
|
-
# macOS Sierra
|
89
|
-
when "16G29", "16G1036", "16G1114", "16G1212" then
|
90
|
-
"10.12.6"
|
91
|
-
when "16F73" then
|
92
|
-
"10.12.5"
|
93
|
-
when "16E195" then
|
94
|
-
"10.12.4"
|
95
|
-
when "16D32" then
|
96
|
-
"10.12.3"
|
97
|
-
when "16C67" then
|
98
|
-
"10.12.2"
|
99
|
-
when "16B2555", "16B2557" then
|
100
|
-
"10.12.1"
|
101
|
-
when "16A323" then
|
102
|
-
"10.12.1"
|
103
99
|
else
|
104
100
|
"UnKnown"
|
105
101
|
end
|
@@ -109,6 +105,8 @@ module Fastlane
|
|
109
105
|
minor_version = version.split(".")[1].to_i
|
110
106
|
# reference https://support.apple.com/ja-jp/HT201260
|
111
107
|
case minor_version
|
108
|
+
when 15
|
109
|
+
"macOS Catalina"
|
112
110
|
when 14
|
113
111
|
"macOS Mojave"
|
114
112
|
when 13
|
metadata
CHANGED
@@ -1,29 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fastlane-plugin-ipa_info
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- tarappo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: plist
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.1'
|
17
20
|
- - ">="
|
18
21
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
22
|
+
version: 3.1.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
24
30
|
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
32
|
+
version: 3.1.0
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: rubyzip
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
requirements:
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.1'
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: 1.1.7
|
43
|
+
type: :runtime
|
44
|
+
prerelease: false
|
45
|
+
version_requirements: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.1'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.1.7
|
27
53
|
- !ruby/object:Gem::Dependency
|
28
54
|
name: pry
|
29
55
|
requirement: !ruby/object:Gem::Requirement
|
@@ -160,6 +186,7 @@ files:
|
|
160
186
|
- README.md
|
161
187
|
- lib/fastlane/plugin/ipa_info.rb
|
162
188
|
- lib/fastlane/plugin/ipa_info/actions/ipa_info_action.rb
|
189
|
+
- lib/fastlane/plugin/ipa_info/helper/ipa_analyze_helper.rb
|
163
190
|
- lib/fastlane/plugin/ipa_info/helper/ipa_info_helper.rb
|
164
191
|
- lib/fastlane/plugin/ipa_info/version.rb
|
165
192
|
homepage: https://github.com/tarappo/fastlane-plugin-ipa_info
|