read_ipa 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/read_ipa.rb +12 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2a7646019ea6e7252423c51d1547fcced1825b1
|
4
|
+
data.tar.gz: 7b994e0ad60aa6de7f31af351af733409f563a9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62ec5b5ac54ddf38dae995edb2a224767876d2c0279e1c96a1d7f899f8cc6cc90dae3956ed5285816b2712f67496a0219495f5f11dd79e98bd32f3d032b26691
|
7
|
+
data.tar.gz: 075366d953eaabc281fe3435ab3a7c5d0a3a0c22554a3697d82cab222cff57050ca9c539d99e9eaf1e7d6adb3457358ceccaeca2579c07a799c8947779c3b5fa
|
data/lib/read_ipa.rb
CHANGED
@@ -57,10 +57,12 @@ module ReadIpa
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
def get_highest_res_icon(
|
61
|
-
highest_res_icon =
|
62
|
-
.map{ |icon_path| icon_path
|
63
|
-
.
|
60
|
+
def get_highest_res_icon(icons_file_names)
|
61
|
+
highest_res_icon = icons_file_names
|
62
|
+
.map{ |icon_path| find_existing_path(icon_path) }
|
63
|
+
.compact
|
64
|
+
.uniq(&:name)
|
65
|
+
.map{|entry| entry.get_input_stream.read}
|
64
66
|
.max_by{|data| read_png(data).width }
|
65
67
|
|
66
68
|
begin
|
@@ -122,6 +124,12 @@ module ReadIpa
|
|
122
124
|
return false
|
123
125
|
end
|
124
126
|
|
127
|
+
def find_existing_path(icon_path)
|
128
|
+
without_extension = icon_path.gsub(/\.png$/i, '')
|
129
|
+
regex = /#{Regexp.quote(@app_folder)}#{Regexp.quote(without_extension)}[(\.png)@~]/
|
130
|
+
@zipfile.entries.find{|e| e.name =~ regex}
|
131
|
+
end
|
132
|
+
|
125
133
|
private
|
126
134
|
|
127
135
|
def read_file(entry)
|