app-info 2.5.3 → 2.6.2

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: db2a658da1cd03d7129e25b303508ba909275033afefdad334051df0cf3ef28d
4
- data.tar.gz: a8756a88ca2039d14debca872ab586d774f9efe19ecb296cedd87a9cf65ac038
3
+ metadata.gz: f7f7e727564d15f13cd4ef2c3a8901f78402067892c0d633c38026744fc08b26
4
+ data.tar.gz: 3bb384bb2ebfc94d757ca3a005dcf0b36daaddff40814809a6a329d422f51de9
5
5
  SHA512:
6
- metadata.gz: a69147119d7201d1c4e4a584ec53cbb158d94350a28886529439a6e156ff6c3d107914a23a3d89f386228b34fcc947af93364cd84125413375719f20d994481c
7
- data.tar.gz: 5e7f59d142fbfb5b29b3bad6c97224a091a88207ec8de502a8655456dda81550a3a2698b21893f5e6b6398d86fcc387de5502594c2d66a8f632d087fdf5e6f79
6
+ metadata.gz: 70e3550ea8788652e1da6e63a0c87b23bfde92e29458a83816a25723f7ce0e2a72e4aa68092fef06ee38d9bde0bb36c513fd82b2f35fecb7baed3c952a6eb067
7
+ data.tar.gz: 77d9f91f18730b9cc071a7c0cab9860130ab79dc804e5cf05f254b1896aaa60ce743d4f66fb2624b5ce501e0f6bf118aad98efe131b4494a924b505af50d2f95
@@ -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.2] (2021-08-27)
13
+
14
+ ### Fixed
15
+
16
+ - Force write all icon data with `ASCII-8BIT`
17
+
18
+ ## [2.6.1] (2021-08-26)
19
+
20
+ ### Fixed
21
+
22
+ - Force write macOS icon data with `ASCII-8BIT`
23
+
24
+ ## [2.6.0] (2021-08-24)
25
+
26
+ ### Changed
27
+
28
+ - [breaking changes] Dropped Ruby 2.3, 2.4
29
+ - [breaking changes] get all parser size with human reable changes to keyword arguments
30
+ - Rewrite InfoPlist parser
31
+ - iOS framework and plugin array sortted by ASC
32
+ - Move CI to Github Action
33
+
34
+ ### Added
35
+
36
+ - macOS App parser support [#34](https://github.com/icyleaf/app_info/pull/34)
37
+ - CLI shell mode support
38
+
39
+ ### Fixed
40
+
41
+ - Ruby 3.0 support
42
+
43
+ ## [2.5.4] (2021-07-08)
44
+
45
+ ### Fixed
46
+
47
+ - Make `ruby-macho` version match a range between 1.4 and 3.
48
+
12
49
  ## [2.5.3] (2021-06-16)
13
50
 
14
51
  ### Fixed
@@ -136,7 +173,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
136
173
 
137
174
  - Updated dependency of CFPropertly list be a range between 2.3.4. (thanks @[cschroed](https://github.com/cschroed))
138
175
 
139
- [Unreleased]: https://github.com/icyleaf/app-info/compare/v2.5.2..HEAD
176
+ [Unreleased]: https://github.com/icyleaf/app-info/compare/v2.6.1..HEAD
177
+ [2.6.2]: https://github.com/icyleaf/app-info/compare/v2.6.1...v2.6.2
178
+ [2.6.1]: https://github.com/icyleaf/app-info/compare/v2.6.0...v2.6.1
179
+ [2.6.0]: https://github.com/icyleaf/app-info/compare/v2.5.4...v2.6.0
180
+ [2.5.4]: https://github.com/icyleaf/app-info/compare/v2.5.3...v2.5.4
181
+ [2.5.3]: https://github.com/icyleaf/app-info/compare/v2.5.2...v2.5.3
140
182
  [2.5.2]: https://github.com/icyleaf/app-info/compare/v2.5.1...v2.5.2
141
183
  [2.5.1]: https://github.com/icyleaf/app-info/compare/v2.4.3...v2.5.1
142
184
  [2.4.3]: https://github.com/icyleaf/app-info/compare/v2.4.2...v2.4.3
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