fastlane-plugin-app_info 0.2.0 → 0.3.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
- SHA1:
3
- metadata.gz: b788b8b56afc93ec405d1d2d538010f4579f272e
4
- data.tar.gz: 9921dc1352fa525c368448a361e15700efebf75b
2
+ SHA256:
3
+ metadata.gz: acab563c3a2013d4ee100335c1ce2d4005d5f6887322fcd53581f72869ddd942
4
+ data.tar.gz: 345bcad4c2d60afcc4a3255621c89158df5a51e4010a381e350524e2b2a0a597
5
5
  SHA512:
6
- metadata.gz: cd453c003f402e9af916e800a5ceba14f755697f4fe15b6202d2736bf17cddb1bbfd049857b3630a61c0659c757d21dd6c1cf1dcd226188c0992f9c399ef01bd
7
- data.tar.gz: d247080aa87eb7635b055a849acdda62170d1184f0052220807a2958f979873d6f6b1dc57bc0d554d236600b9a33d1a527700504189ac994f111ced252bfa00d
6
+ metadata.gz: 0ad3c2bdb1f411f2057005ce9b094dc20c4d3c2d1e3ad1a514ee49d82f06893b17302a32ba0a5d93ca95d7f75b2490e5dcb910ad7f3c36cfe2d5008d59702f81
7
+ data.tar.gz: ebb881feb0881ae550613bca2f35870eaa55698e007af152e2500e66130ba232619b81c364c1c2f84082ab1fdfdb9a5382716dfa92c98e3d483f6275f85d262e
@@ -31,24 +31,43 @@ module Fastlane
31
31
  end
32
32
 
33
33
  def self.table_columns
34
- common_columns.merge(ios_columns)
34
+ common_columns.merge(extra_columns)
35
35
  end
36
36
 
37
37
  def self.common_columns
38
38
  Helper::AppInfoHelper.common_columns.each_with_object({}) do |key, hash|
39
- name = key.split('_').map(&:capitalize).join('')
40
- hash[name] = Helper::AppInfoHelper.object_to_column(@app.send(key.to_sym))
39
+ name = key == 'os' ? key.upcase : key.split('_').map(&:capitalize).join('')
40
+ value = key == 'size' ? @app.size(true) : @app.send(key.to_sym)
41
+ hash[name] = Helper::AppInfoHelper.object_to_column(value)
41
42
  end
42
43
  end
43
44
 
44
- def self.ios_columns
45
- return {} unless @app.os == 'iOS' && @app.mobileprovision && !@app.mobileprovision.empty?
46
-
47
- @app.mobileprovision.mobileprovision.each_with_object({}) do |(key, value), hash|
48
- next if key == 'DeveloperCertificates'
49
-
50
- name = Helper::AppInfoHelper.column_name(key, value)
51
- hash[name] = Helper::AppInfoHelper.object_to_column(value)
45
+ def self.extra_columns
46
+ if @app.os == 'iOS'
47
+ return {} unless @app.mobileprovision && !@app.mobileprovision.empty?
48
+
49
+ @app.mobileprovision.mobileprovision.each_with_object({}) do |(key, value), hash|
50
+ next if key == 'DeveloperCertificates'
51
+
52
+ name = Helper::AppInfoHelper.column_name(key, value)
53
+ hash[name] = Helper::AppInfoHelper.object_to_column(value)
54
+ end
55
+ elsif @app.os == 'Android'
56
+ signs = @app.signs.map {|f| f.path }
57
+ issuers = Helper::AppInfoHelper.android_certificate_issuer(@app)
58
+ permissions = @app.use_permissions
59
+ features = @app.use_features
60
+
61
+ {
62
+ "MinSDKVersion" => Helper::AppInfoHelper.object_to_column(@app.min_sdk_version),
63
+ "TargetSDKVersion" => Helper::AppInfoHelper.object_to_column(@app.target_sdk_version),
64
+ "Signatures" => Helper::AppInfoHelper.object_to_column(signs),
65
+ "CertificateIssuers" => Helper::AppInfoHelper.object_to_column(issuers),
66
+ "UsePermissions (#{permissions.size})" => Helper::AppInfoHelper.object_to_column(permissions),
67
+ "UseFeatures (#{features.size})" => Helper::AppInfoHelper.object_to_column(features),
68
+ }
69
+ else
70
+ {}
52
71
  end
53
72
  end
54
73
 
@@ -26,13 +26,14 @@ module Fastlane
26
26
  end
27
27
 
28
28
  def self.common_columns
29
- %w[name release_version build_version identifier os]
29
+ %w[name release_version build_version identifier os size]
30
30
  end
31
31
 
32
32
  def self.app_to_json(app)
33
33
  data = common_columns.each_with_object({}) do |key, obj|
34
- name = key.split('_').map(&:capitalize).join('')
35
- obj[name] = app.send(key.to_sym)
34
+ name = key.downcase == 'os' ? key.upcase : key.split('_').map(&:capitalize).join('')
35
+ value = key == 'size' ? app.size(true) : app.send(key.to_sym)
36
+ obj[name] = value
36
37
  end
37
38
 
38
39
  if app.os == 'iOS' && app.mobileprovision && !app.mobileprovision.empty?
@@ -40,11 +41,27 @@ module Fastlane
40
41
  next if key == 'DeveloperCertificates'
41
42
  data[key] = value
42
43
  end
44
+ elsif app.os == 'Android'
45
+ data["MinSDKVersion"] = app.min_sdk_version
46
+ data["TargetSDKVersion"] = app.target_sdk_version
47
+ data["CertificateIssuers"] = android_certificate_issuer(app)
48
+ data["Signatures"] = app.signs.map {|sign| sign.path }
49
+ data["UsePermissions"] = app.use_permissions
50
+ data["UseFeatures"] = app.use_features
43
51
  end
44
52
 
45
53
  JSON.dump(data)
46
54
  end
47
55
 
56
+ def self.android_certificate_issuer(app)
57
+ app.certificates.each_with_object([]) do |cert, obj|
58
+ issuer = cert.certificate.issuer.to_a.map {|c| [c[0], c[1]] }.flatten.each_slice(2).to_h
59
+ obj << issuer.select{ |k, _| ['CN', 'OU', 'O'].include?(k) }
60
+ .map {|k, v| "#{k}:#{v}"}
61
+ .join(' ')
62
+ end
63
+ end
64
+
48
65
  def self.store_sharedvalue(key, value)
49
66
  Actions.lane_context[key] = value
50
67
  ENV[key.to_s] = value
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AppInfo
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.3.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-app_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - icyleaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-25 00:00:00.000000000 Z
11
+ date: 2019-06-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: app-info
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.4
19
+ version: 1.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.4
26
+ version: 1.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -139,8 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  - !ruby/object:Gem::Version
140
140
  version: '0'
141
141
  requirements: []
142
- rubyforge_project:
143
- rubygems_version: 2.6.12
142
+ rubygems_version: 3.0.3
144
143
  signing_key:
145
144
  specification_version: 4
146
145
  summary: Teardown tool for mobile app(ipa/apk), analysis metedata like version, name,