pprof 0.3.2 → 0.3.4
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 +4 -4
- data/README.md +6 -2
- data/lib/pprof/entitlements.rb +39 -2
- data/lib/pprof/output_formatter.rb +11 -0
- data/lib/pprof/provisioning_profile.rb +53 -3
- data/lib/pprof/version.rb +2 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e19ab5781df3a2fe5ddd41e85b937da9134941a
|
4
|
+
data.tar.gz: ec74aa8ec2cd3341756d38ab617839cb259d87ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd233c67e41648c601af8a57ae712a2ad32dfbd8912ba71d062633afbb6dbddeadc32161d9f5d929213c4479dfe8a0479c38c10d42d9bd6485477a28754df261
|
7
|
+
data.tar.gz: df20d443af778ba98a8b44d44927a994dd94d97536369bfba77580e8740787c1a9ab593938a4000cf6ad6a667f18e42ab43a9f7ed5310a400dfecf95983e1e6c
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[](https://twitter.com/aligatr)
|
4
4
|
[](https://github.com/AliSoftware/pprof/blob/master/LICENSE)
|
5
|
+
[](https://badge.fury.io/rb/pprof)
|
5
6
|
|
6
7
|
`pprof` is a ruby library and binary to manipulate Provisioning Profiles.
|
7
8
|
|
@@ -11,8 +12,11 @@ It can help you create ruby scripts to list, get information, find and filter Pr
|
|
11
12
|
|
12
13
|
### Rubygems
|
13
14
|
|
14
|
-
|
15
|
-
|
15
|
+
```sh
|
16
|
+
$ gem install pprof
|
17
|
+
```
|
18
|
+
|
19
|
+
_(You might need to run this command with `sudo` if your gem home is a system directory)_
|
16
20
|
|
17
21
|
### Build from source
|
18
22
|
|
data/lib/pprof/entitlements.rb
CHANGED
@@ -1,60 +1,90 @@
|
|
1
|
+
# Module for the pprof tool to manipulate Provisioning Profiles
|
1
2
|
module PProf
|
3
|
+
# Represents the list of entitlements in a Provisioning Profile
|
2
4
|
class Entitlements
|
5
|
+
# Create a new Entitlements object from the hash representation
|
6
|
+
# extracted from the Provisioning Profile
|
7
|
+
#
|
8
|
+
# @param [Hash] dict
|
9
|
+
# The hash representation of the entitlements, typically
|
10
|
+
# extracted from the Provisioning Profile.
|
3
11
|
def initialize(dict)
|
4
12
|
@dict = dict
|
5
13
|
end
|
6
14
|
|
15
|
+
# The list of Keychain Access Groups
|
16
|
+
#
|
7
17
|
# @return [Array<String>]
|
8
18
|
def keychain_access_groups
|
9
19
|
@dict['keychain-access-groups']
|
10
20
|
end
|
11
21
|
|
22
|
+
# The status of the `get-task-allow` flag.
|
23
|
+
# True if we can attach a debugger to the executable, false if not.
|
24
|
+
#
|
12
25
|
# @return [Bool]
|
13
26
|
def get_task_allow
|
14
27
|
@dict['get-task-allow']
|
15
28
|
end
|
16
29
|
|
30
|
+
# The full application identifier (including the team prefix), as specified in the entitlements
|
31
|
+
#
|
17
32
|
# @return [String]
|
18
33
|
def app_id
|
19
34
|
@dict['application-identifier']
|
20
35
|
end
|
21
36
|
|
37
|
+
# The Team Identifier
|
38
|
+
#
|
22
39
|
# @return [String]
|
23
40
|
def team_id
|
24
41
|
@dict['com.apple.developer.team-identifier']
|
25
42
|
end
|
26
43
|
|
44
|
+
# The Apple Push Service environment used for push notifications.
|
45
|
+
# Typically either 'development' or 'production', or `nil` if push isn't enabled.
|
46
|
+
#
|
27
47
|
# @return [String]
|
28
48
|
def aps_environment
|
29
49
|
@dict['aps-environment']
|
30
50
|
end
|
31
51
|
|
52
|
+
# The Application Groups registered in the entitlements
|
53
|
+
#
|
32
54
|
# @return [Array<String>]
|
33
55
|
def app_groups
|
34
56
|
@dict['com.apple.security.application-groups']
|
35
57
|
end
|
36
58
|
|
59
|
+
# Are Beta (TestFlight) reports active?
|
60
|
+
#
|
37
61
|
# @return [Bool]
|
38
62
|
def beta_reports_active
|
39
63
|
@dict['beta-reports-active']
|
40
64
|
end
|
41
65
|
|
66
|
+
# True if the HealthKit entitlement is set
|
67
|
+
#
|
42
68
|
# @return [Bool]
|
43
69
|
def healthkit
|
44
70
|
@dict['com.apple.developer.healthkit']
|
45
71
|
end
|
46
72
|
|
73
|
+
# The Ubiquity Container identifiers, if at least one is enabled
|
74
|
+
#
|
47
75
|
# @return [Array<String>]
|
48
76
|
def ubiquity_container_identifiers
|
49
77
|
@dict['com.apple.developer.ubiquity-container-identifiers']
|
50
78
|
end
|
51
79
|
|
80
|
+
# The Ubiquity Key-Value Store Identifier, if enabled.
|
81
|
+
#
|
52
82
|
# @return [String]
|
53
83
|
def ubiquity_kvstore_identifier
|
54
84
|
@dict['com.apple.developer.ubiquity-kvstore-identifier']
|
55
85
|
end
|
56
86
|
|
57
|
-
#
|
87
|
+
# Generic access to any entitlement by key
|
58
88
|
#
|
59
89
|
# @param [#to_s] key
|
60
90
|
# The entitlement key to read
|
@@ -72,7 +102,7 @@ module PProf
|
|
72
102
|
@dict.has_key?(key.to_s)
|
73
103
|
end
|
74
104
|
|
75
|
-
# The list of entitlement keys as String
|
105
|
+
# The list of all entitlement keys, as String
|
76
106
|
#
|
77
107
|
# @return [Array<String>]
|
78
108
|
#
|
@@ -80,10 +110,17 @@ module PProf
|
|
80
110
|
@dict.keys.map(&:to_s)
|
81
111
|
end
|
82
112
|
|
113
|
+
# The hash representation of the entitlements (as represented in their PLIST form)
|
114
|
+
#
|
115
|
+
# @return [Hash]
|
83
116
|
def to_hash
|
84
117
|
@dict
|
85
118
|
end
|
86
119
|
|
120
|
+
# The pretty-printed list of all entitlement keys and values
|
121
|
+
# (as a multi-line dashed list for human reading)
|
122
|
+
#
|
123
|
+
# @return [String]
|
87
124
|
def to_s
|
88
125
|
@dict.map do |key, value|
|
89
126
|
"- #{key}: #{value}"
|
@@ -1,4 +1,6 @@
|
|
1
|
+
# Module for the pprof tool to manipulate Provisioning Profiles
|
1
2
|
module PProf
|
3
|
+
# A helper tool to pretty-print Provisioning Profile informations
|
2
4
|
class OutputFormatter
|
3
5
|
# Initialize a new OutputFormatter
|
4
6
|
#
|
@@ -12,16 +14,25 @@ module PProf
|
|
12
14
|
|
13
15
|
# A small helper to print ASCII tables
|
14
16
|
class ASCIITable
|
17
|
+
# Create a new ASCII table
|
18
|
+
#
|
19
|
+
# @param [Int...] widths
|
20
|
+
# The list of width for each colum of the table
|
15
21
|
def initialize(*widths)
|
16
22
|
@widths = widths
|
17
23
|
end
|
18
24
|
|
25
|
+
# Add a new row to the ASCII table
|
26
|
+
#
|
27
|
+
# @param [String...] cols
|
28
|
+
# The content of each column of the row to add
|
19
29
|
def row(*cols)
|
20
30
|
'| ' + cols.zip(@widths).map do |c,w|
|
21
31
|
(c || '<nil>').to_s.ljust(w)[0...w]
|
22
32
|
end.join(' | ') + ' |'
|
23
33
|
end
|
24
34
|
|
35
|
+
# Add a separator line to the ASCII table
|
25
36
|
def separator
|
26
37
|
'+' + @widths.map { |w| '-' * (w+2) }.join('+') + '+'
|
27
38
|
end
|
@@ -2,10 +2,22 @@ require 'openssl'
|
|
2
2
|
require 'plist'
|
3
3
|
require 'time'
|
4
4
|
|
5
|
+
# Module for the pprof tool to manipulate Provisioning Profiles
|
5
6
|
module PProf
|
7
|
+
# Represents the content of a Provisioning Profile file
|
6
8
|
class ProvisioningProfile
|
9
|
+
# The default location where all the Provisioning Profiles are stored on a Mac
|
7
10
|
DEFAULT_DIR="#{ENV['HOME']}/Library/MobileDevice/Provisioning Profiles"
|
8
11
|
|
12
|
+
# Create a new ProvisioningProfile object from a file path or UUID
|
13
|
+
#
|
14
|
+
# - If the parameter given has the form of an UUID, a file named with this UUID
|
15
|
+
# and a `.mobileprovision` is searched in the default directory `DEFAULT_DIR`
|
16
|
+
# - Otherwise, the parameter is interpreted as a file path
|
17
|
+
#
|
18
|
+
# @param [String] file
|
19
|
+
# File path or UUID of the ProvisioningProfile
|
20
|
+
#
|
9
21
|
def initialize(file)
|
10
22
|
if file =~ %r/^[0-9A-F-]*$/i
|
11
23
|
path = "#{PProf::ProvisioningProfile::DEFAULT_DIR}/#{file}.mobileprovision"
|
@@ -17,77 +29,115 @@ module PProf
|
|
17
29
|
@plist = Plist::parse_xml(pkcs7.data)
|
18
30
|
end
|
19
31
|
|
32
|
+
# The name of the Provisioning Profile
|
33
|
+
#
|
20
34
|
# @return [String]
|
21
35
|
def name
|
22
36
|
@plist['Name']
|
23
37
|
end
|
24
38
|
|
39
|
+
# The UUID of the Provisioning Profile
|
40
|
+
#
|
25
41
|
# @return [String]
|
26
42
|
def uuid
|
27
43
|
@plist['UUID']
|
28
44
|
end
|
29
45
|
|
46
|
+
# The name of the Application Identifier associated with this Provisioning Profile
|
47
|
+
#
|
48
|
+
# @note This is not the AppID itself, but rather the name you associated to that
|
49
|
+
# AppID in your Developer Portal
|
50
|
+
#
|
30
51
|
# @return [String]
|
31
52
|
def app_id_name
|
32
53
|
@plist['AppIDName']
|
33
54
|
end
|
34
55
|
|
56
|
+
# The AppID prefix (which is typically the ID of the team)
|
57
|
+
#
|
35
58
|
# @return [String]
|
36
59
|
def app_id_prefix
|
37
60
|
@plist['ApplicationIdentifierPrefix']
|
38
61
|
end
|
39
62
|
|
63
|
+
# The Creation date of this Provisioning Profile
|
64
|
+
#
|
40
65
|
# @return [DateTime]
|
41
66
|
def creation_date
|
42
67
|
@plist['CreationDate']
|
43
68
|
end
|
44
69
|
|
70
|
+
# The expiration date of this Provisioning Profile
|
71
|
+
#
|
45
72
|
# @return [DateTime]
|
46
73
|
def expiration_date
|
47
74
|
@plist['ExpirationDate']
|
48
75
|
end
|
49
76
|
|
77
|
+
# The Time-To-Live of this Provisioning Profile
|
50
78
|
# @return [Int]
|
51
79
|
def ttl
|
52
80
|
@plist['TimeToLive'].to_i
|
53
81
|
end
|
54
82
|
|
83
|
+
# The Team IDs associated with this Provisioning Profile
|
84
|
+
#
|
85
|
+
# @note typically Provisioning Profiles contain only one team
|
86
|
+
#
|
55
87
|
# @return [Array<String>]
|
56
88
|
def team_ids
|
57
89
|
@plist['TeamIdentifier']
|
58
90
|
end
|
59
91
|
|
92
|
+
# The name of the Team associated with this Provisioning Profile
|
93
|
+
#
|
60
94
|
# @return [String]
|
61
95
|
def team_name
|
62
96
|
@plist['TeamName']
|
63
97
|
end
|
64
98
|
|
65
|
-
#
|
99
|
+
# The list of X509 Developer Certifiates associated with this profile
|
100
|
+
#
|
101
|
+
# @return [Array<OpenSSL::X509::Certificate>]
|
66
102
|
def developer_certificates
|
67
103
|
@plist['DeveloperCertificates'].map do |data|
|
68
104
|
OpenSSL::X509::Certificate.new(data.string)
|
69
105
|
end
|
70
106
|
end
|
71
107
|
|
72
|
-
#
|
108
|
+
# All the entitlements associated with this Provisioning Profile
|
109
|
+
#
|
110
|
+
# @return [Entitlements]
|
73
111
|
def entitlements
|
74
112
|
PProf::Entitlements.new(@plist['Entitlements'])
|
75
113
|
end
|
76
114
|
|
77
|
-
#
|
115
|
+
# The list of devices provisioned with this Provisioning Profile (if any)
|
116
|
+
#
|
117
|
+
# @return [Array<String>]
|
78
118
|
def provisioned_devices
|
79
119
|
@plist['ProvisionedDevices']
|
80
120
|
end
|
81
121
|
|
122
|
+
# Indicates if this Provisioning Profile is provisioned for all devices
|
123
|
+
# or only for a list of some specific devices
|
124
|
+
#
|
82
125
|
# @return [Bool]
|
83
126
|
def provisions_all_devices
|
84
127
|
@plist['ProvisionsAllDevices'] || false
|
85
128
|
end
|
86
129
|
|
130
|
+
# The hash representation of this Provisioning Profile
|
131
|
+
#
|
132
|
+
# @return [Hash]
|
87
133
|
def to_hash
|
88
134
|
@dict
|
89
135
|
end
|
90
136
|
|
137
|
+
# The human-readable string representation of this Provisioning Profile
|
138
|
+
# Typically suitable for printing this Provisioning Profile information to the user.
|
139
|
+
#
|
140
|
+
# @return [String]
|
91
141
|
def to_s
|
92
142
|
lines = [:name, :uuid, :app_id_name, :app_id_prefix, :creation_date, :expiration_date, :ttl, :team_ids, :team_name].map do |key|
|
93
143
|
"- #{key.to_s}: #{self.send(key.to_sym)}"
|
data/lib/pprof/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pprof
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Halligon
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plist
|
@@ -39,7 +39,7 @@ files:
|
|
39
39
|
- lib/pprof/output_formatter.rb
|
40
40
|
- lib/pprof/provisioning_profile.rb
|
41
41
|
- lib/pprof/version.rb
|
42
|
-
homepage:
|
42
|
+
homepage: https://github.com/AliSoftware/pprof
|
43
43
|
licenses:
|
44
44
|
- MIT
|
45
45
|
metadata: {}
|