fastlane-plugin-app_info 0.2.0 → 0.5.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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ec6c3be09ebd56b7d1a41d93d2db25dc1621342b1fb4e377340d7207622730f2
|
4
|
+
data.tar.gz: 4f4c9874d37aca154f5fee52723a43959ecb3a49c7592cf82064d1e271750924
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04604c168bf9f9afc77953948a96ef86facce874432c9985bd179dd418d351f42ebaab8b460c769966291ca66e84480197c66b595e307be27652a08b5a56a28b
|
7
|
+
data.tar.gz: 58695d47494cedc66f5f412fc31c4c7a343fd158fad29f5216528e65d93a5a1b8112039342eb3885f9ac3787c5208988707bcdc8a34b6ef17499a5b9a521ba3d
|
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
|
-
|
|
31
|
-
|
32
|
-
| Key
|
33
|
-
|
34
|
-
| file
|
35
|
-
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
|
44
|
-
|
45
|
-
|
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
|
-
```
|
57
|
-
$ bundle exec fastlane action app_info
|
67
|
+
```text
|
58
68
|
+-----------------------------+-------------------------------------------------+
|
59
|
-
| Summary for app_info 0.
|
69
|
+
| Summary for app_info 0.5.0 |
|
60
70
|
+-----------------------------+-------------------------------------------------+
|
61
|
-
|
|
71
|
+
| OS | iOS |
|
72
|
+
| Name | AppInfoDemo |
|
62
73
|
| ReleaseVersion | 1.2.3 |
|
63
74
|
| BuildVersion | 5 |
|
64
75
|
| Identifier | com.icyleaf.AppInfoDemo |
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
|
|
75
|
-
|
|
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
|
-
```
|
88
|
-
|
89
|
-
|
|
90
|
-
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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,47 +9,25 @@ module Fastlane
|
|
9
9
|
|
10
10
|
class AppInfoAction < Action
|
11
11
|
def self.run(params)
|
12
|
-
|
13
|
-
UI.user_error! 'You have to either pass an ipa or an apk file' unless
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
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(ios_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.
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
|
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)
|
52
|
-
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
|
+
)
|
53
31
|
end
|
54
32
|
|
55
33
|
def self.description
|
@@ -64,9 +42,13 @@ module Fastlane
|
|
64
42
|
"Teardown tool for mobile app(ipa/apk), analysis metedata like version, name, icon etc."
|
65
43
|
end
|
66
44
|
|
45
|
+
def self.return_value
|
46
|
+
"Returns a Hash formated metadata of given app"
|
47
|
+
end
|
48
|
+
|
67
49
|
def self.output
|
68
50
|
[
|
69
|
-
[SharedValues::APP_INFO.to_s, '
|
51
|
+
[SharedValues::APP_INFO.to_s, 'The JSON formated metadata of given app']
|
70
52
|
]
|
71
53
|
end
|
72
54
|
|
@@ -79,7 +61,12 @@ module Fastlane
|
|
79
61
|
optional: true,
|
80
62
|
verify_block: proc do |value|
|
81
63
|
raise "Couldn't find app file".red unless File.exist?(value)
|
82
|
-
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)
|
83
70
|
]
|
84
71
|
end
|
85
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[key] = value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
6
60
|
def self.object_to_column(object)
|
7
61
|
case object
|
8
62
|
when Hash
|
@@ -25,24 +79,17 @@ module Fastlane
|
|
25
79
|
end
|
26
80
|
end
|
27
81
|
|
28
|
-
def self.
|
29
|
-
|
82
|
+
def self.upcase(key)
|
83
|
+
key == 'os' ? key.upcase : key.split('_').map(&:capitalize).join('')
|
30
84
|
end
|
31
85
|
|
32
|
-
def self.
|
33
|
-
|
34
|
-
|
35
|
-
obj[
|
36
|
-
|
37
|
-
|
38
|
-
if app.os == 'iOS' && app.mobileprovision && !app.mobileprovision.empty?
|
39
|
-
app.mobileprovision.mobileprovision.each do |key, value|
|
40
|
-
next if key == 'DeveloperCertificates'
|
41
|
-
data[key] = value
|
42
|
-
end
|
86
|
+
def self.android_certificate_issuer(app)
|
87
|
+
app.certificates.each_with_object([]) do |cert, obj|
|
88
|
+
issuer = cert.certificate.issuer.to_a.map {|c| [c[0], c[1]] }.flatten.each_slice(2).to_h
|
89
|
+
obj << issuer.select{ |k, _| ['CN', 'OU', 'O'].include?(k) }
|
90
|
+
.map {|k, v| "#{k}:#{v}"}
|
91
|
+
.join(' ')
|
43
92
|
end
|
44
|
-
|
45
|
-
JSON.dump(data)
|
46
93
|
end
|
47
94
|
|
48
95
|
def self.store_sharedvalue(key, value)
|
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.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- icyleaf
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-07-08 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:
|
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:
|
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,9 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
139
145
|
- !ruby/object:Gem::Version
|
140
146
|
version: '0'
|
141
147
|
requirements: []
|
142
|
-
|
143
|
-
|
144
|
-
signing_key:
|
148
|
+
rubygems_version: 3.1.4
|
149
|
+
signing_key:
|
145
150
|
specification_version: 4
|
146
151
|
summary: Teardown tool for mobile app(ipa/apk), analysis metedata like version, name,
|
147
152
|
icon etc.
|