fastlane-plugin-ipa_info 0.5.0 → 0.6.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
  SHA256:
3
- metadata.gz: a177420149a8dc188416e4c618551a9a114d9115824a294dbc09bec18650d4fa
4
- data.tar.gz: d850c8413099d685eec3d782a5bbb95611cdf1ebf808b1aa8b361a58e4133123
3
+ metadata.gz: 477ddb7083b35228565294f91a6663f8a28bb6be9c12d9c388385e09479a78c3
4
+ data.tar.gz: 30c246417a944bf11deaad3bf1154822179cd4cb7a4499ce4bad037c412d5d9e
5
5
  SHA512:
6
- metadata.gz: 1730872be8e7ecf0ff66f51ddd0ef445b22ddbf368729f0116d079637319518ec0b9e7e165c507be678c8a722bf9501ecae75d02709e003385322bc09c607704
7
- data.tar.gz: 3e8c1737e343fa7865de72d9ba1be0688c8e046b42bb083a503904b37e632d4f1e92fb35970a9d8b9218718b3b947b43a4297e2d2b26323c2b07a035f044e1d4
6
+ metadata.gz: decf9c25b01271d3dd0f5908c4f11f3ab3443dcd82c93a523291916b77de18f94790d616471e579962bd59949d5e52852040de6b91510a44eaba56e35f532050
7
+ data.tar.gz: 2598004e5d4c87742065854f45a0848599f632449e616453601c8b7a97d192fc116401a75c3dfeed25fabe2b1c0f931223e16e934439fc5b602773a3a7074ead
@@ -20,10 +20,15 @@ module Fastlane
20
20
  summary_table = Helper::IpaInfoHelper.summary_table(title: "ipa Information", rows: rows)
21
21
  puts(summary_table)
22
22
 
23
- # certificate info
24
- rows = Helper::IpaInfoHelper.certificate_information(provision_info_result: info_result[:provisiong_info])
23
+ # mobile provisioning info
24
+ rows = Helper::IpaInfoHelper.mobileprovisioning_information(provision_info_result: info_result[:provisiong_info])
25
25
  summary_table = Helper::IpaInfoHelper.summary_table(title: "Mobile Provision", rows: rows)
26
26
  puts(summary_table)
27
+
28
+ # certificate info
29
+ rows = Helper::IpaInfoHelper.certificate_information(certificate_info_result: info_result[:certificate_info])
30
+ summary_table = Helper::IpaInfoHelper.summary_table(title: "Certificate", rows: rows)
31
+ puts(summary_table)
27
32
  end
28
33
 
29
34
  def self.description
@@ -1,7 +1,10 @@
1
1
  require 'tempfile'
2
+ require 'tmpdir'
2
3
  require 'zip'
3
4
  require 'zip/filesystem'
5
+ require 'fileutils'
4
6
  require 'plist'
7
+ require 'open3'
5
8
  require 'fastlane_core/ui/ui'
6
9
 
7
10
  module Fastlane
@@ -12,7 +15,7 @@ module Fastlane
12
15
  app_folder_path = find_app_folder_path_in_ipa(ipa_path)
13
16
  ipa_zipfile.close
14
17
 
15
- # path
18
+ # file path
16
19
  mobileprovision_entry = ipa_zipfile.find_entry("#{app_folder_path}/embedded.mobileprovision")
17
20
  UI.user_error!("mobileprovision not found in #{ipa_path}") unless mobileprovision_entry
18
21
  info_plist_entry = ipa_zipfile.find_entry("#{app_folder_path}/Info.plist")
@@ -20,7 +23,8 @@ module Fastlane
20
23
 
21
24
  return {
22
25
  provisiong_info: self.analyze_mobileprovisioning(mobileprovision_entry, ipa_zipfile),
23
- plist_info: self.analyze_info_plist(info_plist_entry, ipa_zipfile)
26
+ plist_info: self.analyze_info_plist(info_plist_entry, ipa_zipfile),
27
+ certificate_info: self.codesigned(ipa_zipfile)
24
28
  }
25
29
  end
26
30
 
@@ -55,9 +59,9 @@ module Fastlane
55
59
  tempfile = Tempfile.new(::File.basename(mobileprovision_entry.name))
56
60
  begin
57
61
  ipa_zipfile.extract(mobileprovision_entry, tempfile.path) { true }
58
- plist = Plist.parse_xml(`security cms -D -i #{tempfile.path}`)
62
+ mobileprovisioning = Plist.parse_xml(`security cms -D -i #{tempfile.path}`)
59
63
 
60
- plist.each do |key, value|
64
+ mobileprovisioning.each do |key, value|
61
65
  next if key == 'DeveloperCertificates'
62
66
 
63
67
  parse_value = value.class == Hash || value.class == Array ? value : value.to_s
@@ -72,6 +76,30 @@ module Fastlane
72
76
  return result
73
77
  end
74
78
 
79
+ # certificate
80
+ def self.codesigned(ipa_zipfile)
81
+ result = {}
82
+ tempdir = Dir.pwd + "/tmp"
83
+
84
+ begin
85
+ ipa_zipfile.each do |entry_first|
86
+ entry_first.extract(tempdir + "/" + entry_first.name) { true }
87
+ end
88
+
89
+ app_path = tempdir + "/Payload/ios.app"
90
+ cmd = "codesign -dv #{app_path}"
91
+ _stdout, stderr, _status = Open3.capture3(cmd)
92
+ codesigned_flag = stderr.include?("Signed Time")
93
+
94
+ result["CodeSigned"] = codesigned_flag
95
+ rescue StandardError => e
96
+ UI.user_error!(e.message)
97
+ ensure
98
+ FileUtils.rm_r(tempdir)
99
+ end
100
+ return result
101
+ end
102
+
75
103
  # return app folder path
76
104
  def self.find_app_folder_path_in_ipa(ipa_path)
77
105
  return "Payload/#{File.basename(ipa_path, File.extname(ipa_path))}.app"
@@ -38,10 +38,24 @@ module Fastlane
38
38
  rows
39
39
  end
40
40
 
41
- def self.certificate_information(provision_info_result:)
41
+ # certificate info
42
+ def self.certificate_information(certificate_info_result:)
43
+ rows = []
44
+ [%w[CodeSigned CodeSigned]].each do |key, name|
45
+ ENV["FL_#{name.upcase}"] = certificate_info_result[key].to_s
46
+
47
+ rows << [name, certificate_info_result[key].to_s]
48
+ end
49
+
50
+ rows
51
+ end
52
+
53
+ # mobileprovisioning info
54
+ def self.mobileprovisioning_information(provision_info_result:)
42
55
  rows = []
43
56
  [%w[TeamName TeamName],
44
57
  %w[Name ProvisioningProfileName]].each do |key, name|
58
+ ENV["FL_#{name.upcase}"] = provision_info_result[key]
45
59
  rows << [name, provision_info_result[key]]
46
60
  end
47
61
 
@@ -51,6 +65,9 @@ module Fastlane
51
65
  expire_date = Date.parse(provision_info_result[key].to_s)
52
66
  count_day = (expire_date - today).numerator
53
67
 
68
+ ENV["FL_#{name.upcase}"] = provision_info_result[key]
69
+ ENV["FL_COUNT_DAY"] = count_day.to_s
70
+
54
71
  rows << [name, provision_info_result[key]]
55
72
  rows << ["DeadLine", "#{count_day} day"]
56
73
  end
@@ -62,7 +79,16 @@ module Fastlane
62
79
  # @return macOS version(High Sierra or higher)
63
80
  def self.macos_build_to_macos_version(build:)
64
81
  case build
82
+ # macOS Big Sur
83
+ when "20B29", "20B50" then
84
+ "11.0.1"
65
85
  # macOS Catalina
86
+ when "19H2", "19H15" then
87
+ "10.15.7"
88
+ when "19G73", "19G2021" then
89
+ "10.15.6"
90
+ when "19F101", "19F96" then
91
+ "10.15.5"
66
92
  when "19E266" then
67
93
  "10.15.4"
68
94
  when "19D76" then
@@ -109,8 +135,13 @@ module Fastlane
109
135
  end
110
136
 
111
137
  def self.macos_version_to_os_name(version:)
138
+ major_version = version.split(".")[0].to_i
112
139
  minor_version = version.split(".")[1].to_i
113
140
  # reference https://support.apple.com/ja-jp/HT201260
141
+ case major_version
142
+ when 11
143
+ return "macOS Big Sur"
144
+ end
114
145
  case minor_version
115
146
  when 15
116
147
  "macOS Catalina"
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module IpaInfo
3
- VERSION = "0.5.0"
3
+ VERSION = "0.6.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-ipa_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - tarappo
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-02 00:00:00.000000000 Z
11
+ date: 2021-01-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plist
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '3.1'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 3.1.0
20
+ - - "~>"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '3.1'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
29
  version: 3.1.0
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rubyzip
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -208,8 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubyforge_project:
212
- rubygems_version: 2.7.6
211
+ rubygems_version: 3.0.3
213
212
  signing_key:
214
213
  specification_version: 4
215
214
  summary: show ipa info