danger-apkstats 0.1.0 → 0.3.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: 06da284025d85c4baf756df842fef7ed035bbc6a4b51e3869b03df48f851b480
4
- data.tar.gz: ed4436f89c1b65211bd338aa4e48095df59c7f518c69a185836cdde7655d2149
3
+ metadata.gz: 7e3766086cf1f908f3a553259ce56b77077cb25af31cb6f1d2c36c565d4fc62a
4
+ data.tar.gz: a8592f39aa1288898076e59e0586c3ac941a92294d65123eaad05236e9d78588
5
5
  SHA512:
6
- metadata.gz: d67745379004649774230e918514f09ac792050190540f23efab90c29308b9b3fe098884288c975f2c74a37e1aab2d9434881224a4e9682a0be1bf58859a17a4
7
- data.tar.gz: 869be5736265bffec15b3468846b346a6a45c3b4796e7a80b4cf1448845009f22d9c6e5fb12bebc4c4d7a6e363bffa62a386cd4be18b39eeeeb9c31de139cd8c
6
+ metadata.gz: 0a93c60400f8692df2701b939cd840d740990da627c530e015ef4012f652de3770d10fb339fe1db7795fb313cbfdd2854c2ac7b5e0580b69add6995e1d1ac980
7
+ data.tar.gz: b77a1fa1c2c6cff74fdeeba07b6e4d41db76cda9b691f2d702dfdd69138d15a75fcb7897cbe4a8371de9e55ed984b8ea41389efe32fbb83c10498c247f661090
@@ -0,0 +1,3 @@
1
+
2
+ d56f5187479451eabf01fb78af6dfcb131a6481e
3
+ 24333f8a63b6825ea9c5514f83c2829b004d1fee
@@ -0,0 +1,104 @@
1
+ version: 2.1
2
+
3
+ executors:
4
+ base:
5
+ docker:
6
+ - image: circleci/android:api-29
7
+ working_directory: ~/workspace
8
+ environment:
9
+ ANDROID_SDK_ROOT: /home/circleci/sdk
10
+ APKANALYZER_PATH: /home/circleci/sdk/cmdline-tools/tools/bin/apkanalyzer
11
+
12
+ ruby:
13
+ docker:
14
+ - image: circleci/ruby:2.7.1
15
+ working_directory: ~/workspace
16
+
17
+ commands:
18
+ install-android-sdk:
19
+ parameters:
20
+ zip-version:
21
+ type: string
22
+ description: the version of the zip archive
23
+ build-tools:
24
+ type: string
25
+ steps:
26
+ - restore_cache:
27
+ key: v1-android-sdk-{{ arch }}-<< parameters.zip-version >>-<< parameters.build-tools >>
28
+ - run: |
29
+ version="<< parameters.zip-version >>"
30
+ if [ "$(cat $ANDROID_SDK_ROOT/.sdk_tools_version || echo)" != "$version" ]; then
31
+ rm -fr $ANDROID_SDK_ROOT || :
32
+ mkdir -p $ANDROID_SDK_ROOT/licenses $ANDROID_SDK_ROOT/cmdline-tools
33
+ curl -o sdk-tools-linux.zip "https://dl.google.com/android/repository/commandlinetools-linux-${version}_latest.zip"
34
+ unzip "sdk-tools-linux.zip" -d $ANDROID_SDK_ROOT/cmdline-tools
35
+ echo "$version" > $ANDROID_SDK_ROOT/.sdk_tools_version
36
+ fi
37
+ mkdir -p $ANDROID_SDK_ROOT/licenses
38
+ cp .circleci/android-sdk-license $ANDROID_SDK_ROOT/licenses/
39
+ $ANDROID_SDK_ROOT/cmdline-tools/tools/bin/sdkmanager "build-tools;<< parameters.build-tools >>"
40
+ - save_cache:
41
+ key: v1-android-sdk-{{ arch }}-<< parameters.zip-version >>-<< parameters.build-tools >>
42
+ paths:
43
+ - ~/sdk
44
+ install-ruby:
45
+ parameters:
46
+ ruby-version:
47
+ type: string
48
+ steps:
49
+ - run: |
50
+ sudo apt-get update && \
51
+ cd /tmp && wget -O ruby-install-0.6.1.tar.gz https://github.com/postmodern/ruby-install/archive/v0.6.1.tar.gz && \
52
+ tar -xzvf ruby-install-0.6.1.tar.gz && \
53
+ cd ruby-install-0.6.1 && \
54
+ sudo make install && \
55
+ ruby-install --cleanup ruby << parameters.ruby-version >> && \
56
+ rm -r /tmp/ruby-install-* && \
57
+ sudo rm -rf /var/lib/apt/lists/*
58
+
59
+ echo "export PATH=${HOME}/.rubies/ruby-<< parameters.ruby-version >>/bin:\${PATH}" >> $BASH_ENV
60
+ - run: ruby --version
61
+ bundle-install:
62
+ steps:
63
+ - restore_cache:
64
+ key: v1-bundle-{{ arch }}-{{ checksum "./Gemfile.lock" }}
65
+ - run: gem install bundler -v 2.1.4
66
+ - run: bundle install --path=vendor/bundle
67
+ - save_cache:
68
+ key: v1-bundle-{{ arch }}-{{ checksum "./Gemfile.lock" }}
69
+ paths:
70
+ - vendor/bundle
71
+
72
+ jobs:
73
+ lint:
74
+ executor: ruby
75
+ steps:
76
+ - checkout
77
+ - bundle-install
78
+ - run: bundle exec rake rubocop
79
+
80
+ test:
81
+ parameters:
82
+ ruby_version:
83
+ type: string
84
+ description: 'Ruby version to be used'
85
+ executor: base
86
+
87
+ steps:
88
+ - checkout
89
+ - install-ruby:
90
+ ruby-version: << parameters.ruby_version >>
91
+ - install-android-sdk:
92
+ zip-version: "6514223"
93
+ build-tools: 29.0.2
94
+ - bundle-install
95
+ - run: bundle exec rake specs spec_docs
96
+
97
+ workflows:
98
+ materix_test:
99
+ jobs:
100
+ - lint
101
+ - test:
102
+ matrix:
103
+ parameters:
104
+ ruby_version: [2.5.8, 2.6.6, 2.7.1]
data/.gitignore CHANGED
@@ -4,3 +4,4 @@ pkg
4
4
  .yardoc
5
5
  **/vendor/bundle/
6
6
  *.gem
7
+ .bundle/
@@ -7,7 +7,7 @@ AllCops:
7
7
  - 'vendor/**/*'
8
8
  - 'spec/fixtures/**/*'
9
9
  - 'tmp/**/*'
10
- TargetRubyVersion: 2.3.7
10
+ TargetRubyVersion: 2.7.1
11
11
 
12
12
  Metrics/ModuleLength:
13
13
  Exclude:
@@ -22,20 +22,16 @@ Style/StringLiterals:
22
22
  Style/ClassCheck:
23
23
  EnforcedStyle: kind_of?
24
24
 
25
- # It's better to be more explicit about the type
26
- Style/BracesAroundHashParameters:
27
- Enabled: false
28
-
29
25
  # specs sometimes have useless assignments, which is fine
30
26
  Lint/UselessAssignment:
31
27
  Exclude:
32
28
  - '**/spec/**/*'
33
29
 
34
30
  # We could potentially enable the 2 below:
35
- Layout/IndentHash:
31
+ Layout/FirstHashElementIndentation:
36
32
  Enabled: false
37
33
 
38
- Layout/AlignHash:
34
+ Layout/HashAlignment:
39
35
  Enabled: false
40
36
 
41
37
  # HoundCI doesn't like this rule
@@ -85,7 +81,7 @@ Metrics/CyclomaticComplexity:
85
81
  Max: 17
86
82
 
87
83
  # Configuration parameters: AllowURI, URISchemes.
88
- Metrics/LineLength:
84
+ Layout/LineLength:
89
85
  Max: 370
90
86
 
91
87
  # Configuration parameters: CountKeywordArgs.
@@ -136,16 +132,16 @@ Metrics/BlockLength:
136
132
  Style/MixinGrouping:
137
133
  Enabled: false
138
134
 
139
- Style/FileName:
135
+ Naming/FileName:
140
136
  Enabled: false
141
137
 
142
- Layout/IndentHeredoc:
138
+ Layout/HeredocIndentation:
143
139
  Enabled: false
144
140
 
145
141
  Style/SpecialGlobalVars:
146
142
  Enabled: false
147
143
 
148
- PercentLiteralDelimiters:
144
+ Department/PercentLiteralDelimiters:
149
145
  PreferredDelimiters:
150
146
  "%": ()
151
147
  "%i": ()
@@ -167,4 +163,43 @@ Style/TrailingCommaInArrayLiteral:
167
163
  Enabled: false
168
164
 
169
165
  Style/TrailingCommaInHashLiteral:
170
- Enabled: false
166
+ Enabled: false
167
+
168
+ Layout/EmptyLinesAroundAttributeAccessor:
169
+ Enabled: true
170
+
171
+ Layout/SpaceAroundMethodCallOperator:
172
+ Enabled: false
173
+
174
+ Lint/DeprecatedOpenSSLConstant:
175
+ Enabled: false
176
+
177
+ Lint/MixedRegexpCaptureTypes:
178
+ Enabled: false
179
+
180
+ Lint/RaiseException:
181
+ Enabled: true
182
+
183
+ Lint/StructNewOverride:
184
+ Enabled: true
185
+
186
+ Style/ExponentialNotation:
187
+ Enabled: false
188
+
189
+ Style/HashEachMethods:
190
+ Enabled: true
191
+
192
+ Style/HashTransformKeys:
193
+ Enabled: true
194
+
195
+ Style/HashTransformValues:
196
+ Enabled: true
197
+
198
+ Style/RedundantRegexpCharacterClass:
199
+ Enabled: true
200
+
201
+ Style/RedundantRegexpEscape:
202
+ Enabled: true
203
+
204
+ Style/SlicingWithRange:
205
+ Enabled: true
@@ -11,5 +11,7 @@ message(apkstats.non_required_features)
11
11
  message(apkstats.permissions)
12
12
  message(apkstats.min_sdk)
13
13
  message(apkstats.target_sdk)
14
+ message("#{apkstats.reference_count}")
15
+ message("#{apkstats.dex_count}")
14
16
 
15
17
  apkstats.compare_with('/spec/fixture/app-other5.apk', do_report: true)
@@ -1,47 +1,49 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- danger-apkstats (0.1.0)
4
+ danger-apkstats (0.3.1)
5
5
  danger-plugin-api (~> 1.0)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- addressable (2.5.2)
11
- public_suffix (>= 2.0.2, < 4.0)
12
- ast (2.4.0)
13
- claide (1.0.2)
10
+ addressable (2.7.0)
11
+ public_suffix (>= 2.0.2, < 5.0)
12
+ ast (2.4.1)
13
+ claide (1.0.3)
14
14
  claide-plugins (0.9.2)
15
15
  cork
16
16
  nap
17
17
  open4 (~> 1.3)
18
- coderay (1.1.2)
18
+ coderay (1.1.3)
19
19
  colored2 (3.1.2)
20
20
  cork (0.3.0)
21
21
  colored2 (~> 3.1)
22
- danger (5.6.4)
22
+ danger (8.0.1)
23
23
  claide (~> 1.0)
24
24
  claide-plugins (>= 0.9.2)
25
25
  colored2 (~> 3.1)
26
26
  cork (~> 0.1)
27
- faraday (~> 0.9)
28
- faraday-http-cache (~> 1.0)
29
- git (~> 1)
30
- kramdown (~> 1.5)
27
+ faraday (>= 0.9.0, < 2.0)
28
+ faraday-http-cache (~> 2.0)
29
+ git (~> 1.7)
30
+ kramdown (~> 2.0)
31
+ kramdown-parser-gfm (~> 1.0)
31
32
  no_proxy_fix
32
33
  octokit (~> 4.7)
33
34
  terminal-table (~> 1)
34
35
  danger-plugin-api (1.0.0)
35
36
  danger (> 2.0)
36
37
  diff-lcs (1.3)
37
- faraday (0.15.2)
38
+ faraday (1.0.1)
38
39
  multipart-post (>= 1.2, < 3)
39
- faraday-http-cache (1.3.1)
40
- faraday (~> 0.8)
41
- ffi (1.9.25)
40
+ faraday-http-cache (2.2.0)
41
+ faraday (>= 0.8)
42
+ ffi (1.13.1)
42
43
  formatador (0.2.5)
43
- git (1.4.0)
44
- guard (2.14.2)
44
+ git (1.7.0)
45
+ rchardet (~> 1.8)
46
+ guard (2.16.2)
45
47
  formatador (>= 0.2.4)
46
48
  listen (>= 2.7, < 4.0)
47
49
  lumberjack (>= 1.0.12, < 2.0)
@@ -55,82 +57,89 @@ GEM
55
57
  guard (~> 2.1)
56
58
  guard-compat (~> 1.1)
57
59
  rspec (>= 2.99.0, < 4.0)
58
- jaro_winkler (1.5.1)
59
- kramdown (1.17.0)
60
+ kramdown (2.3.0)
61
+ rexml
62
+ kramdown-parser-gfm (1.1.0)
63
+ kramdown (~> 2.0)
60
64
  listen (3.0.7)
61
65
  rb-fsevent (>= 0.9.3)
62
66
  rb-inotify (>= 0.9.7)
63
- lumberjack (1.0.13)
64
- method_source (0.9.0)
65
- multipart-post (2.0.0)
67
+ lumberjack (1.2.5)
68
+ method_source (1.0.0)
69
+ multipart-post (2.1.1)
66
70
  nap (1.1.0)
67
71
  nenv (0.3.0)
68
72
  no_proxy_fix (0.1.2)
69
- notiffany (0.1.1)
73
+ notiffany (0.1.3)
70
74
  nenv (~> 0.1)
71
75
  shellany (~> 0.0)
72
- octokit (4.9.0)
76
+ octokit (4.18.0)
77
+ faraday (>= 0.9)
73
78
  sawyer (~> 0.8.0, >= 0.5.3)
74
79
  open4 (1.3.4)
75
- parallel (1.12.1)
76
- parser (2.5.1.2)
80
+ parallel (1.19.1)
81
+ parser (2.7.1.3)
77
82
  ast (~> 2.4.0)
78
- powerpack (0.1.2)
79
- pry (0.11.3)
80
- coderay (~> 1.1.0)
81
- method_source (~> 0.9.0)
82
- public_suffix (3.0.2)
83
+ pry (0.13.1)
84
+ coderay (~> 1.1)
85
+ method_source (~> 1.0)
86
+ public_suffix (4.0.5)
83
87
  rainbow (3.0.0)
84
- rake (10.5.0)
85
- rb-fsevent (0.10.3)
86
- rb-inotify (0.9.10)
87
- ffi (>= 0.5.0, < 2)
88
- rspec (3.7.0)
89
- rspec-core (~> 3.7.0)
90
- rspec-expectations (~> 3.7.0)
91
- rspec-mocks (~> 3.7.0)
92
- rspec-core (3.7.1)
93
- rspec-support (~> 3.7.0)
94
- rspec-expectations (3.7.0)
88
+ rake (13.0.1)
89
+ rb-fsevent (0.10.4)
90
+ rb-inotify (0.10.1)
91
+ ffi (~> 1.0)
92
+ rchardet (1.8.0)
93
+ regexp_parser (1.7.1)
94
+ rexml (3.2.4)
95
+ rspec (3.9.0)
96
+ rspec-core (~> 3.9.0)
97
+ rspec-expectations (~> 3.9.0)
98
+ rspec-mocks (~> 3.9.0)
99
+ rspec-core (3.9.2)
100
+ rspec-support (~> 3.9.3)
101
+ rspec-expectations (3.9.2)
95
102
  diff-lcs (>= 1.2.0, < 2.0)
96
- rspec-support (~> 3.7.0)
97
- rspec-mocks (3.7.0)
103
+ rspec-support (~> 3.9.0)
104
+ rspec-mocks (3.9.1)
98
105
  diff-lcs (>= 1.2.0, < 2.0)
99
- rspec-support (~> 3.7.0)
100
- rspec-support (3.7.1)
101
- rubocop (0.58.2)
102
- jaro_winkler (~> 1.5.1)
106
+ rspec-support (~> 3.9.0)
107
+ rspec-support (3.9.3)
108
+ rubocop (0.85.1)
103
109
  parallel (~> 1.10)
104
- parser (>= 2.5, != 2.5.1.1)
105
- powerpack (~> 0.1)
110
+ parser (>= 2.7.0.1)
106
111
  rainbow (>= 2.2.2, < 4.0)
112
+ regexp_parser (>= 1.7)
113
+ rexml
114
+ rubocop-ast (>= 0.0.3)
107
115
  ruby-progressbar (~> 1.7)
108
- unicode-display_width (~> 1.0, >= 1.0.1)
109
- ruby-progressbar (1.9.0)
110
- sawyer (0.8.1)
111
- addressable (>= 2.3.5, < 2.6)
112
- faraday (~> 0.8, < 1.0)
116
+ unicode-display_width (>= 1.4.0, < 2.0)
117
+ rubocop-ast (0.0.3)
118
+ parser (>= 2.7.0.1)
119
+ ruby-progressbar (1.10.1)
120
+ sawyer (0.8.2)
121
+ addressable (>= 2.3.5)
122
+ faraday (> 0.8, < 2.0)
113
123
  shellany (0.0.1)
114
124
  terminal-table (1.8.0)
115
125
  unicode-display_width (~> 1.1, >= 1.1.1)
116
- thor (0.20.0)
117
- unicode-display_width (1.4.0)
118
- yard (0.9.15)
126
+ thor (1.0.1)
127
+ unicode-display_width (1.7.0)
128
+ yard (0.9.25)
119
129
 
120
130
  PLATFORMS
121
131
  ruby
122
132
 
123
133
  DEPENDENCIES
124
- bundler (~> 1.3)
125
134
  danger-apkstats!
126
135
  guard (~> 2.14)
127
136
  guard-rspec (~> 4.7)
128
137
  listen (= 3.0.7)
129
138
  pry
130
- rake (~> 10.0)
139
+ rake (~> 13.0)
131
140
  rspec (~> 3.4)
132
141
  rubocop
133
142
  yard
134
143
 
135
144
  BUNDLED WITH
136
- 1.16.1
145
+ 2.1.4
@@ -1,4 +1,4 @@
1
- Copyright (c) 2018 Jumpei Matsuda <jmatsu.drm@gmail.com>
1
+ Copyright (c) 2018-2020 Jumpei Matsuda <jmatsu.drm@gmail.com>
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -1,23 +1,35 @@
1
- [![Build Status](https://travis-ci.com/jmatsu/danger-apkstats.svg?branch=master)](https://travis-ci.com/jmatsu/danger-apkstats) [![Gem Version](https://badge.fury.io/rb/danger-apkstats.svg)](https://badge.fury.io/rb/danger-apkstats)
1
+ [![jmatsu](https://circleci.com/gh/jmatsu/danger-apkstats.svg?style=shield)](https://circleci.com/gh/jmatsu/danger-apkstats) [![Gem Version](https://badge.fury.io/rb/danger-apkstats.svg)](https://badge.fury.io/rb/danger-apkstats)
2
2
 
3
3
  # danger-apkstats
4
4
 
5
- A description of danger-apkstats.
5
+ This is a plugin of [Danger](https://github.com/danger/danger) for Android projects.
6
+ This allows you to get attributes of your application file (apk) and report a summary of comparison between two application files.
6
7
 
7
8
  ## Installation
8
9
 
9
- $ gem install danger-apkstats
10
+ `gem install danger-apkstats` or add `danger-apkstats` to your Gemfile.
10
11
 
11
- ## Usage
12
+ Please specify the path of apkanalyzer in your Dangerfile.
13
+
14
+ ```ruby
15
+ apkstats.apkanalyzer_path='/path/to/apkanalyzer'
16
+ ```
12
17
 
13
- Methods and attributes from this plugin are available in
14
- your `Dangerfile` under the `apkstats` namespace.
18
+ `ANDROID_HOME` has been officially deprecated. `ANDROID_SDK_ROOT` is similar to `ANDROID_HOME` but differs actually. And also, the change indicated the possibility of further deprecations and/or breaking changes in the Android SDK structure.
15
19
 
16
- # Sample
20
+ ## Usage
21
+
22
+ `apkstats` namespace is available under Dangerfile.
23
+
24
+ ### Required preparation
17
25
 
18
26
  ```
19
27
  apkstats.apk_filepath='app-debug.apk' # required.
20
- apkstats.compare_with('app-other.apk', do_report: true)
28
+ ```
29
+
30
+ ### Show attributes
31
+
32
+ ```
21
33
  apkstats.file_size #=> Fixnum
22
34
  apkstats.download_size #=> Fixnum
23
35
  apkstats.required_features #=> Array<String> | Nil
@@ -25,22 +37,28 @@ apkstats.non_required_features #=> Array<String> | Nil
25
37
  apkstats.permissions #=> Array<String> | Nil
26
38
  apkstats.min_sdk #=> String | Nil
27
39
  apkstats.target_sdk #=> String | Nils
40
+ apkstats.reference_count #=> Fixnum
41
+ apkstats.dex_count #=> Fixnum
28
42
  ```
29
43
 
30
- ## Compare apk files
44
+ ### Get a comparison report
31
45
 
32
- The report will be like below.
46
+ ```
47
+ apkstats.compare_with(String, do_report: Boolean)
48
+ ```
33
49
 
34
- ### Apk comparision results
50
+ For example, the report will be like below.
35
51
 
36
52
  Property | Summary
37
53
  :--- | :---
38
- New File Size | 1621248 Bytes. (1.55 MB
54
+ New File Size | 1621248 Bytes. (1.55 MB)
39
55
  File Size Change | -13352 Bytes. (-13.04 KB)
40
56
  Download Size Change | +41141 Bytes. (+40.18 KB)
41
57
  Removed Required Features | - android.hardware.camera
42
58
  Removed Non-required Features | - android.hardware.camera.front (not-required)
43
59
  Removed Permissions | - android.permission.INTERNET<br>- android.permission.CAMERA
60
+ New Number of dex file(s) | 15720
61
+ Number of dex file(s) Change | 1
44
62
 
45
63
  ## Development
46
64
 
@@ -49,3 +67,9 @@ Removed Permissions | - android.permission.INTERNET<br>- android.permission.CAME
49
67
  3. Run `bundle exec rake spec` to run the tests.
50
68
  4. Use `bundle exec guard` to automatically have tests run as you make changes.
51
69
  5. Make your changes.
70
+
71
+ ### Supported ruby versions
72
+
73
+ Support only versions which are in normal and/or security maintenance.
74
+
75
+ ref: https://www.ruby-lang.org/en/downloads/branches/