app-info 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6f04c7ea1c72a434282e71c78eeebf12540e4489f67ccd2f97f3fbfcbe8208a4
4
+ data.tar.gz: 7411ca3c3cef8e572e4b9696ba38f1080959059cdd23f200100a2b229c327ed1
5
+ SHA512:
6
+ metadata.gz: bb1215bb6160e01d7b7e02aa79d53092e39b7d32b128e3e938c791960bd87783aa4d37c817828e97ca625be536916f746506f6e4adb8a8e1a38697b9ad08f8f2
7
+ data.tar.gz: 25c5f9522ba9afc772c858854d7ac0f98b3b8df6010d578f9edef1f7ff9587e13174a07207028572fd59f53e9849ca411f52897ef27c7310c8982e653ec9e14a
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.idea/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
@@ -0,0 +1,40 @@
1
+ # The behavior of RuboCop can be controlled via the .rubocop.yml
2
+ # configuration file. It makes it possible to enable/disable
3
+ # certain cops (checks) and to alter their behavior if they accept
4
+ # any parameters. The file can be placed either in your home
5
+ # directory or in some project directory.
6
+ #
7
+ # RuboCop will start looking for the configuration file in the directory
8
+ # where the inspected file is and continue its way up to the root directory.
9
+ #
10
+ # See https://github.com/rubocop-hq/rubocop/blob/master/manual/configuration.md
11
+
12
+ AllCops:
13
+ TargetRubyVersion: 2.3
14
+ Exclude:
15
+ - 'spec/**/*'
16
+ - 'Rakefile'
17
+ - 'app_info.gemspec'
18
+ - 'lib/app-info.rb'
19
+
20
+ Metrics/AbcSize:
21
+ Max: 100
22
+
23
+ Metrics/BlockLength:
24
+ Max: 35
25
+
26
+ Metrics/MethodLength:
27
+ Max: 20
28
+
29
+ Layout/LineLength:
30
+ Max: 100
31
+
32
+ Metrics/ClassLength:
33
+ CountComments: false
34
+ Max: 300
35
+
36
+ Metrics/CyclomaticComplexity:
37
+ Max: 10
38
+
39
+ Style/Documentation:
40
+ Enabled: false
@@ -0,0 +1,9 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.3
5
+ - 2.4
6
+ - 2.5
7
+ - 2.6
8
+ - 2.7
9
+ before_install: gem install bundler
@@ -0,0 +1,96 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
6
+ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ > List all changes before release a new version.
11
+
12
+ ## [2.2.0] (2020-07-21)
13
+
14
+ ### Added
15
+
16
+ - Add `platforms`, `platform` and `type` to `AppInfo::MobileProvision`. #[21](https://github.com/icyleaf/app-info/pull/19)
17
+ - Add Enabled Capabilities support for mobileprovision. #[21](https://github.com/icyleaf/app-info/pull/19)
18
+
19
+ ## [2.1.4] (2020-01-21)
20
+
21
+ ### Fixed
22
+
23
+ - Correct Zipped dSYM filename with directory.
24
+
25
+ ## [2.1.3] (2020-01-16)
26
+
27
+ ### Fixed
28
+
29
+ - Store Android icon with BINARY mode AGAIN(correct way).
30
+
31
+ ## [2.1.2] (2020-01-11)
32
+
33
+ ### Fixed
34
+
35
+ - Correct Android icon temporary path.
36
+ - Store Android icon force encoding with BINARY.
37
+
38
+ ## [2.1.1] (2019-12-28)
39
+
40
+ ### Fixed
41
+
42
+ - Correct get dSYM binary file. #[19](https://github.com/icyleaf/app-info/pull/19)
43
+
44
+ ## [2.1.0] (2019-10-31)
45
+
46
+ ### Added
47
+
48
+ - Added `.[]` and `missing_method` to find and match in `AppInfo::InfoPlist` and `AppInfo::MobileProvision'.
49
+ - Added `AppInfo::MobileProvision.developer_certs`. #[17](https://github.com/icyleaf/app-info/pull/17)
50
+
51
+ ## [2.0.0] (2019-10-29)
52
+
53
+ ### Added
54
+
55
+ - Added iOS `.dSYM.zip` format support. #[8](https://github.com/icyleaf/app-info/issues/8)
56
+ - Added parse mobileprovision in Linux. #[10](https://github.com/icyleaf/app_info/pull/10)
57
+ - Added `AppInfo.file_type` to detect file type.
58
+ - Added detect and simple parse Android proguard file support. #[15](https://github.com/icyleaf/app_info/pull/15)
59
+ - Added `AppInfo::IPA.archs` to return what architecture(s) support. #[16](https://github.com/icyleaf/app_info/pull/16)
60
+
61
+ ### Changed
62
+
63
+ - Remove `Parser` module to reduce namespace. #[13](https://github.com/icyleaf/app-info/issues/13)
64
+ - Use parse Macho-O header and contents to detect file type instead of file extension name.
65
+ - Dropped Ruby 2.2 and below versions support.
66
+
67
+ ## [1.1.2] (2019-09-19)
68
+
69
+ ### Fixed
70
+
71
+ - Fixed fetch key from ipa.info by Hash way. (thanks @[MobilEKG](https://github.com/MobilEKG))
72
+
73
+ ## [1.1.0] (2019-06-17)
74
+
75
+ ### Added
76
+
77
+ - Added more methods to Android parser.
78
+
79
+ ## [1.0.5] (2019-03-30)
80
+
81
+ ### Changed
82
+
83
+ - Updated dependency of CFPropertly list be a range between 2.3.4. (thanks @[cschroed](https://github.com/cschroed))
84
+
85
+ [Unreleased]: https://github.com/icyleaf/app-info/compare/v2.2.0..HEAD
86
+ [2.2.0]: https://github.com/icyleaf/app-info/compare/v2.1.3...v2.1.4
87
+ [2.1.4]: https://github.com/icyleaf/app-info/compare/v2.1.3...v2.1.4
88
+ [2.1.3]: https://github.com/icyleaf/app-info/compare/v2.1.2...v2.1.3
89
+ [2.1.2]: https://github.com/icyleaf/app-info/compare/v2.1.1...v2.1.2
90
+ [2.1.1]: https://github.com/icyleaf/app-info/compare/v2.1.0...v2.1.1
91
+ [2.1.0]: https://github.com/icyleaf/app-info/compare/v2.0.0...v2.1.0
92
+ [2.0.0]: https://github.com/icyleaf/app-info/compare/v1.1.2...v2.0.0
93
+ [1.1.2]: https://github.com/icyleaf/app-info/compare/v1.0.5...v1.1.2
94
+ [1.1.0]: https://github.com/icyleaf/app-info/compare/v1.0.5...v1.1.0
95
+ [1.0.5]: https://github.com/icyleaf/app-info/compare/v0.9.0...v1.0.5
96
+
@@ -0,0 +1,49 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, and in the interest of
4
+ fostering an open and welcoming community, we pledge to respect all people who
5
+ contribute through reporting issues, posting feature requests, updating
6
+ documentation, submitting pull requests or patches, and other activities.
7
+
8
+ We are committed to making participation in this project a harassment-free
9
+ experience for everyone, regardless of level of experience, gender, gender
10
+ identity and expression, sexual orientation, disability, personal appearance,
11
+ body size, race, ethnicity, age, religion, or nationality.
12
+
13
+ Examples of unacceptable behavior by participants include:
14
+
15
+ * The use of sexualized language or imagery
16
+ * Personal attacks
17
+ * Trolling or insulting/derogatory comments
18
+ * Public or private harassment
19
+ * Publishing other's private information, such as physical or electronic
20
+ addresses, without explicit permission
21
+ * Other unethical or unprofessional conduct
22
+
23
+ Project maintainers have the right and responsibility to remove, edit, or
24
+ reject comments, commits, code, wiki edits, issues, and other contributions
25
+ that are not aligned to this Code of Conduct, or to ban temporarily or
26
+ permanently any contributor for other behaviors that they deem inappropriate,
27
+ threatening, offensive, or harmful.
28
+
29
+ By adopting this Code of Conduct, project maintainers commit themselves to
30
+ fairly and consistently applying these principles to every aspect of managing
31
+ this project. Project maintainers who do not follow or enforce the Code of
32
+ Conduct may be permanently removed from the project team.
33
+
34
+ This code of conduct applies both within project spaces and in public spaces
35
+ when an individual is representing the project or its community.
36
+
37
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
38
+ reported by contacting a project maintainer at icyleaf.cn@gmail.com. All
39
+ complaints will be reviewed and investigated and will result in a response that
40
+ is deemed necessary and appropriate to the circumstances. Maintainers are
41
+ obligated to maintain confidentiality with regard to the reporter of an
42
+ incident.
43
+
44
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45
+ version 1.3.0, available at
46
+ [http://contributor-covenant.org/version/1/3/0/][version]
47
+
48
+ [homepage]: http://contributor-covenant.org
49
+ [version]: http://contributor-covenant.org/version/1/3/0/
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+ # source 'https://gems.ruby-china.com'
5
+
6
+ # Specify your gem's dependencies in app-info.gemspec
7
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016-present icyleaf
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,246 @@
1
+ # app_info
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)
5
+ [![Gem version](https://img.shields.io/gem/v/app-info.svg?style=flat)](https://rubygems.org/gems/app_info)
6
+ [![License](https://img.shields.io/badge/license-MIT-red.svg?style=flat)](LICENSE)
7
+
8
+ Teardown tool for mobile app(ipa/apk) and dSYM.zip file, analysis metedata like version, name, icon etc.
9
+
10
+ ## Support
11
+
12
+ - Android apk file
13
+ - iOS ipa file
14
+ - Info.plist file
15
+ - .mobileprovision/.provisionprofile file
16
+ - dSYM(.zip) file
17
+
18
+ ## Installation
19
+
20
+ Add this line to your application's Gemfile:
21
+
22
+ ```ruby
23
+ gem 'app-info'
24
+ ```
25
+
26
+ And then execute:
27
+
28
+ ```bash
29
+ $ bundle
30
+ ```
31
+
32
+ Or install it yourself as:
33
+
34
+ ```bash
35
+ $ gem install app-info
36
+ ```
37
+
38
+ ## Usage
39
+
40
+ ### Initialize
41
+
42
+ ```ruby
43
+ require 'app-info'
44
+
45
+ # Automatic detect file extsion and parse
46
+ parser = AppInfo.parse('iphone.ipa')
47
+ parser = AppInfo.parse('ipad.ipa')
48
+ parser = AppInfo.parse('android.apk')
49
+ parser = AppInfo.parse('u-u-i-d.mobileprovision')
50
+ parser = AppInfo.parse('App.dSYm.zip')
51
+
52
+ # If detect file type failed, you can parse in other way
53
+ parser = AppInfo::IPA.new('iphone.ipa')
54
+ parser = AppInfo::IPA.new('android.apk')
55
+ parser = AppInfo::InfoPlist.new('App/Info.plist')
56
+ parser = AppInfo::MobileProvision.new('provisioning_profile/uuid.mobileprovision')
57
+ parser = AppInfo::DSYM.new('App.dSYm.zip')
58
+ ```
59
+
60
+ ### iOS
61
+
62
+ Teardown suport iPhone/iPad/Universal.
63
+
64
+ ```ruby
65
+ ipa = AppInfo.parse('iphone.ipa')
66
+
67
+ # get app file size
68
+ ipa.size
69
+ # => 3093823
70
+
71
+ # get app file size in human reable.
72
+ ipa.size(true)
73
+ # => 29 MB
74
+
75
+ # get app release version
76
+ ipa.release_version
77
+ # => 1.0
78
+
79
+ # get app bundle id
80
+ ipa.bundle_id
81
+ # => com.icyleaf.AppInfoDemo
82
+
83
+ # get app icons
84
+ 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=>[58, 58]}, ...]
86
+
87
+ # get provisioning profile devices
88
+ ipa.devices
89
+ # => ['18cf53cddee60c5af9c97b1521e7cbf8342628da']
90
+
91
+ # detect app type
92
+ ipa.ipad?
93
+ ipa.iphone?
94
+ ipa.universal?
95
+
96
+ # detect app release type
97
+ ipa.release_type
98
+ # => 'AdHoc'
99
+
100
+ # detect architecture(s)
101
+ ipa.archs
102
+ # => [:armv7, :arm64]
103
+
104
+ # get more propety in Info.plist
105
+ ipa.info[:CFBundleDisplayName]
106
+ # => 'AppInfoDemo'
107
+ ```
108
+
109
+ More to check [rspec test](spec/app_info).
110
+
111
+ ### Mobile Provision
112
+
113
+ Extract from IPA parser, it could teardown any .mobileprovision file(Provisioning Profile).
114
+ you can download it from Apple Developer Portal.
115
+
116
+ ```ruby
117
+ profile = AppInfo.parse('~/Library/MobileDevice/Provisioning\ Profiles/6e374bb8-a801-411f-ab28-96a4baa23814.mobileprovision')
118
+
119
+ # get app release version
120
+ profile.team_id
121
+ # => '3J9E73E9XS'
122
+
123
+ # get app package name
124
+ profile.team_name
125
+ # => 'Company/Team Name'
126
+
127
+ # get UDID of devices
128
+ profile.devices
129
+ # => ['18cf53cddee60c5af9c97b1521e7cbf8342628da']
130
+
131
+ # detect type
132
+ profile.type
133
+ # => :development/:adhoc/:appstore/:inhouse
134
+
135
+ # get enabled capabilities
136
+ profile.enabled_capabilities
137
+ # => ['Apple Pay', 'iCloud', 'Sign In with Apple', ...]
138
+ ```
139
+
140
+ ### dSYM
141
+
142
+ ```ruby
143
+ dsym = AppInfo.parse('ios.dSYM.zip')
144
+
145
+ # get object name
146
+ dsym.object
147
+ # => iOS
148
+
149
+ # get macho size
150
+ dsym.machos.size
151
+ # => 1 or 2
152
+
153
+ dsym.machos.each do |macho|
154
+ # get cpu type
155
+ macho.cpu_type
156
+ # => :arm
157
+
158
+ # get cpu name
159
+ macho.cpu_name
160
+ # => armv7
161
+
162
+ # get UUID (debug id)
163
+ macho.uuid
164
+ # => 26dfc15d-bdce-351f-b5de-6ee9f5dd6d85
165
+
166
+ # get macho size
167
+ macho.size
168
+ # => 866526
169
+
170
+ # get macho size in human reable.
171
+ macho.size(true)
172
+ # => 862 KB
173
+
174
+ # dump data to Hash
175
+ macho.to_h
176
+ # => {uuid:"26dfc15d-bdce-351f-b5de-6ee9f5dd6d85", cpu_type: :arm, cpu_name: :armv7, ...}
177
+ end
178
+ ```
179
+
180
+ ### Android
181
+
182
+ ```ruby
183
+ apk = AppInfo.parse('android.apk')
184
+
185
+ # get app file size
186
+ apk.size
187
+ # => 3093823
188
+
189
+ # get app file size in human reable.
190
+ apk.size(true)
191
+ # => 29 MB
192
+
193
+ # get app release version
194
+ apk.release_version
195
+ # => 1.0
196
+
197
+ # get app package name
198
+ apk.bundle_id
199
+ # => com.icyleaf.AppInfoDemo
200
+
201
+ # get app icons
202
+ apk.icons
203
+ # => [{: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]}, ...]
204
+
205
+ # get app support min sdk version
206
+ apk.min_sdk_version
207
+ # => 13
208
+
209
+ # get use_permissions list
210
+ apk.use_permissions
211
+ # => [...]
212
+
213
+ # get activitiy list
214
+ apk.activities
215
+ # => [...]
216
+
217
+ # get service list
218
+ apk.services
219
+ # => [...]
220
+
221
+ # get certificate list
222
+ apk.certificates
223
+ # => [...]
224
+
225
+ # get sign list
226
+ apk.signs
227
+ # => [...]
228
+
229
+ # detect app type (It's difficult to detect phone or tablet)
230
+ apk.tv?
231
+ apk.wear?
232
+ ```
233
+
234
+ ## Development
235
+
236
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
237
+
238
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
239
+
240
+ ## Contributing
241
+
242
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/app-info. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
243
+
244
+ ## License
245
+
246
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).