read_ipa 0.2.0 → 0.2.1
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 +8 -11
- 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: 1f767230a21f560c346509d7c0676dd68de0324d
|
4
|
+
data.tar.gz: ea8e0a300c27f1d4395d41120f8866d54866a3c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ccf898d03ad4ebaa7d3f0bf328fde06cc3d28524ca93fb3517108c2a1eadc0bc39ce079bbc578cb9327352850c7d535a38a85c4294d307c6f1dd3f6c02eb507
|
7
|
+
data.tar.gz: 60a232032d4a8fa7c72f5da8cbc7e67af151eb6ed325ad1c9c6dca63fa0df8b4f941cf8a61646739838d8e8baeffa6e353db952274b525c8237aec9d2b2e71f8
|
data/lib/read_ipa.rb
CHANGED
@@ -58,13 +58,15 @@ module ReadIpa
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def get_highest_res_icon(icons_file_names)
|
61
|
-
|
61
|
+
icon_names = icons_file_names
|
62
62
|
.map{ |icon_path| find_existing_path(icon_path) }
|
63
63
|
.compact
|
64
64
|
.uniq(&:name)
|
65
|
+
highest_res_icon = icon_names
|
65
66
|
.map{|entry| entry.get_input_stream.read}
|
66
67
|
.max_by{|data| read_png(data).width }
|
67
68
|
|
69
|
+
return nil if highest_res_icon.nil?
|
68
70
|
begin
|
69
71
|
return ApplePng.new(highest_res_icon).data
|
70
72
|
rescue NotValidApplePngError
|
@@ -73,22 +75,17 @@ module ReadIpa
|
|
73
75
|
end
|
74
76
|
|
75
77
|
def icon_file
|
76
|
-
|
77
|
-
|
78
|
-
|
78
|
+
icon_files = [plist["CFBundleIconFile"]].compact
|
79
|
+
icon_files += plist["CFBundleIconFiles"] || []
|
80
|
+
if plist["CFBundleIcons"]
|
79
81
|
dict = plist["CFBundleIcons"]
|
80
82
|
primary_icons = dict["CFBundlePrimaryIcon"]
|
81
83
|
return nil unless primary_icons
|
82
84
|
icons = primary_icons.to_rb["CFBundleIconFiles"]
|
83
85
|
return nil unless icons
|
84
|
-
|
85
|
-
elsif plist["CFBundleIconFile"]
|
86
|
-
data = read_file(plist["CFBundleIconFile"])
|
87
|
-
png = ApplePng.new(data)
|
88
|
-
png.data
|
89
|
-
else
|
90
|
-
nil
|
86
|
+
icon_files += icons
|
91
87
|
end
|
88
|
+
get_highest_res_icon(icon_files)
|
92
89
|
end
|
93
90
|
|
94
91
|
def executable_file_name
|