ipa 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -0
- data/Gemfile +1 -2
- data/Gemfile.lock +11 -9
- data/Licence.txt +6 -0
- data/Rakefile +9 -0
- data/ipa.gemspec +6 -5
- data/lib/ipa.rb +43 -18
- data/lib/ipa/version.rb +1 -1
- data/test/fixtures/MockApp.ipa +0 -0
- data/test/fixtures/MockApp/Payload/MockApp.app/Info.plist +0 -0
- data/test/fixtures/MockApp/Payload/MockApp.app/Info.plist.xml +14 -0
- data/test/test_ipa.rb +39 -0
- metadata +29 -34
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 601bffa541c7faeb2631b61454d46d93f1cd6245
|
4
|
+
data.tar.gz: cc3483f6fc1ebd2f0beb8f91cd28b606cd657045
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cbff855594ad6ed3e2f6d8bebdcf81f1a3b7eb82b987cab7c3829538baf0d242d95df87750172df3652e8ef6977efe509f9f1cdf006cb0c376cfd8408400250f
|
7
|
+
data.tar.gz: 34a36839e314c6096205dd8244ed631b394588a830cc5861849d8759bce9bd2c89586eb0ec10f60137c2857d34bbb60a004675a6729060c56fa533e177e0c7b4
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,22 +1,24 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ipa (0.
|
5
|
-
CFPropertyList (~> 2.
|
6
|
-
rubyzip (~>
|
4
|
+
ipa (0.2.0)
|
5
|
+
CFPropertyList (~> 2.3)
|
6
|
+
rubyzip (~> 1.1)
|
7
7
|
|
8
8
|
GEM
|
9
|
-
remote:
|
9
|
+
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
CFPropertyList (2.
|
12
|
-
rake (
|
13
|
-
rubyzip (
|
11
|
+
CFPropertyList (2.3.1)
|
12
|
+
rake (10.4.2)
|
13
|
+
rubyzip (1.1.7)
|
14
14
|
|
15
15
|
PLATFORMS
|
16
16
|
ruby
|
17
17
|
|
18
18
|
DEPENDENCIES
|
19
|
-
|
20
|
-
bundler (>= 1.0.0)
|
19
|
+
bundler
|
21
20
|
ipa!
|
22
21
|
rake
|
22
|
+
|
23
|
+
BUNDLED WITH
|
24
|
+
1.10.6
|
data/Licence.txt
ADDED
@@ -0,0 +1,6 @@
|
|
1
|
+
I, the copyright holder of this work, hereby release it into the public domain.
|
2
|
+
This applies worldwide.
|
3
|
+
|
4
|
+
In case this is not legally possible: I grant anyone the right to use this work
|
5
|
+
for any purpose, without any conditions, unless such conditions are required by
|
6
|
+
law.
|
data/Rakefile
CHANGED
data/ipa.gemspec
CHANGED
@@ -5,8 +5,9 @@ Gem::Specification.new do |s|
|
|
5
5
|
s.name = 'ipa'
|
6
6
|
s.version = IPA::VERSION
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
|
-
s.authors = ['Sijmen
|
9
|
-
s.email = ['sjmulder
|
8
|
+
s.authors = ['Sijmen Mulder']
|
9
|
+
s.email = ['ik@sjmulder.nl']
|
10
|
+
s.license = 'Public Domain'
|
10
11
|
s.homepage = 'https://github.com/sjmulder/ipa'
|
11
12
|
s.summary = 'Reads metadata from IPA files'
|
12
13
|
s.description = 'Reads metadata from iPhone/iPad IPA files, such as title, version, and icon files.'
|
@@ -14,9 +15,9 @@ Gem::Specification.new do |s|
|
|
14
15
|
s.required_rubygems_version = '>= 1.3.6'
|
15
16
|
s.rubyforge_project = 'ipa'
|
16
17
|
|
17
|
-
|
18
|
-
|
19
|
-
s.add_development_dependency 'bundler', '
|
18
|
+
s.add_dependency 'rubyzip', '~> 1.1'
|
19
|
+
s.add_dependency 'CFPropertyList', '~> 2.3'
|
20
|
+
s.add_development_dependency 'bundler', '~> 0'
|
20
21
|
|
21
22
|
s.files = `git ls-files`.split("\n")
|
22
23
|
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
data/lib/ipa.rb
CHANGED
@@ -5,15 +5,17 @@ require 'cfpropertylist'
|
|
5
5
|
module IPA
|
6
6
|
class IPAFile
|
7
7
|
MAPPED_INFO_KEYS = {
|
8
|
-
:name
|
9
|
-
:display_name
|
10
|
-
:identifier
|
11
|
-
:icon_path
|
12
|
-
:icon_paths
|
13
|
-
:is_iphone
|
14
|
-
:app_category
|
15
|
-
:version
|
16
|
-
:version_string
|
8
|
+
:name => 'CFBundleName',
|
9
|
+
:display_name => 'CFBundleDisplayName',
|
10
|
+
:identifier => 'CFBundleIdentifier',
|
11
|
+
:icon_path => 'CFBundleIconFile',
|
12
|
+
:icon_paths => 'CFBundleIconFiles',
|
13
|
+
:is_iphone => 'LSRequiresIPhoneOS',
|
14
|
+
:app_category => 'LSApplicationCategoryType',
|
15
|
+
:version => 'CFBundleVersion',
|
16
|
+
:version_string => 'CFBundleShortVersionString',
|
17
|
+
:minimum_os_version => 'MinimumOSVersion',
|
18
|
+
:device_family => 'UIDeviceFamily'
|
17
19
|
}
|
18
20
|
|
19
21
|
MAPPED_INFO_KEYS.each do |method_name, key_name|
|
@@ -61,15 +63,38 @@ module IPA
|
|
61
63
|
@info_plist
|
62
64
|
end
|
63
65
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
66
|
+
# Note: The returned pngs are crushed by Apple during the ipa creation. To uncrush use:
|
67
|
+
# `xcrun -sdk iphoneos pngcrush -revert-iphone-optimizations crushed.png uncrushed.png`
|
68
|
+
def icons
|
69
|
+
paths = []
|
70
|
+
path_keys = ['CFBundleIcons', 'CFBundleIcons~ipad']
|
71
|
+
path_keys.each do |path_key|
|
72
|
+
icons = info && (info[path_key] &&
|
73
|
+
info[path_key]['CFBundlePrimaryIcon'] &&
|
74
|
+
(info[path_key]['CFBundlePrimaryIcon']['CFBundleIconFile'] ||
|
75
|
+
info[path_key]['CFBundlePrimaryIcon']['CFBundleIconFiles']))
|
76
|
+
paths.push(*icons)
|
77
|
+
end
|
78
|
+
|
79
|
+
paths << 'Icon.png' if paths.size == 0
|
80
|
+
|
81
|
+
unless paths.is_a?(Array)
|
82
|
+
paths = [paths]
|
83
|
+
end
|
84
|
+
|
85
|
+
paths = paths.map do |path|
|
86
|
+
begin
|
87
|
+
@zipfile.entries.entries.map { |e| File.basename(e.name) }.select { |name| name.start_with?(path) }
|
88
|
+
rescue Exception => e
|
89
|
+
STDERR.puts "\n\nException #{e}\n\n"
|
90
|
+
nil
|
91
|
+
end
|
92
|
+
end.flatten.compact.map do |path|
|
93
|
+
[path, Proc.new { payload_file(path) }]
|
94
|
+
end
|
95
|
+
|
96
|
+
Hash[paths]
|
97
|
+
end
|
73
98
|
|
74
99
|
def artwork
|
75
100
|
payload_file('iTunesArtwork')
|
data/lib/ipa/version.rb
CHANGED
Binary file
|
Binary file
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
3
|
+
<plist version="1.0">
|
4
|
+
<dict>
|
5
|
+
<key>CFBundleIdentifier</key>
|
6
|
+
<string>com.example.MockApp</string>
|
7
|
+
<key>CFBundleName</key>
|
8
|
+
<string>MockApp</string>
|
9
|
+
<key>CFBundleDisplayName</key>
|
10
|
+
<string>Mock App</string>
|
11
|
+
<key>LSRequiresIPhoneOS</key>
|
12
|
+
<true />
|
13
|
+
</dict>
|
14
|
+
</plist>
|
data/test/test_ipa.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'ipa'
|
3
|
+
|
4
|
+
include IPA
|
5
|
+
|
6
|
+
class IPAFileTest < Test::Unit::TestCase
|
7
|
+
IPA_PATH = 'test/fixtures/MockApp.ipa'
|
8
|
+
|
9
|
+
def test_ctor
|
10
|
+
ipa = IPAFile.new(IPA_PATH)
|
11
|
+
assert_not_nil(ipa)
|
12
|
+
ipa.close
|
13
|
+
end
|
14
|
+
|
15
|
+
def test_open
|
16
|
+
IPAFile.open(IPA_PATH) do |ipa|
|
17
|
+
assert_not_nil(ipa)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_info_dict
|
22
|
+
IPAFile.open(IPA_PATH) do |ipa|
|
23
|
+
assert_equal('MockApp', ipa.info['CFBundleName'])
|
24
|
+
assert_equal('Mock App', ipa.info['CFBundleDisplayName'])
|
25
|
+
assert_equal('com.example.MockApp', ipa.info['CFBundleIdentifier'])
|
26
|
+
assert(ipa.info['LSRequiresIPhoneOS'])
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_mapped_keys
|
31
|
+
IPAFile.open(IPA_PATH) do |ipa|
|
32
|
+
assert_equal('MockApp', ipa.name)
|
33
|
+
assert_equal('Mock App', ipa.display_name)
|
34
|
+
assert_equal('com.example.MockApp', ipa.identifier)
|
35
|
+
assert(ipa.is_iphone)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
metadata
CHANGED
@@ -1,104 +1,99 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ipa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
|
-
- Sijmen
|
7
|
+
- Sijmen Mulder
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2015-10-01 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rubyzip
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- - ~>
|
17
|
+
- - "~>"
|
20
18
|
- !ruby/object:Gem::Version
|
21
|
-
version:
|
19
|
+
version: '1.1'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- - ~>
|
24
|
+
- - "~>"
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
26
|
+
version: '1.1'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: CFPropertyList
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- - ~>
|
31
|
+
- - "~>"
|
36
32
|
- !ruby/object:Gem::Version
|
37
|
-
version: 2.
|
33
|
+
version: '2.3'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- - ~>
|
38
|
+
- - "~>"
|
44
39
|
- !ruby/object:Gem::Version
|
45
|
-
version: 2.
|
40
|
+
version: '2.3'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: bundler
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - "~>"
|
52
46
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
47
|
+
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - "~>"
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
54
|
+
version: '0'
|
62
55
|
description: Reads metadata from iPhone/iPad IPA files, such as title, version, and
|
63
56
|
icon files.
|
64
57
|
email:
|
65
|
-
- sjmulder
|
58
|
+
- ik@sjmulder.nl
|
66
59
|
executables: []
|
67
60
|
extensions: []
|
68
61
|
extra_rdoc_files: []
|
69
62
|
files:
|
70
|
-
- .gitignore
|
63
|
+
- ".gitignore"
|
71
64
|
- Gemfile
|
72
65
|
- Gemfile.lock
|
66
|
+
- Licence.txt
|
73
67
|
- Rakefile
|
74
68
|
- ipa.gemspec
|
75
69
|
- lib/ipa.rb
|
76
70
|
- lib/ipa/version.rb
|
71
|
+
- test/fixtures/MockApp.ipa
|
72
|
+
- test/fixtures/MockApp/Payload/MockApp.app/Info.plist
|
73
|
+
- test/fixtures/MockApp/Payload/MockApp.app/Info.plist.xml
|
74
|
+
- test/test_ipa.rb
|
77
75
|
homepage: https://github.com/sjmulder/ipa
|
78
|
-
licenses:
|
76
|
+
licenses:
|
77
|
+
- Public Domain
|
78
|
+
metadata: {}
|
79
79
|
post_install_message:
|
80
80
|
rdoc_options: []
|
81
81
|
require_paths:
|
82
82
|
- lib
|
83
83
|
required_ruby_version: !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
85
84
|
requirements:
|
86
|
-
- -
|
85
|
+
- - ">="
|
87
86
|
- !ruby/object:Gem::Version
|
88
87
|
version: '0'
|
89
|
-
segments:
|
90
|
-
- 0
|
91
|
-
hash: 1781569824872270545
|
92
88
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
-
none: false
|
94
89
|
requirements:
|
95
|
-
- -
|
90
|
+
- - ">="
|
96
91
|
- !ruby/object:Gem::Version
|
97
92
|
version: 1.3.6
|
98
93
|
requirements: []
|
99
94
|
rubyforge_project: ipa
|
100
|
-
rubygems_version:
|
95
|
+
rubygems_version: 2.2.2
|
101
96
|
signing_key:
|
102
|
-
specification_version:
|
97
|
+
specification_version: 4
|
103
98
|
summary: Reads metadata from IPA files
|
104
99
|
test_files: []
|