app-info 2.1.0 → 2.2.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: 1c792e9fab37d4beadae7e0d8d6d955e4b51b8d64d8328cbd423ab65b56ae61a
4
- data.tar.gz: 617c4f5bdee5412285f17dc2e97f22e9a6f325ba4efbaf50373030473c9f588a
3
+ metadata.gz: 6f04c7ea1c72a434282e71c78eeebf12540e4489f67ccd2f97f3fbfcbe8208a4
4
+ data.tar.gz: 7411ca3c3cef8e572e4b9696ba38f1080959059cdd23f200100a2b229c327ed1
5
5
  SHA512:
6
- metadata.gz: d9940cf07799f61c12e386799fbebd9273201a936b238d22d6fb9b75edf2e6e6588f19f4782856d6e28b521e89631da86becc791a6b95e5f691c786d7e27b0d4
7
- data.tar.gz: c362a553bdf45c253c2f1fa6c6f25d68da5108bde5cb59670ab759989077771671bb8ad89bdf4750c36440a67b0ac0049acdcadcec5176e5c6104906499d397e
6
+ metadata.gz: bb1215bb6160e01d7b7e02aa79d53092e39b7d32b128e3e938c791960bd87783aa4d37c817828e97ca625be536916f746506f6e4adb8a8e1a38697b9ad08f8f2
7
+ data.tar.gz: 25c5f9522ba9afc772c858854d7ac0f98b3b8df6010d578f9edef1f7ff9587e13174a07207028572fd59f53e9849ca411f52897ef27c7310c8982e653ec9e14a
@@ -26,7 +26,7 @@ Metrics/BlockLength:
26
26
  Metrics/MethodLength:
27
27
  Max: 20
28
28
 
29
- Metrics/LineLength:
29
+ Layout/LineLength:
30
30
  Max: 100
31
31
 
32
32
  Metrics/ClassLength:
@@ -36,6 +36,5 @@ Metrics/ClassLength:
36
36
  Metrics/CyclomaticComplexity:
37
37
  Max: 10
38
38
 
39
-
40
39
  Style/Documentation:
41
40
  Enabled: false
@@ -5,4 +5,5 @@ rvm:
5
5
  - 2.4
6
6
  - 2.5
7
7
  - 2.6
8
+ - 2.7
8
9
  before_install: gem install bundler
@@ -9,12 +9,44 @@ 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.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
+
12
44
  ## [2.1.0] (2019-10-31)
13
45
 
14
46
  ### Added
15
47
 
16
48
  - Added `.[]` and `missing_method` to find and match in `AppInfo::InfoPlist` and `AppInfo::MobileProvision'.
17
- - Added `AppInfo::MobileProvision.developer_certs` . #[17](https://github.com/icyleaf/app-info/pull/17)
49
+ - Added `AppInfo::MobileProvision.developer_certs`. #[17](https://github.com/icyleaf/app-info/pull/17)
18
50
 
19
51
  ## [2.0.0] (2019-10-29)
20
52
 
@@ -50,7 +82,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
50
82
 
51
83
  - Updated dependency of CFPropertly list be a range between 2.3.4. (thanks @[cschroed](https://github.com/cschroed))
52
84
 
53
- [Unreleased]: https://github.com/icyleaf/app-info/compare/v2.1.0..HEAD
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
54
91
  [2.1.0]: https://github.com/icyleaf/app-info/compare/v2.0.0...v2.1.0
55
92
  [2.0.0]: https://github.com/icyleaf/app-info/compare/v1.1.2...v2.0.0
56
93
  [1.1.2]: https://github.com/icyleaf/app-info/compare/v1.0.5...v1.1.2
data/README.md CHANGED
@@ -12,7 +12,7 @@ Teardown tool for mobile app(ipa/apk) and dSYM.zip file, analysis metedata like
12
12
  - Android apk file
13
13
  - iOS ipa file
14
14
  - Info.plist file
15
- - .mobileprovision file
15
+ - .mobileprovision/.provisionprofile file
16
16
  - dSYM(.zip) file
17
17
 
18
18
  ## Installation
@@ -127,6 +127,14 @@ profile.team_name
127
127
  # get UDID of devices
128
128
  profile.devices
129
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', ...]
130
138
  ```
131
139
 
132
140
  ### dSYM
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'ruby-macho', '~> 2.2.0'
26
26
  spec.add_dependency 'ruby_android', '~> 0.7.7'
27
27
  spec.add_dependency 'rubyzip', '>= 1.2', '< 3.0'
28
- spec.add_dependency 'uuidtools', '~> 2.1.5'
28
+ spec.add_dependency 'uuidtools', '>= 2.1.5', '< 2.3.0'
29
29
 
30
30
  spec.add_development_dependency 'bundler', '>= 1.12'
31
31
  spec.add_development_dependency 'rake', '>= 10.0'
@@ -54,8 +54,6 @@ module AppInfo
54
54
  resource.find('@string/app_name')
55
55
  end
56
56
 
57
-
58
-
59
57
  def device_type
60
58
  if wear?
61
59
  Device::WATCH
@@ -120,12 +118,10 @@ module AppInfo
120
118
 
121
119
  @icons = @apk.icon.each_with_object([]) do |(path, data), obj|
122
120
  icon_name = File.basename(path)
123
- icon_path = File.join(tmp_path, File.path(path))
121
+ icon_path = File.join(tmp_path, File.dirname(path))
124
122
  icon_file = File.join(icon_path, icon_name)
125
123
  FileUtils.mkdir_p icon_path
126
- File.open(icon_file, 'w') do |f|
127
- f.write data
128
- end
124
+ File.open(icon_file, 'wb') { |f| f.write(data) }
129
125
 
130
126
  obj << {
131
127
  name: icon_name,
@@ -67,7 +67,7 @@ module AppInfo
67
67
  def app_path
68
68
  unless @app_path
69
69
  path = File.join(contents, 'Contents', 'Resources', 'DWARF')
70
- name = Dir.entries(path).last
70
+ name = Dir.entries(path).reject { |f| ['.', '..'].include?(f) }.first
71
71
  @app_path = File.join(path, name)
72
72
  end
73
73
 
@@ -84,7 +84,10 @@ module AppInfo
84
84
  dsym_dir = nil
85
85
  @contents = Util.unarchive(@file, path: 'dsym') do |path, zip_file|
86
86
  zip_file.each do |f|
87
- dsym_dir ||= f.name
87
+ unless dsym_dir
88
+ dsym_dir = f.name
89
+ dsym_dir = dsym_dir.split('/')[0] # fix filename is xxx.app.dSYM/Contents
90
+ end
88
91
 
89
92
  f_path = File.join(path, f.name)
90
93
  zip_file.extract(f, f_path) unless File.exist?(f_path)
@@ -19,6 +19,26 @@ module AppInfo
19
19
  mobileprovision.try(:[], 'AppIDName')
20
20
  end
21
21
 
22
+ def type
23
+ return :development if development?
24
+ return :adhoc if adhoc?
25
+ return :appstore if appstore?
26
+ return :inhouse if inhouse?
27
+ end
28
+
29
+ def platforms
30
+ return unless platforms = mobileprovision.try(:[], 'Platform')
31
+
32
+ platforms.map { |v|
33
+ v = 'macOS' if v == 'OSX'
34
+ v.downcase.to_sym
35
+ }
36
+ end
37
+
38
+ def platform
39
+ platforms[0]
40
+ end
41
+
22
42
  def devices
23
43
  mobileprovision.try(:[], 'ProvisionedDevices')
24
44
  end
@@ -56,6 +76,122 @@ module AppInfo
56
76
  end
57
77
  end
58
78
 
79
+ # Detect is development type of mobileprovision
80
+ #
81
+ # related link: https://stackoverflow.com/questions/1003066/what-does-get-task-allow-do-in-xcode
82
+ def development?
83
+ case platform.downcase.to_sym
84
+ when :ios
85
+ entitlements['get-task-allow'] == true
86
+ when :macos
87
+ !devices.nil?
88
+ else
89
+ raise Error, "Not implement with platform: #{platform}"
90
+ end
91
+ end
92
+
93
+ # Detect app store type
94
+ #
95
+ # related link: https://developer.apple.com/library/archive/qa/qa1830/_index.html
96
+ def appstore?
97
+ case platform.downcase.to_sym
98
+ when :ios
99
+ !development? && entitlements.key?('beta-reports-active')
100
+ when :macos
101
+ !development?
102
+ else
103
+ raise Error, "Not implement with platform: #{platform}"
104
+ end
105
+ end
106
+
107
+ def adhoc?
108
+ return false if platform == :macos # macOS no need adhoc
109
+
110
+ !development? && !devices.nil?
111
+ end
112
+
113
+ def inhouse?
114
+ return false if platform == :macos # macOS no need adhoc
115
+
116
+ !development? && !adhoc? && !appstore?
117
+ end
118
+
119
+ # Enabled Capabilites
120
+ #
121
+ # Related link: https://developer.apple.com/support/app-capabilities/
122
+ def enabled_capabilities
123
+ capabilities = []
124
+ if adhoc? || appstore?
125
+ capabilities << 'In-App Purchase' << 'GameKit'
126
+ end
127
+
128
+ entitlements.each do |key, value|
129
+ case key
130
+ when 'aps-environment'
131
+ capabilities << 'Push Notifications'
132
+ when 'com.apple.developer.applesignin'
133
+ capabilities << 'Sign In with Apple'
134
+ when 'com.apple.developer.siri'
135
+ capabilities << 'SiriKit'
136
+ when 'com.apple.security.application-groups'
137
+ capabilities << 'App Groups'
138
+ when 'com.apple.developer.associated-domains'
139
+ capabilities << 'Associated Domains'
140
+ when 'com.apple.developer.default-data-protection'
141
+ capabilities << 'Data Protection'
142
+ when 'com.apple.developer.networking.networkextension'
143
+ capabilities << 'Network Extensions'
144
+ when 'com.apple.developer.networking.vpn.api'
145
+ capabilities << 'Personal VPN'
146
+ when 'com.apple.developer.healthkit', 'com.apple.developer.healthkit.access'
147
+ capabilities << 'HealthKit' unless capabilities.include?('HealthKit')
148
+ when 'com.apple.developer.icloud-services', 'com.apple.developer.icloud-container-identifiers'
149
+ capabilities << 'iCloud' unless capabilities.include?('iCloud')
150
+ when 'com.apple.developer.in-app-payments'
151
+ capabilities << 'Apple Pay'
152
+ when 'com.apple.developer.homekit'
153
+ capabilities << 'HomeKit'
154
+ when 'com.apple.developer.user-fonts'
155
+ capabilities << 'Fonts'
156
+ when 'com.apple.developer.pass-type-identifiers'
157
+ capabilities << 'Wallet'
158
+ when 'inter-app-audio'
159
+ capabilities << 'Inter-App Audio'
160
+ when 'com.apple.developer.networking.multipath'
161
+ capabilities << 'Multipath'
162
+ when 'com.apple.developer.authentication-services.autofill-credential-provider'
163
+ capabilities << 'AutoFill Credential Provider'
164
+ when 'com.apple.developer.networking.wifi-info'
165
+ capabilities << 'Access WiFi Information'
166
+ when 'com.apple.external-accessory.wireless-configuration'
167
+ capabilities << 'Wireless Accessory Configuration'
168
+ when 'com.apple.developer.kernel.extended-virtual-addressing'
169
+ capabilities << 'Extended Virtual Address Space'
170
+ when 'com.apple.developer.nfc.readersession.formats'
171
+ capabilities << 'NFC Tag Reading'
172
+ when 'com.apple.developer.ClassKit-environment'
173
+ capabilities << 'ClassKit'
174
+ when 'com.apple.developer.networking.HotspotConfiguration'
175
+ capabilities << 'Hotspot'
176
+ when 'com.apple.developer.devicecheck.appattest-environment'
177
+ capabilities << 'App Attest'
178
+ when 'com.apple.developer.coremedia.hls.low-latency'
179
+ capabilities << 'Low Latency HLS'
180
+ when 'com.apple.developer.associated-domains.mdm-managed'
181
+ capabilities << 'MDM Managed Associated Domains'
182
+ # macOS Only
183
+ when 'com.apple.developer.maps'
184
+ capabilities << 'Maps'
185
+ when 'com.apple.developer.system-extension.install'
186
+ capabilities << 'System Extension'
187
+ when 'com.apple.developer.networking.custom-protocol'
188
+ capabilities << 'Custom Network Protocol'
189
+ end
190
+ end
191
+
192
+ capabilities
193
+ end
194
+
59
195
  def [](key)
60
196
  mobileprovision.try(:[], key.to_s)
61
197
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AppInfo
4
- VERSION = '2.1.0'
4
+ VERSION = '2.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app-info
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.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: 2019-10-31 00:00:00.000000000 Z
11
+ date: 2020-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: CFPropertyList
@@ -116,16 +116,22 @@ dependencies:
116
116
  name: uuidtools
117
117
  requirement: !ruby/object:Gem::Requirement
118
118
  requirements:
119
- - - "~>"
119
+ - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: 2.1.5
122
+ - - "<"
123
+ - !ruby/object:Gem::Version
124
+ version: 2.3.0
122
125
  type: :runtime
123
126
  prerelease: false
124
127
  version_requirements: !ruby/object:Gem::Requirement
125
128
  requirements:
126
- - - "~>"
129
+ - - ">="
127
130
  - !ruby/object:Gem::Version
128
131
  version: 2.1.5
132
+ - - "<"
133
+ - !ruby/object:Gem::Version
134
+ version: 2.3.0
129
135
  - !ruby/object:Gem::Dependency
130
136
  name: bundler
131
137
  requirement: !ruby/object:Gem::Requirement
@@ -202,7 +208,7 @@ homepage: http://github.com/icyleaf/app-info
202
208
  licenses:
203
209
  - MIT
204
210
  metadata: {}
205
- post_install_message:
211
+ post_install_message:
206
212
  rdoc_options: []
207
213
  require_paths:
208
214
  - lib
@@ -217,8 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
217
223
  - !ruby/object:Gem::Version
218
224
  version: '0'
219
225
  requirements: []
220
- rubygems_version: 3.0.6
221
- signing_key:
226
+ rubygems_version: 3.0.3
227
+ signing_key:
222
228
  specification_version: 4
223
229
  summary: Teardown tool for mobile app(ipa/apk) and dSYM file, analysis metedata like
224
230
  version, name, icon