app-info 2.5.1 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 927106ea47092b85df2f8e1c88321d8949da8d7c9e7bc712d907e89932cd4072
4
- data.tar.gz: f2d5acb9cd901f7af25307ed385d8d276e19d04e5e02644e3ea15e9698d5363a
3
+ metadata.gz: c3f41cd5992337273a19a91e968dcae822aac9e4e022368e02d0d2a262394898
4
+ data.tar.gz: 1b0f8391aa791da7d9138ecd50727c8f9afe150f8834af600ff571b812e5f29d
5
5
  SHA512:
6
- metadata.gz: af27de4ad9737a4d87bad27f910b010f42338586ed02ecfd16414997ff8a07e78a1a3b681ca9ccdba6944d6f306cd47cd9730f3bd73a453ce43fe1d280085030
7
- data.tar.gz: 8d11fac42b959acc59e9abd71db8c204866ad11e5bd6a3fb746883284f9d1032e959e5636411d6ef4c3e69d020eb42f99c8df04c381c8d295bd063f9bc447f56
6
+ metadata.gz: fa7c8b0ae2e4493eac060411fdb1ea9b34d948a4d2c2bdf74431d43723b29e4f47879aec62cf456a41798f46df16cd4dcf1e6f4c1419aee373395a746c82372e
7
+ data.tar.gz: 6b5263c1b0a2d145002cb19a410c06de2f659c5f88e9cdb76d83e7739263adb4226b293e231c09daeb7a8ca0a82839d97457c99c288650bcf39ce218d6320ebe
@@ -0,0 +1,9 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "21:00"
8
+ timezone: Asia/Shanghai
9
+ open-pull-requests-limit: 10
@@ -0,0 +1,41 @@
1
+ name: CI
2
+ on:
3
+ push:
4
+ branches:
5
+ - master
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ${{ matrix.os }}
11
+
12
+ strategy:
13
+ fail-fast: false
14
+ matrix:
15
+ ruby: [ ruby-2.5, ruby-2.6, ruby-2.7, ruby-3.0 ]
16
+ os: [ ubuntu-latest ]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+
21
+ - uses: ruby/setup-ruby@v1
22
+ with:
23
+ ruby-version: ${{ matrix.ruby }}
24
+ bundler-cache: true
25
+
26
+ - name: bundle exec rspec
27
+ run: bundle exec rspec --format progress --force-colour
28
+
29
+ lint:
30
+ runs-on: ubuntu-latest
31
+
32
+ steps:
33
+ - uses: actions/checkout@v2
34
+
35
+ - uses: ruby/setup-ruby@v1
36
+ with:
37
+ ruby-version: 2.7
38
+ bundler-cache: true
39
+
40
+ - name: bundle exec rubocop
41
+ run: bundle exec rubocop --format progress --color
data/.rubocop.yml CHANGED
@@ -9,22 +9,35 @@
9
9
  #
10
10
  # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
11
11
 
12
+ inherit_mode:
13
+ merge:
14
+ - Exclude
15
+
12
16
  AllCops:
13
- TargetRubyVersion: 2.3
17
+ TargetRubyVersion: 2.7
18
+ NewCops: enable
19
+ SuggestExtensions: false
14
20
  Exclude:
15
- - 'spec/**/*'
16
- - 'Rakefile'
17
- - 'app_info.gemspec'
18
- - 'lib/app-info.rb'
21
+ - 'bin/*'
22
+ - 'spec/**/*'
23
+ - vendor/bundle/**/*
24
+ - 'Rakefile'
25
+ - 'app_info.gemspec'
26
+ - 'lib/app-info.rb'
19
27
 
20
28
  Metrics/AbcSize:
21
29
  Max: 100
22
30
 
23
31
  Metrics/BlockLength:
24
32
  Max: 35
33
+ Exclude:
34
+ - 'lib/app_info/mobile_provision.rb'
25
35
 
26
36
  Metrics/MethodLength:
27
37
  Max: 20
38
+ Exclude:
39
+ - 'lib/app_info/png_uncrush.rb'
40
+ - 'lib/app_info/mobile_provision.rb'
28
41
 
29
42
  Layout/LineLength:
30
43
  Max: 100
@@ -34,7 +47,13 @@ Metrics/ClassLength:
34
47
  Max: 300
35
48
 
36
49
  Metrics/CyclomaticComplexity:
37
- Max: 10
50
+ Enabled: false
38
51
 
39
- Style/Documentation:
52
+ Metrics/PerceivedComplexity:
53
+ Max: 18
54
+
55
+ Lint/AssignmentInCondition:
40
56
  Enabled: false
57
+
58
+ Style/Documentation:
59
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -9,6 +9,43 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
9
9
 
10
10
  > List all changes before release a new version.
11
11
 
12
+ ## [2.6.0] (2021-08-24)
13
+
14
+ ### Changed
15
+
16
+ - [breaking changes] Dropped Ruby 2.3, 2.4
17
+ - [breaking changes] get all parser size with human reable changes to keyword arguments
18
+ - Rewrite InfoPlist parser
19
+ - iOS framework and plugin array sortted by ASC
20
+ - Move CI to Github Action
21
+
22
+ ### Added
23
+
24
+ - macOS App parser support [#34](https://github.com/icyleaf/app_info/pull/34)
25
+ - CLI shell mode support
26
+
27
+ ### Fixed
28
+
29
+ - Ruby 3.0 support
30
+
31
+ ## [2.5.4] (2021-07-08)
32
+
33
+ ### Fixed
34
+
35
+ - Make `ruby-macho` version match a range between 1.4 and 3.
36
+
37
+ ## [2.5.3] (2021-06-16)
38
+
39
+ ### Fixed
40
+
41
+ - Fix decompress png error (mostly because of it is a normal png file) [#32](https://github.com/icyleaf/app_info/pull/32) thanks @[莫小七](https://github.com/mxq0923)
42
+
43
+ ## [2.5.2] (2021-04-15)
44
+
45
+ ### Fixed
46
+
47
+ - Fix handle get Android application name from manifest first [#29](https://github.com/icyleaf/app_info/issues/29) thanks @[DreamPWJ](https://github.com/DreamPWJ)
48
+
12
49
  ## [2.5.1] (2021-04-14)
13
50
 
14
51
  ### Add
@@ -124,8 +161,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
124
161
 
125
162
  - Updated dependency of CFPropertly list be a range between 2.3.4. (thanks @[cschroed](https://github.com/cschroed))
126
163
 
127
- [Unreleased]: https://github.com/icyleaf/app-info/compare/v2.5.1..HEAD
128
- [2.5.0]: https://github.com/icyleaf/app-info/compare/v2.4.3...v2.5.1
164
+ [Unreleased]: https://github.com/icyleaf/app-info/compare/v2.6.0..HEAD
165
+ [2.6.0]: https://github.com/icyleaf/app-info/compare/v2.5.4...v2.6.0
166
+ [2.5.4]: https://github.com/icyleaf/app-info/compare/v2.5.3...v2.5.4
167
+ [2.5.3]: https://github.com/icyleaf/app-info/compare/v2.5.2...v2.5.3
168
+ [2.5.2]: https://github.com/icyleaf/app-info/compare/v2.5.1...v2.5.2
169
+ [2.5.1]: https://github.com/icyleaf/app-info/compare/v2.4.3...v2.5.1
129
170
  [2.4.3]: https://github.com/icyleaf/app-info/compare/v2.4.2...v2.4.3
130
171
  [2.4.2]: https://github.com/icyleaf/app-info/compare/v2.4.1...v2.4.2
131
172
  [2.4.1]: https://github.com/icyleaf/app-info/compare/v2.3.0...v2.4.1
data/Gemfile CHANGED
@@ -4,3 +4,9 @@ source 'https://rubygems.org'
4
4
 
5
5
  # Specify your gem's dependencies in app-info.gemspec
6
6
  gemspec
7
+
8
+ group :development do
9
+ gem 'awesome_print'
10
+ gem 'debase'
11
+ gem 'ruby-debug-ide'
12
+ end
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
1
  # app_info
2
2
 
3
- [![Language](https://img.shields.io/badge/ruby-2.3+-701516.svg)](.travis.yml)
4
- [![Build Status](https://travis-ci.org/icyleaf/app_info.svg?branch=master)](https://travis-ci.org/icyleaf/app_info)
3
+ [![Language](https://img.shields.io/badge/ruby-2.5+-701516.svg)](.github/workflows/ci.yml)
4
+ [![Build Status](https://img.shields.io/github/workflow/status/icyleaf/app_info/CI)](https://github.com/icyleaf/app_info/actions/workflows/ci.yml)
5
5
  [![Gem version](https://img.shields.io/gem/v/app-info.svg?style=flat)](https://rubygems.org/gems/app_info)
6
6
  [![License](https://img.shields.io/badge/license-MIT-red.svg?style=flat)](LICENSE)
7
7
 
8
- Teardown tool for mobile app(ipa/apk) and dSYM.zip file, analysis metedata like version, name, icon etc.
8
+ Teardown tool for mobile(ipa/apk) app, macOS app and dSYM.zip file, analysis metedata like version, name, icon etc.
9
9
 
10
10
  ## Support
11
11
 
@@ -13,6 +13,7 @@ Teardown tool for mobile app(ipa/apk) and dSYM.zip file, analysis metedata like
13
13
  - iOS ipa file
14
14
  - Info.plist file
15
15
  - .mobileprovision/.provisionprofile file
16
+ - macOS App(.zip) file
16
17
  - dSYM(.zip) file
17
18
 
18
19
  ## Installation
@@ -47,13 +48,15 @@ parser = AppInfo.parse('iphone.ipa')
47
48
  parser = AppInfo.parse('ipad.ipa')
48
49
  parser = AppInfo.parse('android.apk')
49
50
  parser = AppInfo.parse('u-u-i-d.mobileprovision')
51
+ parser = AppInfo.parse('macOS.App.zip')
50
52
  parser = AppInfo.parse('App.dSYm.zip')
51
53
 
52
54
  # If detect file type failed, you can parse in other way
53
55
  parser = AppInfo::IPA.new('iphone.ipa')
54
56
  parser = AppInfo::APK.new('android.apk')
55
- parser = AppInfo::InfoPlist.new('App/Info.plist')
56
- parser = AppInfo::MobileProvision.new('provisioning_profile/uuid.mobileprovision')
57
+ parser = AppInfo::InfoPlist.new('Info.plist')
58
+ parser = AppInfo::MobileProvision.new('uuid.mobileprovision')
59
+ parser = AppInfo::Macos.new('App.dSYm.zip')
57
60
  parser = AppInfo::DSYM.new('App.dSYm.zip')
58
61
  ```
59
62
 
@@ -69,7 +72,7 @@ ipa.size
69
72
  # => 3093823
70
73
 
71
74
  # get app file size in human reable.
72
- ipa.size(true)
75
+ ipa.size(human_size: true)
73
76
  # => 29 MB
74
77
 
75
78
  # get app release version
@@ -80,9 +83,9 @@ ipa.release_version
80
83
  ipa.bundle_id
81
84
  # => com.icyleaf.AppInfoDemo
82
85
 
83
- # get app icons
86
+ # get app icons (uncrushed png by default)
84
87
  ipa.icons
85
- # => [{:name=>"AppIcon29x29@2x~ipad.png", :file=>"/var/folders/mb/8cm0fz4d499968yss9y1j8bc0000gp/T/d20160728-69669-1xnub30/AppInfo-ios-a5369339399e62046d7d59c52254dac6/Payload/bundle.app/AppIcon29x29@2x~ipad.png"}, :dimensions=>[29, 29], :uncrushed_file=>"..." ...]
88
+ # => [{:name=>"AppIcon29x29@2x~ipad.png", :file=>"temp/dir/app/AppIcon29x29@2x~ipad.png"}, :dimensions=>[29, 29], :uncrushed_file=>"..." ...]
86
89
 
87
90
  # get provisioning profile devices
88
91
  ipa.devices
@@ -145,46 +148,6 @@ profile.enabled_capabilities
145
148
  # => ['Apple Pay', 'iCloud', 'Sign In with Apple', ...]
146
149
  ```
147
150
 
148
- ### dSYM
149
-
150
- ```ruby
151
- dsym = AppInfo.parse('ios.dSYM.zip')
152
-
153
- # get object name
154
- dsym.object
155
- # => iOS
156
-
157
- # get macho size
158
- dsym.machos.size
159
- # => 1 or 2
160
-
161
- dsym.machos.each do |macho|
162
- # get cpu type
163
- macho.cpu_type
164
- # => :arm
165
-
166
- # get cpu name
167
- macho.cpu_name
168
- # => armv7
169
-
170
- # get UUID (debug id)
171
- macho.uuid
172
- # => 26dfc15d-bdce-351f-b5de-6ee9f5dd6d85
173
-
174
- # get macho size
175
- macho.size
176
- # => 866526
177
-
178
- # get macho size in human reable.
179
- macho.size(true)
180
- # => 862 KB
181
-
182
- # dump data to Hash
183
- macho.to_h
184
- # => {uuid:"26dfc15d-bdce-351f-b5de-6ee9f5dd6d85", cpu_type: :arm, cpu_name: :armv7, ...}
185
- end
186
- ```
187
-
188
151
  ### Android
189
152
 
190
153
  ```ruby
@@ -195,7 +158,7 @@ apk.size
195
158
  # => 3093823
196
159
 
197
160
  # get app file size in human reable.
198
- apk.size(true)
161
+ apk.size(human_size: true)
199
162
  # => 29 MB
200
163
 
201
164
  # get app release version
@@ -208,7 +171,7 @@ apk.bundle_id
208
171
 
209
172
  # get app icons
210
173
  apk.icons
211
- # => [{:name=>"ic_launcher.png", :file=> "/var/folders/mb/8cm0fz4d499968yss9y1j8bc0000gp/T/d20160728-70163-10d47fl/AppInfo-android-cccbf89a889eb592c5c6f342d56b9a49/res/mipmap-mdpi-v4/ic_launcher.png/ic_launcher.png", :dimensions=>[48, 48]}, ...]
174
+ # => [{:name=>"ic_launcher.png", :file=> "/temp/dir/app/ic_launcher.png", :dimensions=>[48, 48]}, ...]
212
175
 
213
176
  # get app support min sdk version
214
177
  apk.min_sdk_version
@@ -239,6 +202,103 @@ apk.tv?
239
202
  apk.wear?
240
203
  ```
241
204
 
205
+ ### macOS
206
+
207
+ Only accept zipped macOS file.
208
+
209
+ ```ruby
210
+ macos = AppInfo.parse('macos_app.zip')
211
+
212
+ # get app file size
213
+ macos.size
214
+ # => 3093823
215
+
216
+ # get app file size in human reable.
217
+ macos.size(human_size: true)
218
+ # => 29 MB
219
+
220
+ # get app release version
221
+ macos.release_version
222
+ # => 1.0
223
+
224
+ # get app bundle id
225
+ macos.bundle_id
226
+ # => com.icyleaf.AppInfoDemo
227
+
228
+ # Get minimize os version
229
+ macos.min_os_version
230
+ # => 11.3
231
+
232
+ # get app icons(convertd icns to png icon sets by default)
233
+ macos.icons
234
+ # => [{:name=>"AppIcon.icns", :file=>"/temp/dir/app/AppIcon.icns"}, :sets=>[{:name=>"64x64_AppIcon.png", :file=>"/temp/dir/app/64x64_AppIcon.png", :dimensions=>[64, 64]}, ...]
235
+
236
+ # detect publish on mac app store
237
+ macos.stored?
238
+ # => true/false
239
+
240
+ # detect architecture(s)
241
+ macos.archs
242
+ # => [:x86_64, :arm64]
243
+
244
+ # get more propety in Info.plist
245
+ macos.info[:CFBundleDisplayName]
246
+ # => 'AppInfoDemo'
247
+ ```
248
+
249
+ ### dSYM
250
+
251
+ ```ruby
252
+ dsym = AppInfo.parse('ios.dSYM.zip')
253
+
254
+ # get object name
255
+ dsym.object
256
+ # => iOS
257
+
258
+ # get total count of macho
259
+ dsym.machos.count
260
+ # => 1 or 2
261
+
262
+ dsym.machos.each do |macho|
263
+ # get cpu type
264
+ macho.cpu_type
265
+ # => :arm
266
+
267
+ # get cpu name
268
+ macho.cpu_name
269
+ # => armv7
270
+
271
+ # get UUID (debug id)
272
+ macho.uuid
273
+ # => 26dfc15d-bdce-351f-b5de-6ee9f5dd6d85
274
+
275
+ # get macho size
276
+ macho.size
277
+ # => 866526
278
+
279
+ # get macho size in human reable.
280
+ macho.size(human_size: true)
281
+ # => 862 KB
282
+
283
+ # dump data to Hash
284
+ macho.to_h
285
+ # => {uuid:"26dfc15d-bdce-351f-b5de-6ee9f5dd6d85", cpu_type: :arm, cpu_name: :armv7, ...}
286
+ end
287
+ ```
288
+
289
+ ## CLI Shell (Interactive console)
290
+
291
+ It is possible to use this gem as a command line interface to parse mobile app:
292
+
293
+ ```
294
+ > app-info
295
+
296
+ app-info (0.6.0)> p = AppInfo.parse('/path/to/app')
297
+ => #<AppInfo::APK::......>
298
+ app-info (0.6.0)> p.name
299
+ => "AppName"
300
+ ```
301
+
242
302
  ## Best Practice
243
303
 
244
304
  - [fastlane-plugin-app_info](https://github.com/icyleaf/fastlane-plugin-app_info): fastlane plugin
data/app_info.gemspec CHANGED
@@ -15,18 +15,21 @@ Gem::Specification.new do |spec|
15
15
  spec.homepage = 'http://github.com/icyleaf/app-info'
16
16
  spec.license = 'MIT'
17
17
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
18
+ spec.bindir = 'exe'
18
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
20
  spec.require_paths = ['lib']
20
- spec.required_ruby_version = '>= 2.3'
21
+ spec.required_ruby_version = '>= 2.5'
21
22
 
22
- spec.add_dependency 'CFPropertyList', ['< 3.1.0', '>= 2.3.4']
23
+ spec.add_dependency 'CFPropertyList', '< 3.1.0', '>= 2.3.4'
23
24
  spec.add_dependency 'image_size', '>= 1.5', '< 2.2'
24
- spec.add_dependency 'ruby-macho', '~> 2.2.0'
25
+ spec.add_dependency 'ruby-macho', '< 3', '>= 1.4'
25
26
  spec.add_dependency 'ruby_android', '~> 0.7.7'
26
27
  spec.add_dependency 'rubyzip', '>= 1.2', '< 3.0'
27
28
  spec.add_dependency 'uuidtools', '>= 2.1.5', '< 2.3.0'
29
+ spec.add_dependency 'icns', '~> 0.2.0'
28
30
 
29
31
  spec.add_development_dependency 'bundler', '>= 1.12'
30
32
  spec.add_development_dependency 'rake', '>= 10.0'
31
33
  spec.add_development_dependency 'rspec', '~> 3.0'
34
+ spec.add_development_dependency 'rubocop', '~> 1.19'
32
35
  end
data/exe/app-info ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.unshift File.expand_path('../lib', __dir__)
5
+
6
+ # Exit cleanly from an early interrupt
7
+ Signal.trap('INT') { exit 1 }
8
+
9
+ require 'app_info'
10
+ require 'app_info/shell'
11
+
12
+ AppInfo::Shell.run