read_ipa 0.4.0 → 2.2.0

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
- SHA1:
3
- metadata.gz: 5f77d10d88be1217e43ed2934d6e83d1bd9f2948
4
- data.tar.gz: c82f96350fdb74d33629a34bfd4933004dc01124
2
+ SHA256:
3
+ metadata.gz: 9c09babdbd70e8d8d06ec57c7d2b96fd2bb05539623db2a31d282b8a70dbee94
4
+ data.tar.gz: 99c5b8ae87c6acc8300cbc203df69b7950bc5ac1bb8882097c64912d55d91e76
5
5
  SHA512:
6
- metadata.gz: 45e9cde048ed37107071a3d8293a7ceabc39b86b4e21c4e74797e63b8952214a3fd81f50c6d8ac59d0b5d2c1ec691730e8ba964614240d1dd917c99033061c31
7
- data.tar.gz: 73dc1348435ae2c132eb75fce510b68e20a7c303136510d25328885b957d835128127a48dd7fc871c97ffbc96cb8b54e99577ca77d83f4e27eb7c502f2953b9f
6
+ metadata.gz: 05db356113ebda7f383220f49d0fe9401a5128db9d814e50100741272b2bfcad693df180996d87520e224fb3f1f7b75adb4ffa9da142cc3f32d80f36353dfba4
7
+ data.tar.gz: 170ef1c97837fa047d428dc88313e472063fe059009335888f9b1dce0bef81e20a6f2bb84892c8ce767672aa751c28c998a99ee707a42b64538ea79cd01c4464
data/README.md CHANGED
@@ -29,10 +29,8 @@ irb > ipa_file.icon_prerendered
29
29
 
30
30
  ## Supported ruby versions
31
31
 
32
- * 1.9 **NOT SUPPORTED**
33
- * 2.0
34
- * 2.1
35
- * 2.2
32
+ * \>= 2.3.0
33
+ * \>= 3.0.0
36
34
 
37
35
  ## INSTALL
38
36
 
@@ -19,19 +19,15 @@ module ReadIpa
19
19
  end
20
20
 
21
21
  def target_os_version
22
- @plist["DTPlatformVersion"].match(/[\d\.]*/)[0]
22
+ @plist["DTPlatformVersion"].match(/[\d\.]*/)[0] if @plist["DTPlatformVersion"]
23
23
  end
24
24
 
25
25
  def minimum_os_version
26
- @plist["MinimumOSVersion"].match(/[\d\.]*/)[0]
26
+ @plist["MinimumOSVersion"].match(/[\d\.]*/)[0] if @plist["MinimumOSVersion"]
27
27
  end
28
28
 
29
29
  def url_schemes
30
- if @plist["CFBundleURLTypes"] && @plist["CFBundleURLTypes"][0] && @plist["CFBundleURLTypes"][0]["CFBundleURLSchemes"]
31
- @plist["CFBundleURLTypes"][0]["CFBundleURLSchemes"]
32
- else
33
- []
34
- end
30
+ @plist.dig('CFBundleURLTypes', 0, 'CFBundleURLSchemes') || []
35
31
  end
36
32
 
37
33
  def icon_files
@@ -61,15 +57,22 @@ module ReadIpa
61
57
  end
62
58
 
63
59
  def for_ipad?
64
- return true if @plist["UIDeviceFamily"] && (@plist["UIDeviceFamily"] == 2 || @plist["UIDeviceFamily"].include?(2))
65
- return true if @plist["UIDeviceFamily"] && (@plist["UIDeviceFamily"] == "2" || @plist["UIDeviceFamily"].include?("2"))
60
+ return false if @plist["UIDeviceFamily"].nil?
61
+ if @plist["UIDeviceFamily"].kind_of?(Array)
62
+ return true if @plist["UIDeviceFamily"] && (@plist["UIDeviceFamily"].include?(2) || @plist["UIDeviceFamily"].include?("2"))
63
+ else
64
+ return true if @plist["UIDeviceFamily"] && (@plist["UIDeviceFamily"] == 2 || @plist["UIDeviceFamily"] == "2")
65
+ end
66
66
  return false
67
67
  end
68
68
 
69
69
  def for_iphone?
70
- return true if @plist["UIDeviceFamily"]
71
- return true if @plist["UIDeviceFamily"] == 1 || @plist["UIDeviceFamily"].include?(1)
72
- return true if @plist["UIDeviceFamily"] == "1" || @plist["UIDeviceFamily"].include?("1")
70
+ return true if @plist["UIDeviceFamily"].nil?
71
+ if @plist["UIDeviceFamily"].kind_of?(Array)
72
+ return true if @plist["UIDeviceFamily"].include?(1) || @plist["UIDeviceFamily"].include?("1")
73
+ else
74
+ return true if @plist["UIDeviceFamily"] == 1 || @plist["UIDeviceFamily"] == "1"
75
+ end
73
76
  return false
74
77
  end
75
78
  end
@@ -9,18 +9,9 @@ module ReadIpa
9
9
  attr_accessor :plist, :file_path
10
10
  def initialize(file_path)
11
11
  self.file_path = file_path
12
+ @app_folder = get_app_folder
12
13
  @zipfile = Zip::File.open(file_path)
13
- @zipfile.each do |entry|
14
- if /.*\.app\/Info\.plist$/ =~ entry.to_s
15
- @app_folder = entry.to_s.gsub(/Info\.plist$/, '')
16
- break
17
- end
18
- end
19
- if @app_folder.nil?
20
- raise "Could not identify Main app Folder"
21
- end
22
-
23
- plist_str = @zipfile.read(@app_folder + "Info.plist")
14
+ plist_str = @zipfile.read(@app_folder + 'Info.plist')
24
15
  @info_plist = InfoPlist.new(plist_str)
25
16
 
26
17
  cf_plist = CFPropertyList::List.new(data: plist_str, format: CFPropertyList::List::FORMAT_AUTO)
@@ -88,6 +79,19 @@ module ReadIpa
88
79
  read_file(executable_file_name)
89
80
  end
90
81
 
82
+ def get_app_folder
83
+ plist_path = nil
84
+ Zip::File.foreach(file_path) do |entry|
85
+ if /.*\.app\/Info\.plist$/ =~ entry.to_s
86
+ plist_path = entry
87
+ break
88
+ end
89
+ end
90
+ app_folder = plist_path.to_s.gsub(/Info\.plist$/, '')
91
+ raise "Could not identify Main app Folder" if app_folder.nil?
92
+ app_folder
93
+ end
94
+
91
95
  def mobile_provision_file
92
96
  read_file("embedded.mobileprovision")
93
97
  end
@@ -24,7 +24,7 @@ module CFPropertyList
24
24
  class CFArray
25
25
  def to_hash
26
26
  hash_data = []
27
- value.each do |obj|
27
+ value.compact.each do |obj|
28
28
  hash_data << obj.to_hash
29
29
  end
30
30
  hash_data
@@ -1,4 +1,4 @@
1
- require 'minitest/autorun'
1
+ require 'test_helper'
2
2
  require 'digest'
3
3
  require 'read_ipa'
4
4
 
@@ -45,7 +45,7 @@ class ReadIpaTest < Minitest::Test
45
45
  end
46
46
 
47
47
  def test_icon
48
- assert_equal("56b1eecad1cb7046b2e944dcd90fa74b77187f2cb4c766d7bb328ad86c37ca04",
48
+ assert_equal("3e4ed7f5a30280009fac972f8d4c90d2a91f46b94e7d687a20b8bfedad5ab62a",
49
49
  Digest::SHA256::hexdigest(@ipa_file.icon_file))
50
50
  end
51
51
 
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: read_ipa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marvin Killing
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-24 00:00:00.000000000 Z
11
+ date: 2022-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: minitest
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: minitest
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -39,47 +39,47 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: rubyzip
42
+ name: simplecov
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '1.0'
48
- type: :runtime
47
+ version: '0'
48
+ type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '1.0'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: CFPropertyList
56
+ name: apple_png
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: 2.1.1
61
+ version: 0.3.0
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: 2.1.1
68
+ version: 0.3.0
69
69
  - !ruby/object:Gem::Dependency
70
- name: apple_png
70
+ name: CFPropertyList
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.3
75
+ version: '3.0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.1.3
82
+ version: '3.0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: chunky_png
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubyzip
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '1.0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '1.0'
111
125
  description: Extract metadata from iOS packages such as the app name, the app icons
112
126
  or the binary file. This is a diverging fork of github.com/schlu/Ipa-Reader.
113
127
  email: marvinkilling@gmail.com
@@ -126,24 +140,23 @@ homepage: https://github.com/playtestcloud/read_ipa
126
140
  licenses:
127
141
  - MIT
128
142
  metadata: {}
129
- post_install_message:
143
+ post_install_message:
130
144
  rdoc_options: []
131
145
  require_paths:
132
146
  - lib
133
147
  required_ruby_version: !ruby/object:Gem::Requirement
134
148
  requirements:
135
- - - "~>"
149
+ - - ">="
136
150
  - !ruby/object:Gem::Version
137
- version: '2'
151
+ version: '2.3'
138
152
  required_rubygems_version: !ruby/object:Gem::Requirement
139
153
  requirements:
140
154
  - - ">="
141
155
  - !ruby/object:Gem::Version
142
156
  version: '0'
143
157
  requirements: []
144
- rubyforge_project:
145
- rubygems_version: 2.4.6
146
- signing_key:
158
+ rubygems_version: 3.2.32
159
+ signing_key:
147
160
  specification_version: 4
148
161
  summary: Read metadata from iOS IPA package files
149
162
  test_files: