diff --git a/lib/android_apk.rb b/lib/android_apk.rb index 3e3be8a..606d699 100644 --- a/lib/android_apk.rb +++ b/lib/android_apk.rb @@ -161,10 +161,8 @@ def icon_file(dpi = nil, want_png = false) icon.gsub! %r{res/(drawable|mipmap)/([^/]+)\.xml}, "res/\\1-#{dpis}-v4/\\2.png" end - # we cannot prepare for any fallbacks - if want_png && icon.end_with?(".xml") - return nil - end + # we cannot prepare for any fallbacks but don't return nil for now to keep the behavior + # if want_png && icon.end_with?(".xml") Dir.mktmpdir do |dir| output_to = File.join(dir, icon) @@ -175,7 +173,7 @@ def icon_file(dpi = nil, want_png = false) content = zip_file.find_entry(icon)&.get_input_stream&.read return nil if content.nil? - File.open(output_to, "w") do |f| + File.open(output_to, "wb") do |f| f.write(content) end end