lib/app_info/apk.rb in app-info-2.1.1 vs lib/app_info/apk.rb in app-info-2.1.2
- old
+ new
@@ -52,12 +52,10 @@
def name
resource.find('@string/app_name')
end
-
-
def device_type
if wear?
Device::WATCH
elsif tv?
Device::TV
@@ -118,14 +116,14 @@
unless @icons
tmp_path = File.join(Dir.mktmpdir, "AppInfo-android-#{SecureRandom.hex}")
@icons = @apk.icon.each_with_object([]) do |(path, data), obj|
icon_name = File.basename(path)
- icon_path = File.join(tmp_path, File.path(path))
+ icon_path = File.join(tmp_path, File.dirname(path))
icon_file = File.join(icon_path, icon_name)
FileUtils.mkdir_p icon_path
File.open(icon_file, 'w') do |f|
- f.write data
+ f.write(data.force_encoding('BINARY'))
end
obj << {
name: icon_name,
file: icon_file,