fastlane-plugin-app_info 0.3.0 → 0.5.1

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: acab563c3a2013d4ee100335c1ce2d4005d5f6887322fcd53581f72869ddd942
4
- data.tar.gz: 345bcad4c2d60afcc4a3255621c89158df5a51e4010a381e350524e2b2a0a597
3
+ metadata.gz: 71469bee2fa19c249a86327d93c899b4cf159d3a065d27ba5251624814fe9185
4
+ data.tar.gz: 6fa0b0575ada3377668f52aa1278847eec32825593f5fc89ab3b8d6e753077f2
5
5
  SHA512:
6
- metadata.gz: 0ad3c2bdb1f411f2057005ce9b094dc20c4d3c2d1e3ad1a514ee49d82f06893b17302a32ba0a5d93ca95d7f75b2490e5dcb910ad7f3c36cfe2d5008d59702f81
7
- data.tar.gz: ebb881feb0881ae550613bca2f35870eaa55698e007af152e2500e66130ba232619b81c364c1c2f84082ab1fdfdb9a5382716dfa92c98e3d483f6275f85d262e
6
+ metadata.gz: 17139e9c9797161b1a4ed80cf67f06c5c6f50d893d1754abf5a7b4c9a12c0a49b0a66b2ead187e2186e3676bc1a881ec7926df912a1b8091eb0d90c397829f8a
7
+ data.tar.gz: 393b389eb3fd57dd2a4542c5db1661e3ded1d6df033e9c53b7a080d1a18ca31d87ff4c4167aaa19dd6a83623e7a8fc461219aab7370373962e9d63bb172916d8
data/README.md CHANGED
@@ -16,7 +16,8 @@ Teardown tool for mobile app(ipa/apk), analysis metedata like version, name, ico
16
16
 
17
17
  ## Configure
18
18
 
19
- ```+----------------------------------------------------------------------------------------+
19
+ ```
20
+ +----------------------------------------------------------------------------------------+
20
21
  | app_info |
21
22
  +----------------------------------------------------------------------------------------+
22
23
  | Parse and dump mobile app(ipa/apk) metedata. |
@@ -26,23 +27,33 @@ Teardown tool for mobile app(ipa/apk), analysis metedata like version, name, ico
26
27
  | Created by icyleaf <icyleaf.cn@gmail.com> |
27
28
  +----------------------------------------------------------------------------------------+
28
29
 
29
- +------+-------------------------------------------------+---------------+---------+
30
- | app_info Options |
31
- +------+-------------------------------------------------+---------------+---------+
32
- | Key | Description | Env Var | Default |
33
- +------+-------------------------------------------------+---------------+---------+
34
- | file | Path to your ipa/apk file. Optional if you use | APP_INFO_FILE | |
35
- | | the `gym`, `ipa` or `xcodebuild` action. | | |
36
- +------+-------------------------------------------------+---------------+---------+
37
-
38
- +----------+---------------------------------+
39
- | app_info Output Variables |
40
- +----------+---------------------------------+
41
- | Key | Description |
42
- +----------+---------------------------------+
43
- | APP_INFO | the json formated app info data |
44
- +----------+---------------------------------+
45
- Access the output values using `lane_context[SharedValues::VARIABLE_NAME]`
30
+ +-------+---------------------------------+----------------+---------+
31
+ | app_info Options |
32
+ +-------+---------------------------------+----------------+---------+
33
+ | Key | Description | Env Var(s) | Default |
34
+ +-------+---------------------------------+----------------+---------+
35
+ | file | Path to your ipa/apk file. | APP_INFO_FILE | |
36
+ | | Optional if you use the `gym`, | | |
37
+ | | `ipa` or `xcodebuild` action. | | |
38
+ | clean | Clean cache files to reduce | APP_INFO_CLEAN | true |
39
+ | | disk size | | |
40
+ +-------+---------------------------------+----------------+---------+
41
+ * = default value is dependent on the user's system
42
+
43
+ +----------+-----------------------------------------+
44
+ | app_info Output Variables |
45
+ +----------+-----------------------------------------+
46
+ | Key | Description |
47
+ +----------+-----------------------------------------+
48
+ | APP_INFO | The JSON formated metadata of given app |
49
+ +----------+-----------------------------------------+
50
+ Access the output values using `lane_context[SharedValues::APP_INFO]`
51
+
52
+ +-----------------------------------------------+
53
+ | app_info Return Value |
54
+ +-----------------------------------------------+
55
+ | Returns a Hash formated metadata of given app |
56
+ +-----------------------------------------------+
46
57
  ```
47
58
 
48
59
  ## Example
@@ -53,26 +64,30 @@ Check out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plu
53
64
 
54
65
  ### iOS
55
66
 
56
- ```bash
57
- $ bundle exec fastlane action app_info
67
+ ```text
58
68
  +-----------------------------+-------------------------------------------------+
59
- | Summary for app_info 0.1.0 |
69
+ | Summary for app_info 0.5.0 |
60
70
  +-----------------------------+-------------------------------------------------+
61
- | Name | iOS Team Provisioning Profile: * |
71
+ | OS | iOS |
72
+ | Name | AppInfoDemo |
62
73
  | ReleaseVersion | 1.2.3 |
63
74
  | BuildVersion | 5 |
64
75
  | Identifier | com.icyleaf.AppInfoDemo |
65
- | Os | iOS |
66
- | AppIDName | XC Wildcard |
67
- | ApplicationIdentifierPrefix | ********** |
68
- | CreationDate | 2016-07-27 17:44:49 +0800 |
76
+ | Size | 41.70 KB |
77
+ | DeviceType | iPhone |
78
+ | Releasetype | AdHoc |
79
+ | Archs (2) | armv7 |
80
+ | | arm64 |
81
+ | Appidname | XC Wildcard |
82
+ | Applicationidentifierprefix | 5PJA6N5A3B |
83
+ | Creationdate | 2016-07-27 17:44:49 +0800 |
69
84
  | Platform | iOS |
70
- | Entitlements (4) | keychain-access-groups: ["**********.*"] |
85
+ | Entitlements (4) | keychain-access-groups: ["5PJA6N5A3B.*"] |
71
86
  | | get-task-allow: true |
72
- | | application-identifier: **********.* |
73
- | | com.apple.developer.team-identifier: ********** |
74
- | ExpirationDate | 2017-07-27 17:44:49 +0800 |
75
- | ProvisionedDevices (2) | **************************************** |
87
+ | | application-identifier: 5PJA6N5A3B.* |
88
+ | | com.apple.developer.team-identifier: 5PJA6N5A3B |
89
+ | Expirationdate | 2017-07-27 17:44:49 +0800 |
90
+ | Provisioneddevices (100) | 18cf53cddee60c52f9c97b1521e7cbf8342628da |
76
91
  | | **************************************** |
77
92
  | TeamIdentifier | ********** |
78
93
  | TeamName | EWS Inc |
@@ -84,16 +99,25 @@ $ bundle exec fastlane action app_info
84
99
 
85
100
  ### Android
86
101
 
87
- ```bash
88
- +----------------+-------------------------+
89
- | Summary for app_info 0.1.0 |
90
- +----------------+-------------------------+
91
- | Name | AppInfoDemo |
92
- | ReleaseVersion | 1.2.3 |
93
- | BuildVersion | 5 |
94
- | Identifier | com.icyleaf.appinfodemo |
95
- | Os | Android |
96
- +----------------+-------------------------+
102
+ ```text
103
+ +--------------------+------------------------------+
104
+ | Summary for app_info 0.5.0 |
105
+ +--------------------+------------------------------+
106
+ | OS | Android |
107
+ | Name | AppInfoDemo |
108
+ | ReleaseVersion | 1.2.3 |
109
+ | BuildVersion | 5 |
110
+ | Identifier | com.icyleaf.appinfodemo |
111
+ | Size | 2.93 MB |
112
+ | DeviceType | Phone |
113
+ | Minsdkversion | 14 |
114
+ | Targetsdkversion | 29 |
115
+ | Signatures | META-INF/CERT.RSA |
116
+ | Certificateissuers | CN:Android Debug O:Android |
117
+ | Usepermissions (2) | android.permission.BLUETOOTH |
118
+ | | android.permission.CAMERA |
119
+ | Usefeatures | |
120
+ +--------------------+------------------------------+
97
121
  ```
98
122
 
99
123
  ## Run tests for this plugin
@@ -9,66 +9,25 @@ module Fastlane
9
9
 
10
10
  class AppInfoAction < Action
11
11
  def self.run(params)
12
- @file = params.fetch(:file)
13
- UI.user_error! 'You have to either pass an ipa or an apk file' unless @file
14
- @file = File.expand_path(@file)
15
- @app = ::AppInfo.parse(@file)
16
-
17
- print_table!
18
-
19
- # Store shared value
20
- Helper::AppInfoHelper.store_sharedvalue(:APP_INFO, Helper::AppInfoHelper.app_to_json(@app))
21
- end
22
-
23
- def self.print_table!
24
- params = {}
25
- params[:rows] = table_columns
26
- params[:title] = "Summary for app_info #{AppInfo::VERSION}".green
27
-
28
- puts ""
29
- puts Terminal::Table.new(params)
30
- puts ""
31
- end
32
-
33
- def self.table_columns
34
- common_columns.merge(extra_columns)
12
+ file = params.fetch(:file)
13
+ UI.user_error! 'You have to either pass an ipa or an apk file' unless file
14
+ file = File.expand_path(file)
15
+ app = ::AppInfo.parse(file)
16
+ raw = Helper::AppInfoHelper.raw_data(app)
17
+
18
+ UI.verbose "Raw params: #{raw}"
19
+ print_table(raw)
20
+ app.clear! if params.fetch(:clean)
21
+
22
+ Helper::AppInfoHelper.store_sharedvalue(:APP_INFO, JSON.dump(raw))
23
+ raw
35
24
  end
36
25
 
37
- def self.common_columns
38
- Helper::AppInfoHelper.common_columns.each_with_object({}) do |key, hash|
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)
42
- end
43
- end
44
-
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
- {}
71
- end
26
+ def self.print_table(raw)
27
+ puts Terminal::Table.new(
28
+ title: "Summary for app_info #{AppInfo::VERSION}".green,
29
+ rows: Helper::AppInfoHelper.hash_to_columns(raw)
30
+ )
72
31
  end
73
32
 
74
33
  def self.description
@@ -83,9 +42,13 @@ module Fastlane
83
42
  "Teardown tool for mobile app(ipa/apk), analysis metedata like version, name, icon etc."
84
43
  end
85
44
 
45
+ def self.return_value
46
+ "Returns a Hash formated metadata of given app"
47
+ end
48
+
86
49
  def self.output
87
50
  [
88
- [SharedValues::APP_INFO.to_s, 'the json formated app info data']
51
+ [SharedValues::APP_INFO.to_s, 'The JSON formated metadata of given app']
89
52
  ]
90
53
  end
91
54
 
@@ -98,7 +61,12 @@ module Fastlane
98
61
  optional: true,
99
62
  verify_block: proc do |value|
100
63
  raise "Couldn't find app file".red unless File.exist?(value)
101
- end)
64
+ end),
65
+ FastlaneCore::ConfigItem.new(key: :clean,
66
+ env_name: 'APP_INFO_CLEAN',
67
+ description: 'Clean cache files to reduce disk size',
68
+ default_value: true,
69
+ optional: true)
102
70
  ]
103
71
  end
104
72
 
@@ -3,6 +3,60 @@ require 'json'
3
3
  module Fastlane
4
4
  module Helper
5
5
  class AppInfoHelper
6
+ COMMON_COLUMNS = %w[os name release_version build_version identifier size device_type]
7
+
8
+ def self.hash_to_columns(raw)
9
+ raw.each_with_object({}) do |(key, value), obj|
10
+ next if value.respond_to?(:empty?) && value.empty?
11
+
12
+ name = upcase(column_name(key, value))
13
+ obj[name] = object_to_column(value)
14
+ end
15
+ end
16
+
17
+ def self.raw_data(app)
18
+ common_columns(app).merge(platform_columns(app))
19
+ end
20
+
21
+ def self.platform_columns(app)
22
+ obj = {}
23
+
24
+ if app.os == 'iOS'
25
+ obj[upcase('release_type')] = app.release_type
26
+ obj[upcase('archs')] = app.archs
27
+ return {} unless app.mobileprovision && !app.mobileprovision.empty?
28
+
29
+ app.mobileprovision.mobileprovision.each do |key, value|
30
+ next if key == 'DeveloperCertificates' || key == 'Name' || key == 'DER-Encoded-Profile'
31
+
32
+ obj[upcase(key)] = value
33
+ end
34
+ elsif app.os == 'Android'
35
+ signs = app.signs.map { |f| f.path }
36
+ issuers = android_certificate_issuer(app)
37
+ permissions = app.use_permissions
38
+ features = app.use_features
39
+
40
+ obj = {
41
+ "MinSDKVersion" => app.min_sdk_version,
42
+ "TargetSDKVersion" => app.target_sdk_version,
43
+ "Signatures" => signs,
44
+ "CertificateIssuers" => issuers,
45
+ "UsePermissions" => permissions,
46
+ "UseFeatures" => features,
47
+ }
48
+ end
49
+
50
+ obj
51
+ end
52
+
53
+ def self.common_columns(app)
54
+ COMMON_COLUMNS.each_with_object({}) do |key, hash|
55
+ value = key == 'size' ? app.size(true) : app.send(key.to_sym)
56
+ hash[upcase(key)] = value
57
+ end
58
+ end
59
+
6
60
  def self.object_to_column(object)
7
61
  case object
8
62
  when Hash
@@ -25,32 +79,8 @@ module Fastlane
25
79
  end
26
80
  end
27
81
 
28
- def self.common_columns
29
- %w[name release_version build_version identifier os size]
30
- end
31
-
32
- def self.app_to_json(app)
33
- data = common_columns.each_with_object({}) do |key, obj|
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
37
- end
38
-
39
- if app.os == 'iOS' && app.mobileprovision && !app.mobileprovision.empty?
40
- app.mobileprovision.mobileprovision.each do |key, value|
41
- next if key == 'DeveloperCertificates'
42
- data[key] = value
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
51
- end
52
-
53
- JSON.dump(data)
82
+ def self.upcase(key)
83
+ key == 'os' ? key.upcase : key.split('_').map(&:capitalize).join('')
54
84
  end
55
85
 
56
86
  def self.android_certificate_issuer(app)
@@ -1,5 +1,5 @@
1
1
  module Fastlane
2
2
  module AppInfo
3
- VERSION = '0.3.0'.freeze
3
+ VERSION = '0.5.1'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fastlane-plugin-app_info
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - icyleaf
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-18 00:00:00.000000000 Z
11
+ date: 2021-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: app-info
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 2.5.2
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: 1.1.0
22
+ version: '3'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 2.5.2
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: 1.1.0
32
+ version: '3'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: bundler
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -108,7 +114,7 @@ dependencies:
108
114
  - - ">="
109
115
  - !ruby/object:Gem::Version
110
116
  version: '0'
111
- description:
117
+ description:
112
118
  email: icyleaf.cn@gmail.com
113
119
  executables: []
114
120
  extensions: []
@@ -124,7 +130,7 @@ homepage: https://github.com/icyleaf/fastlane-plugin-app_info
124
130
  licenses:
125
131
  - MIT
126
132
  metadata: {}
127
- post_install_message:
133
+ post_install_message:
128
134
  rdoc_options: []
129
135
  require_paths:
130
136
  - lib
@@ -139,8 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
145
  - !ruby/object:Gem::Version
140
146
  version: '0'
141
147
  requirements: []
142
- rubygems_version: 3.0.3
143
- signing_key:
148
+ rubygems_version: 3.1.4
149
+ signing_key:
144
150
  specification_version: 4
145
151
  summary: Teardown tool for mobile app(ipa/apk), analysis metedata like version, name,
146
152
  icon etc.